From a5c9b29495f531a2b00a07d05a1f1733be982d87 Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 17 Jan 2025 17:52:22 -0800 Subject: [PATCH] Fix user ally using move when revived --- src/field/pokemon.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 432f0a92fec..1ee89bae264 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -83,6 +83,7 @@ import { BASE_HIDDEN_ABILITY_CHANCE, BASE_SHINY_CHANCE, SHINY_EPIC_CHANCE, SHINY import { Nature } from "#enums/nature"; import { StatusEffect } from "#enums/status-effect"; import { doShinySparkleAnim } from "#app/field/anims"; +import type { MovePhase } from "#app/phases/move-phase"; export enum LearnMoveSituation { MISC, @@ -4366,12 +4367,8 @@ export class PlayerPokemon extends Pokemon { if (globalScene.currentBattle.double && globalScene.getPlayerParty().length > 1) { const allyPokemon = this.getAlly(); - if (slotIndex <= 1) { - // Revived ally pokemon - globalScene.unshiftPhase(new SwitchSummonPhase(SwitchType.SWITCH, pokemon.getFieldIndex(), slotIndex, false, true)); - globalScene.unshiftPhase(new ToggleDoublePositionPhase(true)); - } else if (allyPokemon.isFainted()) { - // Revived party pokemon, and ally pokemon is fainted + if (allyPokemon.isFainted() || allyPokemon === pokemon) { + globalScene.findPhase((phase: MovePhase) => phase.pokemon === pokemon)?.cancel(); globalScene.unshiftPhase(new SwitchSummonPhase(SwitchType.SWITCH, allyPokemon.getFieldIndex(), slotIndex, false, true)); globalScene.unshiftPhase(new ToggleDoublePositionPhase(true)); }