mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-26 11:39:17 +01:00
https://github.com/pagefaultgames/pokerogue/pull/5955 * Add newPhase method to phase-manager * Update calls to append/prepend phase to use string phase * Replace instantiations of new phase with phase manager
23 lines
601 B
TypeScript
23 lines
601 B
TypeScript
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.phaseManager.unshiftNew("PostTurnStatusEffectPhase", o);
|
|
}
|
|
}
|
|
this.end();
|
|
}
|
|
}
|