Stats displays reward pop all normal wrinkler
This commit is contained in:
@@ -80,6 +80,8 @@ CM.Cache.RemakeIncome = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CM.Cache.RemakeWrinkBank = function() {
|
CM.Cache.RemakeWrinkBank = function() {
|
||||||
|
CM.Cache.WrinkBankTotal = 0;
|
||||||
|
CM.Cache.WrinkBankNormal = 0;
|
||||||
var totalSucked = 0;
|
var totalSucked = 0;
|
||||||
for (var i in Game.wrinklers) {
|
for (var i in Game.wrinklers) {
|
||||||
var sucked = Game.wrinklers[i].sucked;
|
var sucked = Game.wrinklers[i].sucked;
|
||||||
@@ -94,10 +96,10 @@ CM.Cache.RemakeWrinkBank = function() {
|
|||||||
else if (godLvl == 2) sucked *= 1.1;
|
else if (godLvl == 2) sucked *= 1.1;
|
||||||
else if (godLvl == 3) sucked *= 1.05;
|
else if (godLvl == 3) sucked *= 1.05;
|
||||||
}
|
}
|
||||||
totalSucked += sucked;
|
CM.Cache.WrinkBankTotal += sucked;
|
||||||
|
if (Game.wrinklers[i].type == 0) CM.Cache.WrinkBankNormal += sucked;
|
||||||
}
|
}
|
||||||
CM.Cache.WrinkBank = totalSucked;
|
CM.Cache.WrinkGodBank = CM.Cache.WrinkBankTotal;
|
||||||
CM.Cache.WrinkGodBank = totalSucked;
|
|
||||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||||
var godLvl = CM.Sim.hasGod('scorn');
|
var godLvl = CM.Sim.hasGod('scorn');
|
||||||
if (godLvl == 2) CM.Cache.WrinkGodBank = CM.Cache.WrinkGodBank * 1.15 / 1.1;
|
if (godLvl == 2) CM.Cache.WrinkGodBank = CM.Cache.WrinkGodBank * 1.15 / 1.1;
|
||||||
@@ -414,7 +416,7 @@ CM.Cache.UpdateAvgCPS = function() {
|
|||||||
if (CM.Cache.lastDate != -1) {
|
if (CM.Cache.lastDate != -1) {
|
||||||
var timeDiff = currDate - CM.Cache.lastDate
|
var timeDiff = currDate - CM.Cache.lastDate
|
||||||
var bankDiffAvg = Math.max(0, (Game.cookies - CM.Cache.lastCookies)) / timeDiff;
|
var bankDiffAvg = Math.max(0, (Game.cookies - CM.Cache.lastCookies)) / timeDiff;
|
||||||
var wrinkDiffAvg = Math.max(0, (CM.Cache.WrinkBank - CM.Cache.lastWrinkCookies)) / timeDiff;
|
var wrinkDiffAvg = Math.max(0, (CM.Cache.WrinkBankTotal - CM.Cache.lastWrinkCookies)) / timeDiff;
|
||||||
var choEggDiffAvg = Math.max(0,(choEggTotal - CM.Cache.lastChoEgg)) / timeDiff;
|
var choEggDiffAvg = Math.max(0,(choEggTotal - CM.Cache.lastChoEgg)) / timeDiff;
|
||||||
var clicksDiffAvg = (Game.cookieClicks - CM.Cache.lastClicks) / timeDiff;
|
var clicksDiffAvg = (Game.cookieClicks - CM.Cache.lastClicks) / timeDiff;
|
||||||
for (var i = 0; i < timeDiff; i++) {
|
for (var i = 0; i < timeDiff; i++) {
|
||||||
@@ -436,7 +438,7 @@ CM.Cache.UpdateAvgCPS = function() {
|
|||||||
}
|
}
|
||||||
CM.Cache.lastDate = currDate;
|
CM.Cache.lastDate = currDate;
|
||||||
CM.Cache.lastCookies = Game.cookies;
|
CM.Cache.lastCookies = Game.cookies;
|
||||||
CM.Cache.lastWrinkCookies = CM.Cache.WrinkBank;
|
CM.Cache.lastWrinkCookies = CM.Cache.WrinkBankTotal;
|
||||||
CM.Cache.lastChoEgg = choEggTotal;
|
CM.Cache.lastChoEgg = choEggTotal;
|
||||||
CM.Cache.lastClicks = Game.cookieClicks;
|
CM.Cache.lastClicks = Game.cookieClicks;
|
||||||
|
|
||||||
@@ -519,7 +521,8 @@ CM.Cache.CalcMissingUpgrades = function() {
|
|||||||
CM.Cache.min = -1;
|
CM.Cache.min = -1;
|
||||||
CM.Cache.max = -1;
|
CM.Cache.max = -1;
|
||||||
CM.Cache.mid = -1;
|
CM.Cache.mid = -1;
|
||||||
CM.Cache.WrinkBank = -1;
|
CM.Cache.WrinkBankTotal = -1;
|
||||||
|
CM.Cache.WrinkBankNormal = -1;
|
||||||
CM.Cache.WrinkGodBank = -1;
|
CM.Cache.WrinkGodBank = -1;
|
||||||
CM.Cache.GoldenCookiesMult = 1;
|
CM.Cache.GoldenCookiesMult = 1;
|
||||||
CM.Cache.WrathCookiesMult = 1;
|
CM.Cache.WrathCookiesMult = 1;
|
||||||
@@ -1012,11 +1015,11 @@ CM.Data.ConfigDefault = {
|
|||||||
/**
|
/**
|
||||||
* This function returns the total amount stored in the Wrinkler Bank
|
* This function returns the total amount stored in the Wrinkler Bank
|
||||||
* as calculated by CM.Cache.RemakeWrinkBank() if CM.Config.CalcWrink is set
|
* as calculated by CM.Cache.RemakeWrinkBank() if CM.Config.CalcWrink is set
|
||||||
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinkBank)
|
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinkBankTotal)
|
||||||
*/
|
*/
|
||||||
CM.Disp.GetWrinkConfigBank = function() {
|
CM.Disp.GetWrinkConfigBank = function() {
|
||||||
if (CM.Config.CalcWrink)
|
if (CM.Config.CalcWrink)
|
||||||
return CM.Cache.WrinkBank;
|
return CM.Cache.WrinkBankTotal;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -3091,13 +3094,13 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
stats.appendChild(CM.Disp.CreateStatsHeader('Wrinklers', 'Wrink'));
|
stats.appendChild(CM.Disp.CreateStatsHeader('Wrinklers', 'Wrink'));
|
||||||
if (CM.Config.StatsPref.Wrink) {
|
if (CM.Config.StatsPref.Wrink) {
|
||||||
var popAllFrag = document.createDocumentFragment();
|
var popAllFrag = document.createDocumentFragment();
|
||||||
popAllFrag.appendChild(document.createTextNode(Beautify(CM.Cache.WrinkBank) + ' '));
|
popAllFrag.appendChild(document.createTextNode(Beautify(CM.Cache.WrinkBankTotal) + ' / ' + Beautify(CM.Cache.WrinkBankNormal) + ' '));
|
||||||
var popAllA = document.createElement('a');
|
var popAllA = document.createElement('a');
|
||||||
popAllA.textContent = 'Pop All Normal';
|
popAllA.textContent = 'Pop All Normal';
|
||||||
popAllA.className = 'option';
|
popAllA.className = 'option';
|
||||||
popAllA.onclick = function() { CM.Disp.CollectWrinklers(); };
|
popAllA.onclick = function() { CM.Disp.PopAllNormalWrinklers(); };
|
||||||
popAllFrag.appendChild(popAllA);
|
popAllFrag.appendChild(popAllA);
|
||||||
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping', popAllFrag));
|
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping (All/Normal)', popAllFrag));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
15
src/Cache.js
15
src/Cache.js
@@ -53,6 +53,8 @@ CM.Cache.RemakeIncome = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CM.Cache.RemakeWrinkBank = function() {
|
CM.Cache.RemakeWrinkBank = function() {
|
||||||
|
CM.Cache.WrinkBankTotal = 0;
|
||||||
|
CM.Cache.WrinkBankNormal = 0;
|
||||||
var totalSucked = 0;
|
var totalSucked = 0;
|
||||||
for (var i in Game.wrinklers) {
|
for (var i in Game.wrinklers) {
|
||||||
var sucked = Game.wrinklers[i].sucked;
|
var sucked = Game.wrinklers[i].sucked;
|
||||||
@@ -67,10 +69,10 @@ CM.Cache.RemakeWrinkBank = function() {
|
|||||||
else if (godLvl == 2) sucked *= 1.1;
|
else if (godLvl == 2) sucked *= 1.1;
|
||||||
else if (godLvl == 3) sucked *= 1.05;
|
else if (godLvl == 3) sucked *= 1.05;
|
||||||
}
|
}
|
||||||
totalSucked += sucked;
|
CM.Cache.WrinkBankTotal += sucked;
|
||||||
|
if (Game.wrinklers[i].type == 0) CM.Cache.WrinkBankNormal += sucked;
|
||||||
}
|
}
|
||||||
CM.Cache.WrinkBank = totalSucked;
|
CM.Cache.WrinkGodBank = CM.Cache.WrinkBankTotal;
|
||||||
CM.Cache.WrinkGodBank = totalSucked;
|
|
||||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||||
var godLvl = CM.Sim.hasGod('scorn');
|
var godLvl = CM.Sim.hasGod('scorn');
|
||||||
if (godLvl == 2) CM.Cache.WrinkGodBank = CM.Cache.WrinkGodBank * 1.15 / 1.1;
|
if (godLvl == 2) CM.Cache.WrinkGodBank = CM.Cache.WrinkGodBank * 1.15 / 1.1;
|
||||||
@@ -387,7 +389,7 @@ CM.Cache.UpdateAvgCPS = function() {
|
|||||||
if (CM.Cache.lastDate != -1) {
|
if (CM.Cache.lastDate != -1) {
|
||||||
var timeDiff = currDate - CM.Cache.lastDate
|
var timeDiff = currDate - CM.Cache.lastDate
|
||||||
var bankDiffAvg = Math.max(0, (Game.cookies - CM.Cache.lastCookies)) / timeDiff;
|
var bankDiffAvg = Math.max(0, (Game.cookies - CM.Cache.lastCookies)) / timeDiff;
|
||||||
var wrinkDiffAvg = Math.max(0, (CM.Cache.WrinkBank - CM.Cache.lastWrinkCookies)) / timeDiff;
|
var wrinkDiffAvg = Math.max(0, (CM.Cache.WrinkBankTotal - CM.Cache.lastWrinkCookies)) / timeDiff;
|
||||||
var choEggDiffAvg = Math.max(0,(choEggTotal - CM.Cache.lastChoEgg)) / timeDiff;
|
var choEggDiffAvg = Math.max(0,(choEggTotal - CM.Cache.lastChoEgg)) / timeDiff;
|
||||||
var clicksDiffAvg = (Game.cookieClicks - CM.Cache.lastClicks) / timeDiff;
|
var clicksDiffAvg = (Game.cookieClicks - CM.Cache.lastClicks) / timeDiff;
|
||||||
for (var i = 0; i < timeDiff; i++) {
|
for (var i = 0; i < timeDiff; i++) {
|
||||||
@@ -409,7 +411,7 @@ CM.Cache.UpdateAvgCPS = function() {
|
|||||||
}
|
}
|
||||||
CM.Cache.lastDate = currDate;
|
CM.Cache.lastDate = currDate;
|
||||||
CM.Cache.lastCookies = Game.cookies;
|
CM.Cache.lastCookies = Game.cookies;
|
||||||
CM.Cache.lastWrinkCookies = CM.Cache.WrinkBank;
|
CM.Cache.lastWrinkCookies = CM.Cache.WrinkBankTotal;
|
||||||
CM.Cache.lastChoEgg = choEggTotal;
|
CM.Cache.lastChoEgg = choEggTotal;
|
||||||
CM.Cache.lastClicks = Game.cookieClicks;
|
CM.Cache.lastClicks = Game.cookieClicks;
|
||||||
|
|
||||||
@@ -492,7 +494,8 @@ CM.Cache.CalcMissingUpgrades = function() {
|
|||||||
CM.Cache.min = -1;
|
CM.Cache.min = -1;
|
||||||
CM.Cache.max = -1;
|
CM.Cache.max = -1;
|
||||||
CM.Cache.mid = -1;
|
CM.Cache.mid = -1;
|
||||||
CM.Cache.WrinkBank = -1;
|
CM.Cache.WrinkBankTotal = -1;
|
||||||
|
CM.Cache.WrinkBankNormal = -1;
|
||||||
CM.Cache.WrinkGodBank = -1;
|
CM.Cache.WrinkGodBank = -1;
|
||||||
CM.Cache.GoldenCookiesMult = 1;
|
CM.Cache.GoldenCookiesMult = 1;
|
||||||
CM.Cache.WrathCookiesMult = 1;
|
CM.Cache.WrathCookiesMult = 1;
|
||||||
|
|||||||
10
src/Disp.js
10
src/Disp.js
@@ -13,11 +13,11 @@
|
|||||||
/**
|
/**
|
||||||
* This function returns the total amount stored in the Wrinkler Bank
|
* This function returns the total amount stored in the Wrinkler Bank
|
||||||
* as calculated by CM.Cache.RemakeWrinkBank() if CM.Config.CalcWrink is set
|
* as calculated by CM.Cache.RemakeWrinkBank() if CM.Config.CalcWrink is set
|
||||||
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinkBank)
|
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinkBankTotal)
|
||||||
*/
|
*/
|
||||||
CM.Disp.GetWrinkConfigBank = function() {
|
CM.Disp.GetWrinkConfigBank = function() {
|
||||||
if (CM.Config.CalcWrink)
|
if (CM.Config.CalcWrink)
|
||||||
return CM.Cache.WrinkBank;
|
return CM.Cache.WrinkBankTotal;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2092,13 +2092,13 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
stats.appendChild(CM.Disp.CreateStatsHeader('Wrinklers', 'Wrink'));
|
stats.appendChild(CM.Disp.CreateStatsHeader('Wrinklers', 'Wrink'));
|
||||||
if (CM.Config.StatsPref.Wrink) {
|
if (CM.Config.StatsPref.Wrink) {
|
||||||
var popAllFrag = document.createDocumentFragment();
|
var popAllFrag = document.createDocumentFragment();
|
||||||
popAllFrag.appendChild(document.createTextNode(Beautify(CM.Cache.WrinkBank) + ' '));
|
popAllFrag.appendChild(document.createTextNode(Beautify(CM.Cache.WrinkBankTotal) + ' / ' + Beautify(CM.Cache.WrinkBankNormal) + ' '));
|
||||||
var popAllA = document.createElement('a');
|
var popAllA = document.createElement('a');
|
||||||
popAllA.textContent = 'Pop All Normal';
|
popAllA.textContent = 'Pop All Normal';
|
||||||
popAllA.className = 'option';
|
popAllA.className = 'option';
|
||||||
popAllA.onclick = function() { CM.Disp.CollectWrinklers(); };
|
popAllA.onclick = function() { CM.Disp.PopAllNormalWrinklers(); };
|
||||||
popAllFrag.appendChild(popAllA);
|
popAllFrag.appendChild(popAllA);
|
||||||
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping', popAllFrag));
|
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping (All/Normal)', popAllFrag));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user