Skip to content

AbilityState beta ​

Interface of @v12-engine/engine

ts
export interface AbilityState

What a unit holds of one of its abilities: its level, cooldown, charges and autocast

Members ​

autocast ​

ts
autocast: boolean;

Whether the ability is cast by itself when its conditions are met

charges ​

ts
charges?: number;

Uses left, of an ability with charges (AbilityDef.charges): all it holds when left out, and chargesLeft says how many that is. Set while it holds fewer

cooldown ​

ts
cooldown: number;

Seconds until it can be used again

data ​

ts
data?: Record<string, unknown>;

The game's own state of the ability on this unit, plain data (numbers, text, lists and plain objects of them): ammo, a count of what it hit, a mark it left. Saved with the unit and told to its owner's screen with the rest of the ability (AbilityInfo.data), for a button to show. Nothing of the engine's reads it

id ​

ts
id: string;

The id of the ability this is the state of

level ​

ts
level: number;

0 for an ability a hero has not learned yet

point ​

ts
point?: Vec2;

Where it was last aimed

recast ​

ts
recast?: RecastWindow;

Its window to be cast again, while it is open (AbilityDef.recast): the next cast is a recast

refill ​

ts
refill?: number;

Seconds until the next use is back, while it holds fewer than it can

to ​

ts
to?: Vec2;

For one aimed along two points (vector): the second, the way it went from point