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

# Class TypeImmunityAbAttr

Determines whether a Pokemon is immune to a move because of an ability.

#### See

- `applyPreDefend`
- `getCondition`

#### Hierarchy (View Summary)

- PreDefendAbAttr
  - TypeImmunityAbAttr
    - AttackTypeImmunityAbAttr
    - TypeImmunityHealAbAttr
    - NonSuperEffectiveImmunityAbAttr

- Defined in src/data/ability.ts:488

##### Index

### Constructors

constructor

### Properties

showAbility

### Methods

addCondition
apply
applyPreDefend
canApply
canApplyPreDefend
getCondition
getImmuneType
getTriggerMessage

## Constructors

### constructor

- new TypeImmunityAbAttr(
  immuneType: null | PokemonType ,
  condition?: AbAttrCondition,
  ): TypeImmunityAbAttr

  #### Parameters

  - immuneType: null | PokemonType
  - `Optional` condition: AbAttrCondition

  #### Returns TypeImmunityAbAttr

  Overrides PreDefendAbAttr.constructor

  - Defined in src/data/ability.ts:492

## Properties

### showAbility

showAbility: boolean

Inherited from PreDefendAbAttr.showAbility

- Defined in src/data/ability.ts:184

## Methods

### addCondition

- addCondition(condition: AbAttrCondition): AbAttr

  #### Parameters

  - condition: AbAttrCondition

  #### Returns AbAttr

  Inherited from PreDefendAbAttr.addCondition

  - Defined in src/data/ability.ts:209

### apply

- apply(
  pokemon: default ,
  passive: boolean,
  simulated: boolean,
  cancelled: null | BooleanHolder ,
  args: any[],
  ): void

  Applies ability effects without checking conditions

  #### Parameters

  - pokemon: default

    The pokemon to apply this ability to

  - passive: boolean

    Whether or not the ability is a passive

  - simulated: boolean

    Whether the call is simulated

  - cancelled: null | BooleanHolder
  - args: any[]

    Extra args passed to the function. Handled by child classes.

  #### Returns void

  #### See

  `canApply`

  Inherited from PreDefendAbAttr.apply

  - Defined in src/data/ability.ts:199

### applyPreDefend

- applyPreDefend(
  pokemon: default ,
  passive: boolean,
  simulated: boolean,
  attacker: default ,
  move: default ,
  cancelled: BooleanHolder ,
  args: any[],
  ): void

  Applies immunity if this ability grants immunity to the type of the given move.

  #### Parameters

  - pokemon: default

    `Pokemon` The defending Pokemon.

  - passive: boolean

    Whether the ability is passive.

  - simulated: boolean
  - attacker: default

    `Pokemon` The attacking Pokemon.

  - move: default

    `Move` The attacking move.

  - cancelled: BooleanHolder

    `Utils.BooleanHolder` - A holder for a boolean value indicating if the move was cancelled.

  - args: any[]

    [0] `Utils.NumberHolder` gets set to 0 if move is immuned by an ability.

  #### Returns void

  Overrides PreDefendAbAttr.applyPreDefend

  - Defined in src/data/ability.ts:513

### canApply

- canApply(
  pokemon: default ,
  passive: boolean,
  simulated: boolean,
  args: any[],
  ): boolean

  Returns a boolean describing whether the ability can be applied under current conditions

  #### Parameters

  - pokemon: default

    The pokemon to apply this ability to

  - passive: boolean

    Whether or not the ability is a passive

  - simulated: boolean

    Whether the call is simulated

  - args: any[]

    Extra args passed to the function. Handled by child classes.

  #### Returns boolean

  `true` if the ability can be applied, `false` otherwise

  #### See

  `apply`

  Inherited from PreDefendAbAttr.canApply

  - Defined in src/data/ability.ts:223

### canApplyPreDefend

- canApplyPreDefend(
  pokemon: default ,
  passive: boolean,
  simulated: boolean,
  attacker: default ,
  move: default ,
  cancelled: null | BooleanHolder ,
  args: any[],
  ): boolean

  #### Parameters

  - pokemon: default
  - passive: boolean
  - simulated: boolean
  - attacker: default
  - move: default
  - cancelled: null | BooleanHolder
  - args: any[]

  #### Returns boolean

  Overrides PreDefendAbAttr.canApplyPreDefend

  - Defined in src/data/ability.ts:499

### getCondition

- getCondition(): null | AbAttrCondition

  #### Returns null | AbAttrCondition

  Overrides PreDefendAbAttr.getCondition

  - Defined in src/data/ability.ts:521

### getImmuneType

- getImmuneType(): null | PokemonType

  #### Returns null | PokemonType

  - Defined in src/data/ability.ts:517

### getTriggerMessage

- getTriggerMessage(
  _pokemon: default ,
  _abilityName: string,
  ..._args: any[],
  ): null | string

  #### Parameters

  - _pokemon: default
  - _abilityName: string
  - ..._args: any[]

  #### Returns null | string

  Inherited from PreDefendAbAttr.getTriggerMessage

  - Defined in src/data/ability.ts:201