Button and stat for single fattest wrinkler (#177)
This commit is contained in:
@@ -42,6 +42,7 @@ if (typeof CM == "undefined") {
|
|||||||
*/
|
*/
|
||||||
CM.Cache.InitCache = function() {
|
CM.Cache.InitCache = function() {
|
||||||
CM.Cache.CacheDragonAuras();
|
CM.Cache.CacheDragonAuras();
|
||||||
|
CM.Cache.CacheWrinklers();
|
||||||
}
|
}
|
||||||
|
|
||||||
/********
|
/********
|
||||||
@@ -49,10 +50,13 @@ CM.Cache.InitCache = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the currently selected Dragon Auras
|
* This functions caches the currently selected Dragon Auras
|
||||||
* It is called by CM.Sim.CopyData() and CM.Sim.InitData()
|
* It is called by CM.Sim.CopyData() and CM.Cache.InitCache()
|
||||||
* Uncapitalized dragon follows Game-naming
|
* Uncapitalized dragon follows Game-naming
|
||||||
|
* @global {number} CM.Cache.dragonAura The number of the first (right) Aura
|
||||||
|
* @global {number} CM.Cache.dragonAura2 The number of the second (left) Aura
|
||||||
*/
|
*/
|
||||||
CM.Cache.CacheDragonAuras = function() {
|
CM.Cache.CacheDragonAuras = function() {
|
||||||
|
/** @global */
|
||||||
CM.Cache.dragonAura = Game.dragonAura;
|
CM.Cache.dragonAura = Game.dragonAura;
|
||||||
CM.Cache.dragonAura2 = Game.dragonAura2;
|
CM.Cache.dragonAura2 = Game.dragonAura2;
|
||||||
}
|
}
|
||||||
@@ -62,12 +66,15 @@ CM.Cache.CacheDragonAuras = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches data related to Wrinklers
|
* This functions caches data related to Wrinklers
|
||||||
* It is called by CM.Loop()
|
* It is called by CM.Loop() and CM.Cache.InitCache()
|
||||||
|
* @global {number} CM.Cache.WrinklersTotal The cookies of all wrinklers
|
||||||
|
* @global {number} CM.Cache.WrinklersNormal The cookies of all normal wrinklers
|
||||||
|
* @global {[{number}, {number}]} CM.Cache.WrinklersFattest A list containing the cookies and the id of the fattest wrinkler
|
||||||
*/
|
*/
|
||||||
CM.Cache.RemakeWrinkBank = function() {
|
CM.Cache.CacheWrinklers = function() {
|
||||||
CM.Cache.WrinkBankTotal = 0;
|
CM.Cache.WrinklersTotal = 0;
|
||||||
CM.Cache.WrinkBankNormal = 0;
|
CM.Cache.WrinklersNormal = 0;
|
||||||
var totalSucked = 0;
|
CM.Cache.WrinklersFattest = [0, null];
|
||||||
for (var i in Game.wrinklers) {
|
for (var i in Game.wrinklers) {
|
||||||
var sucked = Game.wrinklers[i].sucked;
|
var sucked = Game.wrinklers[i].sucked;
|
||||||
var toSuck = 1.1;
|
var toSuck = 1.1;
|
||||||
@@ -81,19 +88,12 @@ 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;
|
||||||
}
|
}
|
||||||
CM.Cache.WrinkBankTotal += sucked;
|
CM.Cache.WrinklersTotal += sucked;
|
||||||
if (Game.wrinklers[i].type == 0) CM.Cache.WrinkBankNormal += sucked;
|
if (Game.wrinklers[i].type == 0) CM.Cache.WrinklersNormal += sucked;
|
||||||
}
|
if (sucked > CM.Cache.WrinklersFattest[0]) CM.Cache.WrinklersFattest = [sucked, i];
|
||||||
CM.Cache.WrinkGodBank = CM.Cache.WrinkBankTotal;
|
|
||||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
|
||||||
var godLvl = CM.Sim.hasGod('scorn');
|
|
||||||
if (godLvl == 2) CM.Cache.WrinkGodBank = CM.Cache.WrinkGodBank * 1.15 / 1.1;
|
|
||||||
else if (godLvl == 3) CM.Cache.WrinkGodBank = CM.Cache.WrinkGodBank * 1.15 / 1.05;
|
|
||||||
else if (godLvl != 1) CM.Cache.WrinkGodBank *= 1.15;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: UNSORTED */
|
* Section: UNSORTED */
|
||||||
|
|
||||||
@@ -434,7 +434,7 @@ CM.Cache.UpdateAvgCPS = function() {
|
|||||||
if (CM.Cache.lastDate != currDate) {
|
if (CM.Cache.lastDate != currDate) {
|
||||||
var choEggTotal = Game.cookies + CM.Cache.SellForChoEgg;
|
var choEggTotal = Game.cookies + CM.Cache.SellForChoEgg;
|
||||||
if (Game.cpsSucked > 0) {
|
if (Game.cpsSucked > 0) {
|
||||||
choEggTotal += CM.Cache.WrinkGodBank;
|
choEggTotal += CM.Cache.WrinklersTotal;
|
||||||
}
|
}
|
||||||
CM.Cache.RealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal);
|
CM.Cache.RealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal);
|
||||||
choEggTotal *= 0.05;
|
choEggTotal *= 0.05;
|
||||||
@@ -442,7 +442,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.WrinkBankTotal - CM.Cache.lastWrinkCookies)) / timeDiff;
|
var wrinkDiffAvg = Math.max(0, (CM.Cache.WrinklersTotal - 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++) {
|
||||||
@@ -464,7 +464,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.WrinkBankTotal;
|
CM.Cache.lastWrinkCookies = CM.Cache.WrinklersTotal;
|
||||||
CM.Cache.lastChoEgg = choEggTotal;
|
CM.Cache.lastChoEgg = choEggTotal;
|
||||||
CM.Cache.lastClicks = Game.cookieClicks;
|
CM.Cache.lastClicks = Game.cookieClicks;
|
||||||
|
|
||||||
@@ -547,9 +547,6 @@ 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.WrinkBankTotal = -1;
|
|
||||||
CM.Cache.WrinkBankNormal = -1;
|
|
||||||
CM.Cache.WrinkGodBank = -1;
|
|
||||||
CM.Cache.GoldenCookiesMult = 1;
|
CM.Cache.GoldenCookiesMult = 1;
|
||||||
CM.Cache.WrathCookiesMult = 1;
|
CM.Cache.WrathCookiesMult = 1;
|
||||||
CM.Cache.DragonsFortuneMultAdjustment = 1;
|
CM.Cache.DragonsFortuneMultAdjustment = 1;
|
||||||
@@ -1058,11 +1055,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.Options.CalcWrink is set
|
* as calculated by CM.Cache.RemakeWrinkBank() if CM.Options.CalcWrink is set
|
||||||
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinkBankTotal)
|
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinklersTotal)
|
||||||
*/
|
*/
|
||||||
CM.Disp.GetWrinkConfigBank = function() {
|
CM.Disp.GetWrinkConfigBank = function() {
|
||||||
if (CM.Options.CalcWrink)
|
if (CM.Options.CalcWrink)
|
||||||
return CM.Cache.WrinkBankTotal;
|
return CM.Cache.WrinklersTotal;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -3164,13 +3161,21 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
stats.appendChild(CM.Disp.CreateStatsHeader('Wrinklers', 'Wrink'));
|
stats.appendChild(CM.Disp.CreateStatsHeader('Wrinklers', 'Wrink'));
|
||||||
if (CM.Options.Header.Wrink) {
|
if (CM.Options.Header.Wrink) {
|
||||||
var popAllFrag = document.createDocumentFragment();
|
var popAllFrag = document.createDocumentFragment();
|
||||||
popAllFrag.appendChild(document.createTextNode(Beautify(CM.Cache.WrinkBankTotal) + ' / ' + Beautify(CM.Cache.WrinkBankNormal) + ' '));
|
popAllFrag.appendChild(document.createTextNode(Beautify(CM.Cache.WrinklersTotal) + ' / ' + Beautify(CM.Cache.WrinklersNormal) + ' '));
|
||||||
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.PopAllNormalWrinklers(); };
|
popAllA.onclick = function() { CM.Disp.PopAllNormalWrinklers(); };
|
||||||
popAllFrag.appendChild(popAllA);
|
popAllFrag.appendChild(popAllA);
|
||||||
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping (All/Normal)', popAllFrag));
|
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping (All/Normal)', popAllFrag));
|
||||||
|
var popFattestFrag = document.createDocumentFragment();
|
||||||
|
popFattestFrag.appendChild(document.createTextNode(Beautify(CM.Cache.WrinklersFattest[0]) + ' '));
|
||||||
|
var popFattestA = document.createElement('a');
|
||||||
|
popFattestA.textContent = 'Pop single fattest';
|
||||||
|
popFattestA.className = 'option';
|
||||||
|
popFattestA.onclick = function() { Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp = 0; };
|
||||||
|
popFattestFrag.appendChild(popFattestA);
|
||||||
|
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping Single Fattest Wrinkler (id: ' + CM.Cache.WrinklersFattest[1] + ")", popFattestFrag));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3575,11 +3580,11 @@ CM.Disp.CreateStatsPrestigeSection = function() {
|
|||||||
section.className = 'CMStatsPrestigeSection';
|
section.className = 'CMStatsPrestigeSection';
|
||||||
|
|
||||||
var possiblePresMax = Math.floor(Game.HowMuchPrestige(CM.Cache.RealCookiesEarned +
|
var possiblePresMax = Math.floor(Game.HowMuchPrestige(CM.Cache.RealCookiesEarned +
|
||||||
Game.cookiesReset + CM.Cache.WrinkGodBank +
|
Game.cookiesReset + CM.Cache.WrinklersTotal +
|
||||||
(Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CM.Cache.lastChoEgg : 0)));
|
(Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CM.Cache.lastChoEgg : 0)));
|
||||||
section.appendChild(CM.Disp.CreateStatsListing("withTooltip", 'Prestige Level (CUR / MAX)', document.createTextNode(Beautify(Game.prestige) + ' / ' + Beautify(possiblePresMax)), 'PrestMaxTooltipPlaceholder'));
|
section.appendChild(CM.Disp.CreateStatsListing("withTooltip", 'Prestige Level (CUR / MAX)', document.createTextNode(Beautify(Game.prestige) + ' / ' + Beautify(possiblePresMax)), 'PrestMaxTooltipPlaceholder'));
|
||||||
|
|
||||||
var neededCook = Game.HowManyCookiesReset(possiblePresMax + 1) - (CM.Cache.RealCookiesEarned + Game.cookiesReset + CM.Cache.WrinkGodBank + ((Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CM.Cache.lastChoEgg : 0) ? CM.Cache.lastChoEgg : 0));
|
var neededCook = Game.HowManyCookiesReset(possiblePresMax + 1) - (CM.Cache.RealCookiesEarned + Game.cookiesReset + CM.Cache.WrinklersTotal + ((Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CM.Cache.lastChoEgg : 0) ? CM.Cache.lastChoEgg : 0));
|
||||||
var cookiesNextFrag = document.createDocumentFragment();
|
var cookiesNextFrag = document.createDocumentFragment();
|
||||||
cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook)));
|
cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook)));
|
||||||
var cookiesNextSmall = document.createElement('small');
|
var cookiesNextSmall = document.createElement('small');
|
||||||
@@ -3959,7 +3964,7 @@ CM.Loop = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update Wrinkler Bank
|
// Update Wrinkler Bank
|
||||||
CM.Cache.RemakeWrinkBank();
|
CM.Cache.CacheWrinklers();
|
||||||
|
|
||||||
// Calculate PP
|
// Calculate PP
|
||||||
CM.Cache.RemakePP();
|
CM.Cache.RemakePP();
|
||||||
|
|||||||
41
src/Cache.js
41
src/Cache.js
@@ -13,6 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
CM.Cache.InitCache = function() {
|
CM.Cache.InitCache = function() {
|
||||||
CM.Cache.CacheDragonAuras();
|
CM.Cache.CacheDragonAuras();
|
||||||
|
CM.Cache.CacheWrinklers();
|
||||||
}
|
}
|
||||||
|
|
||||||
/********
|
/********
|
||||||
@@ -20,10 +21,13 @@ CM.Cache.InitCache = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the currently selected Dragon Auras
|
* This functions caches the currently selected Dragon Auras
|
||||||
* It is called by CM.Sim.CopyData() and CM.Sim.InitData()
|
* It is called by CM.Sim.CopyData() and CM.Cache.InitCache()
|
||||||
* Uncapitalized dragon follows Game-naming
|
* Uncapitalized dragon follows Game-naming
|
||||||
|
* @global {number} CM.Cache.dragonAura The number of the first (right) Aura
|
||||||
|
* @global {number} CM.Cache.dragonAura2 The number of the second (left) Aura
|
||||||
*/
|
*/
|
||||||
CM.Cache.CacheDragonAuras = function() {
|
CM.Cache.CacheDragonAuras = function() {
|
||||||
|
/** @global */
|
||||||
CM.Cache.dragonAura = Game.dragonAura;
|
CM.Cache.dragonAura = Game.dragonAura;
|
||||||
CM.Cache.dragonAura2 = Game.dragonAura2;
|
CM.Cache.dragonAura2 = Game.dragonAura2;
|
||||||
}
|
}
|
||||||
@@ -33,12 +37,15 @@ CM.Cache.CacheDragonAuras = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches data related to Wrinklers
|
* This functions caches data related to Wrinklers
|
||||||
* It is called by CM.Loop()
|
* It is called by CM.Loop() and CM.Cache.InitCache()
|
||||||
|
* @global {number} CM.Cache.WrinklersTotal The cookies of all wrinklers
|
||||||
|
* @global {number} CM.Cache.WrinklersNormal The cookies of all normal wrinklers
|
||||||
|
* @global {[{number}, {number}]} CM.Cache.WrinklersFattest A list containing the cookies and the id of the fattest wrinkler
|
||||||
*/
|
*/
|
||||||
CM.Cache.RemakeWrinkBank = function() {
|
CM.Cache.CacheWrinklers = function() {
|
||||||
CM.Cache.WrinkBankTotal = 0;
|
CM.Cache.WrinklersTotal = 0;
|
||||||
CM.Cache.WrinkBankNormal = 0;
|
CM.Cache.WrinklersNormal = 0;
|
||||||
var totalSucked = 0;
|
CM.Cache.WrinklersFattest = [0, null];
|
||||||
for (var i in Game.wrinklers) {
|
for (var i in Game.wrinklers) {
|
||||||
var sucked = Game.wrinklers[i].sucked;
|
var sucked = Game.wrinklers[i].sucked;
|
||||||
var toSuck = 1.1;
|
var toSuck = 1.1;
|
||||||
@@ -52,19 +59,12 @@ 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;
|
||||||
}
|
}
|
||||||
CM.Cache.WrinkBankTotal += sucked;
|
CM.Cache.WrinklersTotal += sucked;
|
||||||
if (Game.wrinklers[i].type == 0) CM.Cache.WrinkBankNormal += sucked;
|
if (Game.wrinklers[i].type == 0) CM.Cache.WrinklersNormal += sucked;
|
||||||
}
|
if (sucked > CM.Cache.WrinklersFattest[0]) CM.Cache.WrinklersFattest = [sucked, i];
|
||||||
CM.Cache.WrinkGodBank = CM.Cache.WrinkBankTotal;
|
|
||||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
|
||||||
var godLvl = CM.Sim.hasGod('scorn');
|
|
||||||
if (godLvl == 2) CM.Cache.WrinkGodBank = CM.Cache.WrinkGodBank * 1.15 / 1.1;
|
|
||||||
else if (godLvl == 3) CM.Cache.WrinkGodBank = CM.Cache.WrinkGodBank * 1.15 / 1.05;
|
|
||||||
else if (godLvl != 1) CM.Cache.WrinkGodBank *= 1.15;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: UNSORTED */
|
* Section: UNSORTED */
|
||||||
|
|
||||||
@@ -405,7 +405,7 @@ CM.Cache.UpdateAvgCPS = function() {
|
|||||||
if (CM.Cache.lastDate != currDate) {
|
if (CM.Cache.lastDate != currDate) {
|
||||||
var choEggTotal = Game.cookies + CM.Cache.SellForChoEgg;
|
var choEggTotal = Game.cookies + CM.Cache.SellForChoEgg;
|
||||||
if (Game.cpsSucked > 0) {
|
if (Game.cpsSucked > 0) {
|
||||||
choEggTotal += CM.Cache.WrinkGodBank;
|
choEggTotal += CM.Cache.WrinklersTotal;
|
||||||
}
|
}
|
||||||
CM.Cache.RealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal);
|
CM.Cache.RealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal);
|
||||||
choEggTotal *= 0.05;
|
choEggTotal *= 0.05;
|
||||||
@@ -413,7 +413,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.WrinkBankTotal - CM.Cache.lastWrinkCookies)) / timeDiff;
|
var wrinkDiffAvg = Math.max(0, (CM.Cache.WrinklersTotal - 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++) {
|
||||||
@@ -435,7 +435,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.WrinkBankTotal;
|
CM.Cache.lastWrinkCookies = CM.Cache.WrinklersTotal;
|
||||||
CM.Cache.lastChoEgg = choEggTotal;
|
CM.Cache.lastChoEgg = choEggTotal;
|
||||||
CM.Cache.lastClicks = Game.cookieClicks;
|
CM.Cache.lastClicks = Game.cookieClicks;
|
||||||
|
|
||||||
@@ -518,9 +518,6 @@ 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.WrinkBankTotal = -1;
|
|
||||||
CM.Cache.WrinkBankNormal = -1;
|
|
||||||
CM.Cache.WrinkGodBank = -1;
|
|
||||||
CM.Cache.GoldenCookiesMult = 1;
|
CM.Cache.GoldenCookiesMult = 1;
|
||||||
CM.Cache.WrathCookiesMult = 1;
|
CM.Cache.WrathCookiesMult = 1;
|
||||||
CM.Cache.DragonsFortuneMultAdjustment = 1;
|
CM.Cache.DragonsFortuneMultAdjustment = 1;
|
||||||
|
|||||||
18
src/Disp.js
18
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.Options.CalcWrink is set
|
* as calculated by CM.Cache.RemakeWrinkBank() if CM.Options.CalcWrink is set
|
||||||
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinkBankTotal)
|
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinklersTotal)
|
||||||
*/
|
*/
|
||||||
CM.Disp.GetWrinkConfigBank = function() {
|
CM.Disp.GetWrinkConfigBank = function() {
|
||||||
if (CM.Options.CalcWrink)
|
if (CM.Options.CalcWrink)
|
||||||
return CM.Cache.WrinkBankTotal;
|
return CM.Cache.WrinklersTotal;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2119,13 +2119,21 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
stats.appendChild(CM.Disp.CreateStatsHeader('Wrinklers', 'Wrink'));
|
stats.appendChild(CM.Disp.CreateStatsHeader('Wrinklers', 'Wrink'));
|
||||||
if (CM.Options.Header.Wrink) {
|
if (CM.Options.Header.Wrink) {
|
||||||
var popAllFrag = document.createDocumentFragment();
|
var popAllFrag = document.createDocumentFragment();
|
||||||
popAllFrag.appendChild(document.createTextNode(Beautify(CM.Cache.WrinkBankTotal) + ' / ' + Beautify(CM.Cache.WrinkBankNormal) + ' '));
|
popAllFrag.appendChild(document.createTextNode(Beautify(CM.Cache.WrinklersTotal) + ' / ' + Beautify(CM.Cache.WrinklersNormal) + ' '));
|
||||||
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.PopAllNormalWrinklers(); };
|
popAllA.onclick = function() { CM.Disp.PopAllNormalWrinklers(); };
|
||||||
popAllFrag.appendChild(popAllA);
|
popAllFrag.appendChild(popAllA);
|
||||||
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping (All/Normal)', popAllFrag));
|
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping (All/Normal)', popAllFrag));
|
||||||
|
var popFattestFrag = document.createDocumentFragment();
|
||||||
|
popFattestFrag.appendChild(document.createTextNode(Beautify(CM.Cache.WrinklersFattest[0]) + ' '));
|
||||||
|
var popFattestA = document.createElement('a');
|
||||||
|
popFattestA.textContent = 'Pop single fattest';
|
||||||
|
popFattestA.className = 'option';
|
||||||
|
popFattestA.onclick = function() { Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp = 0; };
|
||||||
|
popFattestFrag.appendChild(popFattestA);
|
||||||
|
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rewards of Popping Single Fattest Wrinkler (id: ' + CM.Cache.WrinklersFattest[1] + ")", popFattestFrag));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2530,11 +2538,11 @@ CM.Disp.CreateStatsPrestigeSection = function() {
|
|||||||
section.className = 'CMStatsPrestigeSection';
|
section.className = 'CMStatsPrestigeSection';
|
||||||
|
|
||||||
var possiblePresMax = Math.floor(Game.HowMuchPrestige(CM.Cache.RealCookiesEarned +
|
var possiblePresMax = Math.floor(Game.HowMuchPrestige(CM.Cache.RealCookiesEarned +
|
||||||
Game.cookiesReset + CM.Cache.WrinkGodBank +
|
Game.cookiesReset + CM.Cache.WrinklersTotal +
|
||||||
(Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CM.Cache.lastChoEgg : 0)));
|
(Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CM.Cache.lastChoEgg : 0)));
|
||||||
section.appendChild(CM.Disp.CreateStatsListing("withTooltip", 'Prestige Level (CUR / MAX)', document.createTextNode(Beautify(Game.prestige) + ' / ' + Beautify(possiblePresMax)), 'PrestMaxTooltipPlaceholder'));
|
section.appendChild(CM.Disp.CreateStatsListing("withTooltip", 'Prestige Level (CUR / MAX)', document.createTextNode(Beautify(Game.prestige) + ' / ' + Beautify(possiblePresMax)), 'PrestMaxTooltipPlaceholder'));
|
||||||
|
|
||||||
var neededCook = Game.HowManyCookiesReset(possiblePresMax + 1) - (CM.Cache.RealCookiesEarned + Game.cookiesReset + CM.Cache.WrinkGodBank + ((Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CM.Cache.lastChoEgg : 0) ? CM.Cache.lastChoEgg : 0));
|
var neededCook = Game.HowManyCookiesReset(possiblePresMax + 1) - (CM.Cache.RealCookiesEarned + Game.cookiesReset + CM.Cache.WrinklersTotal + ((Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CM.Cache.lastChoEgg : 0) ? CM.Cache.lastChoEgg : 0));
|
||||||
var cookiesNextFrag = document.createDocumentFragment();
|
var cookiesNextFrag = document.createDocumentFragment();
|
||||||
cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook)));
|
cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook)));
|
||||||
var cookiesNextSmall = document.createElement('small');
|
var cookiesNextSmall = document.createElement('small');
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ CM.Loop = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update Wrinkler Bank
|
// Update Wrinkler Bank
|
||||||
CM.Cache.RemakeWrinkBank();
|
CM.Cache.CacheWrinklers();
|
||||||
|
|
||||||
// Calculate PP
|
// Calculate PP
|
||||||
CM.Cache.RemakePP();
|
CM.Cache.RemakePP();
|
||||||
|
|||||||
Reference in New Issue
Block a user