Skip to content

UpgradeDef ​

Interface of @v12-engine/engine

ts
export interface UpgradeDef

Research that improves a player's units for the rest of the game

Members ​

apply ​

ts
apply?: (world: World, entity: Entity, level: number) => void;

What it does besides stats, in code, to each unit of the player's: as a level is researched (to the units there are), and as a unit comes into the world while the player has it. Gives an ability, lets a unit hit what flies. Run again for every level: what it does is up to it to not do twice

basedOn ​

ts
basedOn?: string;

The definition this one is a copy of, made from the data (copyOf in a data.json, the editor's Copy as new): what it is drawn, heard and pictured as where the game gives it no look of its own

cost ​

ts
cost: Cost;

Paid for every level

description ​

ts
description?: string;

What the upgrade does, in words, shown when the pointer is over it

effects ​

ts
effects: UpgradeEffect[];

What each level changes in the stats of the units it applies to

hotkey ​

ts
hotkey?: string;

The key that researches it from the command card

id ​

ts
id: string;

The upgrade's id, shared by every game: give it a prefix of the game's

maxLevel ​

ts
maxLevel?: number;

The highest level that can be researched; 1 when left out

name ​

ts
name: string;

What the player sees the upgrade called

race ​

ts
race?: string;

The race it is of (Rules.races): only its players may research it. Everyone's when left out

requires ​

ts
requires?: string[][];

Building types needed, one list per level. Levels past the end of the list need nothing

researchTime ​

ts
researchTime: number;

Seconds per level