From 8aa363683d9ffd1fcc7b06560c8c22cc2dc6ed0c Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Wed, 28 May 2025 18:02:19 -0500 Subject: [PATCH] Make phaseName as public and fix more uses --- src/battle-scene.ts | 4 +--- src/phase.ts | 2 +- src/phases/add-enemy-buff-modifier-phase.ts | 2 +- src/phases/attempt-capture-phase.ts | 2 +- src/phases/attempt-run-phase.ts | 2 +- src/phases/battle-end-phase.ts | 2 +- src/phases/berry-phase.ts | 2 +- src/phases/check-status-effect-phase.ts | 2 +- src/phases/check-switch-phase.ts | 2 +- src/phases/command-phase.ts | 2 +- src/phases/common-anim-phase.ts | 2 +- src/phases/damage-anim-phase.ts | 2 +- src/phases/egg-hatch-phase.ts | 2 +- src/phases/egg-lapse-phase.ts | 2 +- src/phases/egg-summary-phase.ts | 2 +- src/phases/encounter-phase.ts | 2 +- src/phases/end-card-phase.ts | 2 +- src/phases/end-evolution-phase.ts | 2 +- src/phases/enemy-command-phase.ts | 2 +- src/phases/evolution-phase.ts | 2 +- src/phases/exp-phase.ts | 2 +- src/phases/faint-phase.ts | 2 +- src/phases/form-change-phase.ts | 2 +- src/phases/game-over-modifier-reward-phase.ts | 2 +- src/phases/game-over-phase.ts | 2 +- src/phases/hide-ability-phase.ts | 2 +- src/phases/hide-party-exp-bar-phase.ts | 2 +- src/phases/learn-move-phase.ts | 2 +- src/phases/level-cap-phase.ts | 2 +- src/phases/level-up-phase.ts | 2 +- src/phases/load-move-anim-phase.ts | 2 +- src/phases/login-phase.ts | 2 +- src/phases/message-phase.ts | 2 +- src/phases/modifier-reward-phase.ts | 2 +- src/phases/money-reward-phase.ts | 2 +- src/phases/move-anim-phase.ts | 2 +- src/phases/move-charge-phase.ts | 2 +- src/phases/move-effect-phase.ts | 2 +- src/phases/move-end-phase.ts | 2 +- src/phases/move-header-phase.ts | 2 +- src/phases/move-phase.ts | 2 +- src/phases/mystery-encounter-phases.ts | 12 ++++++------ src/phases/new-battle-phase.ts | 2 +- src/phases/new-biome-encounter-phase.ts | 2 +- src/phases/next-encounter-phase.ts | 2 +- src/phases/obtain-status-effect-phase.ts | 2 +- src/phases/party-exp-phase.ts | 2 +- src/phases/party-heal-phase.ts | 2 +- src/phases/pokemon-anim-phase.ts | 2 +- src/phases/pokemon-heal-phase.ts | 2 +- src/phases/pokemon-transform-phase.ts | 2 +- src/phases/post-game-over-phase.ts | 2 +- src/phases/post-summon-phase.ts | 2 +- src/phases/post-turn-status-effect-phase.ts | 2 +- src/phases/quiet-form-change-phase.ts | 2 +- src/phases/reload-session-phase.ts | 2 +- src/phases/reset-status-phase.ts | 2 +- src/phases/return-phase.ts | 2 +- src/phases/revival-blessing-phase.ts | 2 +- src/phases/ribbon-modifier-reward-phase.ts | 2 +- src/phases/scan-ivs-phase.ts | 2 +- src/phases/select-biome-phase.ts | 2 +- src/phases/select-challenge-phase.ts | 2 +- src/phases/select-gender-phase.ts | 2 +- src/phases/select-modifier-phase.ts | 2 +- src/phases/select-starter-phase.ts | 2 +- src/phases/select-target-phase.ts | 2 +- src/phases/shiny-sparkle-phase.ts | 2 +- src/phases/show-ability-phase.ts | 2 +- src/phases/show-party-exp-bar-phase.ts | 2 +- src/phases/show-trainer-phase.ts | 2 +- src/phases/stat-stage-change-phase.ts | 2 +- src/phases/summon-missing-phase.ts | 2 +- src/phases/summon-phase.ts | 3 +-- src/phases/switch-biome-phase.ts | 2 +- src/phases/switch-phase.ts | 2 +- src/phases/switch-summon-phase.ts | 2 +- src/phases/tera-phase.ts | 2 +- src/phases/title-phase.ts | 2 +- src/phases/toggle-double-position-phase.ts | 2 +- src/phases/trainer-victory-phase.ts | 2 +- src/phases/turn-end-phase.ts | 2 +- src/phases/turn-init-phase.ts | 2 +- src/phases/turn-start-phase.ts | 2 +- src/phases/unavailable-phase.ts | 2 +- src/phases/unlock-phase.ts | 2 +- src/phases/victory-phase.ts | 2 +- src/phases/weather-effect-phase.ts | 2 +- src/ui/pokedex-page-ui-handler.ts | 2 +- 89 files changed, 94 insertions(+), 97 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 7a8436b5c55..ea2983c75a8 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1587,9 +1587,7 @@ export default class BattleScene extends SceneBase { return 0; } - const isEggPhase: boolean = ["EggLapsePhase", "EggHatchPhase"].includes( - this.getCurrentPhase()?.constructor.name ?? "", - ); + const isEggPhase: boolean = ["EggLapsePhase", "EggHatchPhase"].includes(this.getCurrentPhase()?.phaseName ?? ""); if ( // Give trainers with specialty types an appropriately-typed form for Wormadam, Rotom, Arceus, Oricorio, Silvally, or Paldean Tauros. diff --git a/src/phase.ts b/src/phase.ts index b15dcd679ba..6b0b5222828 100644 --- a/src/phase.ts +++ b/src/phase.ts @@ -15,7 +15,7 @@ export abstract class Phase { * * When implementing a phase, you must set the `phaseName` property to the name of the phase. */ - protected abstract readonly phaseName: PhaseString; + public abstract readonly phaseName: PhaseString; /** * Check if the phase is of the given type without requiring `instanceof`. diff --git a/src/phases/add-enemy-buff-modifier-phase.ts b/src/phases/add-enemy-buff-modifier-phase.ts index 4e1e77de4b1..28eaf0dc4df 100644 --- a/src/phases/add-enemy-buff-modifier-phase.ts +++ b/src/phases/add-enemy-buff-modifier-phase.ts @@ -9,7 +9,7 @@ import { Phase } from "#app/phase"; import { globalScene } from "#app/global-scene"; export class AddEnemyBuffModifierPhase extends Phase { - protected readonly phaseName = "AddEnemyBuffModifierPhase"; + public readonly phaseName = "AddEnemyBuffModifierPhase"; start() { super.start(); diff --git a/src/phases/attempt-capture-phase.ts b/src/phases/attempt-capture-phase.ts index 8ddaf6f3b01..6c2f5f4dd76 100644 --- a/src/phases/attempt-capture-phase.ts +++ b/src/phases/attempt-capture-phase.ts @@ -27,7 +27,7 @@ import { globalScene } from "#app/global-scene"; import { Gender } from "#app/data/gender"; export class AttemptCapturePhase extends PokemonPhase { - protected readonly phaseName = "AttemptCapturePhase"; + public readonly phaseName = "AttemptCapturePhase"; private pokeballType: PokeballType; private pokeball: Phaser.GameObjects.Sprite; private originalY: number; diff --git a/src/phases/attempt-run-phase.ts b/src/phases/attempt-run-phase.ts index 2e4fed7b6f8..ced81567c43 100644 --- a/src/phases/attempt-run-phase.ts +++ b/src/phases/attempt-run-phase.ts @@ -17,7 +17,7 @@ import { globalScene } from "#app/global-scene"; import { SelectBiomePhase } from "./select-biome-phase"; export class AttemptRunPhase extends PokemonPhase { - protected readonly phaseName = "AttemptRunPhase"; + public readonly phaseName = "AttemptRunPhase"; /** For testing purposes: this is to force the pokemon to fail and escape */ public forceFailEscape = false; diff --git a/src/phases/battle-end-phase.ts b/src/phases/battle-end-phase.ts index db446d4dc8c..626bd1021ae 100644 --- a/src/phases/battle-end-phase.ts +++ b/src/phases/battle-end-phase.ts @@ -5,7 +5,7 @@ import { BattlePhase } from "./battle-phase"; import { GameOverPhase } from "./game-over-phase"; export class BattleEndPhase extends BattlePhase { - protected readonly phaseName = "BattleEndPhase"; + public readonly phaseName = "BattleEndPhase"; /** If true, will increment battles won */ isVictory: boolean; diff --git a/src/phases/berry-phase.ts b/src/phases/berry-phase.ts index f68cf073110..8d66d498039 100644 --- a/src/phases/berry-phase.ts +++ b/src/phases/berry-phase.ts @@ -20,7 +20,7 @@ import type Pokemon from "#app/field/pokemon"; * Also triggers Cud Chew's "repeat berry use" effects */ export class BerryPhase extends FieldPhase { - protected readonly phaseName = "BerryPhase"; + public readonly phaseName = "BerryPhase"; start() { super.start(); diff --git a/src/phases/check-status-effect-phase.ts b/src/phases/check-status-effect-phase.ts index 35044d7e129..0c5884bbac7 100644 --- a/src/phases/check-status-effect-phase.ts +++ b/src/phases/check-status-effect-phase.ts @@ -4,7 +4,7 @@ import type { BattlerIndex } from "#app/battle"; import { globalScene } from "#app/global-scene"; export class CheckStatusEffectPhase extends Phase { - protected readonly phaseName = "CheckStatusEffectPhase"; + public readonly phaseName = "CheckStatusEffectPhase"; private order: BattlerIndex[]; constructor(order: BattlerIndex[]) { super(); diff --git a/src/phases/check-switch-phase.ts b/src/phases/check-switch-phase.ts index 3f6d9cc322f..0506cd36c46 100644 --- a/src/phases/check-switch-phase.ts +++ b/src/phases/check-switch-phase.ts @@ -10,7 +10,7 @@ import { SwitchPhase } from "./switch-phase"; import { SwitchType } from "#enums/switch-type"; export class CheckSwitchPhase extends BattlePhase { - protected readonly phaseName = "CheckSwitchPhase"; + public readonly phaseName = "CheckSwitchPhase"; protected fieldIndex: number; protected useName: boolean; diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index 9c44fbc67ed..209c1eefc85 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -25,7 +25,7 @@ import { ArenaTagSide } from "#app/data/arena-tag"; import { ArenaTagType } from "#app/enums/arena-tag-type"; export class CommandPhase extends FieldPhase { - protected readonly phaseName = "CommandPhase"; + public readonly phaseName = "CommandPhase"; protected fieldIndex: number; constructor(fieldIndex: number) { diff --git a/src/phases/common-anim-phase.ts b/src/phases/common-anim-phase.ts index 87f3b0c5a7d..4a27db3a651 100644 --- a/src/phases/common-anim-phase.ts +++ b/src/phases/common-anim-phase.ts @@ -7,7 +7,7 @@ import { PokemonPhase } from "./pokemon-phase"; export class CommonAnimPhase extends PokemonPhase { // PokemonHealPhase extends CommonAnimPhase, and to make typescript happy, // we need to allow phaseName to be a union of the two - protected readonly phaseName: "CommonAnimPhase" | "PokemonHealPhase" | "WeatherEffectPhase" = "CommonAnimPhase"; + public readonly phaseName: "CommonAnimPhase" | "PokemonHealPhase" | "WeatherEffectPhase" = "CommonAnimPhase"; private anim: CommonAnim | null; private targetIndex?: BattlerIndex; private playOnEmptyField: boolean; diff --git a/src/phases/damage-anim-phase.ts b/src/phases/damage-anim-phase.ts index 7b5d18c91ad..85cb26e0a09 100644 --- a/src/phases/damage-anim-phase.ts +++ b/src/phases/damage-anim-phase.ts @@ -6,7 +6,7 @@ import { fixedInt } from "#app/utils/common"; import { PokemonPhase } from "#app/phases/pokemon-phase"; export class DamageAnimPhase extends PokemonPhase { - protected readonly phaseName = "DamageAnimPhase"; + public readonly phaseName = "DamageAnimPhase"; private amount: number; private damageResult: DamageResult; private critical: boolean; diff --git a/src/phases/egg-hatch-phase.ts b/src/phases/egg-hatch-phase.ts index 00c87be2c2a..d8823a07ef2 100644 --- a/src/phases/egg-hatch-phase.ts +++ b/src/phases/egg-hatch-phase.ts @@ -20,7 +20,7 @@ import { doShinySparkleAnim } from "#app/field/anims"; * Class that represents egg hatching */ export class EggHatchPhase extends Phase { - protected readonly phaseName = "EggHatchPhase"; + public readonly phaseName = "EggHatchPhase"; /** The egg that is hatching */ private egg: Egg; /** The new EggHatchData for the egg/pokemon that hatches */ diff --git a/src/phases/egg-lapse-phase.ts b/src/phases/egg-lapse-phase.ts index 7fa8fe7156c..182d6f304d6 100644 --- a/src/phases/egg-lapse-phase.ts +++ b/src/phases/egg-lapse-phase.ts @@ -16,7 +16,7 @@ import { EggHatchData } from "#app/data/egg-hatch-data"; * Also handles prompts for skipping animation, and calling the egg summary phase */ export class EggLapsePhase extends Phase { - protected readonly phaseName = "EggLapsePhase"; + public readonly phaseName = "EggLapsePhase"; private eggHatchData: EggHatchData[] = []; private readonly minEggsToSkip: number = 2; diff --git a/src/phases/egg-summary-phase.ts b/src/phases/egg-summary-phase.ts index 8fa49ceca5f..cc7857426bc 100644 --- a/src/phases/egg-summary-phase.ts +++ b/src/phases/egg-summary-phase.ts @@ -9,7 +9,7 @@ import type { EggHatchData } from "#app/data/egg-hatch-data"; * Phase is handled mostly by the egg-hatch-scene-handler UI */ export class EggSummaryPhase extends Phase { - protected readonly phaseName = "EggSummaryPhase"; + public readonly phaseName = "EggSummaryPhase"; private eggHatchData: EggHatchData[]; constructor(eggHatchData: EggHatchData[]) { diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index e968919ebe1..df84f8f8ff4 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -48,7 +48,7 @@ import { getNatureName } from "#app/data/nature"; export class EncounterPhase extends BattlePhase { // Union type is necessary as this is subclassed, and typescript will otherwise complain - protected readonly phaseName: "EncounterPhase" | "NextEncounterPhase" | "NewBiomeEncounterPhase" = "EncounterPhase"; + public readonly phaseName: "EncounterPhase" | "NextEncounterPhase" | "NewBiomeEncounterPhase" = "EncounterPhase"; private loaded: boolean; constructor(loaded = false) { diff --git a/src/phases/end-card-phase.ts b/src/phases/end-card-phase.ts index 03a298a36b4..bb64969514f 100644 --- a/src/phases/end-card-phase.ts +++ b/src/phases/end-card-phase.ts @@ -5,7 +5,7 @@ import { addTextObject, TextStyle } from "#app/ui/text"; import i18next from "i18next"; export class EndCardPhase extends Phase { - protected readonly phaseName = "EndCardPhase"; + public readonly phaseName = "EndCardPhase"; public endCard: Phaser.GameObjects.Image; public text: Phaser.GameObjects.Text; start(): void { diff --git a/src/phases/end-evolution-phase.ts b/src/phases/end-evolution-phase.ts index 8653031fe46..cfc0d89fc31 100644 --- a/src/phases/end-evolution-phase.ts +++ b/src/phases/end-evolution-phase.ts @@ -3,7 +3,7 @@ import { Phase } from "#app/phase"; import { UiMode } from "#enums/ui-mode"; export class EndEvolutionPhase extends Phase { - protected readonly phaseName = "EndEvolutionPhase"; + public readonly phaseName = "EndEvolutionPhase"; start() { super.start(); diff --git a/src/phases/enemy-command-phase.ts b/src/phases/enemy-command-phase.ts index 28822f1e7fc..a81fc4d2107 100644 --- a/src/phases/enemy-command-phase.ts +++ b/src/phases/enemy-command-phase.ts @@ -15,7 +15,7 @@ import { BattlerTagType } from "#enums/battler-tag-type"; * @see {@linkcode EnemyPokemon.getNextMove} */ export class EnemyCommandPhase extends FieldPhase { - protected readonly phaseName = "EnemyCommandPhase"; + public readonly phaseName = "EnemyCommandPhase"; protected fieldIndex: number; protected skipTurn = false; diff --git a/src/phases/evolution-phase.ts b/src/phases/evolution-phase.ts index 3f802294ab6..5e635f4cd82 100644 --- a/src/phases/evolution-phase.ts +++ b/src/phases/evolution-phase.ts @@ -21,7 +21,7 @@ import { EVOLVE_MOVE } from "#app/data/balance/pokemon-level-moves"; export class EvolutionPhase extends Phase { // FormChangePhase inherits from this, but EvolutionPhase is not abstract. // We have to use the union here - protected readonly phaseName: "EvolutionPhase" | "FormChangePhase" = "EvolutionPhase"; + public readonly phaseName: "EvolutionPhase" | "FormChangePhase" = "EvolutionPhase"; protected pokemon: PlayerPokemon; protected lastLevel: number; diff --git a/src/phases/exp-phase.ts b/src/phases/exp-phase.ts index 86a1a628043..14d7d7578f8 100644 --- a/src/phases/exp-phase.ts +++ b/src/phases/exp-phase.ts @@ -7,7 +7,7 @@ import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-pha import { LevelUpPhase } from "./level-up-phase"; export class ExpPhase extends PlayerPartyMemberPokemonPhase { - protected readonly phaseName = "ExpPhase"; + public readonly phaseName = "ExpPhase"; private expValue: number; constructor(partyMemberIndex: number, expValue: number) { diff --git a/src/phases/faint-phase.ts b/src/phases/faint-phase.ts index 06ea3c12ff6..7332d6b9462 100644 --- a/src/phases/faint-phase.ts +++ b/src/phases/faint-phase.ts @@ -35,7 +35,7 @@ import { FRIENDSHIP_LOSS_FROM_FAINT } from "#app/data/balance/starters"; import { BattlerTagType } from "#enums/battler-tag-type"; export class FaintPhase extends PokemonPhase { - protected readonly phaseName = "FaintPhase"; + public readonly phaseName = "FaintPhase"; /** * Whether or not instant revive should be prevented */ diff --git a/src/phases/form-change-phase.ts b/src/phases/form-change-phase.ts index 1b3541069ff..f5e428c6d3d 100644 --- a/src/phases/form-change-phase.ts +++ b/src/phases/form-change-phase.ts @@ -13,7 +13,7 @@ import { BattlerTagType } from "#enums/battler-tag-type"; import { SpeciesFormKey } from "#enums/species-form-key"; export class FormChangePhase extends EvolutionPhase { - protected readonly phaseName = "FormChangePhase"; + public readonly phaseName = "FormChangePhase"; private formChange: SpeciesFormChange; private modal: boolean; diff --git a/src/phases/game-over-modifier-reward-phase.ts b/src/phases/game-over-modifier-reward-phase.ts index 6c58b02e7b1..13c8f48abad 100644 --- a/src/phases/game-over-modifier-reward-phase.ts +++ b/src/phases/game-over-modifier-reward-phase.ts @@ -4,7 +4,7 @@ import i18next from "i18next"; import { ModifierRewardPhase } from "./modifier-reward-phase"; export class GameOverModifierRewardPhase extends ModifierRewardPhase { - protected readonly phaseName = "GameOverModifierRewardPhase"; + public readonly phaseName = "GameOverModifierRewardPhase"; doReward(): Promise { return new Promise(resolve => { const newModifier = this.modifierType.newModifier(); diff --git a/src/phases/game-over-phase.ts b/src/phases/game-over-phase.ts index e224f4f60ef..1d03739d610 100644 --- a/src/phases/game-over-phase.ts +++ b/src/phases/game-over-phase.ts @@ -34,7 +34,7 @@ import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; import { MessagePhase } from "./message-phase"; export class GameOverPhase extends BattlePhase { - protected readonly phaseName = "GameOverPhase"; + public readonly phaseName = "GameOverPhase"; private isVictory: boolean; private firstRibbons: PokemonSpecies[] = []; diff --git a/src/phases/hide-ability-phase.ts b/src/phases/hide-ability-phase.ts index 1db0df15343..b0a12da24b1 100644 --- a/src/phases/hide-ability-phase.ts +++ b/src/phases/hide-ability-phase.ts @@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene"; import { Phase } from "#app/phase"; export class HideAbilityPhase extends Phase { - protected readonly phaseName = "HideAbilityPhase"; + public readonly phaseName = "HideAbilityPhase"; start() { super.start(); diff --git a/src/phases/hide-party-exp-bar-phase.ts b/src/phases/hide-party-exp-bar-phase.ts index 9df1ec5c9da..9ee08280cd4 100644 --- a/src/phases/hide-party-exp-bar-phase.ts +++ b/src/phases/hide-party-exp-bar-phase.ts @@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene"; import { BattlePhase } from "./battle-phase"; export class HidePartyExpBarPhase extends BattlePhase { - protected readonly phaseName = "HidePartyExpBarPhase"; + public readonly phaseName = "HidePartyExpBarPhase"; start() { super.start(); diff --git a/src/phases/learn-move-phase.ts b/src/phases/learn-move-phase.ts index 585872374c7..b6f273925cf 100644 --- a/src/phases/learn-move-phase.ts +++ b/src/phases/learn-move-phase.ts @@ -23,7 +23,7 @@ export enum LearnMoveType { } export class LearnMovePhase extends PlayerPartyMemberPokemonPhase { - protected readonly phaseName = "LearnMovePhase"; + public readonly phaseName = "LearnMovePhase"; private moveId: MoveId; private messageMode: UiMode; private learnMoveType: LearnMoveType; diff --git a/src/phases/level-cap-phase.ts b/src/phases/level-cap-phase.ts index 7e78bdc16dd..12d4d64e8e2 100644 --- a/src/phases/level-cap-phase.ts +++ b/src/phases/level-cap-phase.ts @@ -4,7 +4,7 @@ import i18next from "i18next"; import { FieldPhase } from "./field-phase"; export class LevelCapPhase extends FieldPhase { - protected readonly phaseName = "LevelCapPhase"; + public readonly phaseName = "LevelCapPhase"; start(): void { super.start(); diff --git a/src/phases/level-up-phase.ts b/src/phases/level-up-phase.ts index a9b34510683..7cf86a313df 100644 --- a/src/phases/level-up-phase.ts +++ b/src/phases/level-up-phase.ts @@ -10,7 +10,7 @@ import { NumberHolder } from "#app/utils/common"; import i18next from "i18next"; export class LevelUpPhase extends PlayerPartyMemberPokemonPhase { - protected readonly phaseName = "LevelUpPhase"; + public readonly phaseName = "LevelUpPhase"; protected lastLevel: number; protected level: number; protected pokemon: PlayerPokemon = this.getPlayerPokemon(); diff --git a/src/phases/load-move-anim-phase.ts b/src/phases/load-move-anim-phase.ts index b923ec1f6f0..c9b78797407 100644 --- a/src/phases/load-move-anim-phase.ts +++ b/src/phases/load-move-anim-phase.ts @@ -8,7 +8,7 @@ import { Phase } from "#app/phase"; * isn't already loaded (e.g. for Metronome) */ export class LoadMoveAnimPhase extends Phase { - protected readonly phaseName = "LoadMoveAnimPhase"; + public readonly phaseName = "LoadMoveAnimPhase"; constructor(protected moveId: MoveId) { super(); } diff --git a/src/phases/login-phase.ts b/src/phases/login-phase.ts index f9c696cb4e7..ec12b5ddaa4 100644 --- a/src/phases/login-phase.ts +++ b/src/phases/login-phase.ts @@ -11,7 +11,7 @@ import { SelectGenderPhase } from "./select-gender-phase"; import { UnavailablePhase } from "./unavailable-phase"; export class LoginPhase extends Phase { - protected readonly phaseName = "LoginPhase"; + public readonly phaseName = "LoginPhase"; private showText: boolean; constructor(showText = true) { diff --git a/src/phases/message-phase.ts b/src/phases/message-phase.ts index 6ed7be4ff28..335258abe5c 100644 --- a/src/phases/message-phase.ts +++ b/src/phases/message-phase.ts @@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene"; import { Phase } from "#app/phase"; export class MessagePhase extends Phase { - protected readonly phaseName = "MessagePhase"; + public readonly phaseName = "MessagePhase"; private text: string; private callbackDelay?: number | null; private prompt?: boolean | null; diff --git a/src/phases/modifier-reward-phase.ts b/src/phases/modifier-reward-phase.ts index f905496bb8c..83bd8704f59 100644 --- a/src/phases/modifier-reward-phase.ts +++ b/src/phases/modifier-reward-phase.ts @@ -7,7 +7,7 @@ import { BattlePhase } from "./battle-phase"; export class ModifierRewardPhase extends BattlePhase { // RibbonModifierRewardPhase extends ModifierRewardPhase and to make typescript happy // we need to use a union type here - protected readonly phaseName: "ModifierRewardPhase" | "RibbonModifierRewardPhase" | "GameOverModifierRewardPhase" = + public readonly phaseName: "ModifierRewardPhase" | "RibbonModifierRewardPhase" | "GameOverModifierRewardPhase" = "ModifierRewardPhase"; protected modifierType: ModifierType; diff --git a/src/phases/money-reward-phase.ts b/src/phases/money-reward-phase.ts index d98d548cdc2..52cb9ecb3ff 100644 --- a/src/phases/money-reward-phase.ts +++ b/src/phases/money-reward-phase.ts @@ -6,7 +6,7 @@ import { NumberHolder } from "#app/utils/common"; import { BattlePhase } from "./battle-phase"; export class MoneyRewardPhase extends BattlePhase { - protected readonly phaseName = "MoneyRewardPhase"; + public readonly phaseName = "MoneyRewardPhase"; private moneyMultiplier: number; constructor(moneyMultiplier: number) { diff --git a/src/phases/move-anim-phase.ts b/src/phases/move-anim-phase.ts index 7e0d1b665a3..6a33c6b850b 100644 --- a/src/phases/move-anim-phase.ts +++ b/src/phases/move-anim-phase.ts @@ -12,7 +12,7 @@ export class MoveAnimPhase extends Phase { super(); } - protected readonly phaseName = "MoveAnimPhase"; + public readonly phaseName = "MoveAnimPhase"; public override start(): void { super.start(); diff --git a/src/phases/move-charge-phase.ts b/src/phases/move-charge-phase.ts index c2bf0eb73b0..928aa57043e 100644 --- a/src/phases/move-charge-phase.ts +++ b/src/phases/move-charge-phase.ts @@ -15,7 +15,7 @@ import { BattlerTagType } from "#enums/battler-tag-type"; * @extends {@linkcode PokemonPhase} */ export class MoveChargePhase extends PokemonPhase { - protected readonly phaseName = "MoveChargePhase"; + public readonly phaseName = "MoveChargePhase"; /** The move instance that this phase applies */ public move: PokemonMove; /** The field index targeted by the move (Charging moves assume single target) */ diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 223cf447abf..3160d848624 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -82,7 +82,7 @@ import { DamageAchv } from "#app/system/achv"; type HitCheckEntry = [HitCheckResult, TypeDamageMultiplier]; export class MoveEffectPhase extends PokemonPhase { - protected readonly phaseName = "MoveEffectPhase"; + public readonly phaseName = "MoveEffectPhase"; public move: Move; private virtual = false; protected targets: BattlerIndex[]; diff --git a/src/phases/move-end-phase.ts b/src/phases/move-end-phase.ts index 783933d5d14..6642b97773b 100644 --- a/src/phases/move-end-phase.ts +++ b/src/phases/move-end-phase.ts @@ -6,7 +6,7 @@ import { applyPostSummonAbAttrs, PostSummonRemoveEffectAbAttr } from "#app/data/ import type Pokemon from "#app/field/pokemon"; export class MoveEndPhase extends PokemonPhase { - protected readonly phaseName = "MoveEndPhase"; + public readonly phaseName = "MoveEndPhase"; private wasFollowUp: boolean; /** Targets from the preceding MovePhase */ diff --git a/src/phases/move-header-phase.ts b/src/phases/move-header-phase.ts index 7280392117b..50100e827d6 100644 --- a/src/phases/move-header-phase.ts +++ b/src/phases/move-header-phase.ts @@ -4,7 +4,7 @@ import type Pokemon from "#app/field/pokemon"; import { BattlePhase } from "./battle-phase"; export class MoveHeaderPhase extends BattlePhase { - protected readonly phaseName = "MoveHeaderPhase"; + public readonly phaseName = "MoveHeaderPhase"; public pokemon: Pokemon; public move: PokemonMove; diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index a536f0be761..300c27e01fc 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -52,7 +52,7 @@ import { StatusEffect } from "#enums/status-effect"; import i18next from "i18next"; export class MovePhase extends BattlePhase { - protected readonly phaseName = "MovePhase"; + public readonly phaseName = "MovePhase"; protected _pokemon: Pokemon; protected _move: PokemonMove; protected _targets: BattlerIndex[]; diff --git a/src/phases/mystery-encounter-phases.ts b/src/phases/mystery-encounter-phases.ts index 7a141f2708c..0378df0a51b 100644 --- a/src/phases/mystery-encounter-phases.ts +++ b/src/phases/mystery-encounter-phases.ts @@ -38,7 +38,7 @@ import { SelectBiomePhase } from "./select-biome-phase"; * - Queuing of the {@linkcode MysteryEncounterOptionSelectedPhase} */ export class MysteryEncounterPhase extends Phase { - protected readonly phaseName = "MysteryEncounterPhase"; + public readonly phaseName = "MysteryEncounterPhase"; private readonly FIRST_DIALOGUE_PROMPT_DELAY = 300; optionSelectSettings?: OptionSelectSettings; @@ -180,7 +180,7 @@ export class MysteryEncounterPhase extends Phase { * Any phase that is meant to follow this one MUST be queued via the onOptionSelect() logic of the selected option */ export class MysteryEncounterOptionSelectedPhase extends Phase { - protected readonly phaseName = "MysteryEncounterOptionSelectedPhase"; + public readonly phaseName = "MysteryEncounterOptionSelectedPhase"; onOptionSelect: OptionPhaseCallback; constructor() { @@ -222,7 +222,7 @@ export class MysteryEncounterOptionSelectedPhase extends Phase { * See {@linkcode TurnEndPhase} for more details */ export class MysteryEncounterBattleStartCleanupPhase extends Phase { - protected readonly phaseName = "MysteryEncounterBattleStartCleanupPhase"; + public readonly phaseName = "MysteryEncounterBattleStartCleanupPhase"; /** * Cleans up `TURN_END` tags, any {@linkcode PostTurnStatusEffectPhase}s, checks for Pokemon switches, then continues */ @@ -286,7 +286,7 @@ export class MysteryEncounterBattleStartCleanupPhase extends Phase { * - Queue the {@linkcode SummonPhase}s, {@linkcode PostSummonPhase}s, etc., required to initialize the phase queue for a battle */ export class MysteryEncounterBattlePhase extends Phase { - protected readonly phaseName = "MysteryEncounterBattlePhase"; + public readonly phaseName = "MysteryEncounterBattlePhase"; disableSwitch: boolean; constructor(disableSwitch = false) { @@ -516,7 +516,7 @@ export class MysteryEncounterBattlePhase extends Phase { * - Queuing of the {@linkcode PostMysteryEncounterPhase} */ export class MysteryEncounterRewardsPhase extends Phase { - protected readonly phaseName = "MysteryEncounterRewardsPhase"; + public readonly phaseName = "MysteryEncounterRewardsPhase"; addHealPhase: boolean; constructor(addHealPhase = false) { @@ -584,7 +584,7 @@ export class MysteryEncounterRewardsPhase extends Phase { * - Queuing of the next wave */ export class PostMysteryEncounterPhase extends Phase { - protected readonly phaseName = "PostMysteryEncounterPhase"; + public readonly phaseName = "PostMysteryEncounterPhase"; private readonly FIRST_DIALOGUE_PROMPT_DELAY = 750; onPostOptionSelect?: OptionPhaseCallback; diff --git a/src/phases/new-battle-phase.ts b/src/phases/new-battle-phase.ts index 121bb38dc12..c37f412e283 100644 --- a/src/phases/new-battle-phase.ts +++ b/src/phases/new-battle-phase.ts @@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene"; import { BattlePhase } from "./battle-phase"; export class NewBattlePhase extends BattlePhase { - protected readonly phaseName = "NewBattlePhase"; + public readonly phaseName = "NewBattlePhase"; start() { super.start(); diff --git a/src/phases/new-biome-encounter-phase.ts b/src/phases/new-biome-encounter-phase.ts index 85b6c90b75f..29ba67cb797 100644 --- a/src/phases/new-biome-encounter-phase.ts +++ b/src/phases/new-biome-encounter-phase.ts @@ -4,7 +4,7 @@ import { getRandomWeatherType } from "#app/data/weather"; import { NextEncounterPhase } from "./next-encounter-phase"; export class NewBiomeEncounterPhase extends NextEncounterPhase { - protected readonly phaseName = "NewBiomeEncounterPhase"; + public readonly phaseName = "NewBiomeEncounterPhase"; doEncounter(): void { globalScene.playBgm(undefined, true); diff --git a/src/phases/next-encounter-phase.ts b/src/phases/next-encounter-phase.ts index 4853904fdc4..c31b4b5bbc3 100644 --- a/src/phases/next-encounter-phase.ts +++ b/src/phases/next-encounter-phase.ts @@ -6,7 +6,7 @@ import { EncounterPhase } from "./encounter-phase"; * Handles generating, loading and preparing for it. */ export class NextEncounterPhase extends EncounterPhase { - protected readonly phaseName: "NextEncounterPhase" | "NewBiomeEncounterPhase" = "NextEncounterPhase"; + public readonly phaseName: "NextEncounterPhase" | "NewBiomeEncounterPhase" = "NextEncounterPhase"; start() { super.start(); } diff --git a/src/phases/obtain-status-effect-phase.ts b/src/phases/obtain-status-effect-phase.ts index 43e0bb4e054..820db910681 100644 --- a/src/phases/obtain-status-effect-phase.ts +++ b/src/phases/obtain-status-effect-phase.ts @@ -11,7 +11,7 @@ import { applyPostSetStatusAbAttrs, PostSetStatusAbAttr } from "#app/data/abilit import { isNullOrUndefined } from "#app/utils/common"; export class ObtainStatusEffectPhase extends PokemonPhase { - protected readonly phaseName = "ObtainStatusEffectPhase"; + public readonly phaseName = "ObtainStatusEffectPhase"; private statusEffect?: StatusEffect; private turnsRemaining?: number; private sourceText?: string | null; diff --git a/src/phases/party-exp-phase.ts b/src/phases/party-exp-phase.ts index 80574426f6d..30fc97d9105 100644 --- a/src/phases/party-exp-phase.ts +++ b/src/phases/party-exp-phase.ts @@ -6,7 +6,7 @@ import { Phase } from "#app/phase"; * Intended to be used as a more 1-off phase to provide exp to the party (such as during MEs), rather than cleanup a battle entirely */ export class PartyExpPhase extends Phase { - protected readonly phaseName = "PartyExpPhase"; + public readonly phaseName = "PartyExpPhase"; expValue: number; useWaveIndexMultiplier?: boolean; pokemonParticipantIds?: Set; diff --git a/src/phases/party-heal-phase.ts b/src/phases/party-heal-phase.ts index ca3d352e6a0..765c7dbad8e 100644 --- a/src/phases/party-heal-phase.ts +++ b/src/phases/party-heal-phase.ts @@ -3,7 +3,7 @@ import { fixedInt } from "#app/utils/common"; import { BattlePhase } from "./battle-phase"; export class PartyHealPhase extends BattlePhase { - protected readonly phaseName = "PartyHealPhase"; + public readonly phaseName = "PartyHealPhase"; private resumeBgm: boolean; constructor(resumeBgm: boolean) { diff --git a/src/phases/pokemon-anim-phase.ts b/src/phases/pokemon-anim-phase.ts index 1866082a0df..b1a21446996 100644 --- a/src/phases/pokemon-anim-phase.ts +++ b/src/phases/pokemon-anim-phase.ts @@ -7,7 +7,7 @@ import { PokemonAnimType } from "#enums/pokemon-anim-type"; import { SpeciesId } from "#enums/species-id"; export class PokemonAnimPhase extends BattlePhase { - protected readonly phaseName = "PokemonAnimPhase"; + public readonly phaseName = "PokemonAnimPhase"; /** The type of animation to play in this phase */ protected key: PokemonAnimType; /** The Pokemon to which this animation applies */ diff --git a/src/phases/pokemon-heal-phase.ts b/src/phases/pokemon-heal-phase.ts index 6219b5846a5..60bbb17c30a 100644 --- a/src/phases/pokemon-heal-phase.ts +++ b/src/phases/pokemon-heal-phase.ts @@ -14,7 +14,7 @@ import { BattlerTagType } from "#app/enums/battler-tag-type"; import type { HealBlockTag } from "#app/data/battler-tags"; export class PokemonHealPhase extends CommonAnimPhase { - protected readonly phaseName = "PokemonHealPhase"; + public readonly phaseName = "PokemonHealPhase"; private hpHealed: number; private message: string | null; private showFullHpMessage: boolean; diff --git a/src/phases/pokemon-transform-phase.ts b/src/phases/pokemon-transform-phase.ts index 05640dcfa9d..c0f3b048003 100644 --- a/src/phases/pokemon-transform-phase.ts +++ b/src/phases/pokemon-transform-phase.ts @@ -13,7 +13,7 @@ import i18next from "i18next"; * Used for Transform (move) and Imposter (ability) */ export class PokemonTransformPhase extends PokemonPhase { - protected readonly phaseName = "PokemonTransformPhase"; + public readonly phaseName = "PokemonTransformPhase"; protected targetIndex: BattlerIndex; private playSound: boolean; diff --git a/src/phases/post-game-over-phase.ts b/src/phases/post-game-over-phase.ts index f3c349385df..f985419da7a 100644 --- a/src/phases/post-game-over-phase.ts +++ b/src/phases/post-game-over-phase.ts @@ -4,7 +4,7 @@ import type { EndCardPhase } from "./end-card-phase"; import { TitlePhase } from "./title-phase"; export class PostGameOverPhase extends Phase { - protected readonly phaseName = "PostGameOverPhase"; + public readonly phaseName = "PostGameOverPhase"; private endCardPhase?: EndCardPhase; constructor(endCardPhase?: EndCardPhase) { diff --git a/src/phases/post-summon-phase.ts b/src/phases/post-summon-phase.ts index a573042ccf2..a7faf614292 100644 --- a/src/phases/post-summon-phase.ts +++ b/src/phases/post-summon-phase.ts @@ -7,7 +7,7 @@ import { MysteryEncounterPostSummonTag } from "#app/data/battler-tags"; import { BattlerTagType } from "#enums/battler-tag-type"; export class PostSummonPhase extends PokemonPhase { - protected readonly phaseName = "PostSummonPhase"; + public readonly phaseName = "PostSummonPhase"; start() { super.start(); diff --git a/src/phases/post-turn-status-effect-phase.ts b/src/phases/post-turn-status-effect-phase.ts index df5e1dc20f4..47a84059745 100644 --- a/src/phases/post-turn-status-effect-phase.ts +++ b/src/phases/post-turn-status-effect-phase.ts @@ -17,7 +17,7 @@ import { BooleanHolder, NumberHolder } from "#app/utils/common"; import { PokemonPhase } from "./pokemon-phase"; export class PostTurnStatusEffectPhase extends PokemonPhase { - protected readonly phaseName = "PostTurnStatusEffectPhase"; + public readonly phaseName = "PostTurnStatusEffectPhase"; // biome-ignore lint/complexity/noUselessConstructor: Not unnecessary as it makes battlerIndex required constructor(battlerIndex: BattlerIndex) { super(battlerIndex); diff --git a/src/phases/quiet-form-change-phase.ts b/src/phases/quiet-form-change-phase.ts index b27009de6d4..38dcb2bf439 100644 --- a/src/phases/quiet-form-change-phase.ts +++ b/src/phases/quiet-form-change-phase.ts @@ -19,7 +19,7 @@ import { } from "#app/data/abilities/ability"; export class QuietFormChangePhase extends BattlePhase { - protected readonly phaseName = "QuietFormChangePhase"; + public readonly phaseName = "QuietFormChangePhase"; protected pokemon: Pokemon; protected formChange: SpeciesFormChange; diff --git a/src/phases/reload-session-phase.ts b/src/phases/reload-session-phase.ts index 6a579728ca6..ac9337753c4 100644 --- a/src/phases/reload-session-phase.ts +++ b/src/phases/reload-session-phase.ts @@ -4,7 +4,7 @@ import { UiMode } from "#enums/ui-mode"; import { fixedInt } from "#app/utils/common"; export class ReloadSessionPhase extends Phase { - protected readonly phaseName = "ReloadSessionPhase"; + public readonly phaseName = "ReloadSessionPhase"; private systemDataStr?: string; constructor(systemDataStr?: string) { diff --git a/src/phases/reset-status-phase.ts b/src/phases/reset-status-phase.ts index 38b1686afb2..779f375d7e2 100644 --- a/src/phases/reset-status-phase.ts +++ b/src/phases/reset-status-phase.ts @@ -7,7 +7,7 @@ import { BattlePhase } from "#app/phases/battle-phase"; * This is necessary to perform in a phase primarly to ensure that the status icon disappears at the correct time in the battle */ export class ResetStatusPhase extends BattlePhase { - protected readonly phaseName = "ResetStatusPhase"; + public readonly phaseName = "ResetStatusPhase"; private readonly pokemon: Pokemon; private readonly affectConfusion: boolean; private readonly reloadAssets: boolean; diff --git a/src/phases/return-phase.ts b/src/phases/return-phase.ts index 4cdea547682..6365256d40a 100644 --- a/src/phases/return-phase.ts +++ b/src/phases/return-phase.ts @@ -4,7 +4,7 @@ import { SwitchType } from "#enums/switch-type"; import { SwitchSummonPhase } from "./switch-summon-phase"; export class ReturnPhase extends SwitchSummonPhase { - protected readonly phaseName = "ReturnPhase"; + public readonly phaseName = "ReturnPhase"; constructor(fieldIndex: number) { super(SwitchType.SWITCH, fieldIndex, -1, true); } diff --git a/src/phases/revival-blessing-phase.ts b/src/phases/revival-blessing-phase.ts index 05c6f51d2bb..3f70c93dd7a 100644 --- a/src/phases/revival-blessing-phase.ts +++ b/src/phases/revival-blessing-phase.ts @@ -15,7 +15,7 @@ import type { PlayerPokemon } from "#app/field/pokemon"; * when used by one of the player's Pokemon. */ export class RevivalBlessingPhase extends BattlePhase { - protected readonly phaseName = "RevivalBlessingPhase"; + public readonly phaseName = "RevivalBlessingPhase"; constructor(protected user: PlayerPokemon) { super(); } diff --git a/src/phases/ribbon-modifier-reward-phase.ts b/src/phases/ribbon-modifier-reward-phase.ts index 12db1ebf1bf..949f7af0302 100644 --- a/src/phases/ribbon-modifier-reward-phase.ts +++ b/src/phases/ribbon-modifier-reward-phase.ts @@ -6,7 +6,7 @@ import i18next from "i18next"; import { ModifierRewardPhase } from "./modifier-reward-phase"; export class RibbonModifierRewardPhase extends ModifierRewardPhase { - protected readonly phaseName = "RibbonModifierRewardPhase"; + public readonly phaseName = "RibbonModifierRewardPhase"; private species: PokemonSpecies; constructor(modifierTypeFunc: ModifierTypeFunc, species: PokemonSpecies) { diff --git a/src/phases/scan-ivs-phase.ts b/src/phases/scan-ivs-phase.ts index 0537f8e9684..df68a2d1cab 100644 --- a/src/phases/scan-ivs-phase.ts +++ b/src/phases/scan-ivs-phase.ts @@ -8,7 +8,7 @@ import i18next from "i18next"; import { PokemonPhase } from "./pokemon-phase"; export class ScanIvsPhase extends PokemonPhase { - protected readonly phaseName = "ScanIvsPhase"; + public readonly phaseName = "ScanIvsPhase"; // biome-ignore lint/complexity/noUselessConstructor: This changes `battlerIndex` to be required constructor(battlerIndex: BattlerIndex) { super(battlerIndex); diff --git a/src/phases/select-biome-phase.ts b/src/phases/select-biome-phase.ts index 64e403bd4b2..ef6b39e8b8f 100644 --- a/src/phases/select-biome-phase.ts +++ b/src/phases/select-biome-phase.ts @@ -10,7 +10,7 @@ import { PartyHealPhase } from "./party-heal-phase"; import { SwitchBiomePhase } from "./switch-biome-phase"; export class SelectBiomePhase extends BattlePhase { - protected readonly phaseName = "SelectBiomePhase"; + public readonly phaseName = "SelectBiomePhase"; start() { super.start(); diff --git a/src/phases/select-challenge-phase.ts b/src/phases/select-challenge-phase.ts index b189518870c..dcf72d1b441 100644 --- a/src/phases/select-challenge-phase.ts +++ b/src/phases/select-challenge-phase.ts @@ -3,7 +3,7 @@ import { Phase } from "#app/phase"; import { UiMode } from "#enums/ui-mode"; export class SelectChallengePhase extends Phase { - protected readonly phaseName = "SelectChallengePhase"; + public readonly phaseName = "SelectChallengePhase"; start() { super.start(); diff --git a/src/phases/select-gender-phase.ts b/src/phases/select-gender-phase.ts index 2ba06f937d9..ad8515e312e 100644 --- a/src/phases/select-gender-phase.ts +++ b/src/phases/select-gender-phase.ts @@ -6,7 +6,7 @@ import { UiMode } from "#enums/ui-mode"; import i18next from "i18next"; export class SelectGenderPhase extends Phase { - protected readonly phaseName = "SelectGenderPhase"; + public readonly phaseName = "SelectGenderPhase"; start(): void { super.start(); diff --git a/src/phases/select-modifier-phase.ts b/src/phases/select-modifier-phase.ts index f01156cfde4..6e429d9ad7f 100644 --- a/src/phases/select-modifier-phase.ts +++ b/src/phases/select-modifier-phase.ts @@ -32,7 +32,7 @@ import type { CustomModifierSettings } from "#app/modifier/modifier-type"; import { isNullOrUndefined, NumberHolder } from "#app/utils/common"; export class SelectModifierPhase extends BattlePhase { - protected readonly phaseName = "SelectModifierPhase"; + public readonly phaseName = "SelectModifierPhase"; private rerollCount: number; private modifierTiers?: ModifierTier[]; private customModifierSettings?: CustomModifierSettings; diff --git a/src/phases/select-starter-phase.ts b/src/phases/select-starter-phase.ts index 67d6b695887..d25c2dd7211 100644 --- a/src/phases/select-starter-phase.ts +++ b/src/phases/select-starter-phase.ts @@ -15,7 +15,7 @@ import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import { isNullOrUndefined } from "#app/utils/common"; export class SelectStarterPhase extends Phase { - protected readonly phaseName = "SelectStarterPhase"; + public readonly phaseName = "SelectStarterPhase"; start() { super.start(); diff --git a/src/phases/select-target-phase.ts b/src/phases/select-target-phase.ts index ff96d81d0dc..46ba378a56c 100644 --- a/src/phases/select-target-phase.ts +++ b/src/phases/select-target-phase.ts @@ -8,7 +8,7 @@ import i18next from "#app/plugins/i18n"; import { allMoves } from "#app/data/data-lists"; export class SelectTargetPhase extends PokemonPhase { - protected readonly phaseName = "SelectTargetPhase"; + public readonly phaseName = "SelectTargetPhase"; // biome-ignore lint/complexity/noUselessConstructor: This makes `fieldIndex` required constructor(fieldIndex: number) { super(fieldIndex); diff --git a/src/phases/shiny-sparkle-phase.ts b/src/phases/shiny-sparkle-phase.ts index 3abf0142f19..93d7dd67209 100644 --- a/src/phases/shiny-sparkle-phase.ts +++ b/src/phases/shiny-sparkle-phase.ts @@ -3,7 +3,7 @@ import type { BattlerIndex } from "#app/battle"; import { PokemonPhase } from "./pokemon-phase"; export class ShinySparklePhase extends PokemonPhase { - protected readonly phaseName = "ShinySparklePhase"; + public readonly phaseName = "ShinySparklePhase"; // biome-ignore lint/complexity/noUselessConstructor: This makes `battlerIndex` required constructor(battlerIndex: BattlerIndex) { super(battlerIndex); diff --git a/src/phases/show-ability-phase.ts b/src/phases/show-ability-phase.ts index 410704d6091..81aa69537e5 100644 --- a/src/phases/show-ability-phase.ts +++ b/src/phases/show-ability-phase.ts @@ -5,7 +5,7 @@ import { getPokemonNameWithAffix } from "#app/messages"; import { HideAbilityPhase } from "#app/phases/hide-ability-phase"; export class ShowAbilityPhase extends PokemonPhase { - protected readonly phaseName = "ShowAbilityPhase"; + public readonly phaseName = "ShowAbilityPhase"; private passive: boolean; private pokemonName: string; private abilityName: string; diff --git a/src/phases/show-party-exp-bar-phase.ts b/src/phases/show-party-exp-bar-phase.ts index ae2bad7611d..6b4236f0868 100644 --- a/src/phases/show-party-exp-bar-phase.ts +++ b/src/phases/show-party-exp-bar-phase.ts @@ -8,7 +8,7 @@ import { LevelUpPhase } from "./level-up-phase"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; export class ShowPartyExpBarPhase extends PlayerPartyMemberPokemonPhase { - protected readonly phaseName = "ShowPartyExpBarPhase"; + public readonly phaseName = "ShowPartyExpBarPhase"; private expValue: number; constructor(partyMemberIndex: number, expValue: number) { diff --git a/src/phases/show-trainer-phase.ts b/src/phases/show-trainer-phase.ts index dab3f7f9107..bae6ecd839c 100644 --- a/src/phases/show-trainer-phase.ts +++ b/src/phases/show-trainer-phase.ts @@ -3,7 +3,7 @@ import { PlayerGender } from "#app/enums/player-gender"; import { BattlePhase } from "./battle-phase"; export class ShowTrainerPhase extends BattlePhase { - protected readonly phaseName = "ShowTrainerPhase"; + public readonly phaseName = "ShowTrainerPhase"; start() { super.start(); diff --git a/src/phases/stat-stage-change-phase.ts b/src/phases/stat-stage-change-phase.ts index 493b2a8efe3..75bab369dcb 100644 --- a/src/phases/stat-stage-change-phase.ts +++ b/src/phases/stat-stage-change-phase.ts @@ -31,7 +31,7 @@ export type StatStageChangeCallback = ( ) => void; export class StatStageChangePhase extends PokemonPhase { - protected readonly phaseName = "StatStageChangePhase"; + public readonly phaseName = "StatStageChangePhase"; private stats: BattleStat[]; private selfTarget: boolean; private stages: number; diff --git a/src/phases/summon-missing-phase.ts b/src/phases/summon-missing-phase.ts index bbcaf1b6730..ce3e982055e 100644 --- a/src/phases/summon-missing-phase.ts +++ b/src/phases/summon-missing-phase.ts @@ -4,7 +4,7 @@ import { SummonPhase } from "./summon-phase"; import { globalScene } from "#app/global-scene"; export class SummonMissingPhase extends SummonPhase { - protected readonly phaseName = "SummonMissingPhase"; + public readonly phaseName = "SummonMissingPhase"; preSummon(): void { globalScene.ui.showText( i18next.t("battle:sendOutPokemon", { diff --git a/src/phases/summon-phase.ts b/src/phases/summon-phase.ts index f79d0c497a9..2cd7b122bb3 100644 --- a/src/phases/summon-phase.ts +++ b/src/phases/summon-phase.ts @@ -18,8 +18,7 @@ import { globalScene } from "#app/global-scene"; export class SummonPhase extends PartyMemberPokemonPhase { // The union type is needed to keep typescript happy as these phases extend from SummonPhase - protected readonly phaseName: "SummonPhase" | "SummonMissingPhase" | "SwitchSummonPhase" | "ReturnPhase" = - "SummonPhase"; + public readonly phaseName: "SummonPhase" | "SummonMissingPhase" | "SwitchSummonPhase" | "ReturnPhase" = "SummonPhase"; private loaded: boolean; constructor(fieldIndex: number, player = true, loaded = false) { diff --git a/src/phases/switch-biome-phase.ts b/src/phases/switch-biome-phase.ts index c087455fd76..f84f1d517b4 100644 --- a/src/phases/switch-biome-phase.ts +++ b/src/phases/switch-biome-phase.ts @@ -4,7 +4,7 @@ import { getBiomeKey } from "#app/field/arena"; import { BattlePhase } from "./battle-phase"; export class SwitchBiomePhase extends BattlePhase { - protected readonly phaseName = "SwitchBiomePhase"; + public readonly phaseName = "SwitchBiomePhase"; private nextBiome: BiomeId; constructor(nextBiome: BiomeId) { diff --git a/src/phases/switch-phase.ts b/src/phases/switch-phase.ts index 2c3664e7b21..b38d21fe6c3 100644 --- a/src/phases/switch-phase.ts +++ b/src/phases/switch-phase.ts @@ -10,7 +10,7 @@ import { SwitchSummonPhase } from "./switch-summon-phase"; * for the player (if a switch would be valid for the current battle state). */ export class SwitchPhase extends BattlePhase { - protected readonly phaseName = "SwitchPhase"; + public readonly phaseName = "SwitchPhase"; protected readonly fieldIndex: number; private readonly switchType: SwitchType; private readonly isModal: boolean; diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index 5119cb1ee2d..d81ca6029c5 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -22,7 +22,7 @@ import { SubstituteTag } from "#app/data/battler-tags"; import { SwitchType } from "#enums/switch-type"; export class SwitchSummonPhase extends SummonPhase { - protected readonly phaseName: "SwitchSummonPhase" | "ReturnPhase" = "SwitchSummonPhase"; + public readonly phaseName: "SwitchSummonPhase" | "ReturnPhase" = "SwitchSummonPhase"; private readonly switchType: SwitchType; private readonly slotIndex: number; private readonly doReturn: boolean; diff --git a/src/phases/tera-phase.ts b/src/phases/tera-phase.ts index 56cbe8b98a3..5e4ea2fe54e 100644 --- a/src/phases/tera-phase.ts +++ b/src/phases/tera-phase.ts @@ -9,7 +9,7 @@ import { SpeciesFormChangeTeraTrigger } from "#app/data/pokemon-forms"; import { CommonAnim, CommonBattleAnim } from "#app/data/battle-anims"; export class TeraPhase extends BattlePhase { - protected readonly phaseName = "TeraPhase"; + public readonly phaseName = "TeraPhase"; public pokemon: Pokemon; constructor(pokemon: Pokemon) { diff --git a/src/phases/title-phase.ts b/src/phases/title-phase.ts index 8eb17b7550b..aa9ae49ca8b 100644 --- a/src/phases/title-phase.ts +++ b/src/phases/title-phase.ts @@ -29,7 +29,7 @@ import { globalScene } from "#app/global-scene"; import Overrides from "#app/overrides"; export class TitlePhase extends Phase { - protected readonly phaseName = "TitlePhase"; + public readonly phaseName = "TitlePhase"; private loaded = false; private lastSessionData: SessionSaveData; public gameMode: GameModes; diff --git a/src/phases/toggle-double-position-phase.ts b/src/phases/toggle-double-position-phase.ts index bc02408b28d..a6b8705f580 100644 --- a/src/phases/toggle-double-position-phase.ts +++ b/src/phases/toggle-double-position-phase.ts @@ -3,7 +3,7 @@ import { FieldPosition } from "#app/field/pokemon"; import { BattlePhase } from "./battle-phase"; export class ToggleDoublePositionPhase extends BattlePhase { - protected readonly phaseName = "ToggleDoublePositionPhase"; + public readonly phaseName = "ToggleDoublePositionPhase"; private double: boolean; constructor(double: boolean) { diff --git a/src/phases/trainer-victory-phase.ts b/src/phases/trainer-victory-phase.ts index 42b1a115b89..bd035248530 100644 --- a/src/phases/trainer-victory-phase.ts +++ b/src/phases/trainer-victory-phase.ts @@ -14,7 +14,7 @@ import { achvs } from "#app/system/achv"; import { timedEventManager } from "#app/global-event-manager"; export class TrainerVictoryPhase extends BattlePhase { - protected readonly phaseName = "TrainerVictoryPhase"; + public readonly phaseName = "TrainerVictoryPhase"; start() { globalScene.disableMenu = true; diff --git a/src/phases/turn-end-phase.ts b/src/phases/turn-end-phase.ts index e38d690c0db..4d486c4bbd6 100644 --- a/src/phases/turn-end-phase.ts +++ b/src/phases/turn-end-phase.ts @@ -18,7 +18,7 @@ import { PokemonHealPhase } from "./pokemon-heal-phase"; import { globalScene } from "#app/global-scene"; export class TurnEndPhase extends FieldPhase { - protected readonly phaseName = "TurnEndPhase"; + public readonly phaseName = "TurnEndPhase"; start() { super.start(); diff --git a/src/phases/turn-init-phase.ts b/src/phases/turn-init-phase.ts index dfb74d92277..7f94acd3b32 100644 --- a/src/phases/turn-init-phase.ts +++ b/src/phases/turn-init-phase.ts @@ -15,7 +15,7 @@ import { TurnStartPhase } from "./turn-start-phase"; import { globalScene } from "#app/global-scene"; export class TurnInitPhase extends FieldPhase { - protected readonly phaseName = "TurnInitPhase"; + public readonly phaseName = "TurnInitPhase"; start() { super.start(); diff --git a/src/phases/turn-start-phase.ts b/src/phases/turn-start-phase.ts index bc42c07c40c..2d009b30bf3 100644 --- a/src/phases/turn-start-phase.ts +++ b/src/phases/turn-start-phase.ts @@ -25,7 +25,7 @@ import { globalScene } from "#app/global-scene"; import { TeraPhase } from "./tera-phase"; export class TurnStartPhase extends FieldPhase { - protected readonly phaseName = "TurnStartPhase"; + public readonly phaseName = "TurnStartPhase"; /** * This orders the active Pokemon on the field by speed into an BattlerIndex array and returns that array. * It also checks for Trick Room and reverses the array if it is present. diff --git a/src/phases/unavailable-phase.ts b/src/phases/unavailable-phase.ts index 4c211d21bd7..4c4333ceb90 100644 --- a/src/phases/unavailable-phase.ts +++ b/src/phases/unavailable-phase.ts @@ -4,7 +4,7 @@ import { UiMode } from "#enums/ui-mode"; import { LoginPhase } from "./login-phase"; export class UnavailablePhase extends Phase { - protected readonly phaseName = "UnavailablePhase"; + public readonly phaseName = "UnavailablePhase"; start(): void { globalScene.ui.setMode(UiMode.UNAVAILABLE, () => { globalScene.unshiftPhase(new LoginPhase(true)); diff --git a/src/phases/unlock-phase.ts b/src/phases/unlock-phase.ts index b60505007a8..839ac31dc5d 100644 --- a/src/phases/unlock-phase.ts +++ b/src/phases/unlock-phase.ts @@ -6,7 +6,7 @@ import { UiMode } from "#enums/ui-mode"; import i18next from "i18next"; export class UnlockPhase extends Phase { - protected readonly phaseName = "UnlockPhase"; + public readonly phaseName = "UnlockPhase"; private unlockable: Unlockables; constructor(unlockable: Unlockables) { diff --git a/src/phases/victory-phase.ts b/src/phases/victory-phase.ts index 7aaddb92059..2d21f8abc08 100644 --- a/src/phases/victory-phase.ts +++ b/src/phases/victory-phase.ts @@ -18,7 +18,7 @@ import { timedEventManager } from "#app/global-event-manager"; import { SelectBiomePhase } from "./select-biome-phase"; export class VictoryPhase extends PokemonPhase { - protected readonly phaseName = "VictoryPhase"; + public readonly phaseName = "VictoryPhase"; /** If true, indicates that the phase is intended for EXP purposes only, and not to continue a battle to next phase */ isExpOnly: boolean; diff --git a/src/phases/weather-effect-phase.ts b/src/phases/weather-effect-phase.ts index a58ab209d03..cd91b89771c 100644 --- a/src/phases/weather-effect-phase.ts +++ b/src/phases/weather-effect-phase.ts @@ -19,7 +19,7 @@ import { BooleanHolder, toDmgValue } from "#app/utils/common"; import { CommonAnimPhase } from "./common-anim-phase"; export class WeatherEffectPhase extends CommonAnimPhase { - protected readonly phaseName = "WeatherEffectPhase"; + public readonly phaseName = "WeatherEffectPhase"; public weather: Weather | null; constructor() { diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 263842bd4f9..00e166f075d 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -665,7 +665,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { show(args: any[]): boolean { // Allow the use of candies if we are in one of the whitelisted phases this.canUseCandies = ["TitlePhase", "SelectStarterPhase", "CommandPhase"].includes( - globalScene.getCurrentPhase()?.constructor.name ?? "", + globalScene.getCurrentPhase()?.phaseName ?? "", ); if (args.length >= 1 && args[0] === "refresh") {