Refactoring of code relating to switching, effect damage and effects that trigger after a move is used

This commit is contained in:
Maruno17
2021-09-19 19:03:17 +01:00
parent f00f030825
commit 1fb3ff5408
24 changed files with 345 additions and 343 deletions

View File

@@ -157,14 +157,7 @@ class PokeBattle_Move_DamageTargetAlly < PokeBattle_Move
@battle.battlers[b[0]].pbThis(true)))
end
end
switchedAlly = []
hitAlly.each do |b|
@battle.battlers[b[0]].pbItemHPHealCheck
if @battle.battlers[b[0]].pbAbilitiesOnDamageTaken(b[1])
switchedAlly.push(@battle.battlers[b[0]])
end
end
switchedAlly.each { |b| b.pbEffectsOnSwitchIn(true) }
hitAlly.each { |b| @battle.battlers[b[0]].pbItemHPHealCheck }
end
end
@@ -602,7 +595,7 @@ end
#===============================================================================
class PokeBattle_Move_DoublePowerIfTargetLostHPThisTurn < PokeBattle_Move
def pbBaseDamage(baseDmg,user,target)
baseDmg *= 2 if target.tookDamage
baseDmg *= 2 if target.tookDamageThisRound
return baseDmg
end
end