Refactored AI switching code, added "UsePokemonInOrder" skill flag

This commit is contained in:
Maruno17
2023-02-14 16:40:52 +00:00
parent a8e024eb3e
commit 81d069eef1
16 changed files with 353 additions and 235 deletions

View File

@@ -381,7 +381,7 @@ Battle::AbilityEffects::OnHPDroppedBelowHalf.add(:EMERGENCYEXIT,
end
# In trainer battles
next false if battle.pbAllFainted?(battler.idxOpposingSide)
next false if !battle.pbCanSwitch?(battler.index) # Battler can't switch out
next false if !battle.pbCanSwitchOut?(battler.index) # Battler can't switch out
next false if !battle.pbCanChooseNonActive?(battler.index) # No Pokémon can switch in
battle.pbShowAbilitySplash(battler, true)
battle.pbHideAbilitySplash(battler)