# 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 Summary)

- MoveAttr
  - MultiHitAttr

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

##### Index

### Constructors

constructor

### Properties

selfTarget

### Methods

apply
calculateExpectedHitCount
getCondition
getFailedText
getHitCount
getMultiHitType
getTargetBenefitScore
getUserBenefitScore

## Constructors

### constructor

- new MultiHitAttr(multiHitType?: MultiHitType ): MultiHitAttr

  #### Parameters

  - `Optional` multiHitType: MultiHitType

  #### Returns MultiHitAttr

  Overrides MoveAttr.constructor

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

## Properties

### 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 , args: any[]): 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.NumberHolder` storing the hit count of the attack

  #### Returns boolean

  True

  Overrides MoveAttr.apply

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

### calculateExpectedHitCount

- calculateExpectedHitCount(
  move: default ,
  __namedParameters?: {
  ignoreAcc?: boolean;
  maxMultiHit?: boolean;
  partySize?: number;
  },
  ): number

  Calculate the expected number of hits given this attribute's `MultiHitType`, the move's accuracy, and a number of situational parameters.

  #### Parameters

  - move: default

    The move that this attribtue is applied to

  - __namedParameters: { ignoreAcc?: boolean; maxMultiHit?: boolean; partySize?: number } = {}

  #### Returns number

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

### 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

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

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

### getHitCount

- getHitCount(user: default , target: default ): 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/moves/move.ts:2314

### getMultiHitType

- getMultiHitType(): MultiHitType

  #### Returns MultiHitType

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

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

  Overrides MoveAttr.getTargetBenefitScore

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

### 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