Skip to content

Targeting beta ​

Interface of @v12-engine/engine

ts
export interface Targeting

A way of aiming of a game's own, for AbilityDef.target (defineTargeting): the engine's way it is like (what the player gives, what the order walks to), and on top of that what may be aimed at (check), where the effects go from what was aimed (aim), and what the screen draws while it is aimed (indicator)

Members ​

aim ​

ts
aim?(world: World, caster: Entity, ability: AbilityDef, aim: CastAim): CastAimed | undefined;

Where the effects go, from how it was aimed: over what the engine makes of it (its point, target, and for two points the first as the origin and the second as the point)

check ​

ts
check?(world: World, caster: Entity, ability: AbilityDef, aim: CastAim): MessageRef | undefined;

Why it cannot be aimed so, or nothing where it can: asked as the order takes it and again as it goes off (the player is told the reason). A wall only on open ground, a point only beside an ally

id ​

ts
readonly id: string;

What AbilityDef.target says for it

indicator ​

ts
indicator?(view: AimView): readonly AimPiece[] | undefined;

What the screen draws on the ground while the player aims it, in place of the engine's (aimOf): pieces of the shapes there are, each at a place, turned as it says. Code of the game's own, run on the screen: no world

like ​

ts
readonly like: Exclude<AimKind, 'passive'>;

The engine's way it is like: what the player gives (a unit, a point, two points, nothing) and what the order walks to