Merge pull request #635 from DanielNoord/code/modules

Code/modules
This commit is contained in:
Daniël van Noord authored and GitHub committed 2021-03-09 23:35:04 +01:00
commit bb34bce9a5
27 files changed
+2753 -219

No files matched your search

+3
View File
@@ -1,2 +1,5 @@
CookieMonster.js CookieMonster.js
CookieMonster.user.js CookieMonster.user.js
src/*.js
!src/*/*
dist/*
+2 -1
View File
@@ -16,7 +16,8 @@ jobs:
- name: Check if CookieMonster.js is built correctly - name: Check if CookieMonster.js is built correctly
run: | run: |
npm install npm install
npx terser ./src/Header.js ./src/Cache.js ./src/Config.js ./src/Data.js ./src/Disp.js ./src/Main.js ./src/Sim.js ./src/Footer.js -o CookieMonsterTest.js npx webpack
npx terser ./dist/Header.js ./dist/Cache.js ./dist/Config.js ./dist/Data.js ./dist/Disp.js ./dist/Main.js ./dist/Sim.js ./dist/Footer.js -o CookieMonsterTest.js
if cmp CookieMonster.js CookieMonsterTest.js; then if cmp CookieMonster.js CookieMonsterTest.js; then
echo '### SUCCESS: CookieMonster is correctly built! ###' echo '### SUCCESS: CookieMonster is correctly built! ###'
else else
+1 -1
View File
@@ -1 +1 @@
const CM={Backup:{},Cache:{},Config:{},Data:{Config:{}},Disp:{},Footer:{},Main:{},Options:{},Sim:{},VersionMajor:"2.031",VersionMinor:"5"};CM.Cache.InitCache=function(){CM.Cache.CacheDragonAuras();CM.Cache.CacheWrinklers();CM.Cache.CacheStats();CM.Cache.CacheGoldenAndWrathCookiesMults();CM.Cache.CacheChain();CM.Cache.CacheMissingUpgrades();CM.Cache.CacheSeaSpec();CM.Cache.InitCookiesDiff();CM.Cache.HeavenlyChipsDiff=new CMAvgQueue(5);CM.Cache.CacheHeavenlyChipsPS();CM.Cache.CacheAvgCPS();CM.Cache.CacheIncome();CM.Cache.CacheBuildingsPrices();CM.Cache.CachePP()};CM.Cache.LoopCache=function(){CM.Cache.CacheWrinklers();CM.Cache.CachePP();CM.Cache.CacheCurrWrinklerCPS();CM.Cache.CacheAvgCPS();CM.Cache.CacheHeavenlyChipsPS();const cookiesToNext=Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset);CM.Cache.TimeTillNextPrestige=CM.Disp.FormatTime(cookiesToNext/CM.Disp.GetCPS())};class CMAvgQueue{constructor(maxLength){this.maxLength=maxLength;this.queue=[]}addLatest(newValue){if(this.queue.push(newValue)>this.maxLength){this.queue.shift()}}calcAverage(timePeriod){if(timePeriod>this.maxLength)timePeriod=this.maxLength;if(timePeriod>this.queue.length)timePeriod=this.queue.length;let ret=0;for(let i=this.queue.length-1;i>=0&&i>this.queue.length-1-timePeriod;i--){ret+=this.queue[i]}if(ret===0){return 0}return ret/timePeriod}}CM.Cache.CacheDragonAuras=function(){CM.Cache.dragonAura=Game.dragonAura;CM.Cache.dragonAura2=Game.dragonAura2};CM.Cache.CacheWrinklers=function(){CM.Cache.WrinklersTotal=0;CM.Cache.WrinklersNormal=0;CM.Cache.WrinklersFattest=[0,null];for(let i=0;i<Game.wrinklers.length;i++){let sucked=Game.wrinklers[i].sucked;let toSuck=1.1;if(Game.Has("Sacrilegious corruption"))toSuck*=1.05;if(Game.wrinklers[i].type===1)toSuck*=3;sucked*=toSuck;if(Game.Has("Wrinklerspawn"))sucked*=1.05;if(CM.Sim.Objects.Temple.minigameLoaded){const godLvl=Game.hasGod("scorn");if(godLvl===1)sucked*=1.15;else if(godLvl===2)sucked*=1.1;else if(godLvl===3)sucked*=1.05}CM.Cache.WrinklersTotal+=sucked;if(Game.wrinklers[i].type===0){CM.Cache.WrinklersNormal+=sucked;if(sucked>CM.Cache.WrinklersFattest[0])CM.Cache.WrinklersFattest=[sucked,i]}}};CM.Cache.CacheStats=function(){CM.Cache.Lucky=CM.Cache.NoGoldSwitchCookiesPS*900/.15;CM.Cache.Lucky*=CM.Cache.DragonsFortuneMultAdjustment;const cpsBuffMult=CM.Cache.getCPSBuffMult();if(cpsBuffMult>0)CM.Cache.Lucky/=cpsBuffMult;else CM.Cache.Lucky=0;CM.Cache.LuckyReward=CM.Cache.GoldenCookiesMult*(CM.Cache.Lucky*.15)+13;CM.Cache.LuckyWrathReward=CM.Cache.WrathCookiesMult*(CM.Cache.Lucky*.15)+13;CM.Cache.LuckyFrenzy=CM.Cache.Lucky*7;CM.Cache.LuckyRewardFrenzy=CM.Cache.GoldenCookiesMult*(CM.Cache.LuckyFrenzy*.15)+13;CM.Cache.LuckyWrathRewardFrenzy=CM.Cache.WrathCookiesMult*(CM.Cache.LuckyFrenzy*.15)+13;CM.Cache.Conjure=CM.Cache.Lucky*2;CM.Cache.ConjureReward=CM.Cache.Conjure*.15;CM.Cache.Edifice=0;let max=0;let n=0;for(const i of Object.keys(Game.Objects)){if(Game.Objects[i].amount>max)max=Game.Objects[i].amount;if(Game.Objects[i].amount>0)n++}for(const i of Object.keys(Game.Objects)){if((Game.Objects[i].amount<max||n===1)&&Game.Objects[i].amount<400&&Game.Objects[i].price*2>CM.Cache.Edifice){CM.Cache.Edifice=Game.Objects[i].price*2;CM.Cache.EdificeBuilding=i}}};CM.Cache.CacheGoldenAndWrathCookiesMults=function(){if(CM.Footer.isInitzializing){CM.Cache.GoldenCookiesMult=1;CM.Cache.WrathCookiesMult=1;CM.Cache.DragonsFortuneMultAdjustment=1}else{let goldenMult=1;let wrathMult=1;let mult=1;if(CM.Sim.Has("Green yeast digestives"))mult*=1.01;if(CM.Sim.Has("Dragon fang"))mult*=1.03;goldenMult*=1+Game.auraMult("Ancestral Metamorphosis")*.1;goldenMult*=Game.eff("goldenCookieGain");wrathMult*=1+Game.auraMult("Unholy Dominion")*.1;wrathMult*=Game.eff("wrathCookieGain");CM.Cache.GoldenCookiesMult=mult*goldenMult;CM.Cache.WrathCookiesMult=mult*wrathMult;CM.Cache.DragonsFortuneMultAdjustment=1;if(Game.shimmerTypes.golden.n===0){CM.Cache.DragonsFortuneMultAdjustment*=1+Game.auraMult("Dragon's Fortune")*1.23}}};CM.Cache.MaxChainCookieReward=function(digit,maxPayout,mult){let totalFromChain=0;let moni=0;let nextMoni=0;let nextRequired=0;let chain=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);while(nextMoni<maxPayout){moni=Math.max(digit,Math.min(Math.floor(1/9*10**chain*digit*mult),maxPayout*mult));nextMoni=Math.max(digit,Math.min(Math.floor(1/9*10**(chain+1)*digit*mult),maxPayout*mult));nextRequired=Math.floor(1/9*10**(chain+1)*digit*mult);totalFromChain+=moni;chain++}return[totalFromChain,moni,nextRequired]};CM.Cache.CacheChain=function(){let maxPayout=CM.Cache.NoGoldSwitchCookiesPS*60*60*6*CM.Cache.DragonsFortuneMultAdjustment;const cpsBuffMult=CM.Cache.getCPSBuffMult();if(cpsBuffMult>0)maxPayout/=cpsBuffMult;else maxPayout=0;CM.Cache.ChainMaxReward=CM.Cache.MaxChainCookieReward(7,maxPayout,CM.Cache.GoldenCookiesMult);CM.Cache.ChainRequired=CM.Cache.ChainMaxReward[1]*2/CM.Cache.GoldenCookiesMult;CM.Cache.ChainRequLine truncated CM={Backup:{},Cache:{},Config:{},Data:{Config:{}},Disp:{},Footer:{},Main:{},Options:{},Sim:{},VersionMajor:"2.031",VersionMinor:"5"};(()=>{CM.Cache.InitCache=function(){CM.Cache.CacheDragonAuras(),CM.Cache.CacheWrinklers(),CM.Cache.CacheStats(),CM.Cache.CacheGoldenAndWrathCookiesMults(),CM.Cache.CacheChain(),CM.Cache.CacheMissingUpgrades(),CM.Cache.CacheSeaSpec(),CM.Cache.InitCookiesDiff(),CM.Cache.HeavenlyChipsDiff=new e(5),CM.Cache.CacheHeavenlyChipsPS(),CM.Cache.CacheAvgCPS(),CM.Cache.CacheIncome(),CM.Cache.CacheBuildingsPrices(),CM.Cache.CachePP()},CM.Cache.LoopCache=function(){CM.Cache.CacheWrinklers(),CM.Cache.CachePP(),CM.Cache.CacheCurrWrinklerCPS(),CM.Cache.CacheAvgCPS(),CM.Cache.CacheHeavenlyChipsPS();const e=Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset);CM.Cache.TimeTillNextPrestige=CM.Disp.FormatTime(e/CM.Disp.GetCPS())};class e{constructor(e){this.maxLength=e,this.queue=[]}addLatest(e){this.queue.push(e)>this.maxLength&&this.queue.shift()}calcAverage(e){e>this.maxLength&&(e=this.maxLength),e>this.queue.length&&(e=this.queue.length);let a=0;for(let C=this.queue.length-1;C>=0&&C>this.queue.length-1-e;C--)a+=this.queue[C];return 0===a?0:a/e}}CM.Cache.CacheDragonAuras=function(){CM.Cache.dragonAura=Game.dragonAura,CM.Cache.dragonAura2=Game.dragonAura2},CM.Cache.CacheWrinklers=function(){CM.Cache.WrinklersTotal=0,CM.Cache.WrinklersNormal=0,CM.Cache.WrinklersFattest=[0,null];for(let e=0;e<Game.wrinklers.length;e++){let a=Game.wrinklers[e].sucked,C=1.1;if(Game.Has("Sacrilegious corruption")&&(C*=1.05),1===Game.wrinklers[e].type&&(C*=3),a*=C,Game.Has("Wrinklerspawn")&&(a*=1.05),CM.Sim.Objects.Temple.minigameLoaded){const e=Game.hasGod("scorn");1===e?a*=1.15:2===e?a*=1.1:3===e&&(a*=1.05)}CM.Cache.WrinklersTotal+=a,0===Game.wrinklers[e].type&&(CM.Cache.WrinklersNormal+=a,a>CM.Cache.WrinklersFattest[0]&&(CM.Cache.WrinklersFattest=[a,e]))}},CM.Cache.CacheStats=function(){CM.Cache.Lucky=900*CM.Cache.NoGoldSwitchCookiesPS/.15,CM.Cache.Lucky*=CM.Cache.DragonsFortuneMultAdjustment;const e=CM.Cache.getCPSBuffMult();e>0?CM.Cache.Lucky/=e:CM.Cache.Lucky=0,CM.Cache.LuckyReward=CM.Cache.GoldenCookiesMult*(.15*CM.Cache.Lucky)+13,CM.Cache.LuckyWrathReward=CM.Cache.WrathCookiesMult*(.15*CM.Cache.Lucky)+13,CM.Cache.LuckyFrenzy=7*CM.Cache.Lucky,CM.Cache.LuckyRewardFrenzy=CM.Cache.GoldenCookiesMult*(.15*CM.Cache.LuckyFrenzy)+13,CM.Cache.LuckyWrathRewardFrenzy=CM.Cache.WrathCookiesMult*(.15*CM.Cache.LuckyFrenzy)+13,CM.Cache.Conjure=2*CM.Cache.Lucky,CM.Cache.ConjureReward=.15*CM.Cache.Conjure,CM.Cache.Edifice=0;let a=0,C=0;for(const e of Object.keys(Game.Objects))Game.Objects[e].amount>a&&(a=Game.Objects[e].amount),Game.Objects[e].amount>0&&C++;for(const e of Object.keys(Game.Objects))(Game.Objects[e].amount<a||1===C)&&Game.Objects[e].amount<400&&2*Game.Objects[e].price>CM.Cache.Edifice&&(CM.Cache.Edifice=2*Game.Objects[e].price,CM.Cache.EdificeBuilding=e)},CM.Cache.CacheGoldenAndWrathCookiesMults=function(){if(CM.Footer.isInitzializing)CM.Cache.GoldenCookiesMult=1,CM.Cache.WrathCookiesMult=1,CM.Cache.DragonsFortuneMultAdjustment=1;else{let e=1,a=1,C=1;CM.Sim.Has("Green yeast digestives")&&(C*=1.01),CM.Sim.Has("Dragon fang")&&(C*=1.03),e*=1+.1*Game.auraMult("Ancestral Metamorphosis"),e*=Game.eff("goldenCookieGain"),a*=1+.1*Game.auraMult("Unholy Dominion"),a*=Game.eff("wrathCookieGain"),CM.Cache.GoldenCookiesMult=C*e,CM.Cache.WrathCookiesMult=C*a,CM.Cache.DragonsFortuneMultAdjustment=1,0===Game.shimmerTypes.golden.n&&(CM.Cache.DragonsFortuneMultAdjustment*=1+1.23*Game.auraMult("Dragon's Fortune"))}},CM.Cache.MaxChainCookieReward=function(e,a,C){let c=0,o=0,i=0,s=0,t=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);for(;i<a;)o=Math.max(e,Math.min(Math.floor(1/9*10**t*e*C),a*C)),i=Math.max(e,Math.min(Math.floor(1/9*10**(t+1)*e*C),a*C)),s=Math.floor(1/9*10**(t+1)*e*C),c+=o,t++;return[c,o,s]},CM.Cache.CacheChain=function(){let e=60*CM.Cache.NoGoldSwitchCookiesPS*60*6*CM.Cache.DragonsFortuneMultAdjustment;const a=CM.Cache.getCPSBuffMult();a>0?e/=a:e=0,CM.Cache.ChainMaxReward=CM.Cache.MaxChainCookieReward(7,e,CM.Cache.GoldenCookiesMult),CM.Cache.ChainRequired=2*CM.Cache.ChainMaxReward[1]/CM.Cache.GoldenCookiesMult,CM.Cache.ChainRequiredNext=CM.Cache.ChainMaxReward[2]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment,CM.Cache.ChainMaxWrathReward=CM.Cache.MaxChainCookieReward(6,e,CM.Cache.WrathCookiesMult),CM.Cache.ChainWrathRequired=2*CM.Cache.ChainMaxWrathReward[1]/CM.Cache.WrathCookiesMult,CM.Cache.ChainWrathRequiredNext=CM.Cache.ChainMaxWrathReward[2]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment,CM.Cache.ChainFrenzyMaxReward=CM.Cache.MaxChainCookieReward(7,7*e,CM.Cache.GoldenCookiesMult),CM.Cache.ChainFrenzyRequired=2*CM.Cache.ChainFrenzyMaxReward[1]/CM.Cache.GoldenCookiesMult,CM.Cache.ChainFrenzyRequiredNext=CM.Cache.ChainFrenzyMaxReward[2]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment,CM.Cache.ChainFrenzyMaxWrathReward=CM.CacLine truncated
+1
View File
@@ -0,0 +1 @@
(()=>{CM.Cache.InitCache=function(){CM.Cache.CacheDragonAuras(),CM.Cache.CacheWrinklers(),CM.Cache.CacheStats(),CM.Cache.CacheGoldenAndWrathCookiesMults(),CM.Cache.CacheChain(),CM.Cache.CacheMissingUpgrades(),CM.Cache.CacheSeaSpec(),CM.Cache.InitCookiesDiff(),CM.Cache.HeavenlyChipsDiff=new e(5),CM.Cache.CacheHeavenlyChipsPS(),CM.Cache.CacheAvgCPS(),CM.Cache.CacheIncome(),CM.Cache.CacheBuildingsPrices(),CM.Cache.CachePP()},CM.Cache.LoopCache=function(){CM.Cache.CacheWrinklers(),CM.Cache.CachePP(),CM.Cache.CacheCurrWrinklerCPS(),CM.Cache.CacheAvgCPS(),CM.Cache.CacheHeavenlyChipsPS();const e=Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset);CM.Cache.TimeTillNextPrestige=CM.Disp.FormatTime(e/CM.Disp.GetCPS())};class e{constructor(e){this.maxLength=e,this.queue=[]}addLatest(e){this.queue.push(e)>this.maxLength&&this.queue.shift()}calcAverage(e){e>this.maxLength&&(e=this.maxLength),e>this.queue.length&&(e=this.queue.length);let a=0;for(let C=this.queue.length-1;C>=0&&C>this.queue.length-1-e;C--)a+=this.queue[C];return 0===a?0:a/e}}CM.Cache.CacheDragonAuras=function(){CM.Cache.dragonAura=Game.dragonAura,CM.Cache.dragonAura2=Game.dragonAura2},CM.Cache.CacheWrinklers=function(){CM.Cache.WrinklersTotal=0,CM.Cache.WrinklersNormal=0,CM.Cache.WrinklersFattest=[0,null];for(let e=0;e<Game.wrinklers.length;e++){let a=Game.wrinklers[e].sucked,C=1.1;if(Game.Has("Sacrilegious corruption")&&(C*=1.05),1===Game.wrinklers[e].type&&(C*=3),a*=C,Game.Has("Wrinklerspawn")&&(a*=1.05),CM.Sim.Objects.Temple.minigameLoaded){const e=Game.hasGod("scorn");1===e?a*=1.15:2===e?a*=1.1:3===e&&(a*=1.05)}CM.Cache.WrinklersTotal+=a,0===Game.wrinklers[e].type&&(CM.Cache.WrinklersNormal+=a,a>CM.Cache.WrinklersFattest[0]&&(CM.Cache.WrinklersFattest=[a,e]))}},CM.Cache.CacheStats=function(){CM.Cache.Lucky=900*CM.Cache.NoGoldSwitchCookiesPS/.15,CM.Cache.Lucky*=CM.Cache.DragonsFortuneMultAdjustment;const e=CM.Cache.getCPSBuffMult();e>0?CM.Cache.Lucky/=e:CM.Cache.Lucky=0,CM.Cache.LuckyReward=CM.Cache.GoldenCookiesMult*(.15*CM.Cache.Lucky)+13,CM.Cache.LuckyWrathReward=CM.Cache.WrathCookiesMult*(.15*CM.Cache.Lucky)+13,CM.Cache.LuckyFrenzy=7*CM.Cache.Lucky,CM.Cache.LuckyRewardFrenzy=CM.Cache.GoldenCookiesMult*(.15*CM.Cache.LuckyFrenzy)+13,CM.Cache.LuckyWrathRewardFrenzy=CM.Cache.WrathCookiesMult*(.15*CM.Cache.LuckyFrenzy)+13,CM.Cache.Conjure=2*CM.Cache.Lucky,CM.Cache.ConjureReward=.15*CM.Cache.Conjure,CM.Cache.Edifice=0;let a=0,C=0;for(const e of Object.keys(Game.Objects))Game.Objects[e].amount>a&&(a=Game.Objects[e].amount),Game.Objects[e].amount>0&&C++;for(const e of Object.keys(Game.Objects))(Game.Objects[e].amount<a||1===C)&&Game.Objects[e].amount<400&&2*Game.Objects[e].price>CM.Cache.Edifice&&(CM.Cache.Edifice=2*Game.Objects[e].price,CM.Cache.EdificeBuilding=e)},CM.Cache.CacheGoldenAndWrathCookiesMults=function(){if(CM.Footer.isInitzializing)CM.Cache.GoldenCookiesMult=1,CM.Cache.WrathCookiesMult=1,CM.Cache.DragonsFortuneMultAdjustment=1;else{let e=1,a=1,C=1;CM.Sim.Has("Green yeast digestives")&&(C*=1.01),CM.Sim.Has("Dragon fang")&&(C*=1.03),e*=1+.1*Game.auraMult("Ancestral Metamorphosis"),e*=Game.eff("goldenCookieGain"),a*=1+.1*Game.auraMult("Unholy Dominion"),a*=Game.eff("wrathCookieGain"),CM.Cache.GoldenCookiesMult=C*e,CM.Cache.WrathCookiesMult=C*a,CM.Cache.DragonsFortuneMultAdjustment=1,0===Game.shimmerTypes.golden.n&&(CM.Cache.DragonsFortuneMultAdjustment*=1+1.23*Game.auraMult("Dragon's Fortune"))}},CM.Cache.MaxChainCookieReward=function(e,a,C){let c=0,o=0,i=0,s=0,t=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);for(;i<a;)o=Math.max(e,Math.min(Math.floor(1/9*10**t*e*C),a*C)),i=Math.max(e,Math.min(Math.floor(1/9*10**(t+1)*e*C),a*C)),s=Math.floor(1/9*10**(t+1)*e*C),c+=o,t++;return[c,o,s]},CM.Cache.CacheChain=function(){let e=60*CM.Cache.NoGoldSwitchCookiesPS*60*6*CM.Cache.DragonsFortuneMultAdjustment;const a=CM.Cache.getCPSBuffMult();a>0?e/=a:e=0,CM.Cache.ChainMaxReward=CM.Cache.MaxChainCookieReward(7,e,CM.Cache.GoldenCookiesMult),CM.Cache.ChainRequired=2*CM.Cache.ChainMaxReward[1]/CM.Cache.GoldenCookiesMult,CM.Cache.ChainRequiredNext=CM.Cache.ChainMaxReward[2]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment,CM.Cache.ChainMaxWrathReward=CM.Cache.MaxChainCookieReward(6,e,CM.Cache.WrathCookiesMult),CM.Cache.ChainWrathRequired=2*CM.Cache.ChainMaxWrathReward[1]/CM.Cache.WrathCookiesMult,CM.Cache.ChainWrathRequiredNext=CM.Cache.ChainMaxWrathReward[2]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment,CM.Cache.ChainFrenzyMaxReward=CM.Cache.MaxChainCookieReward(7,7*e,CM.Cache.GoldenCookiesMult),CM.Cache.ChainFrenzyRequired=2*CM.Cache.ChainFrenzyMaxReward[1]/CM.Cache.GoldenCookiesMult,CM.Cache.ChainFrenzyRequiredNext=CM.Cache.ChainFrenzyMaxReward[2]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment,CM.Cache.ChainFrenzyMaxWrathReward=CM.Cache.MaxChainCookieReward(6,7*e,CM.Cache.WrathCookiesMult),CM.Cache.ChainFrenzyWrathRequired=2*CM.Cache.ChainFrenzyMaxWrathReward[1]/CMLine truncated
+1
View File
@@ -0,0 +1 @@
CM.Config.SaveConfig=function(){const o=b64_to_utf8(unescape(localStorage.getItem("CookieClickerGame")).split("!END!")[0]),i=o.match(/CookieMonster.*(;|$)/);if(null!==i){const n=o.replace(i[0],`CookieMonster:${CM.save()}`);localStorage.setItem("CookieClickerGame",escape(`${utf8_to_b64(n)}!END!`))}},CM.Config.LoadConfig=function(o){if(void 0!==localStorage.CMConfig&&delete localStorage.CMConfig,void 0!==o){CM.Options=o;let i=!1;for(const o in CM.Data.ConfigDefault)if(void 0===CM.Options[o])i=!0,CM.Options[o]=CM.Data.ConfigDefault[o];else if("Header"!==o&&"Colors"!==o)-1===o.indexOf("SoundURL")?CM.Options[o]>-1&&CM.Options[o]<CM.Data.Config[o].label.length||(i=!0,CM.Options[o]=CM.Data.ConfigDefault[o]):"string"!=typeof CM.Options[o]&&(i=!0,CM.Options[o]=CM.Data.ConfigDefault[o]);else if("Header"===o)for(const n in CM.Data.ConfigDefault.Header)void 0!==CM.Options[o][n]&&CM.Options[o][n]>-1&&CM.Options[o][n]<2||(i=!0,CM.Options[o][n]=CM.Data.ConfigDefault[o][n]);else for(const n in CM.Data.ConfigDefault.Colors)void 0!==CM.Options[o][n]&&"string"==typeof CM.Options[o][n]||(i=!0,CM.Options[o][n]=CM.Data.ConfigDefault[o][n]);i&&CM.Config.SaveConfig(),CM.Main.Loop();for(const o in CM.Data.ConfigDefault)"Header"!==o&&void 0!==CM.Data.Config[o].func&&CM.Data.Config[o].func()}else CM.Config.RestoreDefault()},CM.Config.RestoreDefault=function(){CM.Config.LoadConfig(CM.Data.ConfigDefault),CM.Config.SaveConfig(),Game.UpdateMenu()},CM.Config.ToggleConfig=function(o){CM.Options[o]++,CM.Options[o]===CM.Data.Config[o].label.length?(CM.Options[o]=0,CM.Data.Config[o].toggle&&(l(CM.Config.ConfigPrefix+o).className="option off")):l(CM.Config.ConfigPrefix+o).className="option",void 0!==CM.Data.Config[o].func&&CM.Data.Config[o].func(),l(CM.Config.ConfigPrefix+o).innerHTML=CM.Data.Config[o].label[CM.Options[o]],CM.Config.SaveConfig()},CM.Config.ToggleConfigVolume=function(o){null!==l(`slider${o}`)&&(l(`slider${o}right`).innerHTML=`${l(`slider${o}`).value}%`,CM.Options[o]=Math.round(l(`slider${o}`).value)),CM.Config.SaveConfig()},CM.Config.ToggleHeader=function(o){CM.Options.Header[o]++,CM.Options.Header[o]>1&&(CM.Options.Header[o]=0),CM.Config.SaveConfig()},CM.Config.CheckNotificationPermissions=function(o){if(1===o){const o=function(){try{Notification.requestPermission().then()}catch(o){return!1}return!0};"Notification"in window?o()?Notification.requestPermission().then():Notification.requestPermission():console.log("This browser does not support notifications.")}},CM.Config.ConfigPrefix="CMConfig";
+1
View File
@@ -0,0 +1 @@
(()=>{"use strict";CM.Data={Fortunes:["Fortune #001","Fortune #002","Fortune #003","Fortune #004","Fortune #005","Fortune #006","Fortune #007","Fortune #008","Fortune #009","Fortune #010","Fortune #011","Fortune #012","Fortune #013","Fortune #014","Fortune #015","Fortune #016","Fortune #017","Fortune #018","Fortune #100","Fortune #101","Fortune #102","Fortune #103","Fortune #104"],HalloCookies:["Skull cookies","Ghost cookies","Bat cookies","Slime cookies","Pumpkin cookies","Eyeball cookies","Spider cookies"],ChristCookies:["Christmas tree biscuits","Snowflake biscuits","Snowman biscuits","Holly biscuits","Candy cane biscuits","Bell biscuits","Present biscuits"],ValCookies:["Pure heart biscuits","Ardent heart biscuits","Sour heart biscuits","Weeping heart biscuits","Golden heart biscuits","Eternal heart biscuits","Prism heart biscuits"],PlantDrops:["Elderwort biscuits","Bakeberry cookies","Duketater cookies","Green yeast digestives","Wheat slims","Fern tea","Ichor syrup"],Effects:{buildingCost:"Building prices",click:"Cookies per click",cps:"Total CPS",cursorCps:"Cursor CPS",goldenCookieDur:"Golden cookie duration",goldenCookieEffDur:"Golden cookie effect duration",goldenCookieFreq:"Golden cookie frequency",goldenCookieGain:"Golden cookie gains",grandmaCps:"Grandma CPS",itemDrops:"Random item drop chance",milk:"Effect from milk",reindeerDur:"Reindeer duration",reindeerFreq:"Reindeer frequency",reindeerGain:"Reindeer gains",upgradeCost:"Upgrade prices",wrathCookieDur:"Wrath cookie duration",wrathCookieEffDur:"Wrath cookie effect duration",wrathCookieFreq:"Wrath cookie frequency",wrathCookieGain:"Wrath cookie gains",wrinklerEat:"Wrinkler ",wrinklerSpawn:"Wrinkler spawn frequency"},ModDescription:'<div class="listing">\n <a href="https://github.com/Aktanusa/CookieMonster" target="blank">Cookie Monster</a>\n offers a wide range of tools and statistics to enhance your game experience.\n 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.</br>\n Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>\n Please also report any bugs you may find over there!</br>\n </div>\n ',LatestReleaseNotes:'<div class="listing">\n <b>The latest update (v 2.031.4) has introduced the following features:</b></br>\n - Added a changelog to the info tab and notification indicating a new version</br>\n - Warnings in tooltips are now based on the income after buying the upgrade</br>\n - A new warning and stat for Conjure Baked Goods in combination with Frenzy has been added</br>\n - User can now set a custom tooltip warning ("x times cps") in the settings</br>\n - Garden plots with plants that give cookies on harvest now display a tooltip with current and maximum reward</br>\n - The Harvest All button in the Garden now has a tooltip displaying the current reward </br>\n - The Ascend button can now display additional info (this can be turned off in the settings) </br>\n - The statistics page now displays the Heavenly Chips per second</br>\n - The statistics page now displays the CPS needed for the next level in Chain Cookies</br>\n - The statistics page now displays the cookies needed for optimal rewards for garden plants</br>\n - You can now set a Heavenly Chips target in the settings which will be counted down to in the statistics page</br>\n - The color picker in the settings has been updated to its latest version</br>\n - The overlay of seconds/percentage of timers is now toggle able and more readable</br>\n - You can now toggle to disable bulk-buying from buying less than the selected amount (i.e., buying 7 of a building by pressing the buy 10 when you don\'t have enough for 10)</br>\n - CookieMonster now uses the Modding API provided by the base game</br>\n - There is a new option that allows the decoupling of the base game volume setting and the volumes of sounds created by the mod</br>\n - The tab title now displays a "!" if a Golden Cookie or Reindeer can spawn</br>\n - PP calculation can now be set to: 1) Exclude the 1st, 2nd or 3rd most optimal building (if you never want to buy that it), 2) Always consider optimal buildings that cost below "xx seconds of CPS" (toggleable in the settings), 3) Ignore any building or upgrade that is not purchasable at the moment</br>\n </br>\n <b>This update fixes the following bugs:</b></br>\n - Minigames with enhanced tooltips will now also show these if the minigames were not loaded when CookieMonster was loaded</br>\n - Sound, Flashes and Notifications will no longer play when the mod is initializing</br>\n - The color picker should now update its display consistently</br>\n - Fixed some typo\'s</br>\n - Fixed a game breaking bug when the player had not purchased any upgrades</br>\n - Fixed a number of console errors thrown by CM</br>\n - Fixed the integration with mods that provide additional content, they should now no lLine truncated
+1
View File
@@ -0,0 +1 @@
(()=>{"use strict";const e={FormatTime:function(e,t){if(e===1/0)return e;e=Math.ceil(e);const i=Math.floor(e/31557600),o=Math.floor(e%31557600/86400),a=Math.floor(e%86400/3600),n=Math.floor(e%3600/60),s=Math.floor(e%60);let r="";if(CM.Options.TimeFormat){if(e>315576e4)return"XX:XX:XX:XX:XX";r+=(i<10?"0":"")+i+":",r+=(o<10?"0":"")+o+":",r+=(a<10?"0":"")+a+":",r+=(n<10?"0":"")+n+":",r+=(s<10?"0":"")+s}else{if(e>7776e5)return t?"Over 9000 days!":">9000d";r+=i>0?i+(t?1===i?" year":" years":"y")+", ":"",r+=o>0?o+(t?1===o?" day":" days":"d")+", ":"",(r.length>0||a>0)&&(r+=a+(t?1===a?" hour":" hours":"h")+", "),(r.length>0||n>0)&&(r+=n+(t?1===n?" minute":" minutes":"m")+", "),r+=s+(t?1===s?" second":" seconds":"s")}return r}};CM.Disp=e,CM.Disp.GetWrinkConfigBank=function(){return 1===CM.Options.CalcWrink?CM.Cache.WrinklersTotal:2===CM.Options.CalcWrink?CM.Cache.WrinklersFattest[0]:0},CM.Disp.PopAllNormalWrinklers=function(){for(const e of Object.keys(Game.wrinklers))Game.wrinklers[e].sucked>0&&0===Game.wrinklers[e].type&&(Game.wrinklers[e].hp=0)},CM.Disp.GetCPS=function(){return CM.Options.CPSMode?CM.Cache.AvgCPS:0===CM.Options.CalcWrink?Game.cookiesPs*(1-Game.cpsSucked):1===CM.Options.CalcWrink?Game.cookiesPs*(CM.Cache.CurrWrinklerCPSMult+(1-.05*CM.Cache.CurrWrinklerCount)):2===CM.Options.CalcWrink&&1===Game.wrinklers[CM.Cache.WrinklersFattest[1]].type?Game.cookiesPs*(3*CM.Cache.CurrWrinklerCPSMult/CM.Cache.CurrWrinklerCount+(1-.05*CM.Cache.CurrWrinklerCount)):Game.cookiesPs*(CM.Cache.CurrWrinklerCPSMult/CM.Cache.CurrWrinklerCount+(1-.05*CM.Cache.CurrWrinklerCount))},CM.Disp.CalculateGrimoireRefillTime=function(e,t,i){let o=0;for(;e<i;)e+=.002*Math.max(.002,(e/Math.max(t,100))**.5),o++;return o/Game.fps},CM.Disp.GetLumpColor=function(e){return 0===e?{text:"Normal",color:CM.Disp.colorGray}:1===e?{text:"Bifurcated",color:CM.Disp.colorGreen}:2===e?{text:"Golden",color:CM.Disp.colorYellow}:3===e?{text:"Meaty",color:CM.Disp.colorOrange}:4===e?{text:"Caramelized",color:CM.Disp.colorPurple}:{text:"Unknown Sugar Lump",color:CM.Disp.colorRed}},CM.Disp.GetTimeColor=function(e){let t,i;return e<0?(i=CM.Options.TimeFormat?"00:00:00:00:00":"Done!",t=CM.Disp.colorGreen):(i=CM.Disp.FormatTime(e),t=e>300?CM.Disp.colorRed:e>60?CM.Disp.colorOrange:CM.Disp.colorYellow),{text:i,color:t}},CM.Disp.Beautify=function(e,t,i){const o=CM.Options.ScaleDecimals+1;if(e===1/0)return"Infinity";if(void 0===e)return"0";if(0===CM.Options.Scale)return CM.Backup.Beautify(e,t);if(Number.isFinite(e)){let a="";if(0===e)return e.toString();if(e>.001&&e<CM.Options.ScaleCutoff){a=e.toFixed(2),CM.Options.ScaleSeparator&&(a=a.toLocaleString("nl"));for(let e=0;e<3;e++)"0"!==a[a.length-1]&&"."!==a[a.length-1]||(a=a.slice(0,-1));return a}if(4===CM.Options.Scale&&!i||4===i)a=e.toExponential(o).toString().replace("e","E");else{const t=e.toExponential().toString(),n=Math.floor(t.slice(t.indexOf("e")+1)/3);a=(e/Number("1e"+3*n)).toFixed(o),1===CM.Options.Scale&&!i||1===i?e>=.01&&e<Number("1e"+3*CM.Data.metric.length)?a+=` ${CM.Data.metric[n]}`:a=CM.Disp.Beautify(e,0,4):2===CM.Options.Scale&&!i||2===i?e>=.01&&e<Number("1e"+3*CM.Data.shortScale.length)?a+=` ${CM.Data.shortScale[n]}`:a=CM.Disp.Beautify(e,0,4):3===CM.Options.Scale&&!i||3===i?e>=.01&&e<Number("1e"+3*CM.Data.shortScaleAbbreviated.length)?a+=` ${CM.Data.shortScaleAbbreviated[n]}`:a=CM.Disp.Beautify(e,0,4):(5===CM.Options.Scale&&!i||5===i)&&(a+="E"+3*n)}return""===a&&(console.log(`Could not beautify number with CM.Disp.Beautify: ${e}`),a=CM.Backup.Beautify(e,t)),CM.Options.ScaleSeparator&&(a=a.replace(".",",")),a}return console.log(`Could not beautify number with CM.Disp.Beautify: ${e}`),CM.Backup.Beautify(e,t)},CM.Disp.UpdateAscendState=function(){Game.OnAscend?(l("game").style.bottom="0px",1===CM.Options.BotBar&&(CM.Disp.BotBar.style.display="none"),1===CM.Options.TimerBar&&(CM.Disp.TimerBar.style.display="none")):(CM.Disp.ToggleBotBar(),CM.Disp.ToggleTimerBar()),CM.Disp.UpdateBackground()},CM.Disp.CreateCssArea=function(){CM.Disp.Css=document.createElement("style"),CM.Disp.Css.type="text/css",document.head.appendChild(CM.Disp.Css)},CM.Disp.UpdateBuildingUpgradeStyle=function(){l("products").style.display="grid",l("storeBulk").style.gridRow="1/1",l("upgrades").style.display="flex",l("upgrades").style["flex-wrap"]="wrap"},CM.Disp.UpdateBackground=function(){Game.Background.canvas.width=Game.Background.canvas.parentNode.offsetWidth,Game.Background.canvas.height=Game.Background.canvas.parentNode.offsetHeight,Game.LeftBackground.canvas.width=Game.LeftBackground.canvas.parentNode.offsetWidth,Game.LeftBackground.canvas.height=Game.LeftBackground.canvas.parentNode.offsetHeight},CM.Disp.Draw=function(){if(Game.prefs.autosave&&Game.drawT%10==0&&"stats"===Game.onMenu&&CM.Options.Stats){const e=document.getElementById("CMStatsAutosaveTimer");e&&(e.innerText=Game.sayTime(60*Game.fps-Game.T%(60*Game.fps),4))}CM.Disp.UpdateBuildings(),CM.Disp.UpdateUpgrades(),CM.Disp.UpdateTimerBar(),CM.Disp.UpdateBotBar(),CM.Disp.ULine truncated
+1
View File
@@ -0,0 +1 @@
(()=>{if(CM.init=function(){CM.Footer.isInitzializing=!0;let o=!0;Game.version!==Number(CM.VersionMajor)&&(o=confirm(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} is meant for Game version ${CM.VersionMajor}. Loading a different version may cause errors. Do you still want to load Cookie Monster?`)),o&&(CM.Main.DelayInit(),Game.registerHook("draw",CM.Disp.Draw),Game.registerHook("logic",CM.Main.Loop),CM.Footer.isInitzializing=!1)},CM.save=function(){return JSON.stringify({settings:CM.Options,version:`${CM.VersionMajor}.${CM.VersionMinor}`})},CM.load=function(o){const e=JSON.parse(o);CM.Sim.InitData(),CM.Config.LoadConfig(e.settings),e.version!==`${CM.VersionMajor}.${CM.VersionMinor}`&&(Game.prefs.popups?Game.Popup("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!"):Game.Notify("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!","","",0,1))},CM.Footer.AddJscolor=function(){CM.Footer.Jscolor=document.createElement("script"),CM.Footer.Jscolor.type="text/javascript",CM.Footer.Jscolor.setAttribute("src","https://aktanusa.github.io/CookieMonster/jscolor/jscolor.js"),document.head.appendChild(CM.Footer.Jscolor)},void 0===CM.Footer.isInitzializing){CM.Footer.AddJscolor();const o=setInterval((function(){"undefined"!=typeof jscolor&&(jscolor.init(),Game.registerMod("CookieMonster",CM),clearInterval(o))}),500)}})();
+1
View File
@@ -0,0 +1 @@
CM={Backup:{},Cache:{},Config:{},Data:{Config:{}},Disp:{},Footer:{},Main:{},Options:{},Sim:{},VersionMajor:"2.031",VersionMinor:"5"};
+1
View File
@@ -0,0 +1 @@
(()=>{var __webpack_exports__={};CM.Main.Loop=function(){if(CM.Disp.lastAscendState!==Game.OnAscend&&(CM.Disp.lastAscendState=Game.OnAscend,CM.Disp.UpdateAscendState()),!Game.OnAscend&&0===Game.AscendTimer){CM.Main.LastModCount!==Object.keys(Game.mods).length&&(CM.Sim.CreateSimFunctions(),CM.Sim.InitData(),CM.Cache.InitCache(),CM.Main.LastModCount=Object.keys(Game.mods).length),CM.Sim.DoSims&&(CM.Cache.CacheIncome(),CM.Cache.NoGoldSwitchCPS(),CM.Cache.CacheGoldenAndWrathCookiesMults(),CM.Cache.CacheStats(),CM.Cache.CacheMissingUpgrades(),CM.Cache.CacheChain(),CM.Cache.CacheDragonCost(),CM.Cache.CacheSeaSpec(),CM.Cache.CacheSellForChoEgg(),CM.Sim.DoSims=0);const e=Game.auraMult("Fierce Hoarder")>0;!CM.Cache.HadBuildAura&&e?(CM.Cache.HadBuildAura=!0,CM.Cache.DoRemakeBuildPrices=1):CM.Cache.HadBuildAura&&!e&&(CM.Cache.HadBuildAura=!1,CM.Cache.DoRemakeBuildPrices=1),CM.Cache.DoRemakeBuildPrices&&(CM.Cache.CacheBuildingsPrices(),CM.Cache.DoRemakeBuildPrices=0),CM.Cache.LoopCache(),CM.Main.CheckGoldenCookie(),CM.Main.CheckTickerFortune(),CM.Main.CheckSeasonPopup(),CM.Main.CheckGardenTick(),CM.Main.CheckMagicMeter(),CM.Main.CheckWrinklerCount()}},CM.Main.DelayInit=function(){CM.Sim.CreateSimFunctions(),CM.Sim.InitData(),CM.Cache.InitCache(),CM.Main.LastModCount=Object.keys(Game.mods).length,CM.Disp.CreateCssArea(),CM.Disp.CreateBotBar(),CM.Disp.CreateTimerBar(),CM.Disp.CreateUpgradeBar(),CM.Disp.CreateWhiteScreen(),CM.Disp.CreateFavicon();for(const e of Object.keys(CM.Disp.TooltipText))CM.Disp.CreateSimpleTooltip(CM.Disp.TooltipText[e][0],CM.Disp.TooltipText[e][1],CM.Disp.TooltipText[e][2]);CM.Disp.CreateWrinklerButtons(),CM.Disp.UpdateBuildingUpgradeStyle(),CM.Main.ReplaceTooltips(),CM.Main.AddWrinklerAreaDetect(),CM.Main.ReplaceNative(),CM.Main.ReplaceNativeGrimoire(),Game.CalculateGains(),CM.Config.LoadConfig(),CM.Disp.lastAscendState=Game.OnAscend,Game.prefs.popups?Game.Popup(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} loaded!`):Game.Notify(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} loaded!`,"","",1,1),Game.Win("Third-party")},CM.Main.ReplaceNative=function(){CM.Backup.Beautify=Beautify,Beautify=CM.Disp.Beautify,CM.Backup.CalculateGains=Game.CalculateGains,eval(`CM.Backup.CalculateGainsMod = ${Game.CalculateGains.toString().split("ages');").join("ages');CM.Sim.DateAges = Date.now();").split("if (Game.Has('Century").join("CM.Sim.DateCentury = Date.now();if (Game.Has('Century")}`),Game.CalculateGains=function(){CM.Backup.CalculateGainsMod(),CM.Sim.DoSims=1},CM.Backup.tooltip={},CM.Backup.tooltip.draw=Game.tooltip.draw,eval(`CM.Backup.tooltip.drawMod = ${Game.tooltip.draw.toString().split("this").join("Game.tooltip")}`),Game.tooltip.draw=function(e,i,a){CM.Backup.tooltip.drawMod(e,i,a)},CM.Backup.tooltip.update=Game.tooltip.update,eval(`CM.Backup.tooltip.updateMod = ${Game.tooltip.update.toString().split("this.").join("Game.tooltip.")}`),Game.tooltip.update=function(){CM.Backup.tooltip.updateMod(),CM.Disp.UpdateTooltipLocation()},CM.Backup.UpdateWrinklers=Game.UpdateWrinklers,Game.UpdateWrinklers=function(){CM.Main.FixMouseY(CM.Backup.UpdateWrinklers)},CM.Backup.UpdateSpecial=Game.UpdateSpecial,Game.UpdateSpecial=function(){CM.Main.FixMouseY(CM.Backup.UpdateSpecial)},l("bigCookie").removeEventListener("click",Game.ClickCookie,!1),l("bigCookie").addEventListener("click",(function(){CM.Main.FixMouseY(Game.ClickCookie)}),!1),CM.Backup.RebuildUpgrades=Game.RebuildUpgrades,Game.RebuildUpgrades=function(){CM.Backup.RebuildUpgrades(),CM.Disp.ReplaceTooltipUpgrade(),Game.CalculateGains()},CM.Backup.ClickProduct=Game.ClickProduct,Game.ClickProduct=function(e){(!CM.Options.BulkBuyBlock||Game.ObjectsById[e].bulkPrice<Game.cookies||-1===Game.buyMode)&&CM.Backup.ClickProduct(e)},CM.Backup.DescribeDragonAura=Game.DescribeDragonAura,Game.DescribeDragonAura=function(e){CM.Backup.DescribeDragonAura(e),CM.Disp.AddAuraInfo(e)},CM.Backup.ToggleSpecialMenu=Game.ToggleSpecialMenu,Game.ToggleSpecialMenu=function(e){CM.Backup.ToggleSpecialMenu(e),CM.Disp.AddDragonLevelUpTooltip()},CM.Backup.UpdateMenu=Game.UpdateMenu,Game.UpdateMenu=function(){void 0!==jscolor.picker&&void 0!==jscolor.picker.owner||(CM.Backup.UpdateMenu(),CM.Disp.AddMenu())},CM.Backup.sayTime=Game.sayTime,CM.Disp.sayTime=function(e,i){return Number.isNaN(e)||e<=0?CM.Backup.sayTime(e,i):CM.Disp.FormatTime(e/Game.fps,1)},CM.Backup.Logic=Game.Logic,CM.Backup.LogicMod=new Function(`return ${Game.Logic.toString().split("document.title").join("CM.Disp.Title").split("' more cookies</b> for the next level.<br>';").join("` more cookies</b> for the next level.<br>${CM.Options.TooltipAscendButton ? `<div class='line'></div>It takes ${CM.Cache.TimeTillNextPrestige} to reach the next level and you are making ${Beautify(CM.Cache.HCPerSecond, 2)} chips on average in the last 5 seconds.<br>` : ``}`;")}`)(),Game.Logic=function(){CM.Backup.LogicMod(),CM.Disp.UpdateTitle()}},CM.Main.ReplaceNativeGrimoire=function(){CM.Main.ReplaceNativeGrimoireLaunch(Line truncated
Vendored
+1
View File
@@ -0,0 +1 @@
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 ObjecLine truncated
+2307 -7
View File
File diff suppressed because it is too large. Load diff
+31 -25
View File
@@ -1,29 +1,32 @@
{ {
"name": "cookiemonster-mod", "name": "cookiemonster-mod",
"version": "2.031.4", "version": "2.031.4",
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which 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 everything is an option.", "description": "Cookie Monster is an add-on that you can load into Cookie Clicker which 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 everything is an option.",
"main": "CookieMonster.js", "main": "CookieMonster.js",
"keywords": [ "keywords": [
"Cookie Clicker", "Cookie Clicker",
"javascript", "javascript",
"mod", "mod",
"Dashnet", "Dashnet",
"Orteil" "Orteil"
], ],
"scripts": { "scripts": {
"build": "npx eslint src && terser ./src/Header.js ./src/Cache.js ./src/Config.js ./src/Data.js ./src/Disp.js ./src/Main.js ./src/Sim.js ./src/Footer.js -o CookieMonster.js", "check_lint": "eslint src",
"build-test": "terser ./src/Header.js ./src/Cache.js ./src/Config.js ./src/Data.js ./src/Disp.js ./src/Main.js ./src/Sim.js ./src/Footer.js -o CookieMonster.js" "combine": "terser ./dist/Header.js ./dist/Cache.js ./dist/Config.js ./dist/Data.js ./dist/Disp.js ./dist/Main.js ./dist/Sim.js ./dist/Footer.js -o CookieMonster.js",
}, "build": "run-s check_lint pack combine",
"repository": { "build-test": "run-s pack combine",
"pack": "webpack"
},
"repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/Aktanusa/CookieMonster.git" "url": "git+https://github.com/Aktanusa/CookieMonster.git"
}, },
"license": "MIT", "license": "MIT",
"author": { "author": {
"name": "Aktanusa", "name": "Aktanusa",
"email": "chanam.geo@yahoo.com" "email": "chanam.geo@yahoo.com"
}, },
"contributors": [ "contributors": [
{ {
"name": "Daniël van Noord", "name": "Daniël van Noord",
"email": "13665637+DanielNoord@users.noreply.github.com" "email": "13665637+DanielNoord@users.noreply.github.com"
@@ -33,22 +36,25 @@
"email": "hyoretsu@gmail.com", "email": "hyoretsu@gmail.com",
"url": "https://www.linkedin.com/in/aranleite" "url": "https://www.linkedin.com/in/aranleite"
} }
], ],
"bugs": { "bugs": {
"url": "https://github.com/Aktanusa/CookieMonster/issues" "url": "https://github.com/Aktanusa/CookieMonster/issues"
}, },
"homepage": "https://github.com/Aktanusa/CookieMonster#readme", "homepage": "https://github.com/Aktanusa/CookieMonster#readme",
"devDependencies": { "devDependencies": {
"eslint": "^7.19.0", "eslint": "^7.19.0",
"eslint-config-airbnb-base": "^14.2.1", "eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1", "eslint-plugin-import": "^2.22.1",
"terser": "^5.6.0-beta" "npm-run-all": "^4.1.5",
}, "terser": "^5.6.0-beta",
"ccrepo": { "webpack": "^5.24.4",
"webpack-cli": "^4.5.0"
},
"ccrepo": {
"icon": [ "icon": [
10, 10,
0 0
], ],
"name": "Cookie Monster" "name": "Cookie Monster"
} }
} }
View File
File renamed without changes.
File renamed without changes.
+23 -145
View File
@@ -1,107 +1,32 @@
/** import {
* Data * Fortunes, HalloCookies, ChristCookies, ValCookies, PlantDrops, Effects,
*/ } from './src/Gamedata';
import { ModDescription, LatestReleaseNotes } from './src/Moddata';
import { metric, shortScale, shortScaleAbbreviated } from './src/Scales';
import { ConfigGroups, ConfigGroupsNotification } from './src/Sectionheader';
/** const Data = {
* Section: Data used in the stats page to show not yet purchased updates. See CM.Disp.CreateStatsMissDisp() */ Fortunes: Fortunes,
HalloCookies: HalloCookies,
ChristCookies: ChristCookies,
ValCookies: ValCookies,
PlantDrops: PlantDrops,
Effects: Effects,
CM.Data.Fortunes = [ ModDescription: ModDescription,
'Fortune #001', LatestReleaseNotes: LatestReleaseNotes,
'Fortune #002',
'Fortune #003',
'Fortune #004',
'Fortune #005',
'Fortune #006',
'Fortune #007',
'Fortune #008',
'Fortune #009',
'Fortune #010',
'Fortune #011',
'Fortune #012',
'Fortune #013',
'Fortune #014',
'Fortune #015',
'Fortune #016',
'Fortune #017',
'Fortune #018',
'Fortune #100',
'Fortune #101',
'Fortune #102',
'Fortune #103',
'Fortune #104',
];
CM.Data.HalloCookies = ['Skull cookies', 'Ghost cookies', 'Bat cookies', 'Slime cookies', 'Pumpkin cookies', 'Eyeball cookies', 'Spider cookies'];
CM.Data.ChristCookies = ['Christmas tree biscuits', 'Snowflake biscuits', 'Snowman biscuits', 'Holly biscuits', 'Candy cane biscuits', 'Bell biscuits', 'Present biscuits'];
CM.Data.ValCookies = ['Pure heart biscuits', 'Ardent heart biscuits', 'Sour heart biscuits', 'Weeping heart biscuits', 'Golden heart biscuits', 'Eternal heart biscuits', 'Prism heart biscuits'];
CM.Data.PlantDrops = ['Elderwort biscuits', 'Bakeberry cookies', 'Duketater cookies', 'Green yeast digestives', 'Wheat slims', 'Fern tea', 'Ichor syrup'];
/** metric: metric,
* Section: All possible effects plants and other items can have with an explanation */ shortScale: shortScale,
shortScaleAbbreviated: shortScaleAbbreviated,
CM.Data.Effects = { ConfigGroups: ConfigGroups,
buildingCost: 'Building prices', ConfigGroupsNotification: ConfigGroupsNotification,
click: 'Cookies per click',
cps: 'Total CPS', Config: {},
cursorCps: 'Cursor CPS',
goldenCookieDur: 'Golden cookie duration',
goldenCookieEffDur: 'Golden cookie effect duration',
goldenCookieFreq: 'Golden cookie frequency',
goldenCookieGain: 'Golden cookie gains',
grandmaCps: 'Grandma CPS',
itemDrops: 'Random item drop chance',
milk: 'Effect from milk',
reindeerDur: 'Reindeer duration',
reindeerFreq: 'Reindeer frequency',
reindeerGain: 'Reindeer gains',
upgradeCost: 'Upgrade prices',
wrathCookieDur: 'Wrath cookie duration',
wrathCookieEffDur: 'Wrath cookie effect duration',
wrathCookieFreq: 'Wrath cookie frequency',
wrathCookieGain: 'Wrath cookie gains',
wrinklerEat: 'Wrinkler ',
wrinklerSpawn: 'Wrinkler spawn frequency',
}; };
/** CM.Data = Data;
* Section: Data for the various scales used by CookieMonster */
CM.Data.metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
CM.Data.shortScale = ['', '', 'M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec', 'Quattuordec', 'Quindec', 'Sexdec', 'Septendec', 'Octodec', 'Novemdec', 'Vigint', 'Unvigint', 'Duovigint', 'Trevigint', 'Quattuorvigint'];
CM.Data.shortScaleAbbreviated = ['', 'K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp', 'Oc', 'No', 'De',
'UDe', 'DDe', 'TDe', 'QaDe', 'QiDe', 'SxDe', 'SpDe', 'ODe', 'NDe', 'Vi',
'UVi', 'DVi', 'TVi', 'QaVi', 'QiVi', 'SxVi', 'SpVi', 'OVi', 'NVi', 'Tr',
'UTr', 'DTr', 'TTr', 'QaTr', 'QiTr', 'SxTr', 'SpTr', 'OTr', 'NTr', 'Qaa',
'UQa', 'DQa', 'TQa', 'QaQa', 'QiQa', 'SxQa', 'SpQa', 'OQa', 'NQa', 'Qia',
'UQi', 'DQi', 'TQi', 'QaQi', 'QiQi', 'SxQi', 'SpQi', 'OQi', 'NQi', 'Sxa',
'USx', 'DSx', 'TSx', 'QaSx', 'QiSx', 'SxSx', 'SpSx', 'OSx', 'NSx', 'Spa',
'USp', 'DSp', 'TSp', 'QaSp', 'QiSp', 'SxSp', 'SpSp', 'OSp', 'NSp', 'Oco',
'UOc', 'DOc', 'TOc', 'QaOc', 'QiOc', 'SxOc', 'SpOc', 'OOc', 'NOc', 'Noa',
'UNo', 'DNo', 'TNo', 'QaNo', 'QiNo', 'SxNo', 'SpNo', 'ONo', 'NNo', 'Ct',
'UCt'];
/**
* Section: Two array's containing all Config groups and their to-be displayed title */
CM.Data.ConfigGroups = {
BarsColors: 'Bars/Colors',
Calculation: 'Calculation',
Notification: 'Notification',
Tooltip: 'Tooltips and additional insights',
Statistics: 'Statistics',
Notation: 'Notation',
Miscellaneous: 'Miscellaneous',
};
CM.Data.ConfigGroupsNotification = {
NotificationGeneral: 'General Notifications',
NotificationGC: 'Golden Cookie',
NotificationFC: 'Fortune Cookie',
NotificationSea: 'Season Special',
NotificationGard: 'Garden Tick',
NotificationMagi: 'Full Magic Bar',
NotificationWrink: 'Wrinkler',
NotificationWrinkMax: 'Maximum Wrinklers',
};
/** /**
* Section: An array (CM.Data.Config) containing all Config options and an array of default settings */ * Section: An array (CM.Data.Config) containing all Config options and an array of default settings */
@@ -523,50 +448,3 @@ CM.Data.ConfigDefault = {
BarsColors: 1, Calculation: 1, Notification: 1, NotificationGeneral: 1, NotificationGC: 1, NotificationFC: 1, NotificationSea: 1, NotificationGard: 1, NotificationMagi: 1, NotificationWrink: 1, NotificationWrinkMax: 1, Tooltip: 1, Statistics: 1, Notation: 1, Miscellaneous: 1, Lucky: 1, Chain: 1, Spells: 1, Garden: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1, InfoTab: 1, BarsColors: 1, Calculation: 1, Notification: 1, NotificationGeneral: 1, NotificationGC: 1, NotificationFC: 1, NotificationSea: 1, NotificationGard: 1, NotificationMagi: 1, NotificationWrink: 1, NotificationWrinkMax: 1, Tooltip: 1, Statistics: 1, Notation: 1, Miscellaneous: 1, Lucky: 1, Chain: 1, Spells: 1, Garden: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1, InfoTab: 1,
}, },
}; };
/**
* These variables are used to describe Cookie Monster in the info tab
* It is used by CM.Disp.AddMenuInfo()
*/
CM.Data.ModDescription = `<div class="listing">
<a href="https://github.com/Aktanusa/CookieMonster" target="blank">Cookie Monster</a>
offers a wide range of tools and statistics to enhance your game experience.
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.</br>
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
Please also report any bugs you may find over there!</br>
</div>
`;
CM.Data.LatestReleaseNotes = `<div class="listing">
<b>The latest update (v 2.031.4) has introduced the following features:</b></br>
- Added a changelog to the info tab and notification indicating a new version</br>
- Warnings in tooltips are now based on the income after buying the upgrade</br>
- A new warning and stat for Conjure Baked Goods in combination with Frenzy has been added</br>
- User can now set a custom tooltip warning ("x times cps") in the settings</br>
- Garden plots with plants that give cookies on harvest now display a tooltip with current and maximum reward</br>
- The Harvest All button in the Garden now has a tooltip displaying the current reward </br>
- The Ascend button can now display additional info (this can be turned off in the settings) </br>
- The statistics page now displays the Heavenly Chips per second</br>
- The statistics page now displays the CPS needed for the next level in Chain Cookies</br>
- The statistics page now displays the cookies needed for optimal rewards for garden plants</br>
- You can now set a Heavenly Chips target in the settings which will be counted down to in the statistics page</br>
- The color picker in the settings has been updated to its latest version</br>
- The overlay of seconds/percentage of timers is now toggle able and more readable</br>
- You can now toggle to disable bulk-buying from buying less than the selected amount (i.e., buying 7 of a building by pressing the buy 10 when you don't have enough for 10)</br>
- CookieMonster now uses the Modding API provided by the base game</br>
- There is a new option that allows the decoupling of the base game volume setting and the volumes of sounds created by the mod</br>
- The tab title now displays a "!" if a Golden Cookie or Reindeer can spawn</br>
- PP calculation can now be set to: 1) Exclude the 1st, 2nd or 3rd most optimal building (if you never want to buy that it), 2) Always consider optimal buildings that cost below "xx seconds of CPS" (toggleable in the settings), 3) Ignore any building or upgrade that is not purchasable at the moment</br>
</br>
<b>This update fixes the following bugs:</b></br>
- Minigames with enhanced tooltips will now also show these if the minigames were not loaded when CookieMonster was loaded</br>
- Sound, Flashes and Notifications will no longer play when the mod is initializing</br>
- The color picker should now update its display consistently</br>
- Fixed some typo's</br>
- Fixed a game breaking bug when the player had not purchased any upgrades</br>
- Fixed a number of console errors thrown by CM</br>
- Fixed the integration with mods that provide additional content, they should now no longer break CookieMonster</br>
- The Timer bar will now disappear correctly when the Golden Switch has been activated</br>
- Fixed errors in the calculation of the Chain Cookies and Wrinkler stats</br>
- Fixed buy warnings showing incorrectly</br>
</div>
`;
+94
View File
@@ -0,0 +1,94 @@
/** Data copied directly from the game */
/** Array of the names of all fortune cookies obtainable from the ticker */
export const Fortunes = [
'Fortune #001',
'Fortune #002',
'Fortune #003',
'Fortune #004',
'Fortune #005',
'Fortune #006',
'Fortune #007',
'Fortune #008',
'Fortune #009',
'Fortune #010',
'Fortune #011',
'Fortune #012',
'Fortune #013',
'Fortune #014',
'Fortune #015',
'Fortune #016',
'Fortune #017',
'Fortune #018',
'Fortune #100',
'Fortune #101',
'Fortune #102',
'Fortune #103',
'Fortune #104',
];
/** Array of the names of all Halloween cookies */
export const HalloCookies = [
'Skull cookies',
'Ghost cookies',
'Bat cookies',
'Slime cookies',
'Pumpkin cookies',
'Eyeball cookies',
'Spider cookies',
];
/** Array of the names of all Christmas cookies */
export const ChristCookies = ['Christmas tree biscuits',
'Snowflake biscuits',
'Snowman biscuits',
'Holly biscuits',
'Candy cane biscuits',
'Bell biscuits',
'Present biscuits',
];
/** Array of the names of all Valentine cookies */
export const ValCookies = ['Pure heart biscuits',
'Ardent heart biscuits',
'Sour heart biscuits',
'Weeping heart biscuits',
'Golden heart biscuits',
'Eternal heart biscuits',
'Prism heart biscuits',
];
/** Array of the names of all plant drops */
export const PlantDrops = ['Elderwort biscuits',
'Bakeberry cookies',
'Duketater cookies',
'Green yeast digestives',
'Wheat slims',
'Fern tea',
'Ichor syrup',
];
/** All possible effects plants and other items can have with a display-title */
export const Effects = {
buildingCost: 'Building prices',
click: 'Cookies per click',
cps: 'Total CPS',
cursorCps: 'Cursor CPS',
goldenCookieDur: 'Golden cookie duration',
goldenCookieEffDur: 'Golden cookie effect duration',
goldenCookieFreq: 'Golden cookie frequency',
goldenCookieGain: 'Golden cookie gains',
grandmaCps: 'Grandma CPS',
itemDrops: 'Random item drop chance',
milk: 'Effect from milk',
reindeerDur: 'Reindeer duration',
reindeerFreq: 'Reindeer frequency',
reindeerGain: 'Reindeer gains',
upgradeCost: 'Upgrade prices',
wrathCookieDur: 'Wrath cookie duration',
wrathCookieEffDur: 'Wrath cookie effect duration',
wrathCookieFreq: 'Wrath cookie frequency',
wrathCookieGain: 'Wrath cookie gains',
wrinklerEat: 'Wrinkler ',
wrinklerSpawn: 'Wrinkler spawn frequency',
};
+47
View File
@@ -0,0 +1,47 @@
/** Data related directly to Cookie Monster */
/** Information about Cookie Monster to be displayed in the info section */
export const ModDescription = `<div class="listing">
<a href="https://github.com/Aktanusa/CookieMonster" target="blank">Cookie Monster</a>
offers a wide range of tools and statistics to enhance your game experience.
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.</br>
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
Please also report any bugs you may find over there!</br>
</div>
`;
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
export const LatestReleaseNotes = `<div class="listing">
<b>The latest update (v 2.031.4) has introduced the following features:</b></br>
- Added a changelog to the info tab and notification indicating a new version</br>
- Warnings in tooltips are now based on the income after buying the upgrade</br>
- A new warning and stat for Conjure Baked Goods in combination with Frenzy has been added</br>
- User can now set a custom tooltip warning ("x times cps") in the settings</br>
- Garden plots with plants that give cookies on harvest now display a tooltip with current and maximum reward</br>
- The Harvest All button in the Garden now has a tooltip displaying the current reward </br>
- The Ascend button can now display additional info (this can be turned off in the settings) </br>
- The statistics page now displays the Heavenly Chips per second</br>
- The statistics page now displays the CPS needed for the next level in Chain Cookies</br>
- The statistics page now displays the cookies needed for optimal rewards for garden plants</br>
- You can now set a Heavenly Chips target in the settings which will be counted down to in the statistics page</br>
- The color picker in the settings has been updated to its latest version</br>
- The overlay of seconds/percentage of timers is now toggle able and more readable</br>
- You can now toggle to disable bulk-buying from buying less than the selected amount (i.e., buying 7 of a building by pressing the buy 10 when you don't have enough for 10)</br>
- CookieMonster now uses the Modding API provided by the base game</br>
- There is a new option that allows the decoupling of the base game volume setting and the volumes of sounds created by the mod</br>
- The tab title now displays a "!" if a Golden Cookie or Reindeer can spawn</br>
- PP calculation can now be set to: 1) Exclude the 1st, 2nd or 3rd most optimal building (if you never want to buy that it), 2) Always consider optimal buildings that cost below "xx seconds of CPS" (toggleable in the settings), 3) Ignore any building or upgrade that is not purchasable at the moment</br>
</br>
<b>This update fixes the following bugs:</b></br>
- Minigames with enhanced tooltips will now also show these if the minigames were not loaded when CookieMonster was loaded</br>
- Sound, Flashes and Notifications will no longer play when the mod is initializing</br>
- The color picker should now update its display consistently</br>
- Fixed some typo's</br>
- Fixed a game breaking bug when the player had not purchased any upgrades</br>
- Fixed a number of console errors thrown by CM</br>
- Fixed the integration with mods that provide additional content, they should now no longer break CookieMonster</br>
- The Timer bar will now disappear correctly when the Golden Switch has been activated</br>
- Fixed errors in the calculation of the Chain Cookies and Wrinkler stats</br>
- Fixed buy warnings showing incorrectly</br>
</div>
`;
+148
View File
@@ -0,0 +1,148 @@
/** Data related directly to the scales used by Cookie Monster */
/** Array of abbreviations used in the "Metric" scale */
export const metric = ['',
'',
'M',
'G',
'T',
'P',
'E',
'Z',
'Y',
];
/** Array of abbreviations used in the "Short" scale */
export const shortScale = ['',
'',
'M',
'B',
'Tr',
'Quadr',
'Quint',
'Sext',
'Sept',
'Oct',
'Non',
'Dec',
'Undec',
'Duodec',
'Tredec',
'Quattuordec',
'Quindec',
'Sexdec',
'Septendec',
'Octodec',
'Novemdec',
'Vigint',
'Unvigint',
'Duovigint',
'Trevigint',
'Quattuorvigint',
];
/** Array of abbreviations used in the "Abbreviated Short" scale */
export const shortScaleAbbreviated = ['',
'K',
'M',
'B',
'T',
'Qa',
'Qi',
'Sx',
'Sp',
'Oc',
'No',
'De',
'UDe',
'DDe',
'TDe',
'QaDe',
'QiDe',
'SxDe',
'SpDe',
'ODe',
'NDe',
'Vi',
'UVi',
'DVi',
'TVi',
'QaVi',
'QiVi',
'SxVi',
'SpVi',
'OVi',
'NVi',
'Tr',
'UTr',
'DTr',
'TTr',
'QaTr',
'QiTr',
'SxTr',
'SpTr',
'OTr',
'NTr',
'Qaa',
'UQa',
'DQa',
'TQa',
'QaQa',
'QiQa',
'SxQa',
'SpQa',
'OQa',
'NQa',
'Qia',
'UQi',
'DQi',
'TQi',
'QaQi',
'QiQi',
'SxQi',
'SpQi',
'OQi',
'NQi',
'Sxa',
'USx',
'DSx',
'TSx',
'QaSx',
'QiSx',
'SxSx',
'SpSx',
'OSx',
'NSx',
'Spa',
'USp',
'DSp',
'TSp',
'QaSp',
'QiSp',
'SxSp',
'SpSp',
'OSp',
'NSp',
'Oco',
'UOc',
'DOc',
'TOc',
'QaOc',
'QiOc',
'SxOc',
'SpOc',
'OOc',
'NOc',
'Noa',
'UNo',
'DNo',
'TNo',
'QaNo',
'QiNo',
'SxNo',
'SpNo',
'ONo',
'NNo',
'Ct',
'UCt',
];
+24
View File
@@ -0,0 +1,24 @@
/** Data related to the display titles of certain sections in menu screens */
/** Display titles of the headers of the Cookie Monster settings section */
export const ConfigGroups = {
BarsColors: 'Bars/Colors',
Calculation: 'Calculation',
Notification: 'Notification',
Tooltip: 'Tooltips and additional insights',
Statistics: 'Statistics',
Notation: 'Notation',
Miscellaneous: 'Miscellaneous',
};
/** Display titles of the headers of the notification section of the Cookie Monster settings */
export const ConfigGroupsNotification = {
NotificationGeneral: 'General Notifications',
NotificationGC: 'Golden Cookie',
NotificationFC: 'Fortune Cookie',
NotificationSea: 'Season Special',
NotificationGard: 'Garden Tick',
NotificationMagi: 'Full Magic Bar',
NotificationWrink: 'Wrinkler',
NotificationWrinkMax: 'Maximum Wrinklers',
};
+7 -39
View File
@@ -1,6 +1,10 @@
/** import FormatTime from './src/Beautify';
* Disp *
*/ const Disp = {
FormatTime: FormatTime,
};
CM.Disp = Disp;
/** /**
* Please make sure to annotate your code correctly using JSDoc. * Please make sure to annotate your code correctly using JSDoc.
@@ -94,42 +98,6 @@ CM.Disp.GetLumpColor = function (type) {
} }
}; };
/**
* Section: General functions to format or beautify strings */
/**
* This function returns time as a string depending on TimeFormat setting
* @param {number} time Time to be formatted
* @param {number} longFormat 1 or 0
* @returns {string} Formatted time
*/
CM.Disp.FormatTime = function (time, longFormat) {
if (time === Infinity) return time;
time = Math.ceil(time);
const y = Math.floor(time / 31557600);
const d = Math.floor(time % 31557600 / 86400);
const h = Math.floor(time % 86400 / 3600);
const m = Math.floor(time % 3600 / 60);
const s = Math.floor(time % 60);
let str = '';
if (CM.Options.TimeFormat) {
if (time > 3155760000) return 'XX:XX:XX:XX:XX';
str += `${(y < 10 ? '0' : '') + y}:`;
str += `${(d < 10 ? '0' : '') + d}:`;
str += `${(h < 10 ? '0' : '') + h}:`;
str += `${(m < 10 ? '0' : '') + m}:`;
str += (s < 10 ? '0' : '') + s;
} else {
if (time > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
str += (y > 0 ? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` : '');
str += (d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : '');
if (str.length > 0 || h > 0) str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
if (str.length > 0 || m > 0) str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
}
return str;
};
/** /**
* This function returns the color to be used for time-strings * This function returns the color to be used for time-strings
* @param {number} time Time to be coloured * @param {number} time Time to be coloured
+34
View File
@@ -0,0 +1,34 @@
/** General functions to format or beautify strings */
/**
* This function returns time as a string depending on TimeFormat setting
* @param {number} time Time to be formatted
* @param {number} longFormat 1 or 0
* @returns {string} Formatted time
*/
export default function FormatTime(time, longFormat) {
if (time === Infinity) return time;
time = Math.ceil(time);
const y = Math.floor(time / 31557600);
const d = Math.floor(time % 31557600 / 86400);
const h = Math.floor(time % 86400 / 3600);
const m = Math.floor(time % 3600 / 60);
const s = Math.floor(time % 60);
let str = '';
if (CM.Options.TimeFormat) {
if (time > 3155760000) return 'XX:XX:XX:XX:XX';
str += `${(y < 10 ? '0' : '') + y}:`;
str += `${(d < 10 ? '0' : '') + d}:`;
str += `${(h < 10 ? '0' : '') + h}:`;
str += `${(m < 10 ? '0' : '') + m}:`;
str += (s < 10 ? '0' : '') + s;
} else {
if (time > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
str += (y > 0 ? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` : '');
str += (d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : '');
if (str.length > 0 || h > 0) str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
if (str.length > 0 || m > 0) str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
}
return str;
}
File renamed without changes.
+1 -1
View File
@@ -3,7 +3,7 @@
* Header * * Header *
*/ */
const CM = { CM = {
Backup: {}, Backup: {},
Cache: {}, Cache: {},
Config: {}, Config: {},
View File
File renamed without changes.
View File
File renamed without changes.
+23
View File
@@ -0,0 +1,23 @@
/** We know this is not how Webpack should be used, but we are slowly transferring our code.
* For now this is how at least start to create a structure that allows us to transfer towards
* more modular code. Any help is highly appreciated.
*/
const path = require('path');
module.exports = {
mode: 'production',
entry: {
cache: { import: './src/Cache/Cache.js', filename: './Cache.js' },
config: { import: './src/Config/Config.js', filename: './Config.js' },
data: { import: './src/Data/Data.js', filename: './Data.js' },
disp: { import: './src/Disp/Disp.js', filename: './Disp.js' },
footer: { import: './src/Footer/Footer.js', filename: './Footer.js' },
header: { import: './src/Header/Header.js', filename: './Header.js' },
main: { import: './src/Main/Main.js', filename: './Main.js' },
sim: { import: './src/Sim/Sim.js', filename: './Sim.js' },
},
output: {
filename: 'Data.js',
path: path.resolve(__dirname, 'dist'),
},
};