mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Fixed visual glitch where a Pokémon's HP would raise then lower if its substitute took damage
This commit is contained in:
@@ -245,8 +245,14 @@ class Battle::Move
|
||||
targets.each do |b|
|
||||
next if b.damageState.unaffected || b.damageState.hpLost == 0
|
||||
next if (side == 0 && b.opposes?(user)) || (side == 1 && !b.opposes?(user))
|
||||
oldHP = b.hp + b.damageState.hpLost
|
||||
PBDebug.log("[Move damage] #{b.pbThis} lost #{b.damageState.hpLost} HP (#{oldHP}=>#{b.hp})")
|
||||
oldHP = b.hp
|
||||
if b.damageState.substitute
|
||||
old_sub_hp = b.effects[PBEffects::Substitute] + b.damageState.hpLost
|
||||
PBDebug.log("[Move damage] #{b.pbThis}'s substitute lost #{b.damageState.hpLost} HP (#{old_sub_hp}=>#{b.effects[PBEffects::Substitute]})")
|
||||
else
|
||||
oldHP += b.damageState.hpLost
|
||||
PBDebug.log("[Move damage] #{b.pbThis} lost #{b.damageState.hpLost} HP (#{oldHP}=>#{b.hp})")
|
||||
end
|
||||
effectiveness = 0
|
||||
if Effectiveness.resistant?(b.damageState.typeMod)
|
||||
effectiveness = 1
|
||||
|
||||
Reference in New Issue
Block a user