EntityState beta
Interface of @v12-engine/engine
export interface EntityStateA unit, building, resource or other entity as the screen is told of it
Members
abilities
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
asleep?: boolean;Doing nothing until woken, like a creep sleeping through the night
buffs
buffs?: string[];Ids of the buffs on it
buffTimes
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
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
components?: Record<string, unknown>;Components of game modules and mods that are sent to this player (see Component.replicate), by id
facing
facing: number;The way it faces, in radians; 0 is along +z
health
health: number;Its health now
id
id: number;The entity's id, which commands and orders name it by
leap
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
lifetime?: {
left: number;
total: number;
};Seconds left and seconds in all, for what is gone by itself after a while, like a ward
likeness
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
look?: string;Which of the models of its type it is drawn with, when the map says
mana
mana?: number;Its mana now; left out when it has none
maxHealth
maxHealth?: number;Left out when it is what the unit type says
maxMana
maxMana?: number;Its largest mana when that is not what its type says
name
name?: string;The name the map or the rules gave it (world.named), for whoever knows of it: "the gate", "the hero"
on
on?: number;The resource it stands on (UnitTypeDef.builtOn, a cursed mine on a gold mine), by id
own
own?: OwnEntityState;What only its owner and their allies are told of it
owner
owner: PlayerId;The player who owns it
resource
resource?: number;What is left in a resource
scale
scale?: number;How big it is drawn, when that is not 1
shield
shield?: number;What its shields still hold
stacks
stacks?: Record<string, number>;How many of each of its buffs that stack it carries, for the ones it carries any of
stats
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
type: string;The id of its unit type
unseen
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
visible: boolean;False for a structure that is out of sight and shown the way it was last seen
x
x: number;Where it stands, east-west, in world units
z
z: number;Where it stands, north-south, in world units