mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-18 11:05:52 +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>
24 lines
679 B
TypeScript
24 lines
679 B
TypeScript
import { PostTurnStatusEffectPhase } from "#app/phases/post-turn-status-effect-phase";
|
|
import { Phase } from "#app/phase";
|
|
import type { BattlerIndex } from "#app/battle";
|
|
import { globalScene } from "#app/global-scene";
|
|
|
|
export class CheckStatusEffectPhase extends Phase {
|
|
public readonly phaseName = "CheckStatusEffectPhase";
|
|
private order: BattlerIndex[];
|
|
constructor(order: BattlerIndex[]) {
|
|
super();
|
|
this.order = order;
|
|
}
|
|
|
|
start() {
|
|
const field = globalScene.getField();
|
|
for (const o of this.order) {
|
|
if (field[o].status?.isPostTurn()) {
|
|
globalScene.unshiftPhase(new PostTurnStatusEffectPhase(o));
|
|
}
|
|
}
|
|
this.end();
|
|
}
|
|
}
|