Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Health.js
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
//// Interface functions //// | //// Interface functions //// | ||||
/** | /** | ||||
* Returns the current hitpoint value. | * Returns the current hitpoint value. | ||||
* This is 0 if (and only if) the unit is dead. | * This is 0 if (and only if) the unit is dead. | ||||
*/ | */ | ||||
Health.prototype.GetHitpoints = function() | Health.prototype.GetHitpoints = function() | ||||
{ | { | ||||
return this.hitpoints; | return this.hitpoints.toFixed(2); | ||||
fatherbushido: no | |||||
}; | }; | ||||
Health.prototype.GetMaxHitpoints = function() | Health.prototype.GetMaxHitpoints = function() | ||||
{ | { | ||||
return this.maxHitpoints; | return this.maxHitpoints.toFixed(2); | ||||
fatherbushidoUnsubmitted Not Done Inline Actionsno fatherbushido: no | |||||
}; | }; | ||||
Health.prototype.SetHitpoints = function(value) | Health.prototype.SetHitpoints = function(value) | ||||
{ | { | ||||
// If we're already dead, don't allow resurrection | // If we're already dead, don't allow resurrection | ||||
if (this.hitpoints == 0) | if (this.hitpoints == 0) | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 328 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
no