mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 23:32:19 +02:00
Properly filter for the right switch phase to remove
This commit is contained in:
parent
27b57e99de
commit
a08137e779
@ -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();
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user