Methods
GetHitpoints()
Returns the current hitpoint value.
This is 0 if (and only if) the unit is dead.
HandleDeath()
Handle what happens when the entity dies.
IsInjured() → {boolean}
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. |
Reduce(amount) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
amount |
number | The amount of hitpoints to substract. Kills the entity if required. |
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. |