Compare commits
638 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3617d5fc2 | ||
|
|
71f16eb6e1 | ||
|
|
4cf847376f | ||
|
|
ab3a4b37bc | ||
|
|
fcd5588a03 | ||
|
|
08faf9f198 | ||
|
|
3ad492c23f | ||
|
|
081a8317f9 | ||
|
|
ab4012b5ad | ||
|
|
4a552352c8 | ||
|
|
19903378f2 | ||
|
|
ef05396841 | ||
|
|
9281ec7e8c | ||
|
|
2fcb7c0f66 | ||
|
|
e6596713b9 | ||
|
|
a1c1209386 | ||
|
|
e0c7643671 | ||
|
|
b854773766 | ||
|
|
e139f9d500 | ||
|
|
6d60ffb139 | ||
|
|
ad61e8cf09 | ||
|
|
5dffa1c2ac | ||
|
|
69f972fac2 | ||
|
|
9ead87dd16 | ||
|
|
e2d5c7e6e2 | ||
|
|
e4e364ade3 | ||
|
|
6ca617381a | ||
|
|
69a151a25a | ||
|
|
fdc94dd2db | ||
|
|
c02d2c10d1 | ||
|
|
963116ba2f | ||
|
|
f1183801a8 | ||
|
|
db19976e3e | ||
|
|
894f4359cd | ||
|
|
8cb3c43188 | ||
|
|
88d7b11b87 | ||
|
|
af5a44eb9a | ||
|
|
fd77e84a90 | ||
|
|
43fb9112a7 | ||
|
|
f3ceec3c91 | ||
|
|
b3c2eaeb3e | ||
|
|
717f106468 | ||
|
|
50911eb01a | ||
|
|
12657df5cf | ||
|
|
bef40336a5 | ||
|
|
d9c2f3f432 | ||
|
|
59f8808b61 | ||
|
|
d3aa2c30db | ||
|
|
1e92ff6b92 | ||
|
|
ebbb552100 | ||
|
|
67535eaa4c | ||
|
|
ca46c10c55 | ||
|
|
cfb7659c1f | ||
|
|
1ebc8cacc6 | ||
|
|
e9ced31639 | ||
|
|
c4c95eaa31 | ||
|
|
b7c47bbe6c | ||
|
|
f5ea276a63 | ||
|
|
9357e16dec | ||
|
|
1aecb8a8e1 | ||
|
|
eb99ba1b78 | ||
|
|
6f67c171f4 | ||
|
|
88b58f209f | ||
|
|
25250e8c46 | ||
|
|
cfa32ef295 | ||
|
|
1de5dd27dd | ||
|
|
1c4e988e90 | ||
|
|
e3f58e2e73 | ||
|
|
e85a775468 | ||
|
|
7af043bc55 | ||
|
|
2b28cd64b1 | ||
|
|
a24c666993 | ||
|
|
39b1ec6db4 | ||
|
|
11732b10aa | ||
|
|
346bf2b353 | ||
|
|
e2ad102bb4 | ||
|
|
975650fad6 | ||
|
|
e864dee788 | ||
|
|
76718f8c74 | ||
|
|
66e61614dd | ||
|
|
c061ed5b9e | ||
|
|
4c009df819 | ||
|
|
d1336efb90 | ||
|
|
fec72bbf91 | ||
|
|
1cd430f814 | ||
|
|
a025fe51d7 | ||
|
|
df8957338b | ||
|
|
4d0b5097fd | ||
|
|
8ceef4cf2d | ||
|
|
bc6e6eb110 | ||
|
|
f3e84d0920 | ||
|
|
e9d7fc800f | ||
|
|
f6461642e9 | ||
|
|
769f7f18dd | ||
|
|
9e21fc8586 | ||
|
|
5f9b990854 | ||
|
|
8724a2a334 | ||
|
|
a801e79790 | ||
|
|
0cd64198ed | ||
|
|
60859a774e | ||
|
|
cdff551384 | ||
|
|
a200763a6e | ||
|
|
e5d8aabb66 | ||
|
|
e2afebe1c8 | ||
|
|
3e4b9a0dd3 | ||
|
|
fd02f172dc | ||
|
|
59061a5af0 | ||
|
|
5f35ccc76b | ||
|
|
7e1597dae2 | ||
|
|
968353d3fa | ||
|
|
d29096bf72 | ||
|
|
9e696cafb1 | ||
|
|
545a1a3102 | ||
|
|
c602ea5f45 | ||
|
|
bbdbbfb667 | ||
|
|
d9e0e46e64 | ||
|
|
2608ff9149 | ||
|
|
0e7880816e | ||
|
|
4e238e800c | ||
|
|
8c6de64ac9 | ||
|
|
ca676c3b6a | ||
|
|
425d640592 | ||
|
|
9c61d62a8f | ||
|
|
f4becd6a91 | ||
|
|
d07964cfc5 | ||
|
|
6519497ffc | ||
|
|
4dd640ef4b | ||
|
|
2d9af222c1 | ||
|
|
416637bac3 | ||
|
|
f7de9831e5 | ||
|
|
e4113d21e1 | ||
|
|
f4711c74da | ||
|
|
33d0478ca9 | ||
|
|
ac457ed8dc | ||
|
|
efcaccfb26 | ||
|
|
63a38e564c | ||
|
|
2491f7a7cc | ||
|
|
8deb0c435d | ||
|
|
6ed19f23e6 | ||
|
|
13e1233e0f | ||
|
|
d3af77e2c8 | ||
|
|
b628d20363 | ||
|
|
63139933ce | ||
|
|
0547381845 | ||
|
|
455e99e2ab | ||
|
|
b2ae7c71cf | ||
|
|
eee663f414 | ||
|
|
3dd2e65092 | ||
|
|
16ad8f78dc | ||
|
|
ce5b7940e4 | ||
|
|
7b8e29e346 | ||
|
|
5e5e8f5e22 | ||
|
|
d228967fe7 | ||
|
|
b3757c452a | ||
|
|
6c852e2c50 | ||
|
|
5abdc77e30 | ||
|
|
5af7be93e3 | ||
|
|
0171732e70 | ||
|
|
00c513798a | ||
|
|
235900c826 | ||
|
|
abc7dce047 | ||
|
|
61fc4aaaef | ||
|
|
4649ab87c6 | ||
|
|
7186be028b | ||
|
|
e6728157b3 | ||
|
|
843bb00f34 | ||
|
|
1a73fb8a2d | ||
|
|
1aa6d3797b | ||
|
|
31ea583edb | ||
|
|
b4cb0fee52 | ||
|
|
6dd4022a80 | ||
|
|
d30a064c69 | ||
|
|
cb91c91321 | ||
|
|
93e50181fe | ||
|
|
3b137aa882 | ||
|
|
1d51a36ccd | ||
|
|
30f6ecf8f2 | ||
|
|
1d639a9721 | ||
|
|
19260f9361 | ||
|
|
94ba7487b1 | ||
|
|
cd3a9caab5 | ||
|
|
45c3df2d4b | ||
|
|
80e3ac746a | ||
|
|
52cfd9ddc2 | ||
|
|
ffa664c476 | ||
|
|
a9dfcaab75 | ||
|
|
91a2edf348 | ||
|
|
f450ae98ae | ||
|
|
cd90b15fa3 | ||
|
|
8a3eac78d4 | ||
|
|
cdfb35aa1b | ||
|
|
23f19b4d62 | ||
|
|
ab08bc60e7 | ||
|
|
b48834e416 | ||
|
|
2f12f9839a | ||
|
|
c62b514f0a | ||
|
|
125113133a | ||
|
|
e5bd08c0c4 | ||
|
|
abfeabf08f | ||
|
|
d958fc08bf | ||
|
|
1372942705 | ||
|
|
e64e41e523 | ||
|
|
fda6e65176 | ||
|
|
7795aa79a5 | ||
|
|
b6069e2358 | ||
|
|
a7af602aa3 | ||
|
|
f36dcf012a | ||
|
|
5a64ed45be | ||
|
|
e5b24b393e | ||
|
|
92c28b092b | ||
|
|
d5c5a5f62e | ||
|
|
867249e8cb | ||
|
|
28e28fd5a0 | ||
|
|
5f93186e7d | ||
|
|
0a57450815 | ||
|
|
c08cefd1a6 | ||
|
|
51ab15f2ec | ||
|
|
8505b1621d | ||
|
|
901bc7c61f | ||
|
|
192c5d105c | ||
|
|
519e67dce9 | ||
|
|
c184d8b7a7 | ||
|
|
55c6b5db8b | ||
|
|
6df4abf945 | ||
|
|
242c6ba754 | ||
|
|
00f79cb073 | ||
|
|
c64f42bcfa | ||
|
|
29ba1c66cf | ||
|
|
1875423a7b | ||
|
|
62f8e1fe82 | ||
|
|
f257243b38 | ||
|
|
d71c197ec9 | ||
|
|
0ccd16577f | ||
|
|
7c9d6f570d | ||
|
|
2648af3095 | ||
|
|
cb284ed22d | ||
|
|
5f5a1abac0 | ||
|
|
66429ff0d2 | ||
|
|
c997ace2cf | ||
|
|
9e0dac5413 | ||
|
|
4a3bb46f8b | ||
|
|
69fb8af639 | ||
|
|
ad7d35e1ee | ||
|
|
2bedae477d | ||
|
|
91ebbf39b9 | ||
|
|
a8b874f37d | ||
|
|
b58c3ea292 | ||
|
|
cafa12204e | ||
|
|
b4e2236fb7 | ||
|
|
5d126b6be3 | ||
|
|
b6cd262ff2 | ||
|
|
6edda5420f | ||
|
|
97014d273e | ||
|
|
319a3102de | ||
|
|
b9a1a5444f | ||
|
|
3f405da833 | ||
|
|
9a649f93d2 | ||
|
|
d89c8e3a0f | ||
|
|
6bb99ace11 | ||
|
|
68c30e7bdd | ||
|
|
3ca1018a51 | ||
|
|
aed9b75397 | ||
|
|
0c095e4d81 | ||
|
|
2f430e82e1 | ||
|
|
56d23aae22 | ||
|
|
c1501b47d6 | ||
|
|
63ddf7fa38 | ||
|
|
798f61cafe | ||
|
|
72aef84fcc | ||
|
|
203dc8137e | ||
|
|
e6118f14c2 | ||
|
|
1cffb822fb | ||
|
|
1a0f9ed1a2 | ||
|
|
ca0889790d | ||
|
|
5fc662980a | ||
|
|
5d5256bfc9 | ||
|
|
0f5f244fdc | ||
|
|
1715306374 | ||
|
|
a05c9290de | ||
|
|
51617c9777 | ||
|
|
f7bf34d7af | ||
|
|
07d73b10e3 | ||
|
|
0f865f3897 | ||
|
|
389dae4daa | ||
|
|
c6c54054ee | ||
|
|
2246e31bb5 | ||
|
|
7cfdcc7662 | ||
|
|
938e850e29 | ||
|
|
d3a4eb936a | ||
|
|
c4295a1ed0 | ||
|
|
30c4617bde | ||
|
|
37b378ad08 | ||
|
|
90a79dbc0c | ||
|
|
7164801156 | ||
|
|
c530bd1a4a | ||
|
|
7d7516bb21 | ||
|
|
28fbb1e094 | ||
|
|
ff30cc2818 | ||
|
|
9542093f1b | ||
|
|
208c99baf5 | ||
|
|
5e4471d929 | ||
|
|
2a5fb05a2f | ||
|
|
8aa8a7c878 | ||
|
|
0ae29ce2e8 | ||
|
|
367702dc00 | ||
|
|
73ca07a0e9 | ||
|
|
bd59f7b4a9 | ||
|
|
f6f2f99966 | ||
|
|
04714f22ac | ||
|
|
b65f31bee1 | ||
|
|
7a094a8990 | ||
|
|
e230a3c89e | ||
|
|
a8002f29e3 | ||
|
|
05e84d42d3 | ||
|
|
556e71434d | ||
|
|
101c309cec | ||
|
|
8037615659 | ||
|
|
fcadf1cc18 | ||
|
|
671ff61830 | ||
|
|
2fbbd39118 | ||
|
|
cff7377789 | ||
|
|
583501e01b | ||
|
|
10482dfd2d | ||
|
|
08b30e9c62 | ||
|
|
6098a398f0 | ||
|
|
b80d2b63e8 | ||
|
|
a867d3d896 | ||
|
|
f398aa9564 | ||
|
|
6a6a27680f | ||
|
|
15b859e8b9 | ||
|
|
f13c9fb02d | ||
|
|
f72e95301c | ||
|
|
8ffc0a2664 | ||
|
|
f9c4f68bb8 | ||
|
|
6bf81085ca | ||
|
|
ea4776ae4b | ||
|
|
efd4e9319d | ||
|
|
f30ebd081e | ||
|
|
2f761dfce8 | ||
|
|
88792454c2 | ||
|
|
8805eacb0e | ||
|
|
62d05ea074 | ||
|
|
759d665019 | ||
|
|
b462ed2ced | ||
|
|
eb7a710464 | ||
|
|
7c08431271 | ||
|
|
534e744532 | ||
|
|
0d9f45a537 | ||
|
|
e066c8c43b | ||
|
|
bbc2fdf29f | ||
|
|
b6370c1873 | ||
|
|
bf8e1922cb | ||
|
|
87a85bfc59 | ||
|
|
7e101edf82 | ||
|
|
36e64d3d90 | ||
|
|
6c5821593f | ||
|
|
1b88b70c72 | ||
|
|
15d467992d | ||
|
|
15e4291489 | ||
|
|
7cd62e1735 | ||
|
|
d0ad7c418d | ||
|
|
77447cfca3 | ||
|
|
28b144ee70 | ||
|
|
b6cdc77064 | ||
|
|
e0915bc307 | ||
|
|
7e935aab1a | ||
|
|
9dc95d760a | ||
|
|
f3ea56f34d | ||
|
|
9ce42f2f3c | ||
|
|
4baae5c9f7 | ||
|
|
02b31c8932 | ||
|
|
343327a1b5 | ||
|
|
3bca426eb1 | ||
|
|
5c736b7790 | ||
|
|
a22ab829ec | ||
|
|
f65749db50 | ||
|
|
a3f2fe5dab | ||
|
|
ed814ef39a | ||
|
|
74b353d530 | ||
|
|
d6aca47698 | ||
|
|
106331af85 | ||
|
|
8a303c2d27 | ||
|
|
cbaf06a76b | ||
|
|
e6f2c4c966 | ||
|
|
08e005b9db | ||
|
|
4067410397 | ||
|
|
e3861f1ffe | ||
|
|
e6d0774734 | ||
|
|
95f19fbfd7 | ||
|
|
63c3a493fa | ||
|
|
17efc10568 | ||
|
|
9cad31da3e | ||
|
|
5b9d171bf4 | ||
|
|
44f75247cd | ||
|
|
06c7f59cd6 | ||
|
|
28ab2eab22 | ||
|
|
854bec1519 | ||
|
|
243e43188f | ||
|
|
391b70017a | ||
|
|
cd6f1ddaf4 | ||
|
|
7efbd59062 | ||
|
|
e256d39101 | ||
|
|
0f5291b41c | ||
|
|
8bbec4c8a4 | ||
|
|
e518f25f24 | ||
|
|
e644fcb49f | ||
|
|
b9c7a0f154 | ||
|
|
94745fb013 | ||
|
|
a8e3691507 | ||
|
|
cb8114ecfb | ||
|
|
f864e60e87 | ||
|
|
53117009e7 | ||
|
|
5f4dda4adb | ||
|
|
63e5ddf1ca | ||
|
|
8c5ea875bf | ||
|
|
af0f210c54 | ||
|
|
31e701505e | ||
|
|
cb6b97a269 | ||
|
|
0bebb12808 | ||
|
|
8a3609092d | ||
|
|
8dc5d4b849 | ||
|
|
63a00a2ae1 | ||
|
|
71a4407da8 | ||
|
|
7cf021ac5d | ||
|
|
810c5adfba | ||
|
|
26549a148a | ||
|
|
f810c42b73 | ||
|
|
e3c3c1b1fe | ||
|
|
9b87b1d5ad | ||
|
|
baf21e888f | ||
|
|
8a26fc3178 | ||
|
|
a30f07be77 | ||
|
|
428c000a5a | ||
|
|
42960d9780 | ||
|
|
27567b3cff | ||
|
|
17f13239ca | ||
|
|
d257830de8 | ||
|
|
c87a9d47d0 | ||
|
|
a11f82fce4 | ||
|
|
786ece6667 | ||
|
|
0ac966a905 | ||
|
|
0a29e2f4a0 | ||
|
|
292a80b807 | ||
|
|
32b87738ee | ||
|
|
b91d0e1195 | ||
|
|
5cc08170bc | ||
|
|
f7192d1e90 | ||
|
|
7128df5d50 | ||
|
|
1398b3fbaf | ||
|
|
78888e784c | ||
|
|
a6863bc8e6 | ||
|
|
b6f19737cb | ||
|
|
57cfdad215 | ||
|
|
8e46a55ee5 | ||
|
|
d7883e7238 | ||
|
|
c458d46d33 | ||
|
|
9de7591531 | ||
|
|
564d136df3 | ||
|
|
9714e00938 | ||
|
|
44d532146b | ||
|
|
8f809cc093 | ||
|
|
291ff1ae6a | ||
|
|
744ee0dc5e | ||
|
|
66ac922ae2 | ||
|
|
3d965943c0 | ||
|
|
e05db88a72 | ||
|
|
8a98c6f4db | ||
|
|
272f17be71 | ||
|
|
6922dd0465 | ||
|
|
d40f90d233 | ||
|
|
8ea9400a07 | ||
|
|
eda7514001 | ||
|
|
935ce42305 | ||
|
|
c68febd794 | ||
|
|
3c28df38c8 | ||
|
|
f8c1dd9308 | ||
|
|
3721052cc3 | ||
|
|
94fe8878fd | ||
|
|
2e2631fca8 | ||
|
|
65b335b853 | ||
|
|
fc20c8490c | ||
|
|
bd98741ffe | ||
|
|
deb309c08f | ||
|
|
011698a3c9 | ||
|
|
d25af61007 | ||
|
|
981dc2d1c0 | ||
|
|
bcef69a344 | ||
|
|
cd52377639 | ||
|
|
7660e6dff3 | ||
|
|
a061bbb564 | ||
|
|
e2ec8a34f2 | ||
|
|
356b1fec57 | ||
|
|
f69fe11921 | ||
|
|
c05071ab6e | ||
|
|
dc6d643f7d | ||
|
|
706fb7231e | ||
|
|
2ff37d561c | ||
|
|
a13efd0c5b | ||
|
|
a920e9e5fb | ||
|
|
fa6b998f67 | ||
|
|
244d0342ec | ||
|
|
9f649d8806 | ||
|
|
2e751e966d | ||
|
|
06ba2ad000 | ||
|
|
cb4b85a594 | ||
|
|
b5eac1ce22 | ||
|
|
431b1e6cd0 | ||
|
|
836804b3f9 | ||
|
|
8af54cfe8c | ||
|
|
8e2777df0e | ||
|
|
3ff3b970a0 | ||
|
|
108a0d836d | ||
|
|
9937efddb6 | ||
|
|
d0f5a5594b | ||
|
|
9b0f416a02 | ||
|
|
276160bf7b | ||
|
|
cecbeca1fe | ||
|
|
f359999f9b | ||
|
|
398db2caf6 | ||
|
|
4b90c8a3f0 | ||
|
|
9a8f1bdb86 | ||
|
|
18e747c3b3 | ||
|
|
1bb6ae7e9f | ||
|
|
1f366430cf | ||
|
|
77421c11c0 | ||
|
|
7d5e3ee437 | ||
|
|
ab7f35e6d9 | ||
|
|
9f2a7cda78 | ||
|
|
963f950039 | ||
|
|
0255afd75d | ||
|
|
254d1ad34b | ||
|
|
4a8c59a3e6 | ||
|
|
cd3061f2c4 | ||
|
|
937cb34920 | ||
|
|
ac015ab5a8 | ||
|
|
ea817e3eed | ||
|
|
5b9d3636db | ||
|
|
7cfba6f80a | ||
|
|
2f862ac687 | ||
|
|
6895719759 | ||
|
|
1a1877e15c | ||
|
|
3af0dd81e5 | ||
|
|
909806b0f9 | ||
|
|
a393c73eec | ||
|
|
1c8a9d6bb3 | ||
|
|
62dae65606 | ||
|
|
7310905ae2 | ||
|
|
cd1ea8269b | ||
|
|
22ae4ebc4c | ||
|
|
b5f6fef9ae | ||
|
|
9becf9b9ac | ||
|
|
eb62576e5f | ||
|
|
78ec726f4a | ||
|
|
e4de9c124e | ||
|
|
5ef7486646 | ||
|
|
902c866f18 | ||
|
|
f6164a9b85 | ||
|
|
07253531ef | ||
|
|
5689ffb36e | ||
|
|
3ec7b67c24 | ||
|
|
23abe72564 | ||
|
|
5266d8e4dc | ||
|
|
ebd0e929e2 | ||
|
|
fcd4d9e0fc | ||
|
|
41cd7688ea | ||
|
|
00e0b179a3 | ||
|
|
2600ec040b | ||
|
|
3190d18d23 | ||
|
|
38b3c503fc | ||
|
|
71388411b5 | ||
|
|
67eac9fde2 | ||
|
|
bd0cd9900d | ||
|
|
4ad6cc9fe0 | ||
|
|
e59b69e3f2 | ||
|
|
78df5491a0 | ||
|
|
de0d148dd0 | ||
|
|
f9b4dd4ada | ||
|
|
0f8b5b7da7 | ||
|
|
7295e0ea76 | ||
|
|
010e065dd7 | ||
|
|
816c566442 | ||
|
|
f32b1d5685 | ||
|
|
9df807a4ae | ||
|
|
bd2b59efde | ||
|
|
04549b5e21 | ||
|
|
e5039b588b | ||
|
|
5a9dc8b9fe | ||
|
|
f773a9595a | ||
|
|
362e87610e | ||
|
|
b16510c6ed | ||
|
|
92ff50d3a3 | ||
|
|
1633dfb283 | ||
|
|
80bb731f17 | ||
|
|
ba387bddc6 | ||
|
|
197fceaddc | ||
|
|
cad42578a9 | ||
|
|
446f1e767c | ||
|
|
6ac602a067 | ||
|
|
37107ae621 | ||
|
|
687cb9a4c9 | ||
|
|
2176b9b436 | ||
|
|
e061caa2e4 | ||
|
|
b4157cdbc5 | ||
|
|
c0cd967cc7 | ||
|
|
c32a364d82 | ||
|
|
d82f782f4b | ||
|
|
22a00ceef0 | ||
|
|
b4c0c8de2b | ||
|
|
991c80d040 | ||
|
|
6c0ab25894 | ||
|
|
92575ccd64 | ||
|
|
b4da2c69f1 | ||
|
|
8802a834d5 | ||
|
|
5a42ae532e | ||
|
|
e1c4826605 | ||
|
|
23232c536a | ||
|
|
e5f310393f | ||
|
|
9fc5b3dbaf | ||
|
|
adef849df9 | ||
|
|
d435e215e8 | ||
|
|
76cc63e510 | ||
|
|
eea4656094 | ||
|
|
5a9d378585 | ||
|
|
4a20c76885 | ||
|
|
520f72fe77 | ||
|
|
37f4252509 | ||
|
|
ae29132175 | ||
|
|
5fb084bd12 | ||
|
|
c3e85afb85 | ||
|
|
3ce5164abb | ||
|
|
6107be18a9 | ||
|
|
ae11e1db73 | ||
|
|
ba726ec435 | ||
|
|
4d2287a7ae | ||
|
|
9555e73475 | ||
|
|
e62b7bfe04 | ||
|
|
91d2ea8df7 | ||
|
|
05278149c5 |
2
.eslintignore
Normal file
2
.eslintignore
Normal file
@@ -0,0 +1,2 @@
|
||||
CookieMonster.js
|
||||
CookieMonster.user.js
|
||||
50
.eslintrc.js
Normal file
50
.eslintrc.js
Normal 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',
|
||||
},
|
||||
};
|
||||
23
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
23
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Please use this template to report bugs you might have found
|
||||
title: ''
|
||||
labels: Bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
Please describe the bug and what you would have expected the mod to do
|
||||
|
||||
**To Reproduce**
|
||||
The steps needed to reproduce the behavior:
|
||||
1. ...
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Save file**
|
||||
```
|
||||
If applicable please copy your save file here
|
||||
```
|
||||
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for CookieMonster
|
||||
title: ''
|
||||
labels: Enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the function you'd like to see added to CookieMonster**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Additional files**
|
||||
Add any other files such as save files or screenshots about the feature request here.
|
||||
25
.github/workflows/CI.yml
vendored
Normal file
25
.github/workflows/CI.yml
vendored
Normal 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
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
22
CONTRIBUTING.md
Normal file
22
CONTRIBUTING.md
Normal 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
|
||||
@@ -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
|
||||
3001
CookieMonster.js
3001
CookieMonster.js
File diff suppressed because one or more lines are too long
19
CookieMonster.user.js
Normal file
19
CookieMonster.user.js
Normal 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);
|
||||
114
README.md
114
README.md
@@ -1,18 +1,19 @@
|
||||
# Cookie Monster
|
||||

|
||||
## 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.
|
||||
|
||||
This is a helper, and it is here to help you at *whichever* degree you want, if you only need some help shortening long numbers, it does that. If you need to be accompanied by hand to pick the best buildings to buy, it does that, but **everything is an option**.
|
||||
|
||||
## Current version
|
||||
|
||||
### Current version
|
||||
You can see the current version, and a full history of all versions and what they changed by consulting the [releases page](https://github.com/Aktanusa/CookieMonster/releases).
|
||||
|
||||
## What it does
|
||||
### What it does
|
||||
|
||||
At its core, Cookie Monster computes an index on both buildings and upgrades:
|
||||
|
||||
* **Payback Period (PP)**: Indicates how much a building is worth by using the formula max(cost - cookies in bank, 0)/cps + cost/Δ cps
|
||||
At its core, Cookie Monster computes an index for both buildings and upgrades: the **Payback Period (PP)**. This indicates how much a building is worth by using the following formula:
|
||||
```
|
||||
max(cost - cookies in bank, 0)/cps + cost/Δ cps
|
||||
```
|
||||
|
||||
Cookie Monster also indicates the time left before being able to buy an upgrade or building, and takes it into consideration. It will take *everything* in consideration, meaning if buying a building also unlocks an achievement which boosts your income, which unlocks an achievement, it will know and highlight that building's value.
|
||||
|
||||
@@ -28,111 +29,54 @@ This index is computed for buildings and upgrades. If the relevant option is ena
|
||||
|
||||
Note: For this index, **lower is better**, meaning a building with a PP of 1 is more interesting than one with a PP of 3.
|
||||
|
||||
## What it doesn't do
|
||||
### What it doesn't do
|
||||
|
||||
Most likely you'll find items in gray like Golden Cookie upgrades, clicking upgrades, season upgrades – everything that doesn't earn you a direct bonus to your income will display as gray. This means the following upgrades are **not** taken into account by Cookie Monster:
|
||||
|
||||
* Plastic mouse
|
||||
* Iron mouse
|
||||
* Titanium mouse
|
||||
* Adamantium mouse
|
||||
* Unobtainium mouse
|
||||
* Lucky day
|
||||
* Serendipity
|
||||
* Get lucky
|
||||
* Elder Pledge
|
||||
* Sacrificial rolling pins
|
||||
* **etc.**
|
||||
Some upgrades do not give a direct bonus to your income and will display as gray. These are mainly Golden Cookie upgrades and season upgrades.
|
||||
|
||||
Do note though that, although these upgrades have no direct value, if buying them earns you an achievement of some sort which in return gives you milk and income, Cookie Monster **will** display that value.
|
||||
|
||||
# Using
|
||||
## Using
|
||||
|
||||
## Bookmarklet
|
||||
### Bookmarklet
|
||||
|
||||
Copy this code and save it as a bookmark. Paste it in the URL section. To activate, click the bookmark when the game's open.
|
||||
|
||||
```javascript
|
||||
javascript: (function () {
|
||||
Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonster.js');
|
||||
Game.LoadMod('https://aktanusa.github.io/CookieMonster/CookieMonster.js');
|
||||
}());
|
||||
```
|
||||
|
||||
If (for some reason) the above doesn't work, trying pasting everything after the <code>javascript:</code> bit into your browser's console.
|
||||
|
||||
For beta, use the following instead:
|
||||
### Userscript
|
||||
|
||||
```javascript
|
||||
javascript: (function () {
|
||||
Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonsterBeta.js');
|
||||
}());
|
||||
```
|
||||
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".
|
||||
|
||||
## Userscript
|
||||
## Bugs and suggestions
|
||||
|
||||
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.
|
||||
Any bug or suggestion should be **opened as an issue** [in the repository](https://github.com/Aktanusa/CookieMonster/issues) for easier tracking. This allows us to close issues once they're fixed.
|
||||
|
||||
```javascript
|
||||
// ==UserScript==
|
||||
// @name Cookie Monster
|
||||
// @namespace Cookie
|
||||
// @include http://orteil.dashnet.org/cookieclicker/
|
||||
// @version 1
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
Before submitting a bug, make sure to give a shot at the latest version of the addon on the <code>dev</code> branch. This version can be tested by copying the `CookieMonster.js` file of the dev branch into your console.
|
||||
|
||||
(function() {
|
||||
var checkReady = setInterval(function() {
|
||||
if (typeof Game.ready !== 'undefined' && Game.ready) {
|
||||
Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonster.js');
|
||||
clearInterval(checkReady);
|
||||
}
|
||||
}, 1000);
|
||||
})();
|
||||
```
|
||||
If you are using the beta, use this instead:
|
||||
|
||||
```javascript
|
||||
// ==UserScript==
|
||||
// @name Cookie Monster Beta
|
||||
// @namespace Cookie
|
||||
// @include http://orteil.dashnet.org/cookieclicker/beta/
|
||||
// @version 1
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
|
||||
(function() {
|
||||
var checkReady = setInterval(function() {
|
||||
if (typeof Game.ready !== 'undefined' && Game.ready) {
|
||||
Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonsterBeta.js');
|
||||
clearInterval(checkReady);
|
||||
}
|
||||
}, 1000);
|
||||
})();
|
||||
```
|
||||
|
||||
# Bugs and suggestions
|
||||
|
||||
Any bug or suggestion should be **opened as an issue** [in the repository](https://github.com/Aktanusa/CookieMonster/issues) for easier tracking. This allows me to close issues once they're fixed.
|
||||
|
||||
Before submitting a bug, make sure to give a shot at the latest version of the addon on the <code>dev</code> branch. For this, use the following bookmarklet:
|
||||
|
||||
```javascript
|
||||
javascript: (function () {
|
||||
Game.LoadMod('https://cdn.rawgit.com/Aktanusa/CookieMonster/dev/CookieMonster.js');
|
||||
}());
|
||||
```
|
||||
|
||||
If the bug is still here, you can submit an issue for it.
|
||||
If the bug is still here, you can submit an issue for it. Please do so by using the bug report template.
|
||||
|
||||
All suggestions are welcome, even the smallest ones.
|
||||
|
||||
#Contributors
|
||||
## Contributing
|
||||
|
||||
* **[Raving_Kumquat](http://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author
|
||||
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
|
||||
* **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer
|
||||
* **[Alderi Tokori](http://forum.dashnet.org/profile/Alderi)**: ROI calculations (unused now)
|
||||
* **[Alhifar](https://github.com/Alhifar)**: Missed Golden Cookie Stat
|
||||
* **[BlackenedGem](https://github.com/BlackenedGem)**: Golden/Wrath Cookie Favicons
|
||||
* **[Sandworm](https://github.com/svschouw)**: Modified PP calculation
|
||||
* **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer
|
||||
* **[DanielNoord](https://github.com/DanielNoord)**: Current maintainer
|
||||
* **[bitsandbytes1708](https://github.com/bitsandbytes1708)**: Current maintainer
|
||||
|
||||
4213
jscolor/jscolor.js
4213
jscolor/jscolor.js
File diff suppressed because it is too large
Load Diff
3616
package-lock.json
generated
Normal file
3616
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
53
package.json
Normal file
53
package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
|
||||
Queue.js
|
||||
|
||||
A function to represent a queue
|
||||
|
||||
Created by Stephen Morley - http://code.stephenmorley.org/ - and released under
|
||||
the terms of the CC0 1.0 Universal legal code:
|
||||
|
||||
http://creativecommons.org/publicdomain/zero/1.0/legalcode
|
||||
|
||||
*/
|
||||
|
||||
/* Creates a new queue. A queue is a first-in-first-out (FIFO) data structure -
|
||||
* items are added to the end of the queue and removed from the front.
|
||||
*/
|
||||
function Queue(){
|
||||
|
||||
// initialise the queue and offset
|
||||
var queue = [];
|
||||
var offset = 0;
|
||||
|
||||
// Returns the length of the queue.
|
||||
this.getLength = function(){
|
||||
return (queue.length - offset);
|
||||
}
|
||||
|
||||
// Returns true if the queue is empty, and false otherwise.
|
||||
this.isEmpty = function(){
|
||||
return (queue.length == 0);
|
||||
}
|
||||
|
||||
/* Enqueues the specified item. The parameter is:
|
||||
*
|
||||
* item - the item to enqueue
|
||||
*/
|
||||
this.enqueue = function(item){
|
||||
queue.push(item);
|
||||
}
|
||||
|
||||
/* Dequeues an item and returns it. If the queue is empty, the value
|
||||
* 'undefined' is returned.
|
||||
*/
|
||||
this.dequeue = function(){
|
||||
|
||||
// if the queue is empty, return immediately
|
||||
if (queue.length == 0) return undefined;
|
||||
|
||||
// store the item at the front of the queue
|
||||
var item = queue[offset];
|
||||
|
||||
// increment the offset and remove the free space if necessary
|
||||
if (++ offset * 2 >= queue.length){
|
||||
queue = queue.slice(offset);
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
// return the dequeued item
|
||||
return item;
|
||||
|
||||
}
|
||||
|
||||
/* Returns the item at the front of the queue (without dequeuing it). If the
|
||||
* queue is empty then undefined is returned.
|
||||
*/
|
||||
this.peek = function(){
|
||||
return (queue.length > 0 ? queue[offset] : undefined);
|
||||
}
|
||||
|
||||
/* Returns the item at the spot specified by place in the queue (without
|
||||
* dequeuing it). If the queue is emprty or the requested place is outside
|
||||
* the queue then undefined is returned.
|
||||
*/
|
||||
this.get = function(place){
|
||||
var item = undefined;
|
||||
if (queue.length > 0 && place < (queue.length - offset) && place >= 0) {
|
||||
item = queue[(offset + place)];
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
1025
src/Cache.js
1025
src/Cache.js
File diff suppressed because it is too large
Load Diff
276
src/Config.js
276
src/Config.js
@@ -1,149 +1,175 @@
|
||||
/**********
|
||||
/**
|
||||
* Config *
|
||||
**********/
|
||||
*/
|
||||
|
||||
CM.SaveConfig = function(config) {
|
||||
localStorage.setItem(CM.ConfigPrefix, JSON.stringify(config));
|
||||
}
|
||||
/**
|
||||
* Section: Functions related to saving, loading and restoring configs */
|
||||
|
||||
CM.LoadConfig = function() {
|
||||
if (localStorage.getItem(CM.ConfigPrefix) != null) {
|
||||
CM.Config = JSON.parse(localStorage.getItem(CM.ConfigPrefix));
|
||||
/**
|
||||
* This function saves the config of CookieMonster without saving any of the other save-data
|
||||
* This allows saving in between the autosave intervals
|
||||
* It is called by CM.Config.LoadConfig(), CM.Config.RestoreDefault(), CM.Config.ToggleConfig(),
|
||||
* CM.ToggleConfigVolume() and changes in options with type "url", "color" or "numscale"
|
||||
*/
|
||||
CM.Config.SaveConfig = function () {
|
||||
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.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') {
|
||||
delete localStorage.CMConfig;
|
||||
}
|
||||
if (settings !== undefined) {
|
||||
CM.Options = settings;
|
||||
|
||||
// Check values
|
||||
var mod = false;
|
||||
for (var i in CM.ConfigDefault) {
|
||||
if (typeof CM.Config[i] === 'undefined') {
|
||||
let mod = false;
|
||||
for (const i in CM.Data.ConfigDefault) {
|
||||
if (typeof CM.Options[i] === 'undefined') {
|
||||
mod = true;
|
||||
CM.Config[i] = CM.ConfigDefault[i];
|
||||
}
|
||||
else if (i != 'StatsPref' && i != 'Colors') {
|
||||
if (i.indexOf('SoundURL') == -1) {
|
||||
if (!(CM.Config[i] > -1 && CM.Config[i] < CM.ConfigData[i].label.length)) {
|
||||
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.Data.Config[i].label.length)) {
|
||||
mod = true;
|
||||
CM.Config[i] = CM.ConfigDefault[i];
|
||||
CM.Options[i] = CM.Data.ConfigDefault[i];
|
||||
}
|
||||
} else if (typeof CM.Options[i] !== 'string') { // Sound URLs
|
||||
mod = true;
|
||||
CM.Options[i] = CM.Data.ConfigDefault[i];
|
||||
}
|
||||
} 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 { // Sound URLs
|
||||
if (typeof CM.Config[i] != '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.Config[i] = CM.ConfigDefault[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (i == 'StatsPref') {
|
||||
for (var j in CM.ConfigDefault.StatsPref) {
|
||||
if (typeof CM.Config[i][j] === 'undefined' || !(CM.Config[i][j] > -1 && CM.Config[i][j] < 2)) {
|
||||
mod = true;
|
||||
CM.Config[i][j] = CM.ConfigDefault[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // Colors
|
||||
for (var j in CM.ConfigDefault.Colors) {
|
||||
if (typeof CM.Config[i][j] === 'undefined' || typeof CM.Config[i][j] != 'string') {
|
||||
mod = true;
|
||||
CM.Config[i][j] = CM.ConfigDefault[i][j];
|
||||
CM.Options[i][j] = CM.Data.ConfigDefault[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mod) CM.SaveConfig(CM.Config);
|
||||
CM.Loop(); // Do loop once
|
||||
for (var i in CM.ConfigDefault) {
|
||||
if (i != 'StatsPref' && typeof CM.ConfigData[i].func !== 'undefined') {
|
||||
CM.ConfigData[i].func();
|
||||
if (mod) CM.Config.SaveConfig();
|
||||
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
|
||||
CM.Config.RestoreDefault();
|
||||
}
|
||||
else { // Default values
|
||||
CM.RestoreDefault();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CM.RestoreDefault = function() {
|
||||
CM.Config = {};
|
||||
CM.SaveConfig(CM.ConfigDefault);
|
||||
CM.LoadConfig();
|
||||
/**
|
||||
* This function reloads and resaves the default config as stored in CM.Data.ConfigDefault
|
||||
* It is called by resDefBut.onclick loaded in the options page or by CM.Config.LoadConfig if no localStorage is found
|
||||
*/
|
||||
CM.Config.RestoreDefault = function () {
|
||||
CM.Config.LoadConfig(CM.Data.ConfigDefault);
|
||||
CM.Config.SaveConfig();
|
||||
Game.UpdateMenu();
|
||||
}
|
||||
};
|
||||
|
||||
CM.ToggleConfig = function(config) {
|
||||
CM.ToggleConfigUp(config);
|
||||
if (CM.ConfigData[config].toggle) {
|
||||
if (CM.Config[config] == 0) {
|
||||
l(CM.ConfigPrefix + config).className = 'option off';
|
||||
}
|
||||
else {
|
||||
l(CM.ConfigPrefix + config).className = 'option';
|
||||
/**
|
||||
* Section: Functions related to toggling or changing configs */
|
||||
|
||||
/**
|
||||
* This function toggles options by incrementing them with 1 and handling changes
|
||||
* It is called by the onclick event of options of the "bool" type
|
||||
* @param {string} config The name of the option
|
||||
*/
|
||||
CM.Config.ToggleConfig = function (config) {
|
||||
CM.Options[config]++;
|
||||
|
||||
if (CM.Options[config] === CM.Data.Config[config].label.length) {
|
||||
CM.Options[config] = 0;
|
||||
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.Data.Config[config].func !== 'undefined') {
|
||||
CM.Data.Config[config].func();
|
||||
}
|
||||
|
||||
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
|
||||
* It is called by the oninput and onchange event of "vol" type options
|
||||
* @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);
|
||||
}
|
||||
CM.Config.SaveConfig();
|
||||
};
|
||||
|
||||
/**
|
||||
* This function toggles header options by incrementing them with 1 and handling changes
|
||||
* It is called by the onclick event of the +/- next to headers
|
||||
* @param {string} config The name of the header
|
||||
*/
|
||||
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 */
|
||||
|
||||
/**
|
||||
* This function checks if the user has given permissions for notifications
|
||||
* It is called by a change in any of the notification options
|
||||
* Note that most browsers will stop asking if the user has ignored the prompt around 6 times
|
||||
* @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) {
|
||||
// Check if browser support Promise version of Notification Permissions
|
||||
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()) {
|
||||
Notification.requestPermission().then();
|
||||
} else {
|
||||
Notification.requestPermission();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CM.ToggleConfigUp = function(config) {
|
||||
CM.Config[config]++;
|
||||
if (CM.Config[config] == CM.ConfigData[config].label.length) {
|
||||
CM.Config[config] = 0;
|
||||
}
|
||||
if (typeof CM.ConfigData[config].func !== 'undefined') {
|
||||
CM.ConfigData[config].func();
|
||||
}
|
||||
l(CM.ConfigPrefix + config).innerHTML = CM.Disp.GetConfigDisplay(config);
|
||||
CM.SaveConfig(CM.Config);
|
||||
}
|
||||
|
||||
CM.ToggleConfigDown = function(config) {
|
||||
CM.Config[config]--;
|
||||
if (CM.Config[config] < 0) {
|
||||
CM.Config[config] = CM.ConfigData[config].label.length - 1;
|
||||
}
|
||||
if (typeof CM.ConfigData[config].func !== 'undefined') {
|
||||
CM.ConfigData[config].func();
|
||||
}
|
||||
l(CM.ConfigPrefix + config).innerHTML = CM.Disp.GetConfigDisplay(config);
|
||||
CM.SaveConfig(CM.Config);
|
||||
}
|
||||
|
||||
CM.ToggleStatsConfig = function(config) {
|
||||
if (CM.Config.StatsPref[config] == 0) {
|
||||
CM.Config.StatsPref[config]++;
|
||||
}
|
||||
else {
|
||||
CM.Config.StatsPref[config]--;
|
||||
}
|
||||
CM.SaveConfig(CM.Config);
|
||||
}
|
||||
|
||||
CM.ConfigData.BotBar = {label: ['Bottom Bar OFF', 'Bottom Bar ON'], desc: 'Building Information', toggle: true, func: function() {CM.Disp.ToggleBotBar();}};
|
||||
CM.ConfigData.TimerBar = {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 = {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.BuildColor = {label: ['Building Colors OFF', 'Building Colors ON'], desc: 'Color code buildings', toggle: true, func: function() {CM.Disp.UpdateBuildings();}};
|
||||
CM.ConfigData.BulkBuildColor = {label: ['Bulk Building Colors (Single Buildings Color)', 'Bulk Building Colors (Calculated 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.UpBarColor = {label: ['Upgrade Bar/Colors OFF', 'Upgrade Bar/Colors ON'], desc: 'Color code upgrades and add a counter', toggle: true, func: function() {CM.Disp.ToggleUpBarColor();}};
|
||||
CM.ConfigData.Colors = {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', Yellow: 'Color Yellow. Used to show between best and worst PP buildings closer to best, for Frenzy bar, and for various labels', Orange: 'Color Orange. Used to show between best and worst PP buildings closer to worst, for Next Reindeer bar, and for various labels', Red: 'Color Red. Used to show worst PP building, for Clot bar, and for various labels', 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'}, func: function() {CM.Disp.UpdateColors();}};
|
||||
CM.ConfigData.CalcWrink = {label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON'], desc: 'Calculate times and average Cookies Per Second with Wrinkers', toggle: true};
|
||||
CM.ConfigData.CPSMode = {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 = {label: ['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 = {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.ToolWarnCautBon = {label: ['Calculate Tooltip Warning/Caution With Bonus CPS OFF', 'Calculate Tooltip Warning/Caution With Bonus CPS ON'], desc: 'Calculate the warning/caution with or without the bonus CPS you get from buying', toggle: true};
|
||||
CM.ConfigData.Flash = {label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Golden Cookie/Season Popup', toggle: true};
|
||||
CM.ConfigData.Sound = {label: ['Sounds OFF', 'Sounds ON'], desc: 'Play a sound on Golden Cookie/Season Popup', toggle: true};
|
||||
CM.ConfigData.Volume = {label: [], desc: 'Volume of the sound'};
|
||||
for (var i = 0; i < 101; i++) {
|
||||
CM.ConfigData.Volume.label[i] = i + '%';
|
||||
}
|
||||
CM.ConfigData.GCSoundURL = {label: 'Golden Cookie Sound URL:', desc: 'URL of the sound to be played when a Golden Cookie spawns'};
|
||||
CM.ConfigData.SeaSoundURL = {label: 'Season Special Sound URL:', desc: 'URL of the sound to be played when a Season Special spawns'};
|
||||
CM.ConfigData.GCTimer = {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.Title = {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.ConfigData.Favicon = {label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}};
|
||||
CM.ConfigData.Tooltip = {label: ['Tooltip Information OFF', 'Tooltip Information ON'], desc: 'Extra information in tooltip for buildings/upgrades', toggle: true};
|
||||
CM.ConfigData.TooltipAmor = {label: ['Tooltip Amortization Information OFF', 'Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true};
|
||||
CM.ConfigData.ToolWarnCaut = {label: ['Tooltip Warning/Caution OFF', 'Tooltip Warning/Caution ON'], desc: 'A warning/caution when buying if it will put the bank under the amount needed for max "Lucky!"/"Lucky!" (Frenzy) rewards', toggle: true, func: function() {CM.Disp.ToggleToolWarnCaut();}};
|
||||
CM.ConfigData.ToolWarnCautPos = {label: ['Tooltip Warning/Caution Position (Left)', 'Tooltip Warning/Caution Position (Bottom)'], desc: 'Placement of the warning/caution boxes', toggle: false, func: function() {CM.Disp.ToggleToolWarnCautPos();}};
|
||||
CM.ConfigData.ToolWrink = {label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true};
|
||||
CM.ConfigData.Stats = {label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!', toggle: true};
|
||||
CM.ConfigData.UpStats = {label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false};
|
||||
CM.ConfigData.SayTime = {label: ['Format Time OFF', 'Format Time ON'], desc: 'Change how time is displayed in statistics', toggle: true, func: function() {CM.Disp.ToggleSayTime();}};
|
||||
CM.ConfigData.Scale = {label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Scientific Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}};
|
||||
/**
|
||||
* Section: Variables used in Config functions */
|
||||
|
||||
/**
|
||||
* Used to name certain DOM elements and refer to them
|
||||
*/
|
||||
CM.Config.ConfigPrefix = 'CMConfig';
|
||||
|
||||
570
src/Data.js
570
src/Data.js
@@ -1,8 +1,572 @@
|
||||
/********
|
||||
/**
|
||||
* Data *
|
||||
********/
|
||||
*/
|
||||
|
||||
/**
|
||||
* Section: Data used in the stats page to show not yet purchased updates. See CM.Disp.CreateStatsMissDisp() */
|
||||
|
||||
CM.Data.Fortunes = [
|
||||
'Fortune #001',
|
||||
'Fortune #002',
|
||||
'Fortune #003',
|
||||
'Fortune #004',
|
||||
'Fortune #005',
|
||||
'Fortune #006',
|
||||
'Fortune #007',
|
||||
'Fortune #008',
|
||||
'Fortune #009',
|
||||
'Fortune #010',
|
||||
'Fortune #011',
|
||||
'Fortune #012',
|
||||
'Fortune #013',
|
||||
'Fortune #014',
|
||||
'Fortune #015',
|
||||
'Fortune #016',
|
||||
'Fortune #017',
|
||||
'Fortune #018',
|
||||
'Fortune #100',
|
||||
'Fortune #101',
|
||||
'Fortune #102',
|
||||
'Fortune #103',
|
||||
'Fortune #104',
|
||||
];
|
||||
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'];
|
||||
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'];
|
||||
|
||||
/**
|
||||
* 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'];
|
||||
CM.Data.shortScale = ['', '', 'M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec', 'Quattuordec', 'Quindec', 'Sexdec', 'Septendec', 'Octodec', 'Novemdec', 'Vigint', 'Unvigint', 'Duovigint', 'Trevigint', 'Quattuorvigint'];
|
||||
CM.Data.shortScaleAbbreviated = ['', 'K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp', 'Oc', 'No', 'De',
|
||||
'UDe', 'DDe', 'TDe', 'QaDe', 'QiDe', 'SxDe', 'SpDe', 'ODe', 'NDe', 'Vi',
|
||||
'UVi', 'DVi', 'TVi', 'QaVi', 'QiVi', 'SxVi', 'SpVi', 'OVi', 'NVi', 'Tr',
|
||||
'UTr', 'DTr', 'TTr', 'QaTr', 'QiTr', 'SxTr', 'SpTr', 'OTr', 'NTr', 'Qaa',
|
||||
'UQa', 'DQa', 'TQa', 'QaQa', 'QiQa', 'SxQa', 'SpQa', 'OQa', 'NQa', 'Qia',
|
||||
'UQi', 'DQi', 'TQi', 'QaQi', 'QiQi', 'SxQi', 'SpQi', 'OQi', 'NQi', 'Sxa',
|
||||
'USx', 'DSx', 'TSx', 'QaSx', 'QiSx', 'SxSx', 'SpSx', 'OSx', 'NSx', 'Spa',
|
||||
'USp', 'DSp', 'TSp', 'QaSp', 'QiSp', 'SxSp', 'SpSp', 'OSp', 'NSp', 'Oco',
|
||||
'UOc', 'DOc', 'TOc', 'QaOc', 'QiOc', 'SxOc', 'SpOc', 'OOc', 'NOc', 'Noa',
|
||||
'UNo', 'DNo', 'TNo', 'QaNo', 'QiNo', 'SxNo', 'SpNo', 'ONo', 'NNo', 'Ct',
|
||||
'UCt'];
|
||||
|
||||
/**
|
||||
* Section: Two array's containing all Config groups and their to-be displayed title */
|
||||
|
||||
CM.Data.ConfigGroups = {
|
||||
BarsColors: 'Bars/Colors',
|
||||
Calculation: 'Calculation',
|
||||
Notification: 'Notification',
|
||||
Tooltip: 'Tooltips and additional insights',
|
||||
Statistics: 'Statistics',
|
||||
Notation: 'Notation',
|
||||
Miscellaneous: 'Miscellaneous',
|
||||
};
|
||||
|
||||
CM.Data.ConfigGroupsNotification = {
|
||||
NotificationGeneral: 'General Notifications',
|
||||
NotificationGC: 'Golden Cookie',
|
||||
NotificationFC: 'Fortune Cookie',
|
||||
NotificationSea: 'Season Special',
|
||||
NotificationGard: 'Garden Tick',
|
||||
NotificationMagi: 'Full Magic Bar',
|
||||
NotificationWrink: 'Wrinkler',
|
||||
NotificationWrinkMax: 'Maximum Wrinklers',
|
||||
};
|
||||
|
||||
/**
|
||||
* Section: An array (CM.Data.Config) containing all Config options and an array of default settings */
|
||||
|
||||
/**
|
||||
* This includes all options of CookieMonster and relevant data
|
||||
* Each individual option-array in the has the following items
|
||||
* @item {string} type The type of option (bool(ean), vol(ume), url or color)
|
||||
* @item {string} group The options-group the option belongs to
|
||||
* @item {[string, ...]} label A list of the various configurations of the option
|
||||
* @item {string} desc Description to be used in options menu
|
||||
* @item {boolean} toggle Whether it should be displayed as a grey/white toggle in the options menu
|
||||
* @item {function} func A function to be called when the option is toggled
|
||||
*/
|
||||
// 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',
|
||||
Yellow: 'Color Yellow. Used to show between best and worst PP buildings closer to best, for Frenzy bar, and for various labels',
|
||||
Orange: 'Color Orange. Used to show between best and worst PP buildings closer to worst, for Next Reindeer bar, and for various labels',
|
||||
Red: 'Color Red. Used to show worst PP building, for Clot bar, and for various labels',
|
||||
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',
|
||||
},
|
||||
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(); },
|
||||
};
|
||||
|
||||
// Calculation
|
||||
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.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.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.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.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.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.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.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.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.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.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.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.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
|
||||
* It is used by CM.LoadConfig() and CM.Config.RestoreDefault()
|
||||
*/
|
||||
CM.Data.ConfigDefault = {
|
||||
BotBar: 1,
|
||||
TimerBar: 1,
|
||||
TimerBarPos: 0,
|
||||
TimerBarOverlay: 2,
|
||||
BuildColor: 1,
|
||||
BulkBuildColor: 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,
|
||||
GCVolume: 100,
|
||||
GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3',
|
||||
FortuneNotification: 0,
|
||||
FortuneFlash: 1,
|
||||
FortuneSound: 1,
|
||||
FortuneVolume: 100,
|
||||
FortuneSoundURL: 'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
||||
SeaNotification: 0,
|
||||
SeaFlash: 1,
|
||||
SeaSound: 1,
|
||||
SeaVolume: 100,
|
||||
SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
||||
GardFlash: 1,
|
||||
GardSound: 1,
|
||||
GardVolume: 100,
|
||||
GardSoundURL: 'https://freesound.org/data/previews/103/103046_861714-lq.mp3',
|
||||
MagicNotification: 0,
|
||||
MagicFlash: 1,
|
||||
MagicSound: 1,
|
||||
MagicVolume: 100,
|
||||
MagicSoundURL: 'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
||||
WrinklerNotification: 0,
|
||||
WrinklerFlash: 1,
|
||||
WrinklerSound: 1,
|
||||
WrinklerVolume: 100,
|
||||
WrinklerSoundURL: 'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
||||
WrinklerMaxNotification: 0,
|
||||
WrinklerMaxFlash: 1,
|
||||
WrinklerMaxSound: 1,
|
||||
WrinklerMaxVolume: 100,
|
||||
WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
||||
TooltipBuildUpgrade: 1,
|
||||
TooltipAmor: 0,
|
||||
ToolWarnLucky: 1,
|
||||
ToolWarnLuckyFrenzy: 1,
|
||||
ToolWarnConjure: 1,
|
||||
ToolWarnConjureFrenzy: 1,
|
||||
ToolWarnEdifice: 1,
|
||||
ToolWarnUser: 0,
|
||||
ToolWarnPos: 1,
|
||||
TooltipGrim: 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',
|
||||
},
|
||||
SortBuildings: 0,
|
||||
SortUpgrades: 0,
|
||||
GCTimer: 1,
|
||||
Favicon: 1,
|
||||
WrinklerButtons: 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>
|
||||
`;
|
||||
|
||||
4215
src/Disp.js
4215
src/Disp.js
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,81 @@
|
||||
/**********
|
||||
/**
|
||||
* Footer *
|
||||
**********/
|
||||
*/
|
||||
|
||||
CM.Init();
|
||||
/**
|
||||
* Section: Functions related to base game modding API */
|
||||
|
||||
/**
|
||||
* This register a init function to the CM object. Per Game code/comments:
|
||||
* "this function is called as soon as the mod is registered
|
||||
* declare hooks here"
|
||||
* It starts the further initialization of CookieMonster and registers hooks
|
||||
*/
|
||||
CM.init = function () {
|
||||
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.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:
|
||||
* "use this to store persistent data associated with your mod
|
||||
* return 'a string to be saved';"
|
||||
*/
|
||||
CM.save = function () {
|
||||
return JSON.stringify({
|
||||
settings: CM.Options,
|
||||
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) {
|
||||
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 */
|
||||
|
||||
/**
|
||||
* This functions loads an external script (on the same repository) that creates the
|
||||
* functionality needed to dynamiccaly change colours
|
||||
* It is called by the last function in the footer
|
||||
*/
|
||||
CM.Footer.AddJscolor = function () {
|
||||
CM.Footer.Jscolor = document.createElement('script');
|
||||
CM.Footer.Jscolor.type = 'text/javascript';
|
||||
CM.Footer.Jscolor.setAttribute('src', 'https://aktanusa.github.io/CookieMonster/jscolor/jscolor.js');
|
||||
document.head.appendChild(CM.Footer.Jscolor);
|
||||
};
|
||||
|
||||
/**
|
||||
* This functions starts the initizialization and register CookieMonster
|
||||
* It is called as the last function in this script's execution
|
||||
*/
|
||||
if (typeof CM.Footer.isInitzializing === 'undefined') {
|
||||
CM.Footer.AddJscolor();
|
||||
const delay = setInterval(function () {
|
||||
if (typeof jscolor !== 'undefined') {
|
||||
jscolor.init();
|
||||
Game.registerMod('CookieMonster', CM);
|
||||
clearInterval(delay);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
/**********
|
||||
/* eslint-disable no-unused-vars */
|
||||
/**
|
||||
* Header *
|
||||
**********/
|
||||
|
||||
CM = {};
|
||||
|
||||
CM.Backup = {};
|
||||
|
||||
CM.Cache = {};
|
||||
|
||||
CM.Config = {};
|
||||
|
||||
CM.ConfigData = {};
|
||||
|
||||
CM.Data = {};
|
||||
|
||||
CM.Disp = {};
|
||||
|
||||
CM.Sim = {};
|
||||
*/
|
||||
|
||||
const CM = {
|
||||
Backup: {},
|
||||
Cache: {},
|
||||
Config: {},
|
||||
Data: { Config: {} },
|
||||
Disp: {},
|
||||
Footer: {},
|
||||
Main: {},
|
||||
Options: {},
|
||||
Sim: {},
|
||||
VersionMajor: '2.031',
|
||||
VersionMinor: '4',
|
||||
};
|
||||
|
||||
685
src/Main.js
685
src/Main.js
@@ -1,213 +1,550 @@
|
||||
/********
|
||||
/**
|
||||
* Main *
|
||||
********/
|
||||
*/
|
||||
|
||||
CM.ReplaceNative = function() {
|
||||
CM.Backup.Beautify = Beautify;
|
||||
Beautify = CM.Disp.Beautify;
|
||||
/**
|
||||
* Section: Functions related to the main and initialization loop */
|
||||
|
||||
CM.Backup.CalculateGains = Game.CalculateGains;
|
||||
Game.CalculateGains = function() {
|
||||
CM.Backup.CalculateGains();
|
||||
CM.Sim.DoSims = 1;
|
||||
CM.Sim.Date = new Date().getTime();
|
||||
}
|
||||
|
||||
CM.Backup.seasonPopup = {};
|
||||
CM.Backup.seasonPopup.spawn = Game.seasonPopup.spawn;
|
||||
eval('CM.Backup.seasonPopup.spawnMod = ' + Game.seasonPopup.spawn.toString().split('this').join('Game.seasonPopup'));
|
||||
Game.seasonPopup.spawn = function() {
|
||||
CM.Backup.seasonPopup.spawnMod();
|
||||
CM.Disp.EmphSeasonPopup();
|
||||
}
|
||||
|
||||
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.Disp.DrawTooltipWarnCaut();
|
||||
}
|
||||
|
||||
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.UpdateTooltipWarnCaut();
|
||||
CM.Disp.UpdateTooltipLocation();
|
||||
}
|
||||
|
||||
CM.Backup.UpdateSpecial = Game.UpdateSpecial;
|
||||
Game.UpdateSpecial = function() {
|
||||
if (CM.Config.TimerBar == 1 && CM.Config.TimerBarPos == 0) {
|
||||
var timerBarHeight = parseInt(CM.Disp.TimerBar.style.height);
|
||||
Game.mouseY -= timerBarHeight;
|
||||
CM.Backup.UpdateSpecial();
|
||||
Game.mouseY += timerBarHeight;
|
||||
}
|
||||
else {
|
||||
CM.Backup.UpdateSpecial();
|
||||
}
|
||||
}
|
||||
|
||||
CM.Backup.RebuildUpgrades = Game.RebuildUpgrades;
|
||||
Game.RebuildUpgrades = function() {
|
||||
CM.Backup.RebuildUpgrades();
|
||||
CM.Disp.AddTooltipUpgrade();
|
||||
Game.CalculateGains();
|
||||
}
|
||||
|
||||
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.Loop = function() {
|
||||
if (CM.Disp.lastAscendState != Game.OnAscend) {
|
||||
/**
|
||||
* Main loop of Cookie Monster
|
||||
* CM.init registers it to the "logic" hook provided by the modding api
|
||||
*/
|
||||
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.RemakeLucky();
|
||||
CM.Cache.RemakeChain();
|
||||
CM.Cache.NoGoldSwitchCPS(); // Needed first
|
||||
CM.Cache.CacheGoldenAndWrathCookiesMults();
|
||||
CM.Cache.CacheStats();
|
||||
CM.Cache.CacheMissingUpgrades();
|
||||
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 hasFierHoard = Game.hasAura('Fierce Hoarder');
|
||||
if (!CM.Cache.HadFierHoard && hasFierHoard) {
|
||||
CM.Cache.HadFierHoard = true;
|
||||
const hasBuildAura = Game.auraMult('Fierce Hoarder') > 0;
|
||||
if (!CM.Cache.HadBuildAura && hasBuildAura) {
|
||||
CM.Cache.HadBuildAura = true;
|
||||
CM.Cache.DoRemakeBuildPrices = 1;
|
||||
}
|
||||
else if (CM.Cache.HadFierHoard && !hasFierHoard) {
|
||||
CM.Cache.HadFierHoard = false;
|
||||
} else if (CM.Cache.HadBuildAura && !hasBuildAura) {
|
||||
CM.Cache.HadBuildAura = false;
|
||||
CM.Cache.DoRemakeBuildPrices = 1;
|
||||
}
|
||||
|
||||
if (CM.Cache.DoRemakeBuildPrices) {
|
||||
CM.Cache.RemakeBuildingsPrices();
|
||||
CM.Cache.CacheBuildingsPrices();
|
||||
CM.Cache.DoRemakeBuildPrices = 0;
|
||||
}
|
||||
|
||||
// Update Wrinkler Bank
|
||||
CM.Cache.RemakeWrinkBank();
|
||||
CM.Cache.LoopCache();
|
||||
|
||||
// Calculate PP
|
||||
CM.Cache.RemakePP();
|
||||
|
||||
// Update colors
|
||||
CM.Disp.UpdateBotBarOther();
|
||||
CM.Disp.UpdateBuildings();
|
||||
CM.Disp.UpdateUpgrades();
|
||||
|
||||
// Redraw timers
|
||||
CM.Disp.UpdateBotBarTime();
|
||||
CM.Disp.UpdateTimerBar();
|
||||
|
||||
// Update Tooltip
|
||||
CM.Disp.UpdateTooltip();
|
||||
|
||||
// Update Wrinkler Tooltip
|
||||
CM.Disp.CheckWrinklerTooltip();
|
||||
CM.Disp.UpdateWrinklerTooltip();
|
||||
|
||||
// Change menu refresh interval
|
||||
CM.Disp.RefreshMenu();
|
||||
// Check all changing minigames and game-states
|
||||
CM.Main.CheckGoldenCookie();
|
||||
CM.Main.CheckTickerFortune();
|
||||
CM.Main.CheckSeasonPopup();
|
||||
CM.Main.CheckGardenTick();
|
||||
CM.Main.CheckMagicMeter();
|
||||
CM.Main.CheckWrinklerCount();
|
||||
}
|
||||
};
|
||||
|
||||
// Check Golden Cookies
|
||||
CM.Disp.CheckGoldenCookie();
|
||||
/**
|
||||
* Initialization loop of Cookie Monster
|
||||
* Called by CM.init()
|
||||
*/
|
||||
CM.Main.DelayInit = function () {
|
||||
// Create CM.Sim functions
|
||||
CM.Sim.CreateSimFunctions();
|
||||
|
||||
// Update Average CPS (might need to move)
|
||||
CM.Cache.UpdateAvgCPS()
|
||||
}
|
||||
|
||||
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?');
|
||||
}
|
||||
if (proceed) {
|
||||
CM.Cache.AddQueue();
|
||||
CM.Disp.AddJscolor();
|
||||
|
||||
var delay = setInterval(function() {
|
||||
if (typeof Queue !== 'undefined' && typeof jscolor !== 'undefined') {
|
||||
CM.DelayInit();
|
||||
clearInterval(delay);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
CM.Disp.CreateGCTimer();
|
||||
CM.Disp.CreateTooltip('GoldCookTooltipPlaceholder', 'Calculated with Golden Switch off', '200px');
|
||||
CM.Disp.CreateTooltip('PrestMaxTooltipPlaceholder', 'The MAX prestige is calculated with the cookies gained from popping all wrinklers, selling all buildings with Earth Shatterer aura, and buying Chocolate egg', '310px');
|
||||
CM.Disp.CreateTooltip('NextPrestTooltipPlaceholder', 'Not calculated with cookies gained from wrinklers or Chocolate egg', '200px');
|
||||
CM.Disp.CreateTooltip('HeavenChipMaxTooltipPlaceholder', 'The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers, selling all buildings with Earth Shatterer aura, and buying Chocolate egg', '310px');
|
||||
CM.Disp.CreateTooltip('ResetTooltipPlaceholder', 'The bonus income you would get from new prestige levels at 100% of its potential and from reset achievements if you have the same buildings/upgrades after reset', '340px');
|
||||
CM.Disp.CreateTooltip('ChoEggTooltipPlaceholder', 'The amount of cookies you would get from popping all wrinklers, selling all buildings with Earth Shatterer aura, and then buying Chocolate egg', '300px');
|
||||
CM.Disp.CreateTooltipWarnCaut();
|
||||
CM.Disp.AddTooltipBuild();
|
||||
CM.Disp.AddWrinklerAreaDetect();
|
||||
CM.Cache.InitCookiesDiff();
|
||||
CM.ReplaceNative();
|
||||
Game.CalculateGains();
|
||||
CM.LoadConfig(); // Must be after all things are created!
|
||||
CM.Disp.lastAscendState = Game.OnAscend;
|
||||
CM.Disp.lastBuyMode = Game.buyMode;
|
||||
CM.Disp.lastBuyBulk = Game.buyBulk;
|
||||
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.UpdateBuildingUpgradeStyle();
|
||||
CM.Main.ReplaceTooltips();
|
||||
CM.Main.AddWrinklerAreaDetect();
|
||||
|
||||
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);
|
||||
// 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;
|
||||
|
||||
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');
|
||||
}
|
||||
};
|
||||
|
||||
CM.ConfigDefault = {BotBar: 1, TimerBar: 1, TimerBarPos: 0, BuildColor: 1, BulkBuildColor: 0, UpBarColor: 1, CalcWrink: 1, CPSMode: 1, AvgCPSHist: 2, AvgClicksHist: 2, ToolWarnCautBon: 0, Flash: 1, Sound: 1, Volume: 100, GCSoundURL: 'http://freesound.org/data/previews/66/66717_931655-lq.mp3', SeaSoundURL: 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GCTimer: 1, Title: 1, Favicon: 1, Tooltip: 1, TooltipAmor: 0, ToolWarnCaut: 1, ToolWarnCautPos: 1, ToolWrink: 1, Stats: 1, UpStats: 1, SayTime: 1, Scale: 2, StatsPref: {Lucky: 1, Chain: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1}, Colors : {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3', Pink: '#ff1493', Brown: '#8b4513'}};
|
||||
CM.ConfigPrefix = 'CMConfig';
|
||||
/**
|
||||
* Section: Functions related to replacing stuff */
|
||||
|
||||
CM.VersionMajor = '2';
|
||||
CM.VersionMinor = '5';
|
||||
/**
|
||||
* 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.
|
||||
* CM.Cache.spawnedGoldenShimmer stores the non-user spawned cookie to later determine data for the favicon and tab-title
|
||||
* It is called by CM.CM.Main.CheckGoldenCookie
|
||||
*/
|
||||
CM.Main.FindShimmer = function () {
|
||||
CM.Main.currSpawnedGoldenCookieState = 0;
|
||||
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.Main.Loop
|
||||
*/
|
||||
CM.Main.CheckGoldenCookie = function () {
|
||||
CM.Main.FindShimmer();
|
||||
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]);
|
||||
delete CM.Disp.GCTimers[i];
|
||||
}
|
||||
}
|
||||
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!');
|
||||
}
|
||||
|
||||
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 (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.Main.Loop
|
||||
*/
|
||||
CM.Main.CheckSeasonPopup = function () {
|
||||
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!');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This function checks if there is a fortune cookie on the ticker
|
||||
* 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) {
|
||||
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.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This function checks if a garden tick has happened
|
||||
* 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()) {
|
||||
CM.Disp.Flash(3, 'GardFlash');
|
||||
CM.Disp.PlaySound(CM.Options.GardSoundURL, 'GardSound', 'GardVolume');
|
||||
}
|
||||
CM.Main.lastGardenNextStep = Game.Objects.Farm.minigame.nextStep;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This function checks if the magic meter is full
|
||||
* It is called by CM.Main.Loop
|
||||
*/
|
||||
CM.Main.CheckMagicMeter = function () {
|
||||
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!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This function checks if any new Wrinklers have popped up
|
||||
* It is called by CM.Main.Loop
|
||||
*/
|
||||
CM.Main.CheckWrinklerCount = function () {
|
||||
if (Game.elderWrath > 0) {
|
||||
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.Disp.Flash(3, 'WrinklerMaxFlash');
|
||||
} else {
|
||||
CM.Disp.Flash(3, 'WrinklerFlash');
|
||||
}
|
||||
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');
|
||||
} else {
|
||||
CM.Disp.Notification('WrinklerNotification', 'A Wrinkler appeared', 'A new wrinkler has appeared');
|
||||
}
|
||||
} else {
|
||||
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.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 (const i of Object.keys(Game.wrinklers)) {
|
||||
CM.Disp.TooltipWrinklerBeingShown[i] = 0;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Section: Functions related to the mouse */
|
||||
|
||||
/**
|
||||
* This function fixes Game.mouseY as a result of bars that are added by CookieMonster
|
||||
* It is called by Game.UpdateWrinklers(), Game.UpdateSpecial() and the .onmousover of the BigCookie
|
||||
* before execution of their actual function
|
||||
*/
|
||||
CM.Main.FixMouseY = function (target) {
|
||||
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 {
|
||||
target();
|
||||
}
|
||||
};
|
||||
|
||||
1146
src/Sim.js
1146
src/Sim.js
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user