From cb4b85a594899fbaeadbff518ad5cad8b3d2f220 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Sun, 6 Oct 2019 22:01:37 -0400 Subject: [PATCH] Fixed for Version 2.021 of Cookie Clicker (Issues #257, #259, and #265) --- CookieMonster.js | 121 ++++++++++++++++++++++++++++++++++------------- src/Cache.js | 32 +++++++++---- src/Disp.js | 17 ++++--- src/Main.js | 10 ++-- src/Sim.js | 62 +++++++++++++++++++----- 5 files changed, 178 insertions(+), 64 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index eb2c36b5..e4c1031b 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -39,8 +39,8 @@ CM.Cache.NextNumber = function(base) { CM.Cache.RemakeBuildingsPrices = function() { for (var i in Game.Objects) { - CM.Cache.Objects10[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 10); - CM.Cache.Objects100[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 100); + CM.Cache.Objects10[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 10); + CM.Cache.Objects100[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 100); } } @@ -223,11 +223,11 @@ CM.Cache.RemakeSeaSpec = function() { } CM.Cache.RemakeSellForChoEgg = function() { - if (Game.hasAura('Earth Shatterer') || Game.dragonLevel < 9) { + if (Game.auraMult('Earth Shatterer') == 1.1) { var sellTotal = 0; for (var i in Game.Objects) { var me = Game.Objects[i]; - sellTotal += CM.Sim.BuildingSell(me.basePrice, me.amount, me.free, me.amount, 0); + sellTotal += CM.Sim.BuildingSell(me, me.basePrice, me.amount, me.free, me.amount, 0); } } else { @@ -235,17 +235,29 @@ CM.Cache.RemakeSellForChoEgg = function() { for (var i in Game.Objects) { if (Game.Objects[i].amount > 0) highestBuilding = i; } + var secondHighBuild = ''; + if (Game.auraMult('Earth Shatterer') == 0 && highestBuilding != '') { + if (Game.Objects[highestBuilding].amount > 1) { + secondHighBuild = highestBuilding; + } + else { + for (var i in Game.Objects) { + if (i != highestBuilding && Game.Objects[i].amount > 0) secondHighBuild = i; + } + } + } + var sellTotal = 0; for (var i in Game.Objects) { var me = Game.Objects[i]; - var amount = 0; + var amount = me.amount; if (i == highestBuilding) { - amount = me.amount - 1; + amount -= 1; } - else { - amount = me.amount; + if (i == secondHighBuild) { + amount -= 1; } - sellTotal += CM.Sim.BuildingSell(me.basePrice, amount, me.free, amount, 1); + sellTotal += CM.Sim.BuildingSell(me, me.basePrice, amount, me.free, amount, 1); } } CM.Cache.SellForChoEgg = sellTotal; @@ -377,7 +389,7 @@ CM.Cache.ChainFrenzyWrathReward = 0; CM.Cache.CentEgg = 0; CM.Cache.SellForChoEgg = 0; CM.Cache.Title = ''; -CM.Cache.HadFierHoard = false; +CM.Cache.HadBuildAura = false; CM.Cache.RealCookiesEarned = -1; CM.Cache.lastDate = -1; CM.Cache.lastCookies = -1; @@ -1812,11 +1824,16 @@ CM.Disp.AddMenuStats = function(title) { var luckyRewardFrenzyMaxWrath = CM.Cache.LuckyRewardFrenzy; var luckyCur = luckyCurBase; var luckyCurWrath = luckyCurBase; + // Old way if (Game.hasAura('Ancestral Metamorphosis')) { luckyRewardMax *= 1.1; luckyRewardFrenzyMax *= 1.1; luckyCur *= 1.1; } + /*luckyRewardMax *= 1 + Game.auraMult('Ancestral Metamorphosis') * 0.1; + luckyRewardFrenzyMax *= 1 + Game.auraMult('Ancestral Metamorphosis') * 0.1; + luckyCur *= 1 + Game.auraMult('Ancestral Metamorphosis') * 0.1;*/ + // Old way if (Game.hasAura('Unholy Dominion')) { luckyRewardMaxWrath *= 1.1; luckyRewardFrenzyMaxWrath *= 1.1; @@ -2242,7 +2259,7 @@ CM.Disp.Tooltip = function(type, name) { if (type == 'b') { l('tooltip').innerHTML = Game.Objects[name].tooltip(); if (CM.Config.TooltipAmor == 1) { - var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name].basePrice, 0, Game.Objects[name].free, Game.Objects[name].amount); + var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name], Game.Objects[name].basePrice, 0, Game.Objects[name].free, Game.Objects[name].amount); var amortizeAmount = buildPrice - Game.Objects[name].totalCookies; if (amortizeAmount > 0) { l('tooltip').innerHTML = l('tooltip').innerHTML @@ -2267,10 +2284,10 @@ CM.Disp.Tooltip = function(type, name) { } else if (Game.buyMode == -1) { if (Game.buyBulk == -1) { - l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join('-' + Beautify(CM.Sim.BuildingSell(Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.Objects[name].amount, 0))); + l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join('-' + Beautify(CM.Sim.BuildingSell(Game.Objects[name], Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.Objects[name].amount, 0))); } else { - l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join('-' + Beautify(CM.Sim.BuildingSell(Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.buyBulk, 0))); + l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join('-' + Beautify(CM.Sim.BuildingSell(Game.Objects[name], Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.buyBulk, 0))); } } } @@ -2627,11 +2644,11 @@ for (var i in Game.wrinklers) { CM.Disp.TooltipText = [ ['GoldCookTooltipPlaceholder', 'Calculated with Golden Switch off', '200px'], - ['PrestMaxTooltipPlaceholder', 'The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer aura, and buying Chocolate egg', '380px'], + ['PrestMaxTooltipPlaceholder', 'The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg', '320px'], ['NextPrestTooltipPlaceholder', 'Calculated with cookies gained from wrinklers and Chocolate egg', '200px'], - ['HeavenChipMaxTooltipPlaceholder', 'The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer aura, and buying Chocolate egg', '390px'], + ['HeavenChipMaxTooltipPlaceholder', 'The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg', '330px'], ['ResetTooltipPlaceholder', 'The bonus income you would get from new prestige levels unlocked at 100% of its potential and from reset achievements if you have the same buildings/upgrades after reset', '370px'], - ['ChoEggTooltipPlaceholder', 'The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer aura, and then buying Chocolate egg', '280px'] + ['ChoEggTooltipPlaceholder', 'The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg', '300px'] ]; /******** @@ -2778,13 +2795,13 @@ CM.Loop = function() { } // Check for aura change to recalculate buildings prices - var hasFierHoard = Game.hasAura('Fierce Hoarder'); - if (!CM.Cache.HadFierHoard && hasFierHoard) { - CM.Cache.HadFierHoard = true; + var hasBuildAura = Game.auraMult('Fierce Hoarder') > 0; + if (!CM.Cache.HadBuildAura && hasBuildAura) { + CM.Cache.HadBuildAura = true; CM.Cache.DoRemakeBuildPrices = 1; } - else if (CM.Cache.HadFierHoard && !hasFierHoard) { - CM.Cache.HadFierHoard = false; + else if (CM.Cache.HadBuildAura && !hasBuildAura) { + CM.Cache.HadBuildAura = false; CM.Cache.DoRemakeBuildPrices = 1; } @@ -2935,7 +2952,7 @@ CM.VersionMinor = '1'; * Sim * *******/ -CM.Sim.BuildingGetPrice = function(basePrice, start, free, increase) { +CM.Sim.BuildingGetPrice = function(build, basePrice, start, free, increase) { /*var price=0; for (var i = Math.max(0 , start); i < Math.max(0, start + increase); i++) { price += basePrice * Math.pow(Game.priceIncrease, Math.max(0, i - free)); @@ -2950,7 +2967,7 @@ CM.Sim.BuildingGetPrice = function(basePrice, start, free, increase) { var moni = 0; for (var i = 0; i < increase; i++) { var price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free)); - price = Game.modifyBuildingPrice(null, price); + price = Game.modifyBuildingPrice(build, price); price = Math.ceil(price); moni += price; start++; @@ -2958,7 +2975,7 @@ CM.Sim.BuildingGetPrice = function(basePrice, start, free, increase) { return moni; } -CM.Sim.BuildingSell = function(basePrice, start, free, amount, emuAura) { +CM.Sim.BuildingSell = function(build, basePrice, start, free, amount, emuAura) { /*var price=0; for (var i = Math.max(0, start - amount); i < Math.max(0, start); i++) { price += basePrice * Math.pow(Game.priceIncrease, Math.max(0, i - free)); @@ -2979,10 +2996,15 @@ CM.Sim.BuildingSell = function(basePrice, start, free, amount, emuAura) { var moni=0; for (var i = 0; i < amount; i++) { var price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free)); - price = Game.modifyBuildingPrice(null, price); + price = Game.modifyBuildingPrice(build, price); price = Math.ceil(price); var giveBack = 0.25; - if (Game.hasAura('Earth Shatterer') || emuAura) giveBack = 0.5; + if (emuAura) { + giveBack = 0.5; + } + else { + giveBack *= 1 + Game.auraMult('Earth Shatterer'); + } price = Math.floor(price * giveBack); if (start > 0) { moni += price; @@ -3009,7 +3031,7 @@ CM.Sim.Win = function(what) { eval('CM.Sim.HasAchiev = ' + Game.HasAchiev.toString().split('Game').join('CM.Sim')); -eval('CM.Sim.GetHeavenlyMultiplier = ' + Game.GetHeavenlyMultiplier.toString().split('Game.Has').join('CM.Sim.Has').split('Game.hasAura').join('CM.Sim.hasAura')); +eval('CM.Sim.GetHeavenlyMultiplier = ' + Game.GetHeavenlyMultiplier.toString().split('Game.Has').join('CM.Sim.Has').split('Game.hasAura').join('CM.Sim.hasAura').split('Game.auraMult').join('CM.Sim.auraMult')); CM.Sim.hasAura = function(what) { if (Game.dragonAuras[CM.Sim.dragonAura].name == what || Game.dragonAuras[CM.Sim.dragonAura2].name == what) @@ -3018,6 +3040,15 @@ CM.Sim.hasAura = function(what) { return false; } +CM.Sim.auraMult = function(what) { + var n = 0; + if (Game.dragonAuras[CM.Sim.dragonAura].name == what || Game.dragonAuras[CM.Sim.dragonAura2].name == what) + n = 1; + if (Game.dragonAuras[CM.Sim.dragonAura].name == 'Reality Bending' || Game.dragonAuras[CM.Sim.dragonAura2].name == 'Reality Bending') + n += 0.1; + return n; +} + eval('CM.Sim.GetTieredCpsMult = ' + Game.GetTieredCpsMult.toString() .split('Game.Has').join('CM.Sim.Has') .split('me.tieredUpgrades').join('Game.Objects[me.name].tieredUpgrades') @@ -3027,6 +3058,7 @@ eval('CM.Sim.GetTieredCpsMult = ' + Game.GetTieredCpsMult.toString() .split('me.grandma').join('Game.Objects[me.name].grandma') .split('me.id').join('Game.Objects[me.name].id') .split('Game.Objects[\'Grandma\']').join('CM.Sim.Objects[\'Grandma\']') + .split('me.fortune').join('Game.Objects[me.name].fortune') ); CM.Sim.getCPSBuffMult = function() { @@ -3044,7 +3076,13 @@ CM.Sim.InitData = function() { CM.Sim.Objects[i] = {}; var me = Game.Objects[i]; var you = CM.Sim.Objects[i]; - 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')); + 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.auraMult').join('CM.Sim.auraMult') + ); // Below is needed for above eval! you.baseCps = me.baseCps; you.name = me.name; @@ -3129,6 +3167,9 @@ 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('Fortune #100')) mult *= 1.01; + if (CM.Sim.Has('Fortune #101')) mult *= 1.07; + var buildMult = 1; if (Game.hasGod) { var godLvl = Game.hasGod('asceticism'); @@ -3170,7 +3211,8 @@ 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.hasAura('Breath of Milk')) milkMult *= 1.05; + milkMult *= 1 + CM.Sim.auraMult('Breath of Milk') * 0.05; if (Game.hasGod) { var godLvl = Game.hasGod('mother'); if (godLvl == 1) milkMult *= 1.1; @@ -3194,7 +3236,9 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('Kitten assistants to the regional manager')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult); if (CM.Sim.Has('Kitten marketeers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult); if (CM.Sim.Has('Kitten analysts')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.125 * milkMult); + if (CM.Sim.Has('Kitten executives')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.115 * milkMult); if (CM.Sim.Has('Kitten angels')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); + if (CM.Sim.Has('Fortune #103')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.05 * milkMult); mult *= catMult; @@ -3223,12 +3267,14 @@ CM.Sim.CalculateGains = function() { // TODO Store lumps? if (CM.Sim.Has('Sugar baking')) mult *= (1 + Math.min(100, Game.lumps) * 0.01); - if (CM.Sim.hasAura('Radiant Appetite')) mult *= 2; + //if (CM.Sim.hasAura('Radiant Appetite')) mult *= 2; + mult *= 1 + CM.Sim.auraMult('Radiant Appetite'); - if (Game.hasAura('Dragon\'s Fortune')) { + if (true) { // || CM.Sim.hasAura('Dragon\'s Fortune')) { var n = Game.shimmerTypes['golden'].n; + var auraMult = CM.Sim.auraMult('Dragon\'s Fortune'); for (var i = 0; i < n; i++) { - mult *= 2.23; + mult *= 1 + auraMult * 1.23; } } @@ -3333,6 +3379,15 @@ CM.Sim.CheckOtherAchiev = function() { if (!CM.Sim.Has(CM.Data.ChristCookies[i])) hasAllChristCook = false; } if (hasAllChristCook) CM.Sim.Win('Let it snow'); + + if (CM.Sim.Has('Fortune cookies')) { + var list = Game.Tiers['fortune'].upgrades; + var fortunes = 0; + for (var i in list) { + if (CM.Sim.Has(list[i].name)) fortunes++; + } + if (fortunes >= list.length) CM.Sim.Win('O Fortuna'); + } } CM.Sim.BuyBuildings = function(amount, target) { @@ -3465,6 +3520,8 @@ CM.Sim.ResetBonus = function(possiblePresMax) { if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000) CM.Sim.Win('The end of the world'); if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000) CM.Sim.Win('Oh, you\'re back'); if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000000) CM.Sim.Win('Lazarus'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000000000) CM.Sim.Win('Smurf account'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000000000000) CM.Sim.Win('If at first you don\'t succeed'); CM.Sim.Upgrades['Heavenly chip secret'].bought = 1; CM.Sim.Upgrades['Heavenly cookie stand'].bought = 1; diff --git a/src/Cache.js b/src/Cache.js index fe2196f4..1c317238 100644 --- a/src/Cache.js +++ b/src/Cache.js @@ -19,8 +19,8 @@ CM.Cache.NextNumber = function(base) { CM.Cache.RemakeBuildingsPrices = function() { for (var i in Game.Objects) { - CM.Cache.Objects10[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 10); - CM.Cache.Objects100[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 100); + CM.Cache.Objects10[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 10); + CM.Cache.Objects100[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 100); } } @@ -203,11 +203,11 @@ CM.Cache.RemakeSeaSpec = function() { } CM.Cache.RemakeSellForChoEgg = function() { - if (Game.hasAura('Earth Shatterer') || Game.dragonLevel < 9) { + if (Game.auraMult('Earth Shatterer') == 1.1) { var sellTotal = 0; for (var i in Game.Objects) { var me = Game.Objects[i]; - sellTotal += CM.Sim.BuildingSell(me.basePrice, me.amount, me.free, me.amount, 0); + sellTotal += CM.Sim.BuildingSell(me, me.basePrice, me.amount, me.free, me.amount, 0); } } else { @@ -215,17 +215,29 @@ CM.Cache.RemakeSellForChoEgg = function() { for (var i in Game.Objects) { if (Game.Objects[i].amount > 0) highestBuilding = i; } + var secondHighBuild = ''; + if (Game.auraMult('Earth Shatterer') == 0 && highestBuilding != '') { + if (Game.Objects[highestBuilding].amount > 1) { + secondHighBuild = highestBuilding; + } + else { + for (var i in Game.Objects) { + if (i != highestBuilding && Game.Objects[i].amount > 0) secondHighBuild = i; + } + } + } + var sellTotal = 0; for (var i in Game.Objects) { var me = Game.Objects[i]; - var amount = 0; + var amount = me.amount; if (i == highestBuilding) { - amount = me.amount - 1; + amount -= 1; } - else { - amount = me.amount; + if (i == secondHighBuild) { + amount -= 1; } - sellTotal += CM.Sim.BuildingSell(me.basePrice, amount, me.free, amount, 1); + sellTotal += CM.Sim.BuildingSell(me, me.basePrice, amount, me.free, amount, 1); } } CM.Cache.SellForChoEgg = sellTotal; @@ -357,7 +369,7 @@ CM.Cache.ChainFrenzyWrathReward = 0; CM.Cache.CentEgg = 0; CM.Cache.SellForChoEgg = 0; CM.Cache.Title = ''; -CM.Cache.HadFierHoard = false; +CM.Cache.HadBuildAura = false; CM.Cache.RealCookiesEarned = -1; CM.Cache.lastDate = -1; CM.Cache.lastCookies = -1; diff --git a/src/Disp.js b/src/Disp.js index 4197b763..f5b4e35f 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1232,11 +1232,16 @@ CM.Disp.AddMenuStats = function(title) { var luckyRewardFrenzyMaxWrath = CM.Cache.LuckyRewardFrenzy; var luckyCur = luckyCurBase; var luckyCurWrath = luckyCurBase; + // Old way if (Game.hasAura('Ancestral Metamorphosis')) { luckyRewardMax *= 1.1; luckyRewardFrenzyMax *= 1.1; luckyCur *= 1.1; } + /*luckyRewardMax *= 1 + Game.auraMult('Ancestral Metamorphosis') * 0.1; + luckyRewardFrenzyMax *= 1 + Game.auraMult('Ancestral Metamorphosis') * 0.1; + luckyCur *= 1 + Game.auraMult('Ancestral Metamorphosis') * 0.1;*/ + // Old way if (Game.hasAura('Unholy Dominion')) { luckyRewardMaxWrath *= 1.1; luckyRewardFrenzyMaxWrath *= 1.1; @@ -1662,7 +1667,7 @@ CM.Disp.Tooltip = function(type, name) { if (type == 'b') { l('tooltip').innerHTML = Game.Objects[name].tooltip(); if (CM.Config.TooltipAmor == 1) { - var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name].basePrice, 0, Game.Objects[name].free, Game.Objects[name].amount); + var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name], Game.Objects[name].basePrice, 0, Game.Objects[name].free, Game.Objects[name].amount); var amortizeAmount = buildPrice - Game.Objects[name].totalCookies; if (amortizeAmount > 0) { l('tooltip').innerHTML = l('tooltip').innerHTML @@ -1687,10 +1692,10 @@ CM.Disp.Tooltip = function(type, name) { } else if (Game.buyMode == -1) { if (Game.buyBulk == -1) { - l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join('-' + Beautify(CM.Sim.BuildingSell(Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.Objects[name].amount, 0))); + l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join('-' + Beautify(CM.Sim.BuildingSell(Game.Objects[name], Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.Objects[name].amount, 0))); } else { - l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join('-' + Beautify(CM.Sim.BuildingSell(Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.buyBulk, 0))); + l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join('-' + Beautify(CM.Sim.BuildingSell(Game.Objects[name], Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.buyBulk, 0))); } } } @@ -2047,10 +2052,10 @@ for (var i in Game.wrinklers) { CM.Disp.TooltipText = [ ['GoldCookTooltipPlaceholder', 'Calculated with Golden Switch off', '200px'], - ['PrestMaxTooltipPlaceholder', 'The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer aura, and buying Chocolate egg', '380px'], + ['PrestMaxTooltipPlaceholder', 'The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg', '320px'], ['NextPrestTooltipPlaceholder', 'Calculated with cookies gained from wrinklers and Chocolate egg', '200px'], - ['HeavenChipMaxTooltipPlaceholder', 'The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer aura, and buying Chocolate egg', '390px'], + ['HeavenChipMaxTooltipPlaceholder', 'The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg', '330px'], ['ResetTooltipPlaceholder', 'The bonus income you would get from new prestige levels unlocked at 100% of its potential and from reset achievements if you have the same buildings/upgrades after reset', '370px'], - ['ChoEggTooltipPlaceholder', 'The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer aura, and then buying Chocolate egg', '280px'] + ['ChoEggTooltipPlaceholder', 'The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg', '300px'] ]; diff --git a/src/Main.js b/src/Main.js index 2b4843d2..5ca6c152 100644 --- a/src/Main.js +++ b/src/Main.js @@ -142,13 +142,13 @@ CM.Loop = function() { } // Check for aura change to recalculate buildings prices - var hasFierHoard = Game.hasAura('Fierce Hoarder'); - if (!CM.Cache.HadFierHoard && hasFierHoard) { - CM.Cache.HadFierHoard = true; + var hasBuildAura = Game.auraMult('Fierce Hoarder') > 0; + if (!CM.Cache.HadBuildAura && hasBuildAura) { + CM.Cache.HadBuildAura = true; CM.Cache.DoRemakeBuildPrices = 1; } - else if (CM.Cache.HadFierHoard && !hasFierHoard) { - CM.Cache.HadFierHoard = false; + else if (CM.Cache.HadBuildAura && !hasBuildAura) { + CM.Cache.HadBuildAura = false; CM.Cache.DoRemakeBuildPrices = 1; } diff --git a/src/Sim.js b/src/Sim.js index 82a3773b..feed0f60 100644 --- a/src/Sim.js +++ b/src/Sim.js @@ -2,7 +2,7 @@ * Sim * *******/ -CM.Sim.BuildingGetPrice = function(basePrice, start, free, increase) { +CM.Sim.BuildingGetPrice = function(build, basePrice, start, free, increase) { /*var price=0; for (var i = Math.max(0 , start); i < Math.max(0, start + increase); i++) { price += basePrice * Math.pow(Game.priceIncrease, Math.max(0, i - free)); @@ -17,7 +17,7 @@ CM.Sim.BuildingGetPrice = function(basePrice, start, free, increase) { var moni = 0; for (var i = 0; i < increase; i++) { var price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free)); - price = Game.modifyBuildingPrice(null, price); + price = Game.modifyBuildingPrice(build, price); price = Math.ceil(price); moni += price; start++; @@ -25,7 +25,7 @@ CM.Sim.BuildingGetPrice = function(basePrice, start, free, increase) { return moni; } -CM.Sim.BuildingSell = function(basePrice, start, free, amount, emuAura) { +CM.Sim.BuildingSell = function(build, basePrice, start, free, amount, emuAura) { /*var price=0; for (var i = Math.max(0, start - amount); i < Math.max(0, start); i++) { price += basePrice * Math.pow(Game.priceIncrease, Math.max(0, i - free)); @@ -46,10 +46,15 @@ CM.Sim.BuildingSell = function(basePrice, start, free, amount, emuAura) { var moni=0; for (var i = 0; i < amount; i++) { var price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free)); - price = Game.modifyBuildingPrice(null, price); + price = Game.modifyBuildingPrice(build, price); price = Math.ceil(price); var giveBack = 0.25; - if (Game.hasAura('Earth Shatterer') || emuAura) giveBack = 0.5; + if (emuAura) { + giveBack = 0.5; + } + else { + giveBack *= 1 + Game.auraMult('Earth Shatterer'); + } price = Math.floor(price * giveBack); if (start > 0) { moni += price; @@ -76,7 +81,7 @@ CM.Sim.Win = function(what) { eval('CM.Sim.HasAchiev = ' + Game.HasAchiev.toString().split('Game').join('CM.Sim')); -eval('CM.Sim.GetHeavenlyMultiplier = ' + Game.GetHeavenlyMultiplier.toString().split('Game.Has').join('CM.Sim.Has').split('Game.hasAura').join('CM.Sim.hasAura')); +eval('CM.Sim.GetHeavenlyMultiplier = ' + Game.GetHeavenlyMultiplier.toString().split('Game.Has').join('CM.Sim.Has').split('Game.hasAura').join('CM.Sim.hasAura').split('Game.auraMult').join('CM.Sim.auraMult')); CM.Sim.hasAura = function(what) { if (Game.dragonAuras[CM.Sim.dragonAura].name == what || Game.dragonAuras[CM.Sim.dragonAura2].name == what) @@ -85,6 +90,15 @@ CM.Sim.hasAura = function(what) { return false; } +CM.Sim.auraMult = function(what) { + var n = 0; + if (Game.dragonAuras[CM.Sim.dragonAura].name == what || Game.dragonAuras[CM.Sim.dragonAura2].name == what) + n = 1; + if (Game.dragonAuras[CM.Sim.dragonAura].name == 'Reality Bending' || Game.dragonAuras[CM.Sim.dragonAura2].name == 'Reality Bending') + n += 0.1; + return n; +} + eval('CM.Sim.GetTieredCpsMult = ' + Game.GetTieredCpsMult.toString() .split('Game.Has').join('CM.Sim.Has') .split('me.tieredUpgrades').join('Game.Objects[me.name].tieredUpgrades') @@ -94,6 +108,7 @@ eval('CM.Sim.GetTieredCpsMult = ' + Game.GetTieredCpsMult.toString() .split('me.grandma').join('Game.Objects[me.name].grandma') .split('me.id').join('Game.Objects[me.name].id') .split('Game.Objects[\'Grandma\']').join('CM.Sim.Objects[\'Grandma\']') + .split('me.fortune').join('Game.Objects[me.name].fortune') ); CM.Sim.getCPSBuffMult = function() { @@ -111,7 +126,13 @@ CM.Sim.InitData = function() { CM.Sim.Objects[i] = {}; var me = Game.Objects[i]; var you = CM.Sim.Objects[i]; - 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')); + 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.auraMult').join('CM.Sim.auraMult') + ); // Below is needed for above eval! you.baseCps = me.baseCps; you.name = me.name; @@ -196,6 +217,9 @@ 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('Fortune #100')) mult *= 1.01; + if (CM.Sim.Has('Fortune #101')) mult *= 1.07; + var buildMult = 1; if (Game.hasGod) { var godLvl = Game.hasGod('asceticism'); @@ -237,7 +261,8 @@ 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.hasAura('Breath of Milk')) milkMult *= 1.05; + milkMult *= 1 + CM.Sim.auraMult('Breath of Milk') * 0.05; if (Game.hasGod) { var godLvl = Game.hasGod('mother'); if (godLvl == 1) milkMult *= 1.1; @@ -261,7 +286,9 @@ CM.Sim.CalculateGains = function() { if (CM.Sim.Has('Kitten assistants to the regional manager')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult); if (CM.Sim.Has('Kitten marketeers')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult); if (CM.Sim.Has('Kitten analysts')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.125 * milkMult); + if (CM.Sim.Has('Kitten executives')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.115 * milkMult); if (CM.Sim.Has('Kitten angels')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult); + if (CM.Sim.Has('Fortune #103')) catMult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.05 * milkMult); mult *= catMult; @@ -290,12 +317,14 @@ CM.Sim.CalculateGains = function() { // TODO Store lumps? if (CM.Sim.Has('Sugar baking')) mult *= (1 + Math.min(100, Game.lumps) * 0.01); - if (CM.Sim.hasAura('Radiant Appetite')) mult *= 2; + //if (CM.Sim.hasAura('Radiant Appetite')) mult *= 2; + mult *= 1 + CM.Sim.auraMult('Radiant Appetite'); - if (Game.hasAura('Dragon\'s Fortune')) { + if (true) { // || CM.Sim.hasAura('Dragon\'s Fortune')) { var n = Game.shimmerTypes['golden'].n; + var auraMult = CM.Sim.auraMult('Dragon\'s Fortune'); for (var i = 0; i < n; i++) { - mult *= 2.23; + mult *= 1 + auraMult * 1.23; } } @@ -400,6 +429,15 @@ CM.Sim.CheckOtherAchiev = function() { if (!CM.Sim.Has(CM.Data.ChristCookies[i])) hasAllChristCook = false; } if (hasAllChristCook) CM.Sim.Win('Let it snow'); + + if (CM.Sim.Has('Fortune cookies')) { + var list = Game.Tiers['fortune'].upgrades; + var fortunes = 0; + for (var i in list) { + if (CM.Sim.Has(list[i].name)) fortunes++; + } + if (fortunes >= list.length) CM.Sim.Win('O Fortuna'); + } } CM.Sim.BuyBuildings = function(amount, target) { @@ -532,6 +570,8 @@ CM.Sim.ResetBonus = function(possiblePresMax) { if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000) CM.Sim.Win('The end of the world'); if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000) CM.Sim.Win('Oh, you\'re back'); if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000000) CM.Sim.Win('Lazarus'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000000000) CM.Sim.Win('Smurf account'); + if (CM.Cache.RealCookiesEarned >= 1000000000000000000000000000000000000000000000000000000) CM.Sim.Win('If at first you don\'t succeed'); CM.Sim.Upgrades['Heavenly chip secret'].bought = 1; CM.Sim.Upgrades['Heavenly cookie stand'].bought = 1;