Skip to content

Projectile beta ​

Interface of @v12-engine/engine

ts
export interface Projectile

A shot in flight to a target or a point; it deals its damage when it lands (world.projectiles)

Members ​

crit ​

ts
crit: boolean;

Whether the hit is a critical one

damage ​

ts
damage: number;

The damage it deals on landing

how ​

ts
how?: string;

How what it kills dies, for the screen (see AttackDef.how)

id ​

ts
id: number;

The projectile's id, from world.newId

kind ​

ts
kind: string;

The type of what shot it: the screen draws it so, even once the shooter is gone or out of sight

look ​

ts
look?: string;

What it looks like, when the rules say: a look of the shooter's visual, for the screen (a flaming arrow)

miss ​

ts
miss: boolean;

Fired uphill and going to miss: it flies all the way and does nothing when it comes down

owner ​

ts
owner: PlayerId;

The player whose unit fired it, who is credited with what it does

prevX ​

ts
prevX: number;

Where it was at the last tick, east-west, for the screen to blend by

prevZ ​

ts
prevZ: number;

Where it was at the last tick, north-south, for the screen to blend by

source ​

ts
source: EntityId;

The entity that fired it

speed ​

ts
speed: number;

World units it flies per second

splash ​

ts
splash?: {
        radius: number;
        fells: boolean;
        targets?: AttackDef['targets'];
    };

Set for shots that hit an area instead of a target

sx ​

ts
sx: number;

Where it was fired from

sz ​

ts
sz: number;

North-south coordinate it was fired from

tags ​

ts
tags?: string[];

Words of the game's own about it, which its damage carries (see BeforeAttack.tags)

target ​

ts
target: EntityId;

The entity it is after; 0 or gone for a shot that hits an area

tx ​

ts
tx: number;

Where it is heading. Follows the target while it lives

type ​

ts
type: DamageType;

The type of damage it deals

tz ​

ts
tz: number;

The north-south coordinate it is heading for

weapon ​

ts
weapon?: number;

Which of its shooter's attacks it is of, by place (UnitTypeDef.attacks): the first when left out

x ​

ts
x: number;

Where it is now, east-west, in world units

z ​

ts
z: number;

Where it is now, north-south, in world units