Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/GuiInterface.js
Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | GuiInterface.prototype.GetEntityState = function(player, ent) | ||||
if (cmpPosition && cmpPosition.IsInWorld()) | if (cmpPosition && cmpPosition.IsInWorld()) | ||||
ret.position = cmpPosition.GetPosition(); | ret.position = cmpPosition.GetPosition(); | ||||
let cmpHealth = QueryMiragedInterface(ent, IID_Health); | let cmpHealth = QueryMiragedInterface(ent, IID_Health); | ||||
if (cmpHealth) | if (cmpHealth) | ||||
{ | { | ||||
ret.hitpoints = cmpHealth.GetHitpoints(); | ret.hitpoints = cmpHealth.GetHitpoints(); | ||||
ret.maxHitpoints = cmpHealth.GetMaxHitpoints(); | ret.maxHitpoints = cmpHealth.GetMaxHitpoints(); | ||||
ret.needsRepair = cmpHealth.IsRepairable() && cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints(); | ret.needsRepair = cmpHealth.IsRepairable() && cmpHealth.IsInjured(); | ||||
ret.needsHeal = !cmpHealth.IsUnhealable(); | ret.needsHeal = !cmpHealth.IsUnhealable(); | ||||
} | } | ||||
let cmpCapturable = QueryMiragedInterface(ent, IID_Capturable); | let cmpCapturable = QueryMiragedInterface(ent, IID_Capturable); | ||||
if (cmpCapturable) | if (cmpCapturable) | ||||
{ | { | ||||
ret.capturePoints = cmpCapturable.GetCapturePoints(); | ret.capturePoints = cmpCapturable.GetCapturePoints(); | ||||
ret.maxCapturePoints = cmpCapturable.GetMaxCapturePoints(); | ret.maxCapturePoints = cmpCapturable.GetMaxCapturePoints(); | ||||
▲ Show 20 Lines • Show All 1,710 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator