Fixing Nits
This commit is contained in:
@ -24,7 +24,7 @@ window.plugin.portalWeakness.portalAdded = function(data) {
|
|||||||
|
|
||||||
var d = data.portal.options.details;
|
var d = data.portal.options.details;
|
||||||
var portal_weakness = 0;
|
var portal_weakness = 0;
|
||||||
if(getTeam(d) != 0) {
|
if(getTeam(d) !== 0) {
|
||||||
var only_shields = true;
|
var only_shields = true;
|
||||||
var missing_shields = 0;
|
var missing_shields = 0;
|
||||||
if(window.getTotalPortalEnergy(d)> 0 && window.getCurrentPortalEnergy(d) < window.getTotalPortalEnergy(d)) {
|
if(window.getTotalPortalEnergy(d)> 0 && window.getCurrentPortalEnergy(d) < window.getTotalPortalEnergy(d)) {
|
||||||
@ -33,7 +33,7 @@ window.plugin.portalWeakness.portalAdded = function(data) {
|
|||||||
}
|
}
|
||||||
//Ding the portal for every missing sheild.
|
//Ding the portal for every missing sheild.
|
||||||
$.each(d.portalV2.linkedModArray, function(ind, mod) {
|
$.each(d.portalV2.linkedModArray, function(ind, mod) {
|
||||||
if(mod == null) {
|
if(mod === null) {
|
||||||
missing_shields++;
|
missing_shields++;
|
||||||
portal_weakness += .08;
|
portal_weakness += .08;
|
||||||
}
|
}
|
||||||
@ -41,11 +41,10 @@ window.plugin.portalWeakness.portalAdded = function(data) {
|
|||||||
//Ding the portal for every missing resonator.
|
//Ding the portal for every missing resonator.
|
||||||
var resCount = 0;
|
var resCount = 0;
|
||||||
$.each(d.resonatorArray.resonators, function(ind, reso) {
|
$.each(d.resonatorArray.resonators, function(ind, reso) {
|
||||||
if(reso == null) {
|
if(reso === null) {
|
||||||
portal_weakness += .125;
|
portal_weakness += .125;
|
||||||
only_shields = false;
|
only_shields = false;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
resCount++;
|
resCount++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -64,8 +63,7 @@ window.plugin.portalWeakness.portalAdded = function(data) {
|
|||||||
color = 'yellow';
|
color = 'yellow';
|
||||||
//If only shields are missing, make portal yellow, but fill more than usual since pale yellow is basically invisible
|
//If only shields are missing, make portal yellow, but fill more than usual since pale yellow is basically invisible
|
||||||
fill_opacity = missing_shields*.15 + .1;
|
fill_opacity = missing_shields*.15 + .1;
|
||||||
}
|
} else if(missing_shields > 0) {
|
||||||
else if(missing_shields>0) {
|
|
||||||
color = 'red';
|
color = 'red';
|
||||||
}
|
}
|
||||||
fill_opacity = Math.round(fill_opacity*100)/100;
|
fill_opacity = Math.round(fill_opacity*100)/100;
|
||||||
|
Reference in New Issue
Block a user