mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Fix missing union types for phaseName
This commit is contained in:
parent
86b59a0243
commit
a5721a76be
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user