diff --git a/core/code/portal_info.js b/core/code/portal_info.js index 93cba5be3..727f22ae5 100644 --- a/core/code/portal_info.js +++ b/core/code/portal_info.js @@ -38,6 +38,13 @@ window.getCurrentPortalEnergy = function(d) { return nrg; } +window.getPortalHealth = function(d) { + var max = getTotalPortalEnergy(d); + var cur = getCurrentPortalEnergy(d); + + return max>0 ? Math.floor(cur/max*100) : 0; +} + window.getPortalRange = function(d) { // formula by the great gals and guys at // http://decodeingress.me/2012/11/18/ingress-portal-levels-and-link-range/