diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 2c2a0823948..d53e588e07f 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -171,11 +171,8 @@ import { initGlobalScene } from "#app/global-scene"; import { ShowAbilityPhase } from "#app/phases/show-ability-phase"; import { HideAbilityPhase } from "#app/phases/hide-ability-phase"; import { timedEventManager } from "./global-event-manager"; -import { - type DynamicPhaseType, - type PhasePriorityQueue, - PostSummonPhasePriorityQueue, -} from "#app/data/phase-priority-queue"; +import { type PhasePriorityQueue, PostSummonPhasePriorityQueue } from "#app/data/phase-priority-queue"; +import type { DynamicPhaseType } from "./enums/dynamic-phase-type"; import { PostSummonPhase } from "#app/phases/post-summon-phase"; import { ActivatePriorityQueuePhase } from "#app/phases/activate-priority-queue-phase"; diff --git a/src/data/phase-priority-queue.ts b/src/data/phase-priority-queue.ts index f597f3a9456..dfdd60c75f6 100644 --- a/src/data/phase-priority-queue.ts +++ b/src/data/phase-priority-queue.ts @@ -1,10 +1,12 @@ import { globalScene } from "#app/global-scene"; import type { Phase } from "#app/phase"; import { ActivatePriorityQueuePhase } from "#app/phases/activate-priority-queue-phase"; -import { type PostSummonPhase, PostSummonActivateAbilityPhase } from "#app/phases/post-summon-phase"; +import type { PostSummonPhase } from "#app/phases/post-summon-phase"; +import { PostSummonActivateAbilityPhase } from "#app/phases/post-summon-activate-ability-phase"; import { Stat } from "#enums/stat"; import { BooleanHolder } from "#app/utils"; import { TrickRoomTag } from "#app/data/arena-tag"; +import { DynamicPhaseType } from "#enums/dynamic-phase-type"; /** * Stores a list of {@linkcode Phase}s @@ -93,10 +95,3 @@ function isTrickRoom(): boolean { globalScene.arena.applyTags(TrickRoomTag, false, speedReversed); return speedReversed.value; } - -/** - * Enum representation of the phase types held by implementations of {@linkcode PhasePriorityQueue} - */ -export enum DynamicPhaseType { - POST_SUMMON, -} diff --git a/src/enums/dynamic-phase-type.ts b/src/enums/dynamic-phase-type.ts new file mode 100644 index 00000000000..40f3f42393c --- /dev/null +++ b/src/enums/dynamic-phase-type.ts @@ -0,0 +1,7 @@ +/** + * Enum representation of the phase types held by implementations of {@linkcode PhasePriorityQueue} + */ + +export enum DynamicPhaseType { + POST_SUMMON +} diff --git a/src/phases/activate-priority-queue-phase.ts b/src/phases/activate-priority-queue-phase.ts index b4f4a6f55a1..9d1850a2451 100644 --- a/src/phases/activate-priority-queue-phase.ts +++ b/src/phases/activate-priority-queue-phase.ts @@ -1,4 +1,4 @@ -import type { DynamicPhaseType } from "#app/data/phase-priority-queue"; +import type { DynamicPhaseType } from "#enums/dynamic-phase-type"; import { globalScene } from "#app/global-scene"; import { Phase } from "#app/phase"; diff --git a/src/phases/post-summon-activate-ability-phase.ts b/src/phases/post-summon-activate-ability-phase.ts new file mode 100644 index 00000000000..f8b1b91a009 --- /dev/null +++ b/src/phases/post-summon-activate-ability-phase.ts @@ -0,0 +1,28 @@ +import type { BattlerIndex } from "#app/battle"; +import { applyPostSummonAbAttrs, PostSummonAbAttr } from "#app/data/ability"; +import { PostSummonPhase } from "#app/phases/post-summon-phase"; + +/** + * Helper to {@linkcode PostSummonPhase} which applies abilities + */ + +export class PostSummonActivateAbilityPhase extends PostSummonPhase { + private priority: number; + private passive: boolean; + + constructor(battlerIndex: BattlerIndex, priority: number, passive: boolean) { + super(battlerIndex); + this.priority = priority; + this.passive = passive; + } + + start() { + applyPostSummonAbAttrs(PostSummonAbAttr, this.getPokemon(), this.passive, false); + + this.end(); + } + + public override getPriority() { + return this.priority; + } +} diff --git a/src/phases/post-summon-phase.ts b/src/phases/post-summon-phase.ts index 62f995c908e..32ea8679cbd 100644 --- a/src/phases/post-summon-phase.ts +++ b/src/phases/post-summon-phase.ts @@ -1,11 +1,10 @@ import { globalScene } from "#app/global-scene"; -import { applyAbAttrs, applyPostSummonAbAttrs, CommanderAbAttr, PostSummonAbAttr } from "#app/data/ability"; +import { applyAbAttrs, CommanderAbAttr } from "#app/data/ability"; import { ArenaTrapTag } from "#app/data/arena-tag"; import { StatusEffect } from "#app/enums/status-effect"; import { PokemonPhase } from "./pokemon-phase"; import { MysteryEncounterPostSummonTag } from "#app/data/battler-tags"; import { BattlerTagType } from "#enums/battler-tag-type"; -import type { BattlerIndex } from "#app/battle"; export class PostSummonPhase extends PokemonPhase { start() { @@ -38,27 +37,3 @@ export class PostSummonPhase extends PokemonPhase { return 0; } } - -/** - * Helper to {@linkcode PostSummonPhase} which applies abilities - */ -export class PostSummonActivateAbilityPhase extends PostSummonPhase { - private priority: number; - private passive: boolean; - - constructor(battlerIndex: BattlerIndex, priority: number, passive: boolean) { - super(battlerIndex); - this.priority = priority; - this.passive = passive; - } - - start() { - applyPostSummonAbAttrs(PostSummonAbAttr, this.getPokemon(), this.passive, false); - - this.end(); - } - - public override getPriority() { - return this.priority; - } -}