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

# Class MoveEffectPhase

#### Hierarchy (View Summary)

- PokemonPhase
  - MoveEffectPhase

- Defined in src/phases/move-effect-phase.ts:74

##### Index

### Constructors

constructor

### Properties

battlerIndex
fieldIndex
move
player
reflected
targets

### Methods

applyHeldItemFlinchCheck
applyOnGetHitAbEffects
applyOnHitEffects
applyPostApplyEffects
applySelfTargetEffects
applySuccessfulAttackEffects
checkBypassAccAndInvuln
checkBypassSemiInvuln
end
executeForAll
getFirstTarget
getNewHitPhase
getPokemon
getTargets
getUserPokemon
hideEnemyTrainer
hitCheck
removeTarget
showEnemyTrainer
start
stopMultiHit

## Constructors

### constructor

- new MoveEffectPhase(
  battlerIndex: BattlerIndex ,
  targets: BattlerIndex [],
  move: PokemonMove ,
  reflected?: boolean,
  ): MoveEffectPhase

  #### Parameters

  - battlerIndex: BattlerIndex
  - targets: BattlerIndex []
  - move: PokemonMove
  - reflected: boolean = false

    Indicates that the move was reflected by the user due to magic coat or magic bounce

  #### Returns MoveEffectPhase

  Overrides PokemonPhase.constructor

  - Defined in src/phases/move-effect-phase.ts:82

## Properties

### `Protected` battlerIndex

battlerIndex: number

Inherited from PokemonPhase.battlerIndex

- Defined in src/phases/pokemon-phase.ts:7

### fieldIndex

fieldIndex: number

Inherited from PokemonPhase.fieldIndex

- Defined in src/phases/pokemon-phase.ts:9

### move

move: PokemonMove

- Defined in src/phases/move-effect-phase.ts:75

### player

player: boolean

Inherited from PokemonPhase.player

- Defined in src/phases/pokemon-phase.ts:8

### `Protected` reflected

reflected: boolean = false

- Defined in src/phases/move-effect-phase.ts:77

### `Protected` targets

targets: BattlerIndex []

- Defined in src/phases/move-effect-phase.ts:76

## Methods

### `Protected` applyHeldItemFlinchCheck

- applyHeldItemFlinchCheck(
  user: default ,
  target: default ,
  dealsDamage: boolean,
  ): void

  Handles checking for and applying Flinches

  #### Parameters

  - user: default

    The `Pokemon` using this phase's invoked move

  - target: default

    `Pokemon` the current target of this phase's invoked move

  - dealsDamage: boolean

    `true` if the attempted move successfully dealt damage

  #### Returns void

  a function intended to be passed into a `then()` call.

  - Defined in src/phases/move-effect-phase.ts:672

### `Protected` applyOnGetHitAbEffects

- applyOnGetHitAbEffects(
  user: default ,
  target: default ,
  hitResult: HitResult ,
  ): void

  Applies reactive effects that occur when a Pokémon is hit. (i.e. Effect Spore, Disguise, Liquid Ooze, Beak Blast)

  #### Parameters

  - user: default

    The `Pokemon` using this phase's invoked move

  - target: default

    `Pokemon` the current target of this phase's invoked move

  - hitResult: HitResult

    The `HitResult` of the attempted move

  #### Returns void

  a `Promise` intended to be passed into a `then()` call.

  - Defined in src/phases/move-effect-phase.ts:620

### `Protected` applyOnHitEffects

- applyOnHitEffects(
  user: default ,
  target: default ,
  firstHit: boolean,
  lastHit: boolean,
  firstTarget: boolean,
  ): void

  Applies effects that trigger on HIT (i.e. Final Gambit, Power-Up Punch, Drain Punch)

  #### Parameters

  - user: default

    The `Pokemon` using this phase's invoked move

  - target: default

    `Pokemon` the current target of this phase's invoked move

  - firstHit: boolean

    `true` if this is the first hit in a multi-hit attack

  - lastHit: boolean

    `true` if this is the last hit in a multi-hit attack

  - firstTarget: boolean

    `true` if `target` is the first target hit by this strike of `move`

  #### Returns void

  a function intended to be passed into a `then()` call.

  - Defined in src/phases/move-effect-phase.ts:592

### `Protected` applyPostApplyEffects

- applyPostApplyEffects(
  user: default ,
  target: default ,
  firstHit: boolean,
  lastHit: boolean,
  ): void

  Applies non-self-targeted effects that trigger `POST_APPLY` (i.e. Smelling Salts curing Paralysis, and the forced switch from U-Turn, Dragon Tail, etc)

  #### Parameters

  - user: default

    The `Pokemon` using this phase's invoked move

  - target: default

    `Pokemon` the current target of this phase's invoked move

  - firstHit: boolean

    `true` if this is the first hit in a multi-hit attack

  - lastHit: boolean

    `true` if this is the last hit in a multi-hit attack

  #### Returns void

  a function intended to be passed into a `then()` call.

  - Defined in src/phases/move-effect-phase.ts:568

### `Protected` applySelfTargetEffects

- applySelfTargetEffects(
  user: default ,
  target: default ,
  firstHit: boolean,
  lastHit: boolean,
  ): void

  Apply self-targeted effects that trigger `POST_APPLY`

  #### Parameters

  - user: default

    The `Pokemon` using this phase's invoked move

  - target: default

    `Pokemon` the current target of this phase's invoked move

  - firstHit: boolean

    `true` if this is the first hit in a multi-hit attack

  - lastHit: boolean

    `true` if this is the last hit in a multi-hit attack

  #### Returns void

  a function intended to be passed into a `then()` call.

  - Defined in src/phases/move-effect-phase.ts:545

### `Protected` applySuccessfulAttackEffects

- applySuccessfulAttackEffects(
  user: default ,
  target: default ,
  firstHit: boolean,
  lastHit: boolean,
  isProtected: boolean,
  hitResult: HitResult ,
  firstTarget: boolean,
  ): void

  Applies all effects and attributes that require a move to connect with a target, namely reactive effects like Weak Armor, on-hit effects like that of Power-Up Punch, and item stealing effects

  #### Parameters

  - user: default

    The `Pokemon` using this phase's invoked move

  - target: default

    `Pokemon` the current target of this phase's invoked move

  - firstHit: boolean

    `true` if this is the first hit in a multi-hit attack

  - lastHit: boolean

    `true` if this is the last hit in a multi-hit attack

  - isProtected: boolean

    `true` if the target is protected by effects such as Protect

  - hitResult: HitResult

    The `HitResult` of the attempted move

  - firstTarget: boolean

    `true` if `target` is the first target hit by this strike of `move`

  #### Returns void

  a function intended to be passed into a `then()` call.

  - Defined in src/phases/move-effect-phase.ts:646

### checkBypassAccAndInvuln

- checkBypassAccAndInvuln(target: default ): undefined | boolean

  Check whether the move should bypass both the accuracy and semi-invulnerable states.

  #### Parameters

  - target: default

    The `Pokemon` targeted by the invoked move

  #### Returns undefined | boolean

  `true` if the move should bypass accuracy and semi-invulnerability

  Accuracy and semi-invulnerability can be bypassed by:

  - An ability like Abilities.NO_GUARD | No Guard
  - A poison type using `Toxic`
  - A move like `Lock-On` or `Mind Reader`.

  Does not check against effects `Glaive Rush` status (which should not bypass semi-invulnerability), or interactions like Earthquake hitting against Dig, (which should not bypass the accuracy check).

  #### See

  `hitCheck`

  - Defined in src/phases/move-effect-phase.ts:765

### checkBypassSemiInvuln

- checkBypassSemiInvuln(semiInvulnerableTag: nil | SemiInvulnerableTag ): boolean

  Check whether the move is able to ignore the given `semiInvulnerableTag`

  #### Parameters

  - semiInvulnerableTag: nil | SemiInvulnerableTag

    The semiInvulnerbale tag to check against

  #### Returns boolean

  `true` if the move can ignore the semi-invulnerable state

  - Defined in src/phases/move-effect-phase.ts:790

### end

- end(): void

  #### Returns void

  Overrides PokemonPhase.end

  - Defined in src/phases/move-effect-phase.ts:507

### executeForAll

- executeForAll(func: PokemonFunc): void

  #### Parameters

  - func: PokemonFunc

  #### Returns void

  Inherited from PokemonPhase.executeForAll

  - Defined in src/phases/field-phase.ts:8

### getFirstTarget

- getFirstTarget(): undefined | default

  #### Returns undefined | default

  The first target of this phase's invoked move

  - Defined in src/phases/move-effect-phase.ts:812

### `Protected` getNewHitPhase

- getNewHitPhase(): MoveEffectPhase

  #### Returns MoveEffectPhase

  A new `MoveEffectPhase` with the same properties as this phase

  - Defined in src/phases/move-effect-phase.ts:852

### getPokemon

- getPokemon(): default

  #### Returns default

  Inherited from PokemonPhase.getPokemon

  - Defined in src/phases/pokemon-phase.ts:26

### getTargets

- getTargets(): default []

  #### Returns default []

  An array of all `Pokemon` targeted by this phase's invoked move

  - Defined in src/phases/move-effect-phase.ts:807

### getUserPokemon

- getUserPokemon(): null | default

  #### Returns null | default

  The `Pokemon` using this phase's invoked move

  - Defined in src/phases/move-effect-phase.ts:799

### hideEnemyTrainer

- hideEnemyTrainer(): void

  #### Returns void

  Inherited from PokemonPhase.hideEnemyTrainer

  - Defined in src/phases/battle-phase.ts:37

### hitCheck

- hitCheck(target: default ): boolean

  Resolves whether this phase's invoked move hits the given target

  #### Parameters

  - target: default

    The `Pokemon` targeted by the invoked move

  #### Returns boolean

  `true` if the move hits the target

  - Defined in src/phases/move-effect-phase.ts:695

### `Protected` removeTarget

- removeTarget(target: default ): void

  Removes the given `Pokemon` from this phase's target list

  #### Parameters

  - target: default

    The `Pokemon` to be removed

  #### Returns void

  - Defined in src/phases/move-effect-phase.ts:820

### showEnemyTrainer

- showEnemyTrainer(trainerSlot?: TrainerSlot ): void

  #### Parameters

  - trainerSlot: TrainerSlot = TrainerSlot.NONE

  #### Returns void

  Inherited from PokemonPhase.showEnemyTrainer

  - Defined in src/phases/battle-phase.ts:10

### start

- start(): void

  #### Returns void

  Overrides PokemonPhase.start

  - Defined in src/phases/move-effect-phase.ts:98

### stopMultiHit

- stopMultiHit(target?: default ): void

  Prevents subsequent strikes of this phase's invoked move from occurring

  #### Parameters

  - `Optional` target: default

    If defined, only stop subsequent strikes against this `Pokemon`

  #### Returns void

  - Defined in src/phases/move-effect-phase.ts:834