isTarget
isTarget(
world,entity,candidate,isTargetOptions?):boolean
Whether candidate is among the targets targets names for the
behaviour on entity: let in by one of its kinds or layers, the
default kind where it lists none, and kept by each of its teams and
rules. A behaviour adds its own conditions on top, such as a chaser
never running at an ally.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
entity |
Entity |
candidate |
Entity |
isTargetOptions |
IsTargetOptions |
Returns
Section titled “Returns”boolean
Example
Section titled “Example”if (isTarget(step.world, gate, character, { targets: [red] })) open(gate);