Constructor
new TriggerOnceOnPickup(terrain, color, flagStr)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
terrain |
Terrain | The underlying terrain this decorator wraps. |
color |
Color | Color event broadcast to the board on firing. |
flagStr |
string | Item name or flag string that must match the picked-up item to trigger the event. |
Extends
Classes
Members
terrain :Terrain
- Source:
- Overrides:
Type:
Methods
getProxiedTerrain()
- Description:
Return the terrain being wrapped (TerrainProxy interface).
- Source:
- Overrides:
onPickupInternal(event, cell, _agent, item)
- Description:
Fires the color event and removes this trigger when the picked-up item matches TriggerOnceOnPickup#flagStr by name or by flag. Skips silently when the event is already cancelled or the item does not match.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
event |
GameEvent | |
cell |
Cell | |
_agent |
Agent | Unused; the agent performing the pickup. |
item |
Item | The item being picked up. |