# PokemonMove | pokemon-rogue-battle
Documentation for pokemon-rogue-battle

# 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 if a move has received. PP Ups, amount of PP used, and things like that.

#### See

- `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`.

- Defined in src/field/pokemon.ts:7767

##### Index

### Constructors

constructor

### Properties

maxPpOverride?
moveId
ppUp
ppUsed
virtual

### Methods

getMove
getMovePp
getName
getPpRatio
isUsable
usePp
loadMove

## Constructors

### constructor

- new PokemonMove(
  moveId: Moves ,
  ppUsed?: number,
  ppUp?: number,
  virtual?: boolean,
  maxPpOverride?: number,
  ): PokemonMove

  #### Parameters

  - moveId: Moves
  - ppUsed: number = 0
  - ppUp: number = 0
  - virtual: boolean = false
  - `Optional` maxPpOverride: number

  #### Returns PokemonMove

  - Defined in src/field/pokemon.ts:7779

## Properties

### `Optional` maxPpOverride

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`.

- Defined in src/field/pokemon.ts:7777

### moveId

moveId: Moves

- Defined in src/field/pokemon.ts:7768

### ppUp

ppUp: number

- Defined in src/field/pokemon.ts:7770

### ppUsed

ppUsed: number

- Defined in src/field/pokemon.ts:7769

### virtual

virtual: boolean

- Defined in src/field/pokemon.ts:7771

## Methods

### getMove

- getMove(): default

  #### Returns default

  - Defined in src/field/pokemon.ts:7824

### getMovePp

- getMovePp(): number

  #### Returns number

  - Defined in src/field/pokemon.ts:7836

### getName

- getName(): string

  #### Returns string

  - Defined in src/field/pokemon.ts:7847

### getPpRatio

- getPpRatio(): number

  #### Returns number

  - Defined in src/field/pokemon.ts:7843

### isUsable

- isUsable(
  pokemon: default ,
  ignorePp?: boolean,
  ignoreRestrictionTags?: boolean,
  ): boolean

  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`.

  - Defined in src/field/pokemon.ts:7802

### usePp

- usePp(count?: number): void

  Sets ppUsed for this move and ensures the value does not exceed getMovePp

  #### Parameters

  - count: number = 1

    Amount of PP to use

  #### Returns void

  - Defined in src/field/pokemon.ts:7832

### `Static` loadMove

- loadMove(source: any): PokemonMove

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

  #### Parameters

  - source: any

    The data for the move to copy

  #### Returns PokemonMove

  A valid pokemonmove object

  - Defined in src/field/pokemon.ts:7856