Skip to content

TargetScore beta ​

Interface of @v12-engine/engine

ts
export interface TargetScore

How much a unit wants to attack something, as it looks for a target by itself. Higher is picked first: raise or lower score, or make it -Infinity to pass the target over. Towers of a tower defense go for the creep furthest along its way like this; a taunt makes everyone go for one unit.

Runs for every candidate of every search, which is often: the same object is handed out again and again, so keep nothing of it.

Members ​

attacker ​

ts
attacker: Entity;

The unit looking for a target

distance ​

ts
distance: number;

Edge to edge

engaged ​

ts
engaged: number;

Attackers like this one (its layer, its reach) the target has already, and how many it has room for (RuleSettings.combat.engageRoom)

room ​

ts
room: number;

How many attackers like it the target has already (RuleSettings.combat.engageRoom)

score ​

ts
score: number;

What the engine makes of it: things that fight back first, then the closest, and a full one only when nothing else is near

target ​

ts
target: Entity;

The candidate it is scoring