From c68febd794f695932b3c689019a5f9af29264fe5 Mon Sep 17 00:00:00 2001 From: DanielNoord Date: Tue, 24 Nov 2020 11:23:52 +0100 Subject: [PATCH] Added stats for Conjure Baked Goods (#334) --- CookieMonster.js | 29 ++++++++++++++++++++++++++++- src/Cache.js | 4 ++++ src/Disp.js | 23 +++++++++++++++++++++++ src/Main.js | 2 +- 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 2ed1929..58c0a17 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -159,6 +159,8 @@ CM.Cache.RemakeLucky = function() { CM.Cache.LuckyReward = (CM.Cache.Lucky * 0.15) + 13; CM.Cache.LuckyFrenzy = CM.Cache.Lucky * 7; CM.Cache.LuckyRewardFrenzy = (CM.Cache.LuckyFrenzy * 0.15) + 13; + CM.Cache.Conjure = CM.Cache.Lucky * 2; + CM.Cache.ConjureReward = CM.Cache.Conjure * 0.15; } CM.Cache.MaxChainMoni = function(digit, maxPayout) { @@ -377,6 +379,8 @@ CM.Cache.Lucky = 0; CM.Cache.LuckyReward = 0; CM.Cache.LuckyFrenzy = 0; CM.Cache.LuckyRewardFrenzy = 0; +CM.Cache.Conjure = 0; +CM.Cache.ConjureReward = 0; CM.Cache.SeaSpec = 0; CM.Cache.Chain = 0; CM.Cache.ChainWrath = 0; @@ -2152,6 +2156,29 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(listing(listingQuest('\"Chain\" Reward (CUR) (Golden / Wrath)', 'GoldCookTooltipPlaceholder'), document.createTextNode(Beautify(chainCur) + ' / ' + Beautify(chainCurWrath)))); } + stats.appendChild(header('Conjure Baked Goods', 'Conjure')); + if (CM.Config.StatsPref.Conjure) { + var conjureColor = ((Game.cookies + CM.Disp.GetWrinkConfigBank()) < CM.Cache.Conjure) ? CM.Disp.colorRed : CM.Disp.colorGreen; + var conjureCur = Math.min((Game.cookies + CM.Disp.GetWrinkConfigBank()) * 0.15, CM.Cache.NoGoldSwitchCookiesPS * 60 * 30); + var conjureTime = ((Game.cookies + CM.Disp.GetWrinkConfigBank()) < CM.Cache.Conjure) ? CM.Disp.FormatTime((CM.Cache.Conjure - (Game.cookies + CM.Disp.GetWrinkConfigBank())) / CM.Disp.GetCPS()) : ''; + var conjureRewardMax = CM.Cache.ConjureReward; + + var conjureReqFrag = document.createDocumentFragment(); + var conjureReqSpan = document.createElement('span'); + conjureReqSpan.style.fontWeight = 'bold'; + conjureReqSpan.className = CM.Disp.colorTextPre + conjureColor; + conjureReqSpan.textContent = Beautify(CM.Cache.Conjure); + conjureReqFrag.appendChild(conjureReqSpan); + if (conjureTime != '') { + var conjureReqSmall = document.createElement('small'); + conjureReqSmall.textContent = ' (' + conjureTime + ')'; + conjureReqFrag.appendChild(conjureReqSmall); + } + stats.appendChild(listing(listingQuest('\"Conjure Baked Goods\" Cookies Required', 'GoldCookTooltipPlaceholder'), conjureReqFrag)); + stats.appendChild(listing(listingQuest('\"Conjure Baked Goods\" Reward (MAX)', 'GoldCookTooltipPlaceholder'), document.createTextNode(Beautify(conjureRewardMax)))); + stats.appendChild(listing(listingQuest('\"Conjure Baked Goods\" Reward (CUR)', 'GoldCookTooltipPlaceholder'), document.createTextNode(Beautify(conjureCur)))); + } + var choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')); // Needs to be done for the checking below stats.appendChild(header('Prestige', 'Prestige')); @@ -3242,7 +3269,7 @@ CM.ConfigDefault = { SayTime: 1, GrimoireBar: 1, Scale: 2, - StatsPref: {Lucky: 1, Chain: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1}, + StatsPref: {Lucky: 1, Conjure: 1, Chain: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3', Pink: '#ff1493', Brown: '#8b4513'}, SortBuildings: 0, SortUpgrades: 0 diff --git a/src/Cache.js b/src/Cache.js index 1c31723..a27d678 100644 --- a/src/Cache.js +++ b/src/Cache.js @@ -139,6 +139,8 @@ CM.Cache.RemakeLucky = function() { CM.Cache.LuckyReward = (CM.Cache.Lucky * 0.15) + 13; CM.Cache.LuckyFrenzy = CM.Cache.Lucky * 7; CM.Cache.LuckyRewardFrenzy = (CM.Cache.LuckyFrenzy * 0.15) + 13; + CM.Cache.Conjure = CM.Cache.Lucky * 2; + CM.Cache.ConjureReward = CM.Cache.Conjure * 0.15; } CM.Cache.MaxChainMoni = function(digit, maxPayout) { @@ -357,6 +359,8 @@ CM.Cache.Lucky = 0; CM.Cache.LuckyReward = 0; CM.Cache.LuckyFrenzy = 0; CM.Cache.LuckyRewardFrenzy = 0; +CM.Cache.Conjure = 0; +CM.Cache.ConjureReward = 0; CM.Cache.SeaSpec = 0; CM.Cache.Chain = 0; CM.Cache.ChainWrath = 0; diff --git a/src/Disp.js b/src/Disp.js index 4efdc63..39a1213 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1524,6 +1524,29 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(listing(listingQuest('\"Chain\" Reward (CUR) (Golden / Wrath)', 'GoldCookTooltipPlaceholder'), document.createTextNode(Beautify(chainCur) + ' / ' + Beautify(chainCurWrath)))); } + stats.appendChild(header('Conjure Baked Goods', 'Conjure')); + if (CM.Config.StatsPref.Conjure) { + var conjureColor = ((Game.cookies + CM.Disp.GetWrinkConfigBank()) < CM.Cache.Conjure) ? CM.Disp.colorRed : CM.Disp.colorGreen; + var conjureCur = Math.min((Game.cookies + CM.Disp.GetWrinkConfigBank()) * 0.15, CM.Cache.NoGoldSwitchCookiesPS * 60 * 30); + var conjureTime = ((Game.cookies + CM.Disp.GetWrinkConfigBank()) < CM.Cache.Conjure) ? CM.Disp.FormatTime((CM.Cache.Conjure - (Game.cookies + CM.Disp.GetWrinkConfigBank())) / CM.Disp.GetCPS()) : ''; + var conjureRewardMax = CM.Cache.ConjureReward; + + var conjureReqFrag = document.createDocumentFragment(); + var conjureReqSpan = document.createElement('span'); + conjureReqSpan.style.fontWeight = 'bold'; + conjureReqSpan.className = CM.Disp.colorTextPre + conjureColor; + conjureReqSpan.textContent = Beautify(CM.Cache.Conjure); + conjureReqFrag.appendChild(conjureReqSpan); + if (conjureTime != '') { + var conjureReqSmall = document.createElement('small'); + conjureReqSmall.textContent = ' (' + conjureTime + ')'; + conjureReqFrag.appendChild(conjureReqSmall); + } + stats.appendChild(listing(listingQuest('\"Conjure Baked Goods\" Cookies Required', 'GoldCookTooltipPlaceholder'), conjureReqFrag)); + stats.appendChild(listing(listingQuest('\"Conjure Baked Goods\" Reward (MAX)', 'GoldCookTooltipPlaceholder'), document.createTextNode(Beautify(conjureRewardMax)))); + stats.appendChild(listing(listingQuest('\"Conjure Baked Goods\" Reward (CUR)', 'GoldCookTooltipPlaceholder'), document.createTextNode(Beautify(conjureCur)))); + } + var choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')); // Needs to be done for the checking below stats.appendChild(header('Prestige', 'Prestige')); diff --git a/src/Main.js b/src/Main.js index 5a8f828..4e1af4c 100644 --- a/src/Main.js +++ b/src/Main.js @@ -298,7 +298,7 @@ CM.ConfigDefault = { SayTime: 1, GrimoireBar: 1, Scale: 2, - StatsPref: {Lucky: 1, Chain: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1}, + StatsPref: {Lucky: 1, Conjure: 1, Chain: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3', Pink: '#ff1493', Brown: '#8b4513'}, SortBuildings: 0, SortUpgrades: 0