PokéRogue
    Preparing search index...

    Class EntryHazardTagAbstract

    Abstract class to implement entry hazards. These persistent tags remain on-field across turns and apply effects to any Pokemon switching in.
    Uniquely, adding a tag multiple times may stack multiple "layers" of the effect, increasing its severity.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    layers: number = 1

    The current number of layers this tag has.
    Starts at 1 and increases each time the trap is laid.

    maxDuration: number

    The tag's max duration.

    The side of the field that this arena tag affects.

    ArenaTagSide.BOTH

    sourceId: undefined | number

    The PID of the Pokemon having created the tag, or undefined if not set by a Pokemon.

    sourceMove?: MoveId

    The MoveId that created this tag, or undefined if not set by a move.

    The type of the arena tag

    turnCount: number

    The tag's remaining duration. Setting to any number <=0 will make the tag's duration effectively infinite.

    Accessors

    • get groundedOnly(): boolean

      Whether this tag should only affect grounded targets; default true

      Returns boolean

    • get i18nSideKey(): string
      Sealed

      Returns string

      A suffix corresponding to this tag's current side.

    • get onAddMessageKey(): string

      Return the i18n locales key that will be shown when this tag is added.
      Within the text, {{pokemonNameWithAffix}} and {{moveName}} will be populated with the name of the Pokemon that added the tag and the name of the move that created the tag, respectively.

      Returns string

      If this evaluates to an empty string, no message will be displayed.

    • get onRemoveMessageKey(): string

      Return the i18n locales key that will be shown when this tag is removed.
      Within the text, {{pokemonNameWithAffix}} and {{moveName}} will be populated with the name of the Pokemon that added the tag and the name of the move that created the tag, respectively.

      Returns string

      If this evaluates to an empty string, no message will be displayed.

    Methods

    • Activate this trap's effects when a Pokemon switches into it.

      Parameters

      • simulated: boolean

        Whether the activation is simulated

      • pokemon: Pokemon

        The Pokemon switching in

      Returns boolean

      Whether the trap activation succeeded

    • Activate the hazard effect onto a Pokemon when it enters the field.

      Parameters

      • simulated: boolean

        Whether to suppress activation effects during execution

      • pokemon: Pokemon

        The Pokemon triggering this hazard

      Returns boolean

      true if this hazard affects the given Pokemon; false otherwise.

    • Check if the maximum number of layers for this tag has been reached.

      Returns boolean

      Whether this tag can have another layer added to it.

    • Reduce this ArenaTag's duration and apply any end-of-turn effects Will ignore durations of all tags with durations <=0.

      Returns boolean

      true if this tag should be kept; false if it should be removed.

    • When given a arena tag or json representing one, load the data for it. This is meant to be inherited from by any arena tag with custom attributes

      Type Parameters

      Parameters

      • source: BaseArenaTag & Pick<T, "tagType" | "layers">

        The arena tag being loaded

      Returns void

    • Trigger effects when this tag is added to the Arena. By default, will queue a message with the contents of getOnAddMessage.

      Parameters

      • quiet: boolean = false

        Whether to suppress any messages created during tag addition; default false

      Returns void

    • Trigger effects when this tag is removed from the Arena. By default, will queue a message with the contents of getOnRemoveMessage.

      Parameters

      • quiet: boolean = false

        Whether to suppress any messages created during tag addition; default false

      Returns void