Trigger

Trigger

Fires a color event (and optional message) when the player steps on it. Persistent — fires every time.

Constructor

new Trigger(terrain, color, message)

Source:
Parameters:
Name Type Description
terrain Terrain

The underlying terrain this decorator wraps.

color Color

Color event broadcast to the board on firing.

message string | null

Optional modal message shown to the player.

Extends

Classes

Trigger

Members

terrain :Terrain

Source:
Overrides:
Type:

Methods

getProxiedTerrain()

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

Source:
Overrides:

onEnterInternal(event, _player, cell, _dir)

Description:
  • Fires the color event and, if set, shows a modal message to the player. Skips silently when the event is already cancelled.

Source:
Parameters:
Name Type Description
event GameEvent
_player Player

Unused.

cell Cell
_dir Direction

Unused.