Equipper

Equipper

Adds a specific item to the player's bag when a matching color event is received.

Typical use: grant the player an item as a reward or story beat — e.g. place a Key in the player's bag when a puzzle is solved elsewhere on the board.

Constructor

new Equipper(terrain, color, item)

Source:
Parameters:
Name Type Description
terrain Terrain

The underlying terrain this decorator wraps.

color Color

The color event that triggers the item grant.

item Item

The item instance to add to the player's bag.

Extends

Classes

Equipper

Members

terrain :Terrain

Source:
Overrides:
Type:

Methods

getProxiedTerrain()

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

Source:
Overrides:

onColorEventInternal(event, color, _cell)

Description:
  • Adds Equipper#item to the player's bag when the received color matches Equipper#color. Skips silently when there is no player in the event.

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

Unused.