Mimic

Mimic

Displays the symbol of one terrain while behaving like another, creating a hidden terrain effect. When a player with the DETECT_HIDDEN flag is adjacent, the cell briefly reveals the actual terrain's symbol.

Typical use: disguise a dangerous or traversable cell as something else — subclasses SecretPassage and PitTrap are the canonical examples.

Constructor

new Mimic(appearsAs, actual, color)

Source:
Parameters:
Name Type Description
appearsAs Terrain

The terrain whose symbol is shown to the player.

actual Terrain

The terrain that governs behavior and traversal.

color Color

Color used by the underlying Decorator.

Extends

Classes

Mimic

Members

terrain :Terrain

Source:
Overrides:
Type:

Methods

getApparentTerrain()

Description:
  • Returns the visual terrain (the one whose symbol is displayed).

Source:

getProxiedTerrain()

Description:
  • Returns the behavioral terrain (the one being wrapped).

Source:
Overrides:

onAdjacentToInternal(event, cell)

Description:
  • When the player enters an adjacent cell and has DETECT_HIDDEN, swaps the cell's animation symbol to reveal the actual terrain.

Source:
Parameters:
Name Type Description
event GameEvent
cell Cell

onNotAdjacentToInternal(_event, cell)

Description:
  • When the player leaves the adjacent position, restores the cell's animation symbol so the disguise is shown again.

Source:
Parameters:
Name Type Description
_event GameEvent

Unused.

cell Cell