Skip to content

defaultStrength beta ​

Variable of @v12-engine/engine/ai

ts
defaultStrength: StrengthFormula

The kit's formula for how strong a unit is, under a square root so that it adds up over a group (Lanchester):

sqrt(toughness × offence) × hero, where

  • toughness is the health it has left, more by its armour and magic resist (the middle of the two, since no opponent is in question: 100 of armour doubles it, as the engine's mitigation halves what arrives), - offence is its damage a second (attackDamage × attackSpeed), up to a quarter more for reach (at 10 of range) and a tenth for speed (at 8), - hero is 1 for a unit, and 1.1 + 0.1 × (level − 1) for a hero: its spells, and more as they level.

0 for what has no attack: a building that does not shoot, a worker with no weapon. A declared strength (UnitTypeDef.ai.strength) is taken in its place by Strength, before this is asked