More AI code for deciding when to switch

This commit is contained in:
Maruno17
2023-04-17 19:08:42 +01:00
parent 7f6f57dec3
commit d277658965
11 changed files with 468 additions and 171 deletions

View File

@@ -589,9 +589,9 @@ Battle::AI::Handlers::MoveEffectScore.copy("UserFaintsHealAndCureReplacement",
Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("StartPerishCountsForAllBattlers",
proc { |move, user, target, ai, battle|
next true if target.effects[PBEffects::PerishSong] > 0
next true if Battle::AbilityEffects.triggerMoveImmunity(target.ability, user.battler, target.battler,
move.move, move.rough_type, battle, false)
next false
next false if !target.ability_active?
next Battle::AbilityEffects.triggerMoveImmunity(target.ability, user.battler, target.battler,
move.move, move.rough_type, battle, false)
}
)
Battle::AI::Handlers::MoveEffectScore.add("StartPerishCountsForAllBattlers",