PokéRogue
    Preparing search index...

    Interface GenericSerializableBattlerTag<T>

    Interface for a generic serializable battler tag, i.e. one that does not have a dedicated subclass.

    Used to ensure type safety when serializing battler tags, allowing Typescript to properly infer the type of the tag.

    BattlerTagTypeMap

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

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    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.

    tagType: T
    turnCount: number

    The tag's remaining duration.

    Accessors

    Methods

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