PokéRogue
    Preparing search index...

    A Phase represents a discrete chunk of game logic that must be completed.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    canCancel: boolean

    Whether the evolution can be cancelled by the player

    evoChain: TweenChain | null = null
    evolutionBaseBg: Image
    evolutionBg: Video
    evolutionBgOverlay: Rectangle
    evolutionContainer: Container

    Container for all assets used by the scene. When the scene is cleared, the children within this are destroyed.

    evolutionOverlay: Rectangle
    formChange: SpeciesFormChange
    lastLevel: number
    modal: boolean
    phaseName: "FormChangePhase"

    The string name of the phase, used to identify the phase type for is

    pokemon: PlayerPokemon
    pokemonEvoSprite: Sprite
    pokemonEvoTintSprite: Sprite
    pokemonSprite: Sprite
    pokemonTintSprite: Sprite

    Methods

    • Commence the animations that occur once the form change evolution cycle is complete

      Parameters

      • preName: string

        The name of the Pokemon before the evolution

      • transformedPokemon: Pokemon

        The Pokemon being transformed into

      Returns void

    • Commence the sequence of tweens and events that occur during the evolution animation

      Parameters

      • preName: string

        The name of the Pokemon before the evolution

      • transformedPokemon: Pokemon

        The Pokemon after the evolution

      Returns void

    • Configure the sprite, setting its pipeline data

      Parameters

      • pokemon: Pokemon

        The pokemon object that the sprite information is configured from

      • sprite: Sprite

        The sprite object to configure

      • setPipeline: boolean = true

        Whether to also set the pipeline; should be false if the sprite is only being updated with new sprite assets

      Returns Sprite

      The sprite object that was passed in

    • End the current phase and start the next one.

      Returns void

      Phases that override end() are responsible for calling super.end() themselves (after any async operations resolve). Additionally, attempting to call this function multiple times from the same Phase will likely crash the game.

    • Check whether this Phase is of the given type without requiring instanceof.

      Type Parameters

      • K extends
            | "AddEnemyBuffModifierPhase"
            | "AttemptCapturePhase"
            | "AttemptRunPhase"
            | "BattleEndPhase"
            | "BerryPhase"
            | "CheckInterludePhase"
            | "CheckStatusEffectPhase"
            | "CheckSwitchPhase"
            | "CommandPhase"
            | "CommonAnimPhase"
            | "DamageAnimPhase"
            | "DynamicPhaseMarker"
            | "EggHatchPhase"
            | "EggLapsePhase"
            | "EggSummaryPhase"
            | "EncounterPhase"
            | "EndCardPhase"
            | "EndEvolutionPhase"
            | "EnemyCommandPhase"
            | "EvolutionPhase"
            | "ExpPhase"
            | "FaintPhase"
            | "FormChangePhase"
            | "GameOverPhase"
            | "GameOverModifierRewardPhase"
            | "HideAbilityPhase"
            | "HidePartyExpBarPhase"
            | "InitEncounterPhase"
            | "LearnMovePhase"
            | "LevelCapPhase"
            | "LevelUpPhase"
            | "LoadMoveAnimPhase"
            | "LoginPhase"
            | "MessagePhase"
            | "ModifierRewardPhase"
            | "MoneyRewardPhase"
            | "MoveAnimPhase"
            | "MoveChargePhase"
            | "MoveEffectPhase"
            | "MoveEndPhase"
            | "MoveHeaderPhase"
            | "MoveReflectPhase"
            | "MovePhase"
            | "MysteryEncounterPhase"
            | "MysteryEncounterOptionSelectedPhase"
            | "MysteryEncounterBattlePhase"
            | "MysteryEncounterBattleStartCleanupPhase"
            | "MysteryEncounterRewardsPhase"
            | "PostMysteryEncounterPhase"
            | "NewBattlePhase"
            | "NewBiomeEncounterPhase"
            | "NextEncounterPhase"
            | "ObtainStatusEffectPhase"
            | "PartyExpPhase"
            | "PartyHealPhase"
            | "PokemonAnimPhase"
            | "PokemonHealPhase"
            | "PokemonTransformPhase"
            | "PositionalTagPhase"
            | "PostGameOverPhase"
            | "PostSummonPhase"
            | "PostTurnStatusEffectPhase"
            | "QuietFormChangePhase"
            | "ResetStatusPhase"
            | "ReturnPhase"
            | "RevivalBlessingPhase"
            | "RibbonModifierRewardPhase"
            | "ScanIvsPhase"
            | "SelectBiomePhase"
            | "SelectChallengePhase"
            | "SelectGenderPhase"
            | "SelectModifierPhase"
            | "SelectStarterPhase"
            | "SelectTargetPhase"
            | "ShinySparklePhase"
            | "ShowAbilityPhase"
            | "ShowPartyExpBarPhase"
            | "ShowTrainerPhase"
            | "StatStageChangePhase"
            | "SummonMissingPhase"
            | "SummonPhase"
            | "SwitchBiomePhase"
            | "SwitchPhase"
            | "SwitchSummonPhase"
            | "TeraPhase"
            | "TitlePhase"
            | "ToggleDoublePositionPhase"
            | "TrainerVictoryPhase"
            | "TurnEndPhase"
            | "TurnInitPhase"
            | "TurnStartPhase"
            | "UnavailablePhase"
            | "UnlockPhase"
            | "VictoryPhase"
            | "WeatherEffectPhase"

      Parameters

      • phaseName: K

        The name of the phase to check

      Returns this is PhaseMap[K]

      Whether this Phase is of the provided type.

      This does not check for subclasses! It only checks if the phase is exactly the given type. This method exists to avoid circular import issues, as using instanceof would require importing each phase.

    • Commence the tweens that play after the form change animation finishes

      Parameters

      • transformedPokemon: Pokemon

        The Pokemon after the evolution

      • preName: string

        The name of the Pokemon before the evolution

      Returns void