Added field count formula
This commit is contained in:
@ -137,19 +137,24 @@ window.renderResonatorDetails = function(slot, level, nrg, dist, nick) {
|
||||
window.getDestroyAP = function(d) {
|
||||
console.log('rendering destroy AP');
|
||||
var res_count = 0;
|
||||
var links = 0;
|
||||
var links_count = 0;
|
||||
var fields_count
|
||||
|
||||
$.each(d.resonatorArray.resonators, function(ind, reso)
|
||||
{
|
||||
$.each(d.resonatorArray.resonators, function(ind, reso) {
|
||||
res_count += 1;
|
||||
});
|
||||
|
||||
if(d.portalV2.linkedEdges) $.each(d.portalV2.linkedEdges, function(ind, link)
|
||||
{
|
||||
links++;
|
||||
});
|
||||
if(d.portalV2.linkedEdges) {
|
||||
$.each(d.portalV2.linkedEdges, function(ind, link) {
|
||||
links_count++;
|
||||
});
|
||||
}
|
||||
|
||||
var ap_count = (res_count * DESTROY_RESONATOR) + (links * DESTROY_LINK);
|
||||
if(d.portalV2.linkedFields) {
|
||||
fields_count = d.portalV2.linkedFields.length;
|
||||
}
|
||||
|
||||
var ap_count = (res_count * DESTROY_RESONATOR) + (links_count * DESTROY_LINK) + (fields_count * DESTROY_FIELD);
|
||||
|
||||
return 'Destroy ' + res_count + 'x res + ' + links + 'x link -> <strong style="color: #FFCE00">' + ap_count + '</strong>AP';
|
||||
return 'Destroy ' + res_count + 'x res + ' + links_count + 'x link → <span style="color: #FFCE00">' + ap_count + '</span>AP';
|
||||
}
|
||||
|
3
main.js
3
main.js
@ -129,7 +129,8 @@ var HACK_RANGE = 35; // in meters, max. distance from portal to be able to acces
|
||||
var OCTANTS = ['E', 'NE', 'N', 'NW', 'W', 'SW', 'S', 'SE'];
|
||||
var DEFAULT_PORTAL_IMG = 'http://commondatastorage.googleapis.com/ingress/img/default-portal-image.png';
|
||||
var DESTROY_RESONATOR = 75; //AP for destroying portal
|
||||
var DESTROY_LINK = 187; //AP fro destroying link
|
||||
var DESTROY_LINK = 187; //AP for destroying link
|
||||
var DESTROY_FIELD = 750; //AP for destroying field
|
||||
|
||||
// OTHER MORE-OR-LESS CONSTANTS //////////////////////////////////////
|
||||
var NOMINATIM = 'http://nominatim.openstreetmap.org/search?format=json&limit=1&q=';
|
||||
|
Reference in New Issue
Block a user