parent
bc7de777a2
commit
aabe76661c
@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @id iitc-plugin-compute-ap-stats@Hollow011
|
// @id iitc-plugin-compute-ap-stats@Hollow011
|
||||||
// @name iitc: Compute AP statistics
|
// @name iitc: Compute AP statistics
|
||||||
// @version 0.2.1
|
// @version 0.3
|
||||||
// @namespace https://github.com/breunigs/ingress-intel-total-conversion
|
// @namespace https://github.com/breunigs/ingress-intel-total-conversion
|
||||||
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/compute-ap-stats.user.js
|
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/compute-ap-stats.user.js
|
||||||
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/compute-ap-stats.user.js
|
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/compute-ap-stats.user.js
|
||||||
@ -44,6 +44,21 @@ window.plugin.compAPStats.onPositionMove = function() {
|
|||||||
+ '</table>');
|
+ '</table>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.plugin.compAPStats.missingResonatorAP = function(portal) {
|
||||||
|
var resAP = 0;
|
||||||
|
var missing_resonators = 0;
|
||||||
|
$.each(portal.resonatorArray.resonators, function(ind, reso) {
|
||||||
|
if(reso === null) {
|
||||||
|
missing_resonators++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(missing_resonators > 0) {
|
||||||
|
resAP = window.DEPLOY_RESONATOR * missing_resonators;
|
||||||
|
resAP += window.COMPLETION_BONUS;
|
||||||
|
}
|
||||||
|
return(resAP);
|
||||||
|
};
|
||||||
|
|
||||||
window.plugin.compAPStats.compAPStats = function() {
|
window.plugin.compAPStats.compAPStats = function() {
|
||||||
|
|
||||||
var totalAP_RES = 0;
|
var totalAP_RES = 0;
|
||||||
@ -78,6 +93,9 @@ window.plugin.compAPStats.compAPStats = function() {
|
|||||||
if(!field) return true;
|
if(!field) return true;
|
||||||
allEnlFields.push(field);
|
allEnlFields.push(field);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
totalAP_ENL += window.plugin.compAPStats.missingResonatorAP(d);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (getTeam(d) === TEAM_RES) {
|
else if (getTeam(d) === TEAM_RES) {
|
||||||
totalAP_ENL += portalSum;
|
totalAP_ENL += portalSum;
|
||||||
@ -91,6 +109,9 @@ window.plugin.compAPStats.compAPStats = function() {
|
|||||||
if(!field) return true;
|
if(!field) return true;
|
||||||
allResFields.push(field);
|
allResFields.push(field);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
totalAP_RES += window.plugin.compAPStats.missingResonatorAP(d);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// it's a neutral portal, potential for both teams. by definition no fields or edges
|
// it's a neutral portal, potential for both teams. by definition no fields or edges
|
||||||
totalAP_ENL += portalSum;
|
totalAP_ENL += portalSum;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user