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

# Class AttackMove

#### Hierarchy (View Summary)

- default
  - AttackMove

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

##### Index

### Constructors

constructor

### Properties

accuracy
attrs
chance
effect
generation
id
moveTarget
name
power
pp
priority

### Accessors

category
type

### Methods

addAttr
applyConditions
attr
ballBombMove
bitingMove
calculateBattleAccuracy
calculateBattlePower
calculateEffectivePower
canBeMultiStrikeEnhanced
checkAllHits
checkFlag
condition
danceMove
edgeCase
findAttr
getAttrs
getFailedText
getPriority
getTargetBenefitScore
getUserBenefitScore
hasAttr
hasFlag
hidesTarget
hidesUser
hitsSubstitute
ignoresAbilities
ignoresProtect
ignoresSubstitute
isAllyTarget
isChargingMove
isMultiTarget
isTypeImmune
localize
makesContact
partial
powderMove
pulseMove
punchingMove
recklessMove
redirectCounter
reflectable
slicingMove
soundBased
target
triageMove
unimplemented
windMove

## Constructors

### constructor

- new AttackMove(
  id: Moves ,
  type: PokemonType ,
  category: MoveCategory ,
  power: number,
  accuracy: number,
  pp: number,
  chance: number,
  priority: number,
  generation: number,
  ): AttackMove

  #### Parameters

  - id: Moves
  - type: PokemonType
  - category: MoveCategory
  - power: number
  - accuracy: number
  - pp: number
  - chance: number
  - priority: number
  - generation: number

  #### Returns AttackMove

  Overrides default.constructor

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

## Properties

### accuracy

accuracy: number

Inherited from default.accuracy

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

### attrs

attrs: MoveAttr [] = []

Inherited from default.attrs

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

### chance

chance: number

The chance of a move's secondary effects activating

Inherited from default.chance

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

### effect

effect: string

Inherited from default.effect

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

### generation

generation: number

Inherited from default.generation

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

### id

id: Moves

Inherited from default.id

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

### moveTarget

moveTarget: MoveTarget

Inherited from default.moveTarget

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

### name

name: string

Inherited from default.name

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

### power

power: number

Inherited from default.power

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

### pp

pp: number

Inherited from default.pp

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

### priority

priority: number

Inherited from default.priority

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

## Accessors

### category

- get category(): MoveCategory

  #### Returns MoveCategory

  Inherited from Move.category

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

### type

- get type(): PokemonType

  #### Returns PokemonType

  Inherited from Move.type

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

## Methods

### addAttr

- addAttr(attrAdd: MoveAttr ): this

  Adds a new MoveAttr to the move (appends to the attr array) if the MoveAttr also comes with a condition, also adds that to the conditions array: `MoveCondition` Almost identical to attr, except you are passing in a MoveAttr object, instead of a constructor and it's arguments

  #### Parameters

  - attrAdd: MoveAttr

    `MoveAttr` the attribute to add

  #### Returns this

  the called object `Move`

  Inherited from default.addAttr

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

### applyConditions

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

  Applies each `MoveCondition` function of this move to the params, determines if the move can be used prior to calling each attribute's apply()

  #### Parameters

  - user: default

    `Pokemon` to apply conditions to

  - target: default

    `Pokemon` to apply conditions to

  - move: default

    `Move` to apply conditions to

  #### Returns boolean

  boolean: false if any of the apply()'s return false, else true

  Inherited from default.applyConditions

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

### attr

- attr< T extends Constructor < MoveAttr >>(
  AttrType: T ,
  ...args: ConstructorParameters< T >,
  ): this

  Adds a new MoveAttr to the move (appends to the attr array) if the MoveAttr also comes with a condition, also adds that to the conditions array: `MoveCondition`

  #### Type Parameters

  - T extends Constructor < MoveAttr >

  #### Parameters

  - AttrType: T

    `MoveAttr` the constructor of a MoveAttr class

  - ...args: ConstructorParameters< T >

    the args needed to instantiate a the given class

  #### Returns this

  the called object `Move`

  Inherited from default.attr

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

### ballBombMove

- ballBombMove(): this

  Sets the `MoveFlags.BALLBOMB_MOVE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.ELECTRO_BALL`

  Inherited from default.ballBombMove

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

### bitingMove

- bitingMove(): this

  Sets the `MoveFlags.BITING_MOVE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.BITE`

  Inherited from default.bitingMove

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

### calculateBattleAccuracy

- calculateBattleAccuracy(
  user: default ,
  target: default ,
  simulated?: boolean,
  ): number

  Calculates the accuracy of a move in battle based on various conditions and attributes.

  #### Parameters

  - user: default

    `Pokemon` The Pokémon using the move.

  - target: default

    `Pokemon` The Pokémon being targeted by the move.

  - simulated: boolean = false

  #### Returns number

  The calculated accuracy of the move.

  Inherited from default.calculateBattleAccuracy

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

### calculateBattlePower

- calculateBattlePower(
  source: default ,
  target: default ,
  simulated?: boolean,
  ): number

  Calculates the power of a move in battle based on various conditions and attributes.

  #### Parameters

  - source: default

    `Pokemon` The Pokémon using the move.

  - target: default

    `Pokemon` The Pokémon being targeted by the move.

  - simulated: boolean = false

  #### Returns number

  The calculated power of the move.

  Inherited from default.calculateBattlePower

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

### calculateEffectivePower

- calculateEffectivePower(): number

  Calculate the Expected Power per turn of this move, taking into account multi hit moves, accuracy, and the number of turns it takes to execute.

  Does not (yet) consider the current field effects or the user's abilities.

  #### Returns number

  Inherited from default.calculateEffectivePower

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

### canBeMultiStrikeEnhanced

- canBeMultiStrikeEnhanced(user: default , restrictSpread?: boolean): boolean

  Returns `true` if this move can be given additional strikes by enhancing effects. Currently used for Parental Bond and `Multi-Lens`.

  #### Parameters

  - user: default

    The `Pokemon` using the move

  - restrictSpread: boolean = false

    `true` if the enhancing effect should not affect multi-target moves (default `false`)

  #### Returns boolean

  Inherited from default.canBeMultiStrikeEnhanced

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

### checkAllHits

- checkAllHits(): this

  Sets the `MoveFlags.CHECK_ALL_HITS` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.TRIPLE_AXEL`

  Inherited from default.checkAllHits

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

### checkFlag

- checkFlag(flag: MoveFlags , user: default , target: null | default ): boolean

  Checks if the move flag applies to the pokemon(s) using/receiving the move

  #### Parameters

  - flag: MoveFlags

    `MoveFlags` MoveFlag to check on user and/or target

  - user: default

    `Pokemon` the Pokemon using the move

  - target: null | default

    `Pokemon` the Pokemon receiving the move

  #### Returns boolean

  boolean

  Inherited from default.checkFlag

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

### condition

- condition(condition: MoveCondition | MoveConditionFunc): this

  Adds a move condition to the move

  #### Parameters

  - condition: MoveCondition | MoveConditionFunc

    `MoveCondition` or MoveConditionFunc, appends to conditions array a new MoveCondition object

  #### Returns this

  the called object `Move`

  Inherited from default.condition

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

### danceMove

- danceMove(): this

  Sets the `MoveFlags.DANCE_MOVE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.PETAL_DANCE`

  Inherited from default.danceMove

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

### edgeCase

- edgeCase(): this

  Internal dev flag for documenting edge cases. When using this, please document the known edge case.

  #### Returns this

  the called object `Move`

  Inherited from default.edgeCase

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

### findAttr

- findAttr(attrPredicate: (attr: MoveAttr ) => boolean): MoveAttr

  Takes as input a boolean function and returns the first MoveAttr in attrs that matches true

  #### Parameters

  - attrPredicate: (attr: MoveAttr ) => boolean

  #### Returns MoveAttr

  the first `MoveAttr` element in attrs that makes the input function return true

  Inherited from default.findAttr

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

### getAttrs

- getAttrs< T extends MoveAttr >(attrType: Constructor < T >): T []

  Get all move attributes that match `attrType`

  #### Type Parameters

  - T extends MoveAttr

  #### Parameters

  - attrType: Constructor < T >

    any attribute that extends `MoveAttr`

  #### Returns T []

  Array of attributes that match `attrType`, Empty Array if none match.

  Inherited from default.getAttrs

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

### getFailedText

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

  Sees if a move has a custom failure text (by looking at each `MoveAttr` of this move)

  #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  #### Returns undefined | string

  string of the custom failure text, or `null` if it uses the default text ("But it failed!")

  Inherited from default.getFailedText

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

### getPriority

- getPriority(user: default , simulated?: boolean): number

  #### Parameters

  - user: default
  - simulated: boolean = true

  #### Returns number

  Inherited from default.getPriority

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

### getTargetBenefitScore

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

  Compute the benefit score of this move based on the offensive stat used and the move's power.

  #### Parameters

  - user: default

    The Pokemon using the move

  - target: default

    The Pokemon targeted by the move

  - move: default

    The move being used

  #### Returns number

  The benefit score of using this move

  Overrides default.getTargetBenefitScore

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

### getUserBenefitScore

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

  Calculates the userBenefitScore across all the attributes and conditions

  #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` receiving the move

  - move: default

    `Move` using the move

  #### Returns number

  integer representing the total benefitScore

  Inherited from default.getUserBenefitScore

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

### hasAttr

- hasAttr< T extends MoveAttr >(attrType: Constructor < T >): boolean

  Check if a move has an attribute that matches `attrType`

  #### Type Parameters

  - T extends MoveAttr

  #### Parameters

  - attrType: Constructor < T >

    any attribute that extends `MoveAttr`

  #### Returns boolean

  true if the move has attribute `attrType`

  Inherited from default.hasAttr

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

### hasFlag

- hasFlag(flag: MoveFlags ): boolean

  Getter function that returns if this Move has a MoveFlag

  #### Parameters

  - flag: MoveFlags

    `MoveFlags` to check

  #### Returns boolean

  boolean

  Inherited from default.hasFlag

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

### hidesTarget

- hidesTarget(): this

  Sets the `MoveFlags.HIDE_TARGET` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.WHIRLWIND`

  Inherited from default.hidesTarget

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

### hidesUser

- hidesUser(): this

  Sets the `MoveFlags.HIDE_USER` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.TELEPORT`

  Inherited from default.hidesUser

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

### hitsSubstitute

- hitsSubstitute(user: default , target: null | default ): boolean

  Checks if the move would hit its target's Substitute instead of the target itself.

  #### Parameters

  - user: default

    The `Pokemon` using this move

  - target: null | default

    The `Pokemon` targeted by this move

  #### Returns boolean

  `true` if the move can bypass the target's Substitute; `false` otherwise.

  Inherited from default.hitsSubstitute

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

### ignoresAbilities

- ignoresAbilities(): this

  Sets the `MoveFlags.IGNORE_ABILITIES` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.SUNSTEEL_STRIKE`

  Inherited from default.ignoresAbilities

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

### ignoresProtect

- ignoresProtect(): this

  Sets the `MoveFlags.IGNORE_PROTECT` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.CURSE`

  Inherited from default.ignoresProtect

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

### ignoresSubstitute

- ignoresSubstitute(): this

  Sets the `MoveFlags.IGNORE_SUBSTITUTE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.WHIRLWIND`

  Inherited from default.ignoresSubstitute

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

### isAllyTarget

- isAllyTarget(): boolean

  Getter function that returns if the move targets the user or its ally

  #### Returns boolean

  boolean

  Inherited from default.isAllyTarget

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

### isChargingMove

- isChargingMove(): this is ChargingMove

  #### Returns this is ChargingMove

  Inherited from default.isChargingMove

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

### isMultiTarget

- isMultiTarget(): boolean

  Getter function that returns if the move hits multiple targets

  #### Returns boolean

  boolean

  Inherited from default.isMultiTarget

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

### isTypeImmune

- isTypeImmune(user: default , target: default , type: PokemonType ): boolean

  Checks if the move is immune to certain types. Currently looks at cases of Grass types with powder moves and Dark types with moves affected by Prankster.

  #### Parameters

  - user: default

    the source of this move

  - target: default

    the target of this move

  - type: PokemonType

    the type of the move's target

  #### Returns boolean

  boolean

  Inherited from default.isTypeImmune

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

### localize

- localize(): void

  #### Returns void

  Inherited from default.localize

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

### makesContact

- makesContact(setFlag?: boolean): this

  Sets the `MoveFlags.MAKES_CONTACT` flag for the calling Move

  #### Parameters

  - setFlag: boolean = true

    Default `true`, set to `false` if the move doesn't make contact

  #### Returns this

  The `Move` that called this function

  #### See

  `Abilities.STATIC`

  Inherited from default.makesContact

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

### partial

- partial(): this

  Marks the move as "partial": appends texts to the move name

  #### Returns this

  the called object `Move`

  Inherited from default.partial

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

### powderMove

- powderMove(): this

  Sets the `MoveFlags.POWDER_MOVE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.STUN_SPORE`

  Inherited from default.powderMove

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

### pulseMove

- pulseMove(): this

  Sets the `MoveFlags.PULSE_MOVE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.WATER_PULSE`

  Inherited from default.pulseMove

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

### punchingMove

- punchingMove(): this

  Sets the `MoveFlags.PUNCHING_MOVE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.DRAIN_PUNCH`

  Inherited from default.punchingMove

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

### recklessMove

- recklessMove(): this

  Sets the `MoveFlags.RECKLESS_MOVE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Abilities.RECKLESS`

  Inherited from default.recklessMove

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

### redirectCounter

- redirectCounter(): this

  Sets the `MoveFlags.REDIRECT_COUNTER` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.METAL_BURST`

  Inherited from default.redirectCounter

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

### reflectable

- reflectable(): this

  Sets the `MoveFlags.REFLECTABLE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.ATTRACT`

  Inherited from default.reflectable

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

### slicingMove

- slicingMove(): this

  Sets the `MoveFlags.SLICING_MOVE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.X_SCISSOR`

  Inherited from default.slicingMove

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

### soundBased

- soundBased(): this

  Sets the `MoveFlags.SOUND_BASED` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.UPROAR`

  Inherited from default.soundBased

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

### target

- target(moveTarget: MoveTarget ): this

  Sets the move target of this move

  #### Parameters

  - moveTarget: MoveTarget

    `MoveTarget` the move target to set

  #### Returns this

  the called object `Move`

  Inherited from default.target

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

### triageMove

- triageMove(): this

  Sets the `MoveFlags.TRIAGE_MOVE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.ABSORB`

  Inherited from default.triageMove

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

### unimplemented

- unimplemented(): this

  Marks the move as "unimplemented": appends texts to the move name

  #### Returns this

  the called object `Move`

  Inherited from default.unimplemented

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

### windMove

- windMove(): this

  Sets the `MoveFlags.WIND_MOVE` flag for the calling Move

  #### Returns this

  The `Move` that called this function

  #### See

  `Moves.HURRICANE`

  Inherited from default.windMove

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