PokéRogue
    Preparing search index...

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

    Hierarchy (View Summary)

    Index
    • Parameters

      • battlerIndex: BattlerIndex
      • hpHealed: number
      • __namedParameters: {
            fullRestorePP?: boolean;
            healStatus?: boolean;
            message?: string;
            preventFullHeal?: boolean;
            revive?: boolean;
            showFullHpMessage?: boolean;
            skipAnim?: boolean;
        } = {}

      Returns PokemonHealPhase

    battlerIndex: number

    The battler index this phase refers to, or the pokemon ID if greater than 3. TODO: Make this either use IDs or BattlerIndexes, not a weird mix of both

    fieldIndex: number

    Remove in favor of battlerIndex pleas for fuck's sake

    fullRestorePP: boolean

    Whether to fully restore PP upon healing. Used solely for Lunar Dance.

    false

    healStatus: boolean

    Whether to heal the affected Pokemon's status condition.

    false

    hpHealed: number

    The base amount of HP to heal.

    message: string | undefined

    The message to display upon healing the target, or undefined to show no message.
    Will be overridden by the full HP message if showFullHpMessage is set to true.

    phaseName: "PokemonHealPhase"

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

    player: boolean
    preventFullHeal: boolean

    Whether to prevent fully healing affected Pokemon, leaving them 1 HP below full instead.

    false

    revive: boolean

    Whether to revive the affected Pokemon in addition to healing.
    Revives will not be affected by any Healing Charms.

    false

    showFullHpMessage: boolean

    Whether to show a failure message upon healing a Pokemon already at full HP.

    true

    skipAnim: boolean

    Whether to skip showing the healing animation.

    false

    • End the current phase and start the next one.

      Returns Promise<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.

    • Calculate the amount of HP to be healed during this Phase.

      Returns number

      The updated healing amount post-modifications, capped at the Pokemon's maximum HP.

      The effect of Healing Charms is rounded down for parity with the closest mainline counterpart (e.g. Big Root).

    • 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"
            | "DancerPhase"
            | "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.