Update to use PhaseManager

This commit is contained in:
Dean 2025-06-10 21:31:39 -07:00
parent 9fcd35e2b7
commit 5bd182a15a
4 changed files with 6 additions and 5 deletions

View File

@ -81,9 +81,9 @@ export class PostSummonPhasePriorityQueue extends PhasePriorityQueue {
phasePokemon.getAbilityPriorities().forEach((priority, idx) => {
this.queue.push(new PostSummonActivateAbilityPhase(phasePokemon.getBattlerIndex(), priority, !!idx));
globalScene.appendToPhase(
globalScene.phaseManager.appendToPhase(
new ActivatePriorityQueuePhase(DynamicPhaseType.POST_SUMMON),
ActivatePriorityQueuePhase,
"ActivatePriorityQueuePhase",
(p: ActivatePriorityQueuePhase) => p.getType() === DynamicPhaseType.POST_SUMMON,
);
});

View File

@ -115,6 +115,7 @@ import { WeatherEffectPhase } from "#app/phases/weather-effect-phase";
* This allows for easy creation of new phases without needing to import each phase individually.
*/
const PHASES = Object.freeze({
ActivatePriorityQueuePhase,
AddEnemyBuffModifierPhase,
AttemptCapturePhase,
AttemptRunPhase,

View File

@ -3,6 +3,7 @@ import { globalScene } from "#app/global-scene";
import { Phase } from "#app/phase";
export class ActivatePriorityQueuePhase extends Phase {
public readonly phaseName = "ActivatePriorityQueuePhase";
private type: DynamicPhaseType;
constructor(type: DynamicPhaseType) {
@ -12,7 +13,7 @@ export class ActivatePriorityQueuePhase extends Phase {
override start() {
super.start();
globalScene.startDynamicPhaseType(this.type);
globalScene.phaseManager.startDynamicPhaseType(this.type);
this.end();
}

View File

@ -18,7 +18,6 @@ import i18next from "i18next";
import { SummonPhase } from "./summon-phase";
import { SubstituteTag } from "#app/data/battler-tags";
import { SwitchType } from "#enums/switch-type";
import { PostSummonPhase } from "#app/phases/post-summon-phase";
export class SwitchSummonPhase extends SummonPhase {
public readonly phaseName: "SwitchSummonPhase" | "ReturnPhase" = "SwitchSummonPhase";
@ -252,7 +251,7 @@ export class SwitchSummonPhase extends SummonPhase {
}
queuePostSummon(): void {
globalScene.phaseManager.startDynamicPhase(new PostSummonPhase(this.getPokemon().getBattlerIndex()));
globalScene.phaseManager.pushNew("PostSummonPhase", this.getPokemon().getBattlerIndex());
}
/**