From 5ef74866462b406c01e2947f63ea917bde4027a6 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Wed, 25 Apr 2018 18:47:52 -0400 Subject: [PATCH 01/11] Change to Version 2.0106.2 --- CookieMonster.js | 2 +- src/Main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index c721862..d40019e 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2762,7 +2762,7 @@ CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkB CM.ConfigPrefix = 'CMConfig'; CM.VersionMajor = '2.0106'; -CM.VersionMinor = '1'; +CM.VersionMinor = '2'; /******* * Sim * diff --git a/src/Main.js b/src/Main.js index a37441d..ff2c224 100644 --- a/src/Main.js +++ b/src/Main.js @@ -251,5 +251,5 @@ CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkB CM.ConfigPrefix = 'CMConfig'; CM.VersionMajor = '2.0106'; -CM.VersionMinor = '1'; +CM.VersionMinor = '2'; From e4de9c124e5569e1b7372dc7bbcd4f6f88176ad6 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Wed, 25 Apr 2018 19:24:07 -0400 Subject: [PATCH 02/11] Fix Prestige stats not taking account of extra buildings from Spontaneous Edifice (Issue #175) --- CookieMonster.js | 36 +++++++++++++++++++----------------- src/Cache.js | 2 ++ src/Disp.js | 4 ++-- src/Sim.js | 30 +++++++++++++++--------------- 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index d40019e..fe8236e 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -265,6 +265,7 @@ CM.Cache.UpdateAvgCPS = function() { if (Game.cpsSucked > 0) { choEggTotal += CM.Cache.WrinkGodBank; } + CM.Cache.RealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal); choEggTotal *= 0.05; if (CM.Cache.lastDate != -1) { @@ -377,6 +378,7 @@ CM.Cache.CentEgg = 0; CM.Cache.SellForChoEgg = 0; CM.Cache.Title = ''; CM.Cache.HadFierHoard = false; +CM.Cache.RealCookiesEarned = -1; CM.Cache.lastDate = -1; CM.Cache.lastCookies = -1; CM.Cache.lastWrinkCookies = -1; @@ -1832,8 +1834,8 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(header('Prestige', 'Prestige')); if (CM.Config.StatsPref.Prestige) { - var possiblePresMax = Math.floor(Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + CM.Cache.WrinkGodBank + (choEgg ? CM.Cache.lastChoEgg : 0))); - var neededCook = Game.HowManyCookiesReset(possiblePresMax + 1) - (Game.cookiesEarned + Game.cookiesReset + CM.Cache.WrinkGodBank + (choEgg ? CM.Cache.lastChoEgg : 0)); + var possiblePresMax = Math.floor(Game.HowMuchPrestige(CM.Cache.RealCookiesEarned + Game.cookiesReset + CM.Cache.WrinkGodBank + (choEgg ? CM.Cache.lastChoEgg : 0))); + var neededCook = Game.HowManyCookiesReset(possiblePresMax + 1) - (CM.Cache.RealCookiesEarned + Game.cookiesReset + CM.Cache.WrinkGodBank + (choEgg ? CM.Cache.lastChoEgg : 0)); stats.appendChild(listing(listingQuest('Prestige Level (CUR / MAX)', 'PrestMaxTooltipPlaceholder'), document.createTextNode(Beautify(Game.prestige) + ' / ' + Beautify(possiblePresMax)))); var cookiesNextFrag = document.createDocumentFragment(); @@ -3267,21 +3269,21 @@ CM.Sim.ResetBonus = function(possiblePresMax) { CM.Sim.CopyData(); } - if (Game.cookiesEarned >= 1000000) CM.Sim.Win('Sacrifice'); - if (Game.cookiesEarned >= 1000000000) CM.Sim.Win('Oblivion'); - if (Game.cookiesEarned >= 1000000000000) CM.Sim.Win('From scratch'); - if (Game.cookiesEarned >= 1000000000000000) CM.Sim.Win('Nihilism'); - if (Game.cookiesEarned >= 1000000000000000000) CM.Sim.Win('Dematerialize'); - if (Game.cookiesEarned >= 1000000000000000000000) CM.Sim.Win('Nil zero zilch'); - if (Game.cookiesEarned >= 1000000000000000000000000) CM.Sim.Win('Transcendence'); - if (Game.cookiesEarned >= 1000000000000000000000000000) CM.Sim.Win('Obliterate'); - if (Game.cookiesEarned >= 1000000000000000000000000000000) CM.Sim.Win('Negative void'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000) CM.Sim.Win('To crumbs, you say?'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000000) CM.Sim.Win('You get nothing'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000000000) CM.Sim.Win('Humble rebeginnings'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000000000000) CM.Sim.Win('The end of the world'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000000000000000) CM.Sim.Win('Oh, you\'re back'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000000000000000000) CM.Sim.Win('Lazarus'); + if (CM.Cache.RealCookiesEarned >= 1000000) CM.Sim.Win('Sacrifice'); + if (CM.Cache.RealCookiesEarned >= 1000000000) CM.Sim.Win('Oblivion'); + if (CM.Cache.RealCookiesEarned >= 1000000000000) CM.Sim.Win('From scratch'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000) CM.Sim.Win('Nihilism'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000) CM.Sim.Win('Dematerialize'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000) CM.Sim.Win('Nil zero zilch'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000) CM.Sim.Win('Transcendence'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000) CM.Sim.Win('Obliterate'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000) CM.Sim.Win('Negative void'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000) CM.Sim.Win('To crumbs, you say?'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000) CM.Sim.Win('You get nothing'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000) CM.Sim.Win('Humble rebeginnings'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000) CM.Sim.Win('The end of the world'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000) CM.Sim.Win('Oh, you\'re back'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000000) CM.Sim.Win('Lazarus'); CM.Sim.Upgrades['Heavenly chip secret'].bought = 1; CM.Sim.Upgrades['Heavenly cookie stand'].bought = 1; diff --git a/src/Cache.js b/src/Cache.js index 47a1472..ebfa47b 100644 --- a/src/Cache.js +++ b/src/Cache.js @@ -245,6 +245,7 @@ CM.Cache.UpdateAvgCPS = function() { if (Game.cpsSucked > 0) { choEggTotal += CM.Cache.WrinkGodBank; } + CM.Cache.RealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal); choEggTotal *= 0.05; if (CM.Cache.lastDate != -1) { @@ -357,6 +358,7 @@ CM.Cache.CentEgg = 0; CM.Cache.SellForChoEgg = 0; CM.Cache.Title = ''; CM.Cache.HadFierHoard = false; +CM.Cache.RealCookiesEarned = -1; CM.Cache.lastDate = -1; CM.Cache.lastCookies = -1; CM.Cache.lastWrinkCookies = -1; diff --git a/src/Disp.js b/src/Disp.js index 418cd6d..fc4aeb3 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1282,8 +1282,8 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(header('Prestige', 'Prestige')); if (CM.Config.StatsPref.Prestige) { - var possiblePresMax = Math.floor(Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + CM.Cache.WrinkGodBank + (choEgg ? CM.Cache.lastChoEgg : 0))); - var neededCook = Game.HowManyCookiesReset(possiblePresMax + 1) - (Game.cookiesEarned + Game.cookiesReset + CM.Cache.WrinkGodBank + (choEgg ? CM.Cache.lastChoEgg : 0)); + var possiblePresMax = Math.floor(Game.HowMuchPrestige(CM.Cache.RealCookiesEarned + Game.cookiesReset + CM.Cache.WrinkGodBank + (choEgg ? CM.Cache.lastChoEgg : 0))); + var neededCook = Game.HowManyCookiesReset(possiblePresMax + 1) - (CM.Cache.RealCookiesEarned + Game.cookiesReset + CM.Cache.WrinkGodBank + (choEgg ? CM.Cache.lastChoEgg : 0)); stats.appendChild(listing(listingQuest('Prestige Level (CUR / MAX)', 'PrestMaxTooltipPlaceholder'), document.createTextNode(Beautify(Game.prestige) + ' / ' + Beautify(possiblePresMax)))); var cookiesNextFrag = document.createDocumentFragment(); diff --git a/src/Sim.js b/src/Sim.js index 5338535..0da872e 100644 --- a/src/Sim.js +++ b/src/Sim.js @@ -501,21 +501,21 @@ CM.Sim.ResetBonus = function(possiblePresMax) { CM.Sim.CopyData(); } - if (Game.cookiesEarned >= 1000000) CM.Sim.Win('Sacrifice'); - if (Game.cookiesEarned >= 1000000000) CM.Sim.Win('Oblivion'); - if (Game.cookiesEarned >= 1000000000000) CM.Sim.Win('From scratch'); - if (Game.cookiesEarned >= 1000000000000000) CM.Sim.Win('Nihilism'); - if (Game.cookiesEarned >= 1000000000000000000) CM.Sim.Win('Dematerialize'); - if (Game.cookiesEarned >= 1000000000000000000000) CM.Sim.Win('Nil zero zilch'); - if (Game.cookiesEarned >= 1000000000000000000000000) CM.Sim.Win('Transcendence'); - if (Game.cookiesEarned >= 1000000000000000000000000000) CM.Sim.Win('Obliterate'); - if (Game.cookiesEarned >= 1000000000000000000000000000000) CM.Sim.Win('Negative void'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000) CM.Sim.Win('To crumbs, you say?'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000000) CM.Sim.Win('You get nothing'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000000000) CM.Sim.Win('Humble rebeginnings'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000000000000) CM.Sim.Win('The end of the world'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000000000000000) CM.Sim.Win('Oh, you\'re back'); - if (Game.cookiesEarned >= 1000000000000000000000000000000000000000000000000) CM.Sim.Win('Lazarus'); + if (CM.Cache.RealCookiesEarned >= 1000000) CM.Sim.Win('Sacrifice'); + if (CM.Cache.RealCookiesEarned >= 1000000000) CM.Sim.Win('Oblivion'); + if (CM.Cache.RealCookiesEarned >= 1000000000000) CM.Sim.Win('From scratch'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000) CM.Sim.Win('Nihilism'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000) CM.Sim.Win('Dematerialize'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000) CM.Sim.Win('Nil zero zilch'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000) CM.Sim.Win('Transcendence'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000) CM.Sim.Win('Obliterate'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000) CM.Sim.Win('Negative void'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000) CM.Sim.Win('To crumbs, you say?'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000) CM.Sim.Win('You get nothing'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000) CM.Sim.Win('Humble rebeginnings'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000) CM.Sim.Win('The end of the world'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000) CM.Sim.Win('Oh, you\'re back'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000000) CM.Sim.Win('Lazarus'); CM.Sim.Upgrades['Heavenly chip secret'].bought = 1; CM.Sim.Upgrades['Heavenly cookie stand'].bought = 1; From 9becf9b9acc126c69382bb37280d7c9c45501a3f Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Tue, 10 Jul 2018 21:04:17 -0400 Subject: [PATCH 03/11] Added the options 10s, 15s, 30s to average CPS (Issue #198) --- CookieMonster.js | 15 ++++++++------- src/Cache.js | 4 ++-- src/Config.js | 2 +- src/Disp.js | 7 ++++--- src/Main.js | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index fe8236e..b3b9862 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -301,7 +301,7 @@ CM.Cache.UpdateAvgCPS = function() { var sortedGainWrink = new Array(); var sortedGainChoEgg = new Array(); - var cpsLength = Math.min(CM.Cache.CookiesDiff.getLength(), CM.Disp.times[CM.Config.AvgCPSHist] * 60); + var cpsLength = Math.min(CM.Cache.CookiesDiff.getLength(), CM.Disp.cookieTimes[CM.Config.AvgCPSHist]); // Assumes the queues are the same length for (var i = CM.Cache.CookiesDiff.getLength() - cpsLength; i < CM.Cache.CookiesDiff.getLength(); i++) { @@ -347,7 +347,7 @@ CM.Cache.UpdateAvgCPS = function() { } var totalClicks = 0; - var clicksLength = Math.min(CM.Cache.ClicksDiff.getLength(), CM.Disp.times[CM.Config.AvgClicksHist]); + var clicksLength = Math.min(CM.Cache.ClicksDiff.getLength(), CM.Disp.clickTimes[CM.Config.AvgClicksHist]); for (var i = CM.Cache.ClicksDiff.getLength() - clicksLength; i < CM.Cache.ClicksDiff.getLength(); i++) { totalClicks += CM.Cache.ClicksDiff.get(i); } @@ -517,7 +517,7 @@ CM.ConfigData.UpBarColor = {label: ['Upgrade Bar/Colors OFF', 'Upgrade Bar/Color CM.ConfigData.Colors = {desc: {Blue: 'Color Blue. Used to show better than best PP building, for Click Frenzy bar, and for various labels', Green: 'Color Green. Used to show best PP building, for Blood Frenzy bar, and for various labels', Yellow: 'Color Yellow. Used to show between best and worst PP buildings closer to best, for Frenzy bar, and for various labels', Orange: 'Color Orange. Used to show between best and worst PP buildings closer to worst, for Next Reindeer bar, and for various labels', Red: 'Color Red. Used to show worst PP building, for Clot bar, and for various labels', Purple: 'Color Purple. Used to show worse than worst PP building, for Next Cookie bar, and for various labels', Gray: 'Color Gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar', Pink: 'Color Pink. Used for Dragonflight bar', Brown: 'Color Brown. Used for Dragon Harvest bar'}, func: function() {CM.Disp.UpdateColors();}}; CM.ConfigData.CalcWrink = {label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON'], desc: 'Calculate times and average Cookies Per Second with Wrinklers', toggle: true}; CM.ConfigData.CPSMode = {label: ['Current Cookies Per Second', 'Average Cookies Per Second'], desc: 'Calculate times using current Cookies Per Second or average Cookies Per Second', toggle: false}; -CM.ConfigData.AvgCPSHist = {label: ['Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'], desc: 'How much time average Cookies Per Second should consider', toggle: false}; +CM.ConfigData.AvgCPSHist = {label: ['Average CPS for past 10s', 'Average CPS for past 15s', 'Average CPS for past 30s', 'Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'], desc: 'How much time average Cookies Per Second should consider', toggle: false}; CM.ConfigData.AvgClicksHist = {label: ['Average Cookie Clicks for past 1s', 'Average Cookie Clicks for past 5s', 'Average Cookie Clicks for past 10s', 'Average Cookie Clicks for past 15s', 'Average Cookie Clicks for past 30s'], desc: 'How much time average Cookie Clicks should consider', toggle: false}; CM.ConfigData.ToolWarnCautBon = {label: ['Calculate Tooltip Warning/Caution With Bonus CPS OFF', 'Calculate Tooltip Warning/Caution With Bonus CPS ON'], desc: 'Calculate the warning/caution with or without the bonus CPS you get from buying', toggle: true}; CM.ConfigData.Flash = {label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Golden Cookie/Season Popup', toggle: true}; @@ -1970,8 +1970,8 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(header('Miscellaneous', 'Misc')); if (CM.Config.StatsPref.Misc) { - stats.appendChild(listing('Average Cookies Per Second (Past ' + CM.Disp.times[CM.Config.AvgCPSHist] + (CM.Config.AvgCPSHist == 0 ? ' minute' : ' minutes') + ')', document.createTextNode(Beautify(CM.Cache.AvgCPS, 3)))); - stats.appendChild(listing('Average Cookie Clicks Per Second (Past ' + CM.Disp.times[CM.Config.AvgClicksHist] + (CM.Config.AvgClicksHist == 0 ? ' second' : ' seconds') + ')', document.createTextNode(Beautify(CM.Cache.AvgClicks, 1)))); + stats.appendChild(listing('Average Cookies Per Second (Past ' + (CM.Disp.cookieTimes[CM.Config.AvgCPSHist] < 60 ? (CM.Disp.cookieTimes[CM.Config.AvgCPSHist] + ' seconds') : ((CM.Disp.cookieTimes[CM.Config.AvgCPSHist] / 60) + (CM.Config.AvgCPSHist == 3 ? ' minute' : ' minutes'))) + ')', document.createTextNode(Beautify(CM.Cache.AvgCPS, 3)))); + stats.appendChild(listing('Average Cookie Clicks Per Second (Past ' + CM.Disp.clickTimes[CM.Config.AvgClicksHist] + (CM.Config.AvgClicksHist == 0 ? ' second' : ' seconds') + ')', document.createTextNode(Beautify(CM.Cache.AvgClicks, 1)))); stats.appendChild(listing('Missed Golden Cookies', document.createTextNode(Beautify(Game.missedGoldenClicks)))); } @@ -2499,7 +2499,8 @@ CM.Disp.goldenShimmer; CM.Disp.seasonPopShimmer; CM.Disp.lastAscendState = -1; -CM.Disp.times = [1, 5, 10, 15, 30]; +CM.Disp.cookieTimes = [10, 15, 30, 60, 300, 600, 900, 1800]; +CM.Disp.clickTimes = [1, 5, 10, 15, 30]; CM.Disp.metric = ['M', 'G', 'T', 'P', 'E', 'Z', 'Y']; CM.Disp.shortScale = ['M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec']; @@ -2760,7 +2761,7 @@ CM.DelayInit = function() { CM.HasReplaceNativeGrimoireLaunch = false; CM.HasReplaceNativeGrimoireDraw = false; -CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 0, AvgClicksHist: 0, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 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'}}; +CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 3, AvgClicksHist: 0, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 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'}}; CM.ConfigPrefix = 'CMConfig'; CM.VersionMajor = '2.0106'; diff --git a/src/Cache.js b/src/Cache.js index ebfa47b..fe2196f 100644 --- a/src/Cache.js +++ b/src/Cache.js @@ -281,7 +281,7 @@ CM.Cache.UpdateAvgCPS = function() { var sortedGainWrink = new Array(); var sortedGainChoEgg = new Array(); - var cpsLength = Math.min(CM.Cache.CookiesDiff.getLength(), CM.Disp.times[CM.Config.AvgCPSHist] * 60); + var cpsLength = Math.min(CM.Cache.CookiesDiff.getLength(), CM.Disp.cookieTimes[CM.Config.AvgCPSHist]); // Assumes the queues are the same length for (var i = CM.Cache.CookiesDiff.getLength() - cpsLength; i < CM.Cache.CookiesDiff.getLength(); i++) { @@ -327,7 +327,7 @@ CM.Cache.UpdateAvgCPS = function() { } var totalClicks = 0; - var clicksLength = Math.min(CM.Cache.ClicksDiff.getLength(), CM.Disp.times[CM.Config.AvgClicksHist]); + var clicksLength = Math.min(CM.Cache.ClicksDiff.getLength(), CM.Disp.clickTimes[CM.Config.AvgClicksHist]); for (var i = CM.Cache.ClicksDiff.getLength() - clicksLength; i < CM.Cache.ClicksDiff.getLength(); i++) { totalClicks += CM.Cache.ClicksDiff.get(i); } diff --git a/src/Config.js b/src/Config.js index 9e6172d..56e78ce 100644 --- a/src/Config.js +++ b/src/Config.js @@ -123,7 +123,7 @@ CM.ConfigData.UpBarColor = {label: ['Upgrade Bar/Colors OFF', 'Upgrade Bar/Color CM.ConfigData.Colors = {desc: {Blue: 'Color Blue. Used to show better than best PP building, for Click Frenzy bar, and for various labels', Green: 'Color Green. Used to show best PP building, for Blood Frenzy bar, and for various labels', Yellow: 'Color Yellow. Used to show between best and worst PP buildings closer to best, for Frenzy bar, and for various labels', Orange: 'Color Orange. Used to show between best and worst PP buildings closer to worst, for Next Reindeer bar, and for various labels', Red: 'Color Red. Used to show worst PP building, for Clot bar, and for various labels', Purple: 'Color Purple. Used to show worse than worst PP building, for Next Cookie bar, and for various labels', Gray: 'Color Gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar', Pink: 'Color Pink. Used for Dragonflight bar', Brown: 'Color Brown. Used for Dragon Harvest bar'}, func: function() {CM.Disp.UpdateColors();}}; CM.ConfigData.CalcWrink = {label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON'], desc: 'Calculate times and average Cookies Per Second with Wrinklers', toggle: true}; CM.ConfigData.CPSMode = {label: ['Current Cookies Per Second', 'Average Cookies Per Second'], desc: 'Calculate times using current Cookies Per Second or average Cookies Per Second', toggle: false}; -CM.ConfigData.AvgCPSHist = {label: ['Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'], desc: 'How much time average Cookies Per Second should consider', toggle: false}; +CM.ConfigData.AvgCPSHist = {label: ['Average CPS for past 10s', 'Average CPS for past 15s', 'Average CPS for past 30s', 'Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'], desc: 'How much time average Cookies Per Second should consider', toggle: false}; CM.ConfigData.AvgClicksHist = {label: ['Average Cookie Clicks for past 1s', 'Average Cookie Clicks for past 5s', 'Average Cookie Clicks for past 10s', 'Average Cookie Clicks for past 15s', 'Average Cookie Clicks for past 30s'], desc: 'How much time average Cookie Clicks should consider', toggle: false}; CM.ConfigData.ToolWarnCautBon = {label: ['Calculate Tooltip Warning/Caution With Bonus CPS OFF', 'Calculate Tooltip Warning/Caution With Bonus CPS ON'], desc: 'Calculate the warning/caution with or without the bonus CPS you get from buying', toggle: true}; CM.ConfigData.Flash = {label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Golden Cookie/Season Popup', toggle: true}; diff --git a/src/Disp.js b/src/Disp.js index fc4aeb3..20541aa 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1418,8 +1418,8 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(header('Miscellaneous', 'Misc')); if (CM.Config.StatsPref.Misc) { - stats.appendChild(listing('Average Cookies Per Second (Past ' + CM.Disp.times[CM.Config.AvgCPSHist] + (CM.Config.AvgCPSHist == 0 ? ' minute' : ' minutes') + ')', document.createTextNode(Beautify(CM.Cache.AvgCPS, 3)))); - stats.appendChild(listing('Average Cookie Clicks Per Second (Past ' + CM.Disp.times[CM.Config.AvgClicksHist] + (CM.Config.AvgClicksHist == 0 ? ' second' : ' seconds') + ')', document.createTextNode(Beautify(CM.Cache.AvgClicks, 1)))); + stats.appendChild(listing('Average Cookies Per Second (Past ' + (CM.Disp.cookieTimes[CM.Config.AvgCPSHist] < 60 ? (CM.Disp.cookieTimes[CM.Config.AvgCPSHist] + ' seconds') : ((CM.Disp.cookieTimes[CM.Config.AvgCPSHist] / 60) + (CM.Config.AvgCPSHist == 3 ? ' minute' : ' minutes'))) + ')', document.createTextNode(Beautify(CM.Cache.AvgCPS, 3)))); + stats.appendChild(listing('Average Cookie Clicks Per Second (Past ' + CM.Disp.clickTimes[CM.Config.AvgClicksHist] + (CM.Config.AvgClicksHist == 0 ? ' second' : ' seconds') + ')', document.createTextNode(Beautify(CM.Cache.AvgClicks, 1)))); stats.appendChild(listing('Missed Golden Cookies', document.createTextNode(Beautify(Game.missedGoldenClicks)))); } @@ -1947,7 +1947,8 @@ CM.Disp.goldenShimmer; CM.Disp.seasonPopShimmer; CM.Disp.lastAscendState = -1; -CM.Disp.times = [1, 5, 10, 15, 30]; +CM.Disp.cookieTimes = [10, 15, 30, 60, 300, 600, 900, 1800]; +CM.Disp.clickTimes = [1, 5, 10, 15, 30]; CM.Disp.metric = ['M', 'G', 'T', 'P', 'E', 'Z', 'Y']; CM.Disp.shortScale = ['M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec']; diff --git a/src/Main.js b/src/Main.js index ff2c224..fb6793c 100644 --- a/src/Main.js +++ b/src/Main.js @@ -247,7 +247,7 @@ CM.DelayInit = function() { CM.HasReplaceNativeGrimoireLaunch = false; CM.HasReplaceNativeGrimoireDraw = false; -CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 0, AvgClicksHist: 0, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 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'}}; +CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 3, AvgClicksHist: 0, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 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'}}; CM.ConfigPrefix = 'CMConfig'; CM.VersionMajor = '2.0106'; From b5f6fef9ae0955be6871d3f9f297867affe43459 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Tue, 10 Jul 2018 22:37:00 -0400 Subject: [PATCH 04/11] Expand the number labels since now the game hits even higher numbers! (Issue #197) --- CookieMonster.js | 2 +- src/Disp.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index b3b9862..82e1f44 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2503,7 +2503,7 @@ CM.Disp.cookieTimes = [10, 15, 30, 60, 300, 600, 900, 1800]; CM.Disp.clickTimes = [1, 5, 10, 15, 30]; CM.Disp.metric = ['M', 'G', 'T', 'P', 'E', 'Z', 'Y']; -CM.Disp.shortScale = ['M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec']; +CM.Disp.shortScale = ['M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec', 'Quattuordec', 'Quindec', 'Sexdec', 'Septendec', 'Octodec', 'Novemdec', 'Vigint', 'Unvigint', 'Duovigint', 'Trevigint', 'Quattuorvigint']; CM.Disp.TooltipWrinklerArea = 0; CM.Disp.TooltipWrinkler = -1; diff --git a/src/Disp.js b/src/Disp.js index 20541aa..bce020f 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1951,7 +1951,7 @@ CM.Disp.cookieTimes = [10, 15, 30, 60, 300, 600, 900, 1800]; CM.Disp.clickTimes = [1, 5, 10, 15, 30]; CM.Disp.metric = ['M', 'G', 'T', 'P', 'E', 'Z', 'Y']; -CM.Disp.shortScale = ['M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec']; +CM.Disp.shortScale = ['M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec', 'Quattuordec', 'Quindec', 'Sexdec', 'Septendec', 'Octodec', 'Novemdec', 'Vigint', 'Unvigint', 'Duovigint', 'Trevigint', 'Quattuorvigint']; CM.Disp.TooltipWrinklerArea = 0; CM.Disp.TooltipWrinkler = -1; From 22ae4ebc4cd1f01c90f273f6b31e988205f493cd Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Thu, 12 Jul 2018 23:05:18 -0400 Subject: [PATCH 05/11] Renamed previous Scientific Notation to Engineering Notation and added real Scientific Notation (Issue #110) --- CookieMonster.js | 32 ++++++++++++++++++++++---------- src/Config.js | 2 +- src/Disp.js | 30 +++++++++++++++++++++--------- 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 82e1f44..c1b7a9b 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -540,7 +540,7 @@ CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false}; CM.ConfigData.TimeFormat = {label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false}; CM.ConfigData.SayTime = {label: ['Format Time OFF', 'Format Time ON'], desc: 'Change how time is displayed in statistics', toggle: true, func: function() {CM.Disp.ToggleSayTime();}}; -CM.ConfigData.Scale = {label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Scientific Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}}; +CM.ConfigData.Scale = {label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Engineering Notation', 'Scientific Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}}; /******** * Data * @@ -649,17 +649,29 @@ CM.Disp.Beautify = function(num, frac) { negative = true; } - for (var i = (CM.Disp.shortScale.length - 1); i >= 0; i--) { - if (i < CM.Disp.metric.length && CM.Config.Scale == 1) { - if (num >= Math.pow(1000, i + 2)) { - answer = (Math.floor(num / Math.pow(1000, i + 1)) / 1000).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + ' ' + CM.Disp.metric[i]; - break; + if (CM.Config.Scale == 4) { + if (num > 9) { + var count = 0; + while (num > 9) { + count++; + num /= 10; } + answer = Math.round(num * 1000) / 1000 + 'E+' + count; } - else if (CM.Config.Scale > 1) { - if (num >= Math.pow(1000, i + 2)) { - answer = (Math.floor(num / Math.pow(1000, i + 1)) / 1000) + (CM.Config.Scale == 2 ? (' ' + CM.Disp.shortScale[i]) : ('e+' + ((i + 2) * 3))); - break; + } + else { + for (var i = (CM.Disp.shortScale.length - 1); i >= 0; i--) { + if (i < CM.Disp.metric.length && CM.Config.Scale == 1) { + if (num >= Math.pow(1000, i + 2)) { + answer = (Math.round(num / Math.pow(1000, i + 1)) / 1000).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + ' ' + CM.Disp.metric[i]; + break; + } + } + else if (CM.Config.Scale > 1) { + if (num >= Math.pow(1000, i + 2)) { + answer = (Math.round(num / Math.pow(1000, i + 1)) / 1000) + (CM.Config.Scale == 2 ? (' ' + CM.Disp.shortScale[i]) : ('E+' + ((i + 2) * 3))); + break; + } } } } diff --git a/src/Config.js b/src/Config.js index 56e78ce..f449329 100644 --- a/src/Config.js +++ b/src/Config.js @@ -146,5 +146,5 @@ CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false}; CM.ConfigData.TimeFormat = {label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false}; CM.ConfigData.SayTime = {label: ['Format Time OFF', 'Format Time ON'], desc: 'Change how time is displayed in statistics', toggle: true, func: function() {CM.Disp.ToggleSayTime();}}; -CM.ConfigData.Scale = {label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Scientific Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}}; +CM.ConfigData.Scale = {label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Engineering Notation', 'Scientific Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}}; diff --git a/src/Disp.js b/src/Disp.js index bce020f..e4f96bc 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -97,17 +97,29 @@ CM.Disp.Beautify = function(num, frac) { negative = true; } - for (var i = (CM.Disp.shortScale.length - 1); i >= 0; i--) { - if (i < CM.Disp.metric.length && CM.Config.Scale == 1) { - if (num >= Math.pow(1000, i + 2)) { - answer = (Math.floor(num / Math.pow(1000, i + 1)) / 1000).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + ' ' + CM.Disp.metric[i]; - break; + if (CM.Config.Scale == 4) { + if (num > 9) { + var count = 0; + while (num > 9) { + count++; + num /= 10; } + answer = Math.round(num * 1000) / 1000 + 'E+' + count; } - else if (CM.Config.Scale > 1) { - if (num >= Math.pow(1000, i + 2)) { - answer = (Math.floor(num / Math.pow(1000, i + 1)) / 1000) + (CM.Config.Scale == 2 ? (' ' + CM.Disp.shortScale[i]) : ('e+' + ((i + 2) * 3))); - break; + } + else { + for (var i = (CM.Disp.shortScale.length - 1); i >= 0; i--) { + if (i < CM.Disp.metric.length && CM.Config.Scale == 1) { + if (num >= Math.pow(1000, i + 2)) { + answer = (Math.round(num / Math.pow(1000, i + 1)) / 1000).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + ' ' + CM.Disp.metric[i]; + break; + } + } + else if (CM.Config.Scale > 1) { + if (num >= Math.pow(1000, i + 2)) { + answer = (Math.round(num / Math.pow(1000, i + 1)) / 1000) + (CM.Config.Scale == 2 ? (' ' + CM.Disp.shortScale[i]) : ('E+' + ((i + 2) * 3))); + break; + } } } } From cd1ea8269b37b60af9e5c9afec8e1f68948be87d Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Fri, 13 Jul 2018 00:01:35 -0400 Subject: [PATCH 06/11] Fixed silly bug with Scientific Notation --- CookieMonster.js | 2 +- src/Disp.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index c1b7a9b..378b6b4 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -652,7 +652,7 @@ CM.Disp.Beautify = function(num, frac) { if (CM.Config.Scale == 4) { if (num > 9) { var count = 0; - while (num > 9) { + while (num >= 10) { count++; num /= 10; } diff --git a/src/Disp.js b/src/Disp.js index e4f96bc..d763492 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -100,7 +100,7 @@ CM.Disp.Beautify = function(num, frac) { if (CM.Config.Scale == 4) { if (num > 9) { var count = 0; - while (num > 9) { + while (num >= 10) { count++; num /= 10; } From 7310905ae2a4ede0a7476bb804645dc67d0028fd Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Thu, 19 Jul 2018 21:27:34 -0400 Subject: [PATCH 07/11] Fixed Scientific Notation and Engineering Notation to be more correct --- CookieMonster.js | 42 +++++++++++++++++++++++++++++++++++++----- src/Config.js | 2 +- src/Disp.js | 40 ++++++++++++++++++++++++++++++++++++---- 3 files changed, 74 insertions(+), 10 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 378b6b4..59cd761 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -540,7 +540,7 @@ CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false}; CM.ConfigData.TimeFormat = {label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false}; CM.ConfigData.SayTime = {label: ['Format Time OFF', 'Format Time ON'], desc: 'Change how time is displayed in statistics', toggle: true, func: function() {CM.Disp.ToggleSayTime();}}; -CM.ConfigData.Scale = {label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Engineering Notation', 'Scientific Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}}; +CM.ConfigData.Scale = {label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Scientific Notation', 'Engineering Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}}; /******** * Data * @@ -649,8 +649,8 @@ CM.Disp.Beautify = function(num, frac) { negative = true; } - if (CM.Config.Scale == 4) { - if (num > 9) { + if (CM.Config.Scale == 3) { + if (num >= 10) { var count = 0; while (num >= 10) { count++; @@ -658,6 +658,38 @@ CM.Disp.Beautify = function(num, frac) { } answer = Math.round(num * 1000) / 1000 + 'E+' + count; } + else if (num < 1 && num != 0) { + var count = 0; + while (num < 1) { + count++; + num *= 10; + } + answer = Math.round(num * 1000) / 1000 + 'E-' + count; + } + else { + answer = Math.round(num * 1000) / 1000 + 'E+0'; + } + } + else if (CM.Config.Scale == 4) { + if (num >= 1000) { + var count = 0; + while (num >= 1000) { + count++; + num /= 1000; + } + answer = Math.round(num * 1000) / 1000 + 'E+' + (count * 3); + } + else if (num < 1 && num != 0) { + var count = 0; + while (num < 1) { + count++; + num *= 1000; + } + answer = Math.round(num * 1000) / 1000 + 'E-' + (count * 3); + } + else { + answer = Math.round(num * 1000) / 1000 + 'E+0'; + } } else { for (var i = (CM.Disp.shortScale.length - 1); i >= 0; i--) { @@ -667,9 +699,9 @@ CM.Disp.Beautify = function(num, frac) { break; } } - else if (CM.Config.Scale > 1) { + else if (CM.Config.Scale == 2) { if (num >= Math.pow(1000, i + 2)) { - answer = (Math.round(num / Math.pow(1000, i + 1)) / 1000) + (CM.Config.Scale == 2 ? (' ' + CM.Disp.shortScale[i]) : ('E+' + ((i + 2) * 3))); + answer = (Math.round(num / Math.pow(1000, i + 1)) / 1000) + ' ' + CM.Disp.shortScale[i]; break; } } diff --git a/src/Config.js b/src/Config.js index f449329..80525d7 100644 --- a/src/Config.js +++ b/src/Config.js @@ -146,5 +146,5 @@ CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false}; CM.ConfigData.TimeFormat = {label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false}; CM.ConfigData.SayTime = {label: ['Format Time OFF', 'Format Time ON'], desc: 'Change how time is displayed in statistics', toggle: true, func: function() {CM.Disp.ToggleSayTime();}}; -CM.ConfigData.Scale = {label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Engineering Notation', 'Scientific Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}}; +CM.ConfigData.Scale = {label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Scientific Notation', 'Engineering Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}}; diff --git a/src/Disp.js b/src/Disp.js index d763492..2fa32c7 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -97,8 +97,8 @@ CM.Disp.Beautify = function(num, frac) { negative = true; } - if (CM.Config.Scale == 4) { - if (num > 9) { + if (CM.Config.Scale == 3) { + if (num >= 10) { var count = 0; while (num >= 10) { count++; @@ -106,6 +106,38 @@ CM.Disp.Beautify = function(num, frac) { } answer = Math.round(num * 1000) / 1000 + 'E+' + count; } + else if (num < 1 && num != 0) { + var count = 0; + while (num < 1) { + count++; + num *= 10; + } + answer = Math.round(num * 1000) / 1000 + 'E-' + count; + } + else { + answer = Math.round(num * 1000) / 1000 + 'E+0'; + } + } + else if (CM.Config.Scale == 4) { + if (num >= 1000) { + var count = 0; + while (num >= 1000) { + count++; + num /= 1000; + } + answer = Math.round(num * 1000) / 1000 + 'E+' + (count * 3); + } + else if (num < 1 && num != 0) { + var count = 0; + while (num < 1) { + count++; + num *= 1000; + } + answer = Math.round(num * 1000) / 1000 + 'E-' + (count * 3); + } + else { + answer = Math.round(num * 1000) / 1000 + 'E+0'; + } } else { for (var i = (CM.Disp.shortScale.length - 1); i >= 0; i--) { @@ -115,9 +147,9 @@ CM.Disp.Beautify = function(num, frac) { break; } } - else if (CM.Config.Scale > 1) { + else if (CM.Config.Scale == 2) { if (num >= Math.pow(1000, i + 2)) { - answer = (Math.round(num / Math.pow(1000, i + 1)) / 1000) + (CM.Config.Scale == 2 ? (' ' + CM.Disp.shortScale[i]) : ('E+' + ((i + 2) * 3))); + answer = (Math.round(num / Math.pow(1000, i + 1)) / 1000) + ' ' + CM.Disp.shortScale[i]; break; } } From 62dae6560637f9b6644f4b2bbaa4e8d44521acd6 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Sat, 21 Jul 2018 08:30:52 -0400 Subject: [PATCH 08/11] Fix calculation error due to timing being off by a little bit (happens more often on slower computers) (Issue #200) --- CookieMonster.js | 12 ++++++------ src/Main.js | 4 ++-- src/Sim.js | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 59cd761..e4d7d43 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2565,10 +2565,10 @@ CM.ReplaceNative = function() { Beautify = CM.Disp.Beautify; CM.Backup.CalculateGains = Game.CalculateGains; + eval('CM.Backup.CalculateGainsMod = ' + Game.CalculateGains.toString().split('ages\');').join('ages\');CM.Sim.DateAges = Date.now();').split('var day').join('CM.Sim.DateCentury = Date.now();var day')); Game.CalculateGains = function() { - CM.Backup.CalculateGains(); + CM.Backup.CalculateGainsMod(); CM.Sim.DoSims = 1; - CM.Sim.Date = Date.now(); } CM.Backup.tooltip = {}; @@ -3008,9 +3008,9 @@ CM.Sim.CalculateGains = function() { else if (godLvl == 3) mult *= 1.05; var godLvl = Game.hasGod('ages'); - if (godLvl == 1) mult *= 1 + 0.15 * Math.sin((CM.Sim.Date / 1000 / (60 * 60 * 3)) * Math.PI * 2); - else if (godLvl == 2) mult *= 1 + 0.15 * Math.sin((CM.Sim.Date / 1000 / (60 * 60 * 12)) * Math.PI*2); - else if (godLvl == 3) mult *= 1 + 0.15 * Math.sin((CM.Sim.Date / 1000 / (60 * 60 * 24)) * Math.PI*2); + if (godLvl == 1) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 3)) * Math.PI * 2); + else if (godLvl == 2) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 12)) * Math.PI*2); + else if (godLvl == 3) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 24)) * Math.PI*2); var godLvl = Game.hasGod('decadence'); if (godLvl == 1) buildMult *= 0.93; @@ -3079,7 +3079,7 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('Ant larva')) eggMult *= 1.01; if (CM.Sim.Has('Century egg')) { // The boost increases a little every day, with diminishing returns up to +10% on the 100th day - var day = Math.floor((CM.Sim.Date - Game.startDate) / 1000 / 10) * 10 / 60 / 60 / 24; + var day = Math.floor((CM.Sim.DateCentury - Game.startDate) / 1000 / 10) * 10 / 60 / 60 / 24; day = Math.min(day, 100); CM.Cache.CentEgg = 1 + (1 - Math.pow(1 - day / 100, 3)) * 0.1; eggMult *= CM.Cache.CentEgg; diff --git a/src/Main.js b/src/Main.js index fb6793c..341f3a1 100644 --- a/src/Main.js +++ b/src/Main.js @@ -7,10 +7,10 @@ CM.ReplaceNative = function() { Beautify = CM.Disp.Beautify; CM.Backup.CalculateGains = Game.CalculateGains; + eval('CM.Backup.CalculateGainsMod = ' + Game.CalculateGains.toString().split('ages\');').join('ages\');CM.Sim.DateAges = Date.now();').split('var day').join('CM.Sim.DateCentury = Date.now();var day')); Game.CalculateGains = function() { - CM.Backup.CalculateGains(); + CM.Backup.CalculateGainsMod(); CM.Sim.DoSims = 1; - CM.Sim.Date = Date.now(); } CM.Backup.tooltip = {}; diff --git a/src/Sim.js b/src/Sim.js index 0da872e..4655f32 100644 --- a/src/Sim.js +++ b/src/Sim.js @@ -195,9 +195,9 @@ CM.Sim.CalculateGains = function() { else if (godLvl == 3) mult *= 1.05; var godLvl = Game.hasGod('ages'); - if (godLvl == 1) mult *= 1 + 0.15 * Math.sin((CM.Sim.Date / 1000 / (60 * 60 * 3)) * Math.PI * 2); - else if (godLvl == 2) mult *= 1 + 0.15 * Math.sin((CM.Sim.Date / 1000 / (60 * 60 * 12)) * Math.PI*2); - else if (godLvl == 3) mult *= 1 + 0.15 * Math.sin((CM.Sim.Date / 1000 / (60 * 60 * 24)) * Math.PI*2); + if (godLvl == 1) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 3)) * Math.PI * 2); + else if (godLvl == 2) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 12)) * Math.PI*2); + else if (godLvl == 3) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 24)) * Math.PI*2); var godLvl = Game.hasGod('decadence'); if (godLvl == 1) buildMult *= 0.93; @@ -266,7 +266,7 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('Ant larva')) eggMult *= 1.01; if (CM.Sim.Has('Century egg')) { // The boost increases a little every day, with diminishing returns up to +10% on the 100th day - var day = Math.floor((CM.Sim.Date - Game.startDate) / 1000 / 10) * 10 / 60 / 60 / 24; + var day = Math.floor((CM.Sim.DateCentury - Game.startDate) / 1000 / 10) * 10 / 60 / 60 / 24; day = Math.min(day, 100); CM.Cache.CentEgg = 1 + (1 - Math.pow(1 - day / 100, 3)) * 0.1; eggMult *= CM.Cache.CentEgg; From 1c8a9d6bb3f1993cc1d667f069d6e3ef7c34798b Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Wed, 1 Aug 2018 11:28:15 -0400 Subject: [PATCH 09/11] Split the tooltip options --- CookieMonster.js | 20 +++++++++++--------- src/Config.js | 5 +++-- src/Disp.js | 13 +++++++------ src/Main.js | 2 +- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index e4d7d43..26ff7d3 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -531,10 +531,11 @@ CM.ConfigData.SeaSoundURL = {label: 'Season Special Sound URL:', desc: 'URL of t CM.ConfigData.GCTimer = {label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', toggle: true, func: function() {CM.Disp.ToggleGCTimer();}}; CM.ConfigData.Title = {label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns', toggle: true}; CM.ConfigData.Favicon = {label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}}; -CM.ConfigData.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades/grimoire', toggle: true}; -CM.ConfigData.TooltipAmor = {label: ['Tooltip Amortization Information OFF', 'Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; +CM.ConfigData.TooltipBuildUp = {label: ['Buildings/Upgrades Tooltip Information OFF', 'Buildings/Upgrades Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades', toggle: true}; +CM.ConfigData.TooltipAmor = {label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; CM.ConfigData.ToolWarnCaut = {label: ['Tooltip Warning/Caution OFF', 'Tooltip Warning/Caution ON'], desc: 'A warning/caution when buying if it will put the bank under the amount needed for max "Lucky!"/"Lucky!" (Frenzy) rewards', toggle: true, func: function() {CM.Disp.ToggleToolWarnCaut();}}; CM.ConfigData.ToolWarnCautPos = {label: ['Tooltip Warning/Caution Position (Left)', 'Tooltip Warning/Caution Position (Bottom)'], desc: 'Placement of the warning/caution boxes', toggle: false, func: function() {CM.Disp.ToggleToolWarnCautPos();}}; +CM.ConfigData.TooltipGrim = {label: ['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'], desc: 'Extra information in tooltip for grimoire', toggle: true}; CM.ConfigData.ToolWrink = {label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true}; CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!', toggle: true}; CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false}; @@ -1644,10 +1645,11 @@ CM.Disp.AddMenuPref = function(title) { frag.appendChild(listing('Favicon')); frag.appendChild(header('Tooltip')); - frag.appendChild(listing('Tooltip')); + frag.appendChild(listing('TooltipBuildUp')); frag.appendChild(listing('TooltipAmor')); frag.appendChild(listing('ToolWarnCaut')); frag.appendChild(listing('ToolWarnCautPos')); + frag.appendChild(listing('TooltipGrim')); frag.appendChild(listing('ToolWrink')); frag.appendChild(header('Statistics')); @@ -2207,7 +2209,7 @@ CM.Disp.Tooltip = function(type, name) { area.id = 'CMTooltipArea'; l('tooltip').appendChild(area); - if (CM.Config.Tooltip == 1 && (type == 'u' || (type == 'b' && Game.buyMode == 1))) { + if (CM.Config.TooltipBuildUp == 1 && (type == 'u' || (type == 'b' && Game.buyMode == 1))) { l('tooltip').firstChild.style.paddingBottom = '4px'; var tooltip = document.createElement('div'); tooltip.style.border = '1px solid'; @@ -2276,7 +2278,7 @@ CM.Disp.UpdateTooltip = function() { price = Game.Objects[CM.Disp.tooltipName].getPrice(); } bonus = CM.Cache[target][CM.Disp.tooltipName].bonus; - if (CM.Config.Tooltip == 1 && Game.buyMode == 1) { + if (CM.Config.TooltipBuildUp == 1 && Game.buyMode == 1) { l('CMTooltipBorder').className = CM.Disp.colorTextPre + CM.Cache[target][CM.Disp.tooltipName].color; l('CMTooltipPP').textContent = Beautify(CM.Cache[target][CM.Disp.tooltipName].pp, 2); l('CMTooltipPP').className = CM.Disp.colorTextPre + CM.Cache[target][CM.Disp.tooltipName].color; @@ -2285,13 +2287,13 @@ CM.Disp.UpdateTooltip = function() { else { // Upgrades bonus = CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].bonus; price = Game.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].getPrice(); - if (CM.Config.Tooltip == 1) { + if (CM.Config.TooltipBuildUp == 1) { l('CMTooltipBorder').className = CM.Disp.colorTextPre + CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].color; l('CMTooltipPP').textContent = Beautify(CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].pp, 2); l('CMTooltipPP').className = CM.Disp.colorTextPre + CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].color; } } - if (CM.Config.Tooltip == 1 && (CM.Disp.tooltipType != 'b' || Game.buyMode == 1)) { + if (CM.Config.TooltipBuildUp == 1 && (CM.Disp.tooltipType != 'b' || Game.buyMode == 1)) { l('CMTooltipIncome').textContent = Beautify(bonus, 2); var increase = Math.round(bonus / Game.cookiesPs * 10000); @@ -2356,7 +2358,7 @@ CM.Disp.UpdateTooltip = function() { var minigame = Game.Objects['Wizard tower'].minigame; var spellCost = minigame.getSpellCost(minigame.spellsById[CM.Disp.tooltipName]); - if (CM.Config.Tooltip == 1 && spellCost <= minigame.magicM) { + if (CM.Config.TooltipGrim == 1 && spellCost <= minigame.magicM) { l('CMTooltipArea').innerHTML = ''; l('tooltip').firstChild.style.paddingBottom = '4px'; @@ -2805,7 +2807,7 @@ CM.DelayInit = function() { CM.HasReplaceNativeGrimoireLaunch = false; CM.HasReplaceNativeGrimoireDraw = false; -CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 3, AvgClicksHist: 0, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 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'}}; +CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 3, AvgClicksHist: 0, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, TooltipBuildUp: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, TooltipGrim:1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 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'}}; CM.ConfigPrefix = 'CMConfig'; CM.VersionMajor = '2.0106'; diff --git a/src/Config.js b/src/Config.js index 80525d7..a3f353e 100644 --- a/src/Config.js +++ b/src/Config.js @@ -137,10 +137,11 @@ CM.ConfigData.SeaSoundURL = {label: 'Season Special Sound URL:', desc: 'URL of t CM.ConfigData.GCTimer = {label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', toggle: true, func: function() {CM.Disp.ToggleGCTimer();}}; CM.ConfigData.Title = {label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns', toggle: true}; CM.ConfigData.Favicon = {label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}}; -CM.ConfigData.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades/grimoire', toggle: true}; -CM.ConfigData.TooltipAmor = {label: ['Tooltip Amortization Information OFF', 'Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; +CM.ConfigData.TooltipBuildUp = {label: ['Buildings/Upgrades Tooltip Information OFF', 'Buildings/Upgrades Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades', toggle: true}; +CM.ConfigData.TooltipAmor = {label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; CM.ConfigData.ToolWarnCaut = {label: ['Tooltip Warning/Caution OFF', 'Tooltip Warning/Caution ON'], desc: 'A warning/caution when buying if it will put the bank under the amount needed for max "Lucky!"/"Lucky!" (Frenzy) rewards', toggle: true, func: function() {CM.Disp.ToggleToolWarnCaut();}}; CM.ConfigData.ToolWarnCautPos = {label: ['Tooltip Warning/Caution Position (Left)', 'Tooltip Warning/Caution Position (Bottom)'], desc: 'Placement of the warning/caution boxes', toggle: false, func: function() {CM.Disp.ToggleToolWarnCautPos();}}; +CM.ConfigData.TooltipGrim = {label: ['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'], desc: 'Extra information in tooltip for grimoire', toggle: true}; CM.ConfigData.ToolWrink = {label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true}; CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!', toggle: true}; CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false}; diff --git a/src/Disp.js b/src/Disp.js index 2fa32c7..c1c2edf 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1092,10 +1092,11 @@ CM.Disp.AddMenuPref = function(title) { frag.appendChild(listing('Favicon')); frag.appendChild(header('Tooltip')); - frag.appendChild(listing('Tooltip')); + frag.appendChild(listing('TooltipBuildUp')); frag.appendChild(listing('TooltipAmor')); frag.appendChild(listing('ToolWarnCaut')); frag.appendChild(listing('ToolWarnCautPos')); + frag.appendChild(listing('TooltipGrim')); frag.appendChild(listing('ToolWrink')); frag.appendChild(header('Statistics')); @@ -1655,7 +1656,7 @@ CM.Disp.Tooltip = function(type, name) { area.id = 'CMTooltipArea'; l('tooltip').appendChild(area); - if (CM.Config.Tooltip == 1 && (type == 'u' || (type == 'b' && Game.buyMode == 1))) { + if (CM.Config.TooltipBuildUp == 1 && (type == 'u' || (type == 'b' && Game.buyMode == 1))) { l('tooltip').firstChild.style.paddingBottom = '4px'; var tooltip = document.createElement('div'); tooltip.style.border = '1px solid'; @@ -1724,7 +1725,7 @@ CM.Disp.UpdateTooltip = function() { price = Game.Objects[CM.Disp.tooltipName].getPrice(); } bonus = CM.Cache[target][CM.Disp.tooltipName].bonus; - if (CM.Config.Tooltip == 1 && Game.buyMode == 1) { + if (CM.Config.TooltipBuildUp == 1 && Game.buyMode == 1) { l('CMTooltipBorder').className = CM.Disp.colorTextPre + CM.Cache[target][CM.Disp.tooltipName].color; l('CMTooltipPP').textContent = Beautify(CM.Cache[target][CM.Disp.tooltipName].pp, 2); l('CMTooltipPP').className = CM.Disp.colorTextPre + CM.Cache[target][CM.Disp.tooltipName].color; @@ -1733,13 +1734,13 @@ CM.Disp.UpdateTooltip = function() { else { // Upgrades bonus = CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].bonus; price = Game.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].getPrice(); - if (CM.Config.Tooltip == 1) { + if (CM.Config.TooltipBuildUp == 1) { l('CMTooltipBorder').className = CM.Disp.colorTextPre + CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].color; l('CMTooltipPP').textContent = Beautify(CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].pp, 2); l('CMTooltipPP').className = CM.Disp.colorTextPre + CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].color; } } - if (CM.Config.Tooltip == 1 && (CM.Disp.tooltipType != 'b' || Game.buyMode == 1)) { + if (CM.Config.TooltipBuildUp == 1 && (CM.Disp.tooltipType != 'b' || Game.buyMode == 1)) { l('CMTooltipIncome').textContent = Beautify(bonus, 2); var increase = Math.round(bonus / Game.cookiesPs * 10000); @@ -1804,7 +1805,7 @@ CM.Disp.UpdateTooltip = function() { var minigame = Game.Objects['Wizard tower'].minigame; var spellCost = minigame.getSpellCost(minigame.spellsById[CM.Disp.tooltipName]); - if (CM.Config.Tooltip == 1 && spellCost <= minigame.magicM) { + if (CM.Config.TooltipGrim == 1 && spellCost <= minigame.magicM) { l('CMTooltipArea').innerHTML = ''; l('tooltip').firstChild.style.paddingBottom = '4px'; diff --git a/src/Main.js b/src/Main.js index 341f3a1..0ba877b 100644 --- a/src/Main.js +++ b/src/Main.js @@ -247,7 +247,7 @@ CM.DelayInit = function() { CM.HasReplaceNativeGrimoireLaunch = false; CM.HasReplaceNativeGrimoireDraw = false; -CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 3, AvgClicksHist: 0, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 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'}}; +CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 3, AvgClicksHist: 0, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, TooltipBuildUp: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, TooltipGrim:1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 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'}}; CM.ConfigPrefix = 'CMConfig'; CM.VersionMajor = '2.0106'; From a393c73eec35c5214ded491def4d1381091f2eca Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Wed, 1 Aug 2018 11:34:27 -0400 Subject: [PATCH 10/11] Change to Version 2.0109.1 --- CookieMonster.js | 4 ++-- src/Main.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 26ff7d3..20e52f6 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2810,8 +2810,8 @@ CM.HasReplaceNativeGrimoireDraw = false; CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 3, AvgClicksHist: 0, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, TooltipBuildUp: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, TooltipGrim:1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 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'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '2.0106'; -CM.VersionMinor = '2'; +CM.VersionMajor = '2.0109'; +CM.VersionMinor = '1'; /******* * Sim * diff --git a/src/Main.js b/src/Main.js index 0ba877b..55277b3 100644 --- a/src/Main.js +++ b/src/Main.js @@ -250,6 +250,6 @@ CM.HasReplaceNativeGrimoireDraw = false; CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 0, CPSMode: 1, AvgCPSHist: 3, AvgClicksHist: 0, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, TooltipBuildUp: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, TooltipGrim:1, ToolWrink: 1, Stats: 1, UpStats: 1, TimeFormat: 0, SayTime: 1, Scale: 2, StatsPref: {Lucky: 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'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '2.0106'; -CM.VersionMinor = '2'; +CM.VersionMajor = '2.0109'; +CM.VersionMinor = '1'; From 909806b0f9f447a1a02768118a019bb1cd7e5180 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Wed, 1 Aug 2018 19:43:10 -0400 Subject: [PATCH 11/11] Fix to work with Version 2.0109 of CC (Issue #208) --- CookieMonster.js | 36 +++++++++++++++++++++--------------- src/Sim.js | 36 +++++++++++++++++++++--------------- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 20e52f6..731660e 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2863,8 +2863,8 @@ CM.Sim.BuildingSell = function(basePrice, start, free, amount, emuAura) { var price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free)); price = Game.modifyBuildingPrice(null, price); price = Math.ceil(price); - var giveBack = 0.5; - if (Game.hasAura('Earth Shatterer') || emuAura) giveBack=0.85; + var giveBack = 0.25; + if (Game.hasAura('Earth Shatterer') || emuAura) giveBack=0.5; price = Math.floor(price * giveBack); if (start > 0) { moni += price; @@ -3052,19 +3052,24 @@ CM.Sim.CalculateGains = function() { } // TODO Store minigame buffs? milkMult *= Game.eff('milk'); - - if (CM.Sim.Has('Kitten helpers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); - if (CM.Sim.Has('Kitten workers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.125 * milkMult); - if (CM.Sim.Has('Kitten engineers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult); - if (CM.Sim.Has('Kitten overseers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult); - if (CM.Sim.Has('Kitten managers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten accountants')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten specialists')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten experts')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten consultants')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten assistants to the regional manager')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult); - if (CM.Sim.Has('Kitten marketeers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult); - if (CM.Sim.Has('Kitten angels')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); + + var catMult = 1; + + if (CM.Sim.Has('Kitten helpers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); + if (CM.Sim.Has('Kitten workers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.125 * milkMult); + if (CM.Sim.Has('Kitten engineers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult); + if (CM.Sim.Has('Kitten overseers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult); + if (CM.Sim.Has('Kitten managers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten accountants')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten specialists')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten experts')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten consultants')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten assistants to the regional manager')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult); + if (CM.Sim.Has('Kitten marketeers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult); + if (CM.Sim.Has('Kitten analysts')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.125 * milkMult); + if (CM.Sim.Has('Kitten angels')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); + + mult *= catMult; var eggMult = 1; if (CM.Sim.Has('Chicken egg')) eggMult *= 1.01; @@ -3174,6 +3179,7 @@ CM.Sim.CheckOtherAchiev = function() { if (minAmount >= 350) CM.Sim.Win('Tricentennial and a half'); if (minAmount >= 400) CM.Sim.Win('Quadricentennial'); if (minAmount >= 450) CM.Sim.Win('Quadricentennial and a half'); + if (minAmount >= 500) CM.Sim.Win('Quincentennial'); if (buildingsOwned >= 100) CM.Sim.Win('Builder'); if (buildingsOwned >= 500) CM.Sim.Win('Architect'); diff --git a/src/Sim.js b/src/Sim.js index 4655f32..707af7e 100644 --- a/src/Sim.js +++ b/src/Sim.js @@ -48,8 +48,8 @@ CM.Sim.BuildingSell = function(basePrice, start, free, amount, emuAura) { var price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free)); price = Game.modifyBuildingPrice(null, price); price = Math.ceil(price); - var giveBack = 0.5; - if (Game.hasAura('Earth Shatterer') || emuAura) giveBack=0.85; + var giveBack = 0.25; + if (Game.hasAura('Earth Shatterer') || emuAura) giveBack=0.5; price = Math.floor(price * giveBack); if (start > 0) { moni += price; @@ -237,19 +237,24 @@ CM.Sim.CalculateGains = function() { } // TODO Store minigame buffs? milkMult *= Game.eff('milk'); - - if (CM.Sim.Has('Kitten helpers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); - if (CM.Sim.Has('Kitten workers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.125 * milkMult); - if (CM.Sim.Has('Kitten engineers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult); - if (CM.Sim.Has('Kitten overseers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult); - if (CM.Sim.Has('Kitten managers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten accountants')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten specialists')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten experts')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten consultants')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten assistants to the regional manager')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult); - if (CM.Sim.Has('Kitten marketeers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult); - if (CM.Sim.Has('Kitten angels')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); + + var catMult = 1; + + if (CM.Sim.Has('Kitten helpers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); + if (CM.Sim.Has('Kitten workers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.125 * milkMult); + if (CM.Sim.Has('Kitten engineers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult); + if (CM.Sim.Has('Kitten overseers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult); + if (CM.Sim.Has('Kitten managers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten accountants')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten specialists')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten experts')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten consultants')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten assistants to the regional manager')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult); + if (CM.Sim.Has('Kitten marketeers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult); + if (CM.Sim.Has('Kitten analysts')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.125 * milkMult); + if (CM.Sim.Has('Kitten angels')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); + + mult *= catMult; var eggMult = 1; if (CM.Sim.Has('Chicken egg')) eggMult *= 1.01; @@ -359,6 +364,7 @@ CM.Sim.CheckOtherAchiev = function() { if (minAmount >= 350) CM.Sim.Win('Tricentennial and a half'); if (minAmount >= 400) CM.Sim.Win('Quadricentennial'); if (minAmount >= 450) CM.Sim.Win('Quadricentennial and a half'); + if (minAmount >= 500) CM.Sim.Win('Quincentennial'); if (buildingsOwned >= 100) CM.Sim.Win('Builder'); if (buildingsOwned >= 500) CM.Sim.Win('Architect');