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

# Class ConditionalUserFieldStatusEffectImmunityAbAttr

Conditionally provides immunity to status effects to the user's field.

Used by `Flower Veil`.

#### Hierarchy (View Summary)

- UserFieldStatusEffectImmunityAbAttr
  - ConditionalUserFieldStatusEffectImmunityAbAttr

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

##### Index

### Constructors

constructor

### Properties

condition
immuneEffects
showAbility

### Methods

addCondition
apply
applyPreSetStatus
canApply
canApplyPreSetStatus
getCondition
getTriggerMessage

## Constructors

### constructor

- new ConditionalUserFieldStatusEffectImmunityAbAttr(
  condition: (target: default , source: null | default ) => boolean,
  ...immuneEffects: StatusEffect [],
  ): ConditionalUserFieldStatusEffectImmunityAbAttr

  #### Parameters

  - condition: (target: default , source: null | default ) => boolean
  - ...immuneEffects: StatusEffect []

  #### Returns ConditionalUserFieldStatusEffectImmunityAbAttr

  Overrides UserFieldStatusEffectImmunityAbAttr.constructor

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

## Properties

### `Protected` condition

condition: (target: default , source: null | default ) => boolean

The condition for the field immunity to be applied.

#### Type declaration

- - (target: default , source: null | default ): boolean

  - #### Parameters

    - target: default

      The target of the status effect

    - source: null | default

      The source of the status effect

    #### Returns boolean

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

### `Protected` immuneEffects

immuneEffects: StatusEffect []

Inherited from UserFieldStatusEffectImmunityAbAttr.immuneEffects

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

### showAbility

showAbility: boolean

Inherited from UserFieldStatusEffectImmunityAbAttr.showAbility

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

## Methods

### addCondition

- addCondition(condition: AbAttrCondition): AbAttr

  #### Parameters

  - condition: AbAttrCondition

  #### Returns AbAttr

  Inherited from UserFieldStatusEffectImmunityAbAttr.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 UserFieldStatusEffectImmunityAbAttr.apply

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

### applyPreSetStatus

- applyPreSetStatus(
  pokemon: default ,
  passive: boolean,
  simulated: boolean,
  effect: StatusEffect ,
  cancelled: BooleanHolder ,
  args: any[],
  ): void

  Applies immunity to supplied status effects.

  #### Parameters

  - pokemon: default

    The Pokémon to which the status is being applied.

  - passive: boolean

    n/a

  - simulated: boolean
  - effect: StatusEffect

    The status effect being applied.

  - cancelled: BooleanHolder

    A holder for a boolean value indicating if the status application was cancelled.

  - args: any[]

    n/a

  #### Returns void

  Inherited from UserFieldStatusEffectImmunityAbAttr.applyPreSetStatus

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

### 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 UserFieldStatusEffectImmunityAbAttr.canApply

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

### canApplyPreSetStatus

- canApplyPreSetStatus(
  pokemon: default ,
  passive: boolean,
  simulated: boolean,
  effect: StatusEffect ,
  cancelled: BooleanHolder ,
  args: [ default , null | default , ...any[]],
  ): boolean

  Evaluate the condition to determine if the ConditionalUserFieldStatusEffectImmunityAbAttr can be applied.

  #### Parameters

  - pokemon: default

    The pokemon with the ability

  - passive: boolean

    unused

  - simulated: boolean

    Whether the ability is being simulated

  - effect: StatusEffect

    The status effect being applied

  - cancelled: BooleanHolder

    Holds whether the status effect was cancelled by a prior effect

  - args: [ default , null | default , ...any[]]

    `Args[0]` is the target of the status effect, `Args[1]` is the source.

  #### Returns boolean

  Whether the ability can be applied to cancel the status effect.

  Overrides UserFieldStatusEffectImmunityAbAttr.canApplyPreSetStatus

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

### getCondition

- getCondition(): null | AbAttrCondition

  #### Returns null | AbAttrCondition

  Inherited from UserFieldStatusEffectImmunityAbAttr.getCondition

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

### getTriggerMessage

- getTriggerMessage(pokemon: default , abilityName: string, ...args: any[]): string

  #### Parameters

  - pokemon: default
  - abilityName: string
  - ...args: any[]

  #### Returns string

  Inherited from UserFieldStatusEffectImmunityAbAttr.getTriggerMessage

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