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

# Class RandomMoveAttr

Attribute used to call a random move. Used for `Moves.METRONOME`

#### See

`apply` for move selection and move call

#### Hierarchy

- CallMoveAttr
  - RandomMoveAttr

- Defined in src/data/moves/move.ts:6740

##### Index

### Constructors

constructor

### Properties

hasTarget
invalidMoves
selfTarget

### Methods

apply
getCondition
getFailedText
getMoveOverride
getTargetBenefitScore
getUserBenefitScore

## Constructors

### constructor

- new RandomMoveAttr(invalidMoves: ReadonlySet< Moves >): RandomMoveAttr

  #### Parameters

  - invalidMoves: ReadonlySet< Moves >

  #### Returns RandomMoveAttr

  Overrides CallMoveAttr.constructor

  - Defined in src/data/moves/move.ts:6741

## Properties

### `Protected` hasTarget

hasTarget: boolean

Inherited from CallMoveAttr.hasTarget

- Defined in src/data/moves/move.ts:6715

### `Protected` invalidMoves

invalidMoves: ReadonlySet< Moves >

Inherited from CallMoveAttr.invalidMoves

- Defined in src/data/moves/move.ts:6714

### selfTarget

selfTarget: boolean

Should this `Move` target the user?

Inherited from CallMoveAttr.selfTarget

- Defined in src/data/moves/move.ts:1071

## Methods

### apply

- apply(user: default , target: default , move: default , args: any[]): boolean

  User calls a random moveId.

  Invalid moves are indicated by what is passed in to invalidMoves: `invalidMetronomeMoves`

  #### Parameters

  - user: default

    Pokemon that used the move and will call a random move

  - target: default

    Pokemon that will be targeted by the random move (if single target)

  - move: default

    Move being used

  - args: any[]

    Unused

  #### Returns boolean

  Overrides CallMoveAttr.apply

  - Defined in src/data/moves/move.ts:6762

### getCondition

- getCondition(): null | MoveCondition | MoveConditionFunc

  #### Returns null | MoveCondition | MoveConditionFunc

  the `MoveCondition` or MoveConditionFunc for this `Move`

  Inherited from CallMoveAttr.getCondition

  - Defined in src/data/moves/move.ts:1095

### getFailedText

- getFailedText(user: default , target: default , move: default ): undefined | string

  #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  #### Returns undefined | string

  the string representing failure of this `Move`

  Inherited from CallMoveAttr.getFailedText

  - Defined in src/data/moves/move.ts:1106

### getMoveOverride

- getMoveOverride(): null | Moves

  This function exists solely to allow tests to override the randomly selected move by mocking this function.

  #### Returns null | Moves

  - Defined in src/data/moves/move.ts:6749

### getTargetBenefitScore

- getTargetBenefitScore(user: default , target: default , move: default ): number

  Used by the Enemy AI to rank an attack based on a given target

  #### Parameters

  - user: default
  - target: default
  - move: default

  #### Returns number

  #### See

  `EnemyPokemon.getNextMove`

  Inherited from CallMoveAttr.getTargetBenefitScore

  - Defined in src/data/moves/move.ts:1124

### getUserBenefitScore

- getUserBenefitScore(user: default , target: default , move: default ): number

  Used by the Enemy AI to rank an attack based on a given user

  #### Parameters

  - user: default
  - target: default
  - move: default

  #### Returns number

  #### See

  `EnemyPokemon.getNextMove`

  Inherited from CallMoveAttr.getUserBenefitScore

  - Defined in src/data/moves/move.ts:1115