TriggerOnceOnPickup

TriggerOnceOnPickup

A one-shot trigger that fires when a specific item is picked up from this cell. The item is matched by its exact name or by its Registry type ID (using _matchesNameOrType). Once it fires it removes itself, so it will never fire again.

Typical use: react to the player collecting a key item from a location — e.g. the moment the player lifts the Amulet off a pedestal — then vanish so the event fires only once.

Constructor

new TriggerOnceOnPickup(terrain, color, flagStr)

Source:
Parameters:
Name Type Description
terrain Terrain

The underlying terrain this decorator wraps.

color Color

Color event broadcast to the board on firing.

flagStr string

Item name or flag string that must match the picked-up item to trigger the event.

Extends

Classes

TriggerOnceOnPickup

Methods

getProxiedTerrain()

Description:
  • Return the terrain being wrapped (TerrainProxy interface).

Source:
Overrides:

onPickupInternal()

Description:
  • Fires the color event and removes this trigger when the picked-up item matches TriggerOnceOnPickup#flagStr by name or by Registry type ID. Skips silently when the event is already cancelled or the item does not match.

Source: