TriggerOnceOnDrop

TriggerOnceOnDrop

A one-shot trigger that fires when a specific named item is dropped on this cell. Once it fires it removes itself, so it will never fire again.

Typical use: detect when the player places a particular item at a location — e.g. an altar that reacts only when the Chalice is set down — then vanish so the scene plays out exactly once.

Constructor

new TriggerOnceOnDrop(terrain, color, itemName)

Source:
Parameters:
Name Type Description
terrain Terrain

The underlying terrain this decorator wraps.

color Color

Color event broadcast to the board on firing.

itemName string

Exact item name that must be dropped to trigger the event.

Extends

Classes

TriggerOnceOnDrop

Members

terrain :Terrain

Source:
Overrides:
Type:

Methods

getProxiedTerrain()

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

Source:
Overrides:

onDropInternal(event, cell, item)

Description:
  • Fires the color event and removes this trigger when the dropped item's name exactly matches TriggerOnceOnDrop#itemName. Skips silently when the event is already cancelled or the item does not match.

Source:
Parameters:
Name Type Description
event GameEvent
cell Cell
item Item

The item being dropped.