Compare commits

...

232 Commits

Author SHA1 Message Date
Daniël van Noord
f3617d5fc2 Merge pull request #605 from Aktanusa/dev (v 2.031.4)
Version 2.031.4
2021-02-24 00:26:25 +01:00
Daniël van Noord
71f16eb6e1 Merge branch 'master' into dev 2021-02-24 00:25:39 +01:00
Daniël van Noord
4cf847376f Merge pull request #604 from DanielNoord/feature/changelog
Final update for 2.031.4
2021-02-24 00:22:28 +01:00
Daniël van Noord
ab3a4b37bc Updated ESLint action 2021-02-24 00:21:44 +01:00
Daniël van Noord
fcd5588a03 Added changelog 2021-02-24 00:18:38 +01:00
Daniël van Noord
08faf9f198 Made prelimenary switch to airbnb-base 2021-02-24 00:14:14 +01:00
Daniël van Noord
3ad492c23f Merge pull request #603 from DanielNoord/feature/changelog
Feature/changelog
2021-02-23 22:17:57 +01:00
Daniël van Noord
081a8317f9 Fix edifice warning showing when not relevant #600 2021-02-23 22:11:33 +01:00
Daniël van Noord
ab4012b5ad Added requirements for garden to stats page #602 2021-02-23 22:08:26 +01:00
Daniël van Noord
4a552352c8 Added pop-up notifying of new version 2021-02-23 21:51:13 +01:00
Daniël van Noord
19903378f2 Added a changelog to the info tab #473 2021-02-23 21:12:16 +01:00
Daniël van Noord
ef05396841 Merge pull request #601 from DanielNoord/feature/chainstats
Feature/chainstats
2021-02-23 09:02:19 +01:00
Daniël van Noord
9281ec7e8c Show req. CPS for next Chain level in stats #29 2021-02-23 08:59:51 +01:00
Daniël van Noord
2fcb7c0f66 FIxed #580 and started at #29 2021-02-23 00:35:06 +01:00
Daniël van Noord
e6596713b9 Fix small bug in Wrinkler stats 2021-02-22 22:53:45 +01:00
Daniël van Noord
a1c1209386 Merge pull request #598 from DanielNoord/fix/smallfixes
Small fixes and new functions
2021-02-21 23:39:25 +01:00
Daniël van Noord
e0c7643671 Allow user-customizable tooltip warnings #105 2021-02-21 23:37:15 +01:00
Daniël van Noord
b854773766 Fixed TimerBar not disappearing with 0 timers #588 2021-02-21 23:12:15 +01:00
Daniël van Noord
e139f9d500 Changed default setting of ColorPPBulkMode 2021-02-21 20:17:18 +01:00
Daniël van Noord
6d60ffb139 Merge pull request #594 from DanielNoord/feature/pp
Feature/pp
2021-02-21 17:37:28 +01:00
Daniël van Noord
ad61e8cf09 Allow PP to ignore non-buyable buildings #148 2021-02-21 17:32:37 +01:00
Daniël van Noord
5dffa1c2ac Allow ignoring 1, 2 or 3 best build with PP #155 2021-02-21 16:50:57 +01:00
Daniël van Noord
69f972fac2 Allow pp based on "less than x secs of CPS" #149 2021-02-21 16:21:43 +01:00
Daniël van Noord
9ead87dd16 Merge pull request #592 from DanielNoord/fix/sim
Fixes to Sim.js and content mod acceptance #560
2021-02-21 10:44:42 +01:00
Daniël van Noord
e2d5c7e6e2 Check for new mods and update functions #560 2021-02-21 10:40:52 +01:00
Daniël van Noord
e4e364ade3 Fixes to Sim.js and content mod acceptance #560 2021-02-21 10:30:55 +01:00
Daniël van Noord
6ca617381a Merge pull request #590 from DanielNoord/feature/heavenly
Number of functions related to Stats page and registration to CCRepo
2021-02-21 00:17:45 +01:00
Daniël van Noord
69a151a25a Fixed rounding issues with HC per second 2021-02-21 00:15:27 +01:00
Daniël van Noord
fdc94dd2db Make Missed GC stat toggable #434 2021-02-21 00:06:03 +01:00
Daniël van Noord
c02d2c10d1 Allow target Heavenly Chips in stats #269 2021-02-21 00:00:51 +01:00
Daniël van Noord
963116ba2f Added HC per second to stats and tooltip #169 2021-02-20 23:25:52 +01:00
Daniël van Noord
f1183801a8 Change package name to avoid conflict 2021-02-20 20:41:25 +01:00
Daniël van Noord
db19976e3e Small visual changes to stats page 2021-02-20 20:20:53 +01:00
Daniël van Noord
894f4359cd Added info for CCRepo 2021-02-20 20:20:10 +01:00
Daniël van Noord
8cb3c43188 Merge pull request #586 from DanielNoord/fix/todo
Fix/todo
2021-02-20 17:20:15 +01:00
Daniël van Noord
88d7b11b87 Fixed fatal error in CM.Disp.UpdateAscendState 2021-02-20 17:17:41 +01:00
Daniël van Noord
af5a44eb9a Added 'time left' to ascend tooltip #80 2021-02-20 17:13:50 +01:00
Daniël van Noord
fd77e84a90 Removed old code 2021-02-20 16:15:03 +01:00
Daniël van Noord
43fb9112a7 Replaced var with let 2021-02-20 16:12:16 +01:00
Daniël van Noord
f3ceec3c91 Removed nearly all TODO's #485 2021-02-20 16:10:25 +01:00
Daniël van Noord
b3c2eaeb3e Merge pull request #585 from DanielNoord/feature/title
Show in title if GC/Reindeer can spawn #73
2021-02-20 13:56:46 +01:00
Daniël van Noord
717f106468 Show in title if GC/Reindeer can spawn #73 2021-02-20 13:55:26 +01:00
Daniël van Noord
50911eb01a Merge pull request #583 from DanielNoord/annotate/sim 2021-02-20 13:37:34 +01:00
Daniël van Noord
12657df5cf Big update to structure and annotation #557 2021-02-20 13:35:31 +01:00
Daniël van Noord
bef40336a5 Merged actions into one file 2021-02-19 21:35:01 +01:00
Daniël van Noord
d9c2f3f432 Merge pull request #581 from DanielNoord/annotate/main
Annotate/main
2021-02-19 21:18:28 +01:00
Daniël van Noord
59f8808b61 Finished annotation of Main.js #556 2021-02-19 21:16:36 +01:00
Daniël van Noord
d3aa2c30db Small naming fixes 2021-02-19 20:59:29 +01:00
Daniël van Noord
1e92ff6b92 Merge pull request #579 from DanielNoord/annotate
Updated Cache.js
2021-02-19 00:00:12 +01:00
Daniël van Noord
ebbb552100 Merge branch 'dev' 2021-02-18 23:57:27 +01:00
Daniël van Noord
67535eaa4c Annotated Cache.js and solved issues #555 2021-02-18 23:53:51 +01:00
Daniël van Noord
ca46c10c55 Fixes to chain cookies stats 2021-02-18 22:57:26 +01:00
Daniël van Noord
cfb7659c1f Merge pull request #577 from DanielNoord/hotfix/dev
Fix missing upgrades display on dev branch
2021-02-18 21:34:07 +01:00
Daniël van Noord
1ebc8cacc6 Fix missing upgrades display on dev branch 2021-02-18 21:32:58 +01:00
Daniël van Noord
e9ced31639 Merge pull request #575 from DanielNoord/hotfix
Fix missing upgrades display #574
2021-02-18 21:30:43 +01:00
Daniël van Noord
c4c95eaa31 Fix missing upgrades display #574 2021-02-18 21:29:14 +01:00
Daniël van Noord
b7c47bbe6c Merge pull request #571 from DanielNoord/fix/missinupgrades
Fixed crash with no upgrades purchased #528
2021-02-17 22:49:26 +01:00
Daniël van Noord
f5ea276a63 Merge pull request #572 from DanielNoord/hotfix/missingupgrades
Fix crash with no upgrades #528
2021-02-17 22:47:08 +01:00
Daniël van Noord
9357e16dec Fix crash with no upgrades #528 2021-02-17 22:45:39 +01:00
Daniël van Noord
1aecb8a8e1 Fixed crash with no upgrades purchased #528 2021-02-17 22:42:21 +01:00
Daniël van Noord
eb99ba1b78 Changed all "==" to "===" 2021-02-16 23:47:44 +01:00
Daniël van Noord
6f67c171f4 Merge pull request #570 from DanielNoord/fix/sound
Fix/sound
2021-02-16 23:43:58 +01:00
Daniël van Noord
88b58f209f Allow decoupling of base game and mod volume #567 2021-02-16 23:41:22 +01:00
Daniël van Noord
25250e8c46 Fix sounds playing during mod initialization #558 2021-02-16 23:40:34 +01:00
Daniël van Noord
cfa32ef295 Merge pull request #565 from DanielNoord/hotfixmain
Fix #563
2021-02-11 23:09:31 +01:00
Daniël van Noord
1de5dd27dd Fix #563 2021-02-11 23:08:52 +01:00
Daniël van Noord
1c4e988e90 Merge pull request #564 from DanielNoord/hotfix
Fixed Title option not showing #563
2021-02-11 23:05:46 +01:00
Daniël van Noord
e3f58e2e73 Fixed Title option not showing #563 2021-02-11 23:04:36 +01:00
Daniël van Noord
e85a775468 Merge pull request #562 from DanielNoord/cache
Correctly build CookieMonster.js
2021-02-10 20:39:22 +01:00
Daniël van Noord
7af043bc55 Correctly build CookieMonster.js 2021-02-10 20:38:24 +01:00
Daniël van Noord
2b28cd64b1 Merge branch 'cache' into dev 2021-02-10 20:34:35 +01:00
Daniël van Noord
a24c666993 Resolved additional conflicts 2021-02-10 20:32:54 +01:00
Daniël van Noord
39b1ec6db4 Resolve conflicts 2021-02-10 20:30:50 +01:00
Daniël van Noord
11732b10aa Updated mail address of Aktanusa 2021-02-10 20:23:12 +01:00
DanielNoord
346bf2b353 Merge pull request #561 from Aktanusa/npm
Add NPM
2021-02-10 00:09:56 +01:00
Daniel van Noord
e2ad102bb4 Added final newline 2021-02-10 00:09:11 +01:00
Daniel van Noord
975650fad6 Make terser run from npx 2021-02-10 00:07:30 +01:00
Daniel van Noord
e864dee788 Update name of CheckMainFile action 2021-02-10 00:04:19 +01:00
Daniel van Noord
76718f8c74 Fix CheckMainFile action 2021-02-10 00:01:34 +01:00
Daniel van Noord
66e61614dd Updated README 2021-02-10 00:00:11 +01:00
Daniel van Noord
c061ed5b9e Updated actions 2021-02-09 23:51:13 +01:00
Daniel van Noord
4c009df819 Changed Header.js to use const 2021-02-09 23:51:03 +01:00
Daniel van Noord
d1336efb90 Added NPM and created Build script 2021-02-09 23:46:39 +01:00
Daniel van Noord
fec72bbf91 Changed variable names 2021-02-09 23:13:42 +01:00
DanielNoord
1cd430f814 Update README.md 2021-02-08 09:14:13 +01:00
Daniel van Noord
a025fe51d7 Small fixes here and there 2021-02-07 10:32:30 +01:00
Daniel van Noord
df8957338b Started annotating Cache.js 2021-02-07 10:32:23 +01:00
Daniel van Noord
4d0b5097fd Annotated Header.js 2021-02-06 23:25:05 +01:00
Daniel van Noord
8ceef4cf2d Updated Cache to use Objects1 2021-02-06 22:07:25 +01:00
Daniel van Noord
bc6e6eb110 Add Userscript variable to ESLint settings 2021-02-06 21:51:41 +01:00
DanielNoord
f3e84d0920 Merge pull request #552 from mason1920/dev
Make a Userscript and refer the README to It
2021-02-03 08:05:52 +01:00
DanielNoord
e9d7fc800f Rename cookie-monster.user.js to CookieMonster.user.js 2021-02-03 08:04:47 +01:00
DanielNoord
f6461642e9 Update README.md with instruction for userscript 2021-02-03 08:03:28 +01:00
mason1920
769f7f18dd Make a Userscript and Refer the README to It
Tested and works with Greasemonkey, Tampermonkey, and Violentmonkey.
2021-02-02 05:25:42 -05:00
DanielNoord
9e21fc8586 Merge pull request #551 from Aktanusa/DanielNoord-patch-2
Fixed some debugging left overs
2021-01-31 23:50:08 +01:00
DanielNoord
5f9b990854 Fixed some debugging left overs 2021-01-31 23:49:36 +01:00
DanielNoord
8724a2a334 Merge pull request #550 from Aktanusa/revert-519-dev
Revert "Added a feature to show mysterious achievements"
2021-01-31 23:46:25 +01:00
DanielNoord
a801e79790 Revert "Added a feature to show mysterious achievements" 2021-01-31 23:43:59 +01:00
DanielNoord
0cd64198ed Merge pull request #549 from DanielNoord/todos
Fixed number of TODOs
2021-01-31 21:43:20 +01:00
Daniel van Noord
60859a774e Test aciton 2021-01-31 21:36:44 +01:00
DanielNoord
cdff551384 Update CheckMainFile.yml 2021-01-31 21:36:23 +01:00
Daniel van Noord
a200763a6e Small check 2 2021-01-31 21:33:14 +01:00
Daniel van Noord
e5d8aabb66 Small action test 2021-01-31 21:32:27 +01:00
DanielNoord
e2afebe1c8 Update CheckMainFile.yml 2021-01-31 21:31:03 +01:00
DanielNoord
3e4b9a0dd3 Update CheckMainFile.yml 2021-01-31 21:15:22 +01:00
DanielNoord
fd02f172dc Update CheckMainFile.yml 2021-01-31 21:12:21 +01:00
DanielNoord
59061a5af0 Update CheckMainFile.yml 2021-01-31 21:08:40 +01:00
DanielNoord
5f35ccc76b Update CheckMainFile.yml 2021-01-31 21:00:56 +01:00
DanielNoord
7e1597dae2 Merge branch 'dev' into dev 2021-01-31 20:51:54 +01:00
DanielNoord
968353d3fa Update CheckMainFile.yml 2021-01-31 20:46:08 +01:00
DanielNoord
d29096bf72 Update CheckMainFile.yml 2021-01-31 20:41:31 +01:00
DanielNoord
9e696cafb1 Create CheckMainFile.yml 2021-01-31 20:37:44 +01:00
Daniel van Noord
545a1a3102 Fixed number of TODOs 2021-01-31 20:32:15 +01:00
DanielNoord
c602ea5f45 Merge pull request #544 from DanielNoord/modapi
Incorporate Modding API
2021-01-31 19:46:08 +01:00
Daniel van Noord
bbdbbfb667 Added Loop to hook of modding api #468 2021-01-31 19:44:00 +01:00
Daniel van Noord
d9e0e46e64 Added Loop to hook of modding api #468 2021-01-31 18:28:14 +01:00
DanielNoord
2608ff9149 Merge pull request #543 from DanielNoord/bulkbuy
Bulkbuy
2021-01-31 18:19:18 +01:00
Daniel van Noord
0e7880816e Implement blocking of Bulk buying #143 2021-01-31 18:15:42 +01:00
Daniel van Noord
4e238e800c Added BulkBuyBlock to settings 2021-01-31 17:37:02 +01:00
Daniel van Noord
8c6de64ac9 Spelling error in TimeFormat 2021-01-31 17:33:41 +01:00
DanielNoord
ca676c3b6a Final test ESLint successful 2021-01-31 14:12:46 +01:00
DanielNoord
425d640592 Final test ESLint Action 2021-01-31 14:11:17 +01:00
DanielNoord
9c61d62a8f Update README.md 2021-01-31 14:10:17 +01:00
DanielNoord
f4becd6a91 Create ESLint.yml 2021-01-31 14:08:07 +01:00
DanielNoord
d07964cfc5 Merge pull request #542 from DanielNoord/jshint
Jshint
2021-01-31 14:07:35 +01:00
Daniel van Noord
6519497ffc Fixed ESLint install 2021-01-31 13:55:47 +01:00
Daniel van Noord
4dd640ef4b Installed ESLint 2021-01-31 13:54:31 +01:00
Daniel van Noord
2d9af222c1 ESLint compliant 2021-01-31 13:33:34 +01:00
Daniel van Noord
416637bac3 Cache.js, Config.js & Data.js compy with JSHint 2021-01-30 16:12:09 +01:00
Daniel van Noord
f7de9831e5 Semicolons and easy fixes for all documents 2021-01-30 15:25:19 +01:00
Daniel van Noord
e4113d21e1 Semicolons and var declarations in Cache.js 2021-01-30 14:50:40 +01:00
DanielNoord
f4711c74da Merge pull request #541 from DanielNoord/timerdisplay
Timerdisplay
2021-01-30 13:57:46 +01:00
Daniel van Noord
33d0478ca9 Make overlays of timers toggleable #494 2021-01-30 13:57:15 +01:00
Daniel van Noord
ac457ed8dc Fixed TimerBarOverlay 2021-01-30 13:44:31 +01:00
Daniel van Noord
efcaccfb26 Added TimerBarOverlay option 2021-01-30 13:43:28 +01:00
DanielNoord
63a38e564c Merge pull request #540 from DanielNoord/jscolorfix
Fixed JSColor display not updating #539
2021-01-30 11:36:00 +01:00
Daniel van Noord
2491f7a7cc Fixed JSColor display not updating #539 2021-01-30 11:35:28 +01:00
DanielNoord
8deb0c435d Merge pull request #538 from Aktanusa/master
Master
2021-01-30 01:18:23 +01:00
DanielNoord
6ed19f23e6 Merge pull request #536 from Aktanusa/jscolor
Hot fix for jscolor
2021-01-30 01:17:33 +01:00
Daniel van Noord
13e1233e0f Hot fix for jscolor 2021-01-30 01:16:18 +01:00
DanielNoord
d3af77e2c8 Merge pull request #535 from Aktanusa/master (JSColor update)
Update dev with JSColor
2021-01-30 01:13:26 +01:00
DanielNoord
b628d20363 Merge pull request #533 from Aktanusa/jscolor
Update JSColor and integrate it
2021-01-30 01:12:15 +01:00
Daniel van Noord
63139933ce Clean up 2021-01-30 01:10:08 +01:00
Daniel van Noord
0547381845 Changed the settings for colours 2021-01-30 01:07:09 +01:00
Daniel van Noord
455e99e2ab Updated jscolor to 2.4.5 2021-01-29 20:53:04 +01:00
DanielNoord
b2ae7c71cf Merge pull request #532 from Aktanusa/revert-531-jscolor
Revert "Update JSColor to 2.4.5"
2021-01-29 18:46:03 +01:00
DanielNoord
eee663f414 Revert "Update JSColor to 2.4.5" 2021-01-29 18:45:53 +01:00
DanielNoord
3dd2e65092 Merge pull request #531 from DanielNoord/jscolor
Update JSColor to 2.4.5
2021-01-29 18:23:22 +01:00
Daniel van Noord
16ad8f78dc Update JSColor to 2.4.5 2021-01-29 18:22:57 +01:00
DanielNoord
ce5b7940e4 Merge pull request #529 from DanielNoord/fixsound
Notify's don't occur when loading the mod #495
2021-01-28 22:01:41 +01:00
Daniel van Noord
7b8e29e346 Notify's don't occur when loading the mod #495 2021-01-28 22:01:01 +01:00
PneuJai
5e5e8f5e22 set Missing Achievements OFF to the first label
the switch statements make the coding much more easy to understand dont they?
2021-01-28 13:36:50 +08:00
PneuJai
d228967fe7 set Missing Achievements OFF to the first label 2021-01-28 13:34:19 +08:00
DanielNoord
b3757c452a Merge pull request #527 from DanielNoord/harvestalltooltip
Tooltip for Harvest All button in Farm
2021-01-27 22:13:29 +01:00
Daniel van Noord
6c852e2c50 Tooltip for harvest all button #227 2021-01-27 22:12:37 +01:00
Daniel van Noord
5abdc77e30 Added data on possible effects 2021-01-27 21:43:24 +01:00
DanielNoord
5af7be93e3 Merge pull request #526 from DanielNoord/fix/gardentooltip
Make tooltips be replaced even when minigames were not loaded initially
2021-01-27 21:31:29 +01:00
Daniel van Noord
0171732e70 Made Grimoire tooltip always launch 2021-01-27 21:30:50 +01:00
Daniel van Noord
00c513798a Make Garden tooltip load on LoadMinigames 2021-01-27 21:20:22 +01:00
PneuJai
235900c826 rename labels of MissingAchievements 2021-01-27 15:12:17 +08:00
DanielNoord
abc7dce047 Delete .github/workflows directory 2021-01-27 00:05:42 +01:00
DanielNoord
61fc4aaaef Update main.yml 2021-01-27 00:00:29 +01:00
DanielNoord
4649ab87c6 Update main.yml 2021-01-26 23:58:53 +01:00
DanielNoord
7186be028b Update main.yml 2021-01-26 23:54:49 +01:00
DanielNoord
e6728157b3 Update main.yml 2021-01-26 23:52:25 +01:00
DanielNoord
843bb00f34 Update main.yml 2021-01-26 23:50:52 +01:00
DanielNoord
1a73fb8a2d Update main.yml 2021-01-26 23:50:02 +01:00
DanielNoord
1aa6d3797b Update main.yml 2021-01-26 23:48:51 +01:00
DanielNoord
31ea583edb Update main.yml 2021-01-26 23:47:49 +01:00
DanielNoord
b4cb0fee52 Update main.yml 2021-01-26 23:43:08 +01:00
DanielNoord
6dd4022a80 Update main.yml 2021-01-26 23:39:01 +01:00
DanielNoord
d30a064c69 Update main.yml 2021-01-26 23:38:03 +01:00
DanielNoord
cb91c91321 Update main.yml 2021-01-26 23:33:42 +01:00
DanielNoord
93e50181fe Update main.yml 2021-01-26 23:31:49 +01:00
DanielNoord
3b137aa882 Update main.yml 2021-01-26 23:30:01 +01:00
DanielNoord
1d51a36ccd Update main.yml 2021-01-26 23:28:24 +01:00
DanielNoord
30f6ecf8f2 Update main.yml 2021-01-26 23:23:05 +01:00
DanielNoord
1d639a9721 Update main.yml 2021-01-26 23:20:39 +01:00
DanielNoord
19260f9361 Merge pull request #525 from Aktanusa/action-1
Create main.yml
2021-01-26 23:18:42 +01:00
DanielNoord
94ba7487b1 Create main.yml 2021-01-26 23:17:59 +01:00
DanielNoord
cd3a9caab5 Merge pull request #524 from DanielNoord/gardentooltip
Gardentooltip
2021-01-26 22:32:24 +01:00
Daniel van Noord
45c3df2d4b Fixed plant tooltips 2021-01-26 22:30:27 +01:00
Daniel van Noord
80e3ac746a Fixed CM.Options.TooltipBuildUpgrade #523 2021-01-26 22:26:46 +01:00
Daniel van Noord
52cfd9ddc2 Renamed ToolWrink to TooltipWrink 2021-01-26 22:22:32 +01:00
Daniel van Noord
ffa664c476 Added option foor plot tooltip 2021-01-26 22:21:17 +01:00
Daniel van Noord
a9dfcaab75 Tooltip with curr/max reward for plants #183 2021-01-26 22:18:21 +01:00
PneuJai
91a2edf348 Fixed typos of ReplaceCrateTooltipAchievements 2021-01-26 23:27:31 +08:00
PneuJai
f450ae98ae Fixed the default value for MissingAchievements 2021-01-26 23:26:35 +08:00
PneuJai
cd90b15fa3 Adapt to new option MissingAchievements 2021-01-26 22:39:17 +08:00
PneuJai
8a3eac78d4 Merge MissingShadowAchievements and MissingAchievements 2021-01-26 22:35:00 +08:00
PneuJai
cdfb35aa1b rename ShowMysteriousAchievements to MissingAchievements
also moved to stats group
2021-01-26 22:23:06 +08:00
Daniel van Noord
23f19b4d62 Created (empty) tooltip for garden plots 2021-01-26 14:57:59 +01:00
Daniel van Noord
ab08bc60e7 Merge branch 'dev' of https://github.com/Aktanusa/CookieMonster into gardentooltip 2021-01-26 13:56:49 +01:00
DanielNoord
b48834e416 Merge pull request #522 from Aktanusa/master
Master
2021-01-26 13:56:26 +01:00
DanielNoord
2f12f9839a Merge pull request #520 from DanielNoord/hotfix
Fix tooltips
2021-01-26 13:55:43 +01:00
Daniel van Noord
c62b514f0a Fix tooltips 2021-01-26 13:55:14 +01:00
PneuJai
125113133a Added CM.Disp.ReplaceCrateTooltipAchievements() into init 2021-01-26 20:45:37 +08:00
PneuJai
e5bd08c0c4 Added CM.Disp.ReplaceCrateTooltipAchievements
CM.Disp.ReplaceCrateTooltipAchievements will backup and replace Game.crate and Game.crateTooltip and edit their outputs to show mysterious achievements
Also this will check for CM.Options.ShowMysteriousAchievements and CM.Options.ShowMysteriousShadowAchievements
2021-01-26 20:44:48 +08:00
PneuJai
abfeabf08f Added default values for those two options 2021-01-26 20:42:17 +08:00
PneuJai
d958fc08bf Added two options
They are options to show/hide mysterious achievements, and they dont need functions cuz CM.Disp.ReplaceCrateTooltipAchievements will check for them
2021-01-26 20:41:22 +08:00
Daniel van Noord
1372942705 Merge branch 'dev' of https://github.com/Aktanusa/CookieMonster into gardentooltip 2021-01-26 13:37:55 +01:00
DanielNoord
e64e41e523 Merge pull request #518 from Aktanusa/master
Push hot fix to dev-branch
2021-01-26 13:37:03 +01:00
DanielNoord
fda6e65176 Merge pull request #516 from DanielNoord/fixes
Fix building sorting #515
2021-01-26 13:35:53 +01:00
Daniel van Noord
7795aa79a5 Fix building sorting #515 2021-01-26 13:31:01 +01:00
DanielNoord
b6069e2358 Merge pull request #512 from Aktanusa/dev
Merge pull request #511 from Aktanusa/master
2021-01-25 23:43:36 +01:00
DanielNoord
a7af602aa3 Merge pull request #511 from Aktanusa/master
Merge dev and master
2021-01-25 23:43:10 +01:00
DanielNoord
f36dcf012a Merge pull request #509 from Aktanusa/dev
Publish hotfixes
2021-01-25 23:41:46 +01:00
DanielNoord
5a64ed45be Merge pull request #508 from DanielNoord/fixes
A number of hot fixes for 2.031.3
2021-01-25 23:40:41 +01:00
Daniel van Noord
e5b24b393e Fixed decimal notation #500 2021-01-25 23:37:41 +01:00
Daniel van Noord
92c28b092b Timer bar now adjusts height correctly #499 2021-01-25 23:29:21 +01:00
Daniel van Noord
d5c5a5f62e Show tooltip warnings when extra info is off #496 2021-01-25 23:24:25 +01:00
Daniel van Noord
867249e8cb Missing upgrades no longer shows debug #497 2021-01-25 23:00:30 +01:00
Daniel van Noord
28e28fd5a0 Single fattest wrinkler now excludes shiny #498 2021-01-25 22:55:57 +01:00
Daniel van Noord
5f93186e7d Fixed bug with display of missing upgrades 2021-01-25 22:46:08 +01:00
Daniel van Noord
0a57450815 Fix colour settings not displaying #504 2021-01-25 22:39:03 +01:00
Daniel van Noord
c08cefd1a6 Merge branch 'dev' of https://github.com/Aktanusa/CookieMonster into gardentooltip 2021-01-25 22:32:53 +01:00
Zohnannor
51ab15f2ec Fix in Disp.js and combine 2021-01-25 20:31:32 +01:00
Zohnannor
8505b1621d Update CM.Disp.FormatTime
Add years to date formatting, fixes #502
2021-01-25 20:31:32 +01:00
DanielNoord
901bc7c61f Merge pull request #503 from Zohnannor/patch-1
Update CM.Disp.FormatTime
2021-01-25 20:29:05 +01:00
Zohnannor
192c5d105c Fix in Disp.js and combine 2021-01-25 22:20:59 +03:00
DanielNoord
519e67dce9 Create CONTRIBUTING.md 2021-01-25 18:07:55 +01:00
Zohnannor
c184d8b7a7 Update CM.Disp.FormatTime
Add years to date formatting, fixes #502
2021-01-25 19:02:24 +03:00
Daniel van Noord
55c6b5db8b Merge branch 'dev' of https://github.com/Aktanusa/CookieMonster into gardentooltip 2021-01-23 23:03:24 +01:00
DanielNoord
6df4abf945 Merge pull request #493 from Aktanusa/master
Rebase dev to incorporate hot fix for #490
2021-01-23 23:02:21 +01:00
DanielNoord
242c6ba754 Merge pull request #491 from Aktanusa/fix/hasGod
Fixed hasGod #490
2021-01-23 23:00:21 +01:00
Daniel van Noord
00f79cb073 Fixed hasGod #490 2021-01-23 22:59:46 +01:00
Daniel van Noord
c64f42bcfa Start work on Garden Tooltip 2021-01-23 22:55:39 +01:00
Daniel van Noord
29ba1c66cf Moved most replace tooltip funcs to Main.js 2021-01-23 22:36:26 +01:00
DanielNoord
1875423a7b Merge pull request #489 from DanielNoord/enhance/warnings
Some new functions related to warnings
2021-01-23 22:11:21 +01:00
Daniel van Noord
62f8e1fe82 Base warnings on new income instead of curr #488 2021-01-23 22:10:06 +01:00
Daniel van Noord
f257243b38 Optional warning for Conjure with Frenzy (#487) 2021-01-23 22:02:21 +01:00
Daniel van Noord
d71c197ec9 Added Conjure Frenzy to stats 2021-01-23 21:53:36 +01:00
21 changed files with 11042 additions and 9593 deletions

2
.eslintignore Normal file
View File

@@ -0,0 +1,2 @@
CookieMonster.js
CookieMonster.user.js

50
.eslintrc.js Normal file
View File

@@ -0,0 +1,50 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
globals: {
module: 'readonly',
Game: 'writable',
l: 'readonly',
b64_to_utf8: 'readonly',
utf8_to_b64: 'readonly',
Beautify: 'writable',
realAudio: 'readonly',
JSColor: 'readonly',
jscolor: 'readonly',
BeautifyAll: 'readonly',
CM: 'writable',
unsafeWindow: 'readonly',
},
extends: 'airbnb-base',
parserOptions: {
ecmaVersion: 12,
},
rules: {
indent: ['error', 'tab'],
'no-tabs': 'off',
'max-len': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-new-func': 'off',
'no-eval': 'off',
'no-restricted-properties': 'off',
'no-restricted-syntax': 'off',
'no-mixed-operators': 'off',
'prefer-destructuring': 'off',
'func-names': 'off',
'no-use-before-define': 'off',
'no-console': 'off',
'no-nested-ternary': 'off',
'object-shorthand': 'off',
'no-else-return': 'off',
'prefer-arrow-callback': 'off',
'no-new': 'off',
'no-alert': 'off',
'new-cap': 'off',
'no-restricted-globals': 'off',
'no-template-curly-in-string': 'off',
radix: 'off',
},
};

25
.github/workflows/CI.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: CI
on: [push, pull_request]
jobs:
Check_ESLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run ESLint
run: |
npm install
npx eslint src
Check_main_file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check if CookieMonster.js is built correctly
run: |
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
if cmp CookieMonster.js CookieMonsterTest.js; then
echo '### SUCCESS: CookieMonster is correctly built! ###'
else
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
exit 1
fi

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
node_modules

22
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,22 @@
The following is a description of the our approach to the project.
Cookie Monster is written to modify Cookie Clicker as little as possible. This means the data is copied to simulate instead of actually modifying the current values and reverting later. The benefit is that CM should never mess up any data. The downside is that there is an extra overhead to copy and store the copied data.
Here is a description of what should be stored in each of the source JS. Make edits to the source file first and then use the combine file to compile the final file:
JS | Description
-- | -
Cache | Functions related to creating and storing data cache
Config | Functions related to manipulating CM configuration
Data | Hard coded values
Disp | Functions related to displaying CM's UI
Footer | The footer of CM's JS (not modified often or ever)
Header | The header of CM's JS (not modified often or ever)
Main | Functions related to the main loop and initializing CM
Sim | Functions related to simulate something
These are some additional guidelines:
- Try to use DOM as much as possible instead of using string manipulation to modify HTML.
- Please be descriptive of your commits. If the commit is related to an issue or PR, please add the issue/PR number to the commit message.
- Try to follow the formatting and annotation as specified by JSCode
- PR's should target the `dev` branch

View File

@@ -1,2 +0,0 @@
@ECHO OFF
COPY /B /Y .\src\Header.js + .\src\Cache.js + .\src\Config.js + .\src\Data.js + .\src\Disp.js + .\src\Main.js + .\src\Sim.js + .\src\Footer.js CookieMonster.js

View File

@@ -1,2 +0,0 @@
#!/bin/sh
cat ./src/Header.js ./src/Cache.js ./src/Config.js ./src/Data.js ./src/Disp.js ./src/Main.js ./src/Sim.js ./src/Footer.js > CookieMonster.js

File diff suppressed because one or more lines are too long

19
CookieMonster.user.js Normal file
View File

@@ -0,0 +1,19 @@
// ==UserScript==
// @name Cookie Monster
// @include /https?://orteil.dashnet.org/cookieclicker/
// ==/UserScript==
const readyCheck = setInterval(() => {
const Game = unsafeWindow.Game;
if (
typeof Game !== "undefined" &&
typeof Game.ready !== "undefined" &&
Game.ready
) {
Game.LoadMod(
"https://aktanusa.github.io/CookieMonster/CookieMonster.js"
);
clearInterval(readyCheck);
}
}, 1000);

View File

@@ -1,3 +1,4 @@
![ESLint](https://github.com/Aktanusa/CookieMonster/workflows/ESLint/badge.svg?event=push)
## Cookie Monster
**Cookie Monster** is an addon you can load into Cookie Clicker, that offers a wide range of tools and statistics to enhance the game. **It is not a cheat interface** although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.
@@ -50,27 +51,7 @@ If (for some reason) the above doesn't work, trying pasting everything after the
### Userscript
If you'd rather use the addon as a script via per example *Greasemonkey* or *Tampermonkey*, you can use the following script, which will automatically load *Cookie Monster* every time the original game loads. You may need to specify <code>http://orteil.dashnet.org/cookieclicker/</code> when asked for a *namespace* or *includes*. For how to add an userscript to your browser, refer to your browser/plugin's documentation as the method changes for each one.
```javascript
// ==UserScript==
// @name Cookie Monster
// @namespace Cookie
// @include http://orteil.dashnet.org/cookieclicker/
// @include https://orteil.dashnet.org/cookieclicker/
// @version 1
// @grant none
// ==/UserScript==
(function() {
const checkReady = setInterval(function() {
if (typeof Game.ready !== 'undefined' && Game.ready) {
Game.LoadMod('https://aktanusa.github.io/CookieMonster/CookieMonster.js');
clearInterval(checkReady);
}
}, 1000);
})();
```
If you'd rather use the addon as a [userscript](https://en.wikipedia.org/wiki/Userscript) to automatically load _Cookie Monster_ every time the original game loads, install the `CookieMonster.user.js` file. You can do this by clicking on the file in the file-list and clicking "raw".
## Bugs and suggestions
@@ -82,6 +63,12 @@ If the bug is still here, you can submit an issue for it. Please do so by using
All suggestions are welcome, even the smallest ones.
## Contributing
To contribute you can fork and clone the repository and run `npm install`.
Please also remember to run `npm run build` after saving all your changes to build the final `CookieMonster.js` file.
## Contributors
* **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author

File diff suppressed because it is too large Load Diff

3616
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

53
package.json Normal file
View File

@@ -0,0 +1,53 @@
{
"name": "cookiemonster-mod",
"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.",
"main": "CookieMonster.js",
"keywords": [
"Cookie Clicker",
"javascript",
"mod",
"Dashnet",
"Orteil"
],
"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"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Aktanusa/CookieMonster.git"
},
"license": "MIT",
"author": {
"name": "Aktanusa",
"email": "chanam.geo@yahoo.com"
},
"contributors": [
{
"name": "Daniël van Noord",
"email": "13665637+DanielNoord@users.noreply.github.com"
},
{
"name": "Aran Leite",
"email": "hyoretsu@gmail.com",
"url": "https://www.linkedin.com/in/aranleite"
}
],
"bugs": {
"url": "https://github.com/Aktanusa/CookieMonster/issues"
},
"homepage": "https://github.com/Aktanusa/CookieMonster#readme",
"devDependencies": {
"eslint": "^7.19.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1",
"terser": "^5.6.0-beta"
},
"ccrepo": {
"icon": [
10,
0
],
"name": "Cookie Monster"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
/**********
/**
* Config *
**********/
*/
/********
/**
* Section: Functions related to saving, loading and restoring configs */
/**
@@ -12,58 +12,52 @@
* CM.ToggleConfigVolume() and changes in options with type "url", "color" or "numscale"
*/
CM.Config.SaveConfig = function () {
let saveString = b64_to_utf8(unescape(localStorage.getItem('CookieClickerGame')).split('!END!')[0]);
CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
if (CookieMonsterSave != null) {
newSaveString = saveString.replace(CookieMonsterSave[0], "CookieMonster:" + CM.save());
localStorage.setItem('CookieClickerGame', escape(utf8_to_b64(newSaveString)+'!END!'))
}
const saveString = b64_to_utf8(unescape(localStorage.getItem('CookieClickerGame')).split('!END!')[0]);
const CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
if (CookieMonsterSave !== null) {
const newSaveString = saveString.replace(CookieMonsterSave[0], `CookieMonster:${CM.save()}`);
localStorage.setItem('CookieClickerGame', escape(`${utf8_to_b64(newSaveString)}!END!`));
}
};
/**
* This function loads the config of CookieMonster saved in localStorage and loads it into CM.Options
* It is called by CM.DelayInit() and CM.Config.RestoreDefault()
* It is called by CM.Main.DelayInit() and CM.Config.RestoreDefault()
*/
CM.Config.LoadConfig = function (settings) {
// This removes cookies left from earlier versions of CookieMonster
if (typeof localStorage.CMConfig != "undefined") {
if (typeof localStorage.CMConfig !== 'undefined') {
delete localStorage.CMConfig;
}
if (settings != null) {
if (settings !== undefined) {
CM.Options = settings;
// Check values
var mod = false;
for (var i in CM.Data.ConfigDefault) {
let mod = false;
for (const i in CM.Data.ConfigDefault) {
if (typeof CM.Options[i] === 'undefined') {
mod = true;
CM.Options[i] = CM.Data.ConfigDefault[i];
}
else if (i != 'Header' && i != 'Colors') {
if (i.indexOf('SoundURL') == -1) {
if (!(CM.Options[i] > -1 && CM.Options[i] < CM.ConfigData[i].label.length)) {
} else if (i !== 'Header' && i !== 'Colors') {
if (i.indexOf('SoundURL') === -1) {
if (!(CM.Options[i] > -1 && CM.Options[i] < CM.Data.Config[i].label.length)) {
mod = true;
CM.Options[i] = CM.Data.ConfigDefault[i];
}
}
else { // Sound URLs
if (typeof CM.Options[i] != 'string') {
} else if (typeof CM.Options[i] !== 'string') { // Sound URLs
mod = true;
CM.Options[i] = CM.Data.ConfigDefault[i];
}
}
}
else if (i == 'Header') {
for (var j in CM.Data.ConfigDefault.Header) {
} else if (i === 'Header') {
for (const j in CM.Data.ConfigDefault.Header) {
if (typeof CM.Options[i][j] === 'undefined' || !(CM.Options[i][j] > -1 && CM.Options[i][j] < 2)) {
mod = true;
CM.Options[i][j] = CM.Data.ConfigDefault[i][j];
}
}
}
else { // Colors
for (var j in CM.Data.ConfigDefault.Colors) {
if (typeof CM.Options[i][j] === 'undefined' || typeof CM.Options[i][j] != 'string') {
} else { // Colors
for (const j in CM.Data.ConfigDefault.Colors) {
if (typeof CM.Options[i][j] === 'undefined' || typeof CM.Options[i][j] !== 'string') {
mod = true;
CM.Options[i][j] = CM.Data.ConfigDefault[i][j];
}
@@ -71,17 +65,16 @@ CM.Config.LoadConfig = function(settings) {
}
}
if (mod) CM.Config.SaveConfig();
CM.Loop(); // Do loop once
for (var i in CM.Data.ConfigDefault) {
if (i != 'Header' && typeof CM.ConfigData[i].func !== 'undefined') {
CM.ConfigData[i].func();
CM.Main.Loop(); // Do loop once
for (const i in CM.Data.ConfigDefault) {
if (i !== 'Header' && typeof CM.Data.Config[i].func !== 'undefined') {
CM.Data.Config[i].func();
}
}
}
else { // Default values
} else { // Default values
CM.Config.RestoreDefault();
}
}
};
/**
* This function reloads and resaves the default config as stored in CM.Data.ConfigDefault
@@ -91,9 +84,9 @@ CM.Config.RestoreDefault = function() {
CM.Config.LoadConfig(CM.Data.ConfigDefault);
CM.Config.SaveConfig();
Game.UpdateMenu();
}
};
/********
/**
* Section: Functions related to toggling or changing configs */
/**
@@ -104,19 +97,18 @@ CM.Config.RestoreDefault = function() {
CM.Config.ToggleConfig = function (config) {
CM.Options[config]++;
if (CM.Options[config] == CM.ConfigData[config].label.length) {
if (CM.Options[config] === CM.Data.Config[config].label.length) {
CM.Options[config] = 0;
if (CM.ConfigData[config].toggle) l(CM.ConfigPrefix + config).className = 'option off';
}
else l(CM.ConfigPrefix + config).className = 'option';
if (CM.Data.Config[config].toggle) l(CM.Config.ConfigPrefix + config).className = 'option off';
} else l(CM.Config.ConfigPrefix + config).className = 'option';
if (typeof CM.ConfigData[config].func !== 'undefined') {
CM.ConfigData[config].func();
if (typeof CM.Data.Config[config].func !== 'undefined') {
CM.Data.Config[config].func();
}
l(CM.ConfigPrefix + config).innerHTML = CM.ConfigData[config].label[CM.Options[config]];
l(CM.Config.ConfigPrefix + config).innerHTML = CM.Data.Config[config].label[CM.Options[config]];
CM.Config.SaveConfig();
}
};
/**
* This function sets the value of the specified volume-option and updates the display in the options menu
@@ -124,12 +116,12 @@ CM.Config.ToggleConfig = function(config) {
* @param {string} config The name of the option
*/
CM.Config.ToggleConfigVolume = function (config) {
if (l("slider" + config) != null) {
l("slider" + config + "right").innerHTML = l("slider" + config).value + "%";
CM.Options[config] = Math.round(l("slider" + config).value);
if (l(`slider${config}`) !== null) {
l(`slider${config}right`).innerHTML = `${l(`slider${config}`).value}%`;
CM.Options[config] = Math.round(l(`slider${config}`).value);
}
CM.Config.SaveConfig();
}
};
/**
* This function toggles header options by incrementing them with 1 and handling changes
@@ -140,9 +132,9 @@ CM.Config.ToggleHeader = function(config) {
CM.Options.Header[config]++;
if (CM.Options.Header[config] > 1) CM.Options.Header[config] = 0;
CM.Config.SaveConfig();
}
};
/********
/**
* Section: Functions related to notifications */
/**
@@ -152,28 +144,32 @@ CM.Config.ToggleHeader = function(config) {
* @param {number} ToggleOnOff A number indicating whether the option has been turned off (0) or on (1)
*/
CM.Config.CheckNotificationPermissions = function (ToggleOnOff) {
if (ToggleOnOff == 1) {
if (ToggleOnOff === 1) {
// Check if browser support Promise version of Notification Permissions
function checkNotificationPromise() {
const checkNotificationPromise = function () {
try {
Notification.requestPermission().then();
} catch (e) {
return false;
}
return true;
}
};
// Check if the browser supports notifications and which type
if (!('Notification' in window)) {
console.log("This browser does not support notifications.");
}
else {
if(checkNotificationPromise()) {
console.log('This browser does not support notifications.');
} else if (checkNotificationPromise()) {
Notification.requestPermission().then();
}
else {
} else {
Notification.requestPermission();
}
}
}
}
};
/**
* Section: Variables used in Config functions */
/**
* Used to name certain DOM elements and refer to them
*/
CM.Config.ConfigPrefix = 'CMConfig';

View File

@@ -1,8 +1,8 @@
/********
/**
* Data *
********/
*/
/********
/**
* Section: Data used in the stats page to show not yet purchased updates. See CM.Disp.CreateStatsMissDisp() */
CM.Data.Fortunes = [
@@ -28,14 +28,41 @@ CM.Data.Fortunes = [
'Fortune #101',
'Fortune #102',
'Fortune #103',
'Fortune #104'
'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']
CM.Data.PlantDrops = ['Elderwort biscuits', 'Bakeberry cookies', 'Duketater cookies', 'Green yeast digestives', 'Wheat slims', 'Fern tea', 'Ichor syrup'];
/********
/**
* Section: All possible effects plants and other items can have with an explanation */
CM.Data.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',
};
/**
* Section: Data for the various scales used by CookieMonster */
CM.Data.metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
@@ -50,33 +77,34 @@ CM.Data.shortScaleAbbreviated = ['', 'K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp',
'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']
'UCt'];
/********
/**
* Section: Two array's containing all Config groups and their to-be displayed title */
CM.ConfigGroups = {
BarsColors: "Bars/Colors",
Calculation: "Calculation",
Notification: "Notification",
Tooltip: "Tooltips",
Statistics: "Statistics",
Notation: "Notation",
Miscellaneous: "Miscellaneous"
}
CM.Data.ConfigGroups = {
BarsColors: 'Bars/Colors',
Calculation: 'Calculation',
Notification: 'Notification',
Tooltip: 'Tooltips and additional insights',
Statistics: 'Statistics',
Notation: 'Notation',
Miscellaneous: 'Miscellaneous',
};
CM.ConfigGroupsNotification = {
NotificationGC: "Golden Cookie",
NotificationFC: "Fortune Cookie",
NotificationSea: "Season Special",
NotificationGard: "Garden Tick",
NotificationMagi: "Full Magic Bar",
NotificationWrink: "Wrinkler",
NotificationWrinkMax: "Maximum Wrinklers",
}
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.ConfigData) 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 */
/**
* This includes all options of CookieMonster and relevant data
@@ -89,16 +117,36 @@ CM.ConfigGroupsNotification = {
* @item {function} func A function to be called when the option is toggled
*/
// Barscolors
CM.ConfigData.BotBar = {type: 'bool', group: 'BarsColors', label: ['Bottom Bar OFF', 'Bottom Bar ON'], desc: 'Building Information', toggle: true, func: function() {CM.Disp.ToggleBotBar();}};
CM.ConfigData.TimerBar = {type: 'bool', group: 'BarsColors', label: ['Timer Bar OFF', 'Timer Bar ON'], desc: 'Timers of Golden Cookie, Season Popup, Frenzy (Normal, Clot, Elder), Click Frenzy', toggle: true, func: function() {CM.Disp.ToggleTimerBar();}};
CM.ConfigData.TimerBarPos = {type: 'bool', group: 'BarsColors', label: ['Timer Bar Position (Top Left)', 'Timer Bar Position (Bottom)'], desc: 'Placement of the Timer Bar', toggle: false, func: function() {CM.Disp.ToggleTimerBarPos();}};
CM.ConfigData.SortBuildings = {type: 'bool', group: 'BarsColors', label: ['Sort Buildings: Default', 'Sort Buildings: PP'], desc: 'Sort the display of buildings in either default order or by PP', toggle: false, func: function () { CM.Disp.UpdateBuildings();}};
CM.ConfigData.SortUpgrades = {type: 'bool', group: 'BarsColors', label: ['Sort Upgrades: Default', 'Sort Upgrades: PP'], desc: 'Sort the display of upgrades in either default order or by PP', toggle: false, func: function () { CM.Disp.UpdateUpgrades();}};
CM.ConfigData.BuildColor = {type: 'bool', group: 'BarsColors', label: ['Building Colors OFF', 'Building Colors ON'], desc: 'Color code buildings', toggle: true, func: function() {CM.Disp.UpdateBuildings();}};
CM.ConfigData.BulkBuildColor = {type: 'bool', group: 'BarsColors', label: ['Bulk Building Colors (Single Building Color)', 'Bulk Building Colors (Calculated Bulk Color)'], desc: 'Color code bulk buildings based on single buildings color or calculated bulk value color', toggle: false, func: function() {CM.Disp.UpdateBuildings();}};
CM.ConfigData.ColorPPBulkMode = {type: 'bool', group: 'BarsColors', label: ['Color of PP (Compared to Single)', 'Color of PP (Compared to Bulk)'], desc: 'Color PP-values based on comparison with single purchase or with selected bulk-buy mode', toggle: false};
CM.ConfigData.UpBarColor = {type: 'bool', group: 'BarsColors', label: ['Upgrade Colors/Bar OFF', 'Upgrade Colors with Bar ON', 'Upgrade Colors without Bar ON'], desc: 'Color code upgrades and optionally add a counter bar', toggle: false, func: function() {CM.Disp.ToggleUpgradeBarAndColor();}};
CM.ConfigData.Colors = { type: 'color', group: 'BarsColors',
CM.Data.Config.BotBar = {
type: 'bool', group: 'BarsColors', label: ['Bottom Bar OFF', 'Bottom Bar ON'], desc: 'Building Information', toggle: true, func: function () { CM.Disp.ToggleBotBar(); },
};
CM.Data.Config.TimerBar = {
type: 'bool', group: 'BarsColors', label: ['Timer Bar OFF', 'Timer Bar ON'], desc: 'Timers of Golden Cookie, Season Popup, Frenzy (Normal, Clot, Elder), Click Frenzy', toggle: true, func: function () { CM.Disp.ToggleTimerBar(); },
};
CM.Data.Config.TimerBarPos = {
type: 'bool', group: 'BarsColors', label: ['Timer Bar Position (Top Left)', 'Timer Bar Position (Bottom)'], desc: 'Placement of the Timer Bar', toggle: false, func: function () { CM.Disp.ToggleTimerBarPos(); },
};
CM.Data.Config.TimerBarOverlay = {
type: 'bool', group: 'BarsColors', label: ['Timer Bar Overlay OFF', 'Timer Bar Overlay Only Seconds', 'Timer Bar Overlay Full'], desc: 'Overlay on timers displaying seconds and/or percentage left', toggle: true,
};
CM.Data.Config.SortBuildings = {
type: 'bool', group: 'BarsColors', label: ['Sort Buildings: Default', 'Sort Buildings: PP'], desc: 'Sort the display of buildings in either default order or by PP', toggle: false, func: function () { CM.Disp.UpdateBuildings(); },
};
CM.Data.Config.SortUpgrades = {
type: 'bool', group: 'BarsColors', label: ['Sort Upgrades: Default', 'Sort Upgrades: PP'], desc: 'Sort the display of upgrades in either default order or by PP', toggle: false, func: function () { CM.Disp.UpdateUpgrades(); },
};
CM.Data.Config.BuildColor = {
type: 'bool', group: 'BarsColors', label: ['Building Colors OFF', 'Building Colors ON'], desc: 'Color code buildings', toggle: true, func: function () { CM.Disp.UpdateBuildings(); },
};
CM.Data.Config.BulkBuildColor = {
type: 'bool', group: 'BarsColors', label: ['Bulk Building Colors (Single Building Color)', 'Bulk Building Colors (Calculated Bulk Color)'], desc: 'Color code bulk buildings based on single buildings color or calculated bulk value color', toggle: false, func: function () { CM.Disp.UpdateBuildings(); },
};
CM.Data.Config.UpBarColor = {
type: 'bool', group: 'BarsColors', label: ['Upgrade Colors/Bar OFF', 'Upgrade Colors with Bar ON', 'Upgrade Colors without Bar ON'], desc: 'Color code upgrades and optionally add a counter bar', toggle: false, func: function () { CM.Disp.ToggleUpgradeBarAndColor(); },
};
CM.Data.Config.Colors = {
type: 'color',
group: 'BarsColors',
desc: {
Blue: 'Color Blue. Used to show better than best PP building, for Click Frenzy bar, and for various labels',
Green: 'Color Green. Used to show best PP building, for Blood Frenzy bar, and for various labels',
@@ -108,109 +156,274 @@ CM.ConfigData.Colors = { type: 'color', group: 'BarsColors',
Purple: 'Color Purple. Used to show worse than worst PP building, for Next Cookie bar, and for various labels',
Gray: 'Color Gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
Pink: 'Color Pink. Used for Dragonflight bar',
Brown: 'Color Brown. Used for Dragon Harvest bar'
Brown: 'Color Brown. Used for Dragon Harvest bar',
},
func: function() {CM.Disp.UpdateColors();}
func: function () { CM.Disp.UpdateColors(); },
};
CM.Data.Config.UpgradeBarFixedPos = {
type: 'bool', group: 'BarsColors', label: ['Upgrade Bar Fixed Position OFF', 'Upgrade Bar Fixed Position ON'], desc: 'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling', toggle: true, func: function () { CM.Disp.ToggleUpgradeBarFixedPos(); },
};
CM.ConfigData.UpgradeBarFixedPos = {type: 'bool', group: 'BarsColors', label: ['Upgrade Bar Fixed Position OFF', 'Upgrade Bar Fixed Position ON'], desc: 'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling', toggle: true, func: function() {CM.Disp.ToggleUpgradeBarFixedPos();}};
// Calculation
CM.ConfigData.CalcWrink = {type: 'bool', group: 'Calculation', label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON', 'Calculate with Single Fattest Wrinkler ON'], desc: 'Calculate times and average Cookies Per Second with (only the single fattest) Wrinklers', toggle: true};
CM.ConfigData.CPSMode = {type: 'bool', group: 'Calculation', label: ['Current Cookies Per Second', 'Average Cookies Per Second'], desc: 'Calculate times using current Cookies Per Second or average Cookies Per Second', toggle: false};
CM.ConfigData.AvgCPSHist = {type: 'bool', group: 'Calculation', label: ['Average CPS for past 10s', 'Average CPS for past 15s', 'Average CPS for past 30s', 'Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'], desc: 'How much time average Cookies Per Second should consider', toggle: false};
CM.ConfigData.AvgClicksHist = {type: 'bool', group: 'Calculation', label: ['Average Cookie Clicks for past 1s', 'Average Cookie Clicks for past 5s', 'Average Cookie Clicks for past 10s', 'Average Cookie Clicks for past 15s', 'Average Cookie Clicks for past 30s'], desc: 'How much time average Cookie Clicks should consider', toggle: false};
CM.ConfigData.ToolWarnBon = {type: 'bool', group: 'Calculation', label: ['Calculate Tooltip Warning With Bonus CPS OFF', 'Calculate Tooltip Warning With Bonus CPS ON'], desc: 'Calculate the warning with or without the bonus CPS you get from buying', toggle: true};
CM.Data.Config.CalcWrink = {
type: 'bool', group: 'Calculation', label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON', 'Calculate with Single Fattest Wrinkler ON'], desc: 'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) Wrinklers', toggle: true,
};
CM.Data.Config.CPSMode = {
type: 'bool', group: 'Calculation', label: ['Current Cookies Per Second', 'Average Cookies Per Second'], desc: 'Calculate times using current Cookies Per Second or average Cookies Per Second', toggle: false,
};
CM.Data.Config.AvgCPSHist = {
type: 'bool', group: 'Calculation', label: ['Average CPS for past 10s', 'Average CPS for past 15s', 'Average CPS for past 30s', 'Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'], desc: 'How much time average Cookies Per Second should consider', toggle: false,
};
CM.Data.Config.AvgClicksHist = {
type: 'bool', group: 'Calculation', label: ['Average Cookie Clicks for past 1s', 'Average Cookie Clicks for past 5s', 'Average Cookie Clicks for past 10s', 'Average Cookie Clicks for past 15s', 'Average Cookie Clicks for past 30s'], desc: 'How much time average Cookie Clicks should consider', toggle: false,
};
CM.Data.Config.ColorPPBulkMode = {
type: 'bool', group: 'Calculation', label: ['Color of PP (Compared to Single)', 'Color of PP (Compared to Bulk)'], desc: 'Color PP-values based on comparison with single purchase or with selected bulk-buy mode', toggle: false, func: function () { CM.Cache.CachePP(); },
};
CM.Data.Config.PPExcludeTop = {
type: 'bool', group: 'Calculation', label: ["Don't Ignore Any", 'Ignore 1st Best', 'Ignore 1st and 2nd Best', 'Ignore 1st, 2nd and 3rd Best'], desc: 'Makes CookieMonster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values', toggle: true,
};
CM.Data.Config.PPSecondsLowerLimit = {
type: 'numscale', group: 'Calculation', label: 'Lower limit for PP (in seconds): ', desc: 'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option', min: 0, max: Infinity,
};
CM.Data.Config.PPOnlyConsiderBuyable = {
type: 'bool', group: 'Calculation', label: ["Don't Ignore Non-Buyable", 'Ignore Non-Buyable'], desc: "Makes CookieMonster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'", toggle: true,
};
CM.Data.Config.ToolWarnBon = {
type: 'bool', group: 'Calculation', label: ['Calculate Tooltip Warning With Bonus CPS OFF', 'Calculate Tooltip Warning With Bonus CPS ON'], desc: 'Calculate the warning with or without the bonus CPS you get from buying', toggle: true,
};
// Notification
CM.ConfigData.GCNotification = {type: 'bool', group: 'NotificationGC', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when Golden Cookie spawns', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.GCNotification);}};
CM.ConfigData.GCFlash = {type: 'bool', group: 'NotificationGC', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Golden Cookie', toggle: true};
CM.ConfigData.GCSound = {type: 'bool', group: 'NotificationGC', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Golden Cookie', toggle: true};
CM.ConfigData.GCVolume = {type: 'vol', group: 'NotificationGC', label: [], desc: 'Volume'};
for (var i = 0; i < 101; i++) {
CM.ConfigData.GCVolume.label[i] = i + '%';
CM.Data.Config.Title = {
type: 'bool', group: 'NotificationGeneral', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns; "!" means that Golden Cookie/Reindeer can spawn', toggle: true,
};
CM.Data.Config.GeneralSound = {
type: 'bool', group: 'NotificationGeneral', label: ['Consider Game Volume Setting OFF', 'Consider Game Volume Setting ON'], desc: 'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down', toggle: true,
};
CM.Data.Config.GCNotification = {
type: 'bool', group: 'NotificationGC', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when Golden Cookie spawns', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.GCNotification); },
};
CM.Data.Config.GCFlash = {
type: 'bool', group: 'NotificationGC', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Golden Cookie', toggle: true,
};
CM.Data.Config.GCSound = {
type: 'bool', group: 'NotificationGC', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Golden Cookie', toggle: true,
};
CM.Data.Config.GCVolume = {
type: 'vol', group: 'NotificationGC', label: [], desc: 'Volume',
};
for (let i = 0; i < 101; i++) {
CM.Data.Config.GCVolume.label[i] = `${i}%`;
}
CM.ConfigData.GCSoundURL = {type: 'url', group: 'NotificationGC', label: 'Sound URL:', desc: 'URL of the sound to be played when a Golden Cookie spawns'};
CM.ConfigData.FortuneNotification = {type: 'bool', group: 'NotificationFC', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when Fortune Cookie is on the Ticker', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.FortuneNotification);}};
CM.ConfigData.FortuneFlash = {type: 'bool', group: 'NotificationFC', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Fortune Cookie', toggle: true};
CM.ConfigData.FortuneSound = {type: 'bool', group: 'NotificationFC', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Fortune Cookie', toggle: true};
CM.ConfigData.FortuneVolume = {type: 'vol', group: 'NotificationFC', label: [], desc: 'Volume'};
for (var i = 0; i < 101; i++) {
CM.ConfigData.FortuneVolume.label[i] = i + '%';
CM.Data.Config.GCSoundURL = {
type: 'url', group: 'NotificationGC', label: 'Sound URL:', desc: 'URL of the sound to be played when a Golden Cookie spawns',
};
CM.Data.Config.FortuneNotification = {
type: 'bool', group: 'NotificationFC', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when Fortune Cookie is on the Ticker', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.FortuneNotification); },
};
CM.Data.Config.FortuneFlash = {
type: 'bool', group: 'NotificationFC', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Fortune Cookie', toggle: true,
};
CM.Data.Config.FortuneSound = {
type: 'bool', group: 'NotificationFC', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Fortune Cookie', toggle: true,
};
CM.Data.Config.FortuneVolume = {
type: 'vol', group: 'NotificationFC', label: [], desc: 'Volume',
};
for (let i = 0; i < 101; i++) {
CM.Data.Config.FortuneVolume.label[i] = `${i}%`;
}
CM.ConfigData.FortuneSoundURL = {type: 'url', group: 'NotificationFC', label: 'Sound URL:', desc: 'URL of the sound to be played when the Ticker has a Fortune Cookie'};
CM.ConfigData.SeaNotification = {type: 'bool', group: 'NotificationSea', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification on Season Popup', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.SeaNotification);}};
CM.ConfigData.SeaFlash = {type: 'bool', group: 'NotificationSea', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Season Popup', toggle: true};
CM.ConfigData.SeaSound = {type: 'bool', group: 'NotificationSea', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Season Popup', toggle: true};
CM.ConfigData.SeaVolume = {type: 'vol', group: 'NotificationSea', label: [], desc: 'Volume'};
for (var i = 0; i < 101; i++) {
CM.ConfigData.SeaVolume.label[i] = i + '%';
CM.Data.Config.FortuneSoundURL = {
type: 'url', group: 'NotificationFC', label: 'Sound URL:', desc: 'URL of the sound to be played when the Ticker has a Fortune Cookie',
};
CM.Data.Config.SeaNotification = {
type: 'bool', group: 'NotificationSea', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification on Season Popup', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.SeaNotification); },
};
CM.Data.Config.SeaFlash = {
type: 'bool', group: 'NotificationSea', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Season Popup', toggle: true,
};
CM.Data.Config.SeaSound = {
type: 'bool', group: 'NotificationSea', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Season Popup', toggle: true,
};
CM.Data.Config.SeaVolume = {
type: 'vol', group: 'NotificationSea', label: [], desc: 'Volume',
};
for (let i = 0; i < 101; i++) {
CM.Data.Config.SeaVolume.label[i] = `${i}%`;
}
CM.ConfigData.SeaSoundURL = {type: 'url', group: 'NotificationSea', label: 'Sound URL:', desc: 'URL of the sound to be played when a Season Special spawns'};
CM.ConfigData.GardFlash = {type: 'bool', group: 'NotificationGard', label: ['Garden Tick Flash OFF', 'Flash ON'], desc: 'Flash screen on Garden Tick', toggle: true};
CM.ConfigData.GardSound = {type: 'bool', group: 'NotificationGard', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Garden Tick', toggle: true};
CM.ConfigData.GardVolume = {type: 'vol', group: 'NotificationGard', label: [], desc: 'Volume'};
for (var i = 0; i < 101; i++) {
CM.ConfigData.GardVolume.label[i] = i + '%';
CM.Data.Config.SeaSoundURL = {
type: 'url', group: 'NotificationSea', label: 'Sound URL:', desc: 'URL of the sound to be played when a Season Special spawns',
};
CM.Data.Config.GardFlash = {
type: 'bool', group: 'NotificationGard', label: ['Garden Tick Flash OFF', 'Flash ON'], desc: 'Flash screen on Garden Tick', toggle: true,
};
CM.Data.Config.GardSound = {
type: 'bool', group: 'NotificationGard', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Garden Tick', toggle: true,
};
CM.Data.Config.GardVolume = {
type: 'vol', group: 'NotificationGard', label: [], desc: 'Volume',
};
for (let i = 0; i < 101; i++) {
CM.Data.Config.GardVolume.label[i] = `${i}%`;
}
CM.ConfigData.GardSoundURL = {type: 'url', group: 'NotificationGard', label: 'Garden Tick Sound URL:', desc: 'URL of the sound to be played when the garden ticks'};
CM.ConfigData.MagicNotification = {type: 'bool', group: 'NotificationMagi', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when magic reaches maximum', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.MagicNotification);}};
CM.ConfigData.MagicFlash = {type: 'bool', group: 'NotificationMagi', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when magic reaches maximum', toggle: true};
CM.ConfigData.MagicSound = {type: 'bool', group: 'NotificationMagi', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when magic reaches maximum', toggle: true};
CM.ConfigData.MagicVolume = {type: 'vol', group: 'NotificationMagi', label: [], desc: 'Volume'};
for (var i = 0; i < 101; i++) {
CM.ConfigData.MagicVolume.label[i] = i + '%';
CM.Data.Config.GardSoundURL = {
type: 'url', group: 'NotificationGard', label: 'Garden Tick Sound URL:', desc: 'URL of the sound to be played when the garden ticks',
};
CM.Data.Config.MagicNotification = {
type: 'bool', group: 'NotificationMagi', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when magic reaches maximum', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.MagicNotification); },
};
CM.Data.Config.MagicFlash = {
type: 'bool', group: 'NotificationMagi', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when magic reaches maximum', toggle: true,
};
CM.Data.Config.MagicSound = {
type: 'bool', group: 'NotificationMagi', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when magic reaches maximum', toggle: true,
};
CM.Data.Config.MagicVolume = {
type: 'vol', group: 'NotificationMagi', label: [], desc: 'Volume',
};
for (let i = 0; i < 101; i++) {
CM.Data.Config.MagicVolume.label[i] = `${i}%`;
}
CM.ConfigData.MagicSoundURL = {type: 'url', group: 'NotificationMagi', label: 'Sound URL:', desc: 'URL of the sound to be played when magic reaches maxium'};
CM.ConfigData.WrinklerNotification = {type: 'bool', group: 'NotificationWrink', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when a Wrinkler appears', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.WrinklerNotification);}};
CM.ConfigData.WrinklerFlash = {type: 'bool', group: 'NotificationWrink', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when a Wrinkler appears', toggle: true};
CM.ConfigData.WrinklerSound = {type: 'bool', group: 'NotificationWrink', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when a Wrinkler appears', toggle: true};
CM.ConfigData.WrinklerVolume = {type: 'vol', group: 'NotificationWrink', label: [], desc: 'Volume'};
for (var i = 0; i < 101; i++) {
CM.ConfigData.WrinklerVolume.label[i] = i + '%';
CM.Data.Config.MagicSoundURL = {
type: 'url', group: 'NotificationMagi', label: 'Sound URL:', desc: 'URL of the sound to be played when magic reaches maxium',
};
CM.Data.Config.WrinklerNotification = {
type: 'bool', group: 'NotificationWrink', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when a Wrinkler appears', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.WrinklerNotification); },
};
CM.Data.Config.WrinklerFlash = {
type: 'bool', group: 'NotificationWrink', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when a Wrinkler appears', toggle: true,
};
CM.Data.Config.WrinklerSound = {
type: 'bool', group: 'NotificationWrink', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when a Wrinkler appears', toggle: true,
};
CM.Data.Config.WrinklerVolume = {
type: 'vol', group: 'NotificationWrink', label: [], desc: 'Volume',
};
for (let i = 0; i < 101; i++) {
CM.Data.Config.WrinklerVolume.label[i] = `${i}%`;
}
CM.ConfigData.WrinklerSoundURL = {type: 'url', group: 'NotificationWrink', label: 'Sound URL:', desc: 'URL of the sound to be played when a Wrinkler appears'};
CM.ConfigData.WrinklerMaxNotification = {type: 'bool', group: 'NotificationWrinkMax', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when the maximum amount of Wrinklers has appeared', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.WrinklerMaxNotification);}};
CM.ConfigData.WrinklerMaxFlash = {type: 'bool', group: 'NotificationWrinkMax', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when the maximum amount of Wrinklers has appeared', toggle: true};
CM.ConfigData.WrinklerMaxSound = {type: 'bool', group: 'NotificationWrinkMax', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when the maximum amount of Wrinklers has appeared', toggle: true};
CM.ConfigData.WrinklerMaxVolume = {type: 'vol', group: 'NotificationWrinkMax', label: [], desc: 'Volume'};
for (var i = 0; i < 101; i++) {
CM.ConfigData.WrinklerMaxVolume.label[i] = i + '%';
CM.Data.Config.WrinklerSoundURL = {
type: 'url', group: 'NotificationWrink', label: 'Sound URL:', desc: 'URL of the sound to be played when a Wrinkler appears',
};
CM.Data.Config.WrinklerMaxNotification = {
type: 'bool', group: 'NotificationWrinkMax', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when the maximum amount of Wrinklers has appeared', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.WrinklerMaxNotification); },
};
CM.Data.Config.WrinklerMaxFlash = {
type: 'bool', group: 'NotificationWrinkMax', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when the maximum amount of Wrinklers has appeared', toggle: true,
};
CM.Data.Config.WrinklerMaxSound = {
type: 'bool', group: 'NotificationWrinkMax', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when the maximum amount of Wrinklers has appeared', toggle: true,
};
CM.Data.Config.WrinklerMaxVolume = {
type: 'vol', group: 'NotificationWrinkMax', label: [], desc: 'Volume',
};
for (let i = 0; i < 101; i++) {
CM.Data.Config.WrinklerMaxVolume.label[i] = `${i}%`;
}
CM.ConfigData.WrinklerMaxSoundURL = {type: 'url', group: 'NotificationWrinkMax', label: 'Sound URL:', desc: 'URL of the sound to be played when the maximum amount of Wrinklers has appeared'};
CM.ConfigData.Title = {type: 'bool', group: 'Notification', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns', toggle: true};
CM.Data.Config.WrinklerMaxSoundURL = {
type: 'url', group: 'NotificationWrinkMax', label: 'Sound URL:', desc: 'URL of the sound to be played when the maximum amount of Wrinklers has appeared',
};
// Tooltip
CM.ConfigData.TooltipBuildUp = {type: 'bool', group: 'Tooltip', label: ['Buildings/Upgrades Tooltip Information OFF', 'Buildings/Upgrades Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades', toggle: true};
CM.ConfigData.TooltipAmor = {type: 'bool', group: 'Tooltip', label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true};
CM.ConfigData.ToolWarnLucky = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Warning OFF', 'Tooltip Lucky Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards', toggle: true};
CM.ConfigData.ToolWarnLuckyFrenzy = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Frenzy Warning OFF', 'Tooltip Lucky Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards', toggle: true};
CM.ConfigData.ToolWarnConjure = {type: 'bool', group: 'Tooltip', label: ['Tooltip Conjure Warning OFF', 'Tooltip Conjure Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards', toggle: true};
CM.ConfigData.ToolWarnEdifice = {type: 'bool', group: 'Tooltip', label: ['Tooltip Edifice Warning OFF', 'Tooltip Edifice Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building', toggle: true};
CM.ConfigData.ToolWarnPos = {type: 'bool', group: 'Tooltip', label: ['Tooltip Warning Position (Left)', 'Tooltip Warning Position (Bottom)'], desc: 'Placement of the warning boxes', toggle: false, func: function() {CM.Disp.ToggleToolWarnPos();}};
CM.ConfigData.TooltipGrim = {type: 'bool', group: 'Tooltip', label: ['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'], desc: 'Extra information in tooltip for grimoire', toggle: true};
CM.ConfigData.ToolWrink = {type: 'bool', group: 'Tooltip', label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true};
CM.ConfigData.TooltipLump = {type: 'bool', group: 'Tooltip', label: ['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'], desc: 'Shows the current Sugar Lump type in Sugar lump tooltip.', toggle: true};
CM.ConfigData.DragonAuraInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'], desc: 'Shows information about changes in CPS and costs in the dragon aura interface.', toggle: true};
CM.Data.Config.TooltipBuildUpgrade = {
type: 'bool', group: 'Tooltip', label: ['Building/Upgrade Tooltip Information OFF', 'Building/Upgrade Tooltip Information ON'], desc: 'Extra information in Building/Upgrade tooltips', toggle: true,
};
CM.Data.Config.TooltipAmor = {
type: 'bool', group: 'Tooltip', label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true,
};
CM.Data.Config.ToolWarnLucky = {
type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Warning OFF', 'Tooltip Lucky Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards', toggle: true,
};
CM.Data.Config.ToolWarnLuckyFrenzy = {
type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Frenzy Warning OFF', 'Tooltip Lucky Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards', toggle: true,
};
CM.Data.Config.ToolWarnConjure = {
type: 'bool', group: 'Tooltip', label: ['Tooltip Conjure Warning OFF', 'Tooltip Conjure Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards', toggle: true,
};
CM.Data.Config.ToolWarnConjureFrenzy = {
type: 'bool', group: 'Tooltip', label: ['Tooltip Conjure Frenzy Warning OFF', 'Tooltip Conjure Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active', toggle: true,
};
CM.Data.Config.ToolWarnEdifice = {
type: 'bool', group: 'Tooltip', label: ['Tooltip Edifice Warning OFF', 'Tooltip Edifice Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building', toggle: true,
};
CM.Data.Config.ToolWarnUser = {
type: 'numscale', group: 'Tooltip', label: 'Tooltip Warning At x times CPS: ', desc: 'Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether', min: 0, max: Infinity,
};
CM.Data.Config.ToolWarnPos = {
type: 'bool', group: 'Tooltip', label: ['Tooltip Warning Position (Left)', 'Tooltip Warning Position (Bottom)'], desc: 'Placement of the warning boxes', toggle: false, func: function () { CM.Disp.ToggleToolWarnPos(); },
};
CM.Data.Config.TooltipGrim = {
type: 'bool', group: 'Tooltip', label: ['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'], desc: 'Extra information in tooltip for grimoire', toggle: true,
};
CM.Data.Config.TooltipWrink = {
type: 'bool', group: 'Tooltip', label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true,
};
CM.Data.Config.TooltipLump = {
type: 'bool', group: 'Tooltip', label: ['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'], desc: 'Shows the current Sugar Lump type in Sugar lump tooltip.', toggle: true,
};
CM.Data.Config.TooltipPlots = {
type: 'bool', group: 'Tooltip', label: ['Garden Plots Tooltip OFF', 'Garden Plots Tooltip ON'], desc: 'Shows a tooltip for plants that have a cookie reward.', toggle: true,
};
CM.Data.Config.DragonAuraInfo = {
type: 'bool', group: 'Tooltip', label: ['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'], desc: 'Shows information about changes in CPS and costs in the dragon aura interface.', toggle: true,
};
CM.Data.Config.TooltipAscendButton = {
type: 'bool', group: 'Tooltip', label: ['Show Extra Info Ascend Tooltip OFF', 'Show Extra Info Ascend Tooltip ON'], desc: 'Shows additional info in the ascend tooltip', toggle: true,
};
// Statistics
CM.ConfigData.Stats = {type: 'bool', group: 'Statistics', label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!', toggle: true};
CM.ConfigData.MissingUpgrades = {type: 'bool', group: 'Statistics', label: ['Missing Upgrades OFF', 'Missing Upgrades ON'], desc: 'Shows Missing upgrades in Stats Menu. This feature can be laggy for users with a low amount of unlocked achievements.', toggle: true};
CM.ConfigData.UpStats = {type: 'bool', group: 'Statistics', label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false};
CM.ConfigData.TimeFormat = {type: 'bool', group: 'Statistics', label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false};
CM.ConfigData.DetailedTime = {type: 'bool', group: 'Statistics', label: ['Detailed Time OFF', 'Detailed Time ON'], desc: 'Change how time is displayed in certain statistics and tooltips', toggle: true, func: function() {CM.Disp.ToggleDetailedTime();}};
CM.ConfigData.GrimoireBar = {type: 'bool', group: 'Statistics', label: ['Grimoire Magic Meter Timer OFF', 'Grimoire Magic Meter Timer ON'], desc: 'A timer on how long before the Grimoire magic meter is full', toggle: true};
CM.Data.Config.Stats = {
type: 'bool', group: 'Statistics', label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!', toggle: true,
};
CM.Data.Config.MissingUpgrades = {
type: 'bool', group: 'Statistics', label: ['Missing Upgrades OFF', 'Missing Upgrades ON'], desc: 'Shows Missing upgrades in Stats Menu. This feature can be laggy for users with a low amount of unlocked achievements.', toggle: true,
};
CM.Data.Config.UpStats = {
type: 'bool', group: 'Statistics', label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false,
};
CM.Data.Config.TimeFormat = {
type: 'bool', group: 'Statistics', label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false,
};
CM.Data.Config.DetailedTime = {
type: 'bool', group: 'Statistics', label: ['Detailed Time OFF', 'Detailed Time ON'], desc: 'Change how time is displayed in certain statistics and tooltips', toggle: true, func: function () { CM.Disp.ToggleDetailedTime(); },
};
CM.Data.Config.GrimoireBar = {
type: 'bool', group: 'Statistics', label: ['Grimoire Magic Meter Timer OFF', 'Grimoire Magic Meter Timer ON'], desc: 'A timer on how long before the Grimoire magic meter is full', toggle: true,
};
CM.Data.Config.HeavenlyChipsTarget = {
type: 'numscale', group: 'Statistics', label: 'Heavenly Chips Target: ', desc: 'Use this to set a Heavenly Chips target that will be counted towards in the "prestige" statsistics sections', min: 1, max: Infinity,
};
CM.Data.Config.ShowMissedGC = {
type: 'bool', group: 'Statistics', label: ['Missed GC OFF', 'Missed GC ON'], desc: 'Show a stat in the statistics screen that counts how many Golden Cookies you have missed', toggle: true,
};
// Notation
CM.ConfigData.Scale = {type: 'bool', group: 'Notation', label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Short Scale (Abbreviated)', 'Scientific Notation', 'Engineering Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}};
CM.ConfigData.ScaleDecimals = {type: 'bool', group: 'Notation', label: ['1 decimals', '2 decimals', '3 decimals'], desc: 'Set the number of decimals used when applicable', toggle: false, func: function() {CM.Disp.RefreshScale();}};
CM.ConfigData.ScaleSeparator = {type: 'bool', group: 'Notation', label: ['. for decimals (Standard)', '. for thousands'], desc: 'Set the separator used for decimals and thousands', toggle: false, func: function() {CM.Disp.RefreshScale();}};
CM.ConfigData.ScaleCutoff = {type: 'numscale', group: 'Notation', label: 'Notation Cut-off Point', desc: 'The number from which CookieMonster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations.', min: 1, max: 999999999};
CM.Data.Config.Scale = {
type: 'bool', group: 'Notation', label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Short Scale (Abbreviated)', 'Scientific Notation', 'Engineering Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function () { CM.Disp.RefreshScale(); },
};
CM.Data.Config.ScaleDecimals = {
type: 'bool', group: 'Notation', label: ['1 decimals', '2 decimals', '3 decimals'], desc: 'Set the number of decimals used when applicable', toggle: false, func: function () { CM.Disp.RefreshScale(); },
};
CM.Data.Config.ScaleSeparator = {
type: 'bool', group: 'Notation', label: ['. for decimals (Standard)', '. for thousands'], desc: 'Set the separator used for decimals and thousands', toggle: false, func: function () { CM.Disp.RefreshScale(); },
};
CM.Data.Config.ScaleCutoff = {
type: 'numscale', group: 'Notation', label: 'Notation Cut-off Point: ', desc: 'The number from which CookieMonster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations', min: 1, max: 999999999,
};
// Miscellaneous
CM.ConfigData.GCTimer = {type: 'bool', group: 'Miscellaneous', label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', toggle: true, func: function() {CM.Disp.ToggleGCTimer();}};
CM.ConfigData.Favicon = {type: 'bool', group: 'Miscellaneous', label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}};
CM.ConfigData.WrinklerButtons = {type: 'bool', group: 'Miscellaneous', label: ['Extra Buttons OFF', 'Extra Buttons ON'], desc: 'Show buttons for popping wrinklers at bottom of cookie section', toggle: true, func: function() {CM.Disp.UpdateWrinklerButtons();}};
CM.Data.Config.GCTimer = {
type: 'bool', group: 'Miscellaneous', label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', toggle: true, func: function () { CM.Disp.ToggleGCTimer(); },
};
CM.Data.Config.Favicon = {
type: 'bool', group: 'Miscellaneous', label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function () { CM.Disp.UpdateFavicon(); },
};
CM.Data.Config.WrinklerButtons = {
type: 'bool', group: 'Miscellaneous', label: ['Extra Buttons OFF', 'Extra Buttons ON'], desc: 'Show buttons for popping wrinklers at bottom of cookie section', toggle: true, func: function () { CM.Disp.UpdateWrinklerButtons(); },
};
CM.Data.Config.BulkBuyBlock = {
type: 'bool', group: 'Miscellaneous', label: ['Block Bulk Buying OFF', 'Block Bulk Buying ON'], desc: "Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.", toggle: true,
};
/**
* This array describes all default settings
@@ -220,16 +433,22 @@ CM.Data.ConfigDefault = {
BotBar: 1,
TimerBar: 1,
TimerBarPos: 0,
TimerBarOverlay: 2,
BuildColor: 1,
BulkBuildColor: 0,
ColorPPBulkMode: 0,
UpBarColor: 1,
UpgradeBarFixedPos: 1,
CalcWrink: 0,
CPSMode: 1,
AvgCPSHist: 3,
AvgClicksHist: 0,
ColorPPBulkMode: 1,
PPExcludeTop: 0,
PPSecondsLowerLimit: 0,
PPOnlyConsiderBuyable: 0,
ToolWarnBon: 0,
Title: 1,
GeneralSound: 1,
GCNotification: 0,
GCFlash: 1,
GCSound: 1,
@@ -264,34 +483,90 @@ CM.Data.ConfigDefault = {
WrinklerMaxSound: 1,
WrinklerMaxVolume: 100,
WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
Title: 1,
TooltipBuildUp: 1,
TooltipBuildUpgrade: 1,
TooltipAmor: 0,
ToolWarnLucky: 1,
ToolWarnLuckyFrenzy: 1,
ToolWarnConjure: 1,
ToolWarnConjureFrenzy: 1,
ToolWarnEdifice: 1,
ToolWarnUser: 0,
ToolWarnPos: 1,
TooltipGrim: 1,
ToolWrink: 1,
TooltipWrink: 1,
TooltipLump: 1,
TooltipPlots: 1,
DragonAuraInfo: 1,
TooltipAscendButton: 1,
Stats: 1,
MissingUpgrades: 1,
UpStats: 1,
TimeFormat: 0,
DetailedTime: 1,
GrimoireBar: 1,
HeavenlyChipsTarget: 1,
ShowMissedGC: 1,
Scale: 2,
ScaleDecimals: 2,
ScaleSeparator: 0,
ScaleCutoff: 999999,
Colors: {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3', Pink: '#ff1493', Brown: '#8b4513'},
Colors: {
Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3', Pink: '#ff1493', Brown: '#8b4513',
},
SortBuildings: 0,
SortUpgrades: 0,
GCTimer: 1,
Favicon: 1,
WrinklerButtons: 1,
Header: {BarsColors: 1, Calculation: 1, Notification: 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, Spells: 1, Chain: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1},
BulkBuyBlock: 0,
Header: {
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>
`;

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
/**********
/**
* Footer *
**********/
*/
/********
/**
* Section: Functions related to base game modding API */
/**
@@ -12,15 +12,18 @@
* It starts the further initialization of CookieMonster and registers hooks
*/
CM.init = function () {
var proceed = true;
if (Game.version != CM.VersionMajor) {
proceed = 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?');
CM.Footer.isInitzializing = true;
let proceed = true;
if (Game.version !== Number(CM.VersionMajor)) {
proceed = 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?`);
}
if (proceed) {
CM.DelayInit();
CM.Main.DelayInit();
Game.registerHook('draw', CM.Disp.Draw);
Game.registerHook('logic', CM.Main.Loop);
CM.Footer.isInitzializing = false;
}
}
};
/**
* This registers a save function to the CM object. Per Game code/comments:
@@ -30,20 +33,24 @@ CM.init = function() {
CM.save = function () {
return JSON.stringify({
settings: CM.Options,
version: CM.VersionMajor + '.' + CM.VersionMinor,
version: `${CM.VersionMajor}.${CM.VersionMinor}`,
});
}
};
/**
* This registers a load function to the CM object. Per Game code/comments:
* "do stuff with the string data you saved previously"
*/
CM.load = function (str) {
let save = JSON.parse(str);
const save = JSON.parse(str);
CM.Config.LoadConfig(save.settings);
if (save.version !== `${CM.VersionMajor}.${CM.VersionMinor}`) {
if (Game.prefs.popups) Game.Popup('A new version of Cookie Monster has been loaded, check out the release notes in the info tab!');
else Game.Notify('A new version of Cookie Monster has been loaded, check out the release notes in the info tab!', '', '', 0, 1);
}
};
/********
/**
* Section: Functions related to the initialization of CookieMonster */
/**
@@ -56,20 +63,19 @@ CM.Footer.AddJscolor = function() {
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);
}
};
/**
* This functions starts the initizialization and register CookieMonster
* It is called as the last function in this script's execution
*/
if (!CM.isRunning) {
if (typeof CM.Footer.isInitzializing === 'undefined') {
CM.Footer.AddJscolor();
var delay = setInterval(function() {
const delay = setInterval(function () {
if (typeof jscolor !== 'undefined') {
jscolor.init();
Game.registerMod('CookieMonster', CM);
clearInterval(delay);
}
}, 500);
CM.isRunning = 1
}

View File

@@ -1,31 +1,18 @@
/**********
/* eslint-disable no-unused-vars */
/**
* Header *
**********/
RunCookieMonsterHeader = function() {
CM = {};
CM.Backup = {};
CM.Cache = {};
CM.Config = {};
CM.ConfigData = {};
CM.Data = {};
CM.Disp = {};
CM.Footer = {};
CM.Main = {};
CM.Options = {};
CM.Sim = {};
}
if (typeof CM == "undefined") {
RunCookieMonsterHeader();
}
*/
const CM = {
Backup: {},
Cache: {},
Config: {},
Data: { Config: {} },
Disp: {},
Footer: {},
Main: {},
Options: {},
Sim: {},
VersionMajor: '2.031',
VersionMinor: '4',
};

View File

@@ -1,215 +1,61 @@
/********
/**
* Main *
********/
CM.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(from, text, origin) {
CM.Backup.tooltip.drawMod(from, text, origin);
}
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);
}
// Assumes newer browsers
l('bigCookie').removeEventListener('click', Game.ClickCookie, false);
l('bigCookie').addEventListener('click', function() { CM.Main.FixMouseY(Game.ClickCookie); }, false);
// Probably better to load per minigame
CM.Backup.scriptLoaded = Game.scriptLoaded;
Game.scriptLoaded = function(who, script) {
CM.Backup.scriptLoaded(who, script);
CM.Disp.ReplaceTooltipGrimoire()
CM.ReplaceNativeGrimoire();
}
// TODO: Move this ReplaceTooltip function too other ReplaceTooltip functions
// OR: Move all other into this function
CM.Backup.RebuildUpgrades = Game.RebuildUpgrades;
Game.RebuildUpgrades = function() {
CM.Backup.RebuildUpgrades();
CM.Disp.ReplaceTooltipUpgrade();
Game.CalculateGains();
}
CM.Backup.DescribeDragonAura = Game.DescribeDragonAura;
/**
* This functions adds the function CM.Disp.AddAuraInfo() to Game.DescribeDragonAura()
* This adds information about CPS differences and costs to the aura choosing interface
* @param {number} aura The number of the aura currently selected by the mouse/user
*/
Game.DescribeDragonAura = function(aura) {
CM.Backup.DescribeDragonAura(aura);
CM.Disp.AddAuraInfo(aura);
}
CM.Backup.ToggleSpecialMenu = Game.ToggleSpecialMenu;
/**
* This functions adds the code to display the tooltips for the levelUp button of the dragon
* Section: Functions related to the main and initialization loop */
/**
* Main loop of Cookie Monster
* CM.init registers it to the "logic" hook provided by the modding api
*/
Game.ToggleSpecialMenu = function(on) {
CM.Backup.ToggleSpecialMenu(on);
CM.Disp.AddDragonLevelUpTooltip();
}
CM.Backup.UpdateMenu = Game.UpdateMenu;
Game.UpdateMenu = function() {
if (typeof jscolor.picker === 'undefined' || typeof jscolor.picker.owner === 'undefined') {
CM.Backup.UpdateMenu();
CM.Disp.AddMenu();
}
}
CM.Backup.sayTime = Game.sayTime;
CM.Disp.sayTime = function(time, detail) {
if (isNaN(time) || time <= 0) return CM.Backup.sayTime(time, detail);
else return CM.Disp.FormatTime(time / Game.fps, 1);
}
CM.Backup.Loop = Game.Loop;
Game.Loop = function() {
CM.Backup.Loop();
CM.Loop();
}
CM.Backup.Logic = Game.Logic;
eval('CM.Backup.LogicMod = ' + Game.Logic.toString().split('document.title').join('CM.Cache.Title'));
Game.Logic = function() {
CM.Backup.LogicMod();
// Update Title
CM.Disp.UpdateTitle();
}
}
CM.ReplaceNativeGrimoire = function() {
CM.ReplaceNativeGrimoireLaunch();
CM.ReplaceNativeGrimoireDraw();
}
CM.ReplaceNativeGrimoireLaunch = function() {
if (!CM.HasReplaceNativeGrimoireLaunch && Game.Objects['Wizard tower'].minigameLoaded) {
var minigame = Game.Objects['Wizard tower'].minigame;
CM.Backup.GrimoireLaunch = minigame.launch;
eval('CM.Backup.GrimoireLaunchMod = ' + minigame.launch.toString().split('=this').join('= Game.Objects[\'Wizard tower\'].minigame'));
Game.Objects['Wizard tower'].minigame.launch = function() {
CM.Backup.GrimoireLaunchMod();
CM.Disp.ReplaceTooltipGrimoire();
CM.HasReplaceNativeGrimoireDraw = false;
CM.ReplaceNativeGrimoireDraw();
}
CM.HasReplaceNativeGrimoireLaunch = true;
}
}
CM.ReplaceNativeGrimoireDraw = function() {
if (!CM.HasReplaceNativeGrimoireDraw && Game.Objects['Wizard tower'].minigameLoaded) {
var minigame = Game.Objects['Wizard tower'].minigame;
CM.Backup.GrimoireDraw = minigame.draw;
Game.Objects['Wizard tower'].minigame.draw = function() {
CM.Backup.GrimoireDraw();
if (CM.Options.GrimoireBar == 1 && minigame.magic < minigame.magicM) {
minigame.magicBarTextL.innerHTML += ' (' + CM.Disp.FormatTime(CM.Disp.CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, minigame.magicM)) + ')';
}
}
CM.HasReplaceNativeGrimoireDraw = true;
}
}
CM.Loop = function() {
if (CM.Disp.lastAscendState != Game.OnAscend) {
CM.Main.Loop = function () {
if (CM.Disp.lastAscendState !== Game.OnAscend) {
CM.Disp.lastAscendState = Game.OnAscend;
CM.Disp.UpdateAscendState();
}
if (!Game.OnAscend && Game.AscendTimer == 0) {
if (!Game.OnAscend && Game.AscendTimer === 0) {
// Check if any other mods have been loaded
if (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 is set whenever CPS has changed
if (CM.Sim.DoSims) {
CM.Cache.RemakeIncome();
CM.Cache.CacheIncome();
CM.Sim.NoGoldSwitchCookiesPS(); // Needed first
CM.Cache.RemakeGoldenAndWrathCookiesMults();
CM.Cache.NoGoldSwitchCPS(); // Needed first
CM.Cache.CacheGoldenAndWrathCookiesMults();
CM.Cache.CacheStats();
CM.Cache.CacheMissingUpgrades();
CM.Cache.RemakeChain();
CM.Cache.CacheChain();
CM.Cache.CacheDragonCost();
CM.Cache.RemakeSeaSpec();
CM.Cache.RemakeSellForChoEgg();
CM.Cache.CacheSeaSpec();
CM.Cache.CacheSellForChoEgg();
CM.Sim.DoSims = 0;
}
// Check for aura change to recalculate buildings prices
var hasBuildAura = Game.auraMult('Fierce Hoarder') > 0;
const hasBuildAura = Game.auraMult('Fierce Hoarder') > 0;
if (!CM.Cache.HadBuildAura && hasBuildAura) {
CM.Cache.HadBuildAura = true;
CM.Cache.DoRemakeBuildPrices = 1;
}
else if (CM.Cache.HadBuildAura && !hasBuildAura) {
} else if (CM.Cache.HadBuildAura && !hasBuildAura) {
CM.Cache.HadBuildAura = false;
CM.Cache.DoRemakeBuildPrices = 1;
}
if (CM.Cache.DoRemakeBuildPrices) {
CM.Cache.RemakeBuildingsPrices();
CM.Cache.CacheBuildingsPrices();
CM.Cache.DoRemakeBuildPrices = 0;
}
// Update Wrinkler Bank
CM.Cache.CacheWrinklers();
// Calculate PP
CM.Cache.RemakePP();
// Update colors
CM.Disp.UpdateBuildings();
CM.Disp.UpdateUpgrades();
// Redraw timers
CM.Disp.UpdateTimerBar();
// Update Bottom Bar
CM.Disp.UpdateBotBar();
// Update Tooltip
CM.Disp.UpdateTooltip();
// Update Wrinkler Tooltip
CM.Disp.CheckWrinklerTooltip();
CM.Disp.UpdateWrinklerTooltip();
// Change menu refresh interval
CM.Disp.RefreshMenu();
}
CM.Cache.LoopCache();
// Check all changing minigames and game-states
CM.Main.CheckGoldenCookie();
@@ -218,55 +64,301 @@ CM.Loop = function() {
CM.Main.CheckGardenTick();
CM.Main.CheckMagicMeter();
CM.Main.CheckWrinklerCount();
// Update Average CPS (might need to move)
CM.Cache.UpdateCurrWrinklerCPS();
CM.Cache.UpdateAvgCPS();
}
};
/**
* Initialization loop of Cookie Monster
* Called by CM.init()
*/
CM.Main.DelayInit = function () {
// Create CM.Sim functions
CM.Sim.CreateSimFunctions();
CM.DelayInit = function() {
CM.Sim.InitData();
CM.Cache.InitCache();
// Stored to check if we need to re-initiliaze data
CM.Main.LastModCount = Object.keys(Game.mods).length;
// Creating visual elements
CM.Disp.CreateCssArea();
CM.Disp.CreateBotBar();
CM.Disp.CreateTimerBar();
CM.Disp.CreateUpgradeBar();
CM.Disp.CreateWhiteScreen();
CM.Disp.CreateFavicon();
for (var i in CM.Disp.TooltipText) {
for (const i of Object.keys(CM.Disp.TooltipText)) {
CM.Disp.CreateSimpleTooltip(CM.Disp.TooltipText[i][0], CM.Disp.TooltipText[i][1], CM.Disp.TooltipText[i][2]);
}
CM.Disp.CreateWrinklerButtons();
CM.Disp.ReplaceTooltipBuild();
CM.Disp.ReplaceTooltipGrimoire();
CM.Disp.ReplaceTooltipLump();
CM.Disp.UpdateBuildingUpgradeStyle();
CM.Main.ReplaceTooltips();
CM.Main.AddWrinklerAreaDetect();
CM.Cache.InitCookiesDiff();
CM.ReplaceNative();
CM.ReplaceNativeGrimoire();
// Replace native functions
CM.Main.ReplaceNative();
CM.Main.ReplaceNativeGrimoire();
Game.CalculateGains();
CM.Config.LoadConfig(); // Must be after all things are created!
CM.Disp.lastAscendState = Game.OnAscend;
CM.Disp.lastBuyMode = Game.buyMode;
CM.Disp.lastBuyBulk = Game.buyBulk;
if (Game.prefs.popups) Game.Popup('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!');
else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!', '', '', 1, 1);
// given the architecture of your code, you probably want these lines somewhere else,
// but I stuck them here for convenience
l("products").style.display = "grid";
l("storeBulk").style.gridRow = "1/1";
l("upgrades").style.display = "flex";
l("upgrades").style["flex-wrap"] = "wrap";
if (Game.prefs.popups) Game.Popup(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} loaded!`);
else Game.Notify(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} loaded!`, '', '', 1, 1);
Game.Win('Third-party');
}
};
/********
* Section: Functions related to checking for changes in Minigames/GC's/Ticker
* TODO: Possibly move this section */
/**
* Section: Functions related to replacing stuff */
/**
* This function replaces certain native (from the base-game) functions
* It is called by CM.Main.DelayInit()
*/
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 (from, text, origin) {
CM.Backup.tooltip.drawMod(from, text, origin);
};
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);
};
// Assumes newer browsers
l('bigCookie').removeEventListener('click', Game.ClickCookie, false);
l('bigCookie').addEventListener('click', function () { CM.Main.FixMouseY(Game.ClickCookie); }, false);
CM.Backup.RebuildUpgrades = Game.RebuildUpgrades;
Game.RebuildUpgrades = function () {
CM.Backup.RebuildUpgrades();
CM.Disp.ReplaceTooltipUpgrade();
Game.CalculateGains();
};
CM.Backup.ClickProduct = Game.ClickProduct;
/**
* This function adds a check to the purchase of a building to allow BulkBuyBlock to work.
* If the options is 1 (on) bulkPrice is under cookies you can't buy the building.
*/
Game.ClickProduct = function (what) {
if (!CM.Options.BulkBuyBlock || Game.ObjectsById[what].bulkPrice < Game.cookies) {
CM.Backup.ClickProduct(what);
}
};
CM.Backup.DescribeDragonAura = Game.DescribeDragonAura;
/**
* This function adds the function CM.Disp.AddAuraInfo() to Game.DescribeDragonAura()
* This adds information about CPS differences and costs to the aura choosing interface
* @param {number} aura The number of the aura currently selected by the mouse/user
*/
Game.DescribeDragonAura = function (aura) {
CM.Backup.DescribeDragonAura(aura);
CM.Disp.AddAuraInfo(aura);
};
CM.Backup.ToggleSpecialMenu = Game.ToggleSpecialMenu;
/**
* This function adds the code to display the tooltips for the levelUp button of the dragon
*/
Game.ToggleSpecialMenu = function (on) {
CM.Backup.ToggleSpecialMenu(on);
CM.Disp.AddDragonLevelUpTooltip();
};
CM.Backup.UpdateMenu = Game.UpdateMenu;
Game.UpdateMenu = function () {
if (typeof jscolor.picker === 'undefined' || typeof jscolor.picker.owner === 'undefined') {
CM.Backup.UpdateMenu();
CM.Disp.AddMenu();
}
};
CM.Backup.sayTime = Game.sayTime;
CM.Disp.sayTime = function (time, detail) {
if (Number.isNaN(time) || time <= 0) return CM.Backup.sayTime(time, detail);
else return CM.Disp.FormatTime(time / Game.fps, 1);
};
// Since the Ascend Tooltip is not actually a tooltip we need to add our additional info here...
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();
// Update Title
CM.Disp.UpdateTitle();
};
};
/**
* This function fixes replaces the Launch and Draw functions of the Grimoire
* It is called by CM.Main.DelayInit() and Game.LoadMinigames()
*/
CM.Main.ReplaceNativeGrimoire = function () {
CM.Main.ReplaceNativeGrimoireLaunch();
CM.Main.ReplaceNativeGrimoireDraw();
};
/**
* This function fixes replaces the .launch function of the Grimoire
* It is called by CM.Main.ReplaceNativeGrimoire()
*/
CM.Main.ReplaceNativeGrimoireLaunch = function () {
if (!CM.Main.HasReplaceNativeGrimoireLaunch && Game.Objects['Wizard tower'].minigameLoaded) {
const minigame = Game.Objects['Wizard tower'].minigame;
CM.Backup.GrimoireLaunch = minigame.launch;
eval(`CM.Backup.GrimoireLaunchMod = ${minigame.launch.toString().split('=this').join('= Game.Objects[\'Wizard tower\'].minigame')}`);
Game.Objects['Wizard tower'].minigame.launch = function () {
CM.Backup.GrimoireLaunchMod();
CM.Main.ReplaceTooltipGrimoire();
CM.HasReplaceNativeGrimoireDraw = false;
CM.Main.ReplaceNativeGrimoireDraw();
};
CM.Main.HasReplaceNativeGrimoireLaunch = true;
}
};
/**
* This function fixes replaces the .draw function of the Grimoire
* It is called by CM.Main.ReplaceNativeGrimoire()
*/
CM.Main.ReplaceNativeGrimoireDraw = function () {
if (!CM.Main.HasReplaceNativeGrimoireDraw && Game.Objects['Wizard tower'].minigameLoaded) {
const minigame = Game.Objects['Wizard tower'].minigame;
CM.Backup.GrimoireDraw = minigame.draw;
Game.Objects['Wizard tower'].minigame.draw = function () {
CM.Backup.GrimoireDraw();
if (CM.Options.GrimoireBar === 1 && minigame.magic < minigame.magicM) {
minigame.magicBarTextL.innerHTML += ` (${CM.Disp.FormatTime(CM.Disp.CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, minigame.magicM))})`;
}
};
CM.Main.HasReplaceNativeGrimoireDraw = true;
}
};
/**
* Section: Functions related to first initizalition of CM */
/**
* This function call all functions that replace Game-tooltips with CM-enhanced tooltips
* It is called by CM.Main.DelayInit()
*/
CM.Main.ReplaceTooltips = function () {
CM.Main.ReplaceTooltipBuild();
CM.Main.ReplaceTooltipLump();
// Replace Tooltips of Minigames. Nesting it in LoadMinigames makes sure to replace them even if
// they were not loaded initially
CM.Backup.LoadMinigames = Game.LoadMinigames;
Game.LoadMinigames = function () {
CM.Backup.LoadMinigames();
CM.Main.ReplaceTooltipGarden();
CM.Main.ReplaceTooltipGrimoire();
CM.Main.ReplaceNativeGrimoire();
};
Game.LoadMinigames();
};
/**
* Section: Functions related to replacing tooltips */
/**
* This function replaces the original .onmouseover functions of buildings so that it calls CM.Disp.Tooltip()
* CM.Disp.Tooltip() sets the tooltip type to 'b'
* It is called by CM.Main.ReplaceTooltips()
*/
CM.Main.ReplaceTooltipBuild = function () {
CM.Main.TooltipBuildBackup = [];
for (const i of Object.keys(Game.Objects)) {
const me = Game.Objects[i];
if (l(`product${me.id}`).onmouseover !== null) {
CM.Main.TooltipBuildBackup[i] = l(`product${me.id}`).onmouseover;
eval(`l('product' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip('b', '${i}');}, 'store'); Game.tooltip.wobble();}`);
}
}
};
/**
* This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip()
* CM.Disp.Tooltip() sets the tooltip type to 's'
* It is called by CM.Main.ReplaceTooltips()
*/
CM.Main.ReplaceTooltipLump = function () {
if (Game.canLumps()) {
CM.Main.TooltipLumpBackup = l('lumps').onmouseover;
eval('l(\'lumps\').onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'s\', \'Lump\');}, \'this\'); Game.tooltip.wobble();}');
}
};
/**
* This function replaces the original .onmouseover functions of the Grimoire minigame so that it calls CM.Disp.Tooltip()
* CM.Disp.Tooltip() sets the tooltip type to 'g'
* It is called by CM.Main.ReplaceTooltips()
*/
CM.Main.ReplaceTooltipGrimoire = function () {
if (Game.Objects['Wizard tower'].minigameLoaded) {
CM.Main.TooltipGrimoireBackup = [];
for (const i in Game.Objects['Wizard tower'].minigame.spellsById) {
if (l(`grimoireSpell${i}`).onmouseover !== null) {
CM.Main.TooltipGrimoireBackup[i] = l(`grimoireSpell${i}`).onmouseover;
eval(`l('grimoireSpell' + i).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip('g', '${i}');}, 'this'); Game.tooltip.wobble();}`);
}
}
}
};
/**
* This function replaces the original .onmouseover functions of all garden plants so that it calls CM.Disp.Tooltip()
* CM.Disp.Tooltip() sets the tooltip type to 'p'
* It is called by CM.Main.ReplaceTooltips()
*/
CM.Main.ReplaceTooltipGarden = function () {
if (Game.Objects.Farm.minigameLoaded) {
l('gardenTool-1').onmouseover = function () { Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function () { return CM.Disp.Tooltip('ha', 'HarvestAllButton'); }, 'this'); Game.tooltip.wobble(); };
Array.from(l('gardenPlot').children).forEach((child) => {
const coords = child.id.slice(-3);
child.onmouseover = function () { Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function () { return CM.Disp.Tooltip('p', [`${coords[0]}`, `${coords[2]}`]); }, 'this'); Game.tooltip.wobble(); };
});
}
};
/**
* Section: Functions related to checking for changes in Minigames/GC's/Ticker */
/**
* Auxilirary function that finds all currently spawned shimmers.
@@ -275,174 +367,170 @@ CM.DelayInit = function() {
*/
CM.Main.FindShimmer = function () {
CM.Main.currSpawnedGoldenCookieState = 0;
CM.Cache.goldenShimmersByID = {}
for (var i in Game.shimmers) {
CM.Cache.goldenShimmersByID[Game.shimmers[i].id] = Game.shimmers[i]
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type == 'golden') {
CM.Cache.goldenShimmersByID = {};
for (const i of Object.keys(Game.shimmers)) {
CM.Cache.goldenShimmersByID[Game.shimmers[i].id] = Game.shimmers[i];
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'golden') {
CM.Cache.spawnedGoldenShimmer = Game.shimmers[i];
CM.Main.currSpawnedGoldenCookieState += 1;
}
}
}
};
/**
* This function checks for changes in the amount of Golden Cookies
* It is called by CM.Loop
* TODO: Remove the delete function, as it does not delete correctly and crowds CM.Disp.GCTimers
* It is called by CM.Main.Loop
*/
CM.Main.CheckGoldenCookie = function () {
CM.Main.FindShimmer();
for (var i in CM.Disp.GCTimers) {
if (typeof CM.Cache.goldenShimmersByID[i] == "undefined") {
for (const i of Object.keys(CM.Disp.GCTimers)) {
if (typeof CM.Cache.goldenShimmersByID[i] === 'undefined') {
CM.Disp.GCTimers[i].parentNode.removeChild(CM.Disp.GCTimers[i]);
// TODO remove delete here
delete CM.Disp.GCTimers[i];
}
}
if (CM.Main.lastGoldenCookieState != Game.shimmerTypes['golden'].n) {
CM.Main.lastGoldenCookieState = Game.shimmerTypes['golden'].n;
if (CM.Main.lastGoldenCookieState !== Game.shimmerTypes.golden.n) {
CM.Main.lastGoldenCookieState = Game.shimmerTypes.golden.n;
if (CM.Main.lastGoldenCookieState) {
if (CM.Main.lastSpawnedGoldenCookieState < CM.Main.currSpawnedGoldenCookieState) {
CM.Disp.Flash(3, 'GCFlash');
CM.Disp.PlaySound(CM.Options.GCSoundURL, 'GCSound', 'GCVolume');
CM.Disp.Notification('GCNotification', "Golden Cookie Spawned", "A Golden Cookie has spawned. Click it now!")
CM.Disp.Notification('GCNotification', 'Golden Cookie Spawned', 'A Golden Cookie has spawned. Click it now!');
}
for (var i in Game.shimmers) {
if (typeof CM.Disp.GCTimers[Game.shimmers[i].id] == "undefined") {
for (const i of Object.keys(Game.shimmers)) {
if (typeof CM.Disp.GCTimers[Game.shimmers[i].id] === 'undefined') {
CM.Disp.CreateGCTimer(Game.shimmers[i]);
}
}
}
CM.Disp.UpdateFavicon();
CM.Main.lastSpawnedGoldenCookieState = CM.Main.currSpawnedGoldenCookieState;
if (CM.Main.currSpawnedGoldenCookieState == 0) CM.Cache.spawnedGoldenShimmer = 0;
}
else if (CM.Options.GCTimer == 1 && CM.Main.lastGoldenCookieState) {
for (var i in CM.Disp.GCTimers) {
if (CM.Main.currSpawnedGoldenCookieState === 0) CM.Cache.spawnedGoldenShimmer = 0;
} else if (CM.Options.GCTimer === 1 && CM.Main.lastGoldenCookieState) {
for (const i of Object.keys(CM.Disp.GCTimers)) {
CM.Disp.GCTimers[i].style.opacity = CM.Cache.goldenShimmersByID[i].l.style.opacity;
CM.Disp.GCTimers[i].style.transform = CM.Cache.goldenShimmersByID[i].l.style.transform;
CM.Disp.GCTimers[i].textContent = Math.ceil(CM.Cache.goldenShimmersByID[i].life / Game.fps);
}
}
}
};
/**
* This function checks if there is reindeer that has spawned
* It is called by CM.Loop
* It is called by CM.Main.Loop
*/
CM.Main.CheckSeasonPopup = function () {
if (CM.Main.lastSeasonPopupState != Game.shimmerTypes['reindeer'].spawned) {
CM.Main.lastSeasonPopupState = Game.shimmerTypes['reindeer'].spawned;
for (var i in Game.shimmers) {
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type == 'reindeer') {
if (CM.Main.lastSeasonPopupState !== Game.shimmerTypes.reindeer.spawned) {
CM.Main.lastSeasonPopupState = Game.shimmerTypes.reindeer.spawned;
for (const i of Object.keys(Game.shimmers)) {
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'reindeer') {
CM.Cache.seasonPopShimmer = Game.shimmers[i];
break;
}
}
CM.Disp.Flash(3, 'SeaFlash');
CM.Disp.PlaySound(CM.Options.SeaSoundURL, 'SeaSound', 'SeaVolume');
CM.Disp.Notification('SeaNotification',"Reindeer sighted!", "A Reindeer has spawned. Click it now!")
}
CM.Disp.Notification('SeaNotification', 'Reindeer sighted!', 'A Reindeer has spawned. Click it now!');
}
};
/**
* This function checks if there is a fortune cookie on the ticker
* It is called by CM.Loop
* It is called by CM.Main.Loop
*/
CM.Main.CheckTickerFortune = function () {
if (CM.Main.lastTickerFortuneState != (Game.TickerEffect && Game.TickerEffect.type == 'fortune')) {
CM.Main.lastTickerFortuneState = (Game.TickerEffect && Game.TickerEffect.type == 'fortune');
if (CM.Main.lastTickerFortuneState !== (Game.TickerEffect && Game.TickerEffect.type === 'fortune')) {
CM.Main.lastTickerFortuneState = (Game.TickerEffect && Game.TickerEffect.type === 'fortune');
if (CM.Main.lastTickerFortuneState) {
CM.Disp.Flash(3, 'FortuneFlash');
CM.Disp.PlaySound(CM.Options.FortuneSoundURL, 'FortuneSound', 'FortuneVolume');
CM.Disp.Notification('FortuneNotification', "Fortune Cookie found", "A Fortune Cookie has appeared on the Ticker.")
}
CM.Disp.Notification('FortuneNotification', 'Fortune Cookie found', 'A Fortune Cookie has appeared on the Ticker.');
}
}
};
/**
* This function checks if a garden tick has happened
* It is called by CM.Loop
* It is called by CM.Main.Loop
*/
CM.Main.CheckGardenTick = function () {
if (Game.Objects['Farm'].minigameLoaded && CM.Main.lastGardenNextStep != Game.Objects['Farm'].minigame.nextStep) {
if (CM.Main.lastGardenNextStep != 0 && CM.Main.lastGardenNextStep < Date.now()) {
if (Game.Objects.Farm.minigameLoaded && CM.Main.lastGardenNextStep !== Game.Objects.Farm.minigame.nextStep) {
if (CM.Main.lastGardenNextStep !== 0 && CM.Main.lastGardenNextStep < Date.now()) {
CM.Disp.Flash(3, 'GardFlash');
CM.Disp.PlaySound(CM.Options.GardSoundURL, 'GardSound', 'GardVolume');
}
CM.Main.lastGardenNextStep = Game.Objects['Farm'].minigame.nextStep;
}
CM.Main.lastGardenNextStep = Game.Objects.Farm.minigame.nextStep;
}
};
/**
* This function checks if the magic meter is full
* It is called by CM.Loop
* It is called by CM.Main.Loop
*/
CM.Main.CheckMagicMeter = function () {
if (Game.Objects['Wizard tower'].minigameLoaded && CM.Options.GrimoireBar == 1) {
var minigame = Game.Objects['Wizard tower'].minigame;
if (Game.Objects['Wizard tower'].minigameLoaded && CM.Options.GrimoireBar === 1) {
const minigame = Game.Objects['Wizard tower'].minigame;
if (minigame.magic < minigame.magicM) CM.Main.lastMagicBarFull = false;
else if (!CM.Main.lastMagicBarFull) {
CM.Main.lastMagicBarFull = true;
CM.Disp.Flash(3, 'MagicFlash');
CM.Disp.PlaySound(CM.Options.MagicSoundURL, 'MagicSound', 'MagicVolume');
CM.Disp.Notification('MagicNotification', "Magic Meter full", "Your Magic Meter is full. Cast a spell!")
}
CM.Disp.Notification('MagicNotification', 'Magic Meter full', 'Your Magic Meter is full. Cast a spell!');
}
}
};
/**
* This function checks if any new Wrinklers have popped up
* It is called by CM.Loop
* It is called by CM.Main.Loop
*/
CM.Main.CheckWrinklerCount = function () {
if (Game.elderWrath > 0) {
var CurrentWrinklers = 0;
for (var i in Game.wrinklers) {
if (Game.wrinklers[i].phase == 2) CurrentWrinklers++;
let CurrentWrinklers = 0;
for (const i in Game.wrinklers) {
if (Game.wrinklers[i].phase === 2) CurrentWrinklers++;
}
if (CurrentWrinklers > CM.Main.lastWrinklerCount) {
CM.Main.lastWrinklerCount = CurrentWrinklers
if (CurrentWrinklers == Game.getWrinklersMax() && CM.Options.WrinklerMaxFlash) {
CM.Main.lastWrinklerCount = CurrentWrinklers;
if (CurrentWrinklers === Game.getWrinklersMax() && CM.Options.WrinklerMaxFlash) {
CM.Disp.Flash(3, 'WrinklerMaxFlash');
} else {
CM.Disp.Flash(3, 'WrinklerFlash');
}
if (CurrentWrinklers == Game.getWrinklersMax() && CM.Options.WrinklerMaxSound) {
if (CurrentWrinklers === Game.getWrinklersMax() && CM.Options.WrinklerMaxSound) {
CM.Disp.PlaySound(CM.Options.WrinklerMaxSoundURL, 'WrinklerMaxSound', 'WrinklerMaxVolume');
} else {
CM.Disp.PlaySound(CM.Options.WrinklerSoundURL, 'WrinklerSound', 'WrinklerVolume');
}
if (CurrentWrinklers == Game.getWrinklersMax() && CM.Options.WrinklerMaxNotification) {
CM.Disp.Notification('WrinklerMaxNotification', "Maximum Wrinklers Reached", "You have reached your maximum ammount of wrinklers")
if (CurrentWrinklers === Game.getWrinklersMax() && CM.Options.WrinklerMaxNotification) {
CM.Disp.Notification('WrinklerMaxNotification', 'Maximum Wrinklers Reached', 'You have reached your maximum ammount of wrinklers');
} else {
CM.Disp.Notification('WrinklerNotification', "A Wrinkler appeared", "A new wrinkler has appeared")
CM.Disp.Notification('WrinklerNotification', 'A Wrinkler appeared', 'A new wrinkler has appeared');
}
} else {
CM.Main.lastWrinklerCount = CurrentWrinklers
}
CM.Main.lastWrinklerCount = CurrentWrinklers;
}
}
};
/**
* This function creates .onmouseover/out events that determine if the mouse is hovering-over a Wrinkler
* It is called by CM.DelayInit
* TODO: The system for displaying wrinklers should ideally use a similar system as other tooltips
* Thus, writing a CM.Disp.ReplaceTooltipWrinkler function etc.
* It is called by CM.Main.DelayInit
* As wrinklers are not appended to the DOM we us a different system than for other tooltips
*/
CM.Main.AddWrinklerAreaDetect = function () {
l('backgroundLeftCanvas').onmouseover = function () { CM.Disp.TooltipWrinklerArea = 1; };
l('backgroundLeftCanvas').onmouseout = function () {
CM.Disp.TooltipWrinklerArea = 0;
Game.tooltip.hide();
for (var i in Game.wrinklers) {
for (const i of Object.keys(Game.wrinklers)) {
CM.Disp.TooltipWrinklerBeingShown[i] = 0;
}
};
}
};
/********
/**
* Section: Functions related to the mouse */
/**
@@ -451,31 +539,12 @@ CM.Main.AddWrinklerAreaDetect = function() {
* before execution of their actual function
*/
CM.Main.FixMouseY = function (target) {
if (CM.Options.TimerBar == 1 && CM.Options.TimerBarPos == 0) {
var timerBarHeight = parseInt(CM.Disp.TimerBar.style.height);
if (CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 0) {
const timerBarHeight = parseInt(CM.Disp.TimerBar.style.height);
Game.mouseY -= timerBarHeight;
target();
Game.mouseY += timerBarHeight;
}
else {
} else {
target();
}
}
CM.HasReplaceNativeGrimoireLaunch = false;
CM.HasReplaceNativeGrimoireDraw = false;
CM.Main.lastGoldenCookieState = 0;
CM.Main.lastSpawnedGoldenCookieState = 0;
CM.Main.currSpawnedGoldenCookieState
CM.Main.lastTickerFortuneState = 0;
CM.Main.lastSeasonPopupState = 0;
CM.Main.lastGardenNextStep = 0;
CM.Main.lastMagicBarFull = 0;
CM.Main.lastWrinklerCount = 0;
CM.ConfigPrefix = 'CMConfig';
CM.VersionMajor = '2.031';
CM.VersionMinor = '3';
};

File diff suppressed because it is too large Load Diff