mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-23 00:32:28 +02:00
Fix user ally using move when revived
This commit is contained in:
parent
1567ae9fed
commit
a5c9b29495
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user