AgentProxy

AgentProxy

Abstract base class for agent decorators (proxies).

Wraps another agent and forwards all behaviour to it, with the exception of onTurn which is intentionally suppressed so that creature AI is disabled for the duration of any proxy effect (giving paralysis for free for non-player agents).

Subclasses can override individual callbacks to add effect-specific behaviour. The wrapped agent is accessible as this.agent.

Mirrors Java's AgentProxy abstract class.

Constructor

new AgentProxy(agent, flags)

Source:
Parameters:
Name Type Description
agent Agent

The agent being wrapped.

flags number

Additional flags added by this proxy.

Classes

AgentProxy

Members

agent :Agent

Source:
Type:

isAgentProxy

Description:
  • Marker used by Cell.setAgent / _clearAgent to detect proxy-wrapped players without creating a circular import to the AgentProxy class.

Source:

Marker used by Cell.setAgent / _clearAgent to detect proxy-wrapped players without creating a circular import to the AgentProxy class.

Methods

is()

Description:
  • Returns true if either the proxy's own flags OR the wrapped agent has the given flag. This is critical so that PLAYER propagates through a Paralyzed wrapper.

Source:

not()

Description:
  • Returns true only if neither the proxy flags nor the wrapped agent has the given flag.

Source:

onFrame()

Description:
  • Delegates to the wrapped agent's onFrame if it defines one.

Source: