Sign of energy infusion not compatible with original game
Closed this issue · 1 comments
The current state of Sign of energy infusion:
youtd2/src/items/item_behaviors/sign_of_energy_infusion.gd
Lines 26 to 33 in 3d51efd
It seems that in original YouTD it had an initial bonus of +100% accounting for the 'base percentual regen'. So the break down of the formula could be:
a. "1" - accounting for the base factor in multiplication (no mana regen means constant damage)
b. another "1" - accounting for the base mana regen of 100% that probably all towers possess - which will account for value of "2" by default
c. "C.getProp_ManaRegPercBonus()" as bonus percentage of mana regen
Current formula in this project seems to merge factors b and c together due to how percentage mana regen properties are stored (starting at 1.0, I assume):
However, factor "a" seems to be left out. If original behaviour is desired "regen+1.0" should probably be used. Otherwise, it might be a balancing factor not to use "+1" so that Sign of energy infusion starts at 0% bonus every 5 hits for a default tower instead of 100% bonus.
The other part of the formula - the call to the max function with argument "1.0": "max(1.0, ...); also alternates the gameplay/balance by removing the downside of lowered mana regen while using the item i.e. zombie hand item, barbarian warlord builder or mana drain aura creeps:
youtd2/src/creeps/special_buffs/creep_mana_drain_aura.gd
Lines 12 to 14 in 3d51efd
Argument of "0.0" in the max function should fix most inconsistencies (I believe) - it will allow damage penalty based on negative mana regen up to 0 damage dealt every 5th hit, while preventing negative damage (not sure if negative damage was possible in original YouTD though or in YouTD2).
So, to mimic the behaviour and balance of original game I'd suggest formula of:
event.damage *= max(0.0, regen+1.0)
with the assumption that no intentional balancing was done here.
There are two points here:
- How does this item affect damage when tower has no "mana regen %" bonuses (+0%)?
- How does this item affect damage when tower has negative "mana regen %" stat (-50% for example?
Point 1
- Original game: damage is multiplied by
2.0
- Youtd2: damage is multiplied by
1.0
, no change
This change was intentional, done in this commit: 14acd33
The reason for the change was that I didn't understand why item "increased damage by its percentual mana regeneration" would multiply damage by 2.0 by default. To me, it looked like item behavior didn't match item description.
I thought about it more now and it appears that original behavior does match the item description, even if it's confusing.
the damage is increased by its percentual mana regeneration.
The key here is that description talks about "percentual mana regeneration" stat, which is not the same as "percentual mana regen bonus" stat.
- "percentual mana regen bonus" starts at +0%
- "percentual mana regeneration" starts at 100%. This is in terms of gameplay logic, values in code are not important here.
Therefore it makes sense that:
- the damage is increased by its percentual mana regeneration
- "Percentual mana regeneration" is 100% by default
- Damage is increased by 100% by default
- Damage is multiplied by 2.0 by default
Point 2
- Original game: damage is reduced
- Youtd2: damage is not reduced, no change to damage
I changed this on purpose some time ago because I felt that this item reducing damage would be unfair but I guess it is better to keep it like in original game. The interaction of mana regen debuffs with this item is neat.
In summary, both suggested changes make sense to me. Suggested formula also looks correct.