pokemon-rogue-battle
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • pokemon: default
      • targets: BattlerIndex[]
      • move: PokemonMove
      • followUp: boolean = false

        Indicates that the move being used is a "follow-up" - for example, a move being used by Metronome or Dancer. Follow-ups bypass a few failure conditions, including flinches, sleep/paralysis/freeze and volatile status checks, etc.

      • ignorePp: boolean = false
      • reflected: boolean = false

        Indicates that the move was reflected by Magic Coat or Magic Bounce. Reflected moves cannot be reflected again and will not trigger Dancer.

      • forcedLast: boolean = false

      Returns MovePhase

    Properties

    _pokemon: default
    _targets: BattlerIndex[]
    cancelled: boolean = false
    failed: boolean = false
    followUp: boolean
    forcedLast: boolean
    ignorePp: boolean
    reflected: boolean = false

    Accessors

    Methods

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

      Parameters

      • ignoreDisableTags: boolean = false

        true to not check if the move is disabled

      Returns boolean

      true if all the checks pass

    • 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

    • 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 should be successful.

      Returns void

    • Counter-attacking moves pass in [BattlerIndex.ATTACKER] into the constructor's targets param. This function modifies this.targets 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

    • 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

    • Displays the move's usage text to the player, unless it's a charge turn (ie: Solar Beam), the pokemon is on a recharge turn (ie: Hyper Beam), or a 2-turn move was interrupted (ie: Fly).

      Returns void