bugfix bug fix

Bugfix Pack

Short Name: 

A passive-aggressive addon that compiles various bug fixes.

Bugs fixed by this addon

Antimagic Shield retaliation turn proc limit

Antimagic Shield is supposed to only retaliate a maximum of 10 times per turn, but the value used for this is incremented too late, which can result in indefinite (and potentially infinite) recursion in the presence of damage reflection or martyrdom effects, such as Empathic Hex.
This addon fixes this so that Antimagic Shield really can't retaliate more than 10 times per turn.

Early equilibrium failures

Equilibrium failures apply before targeting targeted talents, instead of after. In addition to slowing down your inputs, this penalizes you for canceling targeted equilibrium talents. This addon fixes this so that equilibrium-based talents check for failure after targeting, not before.
Note: this only applies to vanilla equilibrium talents; equilibrium-based talents from other addons are currently unaffected.

Free mind crits with Wyrmic Talents

If Ice Wall or Wing Buffet is targeted at an unreachable position, it cancels the talent but still does a mind crit. This can be used to instantly regenerate psi or hate, decrease cooldowns with Eye of the Tiger, etc. This addon fixes this.

Blast and Wing Buffet hitting multiple times

Blast and Wing Buffet perform knockback during projection, which can cause the same target to be hit multiple times, depending on the order that squares are iterated over. This addon fixes these talents by performing the knockback after the projection instead of during it.


Overkill fails to mark itself as the source of its damage, ignores the overkill victim's inc_damage instead of the source's, projects its damage prematurely, and has an overzealous recursion guard that prevents it from working more than once per turn, resulting in bizarre behaviour when using AoE spells. This addon fixes all of these bugs.

Real-time Meteors

In vanilla ToME4, actors can dodge meteors (Meteoric Crash, Meteor Rain, Rain of Fire, etc) by moving out of the way within 1/6th of a second, realtime. This addon fixes this behaviour, making the game properly turn-based once again.

Note: Unfortunately, this won't fix third-party addons that use this terrible behaviour (I hope none exist).

Reckless Strike self-kill

Reckless Strike improper handling of damage shields

It is possible for Reckless Strike to kill you if you attack an enemy with any sort of retaliation, due to the self-damage cap being terribly implemented. It also does not interact with the user's damage shields correctly. This addon fixes this behaviour, and makes Reckless Strike always damage you for 30% of your current HP.

Sustainbug for some talents

"Sustainbug" refers to the snapshotting that is possible with most sustains and some passives. See http://forums.te4.org/viewtopic.php?f=42&t=48178 .
This addon currently fixes it for the following talents:
- Abyssal Shield (NOTE: melee retaliation removed)
- Aim
- Antimagic Shield
- Blood Fury
- Bone Shield
- Corrosive Slashes
- Dark Ritual
- Defensive Posture
- Flame of Urh'Rok (NOTE: Resistances changed to no longer depend on spellpower)
- Infestation
- Overkill
- Precise Strikes
- Striking Stance
- Willful Tormenter


This addon OVERLOADS the following files:

This addon uses the ToME:load hook to overwrite the following functions:
- Abyssal Shield's activate
- Abyssal Shield's deactivate
- Abyssal Shield's info
- Aim's activate
- Aim's deactivate
- Antimagic Shield's on_damage
- Blast's action
- Blood Fury's activate
- Blood Fury's deactivate
- Bone Shield's callbackOnActBase
- Corrosive Slashes's activate
- Defensive Posture's activate
- Defensive Posture's deactivate
- Anomaly Meteor's action
- Flame of Urh'Rok's action
- Flame of Urh'Rok's info
- Meteor Rain's action
- Meteoric Crash's trigger
- Overkill's activate
- Overkill's deactivate
- Precise Strikes's activate
- Precise Strikes's deactivate
- Rain of Fire's callbackOnActBase
- Reckless Strike's action
- Reckless Strike's info
- Targeted equilibrium talents' actions: Mana Clash, Nature's Touch, Ice Claw, Ice Wall, Ice Breath, Acidbeam, Corrosive Seeds, Elemental Split, Rockwalk, Rockswallow, Reclaim, Acidfire, Wing Buffet, Devouring Flame, Fire Breath, Prismatic Slash, Venomous Breath, Thorn Grab, Nature's Equilibrium, Acid Splash, both Slime Spits, Oozewalk, Oozebeam, Mind Parasite, Swallow, Sand Breath, Poisonous Spores, both Slime Roots, Tornado, both Lightning Breaths, Rage, Detonate, Phase Summon, Flamespit, Acid Breath, Poison Breath, Ritch Flamespitter, Hydra, Rimebark, Fire Drake, War Hound, Jelly, Minotaur, Stone Golem, Turtle, Spider and its web, Acidic Spray, Dissolve, Corrosive Breath, Eldritch Blow, Eldritch Fury, Eldritch Spikes, Tentacle Grab, Ooze Spit, Blinding Ink, Spit Poison, Spit Blight, Rushing Claws, Throw Boulder, Telekinetic Blast
- Corruption / Rot's on_mastery_change
- Corruption / Shadowflame's on_mastery_change
- Corruption / Torment's on_mastery_change
- Technique / Sniper's on_mastery_change

This addon uses the DamageProjector:base hook to fix Dark Ritual.

This addon superloads the following functions non-destructively:
- Actor:preUseTalent()
- Actor:tooltip()
- CharacterSheet:init()
- Combat:combatAPR()
- Combat:combatArmor()
- Combat:combatAttackBase()
- Combat:combatCrit()
- Combat:combatDefenseBase()
- Combat:combatSpellCrit()
- Combat:physicalCrit()
- Combat:mindCrit()
- Combat:spellCrit()


- Fixed sustainbug for Aim, Antimagic Shield, Striking Stance
- Fixed Antimagic Shield's retaliation
- Fixed Blast and Wing Buffet hitting multiple times
- Preserved original fenv for more replaced functions, to reduce the chances of addon conflicts

- Gave the Spider talent's action its original fenv back (fixes some artifacts)

- Remove Catalepsy fix as it is fixed in vanilla in 1.5.8

- Fixed Catalepsy

- Fixed equilibrium failure happening before targeting instead of after.

- Shifted to a generalized bugfix addon instead of just "Meteor Fix".
- Fixed sustainbug for Abyssal Shield, Blood Fury, Bone Shield, Corrosive Slashes, Dark Ritual, Defensive Posture, Flame of Urh'Rok, Infestation, Overkill, Precise Strikes, Willful Tormenter
- Fixed Reckless Strike self-kills
- Fixed Reckless Strike damage shield interaction
- Reckless Strike now always damages you for 30% of your current HP after the attack
- Overkill now correctly attributes its damage to the talent
- Overkill now ignores the source's inc_damage instead of the victim's
- Overkill now projects its damage in an onTickEnd()
- Overkill no longer has an overzealous recursion guard, just a regular recursion guard

- Initial release

Weight: 61428967

Syndicate content