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

# Class MultiHitAttr

Attribute used for attack moves that hit multiple times per use, e.g. Bullet Seed.

Applied at the beginning of `MoveEffectPhase`.

#### See

`apply`

#### Hierarchy (view full)

- MoveAttr
  - MultiHitAttr

- Defined in src/data/move.ts:1589

#####
Index

### Constructors

constructor

### Properties

multiHitType
selfTarget

### Methods

apply
getCondition
getFailedText
getHitCount
getTargetBenefitScore
getUserBenefitScore

## Constructors

### constructor

- new MultiHitAttr(multiHitType?): MultiHitAttr

- #### Parameters

  - `Optional` multiHitType: MultiHitType

  #### Returns MultiHitAttr

  Overrides MoveAttr.constructor

  - Defined in src/data/move.ts:1592

## Properties

### `Private` multiHitType

multiHitType: MultiHitType

- Defined in src/data/move.ts:1590

### selfTarget

selfTarget: boolean

Should this `Move` target the user?

Inherited from MoveAttr.selfTarget

- Defined in src/data/move.ts:736

## Methods

### apply

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

- Set the hit count of an attack based on this attribute instance's `MultiHitType`. If the target has an immunity to this attack's types, the hit count will always be 1.

  #### Parameters

  - user: default

    `Pokemon` that used the attack

  - target: default

    `Pokemon` targeted by the attack

  - move: default

    `Move` being used

  - args: any[]

    [0] `Utils.IntegerHolder` storing the hit count of the attack

  #### Returns boolean

  True

  Overrides MoveAttr.apply

  - Defined in src/data/move.ts:1608

### getCondition

- getCondition(): MoveCondition | MoveConditionFunc

- #### Returns MoveCondition | MoveConditionFunc

  the `MoveCondition` or MoveConditionFunc for this `Move`

  Inherited from MoveAttr.getCondition

  - Defined in src/data/move.ts:760

### getFailedText

- getFailedText(user, target, move, cancelled): string

- #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  - cancelled: BooleanHolder

    `Utils.BooleanHolder` which stores if the move should fail

  #### Returns string

  the string representing failure of this `Move`

  Inherited from MoveAttr.getFailedText

  - Defined in src/data/move.ts:772

### getHitCount

- getHitCount(user, target): number

- Calculate the number of hits that an attack should have given this attribute's `MultiHitType`.

  #### Parameters

  - user: default

    `Pokemon` using the attack

  - target: default

    `Pokemon` targeted by the attack

  #### Returns number

  The number of hits this attack should deal

  - Defined in src/data/move.ts:1636

### getTargetBenefitScore

- getTargetBenefitScore(user, target, move): 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`

  Overrides MoveAttr.getTargetBenefitScore

  - Defined in src/data/move.ts:1624

### getUserBenefitScore

- getUserBenefitScore(user, target, move): 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/move.ts:781