mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 19:23:53 +00:00
@@ -54,7 +54,7 @@ function displaySingle(entState, template)
|
||||
healthSize.rright = 100*Math.max(0, Math.min(1, entState.hitpoints / entState.maxHitpoints));
|
||||
unitHealthBar.size = healthSize;
|
||||
|
||||
var hitpoints = entState.hitpoints + " / " + entState.maxHitpoints;
|
||||
var hitpoints = Math.ceil(entState.hitpoints) + " / " + entState.maxHitpoints;
|
||||
getGUIObjectByName("healthStats").caption = hitpoints;
|
||||
getGUIObjectByName("healthSection").hidden = false;
|
||||
}
|
||||
|
||||
@@ -57,9 +57,9 @@ Armour.prototype.TakeDamage = function(hack, pierce, crush)
|
||||
var adjPierce = pierce * Math.pow(0.9, armourStrengths.pierce);
|
||||
var adjCrush = crush * Math.pow(0.9, armourStrengths.crush);
|
||||
|
||||
// Total is sum of individual damages, with minimum damage 1
|
||||
// Round to nearest integer, since HP is integral
|
||||
var total = Math.max(1, Math.round(adjHack + adjPierce + adjCrush));
|
||||
// Total is sum of individual damages
|
||||
// Don't bother rounding, since HP is no longer integral.
|
||||
var total = Math.max(1, adjHack + adjPierce + adjCrush);
|
||||
|
||||
// Reduce health
|
||||
var cmpHealth = Engine.QueryInterface(this.entity, IID_Health);
|
||||
|
||||
@@ -8,11 +8,11 @@ Health.prototype.Schema =
|
||||
"<DeathType>corpse</DeathType>" +
|
||||
"</a:example>" +
|
||||
"<element name='Max' a:help='Maximum hitpoints'>" +
|
||||
"<data type='positiveInteger'/>" +
|
||||
"<data type='decimal'/>" +
|
||||
"</element>" +
|
||||
"<optional>" +
|
||||
"<element name='Initial' a:help='Initial hitpoints. Default if unspecified is equal to Max'>" +
|
||||
"<data type='positiveInteger'/>" +
|
||||
"<data type='decimal'/>" +
|
||||
"</element>" +
|
||||
"</optional>" +
|
||||
"<optional>" +
|
||||
|
||||
Reference in New Issue
Block a user