TargetScore beta
Interface of @v12-engine/engine
export interface TargetScoreHow 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
attacker: Entity;The unit looking for a target
distance
distance: number;Edge to edge
engaged
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
room: number;How many attackers like it the target has already (RuleSettings.combat.engageRoom)
score
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
target: Entity;The candidate it is scoring