diff --git a/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb b/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb index 082d96c7a..cbd3dcbf6 100644 --- a/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb +++ b/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb @@ -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