mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +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) => {
|
phasePokemon.getAbilityPriorities().forEach((priority, idx) => {
|
||||||
this.queue.push(new PostSummonActivateAbilityPhase(phasePokemon.getBattlerIndex(), priority, !!idx));
|
this.queue.push(new PostSummonActivateAbilityPhase(phasePokemon.getBattlerIndex(), priority, !!idx));
|
||||||
globalScene.appendToPhase(
|
globalScene.phaseManager.appendToPhase(
|
||||||
new ActivatePriorityQueuePhase(DynamicPhaseType.POST_SUMMON),
|
new ActivatePriorityQueuePhase(DynamicPhaseType.POST_SUMMON),
|
||||||
ActivatePriorityQueuePhase,
|
"ActivatePriorityQueuePhase",
|
||||||
(p: ActivatePriorityQueuePhase) => p.getType() === DynamicPhaseType.POST_SUMMON,
|
(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.
|
* This allows for easy creation of new phases without needing to import each phase individually.
|
||||||
*/
|
*/
|
||||||
const PHASES = Object.freeze({
|
const PHASES = Object.freeze({
|
||||||
|
ActivatePriorityQueuePhase,
|
||||||
AddEnemyBuffModifierPhase,
|
AddEnemyBuffModifierPhase,
|
||||||
AttemptCapturePhase,
|
AttemptCapturePhase,
|
||||||
AttemptRunPhase,
|
AttemptRunPhase,
|
||||||
|
@ -3,6 +3,7 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import { Phase } from "#app/phase";
|
import { Phase } from "#app/phase";
|
||||||
|
|
||||||
export class ActivatePriorityQueuePhase extends Phase {
|
export class ActivatePriorityQueuePhase extends Phase {
|
||||||
|
public readonly phaseName = "ActivatePriorityQueuePhase";
|
||||||
private type: DynamicPhaseType;
|
private type: DynamicPhaseType;
|
||||||
|
|
||||||
constructor(type: DynamicPhaseType) {
|
constructor(type: DynamicPhaseType) {
|
||||||
@ -12,7 +13,7 @@ export class ActivatePriorityQueuePhase extends Phase {
|
|||||||
|
|
||||||
override start() {
|
override start() {
|
||||||
super.start();
|
super.start();
|
||||||
globalScene.startDynamicPhaseType(this.type);
|
globalScene.phaseManager.startDynamicPhaseType(this.type);
|
||||||
this.end();
|
this.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ import i18next from "i18next";
|
|||||||
import { SummonPhase } from "./summon-phase";
|
import { SummonPhase } from "./summon-phase";
|
||||||
import { SubstituteTag } from "#app/data/battler-tags";
|
import { SubstituteTag } from "#app/data/battler-tags";
|
||||||
import { SwitchType } from "#enums/switch-type";
|
import { SwitchType } from "#enums/switch-type";
|
||||||
import { PostSummonPhase } from "#app/phases/post-summon-phase";
|
|
||||||
|
|
||||||
export class SwitchSummonPhase extends SummonPhase {
|
export class SwitchSummonPhase extends SummonPhase {
|
||||||
public readonly phaseName: "SwitchSummonPhase" | "ReturnPhase" = "SwitchSummonPhase";
|
public readonly phaseName: "SwitchSummonPhase" | "ReturnPhase" = "SwitchSummonPhase";
|
||||||
@ -252,7 +251,7 @@ export class SwitchSummonPhase extends SummonPhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
queuePostSummon(): void {
|
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