Skip to content

EntityState beta ​

Interface of @v12-engine/engine

ts
export interface EntityState

A unit, building, resource or other entity as the screen is told of it

Members ​

abilities ​

ts
abilities?: SharedAbility[];

The abilities it has learned, for whoever sees it, its side's or not, where the rules share them (RuleSettings.hud.shareAbilities). Its side has them in own.abilities all the same

asleep ​

ts
asleep?: boolean;

Doing nothing until woken, like a creep sleeping through the night

buffs ​

ts
buffs?: string[];

Ids of the buffs on it

buffTimes ​

ts
buffTimes?: number[];

Seconds left of each of its buffs, in their order (whole seconds, rounded up, from a host: the plate counts down between); -1 for one kept up by an aura or a passive (BuffInstance.kept) or that lasts until it is taken off. Where the rules share them (RuleSettings.hud.shareBuffTimes)

busy ​

ts
busy?: boolean;

It has an order to carry out: left out while it stands idle. What a cinematic's waits go by (arrived), for any unit it directs; anyone in sight of it can see it walk or swing

components ​

ts
components?: Record<string, unknown>;

Components of game modules and mods that are sent to this player (see Component.replicate), by id

facing ​

ts
facing: number;

The way it faces, in radians; 0 is along +z

health ​

ts
health: number;

Its health now

id ​

ts
id: number;

The entity's id, which commands and orders name it by

leap ​

ts
leap?: {
        from: Vec2;
        to: Vec2;
        height: number;
    };

On its way through the air: from where to where, and how high it rises in between

lifetime ​

ts
lifetime?: {
        left: number;
        total: number;
    };

Seconds left and seconds in all, for what is gone by itself after a while, like a ward

likeness ​

ts
likeness?: {
        type: string;
        owner: PlayerId;
    };

Drawn as this type, in this owner's colour, while it is what its own type and owner say (SpawnOptions.looksLike)

look ​

ts
look?: string;

Which of the models of its type it is drawn with, when the map says

mana ​

ts
mana?: number;

Its mana now; left out when it has none

maxHealth ​

ts
maxHealth?: number;

Left out when it is what the unit type says

maxMana ​

ts
maxMana?: number;

Its largest mana when that is not what its type says

name ​

ts
name?: string;

The name the map or the rules gave it (world.named), for whoever knows of it: "the gate", "the hero"

on ​

ts
on?: number;

The resource it stands on (UnitTypeDef.builtOn, a cursed mine on a gold mine), by id

own ​

ts
own?: OwnEntityState;

What only its owner and their allies are told of it

owner ​

ts
owner: PlayerId;

The player who owns it

resource ​

ts
resource?: number;

What is left in a resource

scale ​

ts
scale?: number;

How big it is drawn, when that is not 1

shield ​

ts
shield?: number;

What its shields still hold

stacks ​

ts
stacks?: Record<string, number>;

How many of each of its buffs that stack it carries, for the ones it carries any of

stats ​

ts
stats?: Partial<Stats>;

The stats that are not what its type starts with. Whoever sees a unit can tell what it is capable of

type ​

ts
type: string;

The id of its unit type

unseen ​

ts
unseen?: boolean;

Invisible to enemies right now, or camouflaged (BuffDef.camouflage: seen by them only from near). Whoever gets this sees it all the same: it is theirs, or they found it, or they are near

visible ​

ts
visible: boolean;

False for a structure that is out of sight and shown the way it was last seen

x ​

ts
x: number;

Where it stands, east-west, in world units

z ​

ts
z: number;

Where it stands, north-south, in world units