From e877f05a064f12382d0b46bdbac615dd78ffd36f Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Tue, 26 Aug 2014 13:10:56 -0400 Subject: [PATCH 01/26] Version change to the new version of Cookie Clicker in beta plus some preliminary fixes --- CookieMonster.js | 52 ++++++++++++++++++++++++++---------------------- src/Main.js | 4 ++-- src/Sim.js | 48 ++++++++++++++++++++++++-------------------- 3 files changed, 56 insertions(+), 48 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 755c754..81abc4a 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1912,8 +1912,8 @@ CM.Init = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.0465'; -CM.VersionMinor = '10'; +CM.VersionMajor = '1.0501'; +CM.VersionMinor = '1'; /******* * Sim * @@ -1927,6 +1927,7 @@ CM.Sim.BuildingGetPrice = function (basePrice, start, increase) { if (Game.Has('Season savings')) price *= 0.99; if (Game.Has('Santa\'s dominion')) price *= 0.99; if (Game.Has('Faberge egg')) price *= 0.99; + if (Game.Has('Divine discount')) price *= 0.99; totalPrice += Math.ceil(price); count++; } @@ -1952,6 +1953,7 @@ CM.Sim.CookNeedPrest = function(prestige) { CM.Sim.CopyData = function() { // Other variables + CM.Sim.heavenlyCookies = Game.heavenlyCookies; CM.Sim.prestige = Game.prestige['Heavenly chips']; CM.Sim.UpgradesOwned = Game.UpgradesOwned; CM.Sim.pledges = Game.pledges; @@ -1991,25 +1993,6 @@ CM.Sim.CopyData = function() { CM.Sim.CalculateGains = function() { CM.Sim.cookiesPs = 0; var mult = 1; - for (var i in CM.Sim.Upgrades) { - var me = CM.Sim.Upgrades[i]; - if (me.bought > 0) { - if (Game.Upgrades[i].type == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) mult += Game.Upgrades[i].power * 0.01; - } - } - mult += CM.Sim.Has('Specialized chocolate chips') * 0.01; - mult += CM.Sim.Has('Designer cocoa beans') * 0.02; - mult += CM.Sim.Has('Underworld ovens') * 0.03; - mult += CM.Sim.Has('Exotic nuts') * 0.04; - mult += CM.Sim.Has('Arcane sugar') * 0.05; - - if (CM.Sim.Has('Increased merriness')) mult += 0.15; - if (CM.Sim.Has('Improved jolliness')) mult += 0.15; - if (CM.Sim.Has('A lump of coal')) mult += 0.01; - if (CM.Sim.Has('An itchy sweater')) mult += 0.01; - if (CM.Sim.Has('Santa\'s dominion')) mult += 0.5; - - if (CM.Sim.Has('Santa\'s legacy')) mult += (Game.santaLevel + 1) * 0.1; var heavenlyMult = 0; if (CM.Sim.Has('Heavenly chip secret')) heavenlyMult += 0.05; @@ -2017,14 +2000,35 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('Heavenly bakery')) heavenlyMult += 0.25; if (CM.Sim.Has('Heavenly confectionery')) heavenlyMult += 0.25; if (CM.Sim.Has('Heavenly key')) heavenlyMult += 0.25; - mult += parseFloat(CM.Sim.prestige) * 0.02 * heavenlyMult; + mult += parseFloat(Game.heavenlyCookies) *0.1 * heavenlyMult; + + for (var i in CM.Sim.Upgrades) { + var me = CM.Sim.Upgrades[i]; + if (me.bought > 0) { + if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) mult *= (1 + (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power) * 0.01); + } + } + if (CM.Sim.Has('Specialized chocolate chips')) mult *= 1.01; + if (CM.Sim.Has('Designer cocoa beans')) mult *= 1.02; + if (CM.Sim.Has('Underworld ovens')) mult *= 1.03; + if (CM.Sim.Has('Exotic nuts')) mult *= 1.04; + if (CM.Sim.Has('Arcane sugar')) mult *= 1.05; + + if (CM.Sim.Has('Increased merriness')) mult *= 1.15; + if (CM.Sim.Has('Improved jolliness')) mult *= 1.15; + if (CM.Sim.Has('A lump of coal')) mult *= 1.01; + if (CM.Sim.Has('An itchy sweater')) mult *= 1.01; + if (CM.Sim.Has('Santa\'s dominion')) mult *= 1.2; + + if (CM.Sim.Has('Santa\'s legacy')) mult *= (Game.santaLevel + 1) * 0.05; for (var i in CM.Sim.Objects) { var me = CM.Sim.Objects[i]; - CM.Sim.cookiesPs += me.amount * (typeof(me.cps) == 'function' ? me.cps() : me.cps); + CM.Sim.cookiesPs += me.amount * (typeof(me.cps) == 'function' ? me.cps(me) : me.cps); } if (CM.Sim.Has('"egg"')) CM.Sim.cookiesPs += 9; // "egg" + if (CM.Sim.Has('"god"')) CM.Sim.cookiesPs += 9;// "god" var milkMult = CM.Sim.Has('Santa\'s milk and cookies') ? 1.05 : 1; if (CM.Sim.Has('Kitten helpers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.05 * milkMult); @@ -2032,6 +2036,7 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('Kitten engineers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); if (CM.Sim.Has('Kitten overseers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); if (CM.Sim.Has('Kitten managers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten angels')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); var eggMult = 0; if (CM.Sim.Has('Chicken egg')) eggMult++; @@ -2287,7 +2292,6 @@ CM.Sim.ResetBonus = function() { 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'); diff --git a/src/Main.js b/src/Main.js index 4984d94..2ebf8e8 100644 --- a/src/Main.js +++ b/src/Main.js @@ -128,6 +128,6 @@ CM.Init = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.0465'; -CM.VersionMinor = '10'; +CM.VersionMajor = '1.0501'; +CM.VersionMinor = '1'; diff --git a/src/Sim.js b/src/Sim.js index dbc5bcd..ecad81c 100644 --- a/src/Sim.js +++ b/src/Sim.js @@ -10,6 +10,7 @@ CM.Sim.BuildingGetPrice = function (basePrice, start, increase) { if (Game.Has('Season savings')) price *= 0.99; if (Game.Has('Santa\'s dominion')) price *= 0.99; if (Game.Has('Faberge egg')) price *= 0.99; + if (Game.Has('Divine discount')) price *= 0.99; totalPrice += Math.ceil(price); count++; } @@ -35,6 +36,7 @@ CM.Sim.CookNeedPrest = function(prestige) { CM.Sim.CopyData = function() { // Other variables + CM.Sim.heavenlyCookies = Game.heavenlyCookies; CM.Sim.prestige = Game.prestige['Heavenly chips']; CM.Sim.UpgradesOwned = Game.UpgradesOwned; CM.Sim.pledges = Game.pledges; @@ -74,25 +76,6 @@ CM.Sim.CopyData = function() { CM.Sim.CalculateGains = function() { CM.Sim.cookiesPs = 0; var mult = 1; - for (var i in CM.Sim.Upgrades) { - var me = CM.Sim.Upgrades[i]; - if (me.bought > 0) { - if (Game.Upgrades[i].type == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) mult += Game.Upgrades[i].power * 0.01; - } - } - mult += CM.Sim.Has('Specialized chocolate chips') * 0.01; - mult += CM.Sim.Has('Designer cocoa beans') * 0.02; - mult += CM.Sim.Has('Underworld ovens') * 0.03; - mult += CM.Sim.Has('Exotic nuts') * 0.04; - mult += CM.Sim.Has('Arcane sugar') * 0.05; - - if (CM.Sim.Has('Increased merriness')) mult += 0.15; - if (CM.Sim.Has('Improved jolliness')) mult += 0.15; - if (CM.Sim.Has('A lump of coal')) mult += 0.01; - if (CM.Sim.Has('An itchy sweater')) mult += 0.01; - if (CM.Sim.Has('Santa\'s dominion')) mult += 0.5; - - if (CM.Sim.Has('Santa\'s legacy')) mult += (Game.santaLevel + 1) * 0.1; var heavenlyMult = 0; if (CM.Sim.Has('Heavenly chip secret')) heavenlyMult += 0.05; @@ -100,14 +83,35 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('Heavenly bakery')) heavenlyMult += 0.25; if (CM.Sim.Has('Heavenly confectionery')) heavenlyMult += 0.25; if (CM.Sim.Has('Heavenly key')) heavenlyMult += 0.25; - mult += parseFloat(CM.Sim.prestige) * 0.02 * heavenlyMult; + mult += parseFloat(Game.heavenlyCookies) *0.1 * heavenlyMult; + + for (var i in CM.Sim.Upgrades) { + var me = CM.Sim.Upgrades[i]; + if (me.bought > 0) { + if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) mult *= (1 + (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power) * 0.01); + } + } + if (CM.Sim.Has('Specialized chocolate chips')) mult *= 1.01; + if (CM.Sim.Has('Designer cocoa beans')) mult *= 1.02; + if (CM.Sim.Has('Underworld ovens')) mult *= 1.03; + if (CM.Sim.Has('Exotic nuts')) mult *= 1.04; + if (CM.Sim.Has('Arcane sugar')) mult *= 1.05; + + if (CM.Sim.Has('Increased merriness')) mult *= 1.15; + if (CM.Sim.Has('Improved jolliness')) mult *= 1.15; + if (CM.Sim.Has('A lump of coal')) mult *= 1.01; + if (CM.Sim.Has('An itchy sweater')) mult *= 1.01; + if (CM.Sim.Has('Santa\'s dominion')) mult *= 1.2; + + if (CM.Sim.Has('Santa\'s legacy')) mult *= (Game.santaLevel + 1) * 0.05; for (var i in CM.Sim.Objects) { var me = CM.Sim.Objects[i]; - CM.Sim.cookiesPs += me.amount * (typeof(me.cps) == 'function' ? me.cps() : me.cps); + CM.Sim.cookiesPs += me.amount * (typeof(me.cps) == 'function' ? me.cps(me) : me.cps); } if (CM.Sim.Has('"egg"')) CM.Sim.cookiesPs += 9; // "egg" + if (CM.Sim.Has('"god"')) CM.Sim.cookiesPs += 9;// "god" var milkMult = CM.Sim.Has('Santa\'s milk and cookies') ? 1.05 : 1; if (CM.Sim.Has('Kitten helpers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.05 * milkMult); @@ -115,6 +119,7 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('Kitten engineers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); if (CM.Sim.Has('Kitten overseers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); if (CM.Sim.Has('Kitten managers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + if (CM.Sim.Has('Kitten angels')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); var eggMult = 0; if (CM.Sim.Has('Chicken egg')) eggMult++; @@ -370,7 +375,6 @@ CM.Sim.ResetBonus = function() { 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'); From 28c5909e1f854a882bbc02a52f29da3552097a55 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Tue, 26 Aug 2014 21:39:17 -0400 Subject: [PATCH 02/26] Fixed to work with beta --- CookieMonster.js | 181 +++++++++++++++++++++++++++-------------------- src/Config.js | 2 +- src/Disp.js | 57 ++++++++------- src/Main.js | 67 ++++++++++-------- src/Sim.js | 55 ++++++++------ 5 files changed, 208 insertions(+), 154 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index c4d2f7d..1c9f4ec 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -305,7 +305,7 @@ CM.ConfigData.ToolWarnCaut = {label: ['Tooltip Warning/Caution OFF', 'Tooltip Wa CM.ConfigData.ToolWarnCautPos = {label: ['Tooltip Warning/Caution Position (Left)', 'Tooltip Warning/Caution Position (Bottom)'], desc: 'Placement of the warning/caution boxes', func: function() {CM.Disp.ToggleToolWarnCautPos();}}; CM.ConfigData.ToolWrink = {label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it'}; CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!'}; -CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 3 seconds'}; +CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds'}; CM.ConfigData.SayTime = {label: ['Format Time OFF', 'Format Time ON'], desc: 'Change how time is displayed in statistics', 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', func: function() {CM.Disp.RefreshScale();}}; @@ -709,20 +709,25 @@ CM.Disp.UpdateTimerBar = function() { } CM.Disp.UpdateBotTimerBarDisplay = function() { - if (CM.Config.BotBar == 1 && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { - CM.Disp.BotBar.style.bottom = '48px'; - l('game').style.bottom = '104px'; - } - else if (CM.Config.BotBar == 1) { - CM.Disp.BotBar.style.bottom = '0px'; - l('game').style.bottom = '56px'; - } - else if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { - l('game').style.bottom = '48px'; - } - else { // No bars + if (Game.OnAscend) { l('game').style.bottom = '0px'; } + else { + if (CM.Config.BotBar == 1 && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { + CM.Disp.BotBar.style.bottom = '48px'; + l('game').style.bottom = '104px'; + } + else if (CM.Config.BotBar == 1) { + CM.Disp.BotBar.style.bottom = '0px'; + l('game').style.bottom = '56px'; + } + else if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { + l('game').style.bottom = '48px'; + } + else { // No bars + l('game').style.bottom = '0px'; + } + } if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { l('sectionLeft').style.top = '48px'; @@ -840,8 +845,8 @@ CM.Disp.UpdateUpgrades = function() { } else { var div = document.createElement('div'); - div.style.width = '17px'; - div.style.height = '17px'; + div.style.width = '12px'; + div.style.height = '12px'; div.style.backgroundColor = CM.Cache.Upgrades[me.name].color; l('upgrade' + i).appendChild(div); } @@ -1255,22 +1260,17 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(header('Heavenly Chips', 'HC')); if (CM.Config.StatsPref.HC) { var possibleHC = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset); - var neededCook = CM.Sim.CookNeedPrest(possibleHC + 1) - (Game.cookiesEarned + Game.cookiesReset); + var neededCook = Game.HowManyCookiesReset(possibleHC + 1) - (Game.cookiesEarned + Game.cookiesReset); var hcMaxFrag = document.createDocumentFragment(); hcMaxFrag.appendChild(document.createTextNode(Beautify(possibleHC))); - var hcMaxSmall = document.createElement('small'); - hcMaxSmall.textContent = ' (' + Beautify((possibleHC * 2)) + '%)'; - hcMaxFrag.appendChild(hcMaxSmall); stats.appendChild(listing('Heavenly Chips (MAX)', hcMaxFrag)); var hcCurFrag = document.createDocumentFragment(); - hcCurFrag.appendChild(document.createTextNode(Beautify(Game.prestige['Heavenly chips']))); - var hcCurSmall = document.createElement('small'); - hcCurSmall.textContent = ' (' + Beautify((Game.prestige['Heavenly chips'] * 2)) + '%)'; - hcCurFrag.appendChild(hcCurSmall); + hcCurFrag.appendChild(document.createTextNode(Beautify(Game.heavenlyChipsEarned))); stats.appendChild(listing('Heavenly Chips (CUR)', hcCurFrag)); stats.appendChild(listing('Cookies To Next Chip', document.createTextNode(Beautify(neededCook)))); stats.appendChild(listing('Time To Next Chip', document.createTextNode(CM.Disp.FormatTime(neededCook / (Game.cookiesPs * (1 - Game.cpsSucked)), 1)))); + // Unneeded? var resetTitleFrag = document.createDocumentFragment(); resetTitleFrag.appendChild(document.createTextNode('Reset Bonus Income ')) var resetTitleSpan = document.createElement('span'); @@ -1297,7 +1297,7 @@ CM.Disp.AddMenuStats = function(title) { resetSmall.textContent = ' (' + (increase / 100) + '% of income)'; resetFrag.appendChild(resetSmall); } - stats.appendChild(listing(resetTitleFrag, resetFrag)); + //stats.appendChild(listing(resetTitleFrag, resetFrag)); } if (Game.cpsSucked > 0) { @@ -1307,7 +1307,9 @@ CM.Disp.AddMenuStats = function(title) { for (var i in Game.wrinklers) { sucked += Game.wrinklers[i].sucked; } - sucked *= 1.1; + var toSuck = 1.1; + if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; + sucked *= toSuck; if (Game.Has('Wrinklerspawn')) sucked *= 1.05; stats.appendChild(listing('Rewards of Popping', document.createTextNode(Beautify(sucked)))); } @@ -1422,7 +1424,7 @@ CM.Disp.AddMenu = function() { } CM.Disp.RefreshMenu = function() { - if (CM.Config.UpStats && Game.onMenu == 'stats' && Game.drawT % (Game.fps * 3) != 0 && Game.drawT % Game.fps == 0) Game.UpdateMenu(); + if (CM.Config.UpStats && Game.onMenu == 'stats' && Game.drawT % (Game.fps * 5) != 0 && Game.drawT % Game.fps == 0) Game.UpdateMenu(); } CM.Disp.UpdateTooltipLocation = function() { @@ -1743,7 +1745,9 @@ CM.Disp.CheckWrinklerTooltip = function() { CM.Disp.UpdateWrinklerTooltip = function() { if (CM.Config.ToolWrink == 1 && l('CMTooltipWrinkler') != null) { var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked; - sucked *= 1.1; + var toSuck = 1.1; + if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; + sucked *= toSuck; if (Game.Has('Wrinklerspawn')) sucked *= 1.05; l('CMTooltipWrinkler').textContent = Beautify(sucked); } @@ -1779,6 +1783,7 @@ CM.Disp.colorRed = 'red'; CM.Disp.colorPurple = 'magenta'; CM.Disp.colorGray = '#b3b3b3'; CM.Disp.lastGoldenCookieState = 'none'; +CM.Disp.lastAscendState = -1; 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']; @@ -1857,39 +1862,45 @@ CM.ReplaceNative = function() { } CM.Loop = function() { - if (CM.Sim.DoSims) { - CM.Cache.RemakeIncome(); - CM.Cache.RemakeBCI(); - CM.Cache.RemakeLucky(); - CM.Cache.RemakeChain(); - CM.Cache.RemakeSeaSpec(); - - CM.Disp.UpdateBotBarOther(); - CM.Disp.UpdateBuildings(); - CM.Disp.UpdateUpgrades(); - - CM.Sim.DoSims = 0; + if (CM.Disp.lastAscendState != Game.OnAscend) { + CM.Disp.lastAscendState = Game.OnAscend; + CM.Disp.UpdateBotTimerBarDisplay(); } - - // Redraw timers - CM.Disp.UpdateBotBarTime(); - CM.Disp.UpdateTimerBar(); - - // Update Tooltip - CM.Disp.UpdateTooltip(); - - // Update Wrinkler Tooltip - CM.Disp.CheckWrinklerTooltip(); - CM.Disp.UpdateWrinklerTooltip(); + if (!Game.OnAscend && Game.AscendTimer == 0) { + if (CM.Sim.DoSims) { + CM.Cache.RemakeIncome(); + CM.Cache.RemakeBCI(); + CM.Cache.RemakeLucky(); + CM.Cache.RemakeChain(); + CM.Cache.RemakeSeaSpec(); - // Check Golden Cookies - CM.Disp.CheckGoldenCookie(); + CM.Disp.UpdateBotBarOther(); + CM.Disp.UpdateBuildings(); + CM.Disp.UpdateUpgrades(); + + CM.Sim.DoSims = 0; + } + + // Redraw timers + CM.Disp.UpdateBotBarTime(); + CM.Disp.UpdateTimerBar(); - // Update Title - CM.Disp.UpdateTitle(); - - // Change menu refresh interval - CM.Disp.RefreshMenu(); + // Update Tooltip + CM.Disp.UpdateTooltip(); + + // Update Wrinkler Tooltip + CM.Disp.CheckWrinklerTooltip(); + CM.Disp.UpdateWrinklerTooltip(); + + // Check Golden Cookies + CM.Disp.CheckGoldenCookie(); + + // Update Title + CM.Disp.UpdateTitle(); + + // Change menu refresh interval + CM.Disp.RefreshMenu(); + } } CM.Init = function() { @@ -1911,6 +1922,7 @@ CM.Init = function() { CM.ReplaceNative(); Game.CalculateGains(); CM.LoadConfig(); // Must be after all things are created! + CM.Disp.lastAscendState = Game.OnAscend; if (Game.prefs.popups) Game.Popup('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!'); else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!','','',1); @@ -1957,14 +1969,8 @@ CM.Sim.Win = function(what) { eval('CM.Sim.HasAchiev = ' + Game.HasAchiev.toString().split('Game').join('CM.Sim')); -CM.Sim.CookNeedPrest = function(prestige) { - return ((Math.pow(((prestige * 2) + 1), 2) - 1) / 8) * 1000000000000; -} - CM.Sim.CopyData = function() { // Other variables - CM.Sim.heavenlyCookies = Game.heavenlyCookies; - CM.Sim.prestige = Game.prestige['Heavenly chips']; CM.Sim.UpgradesOwned = Game.UpgradesOwned; CM.Sim.pledges = Game.pledges; CM.Sim.AchievementsOwned = Game.AchievementsOwned; @@ -1976,8 +1982,10 @@ CM.Sim.CopyData = function() { var me = Game.Objects[i]; var you = CM.Sim.Objects[i]; you.amount = me.amount; - eval('you.cps = ' + me.cps.toString().split('Game.Has').join('CM.Sim.Has').split('Game.Objects').join('CM.Sim.Objects')); - you.name = me.name; // Needed for above eval! + eval('you.cps = ' + me.cps.toString().split('Game.Has').join('CM.Sim.Has').split('Game.Objects').join('CM.Sim.Objects')); + // Below is needed for above eval! + you.baseCps = me.baseCps; + you.name = me.name; } // Upgrades @@ -2130,8 +2138,8 @@ CM.Sim.CheckOtherAchiev = function() { if (bicentennial == 1) CM.Sim.Win('Bicentennial'); if (buildingsOwned >= 100) CM.Sim.Win('Builder'); - if (buildingsOwned >= 400) CM.Sim.Win('Architect'); - if (buildingsOwned >= 800) CM.Sim.Win('Engineer'); + if (buildingsOwned >= 500) CM.Sim.Win('Architect'); + if (buildingsOwned >= 1000) CM.Sim.Win('Engineer'); if (buildingsOwned >= 1500) CM.Sim.Win('Lord of Constructs'); if (CM.Sim.UpgradesOwned >= 20) CM.Sim.Win('Enhancer'); @@ -2183,6 +2191,13 @@ CM.Sim.BuyBuildings = function(amount, target) { if (me.amount >= 150) CM.Sim.Win('Perfected agriculture'); if (me.amount >= 200) CM.Sim.Win('Homegrown'); } + else if (i == 'Mine') { + if (me.amount >= 1) CM.Sim.Win('You know the drill'); + if (me.amount >= 50) CM.Sim.Win('Excavation site'); + if (me.amount >= 100) CM.Sim.Win('Hollow the planet'); + if (me.amount >= 150) CM.Sim.Win('Can you dig it'); + if (me.amount >= 200) CM.Sim.Win('The center of the Earth'); + } else if (i == 'Factory') { if (me.amount >= 1) CM.Sim.Win('Production chain'); if (me.amount >= 50) CM.Sim.Win('Industrial revolution'); @@ -2190,12 +2205,26 @@ CM.Sim.BuyBuildings = function(amount, target) { if (me.amount >= 150) CM.Sim.Win('Ultimate automation'); if (me.amount >= 200) CM.Sim.Win('Technocracy'); } - else if (i == 'Mine') { - if (me.amount >= 1) CM.Sim.Win('You know the drill'); - if (me.amount >= 50) CM.Sim.Win('Excavation site'); - if (me.amount >= 100) CM.Sim.Win('Hollow the planet'); - if (me.amount >= 150) CM.Sim.Win('Can you dig it'); - if (me.amount >= 200) CM.Sim.Win('The center of the Earth'); + else if (i == 'Bank') { + if (me.amount >= 1) CM.Sim.Win('Pretty penny'); + if (me.amount >= 50) CM.Sim.Win('Fit the bill'); + if (me.amount >= 100) CM.Sim.Win('A loan in the dark'); + if (me.amount >= 150) CM.Sim.Win('Need for greed'); + if (me.amount >= 200) CM.Sim.Win('It\'s the economy, stupid'); + } + else if (i == 'Temple') { + if (me.amount >= 1) CM.Sim.Win('Your time to shrine'); + if (me.amount >= 50) CM.Sim.Win('Shady sect'); + if (me.amount >= 100) CM.Sim.Win('New-age cult'); + if (me.amount >= 150) CM.Sim.Win('Organized religion'); + if (me.amount >= 200) CM.Sim.Win('Fanaticism'); + } + else if (i == 'Wizard tower') { + if (me.amount >= 1) CM.Sim.Win('Bewitched'); + if (me.amount >= 50) CM.Sim.Win('The sorcerer\'s apprentice'); + if (me.amount >= 100) CM.Sim.Win('Charms and enchantments'); + if (me.amount >= 150) CM.Sim.Win('Curses and maledictions'); + if (me.amount >= 200) CM.Sim.Win('Magic kingdom'); } else if (i == 'Shipment') { if (me.amount >= 1) CM.Sim.Win('Expedition'); @@ -2258,11 +2287,11 @@ CM.Sim.BuyBuildings = function(amount, target) { CM.Sim.BuyUpgrades = function() { CM.Cache.Upgrades = []; for (var i in Game.Upgrades) { - if (Game.Upgrades[i].bought == 0 && Game.Upgrades[i].unlocked) { + if (Game.Upgrades[i].bought == 0 && Game.Upgrades[i].unlocked && Game.Upgrades[i].pool != 'prestige') { CM.Sim.CopyData(); var me = CM.Sim.Upgrades[i]; me.bought = 1; - if (Game.Upgrades[i].hide != 3) CM.Sim.UpgradesOwned++; + if (Game.Upgrades[i].pool == '' || Game.Upgrades[i].pool == 'cookie') CM.Sim.UpgradesOwned++; if (i == 'Elder Pledge') { CM.Sim.pledges++; @@ -2308,8 +2337,6 @@ CM.Sim.ResetBonus = function() { if (Game.cookiesEarned >= 1000000000000000000000000000) CM.Sim.Win('Obliterate'); if (Game.cookiesEarned >= 1000000000000000000000000000000) CM.Sim.Win('Negative void'); - CM.Sim.prestige = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset); - var lastAchievementsOwned = CM.Sim.AchievementsOwned; CM.Sim.CalculateGains(); diff --git a/src/Config.js b/src/Config.js index a92165a..0e475df 100644 --- a/src/Config.js +++ b/src/Config.js @@ -116,7 +116,7 @@ CM.ConfigData.ToolWarnCaut = {label: ['Tooltip Warning/Caution OFF', 'Tooltip Wa CM.ConfigData.ToolWarnCautPos = {label: ['Tooltip Warning/Caution Position (Left)', 'Tooltip Warning/Caution Position (Bottom)'], desc: 'Placement of the warning/caution boxes', func: function() {CM.Disp.ToggleToolWarnCautPos();}}; CM.ConfigData.ToolWrink = {label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it'}; CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!'}; -CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 3 seconds'}; +CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds'}; CM.ConfigData.SayTime = {label: ['Format Time OFF', 'Format Time ON'], desc: 'Change how time is displayed in statistics', 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', func: function() {CM.Disp.RefreshScale();}}; diff --git a/src/Disp.js b/src/Disp.js index 27ba03c..dce0bbf 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -390,20 +390,25 @@ CM.Disp.UpdateTimerBar = function() { } CM.Disp.UpdateBotTimerBarDisplay = function() { - if (CM.Config.BotBar == 1 && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { - CM.Disp.BotBar.style.bottom = '48px'; - l('game').style.bottom = '104px'; - } - else if (CM.Config.BotBar == 1) { - CM.Disp.BotBar.style.bottom = '0px'; - l('game').style.bottom = '56px'; - } - else if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { - l('game').style.bottom = '48px'; - } - else { // No bars + if (Game.OnAscend) { l('game').style.bottom = '0px'; } + else { + if (CM.Config.BotBar == 1 && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { + CM.Disp.BotBar.style.bottom = '48px'; + l('game').style.bottom = '104px'; + } + else if (CM.Config.BotBar == 1) { + CM.Disp.BotBar.style.bottom = '0px'; + l('game').style.bottom = '56px'; + } + else if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { + l('game').style.bottom = '48px'; + } + else { // No bars + l('game').style.bottom = '0px'; + } + } if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { l('sectionLeft').style.top = '48px'; @@ -521,8 +526,8 @@ CM.Disp.UpdateUpgrades = function() { } else { var div = document.createElement('div'); - div.style.width = '17px'; - div.style.height = '17px'; + div.style.width = '12px'; + div.style.height = '12px'; div.style.backgroundColor = CM.Cache.Upgrades[me.name].color; l('upgrade' + i).appendChild(div); } @@ -936,22 +941,17 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(header('Heavenly Chips', 'HC')); if (CM.Config.StatsPref.HC) { var possibleHC = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset); - var neededCook = CM.Sim.CookNeedPrest(possibleHC + 1) - (Game.cookiesEarned + Game.cookiesReset); + var neededCook = Game.HowManyCookiesReset(possibleHC + 1) - (Game.cookiesEarned + Game.cookiesReset); var hcMaxFrag = document.createDocumentFragment(); hcMaxFrag.appendChild(document.createTextNode(Beautify(possibleHC))); - var hcMaxSmall = document.createElement('small'); - hcMaxSmall.textContent = ' (' + Beautify((possibleHC * 2)) + '%)'; - hcMaxFrag.appendChild(hcMaxSmall); stats.appendChild(listing('Heavenly Chips (MAX)', hcMaxFrag)); var hcCurFrag = document.createDocumentFragment(); - hcCurFrag.appendChild(document.createTextNode(Beautify(Game.prestige['Heavenly chips']))); - var hcCurSmall = document.createElement('small'); - hcCurSmall.textContent = ' (' + Beautify((Game.prestige['Heavenly chips'] * 2)) + '%)'; - hcCurFrag.appendChild(hcCurSmall); + hcCurFrag.appendChild(document.createTextNode(Beautify(Game.heavenlyChipsEarned))); stats.appendChild(listing('Heavenly Chips (CUR)', hcCurFrag)); stats.appendChild(listing('Cookies To Next Chip', document.createTextNode(Beautify(neededCook)))); stats.appendChild(listing('Time To Next Chip', document.createTextNode(CM.Disp.FormatTime(neededCook / (Game.cookiesPs * (1 - Game.cpsSucked)), 1)))); + // Unneeded? var resetTitleFrag = document.createDocumentFragment(); resetTitleFrag.appendChild(document.createTextNode('Reset Bonus Income ')) var resetTitleSpan = document.createElement('span'); @@ -978,7 +978,7 @@ CM.Disp.AddMenuStats = function(title) { resetSmall.textContent = ' (' + (increase / 100) + '% of income)'; resetFrag.appendChild(resetSmall); } - stats.appendChild(listing(resetTitleFrag, resetFrag)); + //stats.appendChild(listing(resetTitleFrag, resetFrag)); } if (Game.cpsSucked > 0) { @@ -988,7 +988,9 @@ CM.Disp.AddMenuStats = function(title) { for (var i in Game.wrinklers) { sucked += Game.wrinklers[i].sucked; } - sucked *= 1.1; + var toSuck = 1.1; + if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; + sucked *= toSuck; if (Game.Has('Wrinklerspawn')) sucked *= 1.05; stats.appendChild(listing('Rewards of Popping', document.createTextNode(Beautify(sucked)))); } @@ -1103,7 +1105,7 @@ CM.Disp.AddMenu = function() { } CM.Disp.RefreshMenu = function() { - if (CM.Config.UpStats && Game.onMenu == 'stats' && Game.drawT % (Game.fps * 3) != 0 && Game.drawT % Game.fps == 0) Game.UpdateMenu(); + if (CM.Config.UpStats && Game.onMenu == 'stats' && Game.drawT % (Game.fps * 5) != 0 && Game.drawT % Game.fps == 0) Game.UpdateMenu(); } CM.Disp.UpdateTooltipLocation = function() { @@ -1424,7 +1426,9 @@ CM.Disp.CheckWrinklerTooltip = function() { CM.Disp.UpdateWrinklerTooltip = function() { if (CM.Config.ToolWrink == 1 && l('CMTooltipWrinkler') != null) { var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked; - sucked *= 1.1; + var toSuck = 1.1; + if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; + sucked *= toSuck; if (Game.Has('Wrinklerspawn')) sucked *= 1.05; l('CMTooltipWrinkler').textContent = Beautify(sucked); } @@ -1460,6 +1464,7 @@ CM.Disp.colorRed = 'red'; CM.Disp.colorPurple = 'magenta'; CM.Disp.colorGray = '#b3b3b3'; CM.Disp.lastGoldenCookieState = 'none'; +CM.Disp.lastAscendState = -1; 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 2ebf8e8..7f32cc7 100644 --- a/src/Main.js +++ b/src/Main.js @@ -63,39 +63,45 @@ CM.ReplaceNative = function() { } CM.Loop = function() { - if (CM.Sim.DoSims) { - CM.Cache.RemakeIncome(); - CM.Cache.RemakeBCI(); - CM.Cache.RemakeLucky(); - CM.Cache.RemakeChain(); - CM.Cache.RemakeSeaSpec(); - - CM.Disp.UpdateBotBarOther(); - CM.Disp.UpdateBuildings(); - CM.Disp.UpdateUpgrades(); - - CM.Sim.DoSims = 0; + if (CM.Disp.lastAscendState != Game.OnAscend) { + CM.Disp.lastAscendState = Game.OnAscend; + CM.Disp.UpdateBotTimerBarDisplay(); } - - // Redraw timers - CM.Disp.UpdateBotBarTime(); - CM.Disp.UpdateTimerBar(); - - // Update Tooltip - CM.Disp.UpdateTooltip(); - - // Update Wrinkler Tooltip - CM.Disp.CheckWrinklerTooltip(); - CM.Disp.UpdateWrinklerTooltip(); + if (!Game.OnAscend && Game.AscendTimer == 0) { + if (CM.Sim.DoSims) { + CM.Cache.RemakeIncome(); + CM.Cache.RemakeBCI(); + CM.Cache.RemakeLucky(); + CM.Cache.RemakeChain(); + CM.Cache.RemakeSeaSpec(); - // Check Golden Cookies - CM.Disp.CheckGoldenCookie(); + CM.Disp.UpdateBotBarOther(); + CM.Disp.UpdateBuildings(); + CM.Disp.UpdateUpgrades(); + + CM.Sim.DoSims = 0; + } + + // Redraw timers + CM.Disp.UpdateBotBarTime(); + CM.Disp.UpdateTimerBar(); - // Update Title - CM.Disp.UpdateTitle(); - - // Change menu refresh interval - CM.Disp.RefreshMenu(); + // Update Tooltip + CM.Disp.UpdateTooltip(); + + // Update Wrinkler Tooltip + CM.Disp.CheckWrinklerTooltip(); + CM.Disp.UpdateWrinklerTooltip(); + + // Check Golden Cookies + CM.Disp.CheckGoldenCookie(); + + // Update Title + CM.Disp.UpdateTitle(); + + // Change menu refresh interval + CM.Disp.RefreshMenu(); + } } CM.Init = function() { @@ -117,6 +123,7 @@ CM.Init = function() { CM.ReplaceNative(); Game.CalculateGains(); CM.LoadConfig(); // Must be after all things are created! + CM.Disp.lastAscendState = Game.OnAscend; if (Game.prefs.popups) Game.Popup('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!'); else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!','','',1); diff --git a/src/Sim.js b/src/Sim.js index ecad81c..6305b35 100644 --- a/src/Sim.js +++ b/src/Sim.js @@ -30,14 +30,8 @@ CM.Sim.Win = function(what) { eval('CM.Sim.HasAchiev = ' + Game.HasAchiev.toString().split('Game').join('CM.Sim')); -CM.Sim.CookNeedPrest = function(prestige) { - return ((Math.pow(((prestige * 2) + 1), 2) - 1) / 8) * 1000000000000; -} - CM.Sim.CopyData = function() { // Other variables - CM.Sim.heavenlyCookies = Game.heavenlyCookies; - CM.Sim.prestige = Game.prestige['Heavenly chips']; CM.Sim.UpgradesOwned = Game.UpgradesOwned; CM.Sim.pledges = Game.pledges; CM.Sim.AchievementsOwned = Game.AchievementsOwned; @@ -49,8 +43,10 @@ CM.Sim.CopyData = function() { var me = Game.Objects[i]; var you = CM.Sim.Objects[i]; you.amount = me.amount; - eval('you.cps = ' + me.cps.toString().split('Game.Has').join('CM.Sim.Has').split('Game.Objects').join('CM.Sim.Objects')); - you.name = me.name; // Needed for above eval! + eval('you.cps = ' + me.cps.toString().split('Game.Has').join('CM.Sim.Has').split('Game.Objects').join('CM.Sim.Objects')); + // Below is needed for above eval! + you.baseCps = me.baseCps; + you.name = me.name; } // Upgrades @@ -203,8 +199,8 @@ CM.Sim.CheckOtherAchiev = function() { if (bicentennial == 1) CM.Sim.Win('Bicentennial'); if (buildingsOwned >= 100) CM.Sim.Win('Builder'); - if (buildingsOwned >= 400) CM.Sim.Win('Architect'); - if (buildingsOwned >= 800) CM.Sim.Win('Engineer'); + if (buildingsOwned >= 500) CM.Sim.Win('Architect'); + if (buildingsOwned >= 1000) CM.Sim.Win('Engineer'); if (buildingsOwned >= 1500) CM.Sim.Win('Lord of Constructs'); if (CM.Sim.UpgradesOwned >= 20) CM.Sim.Win('Enhancer'); @@ -256,6 +252,13 @@ CM.Sim.BuyBuildings = function(amount, target) { if (me.amount >= 150) CM.Sim.Win('Perfected agriculture'); if (me.amount >= 200) CM.Sim.Win('Homegrown'); } + else if (i == 'Mine') { + if (me.amount >= 1) CM.Sim.Win('You know the drill'); + if (me.amount >= 50) CM.Sim.Win('Excavation site'); + if (me.amount >= 100) CM.Sim.Win('Hollow the planet'); + if (me.amount >= 150) CM.Sim.Win('Can you dig it'); + if (me.amount >= 200) CM.Sim.Win('The center of the Earth'); + } else if (i == 'Factory') { if (me.amount >= 1) CM.Sim.Win('Production chain'); if (me.amount >= 50) CM.Sim.Win('Industrial revolution'); @@ -263,12 +266,26 @@ CM.Sim.BuyBuildings = function(amount, target) { if (me.amount >= 150) CM.Sim.Win('Ultimate automation'); if (me.amount >= 200) CM.Sim.Win('Technocracy'); } - else if (i == 'Mine') { - if (me.amount >= 1) CM.Sim.Win('You know the drill'); - if (me.amount >= 50) CM.Sim.Win('Excavation site'); - if (me.amount >= 100) CM.Sim.Win('Hollow the planet'); - if (me.amount >= 150) CM.Sim.Win('Can you dig it'); - if (me.amount >= 200) CM.Sim.Win('The center of the Earth'); + else if (i == 'Bank') { + if (me.amount >= 1) CM.Sim.Win('Pretty penny'); + if (me.amount >= 50) CM.Sim.Win('Fit the bill'); + if (me.amount >= 100) CM.Sim.Win('A loan in the dark'); + if (me.amount >= 150) CM.Sim.Win('Need for greed'); + if (me.amount >= 200) CM.Sim.Win('It\'s the economy, stupid'); + } + else if (i == 'Temple') { + if (me.amount >= 1) CM.Sim.Win('Your time to shrine'); + if (me.amount >= 50) CM.Sim.Win('Shady sect'); + if (me.amount >= 100) CM.Sim.Win('New-age cult'); + if (me.amount >= 150) CM.Sim.Win('Organized religion'); + if (me.amount >= 200) CM.Sim.Win('Fanaticism'); + } + else if (i == 'Wizard tower') { + if (me.amount >= 1) CM.Sim.Win('Bewitched'); + if (me.amount >= 50) CM.Sim.Win('The sorcerer\'s apprentice'); + if (me.amount >= 100) CM.Sim.Win('Charms and enchantments'); + if (me.amount >= 150) CM.Sim.Win('Curses and maledictions'); + if (me.amount >= 200) CM.Sim.Win('Magic kingdom'); } else if (i == 'Shipment') { if (me.amount >= 1) CM.Sim.Win('Expedition'); @@ -331,11 +348,11 @@ CM.Sim.BuyBuildings = function(amount, target) { CM.Sim.BuyUpgrades = function() { CM.Cache.Upgrades = []; for (var i in Game.Upgrades) { - if (Game.Upgrades[i].bought == 0 && Game.Upgrades[i].unlocked) { + if (Game.Upgrades[i].bought == 0 && Game.Upgrades[i].unlocked && Game.Upgrades[i].pool != 'prestige') { CM.Sim.CopyData(); var me = CM.Sim.Upgrades[i]; me.bought = 1; - if (Game.Upgrades[i].hide != 3) CM.Sim.UpgradesOwned++; + if (Game.Upgrades[i].pool == '' || Game.Upgrades[i].pool == 'cookie') CM.Sim.UpgradesOwned++; if (i == 'Elder Pledge') { CM.Sim.pledges++; @@ -381,8 +398,6 @@ CM.Sim.ResetBonus = function() { if (Game.cookiesEarned >= 1000000000000000000000000000) CM.Sim.Win('Obliterate'); if (Game.cookiesEarned >= 1000000000000000000000000000000) CM.Sim.Win('Negative void'); - CM.Sim.prestige = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset); - var lastAchievementsOwned = CM.Sim.AchievementsOwned; CM.Sim.CalculateGains(); From 9a2d96d043fc114457be640e13ec3362d7187382 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Fri, 29 Aug 2014 12:36:45 -0400 Subject: [PATCH 03/26] Made the color boxes on upgrades smaller --- src/Disp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Disp.js b/src/Disp.js index dce0bbf..55d1752 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -526,8 +526,8 @@ CM.Disp.UpdateUpgrades = function() { } else { var div = document.createElement('div'); - div.style.width = '12px'; - div.style.height = '12px'; + div.style.width = '10px'; + div.style.height = '10px'; div.style.backgroundColor = CM.Cache.Upgrades[me.name].color; l('upgrade' + i).appendChild(div); } From af05f9907c737255fc6276dc64c10b669f7b4730 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Fri, 29 Aug 2014 12:38:05 -0400 Subject: [PATCH 04/26] Forgot to update compliled version (again) --- CookieMonster.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 1c9f4ec..6bc5ed9 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -845,8 +845,8 @@ CM.Disp.UpdateUpgrades = function() { } else { var div = document.createElement('div'); - div.style.width = '12px'; - div.style.height = '12px'; + div.style.width = '10px'; + div.style.height = '10px'; div.style.backgroundColor = CM.Cache.Upgrades[me.name].color; l('upgrade' + i).appendChild(div); } From a251c5a9068d9723ee79b11d3df01b05efd32b08 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Mon, 8 Dec 2014 19:03:12 -0500 Subject: [PATCH 05/26] Version change to 1.0466.2 --- src/Main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.js b/src/Main.js index a24854e..6d4bf45 100644 --- a/src/Main.js +++ b/src/Main.js @@ -145,5 +145,5 @@ CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBar CM.ConfigPrefix = 'CMConfig'; CM.VersionMajor = '1.0466'; -CM.VersionMinor = '1'; +CM.VersionMinor = '2'; From 2ff6ea0746462d0024e1913e8b6408b19af4161d Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Wed, 27 May 2015 21:48:29 -0400 Subject: [PATCH 06/26] Finish version change to 1.0466.2 and updated README --- CookieMonster.js | 2 +- README.md | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 621b87a..0aec053 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2080,7 +2080,7 @@ CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBar CM.ConfigPrefix = 'CMConfig'; CM.VersionMajor = '1.0466'; -CM.VersionMinor = '1'; +CM.VersionMinor = '2'; /******* * Sim * diff --git a/README.md b/README.md index 4f5a30d..8a24a61 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cookie Monster -**Cookie Monster** is an addon you can load into Cookie Clicker, that offers a wide range of tools and statistics to enhance the game. It is **not** a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. +**Cookie Monster** is an addon you can load into Cookie Clicker, that offers a wide range of tools and statistics to enhance the game. **It is not a cheat interface** – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper, and it is here to help you at *whichever* degree you want, if you only need some help shortening long numbers, it does that. If you need to be accompanied by hand to pick the best buildings to buy, it does that, but **everything is an option**. @@ -10,27 +10,27 @@ You can see the current version, and a full history of all versions and what the ## What it does -At its core, Cookie Monster computes an index on both buildings and upgrades : +At its core, Cookie Monster computes an index on both buildings and upgrades: -* **Base Cost per Income (BCI)** : Indicates how much a building is worth by comparing how much it costs to how much income gained +* **Base Cost per Income (BCI)**: Indicates how much a building is worth by comparing how much it costs to how much income gained Cookie Monster also indicates the time left before being able to buy an upgrade or building, and takes it into consideration. It will take *everything* in consideration, meaning if buying a building also unlocks an achievement which boosts your income, which unlocks an achievement, it will know and highlight that building's value. -This index is computed for buildings and upgrades. If the relevant option is enabled, it will color-code each of them based on their value : +This index is computed for buildings and upgrades. If the relevant option is enabled, it will color-code each of them based on their value: -* Light Blue : (upgrades) This item has a better BCI than any building -* Green : This item has the best BCI -* Yellow : This item is not the best, but it is closer to best than it is to worst -* Orange : This item is not the worst, but it is closer to worst than it is to best -* Red : This item has the worst BCI -* Purple : (upgrades) This item has a worse BCI than any building -* Gray : (upgrades) This item has not been calculated and/or cannot be calculated due to no definitive worth. +* Light Blue: (upgrades) This item has a better BCI than any building +* Green: This item has the best BCI +* Yellow: This item is not the best, but it is closer to best than it is to worst +* Orange: This item is not the worst, but it is closer to worst than it is to best +* Red: This item has the worst BCI +* Purple: (upgrades) This item has a worse BCI than any building +* Gray: (upgrades) This item has not been calculated and/or cannot be calculated due to no definitive worth. -Note : For this index, **lower is better**, meaning a building with a BCI of 1 is more interesting than one with a BCI of 3. +Note: For this index, **lower is better**, meaning a building with a BCI of 1 is more interesting than one with a BCI of 3. ## What it doesn't do -Most likely you'll find items in gray like Golden Cookie upgrades, clicking upgrades – everything that doesn't earn you a direct bonus to your income will display as gray. This means the following upgrades are **not** taken into account by Cookie Monster : +Most likely you'll find items in gray like Golden Cookie upgrades, clicking upgrades – everything that doesn't earn you a direct bonus to your income will display as gray. This means the following upgrades are **not** taken into account by Cookie Monster: * Plastic mouse * Iron mouse @@ -101,7 +101,7 @@ All suggestions are welcome, even the smallest ones. #Contributors -* **[Raving_Kumquat](http://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)** : Original author -* **[Maxime Fabre](https://github.com/Anahkiasen)** : Previous maintainer -* **Alderi Tokori** : ROI calculations (unused now) -* **[Aktanusa](https://github.com/Aktanusa)** : Current maintainer \ No newline at end of file +* **[Raving_Kumquat](http://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author +* **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer +* **Alderi Tokori**: ROI calculations (unused now) +* **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer \ No newline at end of file From 56903744d872b429eb643ee04a3fd58265c798ad Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Wed, 27 May 2015 22:03:33 -0400 Subject: [PATCH 07/26] Added an indication in the title bar on the type of golden cookie spawned (Issue #39) and tiny cleanup of code --- CookieMonster.js | 8 ++++++-- src/Disp.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 0aec053..157bfad 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1020,8 +1020,12 @@ CM.Disp.UpdateTitle = function() { var titleGC; var titleSP; if (l('goldenCookie').style.display != 'none') { - addGC = true; - titleGC = '[G ' + Math.ceil(Game.goldenCookie.life / Game.fps) + ']'; + if (Game.goldenCookie.wrath) { + titleGC = '[W ' + Math.ceil(Game.goldenCookie.life / Game.fps) + ']'; + } + else { + titleGC = '[G ' + Math.ceil(Game.goldenCookie.life / Game.fps) + ']'; + } } else { titleGC = '[' + Math.ceil((Game.goldenCookie.maxTime - Game.goldenCookie.time) / Game.fps) + ']'; diff --git a/src/Disp.js b/src/Disp.js index 9e75ec6..6014753 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -682,8 +682,12 @@ CM.Disp.UpdateTitle = function() { var titleGC; var titleSP; if (l('goldenCookie').style.display != 'none') { - addGC = true; - titleGC = '[G ' + Math.ceil(Game.goldenCookie.life / Game.fps) + ']'; + if (Game.goldenCookie.wrath) { + titleGC = '[W ' + Math.ceil(Game.goldenCookie.life / Game.fps) + ']'; + } + else { + titleGC = '[G ' + Math.ceil(Game.goldenCookie.life / Game.fps) + ']'; + } } else { titleGC = '[' + Math.ceil((Game.goldenCookie.maxTime - Game.goldenCookie.time) / Game.fps) + ']'; From f1ccbf893760bfda62af3a20867284e6f4936c22 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Thu, 5 Nov 2015 22:15:16 -0500 Subject: [PATCH 08/26] Fixed a bug with Game's Setting Scale not showing fractional numbers like the original (Issue #43) --- CookieMonster.js | 4 ++-- src/Disp.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 157bfad..989e405 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -386,7 +386,7 @@ CM.Disp.GetTimeColor = function(price, bank, cps) { return {text: text, color: color}; } -CM.Disp.Beautify = function(num) { +CM.Disp.Beautify = function(num, frac) { if (CM.Config.Scale != 0 && isFinite(num)) { var answer = ''; var negative = false; @@ -419,7 +419,7 @@ CM.Disp.Beautify = function(num) { return answer; } else { - return CM.Backup.Beautify(num); + return CM.Backup.Beautify(num, frac); } } diff --git a/src/Disp.js b/src/Disp.js index 6014753..ce76024 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -48,7 +48,7 @@ CM.Disp.GetTimeColor = function(price, bank, cps) { return {text: text, color: color}; } -CM.Disp.Beautify = function(num) { +CM.Disp.Beautify = function(num, frac) { if (CM.Config.Scale != 0 && isFinite(num)) { var answer = ''; var negative = false; @@ -81,7 +81,7 @@ CM.Disp.Beautify = function(num) { return answer; } else { - return CM.Backup.Beautify(num); + return CM.Backup.Beautify(num, frac); } } From dbcec54b3da8e309a6aad2b0cbb55a9721f693dd Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Thu, 5 Nov 2015 22:51:29 -0500 Subject: [PATCH 09/26] Added same Issue #43 fix to other scales --- CookieMonster.js | 2 +- src/Disp.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 989e405..6eb6ce9 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -410,7 +410,7 @@ CM.Disp.Beautify = function(num, frac) { } } if (answer == '') { - answer = CM.Backup.Beautify(num); + answer = CM.Backup.Beautify(num, frac); } if (negative) { diff --git a/src/Disp.js b/src/Disp.js index ce76024..be4b1b0 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -72,7 +72,7 @@ CM.Disp.Beautify = function(num, frac) { } } if (answer == '') { - answer = CM.Backup.Beautify(num); + answer = CM.Backup.Beautify(num, frac); } if (negative) { From 07944e366a094a1484c2870cd5acb99f07b66e95 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Mon, 21 Dec 2015 20:46:55 -0500 Subject: [PATCH 10/26] Version change to 1.9.1 --- src/Main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.js b/src/Main.js index 0d6b125..8374b93 100644 --- a/src/Main.js +++ b/src/Main.js @@ -151,6 +151,6 @@ CM.DelayInit = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWarnCautBon: 0, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.0501'; +CM.VersionMajor = '1.9'; CM.VersionMinor = '1'; From b134e3b45cbdaa8685573dc62ae6e1f468e0030c Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Mon, 21 Dec 2015 20:53:00 -0500 Subject: [PATCH 11/26] Version change to 1.9.1 (part 2) --- CookieMonster.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CookieMonster.js b/CookieMonster.js index dc97796..4efdf86 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2091,7 +2091,7 @@ CM.DelayInit = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWarnCautBon: 0, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.0501'; +CM.VersionMajor = '1.9'; CM.VersionMinor = '1'; /******* From d870823c07ac5575db39c5adc616e27ab1563ca4 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Sat, 26 Dec 2015 16:38:36 -0500 Subject: [PATCH 12/26] Fix to work with 1.9 beta mostly --- CookieMonster.js | 302 ++++++++++++++++++++++------------------------- src/Disp.js | 56 ++++++--- src/Main.js | 3 +- src/Sim.js | 243 ++++++++++++++++---------------------- 4 files changed, 284 insertions(+), 320 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 4efdf86..edd8463 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -633,7 +633,8 @@ CM.Disp.CreateTimerBar = function() { CM.Disp.TimerBarCF.style.height = '12px'; CM.Disp.TimerBarCF.style.margin = '0px 10px'; CM.Disp.TimerBarCF.style.position = 'relative'; - CM.Disp.TimerBarCF.appendChild(bar('Click Frenzy', [{id: 'CMTimerBarCFBar', color: CM.Disp.colorBlue}], 'CMTimerBarCFTime')); + CM.Disp.TimerBarCF.appendChild(bar('', [{id: 'CMTimerBarCFBar'}], 'CMTimerBarCFTime')); + CM.Disp.TimerBarCF.firstChild.firstChild.id = 'CMTimerBarCFType'; CM.Disp.TimerBar.appendChild(CM.Disp.TimerBarCF); l('wrapper').appendChild(CM.Disp.TimerBar); @@ -709,6 +710,10 @@ CM.Disp.UpdateTimerBar = function() { l('CMTimerBarFrenType').textContent = 'Clot'; l('CMTimerBarFrenBar').className = CM.Disp.colorBackPre + CM.Disp.colorRed; } + else if (Game.frenzyPower == 15) { + l('CMTimerBarFrenType').textContent = 'Dragon Harvest'; + l('CMTimerBarFrenBar').className = CM.Disp.colorBackPre + CM.Disp.colorPurple; + } else { l('CMTimerBarFrenType').textContent = 'Blood Frenzy'; l('CMTimerBarFrenBar').className = CM.Disp.colorBackPre + CM.Disp.colorGreen; @@ -723,6 +728,14 @@ CM.Disp.UpdateTimerBar = function() { if (Game.clickFrenzy > 0) { CM.Disp.TimerBarCF.style.display = ''; + if (Game.clickFrenzyPower == 777) { + l('CMTimerBarCFType').textContent = 'Click Frenzy'; + l('CMTimerBarCFBar').className = CM.Disp.colorBackPre + CM.Disp.colorBlue; + } + else { + l('CMTimerBarCFType').textContent = 'Dragonflight'; + l('CMTimerBarCFBar').className = CM.Disp.colorBackPre + CM.Disp.colorPurple; + } l('CMTimerBarCFBar').style.width = Math.round(Game.clickFrenzy * maxWidth / Game.clickFrenzyMax) + 'px'; l('CMTimerBarCFTime').textContent = Math.ceil(Game.clickFrenzy / Game.fps); count++; @@ -744,8 +757,13 @@ CM.Disp.UpdateTimerBar = function() { CM.Disp.UpdateBotTimerBarDisplay = function() { if (Game.OnAscend) { l('game').style.bottom = '0px'; + CM.Disp.BotBar.style.display = 'none'; + CM.Disp.TimerBar.style.display = 'none'; + CM.Disp.GCTimer.style.display = 'none'; } else { + CM.Disp.BotBar.style.display = ''; + CM.Disp.TimerBar.style.display = ''; if (CM.Config.BotBar == 1 && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { CM.Disp.BotBar.style.bottom = '48px'; l('game').style.bottom = '104px'; @@ -1210,7 +1228,7 @@ CM.Disp.AddMenuPref = function(title) { l('menu').childNodes[2].insertBefore(frag, l('menu').childNodes[2].childNodes[l('menu').childNodes[2].childNodes.length - 1]); CM.Disp.FormatButtonOnClickBak = l('formatButton').onclick; - l('formatButton').onclick = function() {Game.Toggle('format', 'formatButton', 'Short numbers OFF', 'Short numbers ON'); CM.Disp.RefreshScale();}; + l('formatButton').onclick = function() {Game.Toggle('format', 'formatButton', 'Short numbers OFF', 'Short numbers ON', '1'); PlaySound('snd/tick.mp3'); CM.Disp.RefreshScale();}; } CM.Disp.AddMenuStats = function(title) { @@ -1344,8 +1362,9 @@ CM.Disp.AddMenuStats = function(title) { hcMaxFrag.appendChild(document.createTextNode(Beautify(possibleHC))); stats.appendChild(listing('Heavenly Chips (MAX)', hcMaxFrag)); var hcCurFrag = document.createDocumentFragment(); - hcCurFrag.appendChild(document.createTextNode(Beautify(Game.heavenlyChipsEarned))); - stats.appendChild(listing('Heavenly Chips (CUR)', hcCurFrag)); + // Remove all chip stats? + //hcCurFrag.appendChild(document.createTextNode(Beautify(Game.heavenlyChipsEarned))); + //stats.appendChild(listing('Heavenly Chips (CUR)', hcCurFrag)); stats.appendChild(listing('Cookies To Next Chip', document.createTextNode(Beautify(neededCook)))); stats.appendChild(listing('Time To Next Chip', document.createTextNode(CM.Disp.FormatTime(neededCook / (Game.cookiesPs * (1 - Game.cpsSucked)), 1)))); // Unneeded? @@ -1383,18 +1402,20 @@ CM.Disp.AddMenuStats = function(title) { if (Game.cpsSucked > 0) { stats.appendChild(header('Wrinklers', 'Wrink')); if (CM.Config.StatsPref.Wrink || (CM.Config.StatsPref.Sea && choEgg)) { - var sucked = 0; + var totalSucked = 0; for (var i in Game.wrinklers) { - sucked += Game.wrinklers[i].sucked; + var sucked = Game.wrinklers[i].sucked; + var toSuck = 1.1; + if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; + if (Game.wrinklers[i].type==1) toSuck *= 3; //shiny wrinklers are an elusive, profitable breed + sucked *= toSuck; + if (Game.Has('Wrinklerspawn')) sucked *= 1.05; + totalSucked += sucked; } - var toSuck = 1.1; - if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; - sucked *= toSuck; - if (Game.Has('Wrinklerspawn')) sucked *= 1.05; if (CM.Config.StatsPref.Wrink) { var popAllFrag = document.createDocumentFragment(); - popAllFrag.appendChild(document.createTextNode(Beautify(sucked) + ' ')); + popAllFrag.appendChild(document.createTextNode(Beautify(totalSucked) + ' ')); var popAllA = document.createElement('a'); popAllA.textContent = 'Pop All'; popAllA.className = 'option'; @@ -1543,7 +1564,7 @@ CM.Disp.RefreshMenu = function() { } CM.Disp.UpdateTooltipLocation = function() { - Game.tooltip.tta.style.top = Math.max(0, Math.min((l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - CM.Disp.TooltipWarnCaut.clientHeight - 64, Game.mouseY - 48)) + 'px'; + Game.tooltip.tta.style.top = Math.max(0, Math.min((l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - CM.Disp.TooltipWarnCaut.clientHeight - 38, Game.mouseY - 48)) + 'px'; if (Game.tooltip.origin == 'wrink') { Game.tooltip.tta.style.left = (Game.mouseX + l('tooltip').offsetWidth + 25) + 'px'; Game.tooltip.tta.style.right = 'auto'; @@ -1618,7 +1639,7 @@ CM.Disp.AddTooltipBuild = function() { var me = Game.Objects[i]; if (l('product' + me.id).onmouseover != null) { CM.Disp.TooltipBuildBack[i] = l('product' + me.id).onmouseover; - eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\');}'); + eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}'); } } } @@ -1629,7 +1650,7 @@ CM.Disp.AddTooltipUpgrade = function() { var me = Game.UpgradesInStore[i]; if (l('upgrade' + i).onmouseover != null) { CM.Disp.TooltipUpgradeBack[i] = l('upgrade' + i).onmouseover; - eval('l(\'upgrade\' + i).onmouseover = function() {CM.Disp.Tooltip(\'u\', \'' + i + '\');}'); + eval('l(\'upgrade\' + i).onmouseover = function() {if (!Game.mouseDown) {Game.setOnCrate(this); Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'u\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}}'); } } } @@ -1667,7 +1688,7 @@ CM.Disp.Tooltip = function(type, name) { } } else { // Upgrades - CM.Disp.TooltipUpgradeBack[name](); + l('tooltip').innerHTML = Game.crate(Game.UpgradesInStore[name], 'store', undefined, undefined, 1)(); } var area = document.createElement('div'); @@ -1713,9 +1734,9 @@ CM.Disp.Tooltip = function(type, name) { CM.Disp.UpdateTooltip(); - if (type == 'b') { +// if (type == 'b') { return l('tooltip').innerHTML; - } +// } } CM.Disp.UpdateTooltip = function() { @@ -1882,6 +1903,7 @@ CM.Disp.UpdateWrinklerTooltip = function() { var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked; var toSuck = 1.1; if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; + if (Game.wrinklers[CM.Disp.TooltipWrinkler].type == 1) toSuck *= 3; //shiny wrinklers are an elusive, profitable breed sucked *= toSuck; if (Game.Has('Wrinklerspawn')) sucked *= 1.05; l('CMTooltipWrinkler').textContent = Beautify(sucked); @@ -2065,6 +2087,7 @@ CM.Init = function() { } CM.DelayInit = function() { + CM.Sim.InitData(); CM.Disp.CreateCssArea(); CM.Disp.CreateBotBar(); CM.Disp.CreateTimerBar(); @@ -2083,7 +2106,7 @@ CM.DelayInit = function() { CM.Disp.lastAscendState = Game.OnAscend; if (Game.prefs.popups) Game.Popup('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!'); - else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!','','',1); + else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!','','',1, 1); Game.Win('Third-party'); } @@ -2107,6 +2130,7 @@ CM.Sim.BuildingGetPrice = function(basePrice, start, increase) { if (Game.Has('Santa\'s dominion')) price *= 0.99; if (Game.Has('Faberge egg')) price *= 0.99; if (Game.Has('Divine discount')) price *= 0.99; + if (Game.hasAura('Fierce Hoarder')) price *= 0.98; totalPrice += Math.ceil(price); count++; } @@ -2116,7 +2140,9 @@ CM.Sim.BuildingGetPrice = function(basePrice, start, increase) { CM.Sim.BuildingSell = function(basePrice, start, amount) { var totalMoni = 0; while (amount > 0) { - totalMoni += Math.floor(CM.Sim.BuildingGetPrice(basePrice, start, 1) * 0.5); + var giveBack = 0.5; + if (Game.hasAura('Earth Shatterer')) giveBack = 0.85; + totalMoni += Math.floor(CM.Sim.BuildingGetPrice(basePrice, start, 1) * giveBack); start--; amount--; } @@ -2129,27 +2155,34 @@ CM.Sim.Win = function(what) { if (CM.Sim.Achievements[what]) { if (CM.Sim.Achievements[what].won == 0) { CM.Sim.Achievements[what].won = 1; - if (Game.Achievements[what].hide != 3) CM.Sim.AchievementsOwned++; + if (Game.Achievements[what].pool != 'shadow') CM.Sim.AchievementsOwned++; } } } eval('CM.Sim.HasAchiev = ' + Game.HasAchiev.toString().split('Game').join('CM.Sim')); -CM.Sim.CopyData = function() { - // Other variables - CM.Sim.UpgradesOwned = Game.UpgradesOwned; - CM.Sim.pledges = Game.pledges; - CM.Sim.AchievementsOwned = Game.AchievementsOwned; - +eval('CM.Sim.GetHeavenlyMultiplier = ' + Game.GetHeavenlyMultiplier.toString().split('Game').join('CM.Sim')); + +CM.Sim.hasAura = function(what) { + if (Game.dragonAuras[CM.Sim.dragonAura].name == what || Game.dragonAuras[CM.Sim.dragonAura2].name == what) + return true; + else + return false; +} + +eval('CM.Sim.GetTieredCpsMult = ' + Game.GetTieredCpsMult.toString().split('Game.Has').join('CM.Sim.Has').split('me.tieredUpgrades').join('Game.Objects[me.name].tieredUpgrades').split('me.synergies').join('Game.Objects[me.name].synergies').split('syn.buildingTie1.amount').join('CM.Sim.Objects[syn.buildingTie1.name].amount').split('syn.buildingTie2.amount').join('CM.Sim.Objects[syn.buildingTie2.name].amount')); + +eval('CM.Sim.getGrandmaSynergyUpgradeMultiplier = ' + Game.getGrandmaSynergyUpgradeMultiplier.toString().split('Game.Objects[\'Grandma\']').join('CM.Sim.Objects[\'Grandma\']')); + +CM.Sim.InitData = function() { // Buildings CM.Sim.Objects = []; for (var i in Game.Objects) { CM.Sim.Objects[i] = {}; var me = Game.Objects[i]; var you = CM.Sim.Objects[i]; - you.amount = me.amount; - eval('you.cps = ' + me.cps.toString().split('Game.Has').join('CM.Sim.Has').split('Game.Objects').join('CM.Sim.Objects')); + eval('you.cps = ' + me.cps.toString().split('Game.Has').join('CM.Sim.Has').split('Game.hasAura').join('CM.Sim.hasAura').split('Game.Objects').join('CM.Sim.Objects').split('Game.GetTieredCpsMult').join('CM.Sim.GetTieredCpsMult').split('Game.getGrandmaSynergyUpgradeMultiplier').join('CM.Sim.getGrandmaSynergyUpgradeMultiplier')); // Below is needed for above eval! you.baseCps = me.baseCps; you.name = me.name; @@ -2159,15 +2192,41 @@ CM.Sim.CopyData = function() { CM.Sim.Upgrades = []; for (var i in Game.Upgrades) { CM.Sim.Upgrades[i] = {}; - var me = Game.Upgrades[i]; - var you = CM.Sim.Upgrades[i]; - you.bought = me.bought; } // Achievements CM.Sim.Achievements = []; for (var i in Game.Achievements) { CM.Sim.Achievements[i] = {}; + } +} + +CM.Sim.CopyData = function() { + // Other variables + CM.Sim.UpgradesOwned = Game.UpgradesOwned; + CM.Sim.pledges = Game.pledges; + CM.Sim.AchievementsOwned = Game.AchievementsOwned; + CM.Sim.heavenlyPower = Game.heavenlyPower; + CM.Sim.prestige = Game.prestige; + CM.Sim.dragonAura = Game.dragonAura; + CM.Sim.dragonAura2 = Game.dragonAura2; + + // Buildings + for (var i in Game.Objects) { + var me = Game.Objects[i]; + var you = CM.Sim.Objects[i]; + you.amount = me.amount; + } + + // Upgrades + for (var i in Game.Upgrades) { + var me = Game.Upgrades[i]; + var you = CM.Sim.Upgrades[i]; + you.bought = me.bought; + } + + // Achievements + for (var i in Game.Achievements) { var me = Game.Achievements[i]; var you = CM.Sim.Achievements[i]; you.won = me.won; @@ -2179,20 +2238,18 @@ CM.Sim.CalculateGains = function() { CM.Sim.cookiesPs = 0; var mult = 1; - var heavenlyMult = 0; - if (CM.Sim.Has('Heavenly chip secret')) heavenlyMult += 0.05; - if (CM.Sim.Has('Heavenly cookie stand')) heavenlyMult += 0.20; - if (CM.Sim.Has('Heavenly bakery')) heavenlyMult += 0.25; - if (CM.Sim.Has('Heavenly confectionery')) heavenlyMult += 0.25; - if (CM.Sim.Has('Heavenly key')) heavenlyMult += 0.25; - mult += parseFloat(Game.heavenlyCookies) *0.1 * heavenlyMult; + var heavenlyMult = CM.Sim.GetHeavenlyMultiplier(); + mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * heavenlyMult; + var cookieMult = 0; for (var i in CM.Sim.Upgrades) { var me = CM.Sim.Upgrades[i]; if (me.bought > 0) { - if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) mult *= (1 + (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power) * 0.01); + if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) cookieMult += (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power); } } + + mult *= (1 + 0.01 * cookieMult); if (CM.Sim.Has('Specialized chocolate chips')) mult *= 1.01; if (CM.Sim.Has('Designer cocoa beans')) mult *= 1.02; if (CM.Sim.Has('Underworld ovens')) mult *= 1.03; @@ -2205,7 +2262,7 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('An itchy sweater')) mult *= 1.01; if (CM.Sim.Has('Santa\'s dominion')) mult *= 1.2; - if (CM.Sim.Has('Santa\'s legacy')) mult *= (Game.santaLevel + 1) * 0.05; + if (CM.Sim.Has('Santa\'s legacy')) mult *= 1 + (Game.santaLevel + 1) * 0.05; for (var i in CM.Sim.Objects) { var me = CM.Sim.Objects[i]; @@ -2213,14 +2270,18 @@ CM.Sim.CalculateGains = function() { } if (CM.Sim.Has('"egg"')) CM.Sim.cookiesPs += 9; // "egg" - if (CM.Sim.Has('"god"')) CM.Sim.cookiesPs += 9;// "god" - var milkMult = CM.Sim.Has('Santa\'s milk and cookies') ? 1.05 : 1; + var milkMult=1; + if (CM.Sim.Has('Santa\'s milk and cookies')) milkMult *= 1.05; + if (CM.Sim.hasAura('Breath of Milk')) milkMult *= 1.05; if (CM.Sim.Has('Kitten helpers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.05 * milkMult); if (CM.Sim.Has('Kitten workers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); if (CM.Sim.Has('Kitten engineers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); if (CM.Sim.Has('Kitten overseers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * 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 angels')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); var eggMult = 0; @@ -2243,16 +2304,29 @@ CM.Sim.CalculateGains = function() { eggMult += (1 - Math.pow(1 - day / 100, 3)) * 10; } mult *= (1 + 0.01 * eggMult); - + + if (CM.Sim.hasAura('Radiant Appetite')) mult *= 2; + var rawCookiesPs = CM.Sim.cookiesPs * mult; - for (var i = 0; i < Game.cpsAchievs.length / 2; i++) { - if (rawCookiesPs >= Game.cpsAchievs[i * 2 + 1]) CM.Sim.Win(Game.cpsAchievs[i * 2]); + for (var i in Game.CpsAchievements) { + if (rawCookiesPs >= Game.CpsAchievements[i].threshold) CM.Sim.Win(Game.CpsAchievements[i].name); } if (Game.frenzy > 0) mult *= Game.frenzyPower; if (CM.Sim.Has('Elder Covenant')) mult *= 0.95; + if (CM.Sim.Has('Golden switch [off]')) { + var goldenSwitchMult = 1.25; + if (CM.Sim.Has('Residual luck')) { + var upgrades = ['Get lucky', 'Lucky day', 'Serendipity', 'Heavenly luck', 'Lasting fortune', 'Decisive fate']; + for (var i in upgrades) { + if (CM.Sim.Has(upgrades[i])) goldenSwitchMult += 0.01; + } + } + mult *= goldenSwitchMult; + } + CM.Sim.cookiesPs *= mult; }; @@ -2269,40 +2343,28 @@ CM.Sim.CheckOtherAchiev = function() { if (CM.Sim.Has('Rainbow grandmas')) grandmas++; if (!CM.Sim.HasAchiev('Elder') && grandmas >= 7) CM.Sim.Win('Elder'); + // Redo? var buildingsOwned = 0; - var oneOfEach = 1; var mathematician = 1; var base10 = 1; - var centennial = 1; - var centennialhalf = 1; - var bicentennial = 1; + var minAmount = 100000; for (var i in CM.Sim.Objects) { buildingsOwned += CM.Sim.Objects[i].amount; - if (!CM.Sim.HasAchiev('One with everything')) { - if (CM.Sim.Objects[i].amount == 0) oneOfEach = 0; - } + minAmount = Math.min(CM.Sim.Objects[i].amount, minAmount); if (!CM.Sim.HasAchiev('Mathematician')) { if (CM.Sim.Objects[i].amount < Math.min(128, Math.pow(2, (Game.ObjectsById.length - Game.Objects[i].id) - 1))) mathematician = 0; } if (!CM.Sim.HasAchiev('Base 10')) { if (CM.Sim.Objects[i].amount < (Game.ObjectsById.length - Game.Objects[i].id)*10) base10 = 0; } - if (!CM.Sim.HasAchiev('Centennial')) { - if (CM.Sim.Objects[i].amount < 100) centennial = 0; - } - if (!CM.Sim.HasAchiev('Centennial and a half')) { - if (CM.Sim.Objects[i].amount < 150) centennialhalf = 0; - } - if (!CM.Sim.HasAchiev('Bicentennial')) { - if (CM.Sim.Objects[i].amount < 200) bicentennial = 0; - } } - if (oneOfEach == 1) CM.Sim.Win('One with everything'); + if (minAmount >= 1) CM.Sim.Win('One with everything'); if (mathematician == 1) CM.Sim.Win('Mathematician'); if (base10 == 1) CM.Sim.Win('Base 10'); - if (centennial == 1) CM.Sim.Win('Centennial'); - if (centennialhalf == 1) CM.Sim.Win('Centennial and a half'); - if (bicentennial == 1) CM.Sim.Win('Bicentennial'); + if (minAmount >= 100) CM.Sim.Win('Centennial'); + if (minAmount >= 150) CM.Sim.Win('Centennial and a half'); + if (minAmount >= 200) CM.Sim.Win('Bicentennial'); + if (minAmount >= 250) CM.Sim.Win('Bicentennial and a half'); if (buildingsOwned >= 100) CM.Sim.Win('Builder'); if (buildingsOwned >= 500) CM.Sim.Win('Architect'); @@ -2312,7 +2374,11 @@ CM.Sim.CheckOtherAchiev = function() { if (CM.Sim.UpgradesOwned >= 20) CM.Sim.Win('Enhancer'); if (CM.Sim.UpgradesOwned >= 50) CM.Sim.Win('Augmenter'); if (CM.Sim.UpgradesOwned >= 100) CM.Sim.Win('Upgrader'); - if (CM.Sim.UpgradesOwned >= 150) CM.Sim.Win('Lord of Progress'); + if (CM.Sim.UpgradesOwned >= 200) CM.Sim.Win('Lord of Progress'); + + if (buildingsOwned >= 3000 && CM.Sim.UpgradesOwned >= 300) CM.Sim.Win('Polymath'); + + if (CM.Sim.Objects['Cursor'].amount + CM.Sim.Objects['Grandma'].amount >= 777) CM.Sim.Win('The elder scrolls'); var hasAllHalloCook = true; for (var i in CM.Data.HalloCookies) { @@ -2342,98 +2408,13 @@ CM.Sim.BuyBuildings = function(amount, target) { if (me.amount >= 200) CM.Sim.Win('The Digital'); if (me.amount >= 300) CM.Sim.Win('Extreme polydactyly'); if (me.amount >= 400) CM.Sim.Win('Dr. T'); + if (me.amount >= 500) CM.Sim.Win('Thumbs, phalanges, metacarpals'); } - else if (i == 'Grandma') { - if (me.amount >= 1) CM.Sim.Win('Grandma\'s cookies'); - if (me.amount >= 50) CM.Sim.Win('Sloppy kisses'); - if (me.amount >= 100) CM.Sim.Win('Retirement home'); - if (me.amount >= 150) CM.Sim.Win('Friend of the ancients'); - if (me.amount >= 200) CM.Sim.Win('Ruler of the ancients'); - if (me.amount >= 250) CM.Sim.Win('The old never bothered me anyway'); - } - else if (i == 'Farm') { - if (me.amount >= 1) CM.Sim.Win('My first farm'); - if (me.amount >= 50) CM.Sim.Win('Reap what you sow'); - if (me.amount >= 100) CM.Sim.Win('Farm ill'); - if (me.amount >= 150) CM.Sim.Win('Perfected agriculture'); - if (me.amount >= 200) CM.Sim.Win('Homegrown'); - } - else if (i == 'Mine') { - if (me.amount >= 1) CM.Sim.Win('You know the drill'); - if (me.amount >= 50) CM.Sim.Win('Excavation site'); - if (me.amount >= 100) CM.Sim.Win('Hollow the planet'); - if (me.amount >= 150) CM.Sim.Win('Can you dig it'); - if (me.amount >= 200) CM.Sim.Win('The center of the Earth'); - } - else if (i == 'Factory') { - if (me.amount >= 1) CM.Sim.Win('Production chain'); - if (me.amount >= 50) CM.Sim.Win('Industrial revolution'); - if (me.amount >= 100) CM.Sim.Win('Global warming'); - if (me.amount >= 150) CM.Sim.Win('Ultimate automation'); - if (me.amount >= 200) CM.Sim.Win('Technocracy'); - } - else if (i == 'Bank') { - if (me.amount >= 1) CM.Sim.Win('Pretty penny'); - if (me.amount >= 50) CM.Sim.Win('Fit the bill'); - if (me.amount >= 100) CM.Sim.Win('A loan in the dark'); - if (me.amount >= 150) CM.Sim.Win('Need for greed'); - if (me.amount >= 200) CM.Sim.Win('It\'s the economy, stupid'); - } - else if (i == 'Temple') { - if (me.amount >= 1) CM.Sim.Win('Your time to shrine'); - if (me.amount >= 50) CM.Sim.Win('Shady sect'); - if (me.amount >= 100) CM.Sim.Win('New-age cult'); - if (me.amount >= 150) CM.Sim.Win('Organized religion'); - if (me.amount >= 200) CM.Sim.Win('Fanaticism'); - } - else if (i == 'Wizard tower') { - if (me.amount >= 1) CM.Sim.Win('Bewitched'); - if (me.amount >= 50) CM.Sim.Win('The sorcerer\'s apprentice'); - if (me.amount >= 100) CM.Sim.Win('Charms and enchantments'); - if (me.amount >= 150) CM.Sim.Win('Curses and maledictions'); - if (me.amount >= 200) CM.Sim.Win('Magic kingdom'); - } - else if (i == 'Shipment') { - if (me.amount >= 1) CM.Sim.Win('Expedition'); - if (me.amount >= 50) CM.Sim.Win('Galactic highway'); - if (me.amount >= 100) CM.Sim.Win('Far far away'); - if (me.amount >= 150) CM.Sim.Win('Type II civilization'); - if (me.amount >= 200) CM.Sim.Win('We come in peace'); - } - else if (i == 'Alchemy lab') { - if (me.amount >= 1) CM.Sim.Win('Transmutation'); - if (me.amount >= 50) CM.Sim.Win('Transmogrification'); - if (me.amount >= 100) CM.Sim.Win('Gold member'); - if (me.amount >= 150) CM.Sim.Win('Gild wars'); - if (me.amount >= 200) CM.Sim.Win('The secrets of the universe'); - } - else if (i == 'Portal') { - if (me.amount >= 1) CM.Sim.Win('A whole new world'); - if (me.amount >= 50) CM.Sim.Win('Now you\'re thinking'); - if (me.amount >= 100) CM.Sim.Win('Dimensional shift'); - if (me.amount >= 150) CM.Sim.Win('Brain-split'); - if (me.amount >= 200) CM.Sim.Win('Realm of the Mad God'); - } - else if (i == 'Time machine') { - if (me.amount >= 1) CM.Sim.Win('Time warp'); - if (me.amount >= 50) CM.Sim.Win('Alternate timeline'); - if (me.amount >= 100) CM.Sim.Win('Rewriting history'); - if (me.amount >= 150) CM.Sim.Win('Time duke'); - if (me.amount >= 200) CM.Sim.Win('Forever and ever'); - } - else if (i == 'Antimatter condenser') { - if (me.amount >= 1) CM.Sim.Win('Antibatter'); - if (me.amount >= 50) CM.Sim.Win('Quirky quarks'); - if (me.amount >= 100) CM.Sim.Win('It does matter!'); - if (me.amount >= 150) CM.Sim.Win('Molecular maestro'); - if (me.amount >= 200) CM.Sim.Win('Walk the planck'); - } - else if (i == 'Prism') { - if (me.amount >= 1) CM.Sim.Win('Lone photon'); - if (me.amount >= 50) CM.Sim.Win('Dazzling glimmer'); - if (me.amount >= 100) CM.Sim.Win('Blinding flash'); - if (me.amount >= 150) CM.Sim.Win('Unending glow'); - if (me.amount >= 200) CM.Sim.Win('Rise and shine'); + else { + for (var j in Game.Objects[me.name].tieredAchievs) { + if (me.amount >= Game.Tiers[Game.Objects[me.name].tieredAchievs[j].tier].achievUnlock) + CM.Sim.Win(Game.Objects[me.name].tieredAchievs[j].name); + } } var lastAchievementsOwned = CM.Sim.AchievementsOwned; @@ -2454,11 +2435,11 @@ CM.Sim.BuyBuildings = function(amount, target) { CM.Sim.BuyUpgrades = function() { CM.Cache.Upgrades = []; for (var i in Game.Upgrades) { - if (Game.Upgrades[i].bought == 0 && Game.Upgrades[i].unlocked && Game.Upgrades[i].pool != 'prestige') { + if (Game.Upgrades[i].pool == 'toggle' || (Game.Upgrades[i].bought == 0 && Game.Upgrades[i].unlocked && Game.Upgrades[i].pool != 'prestige')) { CM.Sim.CopyData(); var me = CM.Sim.Upgrades[i]; me.bought = 1; - if (Game.Upgrades[i].pool == '' || Game.Upgrades[i].pool == 'cookie') CM.Sim.UpgradesOwned++; + if (Game.Upgrades[i].pool == '' || Game.Upgrades[i].pool == 'cookie' || Game.Upgrades[i].pool == 'tech') CM.Sim.UpgradesOwned++; if (i == 'Elder Pledge') { CM.Sim.pledges++; @@ -2502,7 +2483,8 @@ CM.Sim.ResetBonus = function() { 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 >= 1000000000000000000000000000000) CM.Sim.Win('Negative void'); + if (Game.cookiesEarned >= 1000000000000000000000000000000000) CM.Sim.Win('To crumbs, you say?'); var lastAchievementsOwned = CM.Sim.AchievementsOwned; diff --git a/src/Disp.js b/src/Disp.js index d7e0373..681223d 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -295,7 +295,8 @@ CM.Disp.CreateTimerBar = function() { CM.Disp.TimerBarCF.style.height = '12px'; CM.Disp.TimerBarCF.style.margin = '0px 10px'; CM.Disp.TimerBarCF.style.position = 'relative'; - CM.Disp.TimerBarCF.appendChild(bar('Click Frenzy', [{id: 'CMTimerBarCFBar', color: CM.Disp.colorBlue}], 'CMTimerBarCFTime')); + CM.Disp.TimerBarCF.appendChild(bar('', [{id: 'CMTimerBarCFBar'}], 'CMTimerBarCFTime')); + CM.Disp.TimerBarCF.firstChild.firstChild.id = 'CMTimerBarCFType'; CM.Disp.TimerBar.appendChild(CM.Disp.TimerBarCF); l('wrapper').appendChild(CM.Disp.TimerBar); @@ -371,6 +372,10 @@ CM.Disp.UpdateTimerBar = function() { l('CMTimerBarFrenType').textContent = 'Clot'; l('CMTimerBarFrenBar').className = CM.Disp.colorBackPre + CM.Disp.colorRed; } + else if (Game.frenzyPower == 15) { + l('CMTimerBarFrenType').textContent = 'Dragon Harvest'; + l('CMTimerBarFrenBar').className = CM.Disp.colorBackPre + CM.Disp.colorPurple; + } else { l('CMTimerBarFrenType').textContent = 'Blood Frenzy'; l('CMTimerBarFrenBar').className = CM.Disp.colorBackPre + CM.Disp.colorGreen; @@ -385,6 +390,14 @@ CM.Disp.UpdateTimerBar = function() { if (Game.clickFrenzy > 0) { CM.Disp.TimerBarCF.style.display = ''; + if (Game.clickFrenzyPower == 777) { + l('CMTimerBarCFType').textContent = 'Click Frenzy'; + l('CMTimerBarCFBar').className = CM.Disp.colorBackPre + CM.Disp.colorBlue; + } + else { + l('CMTimerBarCFType').textContent = 'Dragonflight'; + l('CMTimerBarCFBar').className = CM.Disp.colorBackPre + CM.Disp.colorPurple; + } l('CMTimerBarCFBar').style.width = Math.round(Game.clickFrenzy * maxWidth / Game.clickFrenzyMax) + 'px'; l('CMTimerBarCFTime').textContent = Math.ceil(Game.clickFrenzy / Game.fps); count++; @@ -406,8 +419,13 @@ CM.Disp.UpdateTimerBar = function() { CM.Disp.UpdateBotTimerBarDisplay = function() { if (Game.OnAscend) { l('game').style.bottom = '0px'; + CM.Disp.BotBar.style.display = 'none'; + CM.Disp.TimerBar.style.display = 'none'; + CM.Disp.GCTimer.style.display = 'none'; } else { + CM.Disp.BotBar.style.display = ''; + CM.Disp.TimerBar.style.display = ''; if (CM.Config.BotBar == 1 && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { CM.Disp.BotBar.style.bottom = '48px'; l('game').style.bottom = '104px'; @@ -872,7 +890,7 @@ CM.Disp.AddMenuPref = function(title) { l('menu').childNodes[2].insertBefore(frag, l('menu').childNodes[2].childNodes[l('menu').childNodes[2].childNodes.length - 1]); CM.Disp.FormatButtonOnClickBak = l('formatButton').onclick; - l('formatButton').onclick = function() {Game.Toggle('format', 'formatButton', 'Short numbers OFF', 'Short numbers ON'); CM.Disp.RefreshScale();}; + l('formatButton').onclick = function() {Game.Toggle('format', 'formatButton', 'Short numbers OFF', 'Short numbers ON', '1'); PlaySound('snd/tick.mp3'); CM.Disp.RefreshScale();}; } CM.Disp.AddMenuStats = function(title) { @@ -1006,8 +1024,9 @@ CM.Disp.AddMenuStats = function(title) { hcMaxFrag.appendChild(document.createTextNode(Beautify(possibleHC))); stats.appendChild(listing('Heavenly Chips (MAX)', hcMaxFrag)); var hcCurFrag = document.createDocumentFragment(); - hcCurFrag.appendChild(document.createTextNode(Beautify(Game.heavenlyChipsEarned))); - stats.appendChild(listing('Heavenly Chips (CUR)', hcCurFrag)); + // Remove all chip stats? + //hcCurFrag.appendChild(document.createTextNode(Beautify(Game.heavenlyChipsEarned))); + //stats.appendChild(listing('Heavenly Chips (CUR)', hcCurFrag)); stats.appendChild(listing('Cookies To Next Chip', document.createTextNode(Beautify(neededCook)))); stats.appendChild(listing('Time To Next Chip', document.createTextNode(CM.Disp.FormatTime(neededCook / (Game.cookiesPs * (1 - Game.cpsSucked)), 1)))); // Unneeded? @@ -1045,18 +1064,20 @@ CM.Disp.AddMenuStats = function(title) { if (Game.cpsSucked > 0) { stats.appendChild(header('Wrinklers', 'Wrink')); if (CM.Config.StatsPref.Wrink || (CM.Config.StatsPref.Sea && choEgg)) { - var sucked = 0; + var totalSucked = 0; for (var i in Game.wrinklers) { - sucked += Game.wrinklers[i].sucked; + var sucked = Game.wrinklers[i].sucked; + var toSuck = 1.1; + if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; + if (Game.wrinklers[i].type==1) toSuck *= 3; //shiny wrinklers are an elusive, profitable breed + sucked *= toSuck; + if (Game.Has('Wrinklerspawn')) sucked *= 1.05; + totalSucked += sucked; } - var toSuck = 1.1; - if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; - sucked *= toSuck; - if (Game.Has('Wrinklerspawn')) sucked *= 1.05; if (CM.Config.StatsPref.Wrink) { var popAllFrag = document.createDocumentFragment(); - popAllFrag.appendChild(document.createTextNode(Beautify(sucked) + ' ')); + popAllFrag.appendChild(document.createTextNode(Beautify(totalSucked) + ' ')); var popAllA = document.createElement('a'); popAllA.textContent = 'Pop All'; popAllA.className = 'option'; @@ -1205,7 +1226,7 @@ CM.Disp.RefreshMenu = function() { } CM.Disp.UpdateTooltipLocation = function() { - Game.tooltip.tta.style.top = Math.max(0, Math.min((l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - CM.Disp.TooltipWarnCaut.clientHeight - 64, Game.mouseY - 48)) + 'px'; + Game.tooltip.tta.style.top = Math.max(0, Math.min((l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - CM.Disp.TooltipWarnCaut.clientHeight - 38, Game.mouseY - 48)) + 'px'; if (Game.tooltip.origin == 'wrink') { Game.tooltip.tta.style.left = (Game.mouseX + l('tooltip').offsetWidth + 25) + 'px'; Game.tooltip.tta.style.right = 'auto'; @@ -1280,7 +1301,7 @@ CM.Disp.AddTooltipBuild = function() { var me = Game.Objects[i]; if (l('product' + me.id).onmouseover != null) { CM.Disp.TooltipBuildBack[i] = l('product' + me.id).onmouseover; - eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\');}'); + eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}'); } } } @@ -1291,7 +1312,7 @@ CM.Disp.AddTooltipUpgrade = function() { var me = Game.UpgradesInStore[i]; if (l('upgrade' + i).onmouseover != null) { CM.Disp.TooltipUpgradeBack[i] = l('upgrade' + i).onmouseover; - eval('l(\'upgrade\' + i).onmouseover = function() {CM.Disp.Tooltip(\'u\', \'' + i + '\');}'); + eval('l(\'upgrade\' + i).onmouseover = function() {if (!Game.mouseDown) {Game.setOnCrate(this); Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'u\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}}'); } } } @@ -1329,7 +1350,7 @@ CM.Disp.Tooltip = function(type, name) { } } else { // Upgrades - CM.Disp.TooltipUpgradeBack[name](); + l('tooltip').innerHTML = Game.crate(Game.UpgradesInStore[name], 'store', undefined, undefined, 1)(); } var area = document.createElement('div'); @@ -1375,9 +1396,9 @@ CM.Disp.Tooltip = function(type, name) { CM.Disp.UpdateTooltip(); - if (type == 'b') { +// if (type == 'b') { return l('tooltip').innerHTML; - } +// } } CM.Disp.UpdateTooltip = function() { @@ -1544,6 +1565,7 @@ CM.Disp.UpdateWrinklerTooltip = function() { var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked; var toSuck = 1.1; if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; + if (Game.wrinklers[CM.Disp.TooltipWrinkler].type == 1) toSuck *= 3; //shiny wrinklers are an elusive, profitable breed sucked *= toSuck; if (Game.Has('Wrinklerspawn')) sucked *= 1.05; l('CMTooltipWrinkler').textContent = Beautify(sucked); diff --git a/src/Main.js b/src/Main.js index 8374b93..83cb293 100644 --- a/src/Main.js +++ b/src/Main.js @@ -125,6 +125,7 @@ CM.Init = function() { } CM.DelayInit = function() { + CM.Sim.InitData(); CM.Disp.CreateCssArea(); CM.Disp.CreateBotBar(); CM.Disp.CreateTimerBar(); @@ -143,7 +144,7 @@ CM.DelayInit = function() { CM.Disp.lastAscendState = Game.OnAscend; if (Game.prefs.popups) Game.Popup('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!'); - else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!','','',1); + else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!','','',1, 1); Game.Win('Third-party'); } diff --git a/src/Sim.js b/src/Sim.js index 0444d29..04b36ec 100644 --- a/src/Sim.js +++ b/src/Sim.js @@ -11,6 +11,7 @@ CM.Sim.BuildingGetPrice = function(basePrice, start, increase) { if (Game.Has('Santa\'s dominion')) price *= 0.99; if (Game.Has('Faberge egg')) price *= 0.99; if (Game.Has('Divine discount')) price *= 0.99; + if (Game.hasAura('Fierce Hoarder')) price *= 0.98; totalPrice += Math.ceil(price); count++; } @@ -20,7 +21,9 @@ CM.Sim.BuildingGetPrice = function(basePrice, start, increase) { CM.Sim.BuildingSell = function(basePrice, start, amount) { var totalMoni = 0; while (amount > 0) { - totalMoni += Math.floor(CM.Sim.BuildingGetPrice(basePrice, start, 1) * 0.5); + var giveBack = 0.5; + if (Game.hasAura('Earth Shatterer')) giveBack = 0.85; + totalMoni += Math.floor(CM.Sim.BuildingGetPrice(basePrice, start, 1) * giveBack); start--; amount--; } @@ -33,27 +36,34 @@ CM.Sim.Win = function(what) { if (CM.Sim.Achievements[what]) { if (CM.Sim.Achievements[what].won == 0) { CM.Sim.Achievements[what].won = 1; - if (Game.Achievements[what].hide != 3) CM.Sim.AchievementsOwned++; + if (Game.Achievements[what].pool != 'shadow') CM.Sim.AchievementsOwned++; } } } eval('CM.Sim.HasAchiev = ' + Game.HasAchiev.toString().split('Game').join('CM.Sim')); -CM.Sim.CopyData = function() { - // Other variables - CM.Sim.UpgradesOwned = Game.UpgradesOwned; - CM.Sim.pledges = Game.pledges; - CM.Sim.AchievementsOwned = Game.AchievementsOwned; - +eval('CM.Sim.GetHeavenlyMultiplier = ' + Game.GetHeavenlyMultiplier.toString().split('Game').join('CM.Sim')); + +CM.Sim.hasAura = function(what) { + if (Game.dragonAuras[CM.Sim.dragonAura].name == what || Game.dragonAuras[CM.Sim.dragonAura2].name == what) + return true; + else + return false; +} + +eval('CM.Sim.GetTieredCpsMult = ' + Game.GetTieredCpsMult.toString().split('Game.Has').join('CM.Sim.Has').split('me.tieredUpgrades').join('Game.Objects[me.name].tieredUpgrades').split('me.synergies').join('Game.Objects[me.name].synergies').split('syn.buildingTie1.amount').join('CM.Sim.Objects[syn.buildingTie1.name].amount').split('syn.buildingTie2.amount').join('CM.Sim.Objects[syn.buildingTie2.name].amount')); + +eval('CM.Sim.getGrandmaSynergyUpgradeMultiplier = ' + Game.getGrandmaSynergyUpgradeMultiplier.toString().split('Game.Objects[\'Grandma\']').join('CM.Sim.Objects[\'Grandma\']')); + +CM.Sim.InitData = function() { // Buildings CM.Sim.Objects = []; for (var i in Game.Objects) { CM.Sim.Objects[i] = {}; var me = Game.Objects[i]; var you = CM.Sim.Objects[i]; - you.amount = me.amount; - eval('you.cps = ' + me.cps.toString().split('Game.Has').join('CM.Sim.Has').split('Game.Objects').join('CM.Sim.Objects')); + eval('you.cps = ' + me.cps.toString().split('Game.Has').join('CM.Sim.Has').split('Game.hasAura').join('CM.Sim.hasAura').split('Game.Objects').join('CM.Sim.Objects').split('Game.GetTieredCpsMult').join('CM.Sim.GetTieredCpsMult').split('Game.getGrandmaSynergyUpgradeMultiplier').join('CM.Sim.getGrandmaSynergyUpgradeMultiplier')); // Below is needed for above eval! you.baseCps = me.baseCps; you.name = me.name; @@ -63,15 +73,41 @@ CM.Sim.CopyData = function() { CM.Sim.Upgrades = []; for (var i in Game.Upgrades) { CM.Sim.Upgrades[i] = {}; - var me = Game.Upgrades[i]; - var you = CM.Sim.Upgrades[i]; - you.bought = me.bought; } // Achievements CM.Sim.Achievements = []; for (var i in Game.Achievements) { CM.Sim.Achievements[i] = {}; + } +} + +CM.Sim.CopyData = function() { + // Other variables + CM.Sim.UpgradesOwned = Game.UpgradesOwned; + CM.Sim.pledges = Game.pledges; + CM.Sim.AchievementsOwned = Game.AchievementsOwned; + CM.Sim.heavenlyPower = Game.heavenlyPower; + CM.Sim.prestige = Game.prestige; + CM.Sim.dragonAura = Game.dragonAura; + CM.Sim.dragonAura2 = Game.dragonAura2; + + // Buildings + for (var i in Game.Objects) { + var me = Game.Objects[i]; + var you = CM.Sim.Objects[i]; + you.amount = me.amount; + } + + // Upgrades + for (var i in Game.Upgrades) { + var me = Game.Upgrades[i]; + var you = CM.Sim.Upgrades[i]; + you.bought = me.bought; + } + + // Achievements + for (var i in Game.Achievements) { var me = Game.Achievements[i]; var you = CM.Sim.Achievements[i]; you.won = me.won; @@ -83,20 +119,18 @@ CM.Sim.CalculateGains = function() { CM.Sim.cookiesPs = 0; var mult = 1; - var heavenlyMult = 0; - if (CM.Sim.Has('Heavenly chip secret')) heavenlyMult += 0.05; - if (CM.Sim.Has('Heavenly cookie stand')) heavenlyMult += 0.20; - if (CM.Sim.Has('Heavenly bakery')) heavenlyMult += 0.25; - if (CM.Sim.Has('Heavenly confectionery')) heavenlyMult += 0.25; - if (CM.Sim.Has('Heavenly key')) heavenlyMult += 0.25; - mult += parseFloat(Game.heavenlyCookies) *0.1 * heavenlyMult; + var heavenlyMult = CM.Sim.GetHeavenlyMultiplier(); + mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * heavenlyMult; + var cookieMult = 0; for (var i in CM.Sim.Upgrades) { var me = CM.Sim.Upgrades[i]; if (me.bought > 0) { - if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) mult *= (1 + (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power) * 0.01); + if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) cookieMult += (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power); } } + + mult *= (1 + 0.01 * cookieMult); if (CM.Sim.Has('Specialized chocolate chips')) mult *= 1.01; if (CM.Sim.Has('Designer cocoa beans')) mult *= 1.02; if (CM.Sim.Has('Underworld ovens')) mult *= 1.03; @@ -109,7 +143,7 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('An itchy sweater')) mult *= 1.01; if (CM.Sim.Has('Santa\'s dominion')) mult *= 1.2; - if (CM.Sim.Has('Santa\'s legacy')) mult *= (Game.santaLevel + 1) * 0.05; + if (CM.Sim.Has('Santa\'s legacy')) mult *= 1 + (Game.santaLevel + 1) * 0.05; for (var i in CM.Sim.Objects) { var me = CM.Sim.Objects[i]; @@ -117,14 +151,18 @@ CM.Sim.CalculateGains = function() { } if (CM.Sim.Has('"egg"')) CM.Sim.cookiesPs += 9; // "egg" - if (CM.Sim.Has('"god"')) CM.Sim.cookiesPs += 9;// "god" - var milkMult = CM.Sim.Has('Santa\'s milk and cookies') ? 1.05 : 1; + var milkMult=1; + if (CM.Sim.Has('Santa\'s milk and cookies')) milkMult *= 1.05; + if (CM.Sim.hasAura('Breath of Milk')) milkMult *= 1.05; if (CM.Sim.Has('Kitten helpers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.05 * milkMult); if (CM.Sim.Has('Kitten workers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); if (CM.Sim.Has('Kitten engineers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); if (CM.Sim.Has('Kitten overseers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * 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 angels')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); var eggMult = 0; @@ -147,16 +185,29 @@ CM.Sim.CalculateGains = function() { eggMult += (1 - Math.pow(1 - day / 100, 3)) * 10; } mult *= (1 + 0.01 * eggMult); - + + if (CM.Sim.hasAura('Radiant Appetite')) mult *= 2; + var rawCookiesPs = CM.Sim.cookiesPs * mult; - for (var i = 0; i < Game.cpsAchievs.length / 2; i++) { - if (rawCookiesPs >= Game.cpsAchievs[i * 2 + 1]) CM.Sim.Win(Game.cpsAchievs[i * 2]); + for (var i in Game.CpsAchievements) { + if (rawCookiesPs >= Game.CpsAchievements[i].threshold) CM.Sim.Win(Game.CpsAchievements[i].name); } if (Game.frenzy > 0) mult *= Game.frenzyPower; if (CM.Sim.Has('Elder Covenant')) mult *= 0.95; + if (CM.Sim.Has('Golden switch [off]')) { + var goldenSwitchMult = 1.25; + if (CM.Sim.Has('Residual luck')) { + var upgrades = ['Get lucky', 'Lucky day', 'Serendipity', 'Heavenly luck', 'Lasting fortune', 'Decisive fate']; + for (var i in upgrades) { + if (CM.Sim.Has(upgrades[i])) goldenSwitchMult += 0.01; + } + } + mult *= goldenSwitchMult; + } + CM.Sim.cookiesPs *= mult; }; @@ -173,40 +224,28 @@ CM.Sim.CheckOtherAchiev = function() { if (CM.Sim.Has('Rainbow grandmas')) grandmas++; if (!CM.Sim.HasAchiev('Elder') && grandmas >= 7) CM.Sim.Win('Elder'); + // Redo? var buildingsOwned = 0; - var oneOfEach = 1; var mathematician = 1; var base10 = 1; - var centennial = 1; - var centennialhalf = 1; - var bicentennial = 1; + var minAmount = 100000; for (var i in CM.Sim.Objects) { buildingsOwned += CM.Sim.Objects[i].amount; - if (!CM.Sim.HasAchiev('One with everything')) { - if (CM.Sim.Objects[i].amount == 0) oneOfEach = 0; - } + minAmount = Math.min(CM.Sim.Objects[i].amount, minAmount); if (!CM.Sim.HasAchiev('Mathematician')) { if (CM.Sim.Objects[i].amount < Math.min(128, Math.pow(2, (Game.ObjectsById.length - Game.Objects[i].id) - 1))) mathematician = 0; } if (!CM.Sim.HasAchiev('Base 10')) { if (CM.Sim.Objects[i].amount < (Game.ObjectsById.length - Game.Objects[i].id)*10) base10 = 0; } - if (!CM.Sim.HasAchiev('Centennial')) { - if (CM.Sim.Objects[i].amount < 100) centennial = 0; - } - if (!CM.Sim.HasAchiev('Centennial and a half')) { - if (CM.Sim.Objects[i].amount < 150) centennialhalf = 0; - } - if (!CM.Sim.HasAchiev('Bicentennial')) { - if (CM.Sim.Objects[i].amount < 200) bicentennial = 0; - } } - if (oneOfEach == 1) CM.Sim.Win('One with everything'); + if (minAmount >= 1) CM.Sim.Win('One with everything'); if (mathematician == 1) CM.Sim.Win('Mathematician'); if (base10 == 1) CM.Sim.Win('Base 10'); - if (centennial == 1) CM.Sim.Win('Centennial'); - if (centennialhalf == 1) CM.Sim.Win('Centennial and a half'); - if (bicentennial == 1) CM.Sim.Win('Bicentennial'); + if (minAmount >= 100) CM.Sim.Win('Centennial'); + if (minAmount >= 150) CM.Sim.Win('Centennial and a half'); + if (minAmount >= 200) CM.Sim.Win('Bicentennial'); + if (minAmount >= 250) CM.Sim.Win('Bicentennial and a half'); if (buildingsOwned >= 100) CM.Sim.Win('Builder'); if (buildingsOwned >= 500) CM.Sim.Win('Architect'); @@ -216,7 +255,11 @@ CM.Sim.CheckOtherAchiev = function() { if (CM.Sim.UpgradesOwned >= 20) CM.Sim.Win('Enhancer'); if (CM.Sim.UpgradesOwned >= 50) CM.Sim.Win('Augmenter'); if (CM.Sim.UpgradesOwned >= 100) CM.Sim.Win('Upgrader'); - if (CM.Sim.UpgradesOwned >= 150) CM.Sim.Win('Lord of Progress'); + if (CM.Sim.UpgradesOwned >= 200) CM.Sim.Win('Lord of Progress'); + + if (buildingsOwned >= 3000 && CM.Sim.UpgradesOwned >= 300) CM.Sim.Win('Polymath'); + + if (CM.Sim.Objects['Cursor'].amount + CM.Sim.Objects['Grandma'].amount >= 777) CM.Sim.Win('The elder scrolls'); var hasAllHalloCook = true; for (var i in CM.Data.HalloCookies) { @@ -246,98 +289,13 @@ CM.Sim.BuyBuildings = function(amount, target) { if (me.amount >= 200) CM.Sim.Win('The Digital'); if (me.amount >= 300) CM.Sim.Win('Extreme polydactyly'); if (me.amount >= 400) CM.Sim.Win('Dr. T'); + if (me.amount >= 500) CM.Sim.Win('Thumbs, phalanges, metacarpals'); } - else if (i == 'Grandma') { - if (me.amount >= 1) CM.Sim.Win('Grandma\'s cookies'); - if (me.amount >= 50) CM.Sim.Win('Sloppy kisses'); - if (me.amount >= 100) CM.Sim.Win('Retirement home'); - if (me.amount >= 150) CM.Sim.Win('Friend of the ancients'); - if (me.amount >= 200) CM.Sim.Win('Ruler of the ancients'); - if (me.amount >= 250) CM.Sim.Win('The old never bothered me anyway'); - } - else if (i == 'Farm') { - if (me.amount >= 1) CM.Sim.Win('My first farm'); - if (me.amount >= 50) CM.Sim.Win('Reap what you sow'); - if (me.amount >= 100) CM.Sim.Win('Farm ill'); - if (me.amount >= 150) CM.Sim.Win('Perfected agriculture'); - if (me.amount >= 200) CM.Sim.Win('Homegrown'); - } - else if (i == 'Mine') { - if (me.amount >= 1) CM.Sim.Win('You know the drill'); - if (me.amount >= 50) CM.Sim.Win('Excavation site'); - if (me.amount >= 100) CM.Sim.Win('Hollow the planet'); - if (me.amount >= 150) CM.Sim.Win('Can you dig it'); - if (me.amount >= 200) CM.Sim.Win('The center of the Earth'); - } - else if (i == 'Factory') { - if (me.amount >= 1) CM.Sim.Win('Production chain'); - if (me.amount >= 50) CM.Sim.Win('Industrial revolution'); - if (me.amount >= 100) CM.Sim.Win('Global warming'); - if (me.amount >= 150) CM.Sim.Win('Ultimate automation'); - if (me.amount >= 200) CM.Sim.Win('Technocracy'); - } - else if (i == 'Bank') { - if (me.amount >= 1) CM.Sim.Win('Pretty penny'); - if (me.amount >= 50) CM.Sim.Win('Fit the bill'); - if (me.amount >= 100) CM.Sim.Win('A loan in the dark'); - if (me.amount >= 150) CM.Sim.Win('Need for greed'); - if (me.amount >= 200) CM.Sim.Win('It\'s the economy, stupid'); - } - else if (i == 'Temple') { - if (me.amount >= 1) CM.Sim.Win('Your time to shrine'); - if (me.amount >= 50) CM.Sim.Win('Shady sect'); - if (me.amount >= 100) CM.Sim.Win('New-age cult'); - if (me.amount >= 150) CM.Sim.Win('Organized religion'); - if (me.amount >= 200) CM.Sim.Win('Fanaticism'); - } - else if (i == 'Wizard tower') { - if (me.amount >= 1) CM.Sim.Win('Bewitched'); - if (me.amount >= 50) CM.Sim.Win('The sorcerer\'s apprentice'); - if (me.amount >= 100) CM.Sim.Win('Charms and enchantments'); - if (me.amount >= 150) CM.Sim.Win('Curses and maledictions'); - if (me.amount >= 200) CM.Sim.Win('Magic kingdom'); - } - else if (i == 'Shipment') { - if (me.amount >= 1) CM.Sim.Win('Expedition'); - if (me.amount >= 50) CM.Sim.Win('Galactic highway'); - if (me.amount >= 100) CM.Sim.Win('Far far away'); - if (me.amount >= 150) CM.Sim.Win('Type II civilization'); - if (me.amount >= 200) CM.Sim.Win('We come in peace'); - } - else if (i == 'Alchemy lab') { - if (me.amount >= 1) CM.Sim.Win('Transmutation'); - if (me.amount >= 50) CM.Sim.Win('Transmogrification'); - if (me.amount >= 100) CM.Sim.Win('Gold member'); - if (me.amount >= 150) CM.Sim.Win('Gild wars'); - if (me.amount >= 200) CM.Sim.Win('The secrets of the universe'); - } - else if (i == 'Portal') { - if (me.amount >= 1) CM.Sim.Win('A whole new world'); - if (me.amount >= 50) CM.Sim.Win('Now you\'re thinking'); - if (me.amount >= 100) CM.Sim.Win('Dimensional shift'); - if (me.amount >= 150) CM.Sim.Win('Brain-split'); - if (me.amount >= 200) CM.Sim.Win('Realm of the Mad God'); - } - else if (i == 'Time machine') { - if (me.amount >= 1) CM.Sim.Win('Time warp'); - if (me.amount >= 50) CM.Sim.Win('Alternate timeline'); - if (me.amount >= 100) CM.Sim.Win('Rewriting history'); - if (me.amount >= 150) CM.Sim.Win('Time duke'); - if (me.amount >= 200) CM.Sim.Win('Forever and ever'); - } - else if (i == 'Antimatter condenser') { - if (me.amount >= 1) CM.Sim.Win('Antibatter'); - if (me.amount >= 50) CM.Sim.Win('Quirky quarks'); - if (me.amount >= 100) CM.Sim.Win('It does matter!'); - if (me.amount >= 150) CM.Sim.Win('Molecular maestro'); - if (me.amount >= 200) CM.Sim.Win('Walk the planck'); - } - else if (i == 'Prism') { - if (me.amount >= 1) CM.Sim.Win('Lone photon'); - if (me.amount >= 50) CM.Sim.Win('Dazzling glimmer'); - if (me.amount >= 100) CM.Sim.Win('Blinding flash'); - if (me.amount >= 150) CM.Sim.Win('Unending glow'); - if (me.amount >= 200) CM.Sim.Win('Rise and shine'); + else { + for (var j in Game.Objects[me.name].tieredAchievs) { + if (me.amount >= Game.Tiers[Game.Objects[me.name].tieredAchievs[j].tier].achievUnlock) + CM.Sim.Win(Game.Objects[me.name].tieredAchievs[j].name); + } } var lastAchievementsOwned = CM.Sim.AchievementsOwned; @@ -358,11 +316,11 @@ CM.Sim.BuyBuildings = function(amount, target) { CM.Sim.BuyUpgrades = function() { CM.Cache.Upgrades = []; for (var i in Game.Upgrades) { - if (Game.Upgrades[i].bought == 0 && Game.Upgrades[i].unlocked && Game.Upgrades[i].pool != 'prestige') { + if (Game.Upgrades[i].pool == 'toggle' || (Game.Upgrades[i].bought == 0 && Game.Upgrades[i].unlocked && Game.Upgrades[i].pool != 'prestige')) { CM.Sim.CopyData(); var me = CM.Sim.Upgrades[i]; me.bought = 1; - if (Game.Upgrades[i].pool == '' || Game.Upgrades[i].pool == 'cookie') CM.Sim.UpgradesOwned++; + if (Game.Upgrades[i].pool == '' || Game.Upgrades[i].pool == 'cookie' || Game.Upgrades[i].pool == 'tech') CM.Sim.UpgradesOwned++; if (i == 'Elder Pledge') { CM.Sim.pledges++; @@ -406,7 +364,8 @@ CM.Sim.ResetBonus = function() { 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 >= 1000000000000000000000000000000) CM.Sim.Win('Negative void'); + if (Game.cookiesEarned >= 1000000000000000000000000000000000) CM.Sim.Win('To crumbs, you say?'); var lastAchievementsOwned = CM.Sim.AchievementsOwned; From da3200612b77d814848abe72d36f982d82345187 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Sat, 26 Dec 2015 21:27:41 -0500 Subject: [PATCH 13/26] Fixed bar display glitches related to ascend changes --- CookieMonster.js | 56 ++++++++++++++++++++++++++---------------------- src/Disp.js | 48 ++++++++++++++++++++++------------------- src/Main.js | 8 +++---- 3 files changed, 60 insertions(+), 52 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index edd8463..cfb48a4 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -755,29 +755,19 @@ CM.Disp.UpdateTimerBar = function() { } CM.Disp.UpdateBotTimerBarDisplay = function() { - if (Game.OnAscend) { - l('game').style.bottom = '0px'; - CM.Disp.BotBar.style.display = 'none'; - CM.Disp.TimerBar.style.display = 'none'; - CM.Disp.GCTimer.style.display = 'none'; + if (CM.Config.BotBar == 1 && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { + CM.Disp.BotBar.style.bottom = '48px'; + l('game').style.bottom = '104px'; } - else { - CM.Disp.BotBar.style.display = ''; - CM.Disp.TimerBar.style.display = ''; - if (CM.Config.BotBar == 1 && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { - CM.Disp.BotBar.style.bottom = '48px'; - l('game').style.bottom = '104px'; - } - else if (CM.Config.BotBar == 1) { - CM.Disp.BotBar.style.bottom = '0px'; - l('game').style.bottom = '56px'; - } - else if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { - l('game').style.bottom = '48px'; - } - else { // No bars - l('game').style.bottom = '0px'; - } + else if (CM.Config.BotBar == 1) { + CM.Disp.BotBar.style.bottom = '0px'; + l('game').style.bottom = '56px'; + } + else if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { + l('game').style.bottom = '48px'; + } + else { // No bars + l('game').style.bottom = '0px'; } if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { @@ -1910,6 +1900,20 @@ CM.Disp.UpdateWrinklerTooltip = function() { } } +CM.Disp.UpdateAscendState = function() { + if (Game.OnAscend) { + l('game').style.bottom = '0px'; + if (CM.Config.BotBar == 1) CM.Disp.BotBar.style.display = 'none'; + if (CM.Config.TimerBar == 1) CM.Disp.TimerBar.style.display = 'none'; + } + else { + CM.Disp.ToggleBotBar(); + CM.Disp.ToggleTimerBar(); + } + + CM.Disp.UpdateBackground(); +} + CM.Disp.ToggleSayTime = function() { if (CM.Config.SayTime == 1) { Game.sayTime = CM.Disp.sayTime; @@ -2029,7 +2033,7 @@ CM.ReplaceNative = function() { CM.Loop = function() { if (CM.Disp.lastAscendState != Game.OnAscend) { CM.Disp.lastAscendState = Game.OnAscend; - CM.Disp.UpdateBotTimerBarDisplay(); + CM.Disp.UpdateAscendState(); } if (!Game.OnAscend && Game.AscendTimer == 0) { if (CM.Sim.DoSims) { @@ -2058,15 +2062,15 @@ CM.Loop = function() { CM.Disp.CheckWrinklerTooltip(); CM.Disp.UpdateWrinklerTooltip(); - // Check Golden Cookies - CM.Disp.CheckGoldenCookie(); - // Update Title CM.Disp.UpdateTitle(); // Change menu refresh interval CM.Disp.RefreshMenu(); } + + // Check Golden Cookies + CM.Disp.CheckGoldenCookie(); } CM.Init = function() { diff --git a/src/Disp.js b/src/Disp.js index 681223d..f23f76e 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -417,29 +417,19 @@ CM.Disp.UpdateTimerBar = function() { } CM.Disp.UpdateBotTimerBarDisplay = function() { - if (Game.OnAscend) { - l('game').style.bottom = '0px'; - CM.Disp.BotBar.style.display = 'none'; - CM.Disp.TimerBar.style.display = 'none'; - CM.Disp.GCTimer.style.display = 'none'; + if (CM.Config.BotBar == 1 && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { + CM.Disp.BotBar.style.bottom = '48px'; + l('game').style.bottom = '104px'; } - else { - CM.Disp.BotBar.style.display = ''; - CM.Disp.TimerBar.style.display = ''; - if (CM.Config.BotBar == 1 && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { - CM.Disp.BotBar.style.bottom = '48px'; - l('game').style.bottom = '104px'; - } - else if (CM.Config.BotBar == 1) { - CM.Disp.BotBar.style.bottom = '0px'; - l('game').style.bottom = '56px'; - } - else if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { - l('game').style.bottom = '48px'; - } - else { // No bars - l('game').style.bottom = '0px'; - } + else if (CM.Config.BotBar == 1) { + CM.Disp.BotBar.style.bottom = '0px'; + l('game').style.bottom = '56px'; + } + else if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 1) { + l('game').style.bottom = '48px'; + } + else { // No bars + l('game').style.bottom = '0px'; } if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { @@ -1572,6 +1562,20 @@ CM.Disp.UpdateWrinklerTooltip = function() { } } +CM.Disp.UpdateAscendState = function() { + if (Game.OnAscend) { + l('game').style.bottom = '0px'; + if (CM.Config.BotBar == 1) CM.Disp.BotBar.style.display = 'none'; + if (CM.Config.TimerBar == 1) CM.Disp.TimerBar.style.display = 'none'; + } + else { + CM.Disp.ToggleBotBar(); + CM.Disp.ToggleTimerBar(); + } + + CM.Disp.UpdateBackground(); +} + CM.Disp.ToggleSayTime = function() { if (CM.Config.SayTime == 1) { Game.sayTime = CM.Disp.sayTime; diff --git a/src/Main.js b/src/Main.js index 83cb293..9c6e4f5 100644 --- a/src/Main.js +++ b/src/Main.js @@ -67,7 +67,7 @@ CM.ReplaceNative = function() { CM.Loop = function() { if (CM.Disp.lastAscendState != Game.OnAscend) { CM.Disp.lastAscendState = Game.OnAscend; - CM.Disp.UpdateBotTimerBarDisplay(); + CM.Disp.UpdateAscendState(); } if (!Game.OnAscend && Game.AscendTimer == 0) { if (CM.Sim.DoSims) { @@ -96,15 +96,15 @@ CM.Loop = function() { CM.Disp.CheckWrinklerTooltip(); CM.Disp.UpdateWrinklerTooltip(); - // Check Golden Cookies - CM.Disp.CheckGoldenCookie(); - // Update Title CM.Disp.UpdateTitle(); // Change menu refresh interval CM.Disp.RefreshMenu(); } + + // Check Golden Cookies + CM.Disp.CheckGoldenCookie(); } CM.Init = function() { From f36869d528a091788517bbb980dd815655cf9ca8 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Sun, 27 Dec 2015 17:07:40 -0500 Subject: [PATCH 14/26] Fixed tooltip bugs, Upgrades display bug, and timer bar bug --- CookieMonster.js | 34 +++++++++++++++++++--------------- src/Disp.js | 33 ++++++++++++++++++--------------- src/Main.js | 1 + 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index cfb48a4..280fc6f 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -574,7 +574,7 @@ CM.Disp.CreateTimerBar = function() { var type = document.createElement('span'); type.style.display = 'inline-block'; type.style.textAlign = 'right'; - type.style.width = '71px'; + type.style.width = '78px'; type.style.marginRight = '5px'; type.style.verticalAlign = 'text-top'; type.textContent = name; @@ -666,8 +666,8 @@ CM.Disp.ToggleTimerBarPos = function() { CM.Disp.UpdateTimerBar = function() { if (CM.Config.TimerBar == 1) { - // label width: 76 timer width: 26 div margin: 20 - var maxWidth = CM.Disp.TimerBar.offsetWidth - 122; + // label width: 83 timer width: 26 div margin: 20 + var maxWidth = CM.Disp.TimerBar.offsetWidth - 129; var count = 0; if (Game.goldenCookie.life <= 0 && Game.goldenCookie.toDie == 0) { @@ -1554,10 +1554,13 @@ CM.Disp.RefreshMenu = function() { } CM.Disp.UpdateTooltipLocation = function() { - Game.tooltip.tta.style.top = Math.max(0, Math.min((l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - CM.Disp.TooltipWarnCaut.clientHeight - 38, Game.mouseY - 48)) + 'px'; - if (Game.tooltip.origin == 'wrink') { - Game.tooltip.tta.style.left = (Game.mouseX + l('tooltip').offsetWidth + 25) + 'px'; - Game.tooltip.tta.style.right = 'auto'; + if (Game.tooltip.origin == 'store') { + var warnCautOffset = 0; + if (CM.Config.ToolWarnCaut == 1 && CM.Config.ToolWarnCautPos == 1) warnCautOffset = CM.Disp.TooltipWarnCaut.clientHeight - 4; + Game.tooltip.tta.style.top = Math.min(parseInt(Game.tooltip.tta.style.top), (l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - warnCautOffset - 46) + 'px'; + } + else if (!Game.onCrate && !Game.OnAscend && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { + Game.tooltip.tta.style.top = (parseInt(Game.tooltip.tta.style.top) + parseInt(CM.Disp.TimerBar.style.height)) + 'px'; } } @@ -1614,11 +1617,13 @@ CM.Disp.ToggleToolWarnCaut = function() { CM.Disp.ToggleToolWarnCautPos = function() { if (CM.Config.ToolWarnCautPos == 0) { - CM.Disp.TooltipWarnCaut.style.top = '12px'; + CM.Disp.TooltipWarnCaut.style.top = 'auto'; + CM.Disp.TooltipWarnCaut.style.margin = '4px -4px'; CM.Disp.TooltipWarnCaut.style.padding = '3px 4px'; } else { - CM.Disp.TooltipWarnCaut.style.right = '12px'; + CM.Disp.TooltipWarnCaut.style.right = 'auto'; + CM.Disp.TooltipWarnCaut.style.margin = '4px'; CM.Disp.TooltipWarnCaut.style.padding = '4px 3px'; } } @@ -1724,9 +1729,7 @@ CM.Disp.Tooltip = function(type, name) { CM.Disp.UpdateTooltip(); -// if (type == 'b') { - return l('tooltip').innerHTML; -// } + return l('tooltip').innerHTML; } CM.Disp.UpdateTooltip = function() { @@ -1788,10 +1791,10 @@ CM.Disp.UpdateTooltip = function() { var amount = Game.cookies - price; if (amount < warn || amount < caut) { if (CM.Config.ToolWarnCautPos == 0) { - CM.Disp.TooltipWarnCaut.style.right = (l('tooltip').offsetWidth + 12) + 'px'; + CM.Disp.TooltipWarnCaut.style.right = '0px'; } else { - CM.Disp.TooltipWarnCaut.style.top = (l('tooltip').offsetHeight + 12) + 'px'; + CM.Disp.TooltipWarnCaut.style.top = (l('tooltip').offsetHeight) + 'px'; } CM.Disp.TooltipWarnCaut.style.width = (l('tooltip').offsetWidth - 6) + 'px'; @@ -1872,7 +1875,7 @@ CM.Disp.CheckWrinklerTooltip = function() { div.id = 'CMTooltipWrinkler'; wrinkler.appendChild(div); placeholder.appendChild(wrinkler); - Game.tooltip.draw(this, escape(placeholder.innerHTML), 'wrink'); + Game.tooltip.draw(this, escape(placeholder.innerHTML)); CM.Disp.TooltipWrinkler = i; CM.Disp.TooltipWrinklerCache[i] = 1; } @@ -2007,6 +2010,7 @@ CM.ReplaceNative = function() { Game.RebuildUpgrades = function() { CM.Backup.RebuildUpgrades(); CM.Disp.AddTooltipUpgrade(); + CM.Sim.DoSims = 1; } CM.Backup.UpdateMenu = Game.UpdateMenu; diff --git a/src/Disp.js b/src/Disp.js index f23f76e..5d3660b 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -236,7 +236,7 @@ CM.Disp.CreateTimerBar = function() { var type = document.createElement('span'); type.style.display = 'inline-block'; type.style.textAlign = 'right'; - type.style.width = '71px'; + type.style.width = '78px'; type.style.marginRight = '5px'; type.style.verticalAlign = 'text-top'; type.textContent = name; @@ -328,8 +328,8 @@ CM.Disp.ToggleTimerBarPos = function() { CM.Disp.UpdateTimerBar = function() { if (CM.Config.TimerBar == 1) { - // label width: 76 timer width: 26 div margin: 20 - var maxWidth = CM.Disp.TimerBar.offsetWidth - 122; + // label width: 83 timer width: 26 div margin: 20 + var maxWidth = CM.Disp.TimerBar.offsetWidth - 129; var count = 0; if (Game.goldenCookie.life <= 0 && Game.goldenCookie.toDie == 0) { @@ -1216,10 +1216,13 @@ CM.Disp.RefreshMenu = function() { } CM.Disp.UpdateTooltipLocation = function() { - Game.tooltip.tta.style.top = Math.max(0, Math.min((l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - CM.Disp.TooltipWarnCaut.clientHeight - 38, Game.mouseY - 48)) + 'px'; - if (Game.tooltip.origin == 'wrink') { - Game.tooltip.tta.style.left = (Game.mouseX + l('tooltip').offsetWidth + 25) + 'px'; - Game.tooltip.tta.style.right = 'auto'; + if (Game.tooltip.origin == 'store') { + var warnCautOffset = 0; + if (CM.Config.ToolWarnCaut == 1 && CM.Config.ToolWarnCautPos == 1) warnCautOffset = CM.Disp.TooltipWarnCaut.clientHeight - 4; + Game.tooltip.tta.style.top = Math.min(parseInt(Game.tooltip.tta.style.top), (l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - warnCautOffset - 46) + 'px'; + } + else if (!Game.onCrate && !Game.OnAscend && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { + Game.tooltip.tta.style.top = (parseInt(Game.tooltip.tta.style.top) + parseInt(CM.Disp.TimerBar.style.height)) + 'px'; } } @@ -1276,11 +1279,13 @@ CM.Disp.ToggleToolWarnCaut = function() { CM.Disp.ToggleToolWarnCautPos = function() { if (CM.Config.ToolWarnCautPos == 0) { - CM.Disp.TooltipWarnCaut.style.top = '12px'; + CM.Disp.TooltipWarnCaut.style.top = 'auto'; + CM.Disp.TooltipWarnCaut.style.margin = '4px -4px'; CM.Disp.TooltipWarnCaut.style.padding = '3px 4px'; } else { - CM.Disp.TooltipWarnCaut.style.right = '12px'; + CM.Disp.TooltipWarnCaut.style.right = 'auto'; + CM.Disp.TooltipWarnCaut.style.margin = '4px'; CM.Disp.TooltipWarnCaut.style.padding = '4px 3px'; } } @@ -1386,9 +1391,7 @@ CM.Disp.Tooltip = function(type, name) { CM.Disp.UpdateTooltip(); -// if (type == 'b') { - return l('tooltip').innerHTML; -// } + return l('tooltip').innerHTML; } CM.Disp.UpdateTooltip = function() { @@ -1450,10 +1453,10 @@ CM.Disp.UpdateTooltip = function() { var amount = Game.cookies - price; if (amount < warn || amount < caut) { if (CM.Config.ToolWarnCautPos == 0) { - CM.Disp.TooltipWarnCaut.style.right = (l('tooltip').offsetWidth + 12) + 'px'; + CM.Disp.TooltipWarnCaut.style.right = '0px'; } else { - CM.Disp.TooltipWarnCaut.style.top = (l('tooltip').offsetHeight + 12) + 'px'; + CM.Disp.TooltipWarnCaut.style.top = (l('tooltip').offsetHeight) + 'px'; } CM.Disp.TooltipWarnCaut.style.width = (l('tooltip').offsetWidth - 6) + 'px'; @@ -1534,7 +1537,7 @@ CM.Disp.CheckWrinklerTooltip = function() { div.id = 'CMTooltipWrinkler'; wrinkler.appendChild(div); placeholder.appendChild(wrinkler); - Game.tooltip.draw(this, escape(placeholder.innerHTML), 'wrink'); + Game.tooltip.draw(this, escape(placeholder.innerHTML)); CM.Disp.TooltipWrinkler = i; CM.Disp.TooltipWrinklerCache[i] = 1; } diff --git a/src/Main.js b/src/Main.js index 9c6e4f5..15de2c2 100644 --- a/src/Main.js +++ b/src/Main.js @@ -41,6 +41,7 @@ CM.ReplaceNative = function() { Game.RebuildUpgrades = function() { CM.Backup.RebuildUpgrades(); CM.Disp.AddTooltipUpgrade(); + CM.Sim.DoSims = 1; } CM.Backup.UpdateMenu = Game.UpdateMenu; From 14c1afa30d3c5324c641def7fe4d09d38bf0e742 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Sun, 27 Dec 2015 21:44:50 -0500 Subject: [PATCH 15/26] Fixed rare but bad tooltip bug and fixed some toggle upgrades graphical glitches --- CookieMonster.js | 13 ++++++++++--- src/Cache.js | 1 + src/Disp.js | 12 +++++++++--- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 280fc6f..ba4675f 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -64,6 +64,7 @@ CM.Cache.RemakeBuildingsBCI = function() { CM.Cache.RemakeUpgradeBCI = function() { for (var i in CM.Cache.Upgrades) { CM.Cache.Upgrades[i].bci = Game.Upgrades[i].getPrice() / CM.Cache.Upgrades[i].bonus; + if (isNaN(CM.Cache.Upgrades[i].bci)) CM.Cache.Upgrades[i].bci = 'Infinity'; var color = ''; if (CM.Cache.Upgrades[i].bci <= 0 || CM.Cache.Upgrades[i].bci == 'Infinity') color = CM.Disp.colorGray; else if (CM.Cache.Upgrades[i].bci < CM.Disp.min) color = CM.Disp.colorBlue; @@ -881,10 +882,15 @@ CM.Disp.UpdateUpgrades = function() { for (var i in Game.UpgradesInStore) { var me = Game.UpgradesInStore[i]; - if (l('upgrade' + i).childNodes.length > 0) { - l('upgrade' + i).childNodes[0].className = CM.Disp.colorBackPre + CM.Cache.Upgrades[me.name].color; + var addedColor = false; + for (var j = 0; j < l('upgrade' + i).childNodes.length; j++) { + if (l('upgrade' + i).childNodes[j].className.indexOf(CM.Disp.colorBackPre) != -1) { + l('upgrade' + i).childNodes[j].className = CM.Disp.colorBackPre + CM.Cache.Upgrades[me.name].color; + addedColor = true; + break; + } } - else { + if (!addedColor) { var div = document.createElement('div'); div.style.width = '10px'; div.style.height = '10px'; @@ -1683,6 +1689,7 @@ CM.Disp.Tooltip = function(type, name) { } } else { // Upgrades + if (!Game.UpgradesInStore[name]) return ''; l('tooltip').innerHTML = Game.crate(Game.UpgradesInStore[name], 'store', undefined, undefined, 1)(); } diff --git a/src/Cache.js b/src/Cache.js index a10ed9a..7659ef5 100644 --- a/src/Cache.js +++ b/src/Cache.js @@ -44,6 +44,7 @@ CM.Cache.RemakeBuildingsBCI = function() { CM.Cache.RemakeUpgradeBCI = function() { for (var i in CM.Cache.Upgrades) { CM.Cache.Upgrades[i].bci = Game.Upgrades[i].getPrice() / CM.Cache.Upgrades[i].bonus; + if (isNaN(CM.Cache.Upgrades[i].bci)) CM.Cache.Upgrades[i].bci = 'Infinity'; var color = ''; if (CM.Cache.Upgrades[i].bci <= 0 || CM.Cache.Upgrades[i].bci == 'Infinity') color = CM.Disp.colorGray; else if (CM.Cache.Upgrades[i].bci < CM.Disp.min) color = CM.Disp.colorBlue; diff --git a/src/Disp.js b/src/Disp.js index 5d3660b..806113f 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -543,10 +543,15 @@ CM.Disp.UpdateUpgrades = function() { for (var i in Game.UpgradesInStore) { var me = Game.UpgradesInStore[i]; - if (l('upgrade' + i).childNodes.length > 0) { - l('upgrade' + i).childNodes[0].className = CM.Disp.colorBackPre + CM.Cache.Upgrades[me.name].color; + var addedColor = false; + for (var j = 0; j < l('upgrade' + i).childNodes.length; j++) { + if (l('upgrade' + i).childNodes[j].className.indexOf(CM.Disp.colorBackPre) != -1) { + l('upgrade' + i).childNodes[j].className = CM.Disp.colorBackPre + CM.Cache.Upgrades[me.name].color; + addedColor = true; + break; + } } - else { + if (!addedColor) { var div = document.createElement('div'); div.style.width = '10px'; div.style.height = '10px'; @@ -1345,6 +1350,7 @@ CM.Disp.Tooltip = function(type, name) { } } else { // Upgrades + if (!Game.UpgradesInStore[name]) return ''; l('tooltip').innerHTML = Game.crate(Game.UpgradesInStore[name], 'store', undefined, undefined, 1)(); } From 5aa21209b912dba3c2f50ebcc58ec5b31e96a3cc Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Mon, 28 Dec 2015 11:09:54 -0500 Subject: [PATCH 16/26] Used a better fix on missing boxes on upgrades --- CookieMonster.js | 2 +- src/Main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index ba4675f..9ab5461 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2017,7 +2017,7 @@ CM.ReplaceNative = function() { Game.RebuildUpgrades = function() { CM.Backup.RebuildUpgrades(); CM.Disp.AddTooltipUpgrade(); - CM.Sim.DoSims = 1; + Game.recalculateGains = 1; } CM.Backup.UpdateMenu = Game.UpdateMenu; diff --git a/src/Main.js b/src/Main.js index 15de2c2..d3c593d 100644 --- a/src/Main.js +++ b/src/Main.js @@ -41,7 +41,7 @@ CM.ReplaceNative = function() { Game.RebuildUpgrades = function() { CM.Backup.RebuildUpgrades(); CM.Disp.AddTooltipUpgrade(); - CM.Sim.DoSims = 1; + Game.recalculateGains = 1; } CM.Backup.UpdateMenu = Game.UpdateMenu; From 07b67be07ea8b6f9730f2f9c633e3fd3caf41369 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Thu, 4 Feb 2016 18:24:54 -0500 Subject: [PATCH 17/26] Version change to 1.903.1 --- CookieMonster.js | 2 +- src/Main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 9ab5461..732e3d2 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2129,7 +2129,7 @@ CM.DelayInit = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWarnCautBon: 0, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.9'; +CM.VersionMajor = '1.903'; CM.VersionMinor = '1'; /******* diff --git a/src/Main.js b/src/Main.js index d3c593d..c237a57 100644 --- a/src/Main.js +++ b/src/Main.js @@ -153,6 +153,6 @@ CM.DelayInit = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWarnCautBon: 0, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.9'; +CM.VersionMajor = '1.903'; CM.VersionMinor = '1'; From 5ceffa9d633e7795a74d93a768438ae5cc58f0ba Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Thu, 4 Feb 2016 23:49:51 -0500 Subject: [PATCH 18/26] Fix to work with 1.903 beta (mostly) --- CookieMonster.js | 34 +++++++++++++++++++--------------- src/Cache.js | 8 ++++---- src/Sim.js | 26 +++++++++++++++----------- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 732e3d2..45f9154 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -105,13 +105,13 @@ CM.Cache.RemakeBCI = function() { } CM.Cache.RemakeLucky = function() { - CM.Cache.Lucky = (Game.cookiesPs * 60 * 20) / 0.1; + CM.Cache.Lucky = (Game.cookiesPs * 60 * 15) / 0.15; if (Game.frenzy > 0) { CM.Cache.Lucky /= Game.frenzyPower; } - CM.Cache.LuckyReward = (CM.Cache.Lucky * 0.1) + 13; + CM.Cache.LuckyReward = (CM.Cache.Lucky * 0.15) + 13; CM.Cache.LuckyFrenzy = CM.Cache.Lucky * 7; - CM.Cache.LuckyRewardFrenzy = (CM.Cache.LuckyFrenzy * 0.1) + 13; + CM.Cache.LuckyRewardFrenzy = (CM.Cache.LuckyFrenzy * 0.15) + 13; } CM.Cache.MaxChainMoni = function(digit, maxPayout) { @@ -127,7 +127,7 @@ CM.Cache.MaxChainMoni = function(digit, maxPayout) { } CM.Cache.RemakeChain = function() { - var maxPayout = Game.cookiesPs * 60 * 60 * 3; + var maxPayout = Game.cookiesPs * 60 * 60 * 6; if (Game.frenzy > 0) { maxPayout /= Game.frenzyPower; } @@ -2253,14 +2253,13 @@ CM.Sim.CalculateGains = function() { CM.Sim.cookiesPs = 0; var mult = 1; - var heavenlyMult = CM.Sim.GetHeavenlyMultiplier(); - mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * heavenlyMult; + mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * CM.Sim.GetHeavenlyMultiplier(); var cookieMult = 0; for (var i in CM.Sim.Upgrades) { var me = CM.Sim.Upgrades[i]; if (me.bought > 0) { - if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) cookieMult += (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power); + if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) mult *= (1 + (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power) * 0.01); } } @@ -2277,7 +2276,7 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('An itchy sweater')) mult *= 1.01; if (CM.Sim.Has('Santa\'s dominion')) mult *= 1.2; - if (CM.Sim.Has('Santa\'s legacy')) mult *= 1 + (Game.santaLevel + 1) * 0.05; + if (CM.Sim.Has('Santa\'s legacy')) mult *= 1 + (Game.santaLevel + 1) * 0.03; for (var i in CM.Sim.Objects) { var me = CM.Sim.Objects[i]; @@ -2289,10 +2288,10 @@ CM.Sim.CalculateGains = function() { var milkMult=1; if (CM.Sim.Has('Santa\'s milk and cookies')) milkMult *= 1.05; if (CM.Sim.hasAura('Breath of Milk')) milkMult *= 1.05; - if (CM.Sim.Has('Kitten helpers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.05 * milkMult); - if (CM.Sim.Has('Kitten workers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); - if (CM.Sim.Has('Kitten engineers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten overseers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + 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); @@ -2328,15 +2327,20 @@ CM.Sim.CalculateGains = function() { } if (Game.frenzy > 0) mult *= Game.frenzyPower; + + // Pointless? + name = Game.bakeryName.toLowerCase(); + if (name == 'orteil') mult *= 0.99; + else if (name == 'ortiel') mult*=0.0001; //or so help me if (CM.Sim.Has('Elder Covenant')) mult *= 0.95; if (CM.Sim.Has('Golden switch [off]')) { - var goldenSwitchMult = 1.25; + var goldenSwitchMult = 1.5; if (CM.Sim.Has('Residual luck')) { var upgrades = ['Get lucky', 'Lucky day', 'Serendipity', 'Heavenly luck', 'Lasting fortune', 'Decisive fate']; for (var i in upgrades) { - if (CM.Sim.Has(upgrades[i])) goldenSwitchMult += 0.01; + if (CM.Sim.Has(upgrades[i])) goldenSwitchMult += 0.1; } } mult *= goldenSwitchMult; @@ -2454,7 +2458,7 @@ CM.Sim.BuyUpgrades = function() { CM.Sim.CopyData(); var me = CM.Sim.Upgrades[i]; me.bought = 1; - if (Game.Upgrades[i].pool == '' || Game.Upgrades[i].pool == 'cookie' || Game.Upgrades[i].pool == 'tech') CM.Sim.UpgradesOwned++; + if (Game.CountsAsUpgradeOwned(Game.Upgrades[i].pool)) CM.Sim.UpgradesOwned++; if (i == 'Elder Pledge') { CM.Sim.pledges++; diff --git a/src/Cache.js b/src/Cache.js index 7659ef5..6859417 100644 --- a/src/Cache.js +++ b/src/Cache.js @@ -85,13 +85,13 @@ CM.Cache.RemakeBCI = function() { } CM.Cache.RemakeLucky = function() { - CM.Cache.Lucky = (Game.cookiesPs * 60 * 20) / 0.1; + CM.Cache.Lucky = (Game.cookiesPs * 60 * 15) / 0.15; if (Game.frenzy > 0) { CM.Cache.Lucky /= Game.frenzyPower; } - CM.Cache.LuckyReward = (CM.Cache.Lucky * 0.1) + 13; + CM.Cache.LuckyReward = (CM.Cache.Lucky * 0.15) + 13; CM.Cache.LuckyFrenzy = CM.Cache.Lucky * 7; - CM.Cache.LuckyRewardFrenzy = (CM.Cache.LuckyFrenzy * 0.1) + 13; + CM.Cache.LuckyRewardFrenzy = (CM.Cache.LuckyFrenzy * 0.15) + 13; } CM.Cache.MaxChainMoni = function(digit, maxPayout) { @@ -107,7 +107,7 @@ CM.Cache.MaxChainMoni = function(digit, maxPayout) { } CM.Cache.RemakeChain = function() { - var maxPayout = Game.cookiesPs * 60 * 60 * 3; + var maxPayout = Game.cookiesPs * 60 * 60 * 6; if (Game.frenzy > 0) { maxPayout /= Game.frenzyPower; } diff --git a/src/Sim.js b/src/Sim.js index 04b36ec..d9d616b 100644 --- a/src/Sim.js +++ b/src/Sim.js @@ -119,14 +119,13 @@ CM.Sim.CalculateGains = function() { CM.Sim.cookiesPs = 0; var mult = 1; - var heavenlyMult = CM.Sim.GetHeavenlyMultiplier(); - mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * heavenlyMult; + mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * CM.Sim.GetHeavenlyMultiplier(); var cookieMult = 0; for (var i in CM.Sim.Upgrades) { var me = CM.Sim.Upgrades[i]; if (me.bought > 0) { - if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) cookieMult += (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power); + if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) mult *= (1 + (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power) * 0.01); } } @@ -143,7 +142,7 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('An itchy sweater')) mult *= 1.01; if (CM.Sim.Has('Santa\'s dominion')) mult *= 1.2; - if (CM.Sim.Has('Santa\'s legacy')) mult *= 1 + (Game.santaLevel + 1) * 0.05; + if (CM.Sim.Has('Santa\'s legacy')) mult *= 1 + (Game.santaLevel + 1) * 0.03; for (var i in CM.Sim.Objects) { var me = CM.Sim.Objects[i]; @@ -155,10 +154,10 @@ CM.Sim.CalculateGains = function() { var milkMult=1; if (CM.Sim.Has('Santa\'s milk and cookies')) milkMult *= 1.05; if (CM.Sim.hasAura('Breath of Milk')) milkMult *= 1.05; - if (CM.Sim.Has('Kitten helpers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.05 * milkMult); - if (CM.Sim.Has('Kitten workers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); - if (CM.Sim.Has('Kitten engineers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); - if (CM.Sim.Has('Kitten overseers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult); + 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); @@ -194,15 +193,20 @@ CM.Sim.CalculateGains = function() { } if (Game.frenzy > 0) mult *= Game.frenzyPower; + + // Pointless? + name = Game.bakeryName.toLowerCase(); + if (name == 'orteil') mult *= 0.99; + else if (name == 'ortiel') mult*=0.0001; //or so help me if (CM.Sim.Has('Elder Covenant')) mult *= 0.95; if (CM.Sim.Has('Golden switch [off]')) { - var goldenSwitchMult = 1.25; + var goldenSwitchMult = 1.5; if (CM.Sim.Has('Residual luck')) { var upgrades = ['Get lucky', 'Lucky day', 'Serendipity', 'Heavenly luck', 'Lasting fortune', 'Decisive fate']; for (var i in upgrades) { - if (CM.Sim.Has(upgrades[i])) goldenSwitchMult += 0.01; + if (CM.Sim.Has(upgrades[i])) goldenSwitchMult += 0.1; } } mult *= goldenSwitchMult; @@ -320,7 +324,7 @@ CM.Sim.BuyUpgrades = function() { CM.Sim.CopyData(); var me = CM.Sim.Upgrades[i]; me.bought = 1; - if (Game.Upgrades[i].pool == '' || Game.Upgrades[i].pool == 'cookie' || Game.Upgrades[i].pool == 'tech') CM.Sim.UpgradesOwned++; + if (Game.CountsAsUpgradeOwned(Game.Upgrades[i].pool)) CM.Sim.UpgradesOwned++; if (i == 'Elder Pledge') { CM.Sim.pledges++; From 0ea31f6e9439227314f21ab94e38e27c5b9cfbb6 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Fri, 5 Feb 2016 00:42:04 -0500 Subject: [PATCH 19/26] Fixed bug with Current Lucky reward was calculated wrong --- CookieMonster.js | 2 +- src/Disp.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 45f9154..a3f41fd 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1276,7 +1276,7 @@ CM.Disp.AddMenuStats = function(title) { var luckyTime = (Game.cookies < CM.Cache.Lucky) ? CM.Disp.FormatTime((CM.Cache.Lucky - Game.cookies) / (Game.cookiesPs * (1 - Game.cpsSucked))) : ''; var luckyColorFrenzy = (Game.cookies < CM.Cache.LuckyFrenzy) ? CM.Disp.colorRed : CM.Disp.colorGreen; var luckyTimeFrenzy = (Game.cookies < CM.Cache.LuckyFrenzy) ? CM.Disp.FormatTime((CM.Cache.LuckyFrenzy - Game.cookies) / (Game.cookiesPs * (1 - Game.cpsSucked))) : ''; - var luckyCur = Math.min(Game.cookies * 0.1, Game.cookiesPs * 60 * 20) + 13; + var luckyCur = Math.min(Game.cookies * 0.15, Game.cookiesPs * 60 * 15) + 13; var luckyReqFrag = document.createDocumentFragment(); var luckyReqSpan = document.createElement('span'); diff --git a/src/Disp.js b/src/Disp.js index 806113f..2dbf49d 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -937,7 +937,7 @@ CM.Disp.AddMenuStats = function(title) { var luckyTime = (Game.cookies < CM.Cache.Lucky) ? CM.Disp.FormatTime((CM.Cache.Lucky - Game.cookies) / (Game.cookiesPs * (1 - Game.cpsSucked))) : ''; var luckyColorFrenzy = (Game.cookies < CM.Cache.LuckyFrenzy) ? CM.Disp.colorRed : CM.Disp.colorGreen; var luckyTimeFrenzy = (Game.cookies < CM.Cache.LuckyFrenzy) ? CM.Disp.FormatTime((CM.Cache.LuckyFrenzy - Game.cookies) / (Game.cookiesPs * (1 - Game.cpsSucked))) : ''; - var luckyCur = Math.min(Game.cookies * 0.1, Game.cookiesPs * 60 * 20) + 13; + var luckyCur = Math.min(Game.cookies * 0.15, Game.cookiesPs * 60 * 15) + 13; var luckyReqFrag = document.createDocumentFragment(); var luckyReqSpan = document.createElement('span'); From 85ed5080107f672d83961b7832e4fcdaf5e15e2f Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Fri, 5 Feb 2016 23:37:15 -0500 Subject: [PATCH 20/26] Fix Current Chain reward being calculated wrong, tooltips being buggy, and needing to click a little above santa/dragon icon --- CookieMonster.js | 23 ++++++++++++++++++----- src/Cache.js | 1 - src/Disp.js | 9 +++++---- src/Main.js | 13 +++++++++++++ 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index a3f41fd..dbe25a6 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -143,7 +143,6 @@ CM.Cache.RemakeChain = function() { else { base = CM.Cache.ChainWrathReward; } - var count = 1; if (maxPayout < base) { CM.Cache.Chain = 0; } @@ -1313,7 +1312,7 @@ CM.Disp.AddMenuStats = function(title) { var chainTime = (Game.cookies < CM.Cache.Chain) ? CM.Disp.FormatTime((CM.Cache.Chain - Game.cookies) / (Game.cookiesPs * (1 - Game.cpsSucked))) : ''; var chainColorFrenzy = (Game.cookies < CM.Cache.ChainFrenzy) ? CM.Disp.colorRed : CM.Disp.colorGreen; var chainTimeFrenzy = (Game.cookies < CM.Cache.ChainFrenzy) ? CM.Disp.FormatTime((CM.Cache.ChainFrenzy - Game.cookies) / (Game.cookiesPs * (1 - Game.cpsSucked))) : ''; - var chainCurMax = Math.min(Game.cookiesPs * 60 * 60 * 3, Game.cookies * 0.25); + var chainCurMax = Math.min(Game.cookiesPs * 60 * 60 * 6, Game.cookies * 0.25); var chainCur = CM.Cache.MaxChainMoni(7, chainCurMax); var chainCurWrath = CM.Cache.MaxChainMoni(6, chainCurMax); @@ -1565,9 +1564,10 @@ CM.Disp.UpdateTooltipLocation = function() { if (CM.Config.ToolWarnCaut == 1 && CM.Config.ToolWarnCautPos == 1) warnCautOffset = CM.Disp.TooltipWarnCaut.clientHeight - 4; Game.tooltip.tta.style.top = Math.min(parseInt(Game.tooltip.tta.style.top), (l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - warnCautOffset - 46) + 'px'; } - else if (!Game.onCrate && !Game.OnAscend && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { - Game.tooltip.tta.style.top = (parseInt(Game.tooltip.tta.style.top) + parseInt(CM.Disp.TimerBar.style.height)) + 'px'; - } + // Kept for future possible use if the code changes again + /*else if (!Game.onCrate && !Game.OnAscend && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { + //Game.tooltip.tta.style.top = (parseInt(Game.tooltip.tta.style.top) + parseInt(CM.Disp.TimerBar.style.height)) + 'px'; + }*/ } CM.Disp.CreateTooltipWarnCaut = function() { @@ -2013,6 +2013,19 @@ CM.ReplaceNative = function() { CM.Disp.UpdateTooltipLocation(); } + CM.Backup.UpdateSpecial = Game.UpdateSpecial; + Game.UpdateSpecial = function() { + if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { + var timerBarHeight = parseInt(CM.Disp.TimerBar.style.height); + Game.mouseY -= timerBarHeight; + CM.Backup.UpdateSpecial(); + Game.mouseY += timerBarHeight; + } + else { + CM.Backup.UpdateSpecial(); + } + } + CM.Backup.RebuildUpgrades = Game.RebuildUpgrades; Game.RebuildUpgrades = function() { CM.Backup.RebuildUpgrades(); diff --git a/src/Cache.js b/src/Cache.js index 6859417..2c7aa26 100644 --- a/src/Cache.js +++ b/src/Cache.js @@ -123,7 +123,6 @@ CM.Cache.RemakeChain = function() { else { base = CM.Cache.ChainWrathReward; } - var count = 1; if (maxPayout < base) { CM.Cache.Chain = 0; } diff --git a/src/Disp.js b/src/Disp.js index 2dbf49d..c814d2f 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -974,7 +974,7 @@ CM.Disp.AddMenuStats = function(title) { var chainTime = (Game.cookies < CM.Cache.Chain) ? CM.Disp.FormatTime((CM.Cache.Chain - Game.cookies) / (Game.cookiesPs * (1 - Game.cpsSucked))) : ''; var chainColorFrenzy = (Game.cookies < CM.Cache.ChainFrenzy) ? CM.Disp.colorRed : CM.Disp.colorGreen; var chainTimeFrenzy = (Game.cookies < CM.Cache.ChainFrenzy) ? CM.Disp.FormatTime((CM.Cache.ChainFrenzy - Game.cookies) / (Game.cookiesPs * (1 - Game.cpsSucked))) : ''; - var chainCurMax = Math.min(Game.cookiesPs * 60 * 60 * 3, Game.cookies * 0.25); + var chainCurMax = Math.min(Game.cookiesPs * 60 * 60 * 6, Game.cookies * 0.25); var chainCur = CM.Cache.MaxChainMoni(7, chainCurMax); var chainCurWrath = CM.Cache.MaxChainMoni(6, chainCurMax); @@ -1226,9 +1226,10 @@ CM.Disp.UpdateTooltipLocation = function() { if (CM.Config.ToolWarnCaut == 1 && CM.Config.ToolWarnCautPos == 1) warnCautOffset = CM.Disp.TooltipWarnCaut.clientHeight - 4; Game.tooltip.tta.style.top = Math.min(parseInt(Game.tooltip.tta.style.top), (l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - warnCautOffset - 46) + 'px'; } - else if (!Game.onCrate && !Game.OnAscend && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { - Game.tooltip.tta.style.top = (parseInt(Game.tooltip.tta.style.top) + parseInt(CM.Disp.TimerBar.style.height)) + 'px'; - } + // Kept for future possible use if the code changes again + /*else if (!Game.onCrate && !Game.OnAscend && CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { + //Game.tooltip.tta.style.top = (parseInt(Game.tooltip.tta.style.top) + parseInt(CM.Disp.TimerBar.style.height)) + 'px'; + }*/ } CM.Disp.CreateTooltipWarnCaut = function() { diff --git a/src/Main.js b/src/Main.js index c237a57..65c7358 100644 --- a/src/Main.js +++ b/src/Main.js @@ -37,6 +37,19 @@ CM.ReplaceNative = function() { CM.Disp.UpdateTooltipLocation(); } + CM.Backup.UpdateSpecial = Game.UpdateSpecial; + Game.UpdateSpecial = function() { + if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) { + var timerBarHeight = parseInt(CM.Disp.TimerBar.style.height); + Game.mouseY -= timerBarHeight; + CM.Backup.UpdateSpecial(); + Game.mouseY += timerBarHeight; + } + else { + CM.Backup.UpdateSpecial(); + } + } + CM.Backup.RebuildUpgrades = Game.RebuildUpgrades; Game.RebuildUpgrades = function() { CM.Backup.RebuildUpgrades(); From ee35136130ca36e69e0ac5561ab0564828992c0d Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Sat, 6 Feb 2016 11:24:39 -0500 Subject: [PATCH 21/26] Version change to 1.906 --- CookieMonster.js | 2 +- src/Main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index dbe25a6..8b222fa 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2142,7 +2142,7 @@ CM.DelayInit = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWarnCautBon: 0, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.903'; +CM.VersionMajor = '1.906'; CM.VersionMinor = '1'; /******* diff --git a/src/Main.js b/src/Main.js index 65c7358..3fd3837 100644 --- a/src/Main.js +++ b/src/Main.js @@ -166,6 +166,6 @@ CM.DelayInit = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWarnCautBon: 0, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.903'; +CM.VersionMajor = '1.906'; CM.VersionMinor = '1'; From 6bced494f828f0bd4f874e13e7ccd499ff704018 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Sat, 6 Feb 2016 12:34:17 -0500 Subject: [PATCH 22/26] Version change to 1.907.1 and fixed it to work with 1.907 beta (mostly) --- CookieMonster.js | 14 +++++++++----- src/Main.js | 4 ++-- src/Sim.js | 10 +++++++--- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 8b222fa..a633eb7 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2126,7 +2126,7 @@ CM.DelayInit = function() { CM.Disp.CreateChoEggTooltip(); CM.Disp.CreateTooltipWarnCaut(); CM.Disp.AddTooltipBuild(); - CM.Disp.AddTooltipBuildExtra(); + //CM.Disp.AddTooltipBuildExtra(); // The extra per building was removed CM.Disp.AddWrinklerAreaDetect(); CM.ReplaceNative(); Game.CalculateGains(); @@ -2142,7 +2142,7 @@ CM.DelayInit = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWarnCautBon: 0, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.906'; +CM.VersionMajor = '1.907'; CM.VersionMinor = '1'; /******* @@ -2177,7 +2177,11 @@ CM.Sim.BuildingSell = function(basePrice, start, amount) { return totalMoni; } -eval('CM.Sim.Has = ' + Game.Has.toString().split('Game').join('CM.Sim')); +CM.Sim.Has = function(what) { + if (Game.ascensionMode == 1 && Game.Upgrades[what].pool == 'prestige') return 0; + return (CM.Sim.Upgrades[what] ? CM.Sim.Upgrades[what].bought : 0); +} + CM.Sim.Win = function(what) { if (CM.Sim.Achievements[what]) { @@ -2266,7 +2270,7 @@ CM.Sim.CalculateGains = function() { CM.Sim.cookiesPs = 0; var mult = 1; - mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * CM.Sim.GetHeavenlyMultiplier(); + if (Game.ascensionMode != 1) mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * CM.Sim.GetHeavenlyMultiplier(); var cookieMult = 0; for (var i in CM.Sim.Upgrades) { @@ -2344,7 +2348,7 @@ CM.Sim.CalculateGains = function() { // Pointless? name = Game.bakeryName.toLowerCase(); if (name == 'orteil') mult *= 0.99; - else if (name == 'ortiel') mult*=0.0001; //or so help me + else if (name == 'ortiel') mult *= 0.98; //or so help me if (CM.Sim.Has('Elder Covenant')) mult *= 0.95; diff --git a/src/Main.js b/src/Main.js index 3fd3837..f76f7fc 100644 --- a/src/Main.js +++ b/src/Main.js @@ -150,7 +150,7 @@ CM.DelayInit = function() { CM.Disp.CreateChoEggTooltip(); CM.Disp.CreateTooltipWarnCaut(); CM.Disp.AddTooltipBuild(); - CM.Disp.AddTooltipBuildExtra(); + //CM.Disp.AddTooltipBuildExtra(); // The extra per building was removed CM.Disp.AddWrinklerAreaDetect(); CM.ReplaceNative(); Game.CalculateGains(); @@ -166,6 +166,6 @@ CM.DelayInit = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWarnCautBon: 0, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.906'; +CM.VersionMajor = '1.907'; CM.VersionMinor = '1'; diff --git a/src/Sim.js b/src/Sim.js index d9d616b..9ae0a4c 100644 --- a/src/Sim.js +++ b/src/Sim.js @@ -30,7 +30,11 @@ CM.Sim.BuildingSell = function(basePrice, start, amount) { return totalMoni; } -eval('CM.Sim.Has = ' + Game.Has.toString().split('Game').join('CM.Sim')); +CM.Sim.Has = function(what) { + if (Game.ascensionMode == 1 && Game.Upgrades[what].pool == 'prestige') return 0; + return (CM.Sim.Upgrades[what] ? CM.Sim.Upgrades[what].bought : 0); +} + CM.Sim.Win = function(what) { if (CM.Sim.Achievements[what]) { @@ -119,7 +123,7 @@ CM.Sim.CalculateGains = function() { CM.Sim.cookiesPs = 0; var mult = 1; - mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * CM.Sim.GetHeavenlyMultiplier(); + if (Game.ascensionMode != 1) mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * CM.Sim.GetHeavenlyMultiplier(); var cookieMult = 0; for (var i in CM.Sim.Upgrades) { @@ -197,7 +201,7 @@ CM.Sim.CalculateGains = function() { // Pointless? name = Game.bakeryName.toLowerCase(); if (name == 'orteil') mult *= 0.99; - else if (name == 'ortiel') mult*=0.0001; //or so help me + else if (name == 'ortiel') mult *= 0.98; //or so help me if (CM.Sim.Has('Elder Covenant')) mult *= 0.95; From 914a5e2ff30e33d40dad5dfc0cbae59f12fba72e Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Mon, 8 Feb 2016 09:52:58 -0500 Subject: [PATCH 23/26] Version change to 1.909.1 --- CookieMonster.js | 2 +- src/Main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index a633eb7..3e5b548 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2142,7 +2142,7 @@ CM.DelayInit = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWarnCautBon: 0, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.907'; +CM.VersionMajor = '1.909'; CM.VersionMinor = '1'; /******* diff --git a/src/Main.js b/src/Main.js index f76f7fc..8cfa5df 100644 --- a/src/Main.js +++ b/src/Main.js @@ -166,6 +166,6 @@ CM.DelayInit = function() { CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, UpBarColor: 1, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWarnCautBon: 0, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, HC: 1, Wrink: 1, Sea: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3'}}; CM.ConfigPrefix = 'CMConfig'; -CM.VersionMajor = '1.907'; +CM.VersionMajor = '1.909'; CM.VersionMinor = '1'; From 762a6919e7cd578fe392e744e589ae493d7c47d0 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Mon, 8 Feb 2016 19:25:32 -0500 Subject: [PATCH 24/26] Updated README to reflect the same thing as the Wikia --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 8a24a61..00cbd84 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,14 @@ javascript: (function () { If (for some reason) the above doesn't work, trying pasting everything after the javascript: bit into your browser's console. +For beta, use the following instead: + +```javascript +javascript: (function () { + Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonsterBeta.js'); +}()); +``` + ## Userscript If you'd rather use the addon as a script via per example *Greasemonkey* or *Tampermonkey*, you can use the following script, which will automatically load *Cookie Monster* every time the original game loads. You may need to specify http://orteil.dashnet.org/cookieclicker/ when asked for a *namespace* or *includes*. For how to add an userscript to your browser, refer to your browser/plugin's documentation as the method changes for each one. @@ -82,6 +90,26 @@ javascript:(function() { }, 1000); }()); ``` +If you are using cookie clicker beta use this instead: + +```javascript +// ==UserScript== +// @name Cookie Monster Beta +// @namespace Cookie +// @include http://orteil.dashnet.org/cookieclicker/beta/ +// @version 1 +// @grant none +// ==/UserScript== + +javascript:(function() { + var checkReady = setInterval(function() { + if (typeof Game.ready !== 'undefined' && Game.ready) { + Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonsterBeta.js'); + clearInterval(checkReady); + } + }, 1000); +}()); +``` # Bugs and suggestions From 13a49e3e3995b0e27ec35b909c344f6bb76f4a3b Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Mon, 8 Feb 2016 19:27:29 -0500 Subject: [PATCH 25/26] Updated README to reflect the same thing as the Wikia --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 00cbd84..93ab40b 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ javascript:(function() { }, 1000); }()); ``` -If you are using cookie clicker beta use this instead: +If you are using the beta, use this instead: ```javascript // ==UserScript== From f120f047dc3f4472bc53b9140f526b66770d6b91 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Mon, 8 Feb 2016 20:17:08 -0500 Subject: [PATCH 26/26] Removed HC stats as it is useless now (pending cleaning) --- CookieMonster.js | 5 +++-- src/Disp.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 7c1bb53..d44ce66 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1352,7 +1352,8 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(listing('\"Chain\" Reward (CUR) (Wrath)', document.createTextNode(Beautify(chainCurWrath)))); } - stats.appendChild(header('Heavenly Chips', 'HC')); + // Useless for now; cleanup later + /*stats.appendChild(header('Heavenly Chips', 'HC')); if (CM.Config.StatsPref.HC) { var possibleHC = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset); var neededCook = Game.HowManyCookiesReset(possibleHC + 1) - (Game.cookiesEarned + Game.cookiesReset); @@ -1394,7 +1395,7 @@ CM.Disp.AddMenuStats = function(title) { resetFrag.appendChild(resetSmall); } //stats.appendChild(listing(resetTitleFrag, resetFrag)); - } + }*/ var choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')); // Needs to be done for the checking below diff --git a/src/Disp.js b/src/Disp.js index 534a914..f9bce46 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1014,7 +1014,8 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(listing('\"Chain\" Reward (CUR) (Wrath)', document.createTextNode(Beautify(chainCurWrath)))); } - stats.appendChild(header('Heavenly Chips', 'HC')); + // Useless for now; cleanup later + /*stats.appendChild(header('Heavenly Chips', 'HC')); if (CM.Config.StatsPref.HC) { var possibleHC = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset); var neededCook = Game.HowManyCookiesReset(possibleHC + 1) - (Game.cookiesEarned + Game.cookiesReset); @@ -1056,7 +1057,7 @@ CM.Disp.AddMenuStats = function(title) { resetFrag.appendChild(resetSmall); } //stats.appendChild(listing(resetTitleFrag, resetFrag)); - } + }*/ var choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')); // Needs to be done for the checking below