the Damage Shield Penetrate attribute doesn't work properly

Make all T-Engine/ToME 4 bug reports here

Moderator: Moderator

Post Reply
Message
Author
astralInferno
Uruivellas
Posts: 834
Joined: Mon Jan 27, 2014 10:40 am

the Damage Shield Penetrate attribute doesn't work properly

#1 Post by astralInferno »

The problem is in actor.lua line 2568.

"adjusted_value" is how much of the incoming damage is hitting the shield. If you don't have damage_shield_penetrate, this is equal to the "value"; the incoming damage.

if adjusted_value is less than the remaining damage shield, everything works properly. The shield drops by adjusted_value, and value drops by adjusted_value.

If adjusted_value is MORE than the remaining damage shield, everything goes wrong. Value is set to adjusted_value - damage_shield_absorb, meaning that the ACTUAL DAMAGE TO HEALTH cannot EVER be higher than "amount of damage hitting shields MINUS the shield's remaining strength"

Notably, because adjusted_value is equal to value when you have no damage_shield_penetrate, this works normally when you dont have the shield_penetrate. It' s not a common attribute, so this is probably why no-one's caught it.

line 2568 should be changed from
value = adjusted_value - self.damage_shield_absorb

to
value = value - self.damage_shield_absorb

If the adjusted_value is high enough to defeat the damage shield, the shield penetration is irrelevant.

(An alternate solution for this would be to change how shield penetration works, making it so that n% of damage that WOULD be absorbed by a shield, isn't. Under this paradigm, dealing 100 damage with 50% penetration to something with 40 shields would only deal 20 damage to the shields. The target would take 80 damage, and their shields would drop by 20. If you wanted to make it spicier, it could even do 80 damage to the target and still drop the shields by 40! But that's very much outside the remit of this bug report.)

tl;dr - if you have shield penetration, then when attacking people with low enough shields that you're going to destroy the shield, your damage is capped at (damage*(100% - shield pen%) - shield value, meaning that the higher your shield pen is, the less damage you can actually do when breaking a shield.

Post Reply