1 line
19 KiB
JavaScript
1 line
19 KiB
JavaScript
CM.Sim.BuildingGetPrice=function(e,i,a,n,m){let s=0;for(let t=0;t<m;t++){let m=i*Game.priceIncrease**Math.max(0,a-n);m=Game.modifyBuildingPrice(e,m),m=Math.ceil(m),s+=m,a++}return s},CM.Sim.modifyBuildingPrice=function(e,i){if(CM.Sim.Has("Season savings")&&(i*=.99),CM.Sim.Has("Santa's dominion")&&(i*=.99),CM.Sim.Has("Faberge egg")&&(i*=.99),CM.Sim.Has("Divine discount")&&(i*=.99),CM.Sim.Has("Fortune #100")&&(i*=.99),i*=1-.02*CM.Sim.auraMult("Fierce Hoarder"),Game.hasBuff("Everything must go")&&(i*=.95),Game.hasBuff("Crafty pixies")&&(i*=.98),Game.hasBuff("Nasty goblins")&&(i*=1.02),e.fortune&&CM.Sim.Has(e.fortune.name)&&(i*=.93),i*=CM.Sim.eff("buildingCost"),CM.Sim.Objects.Temple.minigameLoaded){const e=CM.Sim.hasGod("creation");1===e?i*=.93:2===e?i*=.95:3===e&&(i*=.98)}return i},CM.Sim.getSellMultiplier=function(){let e=.25;return e*=1+CM.Sim.auraMult("Earth Shatterer"),e},CM.Sim.BuildingSell=function(e,i,a,n,m,s){s=void 0===s?0:s;let t=0;-1===m&&(m=a),m||(m=Game.buyBulk);for(let o=0;o<m;o++){let m=i*Game.priceIncrease**Math.max(0,a-n);m=s?Game.modifyBuildingPrice(e,m):CM.Sim.modifyBuildingPrice(e,m),m=Math.ceil(m);const o=s?e.getSellMultiplier():CM.Sim.getSellMultiplier();m=Math.floor(m*o),a>0&&(t+=m,a--)}return t},CM.Sim.ReplaceFunction=function(e){return e.toString().split("Game.Upgrades[").join("CM.Sim.Upgrades[").split("Game.Achievements").join("CM.Sim.Achievements").split("Game.Has").join("CM.Sim.Has").split("Game.dragonAura]").join("CM.Sim.dragonAura]").split("Game.dragonAura2]").join("CM.Sim.dragonAura2]").split("Game.auraMult").join("CM.Sim.auraMult").split("Game.hasGod").join("CM.Sim.hasGod").split("Game.effs").join("CM.Sim.effs").split("Game.Objects").join("CM.Sim.Objects").split("Game.GetTieredCpsMult").join("CM.Sim.GetTieredCpsMult").split("Game.eff").join("CM.Sim.eff")},CM.Sim.CreateSimFunctions=function(){CM.Sim.Has=new Function(`return ${CM.Sim.ReplaceFunction(Game.Has)}`)(),CM.Sim.HasAchiev=new Function(`return ${CM.Sim.ReplaceFunction(Game.HasAchiev)}`)(),CM.Sim.hasAura=new Function(`return ${CM.Sim.ReplaceFunction(Game.hasAura)}`)(),CM.Sim.GetHeavenlyMultiplier=new Function(`return ${CM.Sim.ReplaceFunction(Game.GetHeavenlyMultiplier)}`)(),CM.Sim.auraMult=new Function(`return ${CM.Sim.ReplaceFunction(Game.auraMult)}`)(),CM.Sim.eff=new Function(`return ${CM.Sim.ReplaceFunction(Game.eff)}`)(),CM.Sim.GetTieredCpsMult=new Function(`return ${CM.Sim.ReplaceFunction(Game.GetTieredCpsMult)}`)()},CM.Sim.Win=function(e){CM.Sim.Achievements[e]&&0===CM.Sim.Achievements[e].won&&(CM.Sim.Achievements[e].won=1,"shadow"!==Game.Achievements[e].pool&&CM.Sim.AchievementsOwned++)},CM.Sim.hasGod=function(e){if(Game.hasGod){const i=CM.Sim.Objects.Temple.minigame.gods[e];for(let e=0;e<3;e++)if(CM.Sim.Objects.Temple.minigame.slot[e]===i.id)return e+1}return!1},CM.Sim.InitialBuildingData=function(e){const i=Game.Objects[e],a={};return a.cps=new Function(`return ${CM.Sim.ReplaceFunction(i.cps)}`)(),a.baseCps=i.baseCps,a.name=i.name,a.tieredUpgrades=i.tieredUpgrades,a.synergies=i.synergies,a.fortune=i.fortune,a.grandma=i.grandma,a.baseCPS=i.baseCps,a.id=i.id,a.vanilla=i.vanilla,a},CM.Sim.InitUpgrade=function(e){const i=Game.Upgrades[e],a={};return a.power=i.power,"function"==typeof i.power&&(i.power=new Function(`return ${CM.Sim.ReplaceFunction(i.power)}`)()),a.pool=i.pool,a.name=i.name,a},CM.Sim.InitAchievement=function(e){const i=Game.Achievements[e],a={};return a.name=i.name,a},CM.Sim.InitData=function(){CM.Sim.Objects=[];for(const e of Object.keys(Game.Objects))CM.Sim.Objects[e]=CM.Sim.InitialBuildingData(e);CM.Sim.Upgrades=[];for(const e of Object.keys(Game.Upgrades))CM.Sim.Upgrades[e]=CM.Sim.InitUpgrade(e);CM.Sim.Achievements=[];for(const e of Object.keys(Game.Achievements))CM.Sim.Achievements[e]=CM.Sim.InitAchievement(e);CM.Sim.CopyData()},CM.Sim.CopyData=function(){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;for(const e of Object.keys(Game.Objects)){const i=Game.Objects[e];let a=CM.Sim.Objects[e];void 0===a&&(CM.Sim.Objects[e]=CM.Sim.InitialBuildingData(e),a=CM.Sim.Objects[e],CM.Disp.CreateBotBarBuildingColumn(e)),a.amount=i.amount,a.level=i.level,a.totalCookies=i.totalCookies,a.basePrice=i.basePrice,a.free=i.free,i.minigameLoaded&&(a.minigameLoaded=i.minigameLoaded,a.minigame=i.minigame)}for(const e of Object.keys(Game.Upgrades)){const i=Game.Upgrades[e];let a=CM.Sim.Upgrades[e];void 0===a&&(CM.Sim.Upgrades[e]=CM.Sim.InitUpgrade(e),a=CM.Sim.Upgrades[e]),a.bought=i.bought}for(const e of Object.keys(Game.Achievements)){const i=Game.Achievements[e];let a=CM.Sim.Achievements[e];void 0===a&&(CM.Sim.Achievements[e]=CM.Sim.InitAchievement(e),a=CM.Sim.Achievements[e]),a.won=i.won}CM.Cache.CacheDragonAuras(),CM.Sim.dragonAura=CM.Cache.dragonAura,CM.Sim.dragonAura2=CM.Cache.dragonAura2},CM.Sim.CalculateGains=function(){CM.Sim.cookiesPs=0;let e=1;const i={};for(const e of Object.keys(Game.Objects))if(Game.Objects[e].minigameLoaded&&Game.Objects[e].minigame.effs){const a=Game.Objects[e].minigame.effs;for(const e in a)i[e]?i[e]*=a[e]:i[e]=a[e]}CM.Sim.effs=i,1!==Game.ascensionMode&&(e+=.01*parseFloat(CM.Sim.prestige)*CM.Sim.heavenlyPower*CM.Sim.GetHeavenlyMultiplier()),e*=CM.Sim.eff("cps"),CM.Sim.Has("Heralds")&&1!==Game.ascensionMode&&(e*=1+.01*Game.heralds);for(const i of Object.keys(Game.cookieUpgrades)){const a=Game.cookieUpgrades[i];CM.Sim.Has(a.name)&&("function"==typeof a.power?e*=1+.01*CM.Sim.Upgrades[a.name].power(CM.Sim.Upgrades[a.name]):e*=1+.01*a.power)}CM.Sim.Has("Specialized chocolate chips")&&(e*=1.01),CM.Sim.Has("Designer cocoa beans")&&(e*=1.02),CM.Sim.Has("Underworld ovens")&&(e*=1.03),CM.Sim.Has("Exotic nuts")&&(e*=1.04),CM.Sim.Has("Arcane sugar")&&(e*=1.05),CM.Sim.Has("Increased merriness")&&(e*=1.15),CM.Sim.Has("Improved jolliness")&&(e*=1.15),CM.Sim.Has("A lump of coal")&&(e*=1.01),CM.Sim.Has("An itchy sweater")&&(e*=1.01),CM.Sim.Has("Santa's dominion")&&(e*=1.2),CM.Sim.Has("Fortune #100")&&(e*=1.01),CM.Sim.Has("Fortune #101")&&(e*=1.07),CM.Sim.Has("Dragon scale")&&(e*=1.03);let a=1;if(CM.Sim.hasGod){let i=CM.Sim.hasGod("asceticism");1===i?e*=1.15:2===i?e*=1.1:3===i&&(e*=1.05),i=CM.Sim.hasGod("ages"),1===i?e*=1+.15*Math.sin(CM.Sim.DateAges/1e3/10800*Math.PI*2):2===i?e*=1+.15*Math.sin(CM.Sim.DateAges/1e3/43200*Math.PI*2):3===i&&(e*=1+.15*Math.sin(CM.Sim.DateAges/1e3/86400*Math.PI*2)),i=CM.Sim.hasGod("decadence"),1===i?a*=.93:2===i?a*=.95:3===i&&(a*=.98),i=CM.Sim.hasGod("industry"),1===i?a*=1.1:2===i?a*=1.06:3===i&&(a*=1.03),i=CM.Sim.hasGod("labor"),1===i?a*=.97:2===i?a*=.98:3===i&&(a*=.99)}CM.Sim.Has("Santa's legacy")&&(e*=1+.03*(Game.santaLevel+1));const n=CM.Sim.AchievementsOwned/25;let m=1;if(CM.Sim.Has("Santa's milk and cookies")&&(m*=1.05),m*=1+.05*CM.Sim.auraMult("Breath of Milk"),CM.Sim.hasGod){const e=CM.Sim.hasGod("mother");1===e?m*=1.1:2===e?m*=1.05:3===e&&(m*=1.03)}m*=CM.Sim.eff("milk");let s=1;CM.Sim.Has("Kitten helpers")&&(s*=1+.1*n*m),CM.Sim.Has("Kitten workers")&&(s*=1+.125*n*m),CM.Sim.Has("Kitten engineers")&&(s*=1+.15*n*m),CM.Sim.Has("Kitten overseers")&&(s*=1+.175*n*m),CM.Sim.Has("Kitten managers")&&(s*=1+.2*n*m),CM.Sim.Has("Kitten accountants")&&(s*=1+.2*n*m),CM.Sim.Has("Kitten specialists")&&(s*=1+.2*n*m),CM.Sim.Has("Kitten experts")&&(s*=1+.2*n*m),CM.Sim.Has("Kitten consultants")&&(s*=1+.2*n*m),CM.Sim.Has("Kitten assistants to the regional manager")&&(s*=1+.175*n*m),CM.Sim.Has("Kitten marketeers")&&(s*=1+.15*n*m),CM.Sim.Has("Kitten analysts")&&(s*=1+.125*n*m),CM.Sim.Has("Kitten executives")&&(s*=1+.115*n*m),CM.Sim.Has("Kitten angels")&&(s*=1+.1*n*m),CM.Sim.Has("Fortune #103")&&(s*=1+.05*n*m);for(const e of Object.keys(CM.Sim.Objects)){const i=CM.Sim.Objects[e];let s=i.cps(i);1!==Game.ascensionMode&&(s*=(1+.01*i.level)*a),"Grandma"===i.name&&CM.Sim.Has("Milkhelp® lactose intolerance relief tablets")&&(s*=1+.05*n*m),CM.Sim.cookiesPs+=i.amount*s}CM.Sim.Has('"egg"')&&(CM.Sim.cookiesPs+=9),e*=s;let t=1;if(CM.Sim.Has("Chicken egg")&&(t*=1.01),CM.Sim.Has("Duck egg")&&(t*=1.01),CM.Sim.Has("Turkey egg")&&(t*=1.01),CM.Sim.Has("Quail egg")&&(t*=1.01),CM.Sim.Has("Robin egg")&&(t*=1.01),CM.Sim.Has("Ostrich egg")&&(t*=1.01),CM.Sim.Has("Cassowary egg")&&(t*=1.01),CM.Sim.Has("Salmon roe")&&(t*=1.01),CM.Sim.Has("Frogspawn")&&(t*=1.01),CM.Sim.Has("Shark egg")&&(t*=1.01),CM.Sim.Has("Turtle egg")&&(t*=1.01),CM.Sim.Has("Ant larva")&&(t*=1.01),CM.Sim.Has("Century egg")){let e=10*Math.floor((CM.Sim.DateCentury-Game.startDate)/1e3/10)/60/60/24;e=Math.min(e,100),CM.Cache.CentEgg=1+.1*(1-(1-e/100)**3),t*=CM.Cache.CentEgg}e*=t,CM.Sim.Has("Sugar baking")&&(e*=1+.01*Math.min(100,Game.lumps)),e*=1+CM.Sim.auraMult("Radiant Appetite");const o=CM.Sim.cookiesPs*e;for(const e of Object.keys(Game.CpsAchievements))o>=Game.CpsAchievements[e].threshold&&CM.Sim.Win(Game.CpsAchievements[e].name);CM.Sim.cookiesPsRaw=o;const C=Game.shimmerTypes.golden.n,M=CM.Sim.auraMult("Dragon's Fortune");for(let i=0;i<C;i++)e*=1+1.23*M;const r=Game.bakeryName.toLowerCase();if("orteil"===r?e*=.99:"ortiel"===r&&(e*=.98),CM.Sim.Has("Elder Covenant")&&(e*=.95),CM.Sim.Has("Golden switch [off]")){let i=1.5;if(CM.Sim.Has("Residual luck")){const e=Game.goldenCookieUpgrades;for(const a of Object.keys(e))CM.Sim.Has(e[a])&&(i+=.1)}e*=i}if(CM.Sim.Has("Shimmering veil [off]")){let i=.5;CM.Sim.Has("Reinforced membrane")&&(i+=.1),e*=1+i}CM.Sim.Has("Magic shenanigans")&&(e*=1e3),CM.Sim.Has("Occult obstruction")&&(e*=0),CM.Sim.cookiesPs=Game.runModHookOnValue("cps",CM.Sim.cookiesPs),e*=CM.Cache.getCPSBuffMult(),CM.Sim.cookiesPs*=e},CM.Sim.CheckOtherAchiev=function(){let e=0;for(const i of Object.keys(Game.GrandmaSynergies))CM.Sim.Has(Game.GrandmaSynergies[i])&&e++;!CM.Sim.HasAchiev("Elder")&&e>=7&&CM.Sim.Win("Elder"),!CM.Sim.HasAchiev("Veteran")&&e>=14&&CM.Sim.Win("Veteran");let i=0,a=1,n=1,m=1e5;for(const e of Object.keys(CM.Sim.Objects))i+=CM.Sim.Objects[e].amount,m=Math.min(CM.Sim.Objects[e].amount,m),CM.Sim.HasAchiev("Mathematician")||CM.Sim.Objects[e].amount<Math.min(128,2**(Game.ObjectsById.length-Game.Objects[e].id-1))&&(a=0),CM.Sim.HasAchiev("Base 10")||CM.Sim.Objects[e].amount<10*(Game.ObjectsById.length-Game.Objects[e].id)&&(n=0);m>=1&&CM.Sim.Win("One with everything"),1===a&&CM.Sim.Win("Mathematician"),1===n&&CM.Sim.Win("Base 10"),m>=100&&CM.Sim.Win("Centennial"),m>=150&&CM.Sim.Win("Centennial and a half"),m>=200&&CM.Sim.Win("Bicentennial"),m>=250&&CM.Sim.Win("Bicentennial and a half"),m>=300&&CM.Sim.Win("Tricentennial"),m>=350&&CM.Sim.Win("Tricentennial and a half"),m>=400&&CM.Sim.Win("Quadricentennial"),m>=450&&CM.Sim.Win("Quadricentennial and a half"),m>=500&&CM.Sim.Win("Quincentennial"),m>=550&&CM.Sim.Win("Quincentennial and a half"),m>=600&&CM.Sim.Win("Sexcentennial"),i>=100&&CM.Sim.Win("Builder"),i>=500&&CM.Sim.Win("Architect"),i>=1e3&&CM.Sim.Win("Engineer"),i>=2e3&&CM.Sim.Win("Lord of Constructs"),i>=4e3&&CM.Sim.Win("Grand design"),i>=8e3&&CM.Sim.Win("Ecumenopolis"),CM.Sim.UpgradesOwned>=20&&CM.Sim.Win("Enhancer"),CM.Sim.UpgradesOwned>=50&&CM.Sim.Win("Augmenter"),CM.Sim.UpgradesOwned>=100&&CM.Sim.Win("Upgrader"),CM.Sim.UpgradesOwned>=200&&CM.Sim.Win("Lord of Progress"),CM.Sim.UpgradesOwned>=300&&CM.Sim.Win("The full picture"),CM.Sim.UpgradesOwned>=400&&CM.Sim.Win("When there's nothing left to add"),i>=4e3&&CM.Sim.UpgradesOwned>=300&&CM.Sim.Win("Polymath"),i>=8e3&&CM.Sim.UpgradesOwned>=400&&CM.Sim.Win("Renaissance baker"),CM.Sim.Objects.Cursor.amount+CM.Sim.Objects.Grandma.amount>=777&&CM.Sim.Win("The elder scrolls");let s=!0;for(const e of Object.keys(CM.Data.HalloCookies))CM.Sim.Has(CM.Data.HalloCookies[e])||(s=!1);s&&CM.Sim.Win("Spooky cookies");let t=!0;for(const e of Object.keys(CM.Data.ChristCookies))CM.Sim.Has(CM.Data.ChristCookies[e])||(t=!1);if(t&&CM.Sim.Win("Let it snow"),CM.Sim.Has("Fortune cookies")){const e=Game.Tiers.fortune.upgrades;let i=0;for(const a of Object.keys(e))CM.Sim.Has(e[a].name)&&i++;i>=e.length&&CM.Sim.Win("O Fortuna")}},CM.Sim.NoGoldSwitchCPS=function(){return CM.Sim.CopyData(),CM.Sim.Upgrades["Golden switch [off]"].bought=0,CM.Sim.CalculateGains(),CM.Sim.cookiesPs},CM.Sim.BuyBuildingsBonusIncome=function(e,i){CM.Sim.CopyData();const a=CM.Sim.Objects[e];if(a.amount+=i,"Cursor"===e)a.amount>=1&&CM.Sim.Win("Click"),a.amount>=2&&CM.Sim.Win("Double-click"),a.amount>=50&&CM.Sim.Win("Mouse wheel"),a.amount>=100&&CM.Sim.Win("Of Mice and Men"),a.amount>=200&&CM.Sim.Win("The Digital"),a.amount>=300&&CM.Sim.Win("Extreme polydactyly"),a.amount>=400&&CM.Sim.Win("Dr. T"),a.amount>=500&&CM.Sim.Win("Thumbs, phalanges, metacarpals"),a.amount>=600&&CM.Sim.Win("With her finger and her thumb"),a.amount>=700&&CM.Sim.Win("Gotta hand it to you"),a.amount>=800&&CM.Sim.Win("The devil's workshop");else for(const e in Game.Objects[a.name].tieredAchievs)a.amount>=Game.Tiers[Game.Objects[a.name].tieredAchievs[e].tier].achievUnlock&&CM.Sim.Win(Game.Objects[a.name].tieredAchievs[e].name);const n=CM.Sim.AchievementsOwned;return CM.Sim.CalculateGains(),CM.Sim.CheckOtherAchiev(),n!==CM.Sim.AchievementsOwned&&CM.Sim.CalculateGains(),CM.Sim.cookiesPs-Game.cookiesPs},CM.Sim.BuyUpgradesBonusIncome=function(e){if("toggle"===Game.Upgrades[e].pool||0===Game.Upgrades[e].bought&&Game.Upgrades[e].unlocked&&"prestige"!==Game.Upgrades[e].pool){CM.Sim.CopyData();const i=CM.Sim.Upgrades[e];"Shimmering veil [on]"===i.name?CM.Sim.Upgrades["Shimmering veil [off]"].bought=0:"Golden switch [on]"===i.name?CM.Sim.Upgrades["Golden switch [off]"].bought=0:i.bought=(i.bought+1)%2,Game.CountsAsUpgradeOwned(Game.Upgrades[e].pool)&&CM.Sim.UpgradesOwned++,"Elder Pledge"===e?(CM.Sim.pledges++,CM.Sim.pledges>0&&CM.Sim.Win("Elder nap"),CM.Sim.pledges>=5&&CM.Sim.Win("Elder slumber")):"Elder Covenant"===e?CM.Sim.Win("Elder calm"):"Prism heart biscuits"===e?CM.Sim.Win("Lovely cookies"):"Heavenly key"===e&&CM.Sim.Win("Wholesome");const a=CM.Sim.AchievementsOwned;CM.Sim.CalculateGains(),CM.Sim.CheckOtherAchiev(),a!==CM.Sim.AchievementsOwned&&CM.Sim.CalculateGains();const n=CM.Sim.mouseCps()-Game.computedMouseCps;return n?[CM.Sim.cookiesPs-Game.cookiesPs,n]:[CM.Sim.cookiesPs-Game.cookiesPs]}return[]},CM.Sim.mouseCps=function(){let e=0;CM.Sim.Has("Thousand fingers")&&(e+=.1),CM.Sim.Has("Million fingers")&&(e*=5),CM.Sim.Has("Billion fingers")&&(e*=10),CM.Sim.Has("Trillion fingers")&&(e*=20),CM.Sim.Has("Quadrillion fingers")&&(e*=20),CM.Sim.Has("Quintillion fingers")&&(e*=20),CM.Sim.Has("Sextillion fingers")&&(e*=20),CM.Sim.Has("Septillion fingers")&&(e*=20),CM.Sim.Has("Octillion fingers")&&(e*=20),CM.Sim.Has("Nonillion fingers")&&(e*=20);let i=0;for(const e of Object.keys(CM.Sim.Objects))i+=CM.Sim.Objects[e].amount;i-=CM.Sim.Objects.Cursor.amount,e*=i,CM.Sim.Has("Plastic mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Iron mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Titanium mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Adamantium mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Unobtainium mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Eludium mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Wishalloy mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Fantasteel mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Nevercrack mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Armythril mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Technobsidian mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Plasmarble mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Miraculite mouse")&&(e+=.01*CM.Sim.cookiesPs),CM.Sim.Has("Fortune #104")&&(e+=.01*CM.Sim.cookiesPs);let a=1;if(CM.Sim.Has("Santa's helpers")&&(a*=1.1),CM.Sim.Has("Cookie egg")&&(a*=1.1),CM.Sim.Has("Halo gloves")&&(a*=1.1),CM.Sim.Has("Dragon claw")&&(a*=1.03),CM.Sim.Has("Aura gloves")&&(a*=1+.05*Math.min(Game.Objects.Cursor.level,CM.Sim.Has("Luminous gloves")?20:10)),a*=CM.Sim.eff("click"),CM.Sim.Objects.Temple.minigameLoaded&&CM.Sim.hasGod){const e=CM.Sim.hasGod("labor");1===e?a*=1.15:2===e?a*=1.1:3===e&&(a*=1.05)}for(const e of Object.keys(Game.buffs))void 0!==Game.buffs[e].multClick&&(a*=Game.buffs[e].multClick);a*=1+.05*CM.Sim.auraMult("Dragon Cursor");let n=a*Game.ComputeCps(1,CM.Sim.Has("Reinforced index finger")+CM.Sim.Has("Carpal tunnel prevention cream")+CM.Sim.Has("Ambidextrous"),e);return n=Game.runModHookOnValue("cookiesPerClick",n),Game.hasBuff("Cursed finger")&&(n=Game.buffs["Cursed finger"].power),n},CM.Sim.CalculateChangeAura=function(e){CM.Sim.CopyData(),l("promptContent").children[0].innerHTML.includes("secondary")?CM.Sim.dragonAura2=e:CM.Sim.dragonAura=e;let i=0;if(CM.Sim.dragonAura!==CM.Cache.dragonAura||CM.Sim.dragonAura2!==CM.Cache.dragonAura2)for(let e=Game.ObjectsById.length-1;e>-1;--e)if(Game.ObjectsById[e-1].amount>0){const a=CM.Sim.Objects[Game.ObjectsById[e].name].name;CM.Sim.Objects[a].amount-=1,CM.Sim.buildingsOwned-=1,i=CM.Sim.Objects[a].basePrice*Game.priceIncrease**Math.max(0,CM.Sim.Objects[a].amount-1-CM.Sim.Objects[a].free),i=Game.modifyBuildingPrice(CM.Sim.Objects[a],i),i=Math.ceil(i);break}const a=CM.Sim.AchievementsOwned;return CM.Sim.CalculateGains(),CM.Sim.CheckOtherAchiev(),a!==CM.Sim.AchievementsOwned&&CM.Sim.CalculateGains(),[CM.Sim.cookiesPs-Game.cookiesPs,i]},CM.Sim.ResetBonus=function(e){let i=Game.cookiesPs;CM.Sim.CopyData(),0===CM.Sim.Upgrades["Heavenly key"].bought&&(CM.Sim.Upgrades["Heavenly chip secret"].bought=1,CM.Sim.Upgrades["Heavenly cookie stand"].bought=1,CM.Sim.Upgrades["Heavenly bakery"].bought=1,CM.Sim.Upgrades["Heavenly confectionery"].bought=1,CM.Sim.Upgrades["Heavenly key"].bought=1,CM.Sim.CalculateGains(),i=CM.Sim.cookiesPs,CM.Sim.CopyData()),CM.Cache.RealCookiesEarned>=1e6&&CM.Sim.Win("Sacrifice"),CM.Cache.RealCookiesEarned>=1e9&&CM.Sim.Win("Oblivion"),CM.Cache.RealCookiesEarned>=1e12&&CM.Sim.Win("From scratch"),CM.Cache.RealCookiesEarned>=1e15&&CM.Sim.Win("Nihilism"),CM.Cache.RealCookiesEarned>=1e18&&CM.Sim.Win("Dematerialize"),CM.Cache.RealCookiesEarned>=1e21&&CM.Sim.Win("Nil zero zilch"),CM.Cache.RealCookiesEarned>=1e24&&CM.Sim.Win("Transcendence"),CM.Cache.RealCookiesEarned>=1e27&&CM.Sim.Win("Obliterate"),CM.Cache.RealCookiesEarned>=1e30&&CM.Sim.Win("Negative void"),CM.Cache.RealCookiesEarned>=1e33&&CM.Sim.Win("To crumbs, you say?"),CM.Cache.RealCookiesEarned>=1e36&&CM.Sim.Win("You get nothing"),CM.Cache.RealCookiesEarned>=1e39&&CM.Sim.Win("Humble rebeginnings"),CM.Cache.RealCookiesEarned>=1e42&&CM.Sim.Win("The end of the world"),CM.Cache.RealCookiesEarned>=1e45&&CM.Sim.Win("Oh, you're back"),CM.Cache.RealCookiesEarned>=1e48&&CM.Sim.Win("Lazarus"),CM.Cache.RealCookiesEarned>=1e51&&CM.Sim.Win("Smurf account"),CM.Cache.RealCookiesEarned>=1e54&&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,CM.Sim.Upgrades["Heavenly bakery"].bought=1,CM.Sim.Upgrades["Heavenly confectionery"].bought=1,CM.Sim.Upgrades["Heavenly key"].bought=1,CM.Sim.prestige=e;const a=CM.Sim.AchievementsOwned;CM.Sim.CalculateGains(),CM.Sim.CheckOtherAchiev(),a!==CM.Sim.AchievementsOwned&&CM.Sim.CalculateGains();const n=CM.Sim.cookiesPs-i;return CM.Sim.prestige=Game.prestige,n},CM.Sim.SellBuildingsForChoEgg=function(){let e=0;CM.Sim.CopyData();let i=2;5!==CM.Sim.dragonAura&&18!==CM.Sim.dragonAura||--i,5!==CM.Sim.dragonAura2&&18!==CM.Sim.dragonAura2||--i,CM.Sim.dragonAura=5,CM.Sim.dragonAura2=18;for(let e=0;e<i;++e){let e=0;for(const i in CM.Sim.Objects)CM.Sim.Objects[i].amount>0&&(e=CM.Sim.Objects[i]);e.amount--,CM.Sim.buildingsOwned--}for(const i of Object.keys(CM.Sim.Objects)){const a=CM.Sim.Objects[i];e+=CM.Sim.BuildingSell(Game.Objects[a.name],Game.Objects[i].basePrice,a.amount,Game.Objects[i].free,a.amount)}return e}; |