AgentDestroyer

AgentDestroyer

Destroys agents that interact with this cell, operating in one of two modes depending on whether a color is configured.

  • Passive mode (color is NONE): destroys any non-player agent the moment it steps onto this cell, removing it from the cell it entered from.
  • Active mode (color is set): destroys the agent currently on this cell when a matching color event is received.

Typical use: create invisible kill-zones for agents, or trigger a boss defeat remotely via a color event.

Constructor

new AgentDestroyer()

Source:

Extends

Classes

AgentDestroyer

Methods

getProxiedTerrain()

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

Source:
Overrides:

onAgentEnterInternal()

Description:
  • In passive mode (color is NONE), removes the agent from the cell it entered from as soon as it steps onto this cell, then runs the same death sequence as Java's Game.die(): fire onDie and, unless that cancels the event, drop a Hit effect on the cell.

Source:

onColorEventInternal()

Description:
  • In active mode, removes the agent on this cell when the received color matches AgentDestroyer#color, mirroring Java's Game.die(): fire onDie on a fresh event, decoupled from whatever event triggered the color signal (e.g. a Switch's already-cancelled move event), and, unless that cancels the event, remove the agent and drop a Hit effect. Skips silently when the cell has no agent.

Source: