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

# Class PreUseInterruptAttr

Attribute for moves that can be conditionally interrupted to be considered to have failed before their "useMove" message is displayed. Currently used by Focus Punch.

#### Hierarchy (View Summary)

- MoveAttr
  - PreUseInterruptAttr

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

##### Index

### Constructors

constructor

### Properties

conditionFunc
message?
overridesFailedMessage
selfTarget

### Methods

apply
getCondition
getFailedText
getTargetBenefitScore
getUserBenefitScore

## Constructors

### constructor

- new PreUseInterruptAttr(
  message?:
  | string
  | ((user: default , target: default , move: default ) => string),
  conditionFunc?: MoveConditionFunc,
  ): PreUseInterruptAttr

  Create a new MoveInterruptedMessageAttr.

  #### Parameters

  - `Optional` message: string | ((user: default , target: default , move: default ) => string)

    The message to display when the move is interrupted, or a function that formats the message based on the user, target, and move.

  - `Optional` conditionFunc: MoveConditionFunc

  #### Returns PreUseInterruptAttr

  Overrides MoveAttr.constructor

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

## Properties

### `Protected` conditionFunc

conditionFunc: MoveConditionFunc

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

### `Protected` `Optional` message

message?: string | ((user: default , target: default , move: default ) => string)

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

### `Protected` overridesFailedMessage

overridesFailedMessage: boolean

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

### selfTarget

selfTarget: boolean

Should this `Move` target the user?

Inherited from MoveAttr.selfTarget

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

## Methods

### apply

- apply(user: default , target: default , move: default ): boolean

  Message to display when a move is interrupted.

  #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  #### Returns boolean

  Overrides MoveAttr.apply

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

### getCondition

- getCondition(): null | MoveCondition | MoveConditionFunc

  #### Returns null | MoveCondition | MoveConditionFunc

  the `MoveCondition` or MoveConditionFunc for this `Move`

  Inherited from MoveAttr.getCondition

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

### getFailedText

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

  Message to display when a move is interrupted.

  #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  #### Returns undefined | string

  Overrides MoveAttr.getFailedText

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

### 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 MoveAttr.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 MoveAttr.getUserBenefitScore

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