mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 23:42:18 +02:00
Split files
This commit is contained in:
parent
d6df829f85
commit
557cf21cfe
@ -171,11 +171,8 @@ import { initGlobalScene } from "#app/global-scene";
|
|||||||
import { ShowAbilityPhase } from "#app/phases/show-ability-phase";
|
import { ShowAbilityPhase } from "#app/phases/show-ability-phase";
|
||||||
import { HideAbilityPhase } from "#app/phases/hide-ability-phase";
|
import { HideAbilityPhase } from "#app/phases/hide-ability-phase";
|
||||||
import { timedEventManager } from "./global-event-manager";
|
import { timedEventManager } from "./global-event-manager";
|
||||||
import {
|
import { type PhasePriorityQueue, PostSummonPhasePriorityQueue } from "#app/data/phase-priority-queue";
|
||||||
type DynamicPhaseType,
|
import type { DynamicPhaseType } from "./enums/dynamic-phase-type";
|
||||||
type PhasePriorityQueue,
|
|
||||||
PostSummonPhasePriorityQueue,
|
|
||||||
} from "#app/data/phase-priority-queue";
|
|
||||||
import { PostSummonPhase } from "#app/phases/post-summon-phase";
|
import { PostSummonPhase } from "#app/phases/post-summon-phase";
|
||||||
import { ActivatePriorityQueuePhase } from "#app/phases/activate-priority-queue-phase";
|
import { ActivatePriorityQueuePhase } from "#app/phases/activate-priority-queue-phase";
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { Phase } from "#app/phase";
|
import type { Phase } from "#app/phase";
|
||||||
import { ActivatePriorityQueuePhase } from "#app/phases/activate-priority-queue-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 { Stat } from "#enums/stat";
|
||||||
import { BooleanHolder } from "#app/utils";
|
import { BooleanHolder } from "#app/utils";
|
||||||
import { TrickRoomTag } from "#app/data/arena-tag";
|
import { TrickRoomTag } from "#app/data/arena-tag";
|
||||||
|
import { DynamicPhaseType } from "#enums/dynamic-phase-type";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores a list of {@linkcode Phase}s
|
* Stores a list of {@linkcode Phase}s
|
||||||
@ -93,10 +95,3 @@ function isTrickRoom(): boolean {
|
|||||||
globalScene.arena.applyTags(TrickRoomTag, false, speedReversed);
|
globalScene.arena.applyTags(TrickRoomTag, false, speedReversed);
|
||||||
return speedReversed.value;
|
return speedReversed.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Enum representation of the phase types held by implementations of {@linkcode PhasePriorityQueue}
|
|
||||||
*/
|
|
||||||
export enum DynamicPhaseType {
|
|
||||||
POST_SUMMON,
|
|
||||||
}
|
|
||||||
|
7
src/enums/dynamic-phase-type.ts
Normal file
7
src/enums/dynamic-phase-type.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* Enum representation of the phase types held by implementations of {@linkcode PhasePriorityQueue}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export enum DynamicPhaseType {
|
||||||
|
POST_SUMMON
|
||||||
|
}
|
@ -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 { globalScene } from "#app/global-scene";
|
||||||
import { Phase } from "#app/phase";
|
import { Phase } from "#app/phase";
|
||||||
|
|
||||||
|
28
src/phases/post-summon-activate-ability-phase.ts
Normal file
28
src/phases/post-summon-activate-ability-phase.ts
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
}
|
@ -1,11 +1,10 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
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 { ArenaTrapTag } from "#app/data/arena-tag";
|
||||||
import { StatusEffect } from "#app/enums/status-effect";
|
import { StatusEffect } from "#app/enums/status-effect";
|
||||||
import { PokemonPhase } from "./pokemon-phase";
|
import { PokemonPhase } from "./pokemon-phase";
|
||||||
import { MysteryEncounterPostSummonTag } from "#app/data/battler-tags";
|
import { MysteryEncounterPostSummonTag } from "#app/data/battler-tags";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import type { BattlerIndex } from "#app/battle";
|
|
||||||
|
|
||||||
export class PostSummonPhase extends PokemonPhase {
|
export class PostSummonPhase extends PokemonPhase {
|
||||||
start() {
|
start() {
|
||||||
@ -38,27 +37,3 @@ export class PostSummonPhase extends PokemonPhase {
|
|||||||
return 0;
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user