Skip to content

Commit

Permalink
add portal health function
Browse files Browse the repository at this point in the history
  • Loading branch information
le-jeu committed Feb 17, 2021
1 parent d7d796d commit 2ad9b21
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/code/portal_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down

0 comments on commit 2ad9b21

Please sign in to comment.