Projectile beta
Interface of @v12-engine/engine
export interface ProjectileA shot in flight to a target or a point; it deals its damage when it lands (world.projectiles)
Members
crit
crit: boolean;Whether the hit is a critical one
damage
damage: number;The damage it deals on landing
how
how?: string;How what it kills dies, for the screen (see AttackDef.how)
id
id: number;The projectile's id, from world.newId
kind
kind: string;The type of what shot it: the screen draws it so, even once the shooter is gone or out of sight
look
look?: string;What it looks like, when the rules say: a look of the shooter's visual, for the screen (a flaming arrow)
miss
miss: boolean;Fired uphill and going to miss: it flies all the way and does nothing when it comes down
owner
owner: PlayerId;The player whose unit fired it, who is credited with what it does
prevX
prevX: number;Where it was at the last tick, east-west, for the screen to blend by
prevZ
prevZ: number;Where it was at the last tick, north-south, for the screen to blend by
source
source: EntityId;The entity that fired it
speed
speed: number;World units it flies per second
splash
splash?: {
radius: number;
fells: boolean;
targets?: AttackDef['targets'];
};Set for shots that hit an area instead of a target
sx
sx: number;Where it was fired from
sz
sz: number;North-south coordinate it was fired from
tags
tags?: string[];Words of the game's own about it, which its damage carries (see BeforeAttack.tags)
target
target: EntityId;The entity it is after; 0 or gone for a shot that hits an area
tx
tx: number;Where it is heading. Follows the target while it lives
type
type: DamageType;The type of damage it deals
tz
tz: number;The north-south coordinate it is heading for
weapon
weapon?: number;Which of its shooter's attacks it is of, by place (UnitTypeDef.attacks): the first when left out
x
x: number;Where it is now, east-west, in world units
z
z: number;Where it is now, north-south, in world units