Skip to content

Commit

Permalink
Merge pull request #451 from PiotrKaszuba/fix-issue-450
Browse files Browse the repository at this point in the history
Fix #450: Sign of energy infusion
  • Loading branch information
Kvel2D authored Sep 29, 2024
2 parents 092e3e8 + 8b87d7a commit 2941073
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/items/item_behaviors/sign_of_energy_infusion.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ func on_damage(event: Event):
# NOTE: original script multiplies damage by (2.0 +
# regen). In original youtd, regen value starts at
# 0.0. In youtd2 regen starts at 1.0. So in original
# game damage was multiplied by 2.0 as baseline?
# Changed it to mutiply by 1.0 or above, so that if
# regen is decreased below 100%, damage is not
# decreased.
event.damage *= max(1.0, regen)
# game damage was multiplied by 2.0 for a default tower.
# max(0.0, ...) allows for damage penalty when mana regen
# is reduced by i.e. mana drain aura creeps
# while preventing it from turning negative.
event.damage *= max(0.0, 1.0 + regen)
item.user_int = 0
var damage_text: String = Utils.format_float(event.damage, 0)
carrier.get_player().display_small_floating_text(damage_text, carrier, Color8(255, 0, 255), 40.0)
Expand Down

0 comments on commit 2941073

Please sign in to comment.