Private
Readonly
Returns a message if the switch-out attempt fails due to ability effects.
The target Pokémon.
The failure message, or null if no failure.
null
Determines if a Pokémon can switch out based on its status, the opponent's status, and battle conditions.
The Pokémon attempting to switch out
The opponent Pokémon
true if the switch-out condition is met
true
Handles the logic for switching out a Pokémon based on battle conditions, HP, and the switch type.
The Pokémon attempting to switch out.
true if the switch is successful
Returns a message if the switch-out attempt fails due to ability effects.