mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-28 12:32:44 +02:00
* Move phase types out of phase interceptor * Create isXPhase method and add properties to each phase * Replace instanceof phase with isXPhase * Fix missing union types for phaseName * Update doc comment in phase.ts * Fix incomplete comment in encounter-phase * Make phaseName as public and fix more uses * Move phaseName property declaration before constructor in move anim phase Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Rename isXPhase to is --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
30 lines
765 B
TypeScript
30 lines
765 B
TypeScript
import { globalScene } from "#app/global-scene";
|
|
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";
|
|
import { SwitchType } from "#enums/switch-type";
|
|
import { SwitchSummonPhase } from "./switch-summon-phase";
|
|
|
|
export class ReturnPhase extends SwitchSummonPhase {
|
|
public readonly phaseName = "ReturnPhase";
|
|
constructor(fieldIndex: number) {
|
|
super(SwitchType.SWITCH, fieldIndex, -1, true);
|
|
}
|
|
|
|
switchAndSummon(): void {
|
|
this.end();
|
|
}
|
|
|
|
summon(): void {}
|
|
|
|
onEnd(): void {
|
|
const pokemon = this.getPokemon();
|
|
|
|
pokemon.resetSprite();
|
|
pokemon.resetTurnData();
|
|
pokemon.resetSummonData();
|
|
|
|
globalScene.updateFieldScale();
|
|
|
|
globalScene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger);
|
|
}
|
|
}
|