Skip to content

HeroSettings beta ​

Interface of @v12-engine/engine

ts
export interface HeroSettings

The numbers and formulas of heroes, the heroes pack's (heroesPack(rules)): how many heroes a player may have, how much experience a level takes, what bringing one back costs. The classic RTS numbers for those left out

Members ​

assistGold ​

ts
assistGold(world: World, victim: Entity, killer: Entity | undefined, assists: readonly Entity[]): number;

Gold the player of each hero that assists a hero's kill is paid. Half of what the kill is worth (its bounty's middle, or 100 and 25 a level of the victim's: heroKillWorth), shared out among them, when left out

assists ​

ts
assists(world: World, victim: Entity, killer: Entity | undefined, found: readonly Entity[]): readonly Entity[];

Which heroes assist a hero's kill, of those the engine found (foundAssists: who hurt it and who helped its killer within assistTime): all of them when left out. A game's own rule (only those near, only damage)

assistTime ​

ts
assistTime: number;

Seconds within which a hero that hurt a hero, or healed, shielded or buffed the hero that killed it, assists the kill (heroAssists): it shares the kill's experience wherever it is, and is paid assistGold. 10 when left out; 0 for no assists

buybackCooldown ​

ts
buybackCooldown: number;

Seconds a hero bought back waits before it may be again: 120 when left out

buybackCost ​

ts
buybackCost(world: World, hero: Entity): Cost | undefined;

What buying a fallen hero back costs its player (buyBack): 100 and 40 a level of its, in the game's money, when left out. Nothing for a hero that cannot be bought back: a game without buyback says () => undefined

callings ​

ts
callings: readonly CallingDef[];

The callings a hero may have (HeroDef.callings): the engine's when left out (defaultCallings), or a game's own, some of them, renamed or added to: heroesPack({ callings: [...] })

fallenFor ​

ts
fallenFor: number;

Seconds a fallen hero is remembered as it fell (fallenHeroes): 8 when left out

killXp ​

ts
killXp(world: World, dead: Entity): number;

Experience a kill is worth, for units whose type does not say (UnitTypeDef.xp)

maxHeroes ​

ts
maxHeroes: number;

Heroes a player can have at once, fallen ones and ones being trained included

maxHeroLevel ​

ts
maxHeroLevel: number;

The level heroes stop at, unless their type says otherwise (HeroDef.maxLevel)

pointsForLevel ​

ts
pointsForLevel(level: number): number;

Ability points a hero gets for reaching a level. One, when left out

revive ​

ts
revive(world: World, hero: Entity): {
        cost: Cost;
        time: number;
    };

What it costs to bring a fallen hero back, in the game's money, and how long it takes in seconds

shutdownGold ​

ts
shutdownGold(world: World, victim: Entity, streak: number): number;

Gold a hero's death pays its killer's player on top of the kill, for the kills it made in a row without dying (streak): the shutdown that ends a streak. None under 3, then 100, and 50 more for each kill past it, 500 at most, when left out

xpForLevel ​

ts
xpForLevel(level: number): number;

Experience needed in total to be of a level. Level 1 must need none

xpRange ​

ts
xpRange: number;

Heroes this close to a kill get a share of the experience