AI function code rewrites for protection moves

This commit is contained in:
Maruno17
2023-02-04 21:14:35 +00:00
parent 80bb967aad
commit 7678a13e94
2 changed files with 346 additions and 56 deletions

View File

@@ -287,11 +287,10 @@ class Battle::AI::AIBattler
#=============================================================================
def can_attack?
return false if self.effects[PBEffects::SkyDrop] >= 0
return false if self.effects[PBEffects::HyperBeam] > 0
return false if status == :SLEEP && statusCount > 1
return false if status == :FROZEN # Only 20% chance of unthawing; assune it won't
return false if self.effects[PBEffects::Truant]
return false if self.effects[PBEffects::Truant] && has_active_ability?(:TRUANT)
return false if self.effects[PBEffects::Flinch]
# NOTE: Confusion/infatuation/paralysis have higher chances of allowing the
# attack, so the battler is treated as able to attack in those cases.