PokéRogue
    Preparing search index...

    Class DamagingTrapTagAbstract

    Abstract class to implement damaging entry hazards. Currently used for SpikesTag and StealthRockTag.

    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: number | undefined

    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 maxLayers(): number

      The maximum number of layers this tag can have.

      Returns number

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

    • get triggerMessageKey(): string

      Return the i18n key of the text to be displayed when this tag deals damage.
      Within the text, {{pokemonNameWithAffix}} will be populated with the victim's name.

      Returns string

      The locales key for the trigger message to be displayed on-screen.

    Methods

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

    • Return the amount of damage this tag should deal to the given Pokemon, relative to its maximum HP.

      Parameters

      Returns number

      The percentage of max HP to deal upon activation.

    • Reduce this ArenaTag's duration and apply any end-of-turn effects.

      Returns boolean

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

      Will ignore durations of all tags with durations <=0.

    • 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