pokemon-rogue-battle
    Preparing search index...

    Class PostDamageForceSwitchAbAttr

    Ability attribute for forcing a Pokémon to switch out after its health drops below half. This attribute checks various conditions related to the damage received, the moves used by the Pokémon and its opponents, and determines whether a forced switch-out should occur.

    Used by Wimp Out and Emergency Exit

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    showAbility: boolean

    Methods

    • 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

    • Applies the switch-out logic after the Pokémon takes damage. Checks various conditions based on the moves used by the Pokémon, the opponents' moves, and the Pokémon's health after damage to determine whether the switch-out should occur.

      Parameters

      • pokemon: default

        The Pokémon that took damage.

      • damage: number

        N/A

      • passive: boolean

        N/A

      • simulated: boolean

        Whether the ability is being simulated.

      • args: any[]

        N/A

      • Optionalsource: default

        N/A

      Returns void

    • 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

      apply