Merge pull request #181 from vita10gy/gh-pages

Delete unused function
This commit is contained in:
Stefan Breunig 2013-02-16 01:47:20 -08:00
commit 4dd9327b81
2 changed files with 1 additions and 40 deletions

View File

@ -10,7 +10,7 @@ Available Plugins
-----------------
- [**Guess Player Level**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js) looks for the highest placed resonator per player in the current view to guess the player level.
- [**Highlight Weakened Portals**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-portal-weakness.user.js) fill portals with red or orange to indicate portal's state of disrepair. The brighter the color the more attention needed (recharge, shields, resonators). A dashed portal means a resonator is missing.
- [**Highlight Weakened Portals**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-portal-weakness.user.js) fill portals with red to indicate portal's state of disrepair. The brighter the color the more attention needed (recharge, shields, resonators). A dashed portal means a resonator is missing.
- [**Draw Tools**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/draw-tools.user.js) allows to draw circles and lines on the map to aid you with planning your next big field.

View File

@ -20,45 +20,6 @@ if(typeof window.plugin !== 'function') window.plugin = function() {};
// use own namespace for plugin
window.plugin.portalWeakness = function() {};
window.plugin.portalWeakness.getPortalWeaknessFactor = function(d)
{
var portal_weakness = 0;
if(getTeam(d) != 0)
{
if(window.getTotalPortalEnergy(d)> 0 && window.getCurrentPortalEnergy(d) < window.getTotalPortalEnergy(d))
{
portal_weakness = 1 - (window.getPortalEnergy(d)/window.getTotalPortalEnergy(d));
}
//Ding the portal for every missing sheild.
$.each(d.portalV2.linkedModArray, function(ind, mod)
{
if(mod == null)
{
portal_weakness += .05;
}
});
//Ding the portal for every missing resonator.
var resCount = 0;
$.each(d.resonatorArray.resonators, function(ind, reso)
{
if(reso == null) {
portal_weakness += .125;
}
else {
resCount++;
}
});
if(portal_weakness<0) {
portal_weakness = 0;
}
if(portal_weakness>1)
{
portal_weakness = 1;
}
}
return(Math.round(portal_weakness*100)/100);
}
window.plugin.portalWeakness.portalAdded = function(data) {
var d = data.portal.options.details;