pokemon-rogue-battle
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _pokemon: Pokemon
    _targets: BattlerIndex[]
    cancelled: boolean = false

    Whether the current move should fail and retain PP.

    failed: boolean = false

    Whether the current move should fail but still use PP.

    forcedLast: boolean

    Whether the current move is forced last (used for Quash).

    phaseName: "MovePhase"

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

    useMode: MoveUseMode

    Accessors

    Methods

    • Checks if the pokemon is active, if the move is usable, and that the move is targeting something.

      Parameters

      • ignoreDisableTags: boolean = false

        true to not check if the move is disabled

      Returns boolean

      true if all the checks pass

    • Queue a MoveChargePhase for this phase's invoked move. Does NOT consume PP (occurs on the 2nd strike of the move)

      Returns void

    • Fail the move currently being used. Handles failure messages, pushing to move history, etc.

      Parameters

      • showText: boolean

        Whether to show move text when failing the move.

      • failedDueToWeather: boolean = false

        Whether the move failed due to weather (default false)

      • failedDueToTerrain: boolean = false

        Whether the move failed due to terrain (default false)

      Returns void

    • Applies PP increasing abilities (currently only Pressure) if they exist on the target pokemon. Note that targets must include only active pokemon.

      TODO: This hardcodes the PP increase at 1 per opponent, rather than deferring to the ability.

      Parameters

      Returns number

    • Handles the case where the move was cancelled or failed:

      • Uses PP if the move failed (not cancelled) and should use PP (failed moves are not affected by Pressure)
      • Records a cancelled OR failed move in move history, so abilities like Truant don't trigger on the next turn and soft-lock.
      • Lapses MOVE_EFFECT tags:
        • Semi-invulnerable battler tags (Fly/Dive/etc.) are intended to lapse on move effects, but also need to lapse on move failure/cancellation.

          TODO: ...this seems weird.

      • Lapses AFTER_MOVE tags:
      • Removes the second turn of charge moves

      Returns void

    • Check if the phase is of the given type without requiring instanceof.

      Type Parameters

      • K extends
            | "ActivatePriorityQueuePhase"
            | "AddEnemyBuffModifierPhase"
            | "AttemptCapturePhase"
            | "AttemptRunPhase"
            | "BattleEndPhase"
            | "BerryPhase"
            | "CheckInterludePhase"
            | "CheckStatusEffectPhase"
            | "CheckSwitchPhase"
            | "CommandPhase"
            | "CommonAnimPhase"
            | "DamageAnimPhase"
            | "EggHatchPhase"
            | "EggLapsePhase"
            | "EggSummaryPhase"
            | "EncounterPhase"
            | "EndCardPhase"
            | "EndEvolutionPhase"
            | "EnemyCommandPhase"
            | "EvolutionPhase"
            | "ExpPhase"
            | "FaintPhase"
            | "FormChangePhase"
            | "GameOverPhase"
            | "GameOverModifierRewardPhase"
            | "HideAbilityPhase"
            | "HidePartyExpBarPhase"
            | "LearnMovePhase"
            | "LevelCapPhase"
            | "LevelUpPhase"
            | "LoadMoveAnimPhase"
            | "LoginPhase"
            | "MessagePhase"
            | "ModifierRewardPhase"
            | "MoneyRewardPhase"
            | "MoveAnimPhase"
            | "MoveChargePhase"
            | "MoveEffectPhase"
            | "MoveEndPhase"
            | "MoveHeaderPhase"
            | "MovePhase"
            | "MysteryEncounterPhase"
            | "MysteryEncounterOptionSelectedPhase"
            | "MysteryEncounterBattlePhase"
            | "MysteryEncounterBattleStartCleanupPhase"
            | "MysteryEncounterRewardsPhase"
            | "PostMysteryEncounterPhase"
            | "NewBattlePhase"
            | "NewBiomeEncounterPhase"
            | "NextEncounterPhase"
            | "ObtainStatusEffectPhase"
            | "PartyExpPhase"
            | "PartyHealPhase"
            | "PokemonAnimPhase"
            | "PokemonHealPhase"
            | "PokemonTransformPhase"
            | "PositionalTagPhase"
            | "PostGameOverPhase"
            | "PostSummonPhase"
            | "PostTurnStatusEffectPhase"
            | "QuietFormChangePhase"
            | "ReloadSessionPhase"
            | "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

      • phase: K

        The string 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.

    • Lapse PRE_MOVE tags that trigger before a move is used, regardless of whether or not it failed. Also lapse MOVE tags if the move is successful and not called indirectly.

      Returns void

    • Update the targets of any counter-attacking moves with [BattlerIndex.ATTACKER] set to reflect the actual battler index of the user's last attacker.

      If there is no last attacker or they are no longer on the field, a message is displayed and the move is marked for failure.

      Returns void

      Make this a feature of the move rather than basing logic on BattlerIndex.ATTACKER

    • Modifies this.targets in place, based upon:

      • Move redirection abilities, effects, etc.
      • Counterattacks, which pass a special value into the targets constructor param ([BattlerIndex.ATTACKER]).

      Returns void

    • Display the text for a move failing to execute.

      Parameters

      • failedText: string = ...

        The failure text to display; defaults to "battle:attackFailed" locale key ("But it failed!" in english)

      Returns void

    • Displays the move's usage text to the player as applicable for the move being used.

      Returns void