pokerogue/src/phases/reset-status-phase.ts
Sirz Benjie 1fc42b3231
[Misc] Add phase#is method to help reduce circular imports (#5868)
* 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>
2025-06-06 21:08:23 +00:00

28 lines
863 B
TypeScript

import type Pokemon from "#app/field/pokemon";
import { BattlePhase } from "#app/phases/battle-phase";
/**
* Phase which handles resetting a Pokemon's status to none
*
* This is necessary to perform in a phase primarly to ensure that the status icon disappears at the correct time in the battle
*/
export class ResetStatusPhase extends BattlePhase {
public readonly phaseName = "ResetStatusPhase";
private readonly pokemon: Pokemon;
private readonly affectConfusion: boolean;
private readonly reloadAssets: boolean;
constructor(pokemon: Pokemon, affectConfusion: boolean, reloadAssets: boolean) {
super();
this.pokemon = pokemon;
this.affectConfusion = affectConfusion;
this.reloadAssets = reloadAssets;
}
public override start() {
this.pokemon.clearStatus(this.affectConfusion, this.reloadAssets);
this.end();
}
}