A unit's hit points determine how healthy it is.
If a unit's hp goes below 1, it is either wrecked,
meaning that it changes to a new type
wrecked-type
or else it vanishes,
meaning that it is completely cleared from the world.
UnitTypeProperty: hp-max
n
This property is the maximum number of hit points for (each part of) a unit.
Completed units start with this many hit points.
Defaults to 1
.
UnitTypeProperty: parts-max
n
This property declares that a unit is really
an aggregate of n smaller identical units.
Defaults to 1
.
UnitTypeProperty: wrecked-type
unit-type
This property is the type of unit that a unit with 0 hp will become.
For instance, a destroyed "fort" might become a "rubble pile" unit.
If its value is non-unit
, then the destroyed unit just vanishes.
The wrecked-type
of a type must be a different type.
Defaults to non-unit
.
The transformation to the wrecked type does not change position or name. The transformed unit has full hp, supplies are conserved as much as possible, tooling is preserved, and any unit plan is erased. It has the same number of parts, or as many as possible if that is fewer. It may be that the wrecked type is on terrain that it cannot survive on; in that case, it will be wrecked again, repeating until the unit either vanishes or is in a viable position, or this process has been repeated more times than the number of unit types (prevents infinite loops). Any excess occupants will be removed and either placed in another nearby unit or in the open, or will vanish if there is no other option.
UnitTypeProperty: hp-recovery
n
This property is the number of 1/100 hp recovered per turn.
Recovery happens automatically at the end of each turn.
The amount n / 100 is recovered automatically each turn,
while n mod 100 is the percent chance of recovering
an additional 1 hit point.
Defaults to 0
.