Flagger

Flagger

Sets a flag on the player when a matching color event is received.

Typical use: mark the player as having completed a task or entered a region — e.g. set the "poisoned" flag when the player steps on a trap that fires a color event.

Constructor

new Flagger(terrain, color, flag)

Source:
Parameters:
Name Type Description
terrain Terrain

The underlying terrain this decorator wraps.

color Color

The color event that triggers the flag change.

flag number

Bitmask flag to add to the player.

Extends

Classes

Flagger

Members

terrain :Terrain

Source:
Overrides:
Type:

Methods

getProxiedTerrain()

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

Source:
Overrides:

onColorEventInternal(event, color, _cell)

Description:
  • Adds Flagger#flag to the player when the received color matches Flagger#color. Skips silently when there is no player in the event.

Source:
Parameters:
Name Type Description
event GameEvent
color Color
_cell Cell

Unused.