Unequipper

Unequipper

Removes a specific item from the player's bag when a matching color event is received.

Typical use: consume a required item as part of a puzzle or trade — e.g. take the Chalice from the player when it is delivered to an altar that fires a color event.

Constructor

new Unequipper(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 removal.

item Item

The item instance to remove from the player's bag.

Extends

Classes

Unequipper

Members

terrain :Terrain

Source:
Overrides:
Type:

Methods

getProxiedTerrain()

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

Source:
Overrides:

onColorEventInternal(event, color, _cell)

Description:
  • Removes Unequipper#item from the player's bag when the received color matches Unequipper#color. Skips silently when there is no player in the event.

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

Unused.