pokemon-rogue-battle
    Preparing search index...

    Class PokemonMove

    Wrapper class for the Move class for Pokemon to interact with. These are the moves assigned to a Pokemon object. It links to Move class via the move ID. Compared to Move, this class also tracks things like PP Ups recieved, PP used, etc.

    • isUsable - checks if move is restricted, out of PP, or not implemented.
    • getMove - returns Move object by looking it up via ID.
    • usePp - removes a point of PP from the move.
    • getMovePp - returns amount of PP a move currently has.
    • getPpRatio - returns the current PP amount / max PP amount.
    • getName - returns name of Move.
    Index

    Constructors

    • Parameters

      • moveId: Moves
      • ppUsed: number = 0
      • ppUp: number = 0
      • virtual: boolean = false
      • OptionalmaxPpOverride: number

      Returns PokemonMove

    Properties

    maxPpOverride?: number

    If defined and nonzero, overrides the maximum PP of the move (e.g., due to move being copied by Transform). This also nullifies all effects of ppUp.

    moveId: Moves
    ppUp: number
    ppUsed: number
    virtual: boolean

    Methods

    • Checks whether the move can be selected or performed by a Pokemon, without consideration for the move's targets. The move is unusable if it is out of PP, restricted by an effect, or unimplemented.

      Parameters

      • pokemon: default

        Pokemon that would be using this move

      • ignorePp: boolean = false

        If true, skips the PP check

      • ignoreRestrictionTags: boolean = false

        If true, skips the check for move restriction tags (see MoveRestrictionBattlerTag)

      Returns boolean

      true if the move can be selected and used by the Pokemon, otherwise false.

    • Copies an existing move or creates a valid PokemonMove object from json representing one

      Parameters

      • source: any

        The data for the move to copy; can be a PokemonMove or JSON object representing one

      Returns PokemonMove

      A valid PokemonMove object