pokemon-rogue-battle
    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.

    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.

    Implement handling for ArenaTags created by non-pokemon sources (most tags will throw errors without a source)

    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

    Methods

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

      Parameters

      • _pokemon: Pokemon

        The Pokemon

      • _simulated: boolean

        Whether the activation is simulated

      Returns boolean

      Whether the trap activation succeeded

      Do we need the return value? nothing uses it

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

      Parameters

      • _arena: Arena

        The Arena at the time of tag activation

      • 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.

    • Return the text to be displayed upon adding a new layer to this trap.

      Parameters

      Returns string

      The localized message to be displayed on screen.

    • Trigger this ArenaTag's effect, reducing its duration as applicable. Will ignore durations of all tags with durations <=0.

      Parameters

      • _arena: Arena

        The Arena at the moment the tag is being lapsed. Unused by default but can be used by sub-classes.

      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

    • Display text when this tag is added to the field.

      Parameters

      • _arena: Arena

        The Arena at the time of adding this tag

      • quiet: boolean = false

        Whether to suppress messages during tag creation; default false

      Returns void