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

# Class ConditionalUserFieldProtectStatAbAttr

Conditionally provides immunity to stat drop effects to the user's field.

Used by `Flower Veil`.

#### Hierarchy (View Summary)

- PreStatStageChangeAbAttr
  - ConditionalUserFieldProtectStatAbAttr

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

##### Index

### Constructors

constructor

### Properties

condition
protectedStat?
showAbility

### Methods

addCondition
apply
applyPreStatStageChange
canApply
canApplyPreStatStageChange
getCondition
getTriggerMessage

## Constructors

### constructor

- new ConditionalUserFieldProtectStatAbAttr(
  condition: (target: default ) => boolean,
  protectedStat?: ATK | DEF | SPATK | SPDEF | SPD | ACC | EVA ,
  ): ConditionalUserFieldProtectStatAbAttr

  #### Parameters

  - condition: (target: default ) => boolean
  - `Optional` protectedStat: ATK | DEF | SPATK | SPDEF | SPD | ACC | EVA

  #### Returns ConditionalUserFieldProtectStatAbAttr

  Overrides PreStatStageChangeAbAttr.constructor

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

## Properties

### `Protected` condition

condition: (target: default ) => boolean

If the method evaluates to true, the stat will be protected.

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

### `Protected` `Optional` protectedStat

protectedStat?: ATK | DEF | SPATK | SPDEF | SPD | ACC | EVA

`BattleStat` to protect or `undefined` if all `BattleStat` are protected

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

### showAbility

showAbility: boolean

Inherited from PreStatStageChangeAbAttr.showAbility

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

## Methods

### addCondition

- addCondition(condition: AbAttrCondition): AbAttr

  #### Parameters

  - condition: AbAttrCondition

  #### Returns AbAttr

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

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

### applyPreStatStageChange

- applyPreStatStageChange(
  _pokemon: default ,
  _passive: boolean,
  _simulated: boolean,
  _stat: ATK | DEF | SPATK | SPDEF | SPD | ACC | EVA ,
  cancelled: BooleanHolder ,
  _args: any[],
  ): void

  Apply the `ConditionalUserFieldStatusEffectImmunityAbAttr` to an interaction

  #### Parameters

  - _pokemon: default

    The pokemon the stat change is affecting (unused)

  - _passive: boolean

    unused

  - _simulated: boolean

    unused

  - _stat: ATK | DEF | SPATK | SPDEF | SPD | ACC | EVA
  - cancelled: BooleanHolder

    Will be set to true if the stat change is prevented

  - _args: any[]

    unused

  #### Returns void

  Overrides PreStatStageChangeAbAttr.applyPreStatStageChange

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

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

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

### canApplyPreStatStageChange

- canApplyPreStatStageChange(
  pokemon: default ,
  passive: boolean,
  simulated: boolean,
  stat: ATK | DEF | SPATK | SPDEF | SPD | ACC | EVA ,
  cancelled: BooleanHolder ,
  args: [ default , ...any[]],
  ): boolean

  Determine whether the ConditionalUserFieldProtectStatAbAttr can be applied.

  #### Parameters

  - pokemon: default

    The pokemon with the ability

  - passive: boolean

    unused

  - simulated: boolean

    Unused

  - stat: ATK | DEF | SPATK | SPDEF | SPD | ACC | EVA

    The stat being affected

  - cancelled: BooleanHolder

    Holds whether the stat change was already prevented.

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

    Args[0] is the target pokemon of the stat change.

  #### Returns boolean

  Overrides PreStatStageChangeAbAttr.canApplyPreStatStageChange

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

### getCondition

- getCondition(): null | AbAttrCondition

  #### Returns null | AbAttrCondition

  Inherited from PreStatStageChangeAbAttr.getCondition

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

### getTriggerMessage

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

  #### Parameters

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

  #### Returns null | string

  Inherited from PreStatStageChangeAbAttr.getTriggerMessage

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