Properly filter for the right switch phase to remove

This commit is contained in:
Dean 2025-01-17 18:52:49 -08:00
parent 27b57e99de
commit a08137e779
2 changed files with 1 additions and 5 deletions

View File

@ -5983,7 +5983,7 @@ export class RevivalBlessingAttr extends MoveEffectAttr {
// Handle cases where revived pokemon needs to get switched in on same turn // Handle cases where revived pokemon needs to get switched in on same turn
if (allyPokemon.isFainted() || allyPokemon === pokemon) { if (allyPokemon.isFainted() || allyPokemon === pokemon) {
// Enemy switch phase should be removed and replaced with the revived pkmn switching in // Enemy switch phase should be removed and replaced with the revived pkmn switching in
globalScene.tryRemovePhase((phase: SwitchSummonPhase) => phase instanceof SwitchSummonPhase && !phase.getPlayer()); globalScene.tryRemovePhase((phase: SwitchSummonPhase) => phase instanceof SwitchSummonPhase && phase.getPokemon() === pokemon);
// If the pokemon being revived was alive earlier in the turn, cancel its move // If the pokemon being revived was alive earlier in the turn, cancel its move
// (revived pokemon can't move in the turn they're brought back) // (revived pokemon can't move in the turn they're brought back)
globalScene.findPhase((phase: MovePhase) => phase.pokemon === pokemon)?.cancel(); globalScene.findPhase((phase: MovePhase) => phase.pokemon === pokemon)?.cancel();

View File

@ -24,8 +24,4 @@ export abstract class PartyMemberPokemonPhase extends FieldPhase {
getPokemon(): Pokemon { getPokemon(): Pokemon {
return this.getParty()[this.partyMemberIndex]; return this.getParty()[this.partyMemberIndex];
} }
getPlayer(): boolean {
return this.player;
}
} }