mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-03 23:12:20 +02:00
Update to use PhaseManager
This commit is contained in:
parent
9fcd35e2b7
commit
5bd182a15a
@ -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,
|
||||
);
|
||||
});
|
||||
|
@ -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,
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user