Class: Health

Health()

new Health()

Source:

Methods

GetHitpoints()

Returns the current hitpoint value. This is 0 if (and only if) the unit is dead.
Source:

HandleDeath()

Handle what happens when the entity dies.
Source:

IsInjured() → {boolean}

Source:
Returns:
Whether the units are injured. Dead units are not considered injured.
Type
boolean

KilledBy(attacker, attackerOwner)

Called when an entity kills us.
Parameters:
Name Type Description
attacker number The entityID of the killer.
attackerOwner number The playerID of the attacker.
Source:

Reduce(amount) → {Object}

Parameters:
Name Type Description
amount number The amount of hitpoints to substract. Kills the entity if required.
Source:
Returns:
- Number of health points lost.
Type
Object

TakeDamage(amount, attacker, attackerOwner)

Parameters:
Name Type Description
amount number The amount of damage to be taken.
attacker number The entityID of the attacker.
attackerOwner number The playerID of the owner of the attacker.
Source: