PokéRogue
    Preparing search index...

    Interface DamageOverTimeTagAbstract

    Abstract class to damage the attached Pokemon at the end of each turn.

    Triggers repeatedly until removed by an effect or move.

    interface DamageOverTimeTag {
        sourceId?: number;
        sourceMove?: MoveId;
        tagType: DamageOverTimeTagType;
        turnCount: number;
        get animation(): CommonAnim;
        get lapseTypes(): readonly BattlerTagLapseType[];
        get onAddMessageKey(): string;
        get triggerMessageKey(): string;
        canAdd(pokemon: Pokemon): boolean;
        damage(pokemon: Pokemon): void;
        getDamageHpRatio(pokemon: Pokemon): number;
        getDescriptor(): string;
        getMoveName(): string | null;
        getSourcePokemon(): Pokemon | undefined;
        isBatonPassable(recipient: Pokemon): boolean;
        isSourceLinked(): boolean;
        lapse(pokemon: Pokemon): boolean;
        loadTag<const T extends DamageOverTimeTag>(
            source: BaseBattlerTag & Pick<T, "tagType">,
        ): void;
        onAdd(pokemon: Pokemon): void;
        onOverlap(_pokemon: Pokemon): void;
        onRemove(_pokemon: Pokemon): void;
    }

    Hierarchy (View Summary)

    Index
    sourceId?: number

    The PID of the Pokemon that added this 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.

    turnCount: number

    The tag's remaining duration.

    • get onAddMessageKey(): string

      Return the i18n locales key that will be shown when this tag is added.
      Within the text, {{pokemonNameWithAffix}} will be populated with the name of the Pokemon to whom this Tag is attached.

      Returns string

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

    • get triggerMessageKey(): string

      Return the i18n locales key of the text to be displayed when this tag deals damage.
      Within the text, the following variables will be populated:

      • {{pokemonNameWithAffix}} - the name of the Pokemon to whom this Tag is attached.
      • {{sourcePokemonName}} - the name of the Pokemon having created this Tag, if recorded.
      • {{moveName}} - The name of the Move to which this Tag is attached, if recorded.

      Returns string

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

    • Sealed

      Damage the Pokemon to whom this Tag is attached.

      Handles checking for Magic Guard, queueing animations, and other assorted checks.

      Parameters

      Returns void

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

    • Returns string

    • Returns string | null

    • Helper function that retrieves the source Pokemon object

      Returns Pokemon | undefined

      The source Pokemon, or undefined if none is found

    • Check whether this Tag can be transferred to another Pokemon via Baton Pass.

      Parameters

      • recipient: Pokemon

        The Pokemon receiving this Tag (i.e. the one switching in) Unused by default but exposed to allow for subclasses to perform custom logic.

      Returns boolean

      Whether this Tag can be transferred via Baton Pass. Defaults to returning the value set in the class constructor.

    • Returns boolean

    • Apply the battler tag's effects based on the lapse type

      Parameters

      • pokemon: Pokemon

        The Pokemon whom this tag belongs to. Unused by default but can be used by subclasses.

      Returns boolean

      true if the tag should be kept (turnCount > 0 by default)

      Generally, this involves ticking down the tag's duration. The tag also initiates the effects it is responsbile for