use constants

This commit is contained in:
Peter Sorger
2013-02-13 16:10:24 +01:00
parent 63127f7890
commit 5876d0cab6

View File

@ -153,16 +153,16 @@ window.getDestroyAP = function(d) {
var resoAp = resoCount * DESTROY_RESONATOR;
var linkAp = linkCount * DESTROY_LINK;
var fieldAp = fieldCount * DESTROY_FIELD;
var sum = resoAp + linkAp + fieldAp + 1750;
var sum = resoAp + linkAp + fieldAp + CAPTURE_PORTAL + 8*DEPLOY_RESONATOR + COMPLETITION_BONUS;
function tt(text) {
var t = 'Destroy & Capture:\n';
t += resoCount + '×\tResonators\t= ' + digits(resoAp) + '\n';
t += linkCount + '×\tLinks\t= ' + digits(linkAp) + '\n';
t += fieldCount + '×\tFields\t= ' + digits(fieldAp) + '\n';
t += '1×\tCapture\t= 500\n';
t += '8×\tDeploy\t= 1000\n';
t += '1×\tBonus\t= 250\n';
t += '1×\tCapture\t= ' + CAPTURE_PORTAL + '\n';
t += '8×\tDeploy\t= ' + DEPLOY_RESONATOR + '\n';
t += '1×\tBonus\t= ' + COMPLETITION_BONUS + '\n';
t += 'Sum: ' + digits(sum) + ' AP';
return '<tt title="'+t+'">' + digits(text) + '</tt>';
}