diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index af46d41ed24..a3f12510a34 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -47,7 +47,8 @@ import { WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/data/mystery-encounters/mys import { getNatureName } from "#app/data/nature"; export class EncounterPhase extends BattlePhase { - protected readonly phaseName = "EncounterPhase"; + // Union type is necessary as these + protected readonly phaseName: "EncounterPhase" | "NextEncounterPhase" | "NewBiomeEncounterPhase" = "EncounterPhase"; private loaded: boolean; constructor(loaded = false) { diff --git a/src/phases/modifier-reward-phase.ts b/src/phases/modifier-reward-phase.ts index 5a4f94dc154..f905496bb8c 100644 --- a/src/phases/modifier-reward-phase.ts +++ b/src/phases/modifier-reward-phase.ts @@ -7,7 +7,8 @@ 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" = "ModifierRewardPhase"; + protected readonly phaseName: "ModifierRewardPhase" | "RibbonModifierRewardPhase" | "GameOverModifierRewardPhase" = + "ModifierRewardPhase"; protected modifierType: ModifierType; constructor(modifierTypeFunc: ModifierTypeFunc) { diff --git a/src/phases/next-encounter-phase.ts b/src/phases/next-encounter-phase.ts index 6bf33a12608..4853904fdc4 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"; + protected readonly phaseName: "NextEncounterPhase" | "NewBiomeEncounterPhase" = "NextEncounterPhase"; start() { super.start(); } diff --git a/src/phases/summon-phase.ts b/src/phases/summon-phase.ts index 81516d25929..f79d0c497a9 100644 --- a/src/phases/summon-phase.ts +++ b/src/phases/summon-phase.ts @@ -17,9 +17,9 @@ import { applyPreSummonAbAttrs, PreSummonAbAttr } from "#app/data/abilities/abil import { globalScene } from "#app/global-scene"; export class SummonPhase extends PartyMemberPokemonPhase { - // Both SwitchSummonPhase and SummonMissingPhase extend this class and so we must use a - // union type to make typescript happy. - protected readonly phaseName: "SummonPhase" | "SummonMissingPhase" | "SwitchSummonPhase" = "SummonPhase"; + // The union type is needed to keep typescript happy as these phases extend from SummonPhase + protected readonly phaseName: "SummonPhase" | "SummonMissingPhase" | "SwitchSummonPhase" | "ReturnPhase" = + "SummonPhase"; private loaded: boolean; constructor(fieldIndex: number, player = true, loaded = false) { diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index 566698929b8..5119cb1ee2d 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"; + protected readonly phaseName: "SwitchSummonPhase" | "ReturnPhase" = "SwitchSummonPhase"; private readonly switchType: SwitchType; private readonly slotIndex: number; private readonly doReturn: boolean;