Skip to content

AttackDef beta ​

Interface of @v12-engine/engine

ts
export interface AttackDef

One of the ways a unit attacks (UnitTypeDef.attacks): what it hits, how its blow lands. How hard, how fast and how far are stats: the unit's attackDamage, attackSpeed and attackRange, or stats of the game's own that the attack names (stats: a second weapon's)

Members ​

acquisitionRange ​

ts
acquisitionRange: number;

Enemies closer than this are attacked automatically

cleave ​

ts
cleave?: Cleave;

A blow from up close (no missile) also strikes the target's other enemies near it, a part of its damage each: a cleave. With a buff's (BuffDef.cleave), the one of the larger part counts

damagePoint ​

ts
damagePoint: number;

Seconds from the start of the swing until damage lands (or the projectile leaves), at the attack speed the unit starts with

damageType ​

ts
damageType?: DamageType;

Physical when left out

fells ​

ts
fells?: boolean;

Brings down what is fellable in the area it hits

ground ​

ts
ground?: boolean;

Can be told to attack a spot on the ground

how ​

ts
how?: string | ((hit: {
        attacker: Entity;
        target?: Entity;
        damage: number;
        type: DamageType;
        crit: boolean;
        tags?: readonly string[];
    }) => string | undefined);

How what this attack kills dies, for the screen ('shot', 'crushed', 'burnt'): the death's how, which the view shows its way (UnitLook.death). A word, or one decided for each blow. The death hook has the last say

minRange ​

ts
minRange?: number;

How near is too near, edge to edge: what is closer than this the attack does not hit (a siege weapon's dead zone). Another of the unit's attacks takes over there where one reaches (RuleSettings.combat.pickAttack); with none, a unit told to attack steps back out of it first, and one left to itself does not pick what is that near. None when left out

onTheMove ​

ts
onTheMove?: boolean;

Fires as the unit walks (a horse archer, a tank's turret): told to move, it hits what it passes within the attack's range without stopping or turning to it, at the attack's speed. Every other order fights as any attack does (it stops to). Not when left out

projectileSpeed ​

ts
projectileSpeed?: number;

Set for ranged attacks

recovery ​

ts
recovery?: number;

Seconds after the blow during which the unit is held: an order it is given (a move, another attack) waits until they are over, unless the rules let it cut them (RuleSettings.combat.recoveryCancels). At the attack speed the unit starts with, shorter as it attacks faster, and never past its next swing. None when left out: it may walk away the moment the blow lands (kiting), as in LoL

splash ​

ts
splash?: number;

Radius around the point of impact in which everyone is hit, friends too: in full in the inner half, by half further out. Shots of such an attack land where they were aimed, they do not follow their target

stats ​

ts
stats?: AttackStats;

The stats its numbers are, by id: a stat of the game's (Rules.stats) for a weapon whose damage, speed or range is not the unit's first's. What changes those stats (research, items, buffs) changes this attack alone

targets ​

ts
targets?: (EntityKind | Layer)[];

What this attack can hit: kinds of things, and where they are. Everything on the ground when left out. What flies is only hit by attacks that name air, and an attack that names air alone does not hit the ground