diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 962a13bb840..bfbf85d92e2 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -6398,12 +6398,23 @@ export class ForceSwitchOutAttr extends MoveEffectAttr { return (user, target, move) => { const switchOutTarget = (this.selfSwitch ? user : target); const player = switchOutTarget instanceof PlayerPokemon; + const forceSwitchAttr = move.getAttrs(ForceSwitchOutAttr).find(attr => attr.switchType === SwitchType.FORCE_SWITCH); if (!this.selfSwitch) { if (move.hitsSubstitute(user, target)) { return false; } + // Check if the move is Roar or Whirlwind and if there is a trainer with only Pokémon left. + if (forceSwitchAttr && globalScene.currentBattle.trainer) { + const enemyParty = globalScene.getEnemyParty(); + // Filter out any Pokémon that are not allowed in battle (e.g. fainted ones) + const remainingPokemon = enemyParty.filter(p => p.hp > 0 && p.isAllowedInBattle()); + if (remainingPokemon.length <= 1) { + return false; + } + } + // Dondozo with an allied Tatsugiri in its mouth cannot be forced out const commandedTag = switchOutTarget.getTag(BattlerTagType.COMMANDED); if (commandedTag?.getSourcePokemon()?.isActive(true)) { diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index 753d0cd45f5..478229dcae8 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -376,17 +376,6 @@ export class MovePhase extends BattlePhase { const move = this.move.getMove(); - // Check if the move is Roar or Whirlwind and if there is a trainer with only Pokémon left. - if ([Moves.ROAR, Moves.WHIRLWIND].includes(this.move.moveId) && globalScene.currentBattle.trainer) { - const enemyParty = globalScene.getEnemyParty(); - // Filter out any Pokémon that are not allowed in battle (e.g. fainted ones) - const remainingPokemon = enemyParty.filter(pokemon => pokemon.hp > 0 && pokemon.isAllowedInBattle()); - - if (remainingPokemon.length <= 1) { - success = false; - } - } - /** * Move conditions assume the move has a single target * TODO: is this sustainable?