Compare commits
284 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cff2928535 | ||
|
|
5fec38625f | ||
|
|
1d325a253c | ||
|
|
33caf8838c | ||
|
|
2708903e92 | ||
|
|
6b346e0272 | ||
|
|
d6a3209c43 | ||
|
|
dfd0d790bc | ||
|
|
f228365978 | ||
|
|
e7536d4bd4 | ||
|
|
9a6086d823 | ||
|
|
527de03493 | ||
|
|
52d52baf8e | ||
|
|
9c1bfbf80a | ||
|
|
d4043689a4 | ||
|
|
8cb0471694 | ||
|
|
ce7f0eb7e3 | ||
|
|
70df241c8f | ||
|
|
3ba2a31363 | ||
|
|
c4907e9582 | ||
|
|
1c1afb6880 | ||
|
|
1905f9a953 | ||
|
|
23eb28e29c | ||
|
|
38f430c930 | ||
|
|
035318c33f | ||
|
|
a620efe44a | ||
|
|
26b08c77ce | ||
|
|
3e53ba7c6d | ||
|
|
9252d10f23 | ||
|
|
0278162dce | ||
|
|
ee0ed81aba | ||
|
|
f69fb191d1 | ||
|
|
c0e93f316f | ||
|
|
058555b148 | ||
|
|
dd2c4e56b4 | ||
|
|
be569ee218 | ||
|
|
c0e27f3c52 | ||
|
|
d694e82b02 | ||
|
|
ca796c0b48 | ||
|
|
6c95e341f5 | ||
|
|
f84f6fc348 | ||
|
|
be245da05f | ||
|
|
977c25e77a | ||
|
|
6ab791d762 | ||
|
|
962a709489 | ||
|
|
4fb58719d3 | ||
|
|
eaff9ef93d | ||
|
|
f403f89c20 | ||
|
|
100745946e | ||
|
|
18b151d7c0 | ||
|
|
2febfb4cbe | ||
|
|
73b9ebce7f | ||
|
|
39744d52b3 | ||
|
|
97624bd4da | ||
|
|
66549c5c96 | ||
|
|
df152fd302 | ||
|
|
ff31c45a4a | ||
|
|
9ba81afae1 | ||
|
|
66e906e878 | ||
|
|
865fc3b227 | ||
|
|
47ebed0925 | ||
|
|
734f3c38c2 | ||
|
|
fcbf1b2377 | ||
|
|
4c6dfbba69 | ||
|
|
3edcb0300b | ||
|
|
49e9711b7c | ||
|
|
a48ad37b7f | ||
|
|
ace1c9f6a9 | ||
|
|
fa942ff81d | ||
|
|
974b948583 | ||
|
|
e1e4327173 | ||
|
|
d054b55ddc | ||
|
|
6e0add10fb | ||
|
|
f431d2b6be | ||
|
|
68ad398b27 | ||
|
|
68d7295bbc | ||
|
|
2be4e2de57 | ||
|
|
ae6db8f330 | ||
|
|
5715274d1a | ||
|
|
74cdb613ca | ||
|
|
4eae4598a7 | ||
|
|
d9ef469980 | ||
|
|
5532e4d0ba | ||
|
|
e78703130e | ||
|
|
63240b01bc | ||
|
|
1a520b4d52 | ||
|
|
c7fd910a26 | ||
|
|
a3ad66a058 | ||
|
|
ee3aac59ce | ||
|
|
598a36493f | ||
|
|
507e168e24 | ||
|
|
35bd55f884 | ||
|
|
7202f0122d | ||
|
|
19edf86751 | ||
|
|
28857220f3 | ||
|
|
8d1d9697c1 | ||
|
|
6eb2b76d9f | ||
|
|
b674376433 | ||
|
|
9c24deb5aa | ||
|
|
88a6fc31a1 | ||
|
|
f791d47845 | ||
|
|
d6b0284da1 | ||
|
|
0f2bd0a10e | ||
|
|
41c28c21df | ||
|
|
67d3562659 | ||
|
|
770b238f70 | ||
|
|
305454b802 | ||
|
|
18ace33231 | ||
|
|
af803b4ead | ||
|
|
210f4d4aee | ||
|
|
5a045e7ac4 | ||
|
|
cc2a754425 | ||
|
|
e44e39bc2c | ||
|
|
48c1d12d86 | ||
|
|
195d7335f8 | ||
|
|
941ccfeb79 | ||
|
|
eb71fd9bd2 | ||
|
|
039155a607 | ||
|
|
9fe2e8b9b9 | ||
|
|
11b3a99314 | ||
|
|
932b03fd51 | ||
|
|
be8cf101e4 | ||
|
|
98e6cd1dfc | ||
|
|
c3adcf4d81 | ||
|
|
82bf56cee0 | ||
|
|
21c714008c | ||
|
|
d377702d09 | ||
|
|
32f0572ab3 | ||
|
|
89952f20c2 | ||
|
|
8bab891231 | ||
|
|
0f6cffc9bf | ||
|
|
0aebc35a8b | ||
|
|
ec87a8ad3c | ||
|
|
6ff15db4da | ||
|
|
21b8a169ef | ||
|
|
32b7bfc2c9 | ||
|
|
e66ecb2be5 | ||
|
|
ddc46113bc | ||
|
|
3e80f95947 | ||
|
|
52ac7558c7 | ||
|
|
76c6d584df | ||
|
|
fa70faf386 | ||
|
|
4222e2d275 | ||
|
|
f95609a36d | ||
|
|
209d35d30e | ||
|
|
4da9d379c5 | ||
|
|
1c8bd79640 | ||
|
|
1d12977984 | ||
|
|
0f960b9ad4 | ||
|
|
87e4a6821a | ||
|
|
134828692a | ||
|
|
1b548e2beb | ||
|
|
30602b6ff7 | ||
|
|
09b0ca83ae | ||
|
|
091b1f100e | ||
|
|
c7a3a0a329 | ||
|
|
4d7e138e09 | ||
|
|
d909f593a7 | ||
|
|
266b808c4a | ||
|
|
bc936ebf20 | ||
|
|
32b3167697 | ||
|
|
f47e1f59fe | ||
|
|
e4cdc6b85a | ||
|
|
d23719c2a8 | ||
|
|
652d00ee72 | ||
|
|
f8a13302b1 | ||
|
|
8aac67b665 | ||
|
|
8ce4e13646 | ||
|
|
80d03e1cbc | ||
|
|
d300d7c0fc | ||
|
|
fbcee9a425 | ||
|
|
bf5e44ed9e | ||
|
|
d56ffd9961 | ||
|
|
adca267cfc | ||
|
|
75dac873dc | ||
|
|
84eed2d7c4 | ||
|
|
f5e342f7c5 | ||
|
|
23db16917c | ||
|
|
077f0120b7 | ||
|
|
1545d9782b | ||
|
|
62dea78e65 | ||
|
|
309ebd6805 | ||
|
|
3e3945461d | ||
|
|
d99837df61 | ||
|
|
fc37ae1b95 | ||
|
|
1a07cb6a01 | ||
|
|
3d6e1d0c84 | ||
|
|
5cd0613398 | ||
|
|
b011556841 | ||
|
|
2d0b499a14 | ||
|
|
210ac67701 | ||
|
|
6ff8ee69f2 | ||
|
|
16c80cbf4b | ||
|
|
d02ce3cd8f | ||
|
|
df639be579 | ||
|
|
86678b0871 | ||
|
|
90be659c13 | ||
|
|
c51c900d1c | ||
|
|
cf1c2c39f4 | ||
|
|
5b34685cd4 | ||
|
|
81114acfa2 | ||
|
|
3e5671f39e | ||
|
|
9b33169fcc | ||
|
|
f9513d3615 | ||
|
|
ad4e6560d6 | ||
|
|
91c0fd1165 | ||
|
|
3534466a58 | ||
|
|
7a3e153319 | ||
|
|
918790cad4 | ||
|
|
b4426e48db | ||
|
|
a9c1d6a170 | ||
|
|
d9429418e9 | ||
|
|
aa89b6f13c | ||
|
|
7986f2ab46 | ||
|
|
936f538343 | ||
|
|
0310d23eb4 | ||
|
|
392c473839 | ||
|
|
84502bff4a | ||
|
|
b42daead36 | ||
|
|
314efc87f6 | ||
|
|
3f20fac752 | ||
|
|
f916008a3b | ||
|
|
1a94c4cb7c | ||
|
|
937fa23569 | ||
|
|
be1ecf306a | ||
|
|
8ebb2f85ed | ||
|
|
116679a5c9 | ||
|
|
bf95af4e58 | ||
|
|
8a709af86f | ||
|
|
46c849ea9e | ||
|
|
49b8a8c6d7 | ||
|
|
88b36becbb | ||
|
|
e800159b1e | ||
|
|
da2902dd67 | ||
|
|
09cc7ca646 | ||
|
|
e1d6defaf6 | ||
|
|
0c10027fa4 | ||
|
|
0b3a12ce33 | ||
|
|
0ea8719dbf | ||
|
|
8fc6d64219 | ||
|
|
47988a3707 | ||
|
|
3d06ee6aec | ||
|
|
49c67bd86d | ||
|
|
2b1007f7af | ||
|
|
436a22f0c7 | ||
|
|
e3fdc6854d | ||
|
|
62bc84920a | ||
|
|
7b67ea19d8 | ||
|
|
aa93b6a6d2 | ||
|
|
6fc807e3ce | ||
|
|
605927359d | ||
|
|
9f870572f4 | ||
|
|
aec0583a89 | ||
|
|
db95fe5147 | ||
|
|
a21df99b0b | ||
|
|
79de5d09c7 | ||
|
|
0d1265d533 | ||
|
|
797a0ce498 | ||
|
|
494673a371 | ||
|
|
2299d0b89c | ||
|
|
c5806799a4 | ||
|
|
f44d03c4c7 | ||
|
|
b7666cca6d | ||
|
|
3568799c32 | ||
|
|
47a8427448 | ||
|
|
2899291162 | ||
|
|
a390734890 | ||
|
|
6995e86752 | ||
|
|
dbd2b0ae51 | ||
|
|
f9141a7f4f | ||
|
|
15b80cf48f | ||
|
|
030a0a20da | ||
|
|
a1f2e0f424 | ||
|
|
581db06f0f | ||
|
|
93ffc9d67b | ||
|
|
e6c1117a11 | ||
|
|
dcf233e7c2 | ||
|
|
47437ce496 | ||
|
|
aeee5a2e9c | ||
|
|
9b81c60f1e | ||
|
|
72e745c1f4 | ||
|
|
3ffedc83fa | ||
|
|
017096df73 | ||
|
|
f3507c4046 |
34
.eslintrc.js
34
.eslintrc.js
@@ -1,34 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
es2021: true,
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
Game: 'writable',
|
|
||||||
l: 'readonly',
|
|
||||||
b64_to_utf8: 'readonly',
|
|
||||||
utf8_to_b64: 'readonly',
|
|
||||||
BeautifyAll: 'readonly',
|
|
||||||
PlaySound: 'readonly',
|
|
||||||
},
|
|
||||||
extends: ['airbnb-base', 'plugin:prettier/recommended'],
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 12,
|
|
||||||
},
|
|
||||||
ignorePatterns: ['*CookieMonster*.js', 'dist/*', 'node_modules/*'],
|
|
||||||
rules: {
|
|
||||||
'import/no-mutable-exports': 'off',
|
|
||||||
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
|
||||||
'func-names': 'off',
|
|
||||||
'prefer-destructuring': ['error', { object: true, array: false }],
|
|
||||||
'max-len': [
|
|
||||||
1,
|
|
||||||
{
|
|
||||||
code: 100,
|
|
||||||
ignoreComments: true,
|
|
||||||
ignoreStrings: true,
|
|
||||||
ignoreTemplateLiterals: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
48
.eslintrc.json
Normal file
48
.eslintrc.json
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true
|
||||||
|
},
|
||||||
|
"globals": {
|
||||||
|
"Game": "writable",
|
||||||
|
"l": "readonly",
|
||||||
|
"b64_to_utf8": "readonly",
|
||||||
|
"utf8_to_b64": "readonly",
|
||||||
|
"BeautifyAll": "readonly",
|
||||||
|
"PlaySound": "readonly"
|
||||||
|
},
|
||||||
|
"extends": ["airbnb-base", "prettier"],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 12
|
||||||
|
},
|
||||||
|
"plugins": ["@typescript-eslint"],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["src/**/*.{ts,tsx}"],
|
||||||
|
"extends": ["plugin:@typescript-eslint/recommended"],
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"rules": {
|
||||||
|
"import/extensions": "off", // To allow importing .ts without errors
|
||||||
|
"import/no-unresolved": "off" // To allow importing .ts without errors
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ignorePatterns": ["*CookieMonster*.js", "dist/*", "node_modules/*"],
|
||||||
|
"rules": {
|
||||||
|
"import/no-mutable-exports": "off", // We need to this throughout Cookie Monster
|
||||||
|
"no-plusplus": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"allowForLoopAfterthoughts": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"func-names": "off", // To allow unnamed arrow functions
|
||||||
|
"prefer-destructuring": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"object": true,
|
||||||
|
"array": false
|
||||||
|
}
|
||||||
|
] // Importing arrays and then destructuring them seems to fail
|
||||||
|
}
|
||||||
|
}
|
||||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -22,3 +22,5 @@ If applicable, add screenshots to help explain your problem.
|
|||||||
Please add a save file here.
|
Please add a save file here.
|
||||||
This makes debugging much easier as we do not always have a good test save to debug the issue
|
This makes debugging much easier as we do not always have a good test save to debug the issue
|
||||||
```
|
```
|
||||||
|
**Browser**
|
||||||
|
Please specify your current browser. This can help find/fix the bug!
|
||||||
|
|||||||
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
37
.github/workflows/CI.yml
vendored
37
.github/workflows/CI.yml
vendored
@@ -1,31 +1,32 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on: pull_request
|
on: pull_request
|
||||||
jobs:
|
jobs:
|
||||||
Check_ESLint:
|
Check_linting_test_and_build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
- name: Run ESLint
|
- name: Run ESLint
|
||||||
|
run: npx eslint src
|
||||||
|
- name: Run Mocha tests
|
||||||
|
run: npx mocha
|
||||||
|
- name: Check if CookieMonsterDev.js is built correctly
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npx webpack -o ./tmp --env production
|
||||||
npx eslint src
|
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
|
||||||
Check_main_file:
|
echo '### SUCCESS: CookieMonsterDev is correctly built! ###'
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Check if CookieMonster.js is built correctly
|
|
||||||
run: |
|
|
||||||
npm install
|
|
||||||
npx webpack -o ./test --env production
|
|
||||||
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 test/CookieMonster.js); then
|
|
||||||
echo '### SUCCESS: CookieMonster is correctly built! ###'
|
|
||||||
else
|
else
|
||||||
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
|
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if cmp <(head -n 2 CookieMonster.js) <(head -n 2 test/CookieMonster.js); then
|
- name: Check if CookieMonster.js is built correctly
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
run: |
|
||||||
|
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 dist/CookieMonster.js); then
|
||||||
echo '### SUCCESS: CookieMonster is correctly built! ###'
|
echo '### SUCCESS: CookieMonster is correctly built! ###'
|
||||||
else
|
else
|
||||||
echo '### WARNING: Make sure to move the file from the /dist folder to the main folder. Otherwise Github Pages won't notice it ###'
|
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to copy CookieMonsterDev.js into CookieMonster.js before merging to master! ###'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
16
.github/workflows/publish-dev.yml
vendored
Normal file
16
.github/workflows/publish-dev.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: Publish
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "dev"
|
||||||
|
jobs:
|
||||||
|
publish-dev:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: everlytic/branch-merge@1.1.0
|
||||||
|
with:
|
||||||
|
github_token: ${{ github.token }}
|
||||||
|
source_ref: 'dev'
|
||||||
|
target_branch: 'gh-pages'
|
||||||
|
commit_message_template: '[Automated] Merge {source_ref} into {target_branch}'
|
||||||
4
.mocharc.json
Normal file
4
.mocharc.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"recursive": true,
|
||||||
|
"require": ["esm", "ts-node/register"]
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"printWidth": 100,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"trailingComma": "all"
|
"trailingComma": "all"
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -4,16 +4,10 @@
|
|||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
const readyCheck = setInterval(() => {
|
const readyCheck = setInterval(() => {
|
||||||
const Game = unsafeWindow.Game;
|
const Game = unsafeWindow.Game;
|
||||||
|
|
||||||
if (
|
if (typeof Game !== 'undefined' && typeof Game.ready !== 'undefined' && Game.ready) {
|
||||||
typeof Game !== "undefined" &&
|
Game.LoadMod('https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonster.js');
|
||||||
typeof Game.ready !== "undefined" &&
|
clearInterval(readyCheck);
|
||||||
Game.ready
|
}
|
||||||
) {
|
|
||||||
Game.LoadMod(
|
|
||||||
"https://aktanusa.github.io/CookieMonster/CookieMonster.js"
|
|
||||||
);
|
|
||||||
clearInterval(readyCheck);
|
|
||||||
}
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014 Aktanusa
|
Copyright (c) 2021 CookieMonsterTeam
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
37
README.md
37
README.md
@@ -1,24 +1,27 @@
|
|||||||

|
[](https://github.com/CookieMonsterTeam/CookieMonster/actions/workflows/CI.yml)
|
||||||
## 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.
|
**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.
|
||||||
The mod helps you to *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**.
|
The mod helps you to *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
|
||||||
The `gh-pages` branch hosts the latest version intended for general users. All development and pull requests should target the `dev` branch.
|
The `master` branch hosts the latest production version intended for general users.
|
||||||
|
All development and pull requests should target the `dev` branch.
|
||||||
|
Github Pages is hosted from the `gh-pages` branch
|
||||||
|
|
||||||
### What it does
|
### What it does
|
||||||
|
|
||||||
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:
|
At its core, Cookie Monster computes an index for both buildings and upgrades: the **Payback Period (PP)**. CM will take *everything* in consideration, meaning if buying a building also unlocks an achievement which boosts your income, which unlocks an achievement, CM will know and highlight that building's value. CM uses the following formula to calculate the PP:
|
||||||
|
|
||||||
```
|
```
|
||||||
max(cost - cookies in bank, 0)/cps + cost/Δ cps
|
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.
|
If the relevant option is enabled, CM will color-code each of them based on their value. CM compares the PP across all possible buy options: if a buy 10 option is better than any of the buy 1 options Cookie Monster will colour them accordingly. Note that sometimes it is better to buy 10 of a building than to buy only 1, CM will also indicate this!
|
||||||
|
|
||||||
This index is computed for buildings and upgrades. If the relevant option is enabled, it will color-code each of them based on their value. It compares the PP across all possible buy options: if a buy 10 option is better than any of the buy 1 options Cookie Monster will colour them accordingly.
|
|
||||||
Cookie Monster uses the following standard colours:
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>The following standard colours are used:</summary>
|
||||||
|
|
||||||
* Light Blue: (upgrades) This item has a better PP than the best building to buy
|
* Light Blue: (upgrades) This item has a better PP than the best building to buy
|
||||||
* Green: This building has the best PP
|
* Green: This building has the best PP
|
||||||
* Yellow: This building is within the top 10 of best PP's
|
* Yellow: This building is within the top 10 of best PP's
|
||||||
@@ -27,6 +30,8 @@ Cookie Monster uses the following standard colours:
|
|||||||
* Purple: This building is worse than the top 10 of best PP's
|
* Purple: This building is worse than the top 10 of best PP's
|
||||||
* Gray: This item does not have a PP, often this means that there is no change to CPS
|
* Gray: This item does not have a PP, often this means that there is no change to CPS
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
@@ -37,7 +42,7 @@ Copy this code and save it as a bookmark. Paste it in the URL section. To activa
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
javascript: (function () {
|
javascript: (function () {
|
||||||
Game.LoadMod('https://aktanusa.github.io/CookieMonster/CookieMonster.js');
|
Game.LoadMod('https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonster.js');
|
||||||
}());
|
}());
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -51,24 +56,30 @@ If you'd rather use the addon as a [userscript](https://en.wikipedia.org/wiki/Us
|
|||||||
|
|
||||||
## Bugs and suggestions
|
## 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 us to close issues once they're fixed.
|
Any bug or suggestion should be **opened as an issue** [in the repository](https://github.com/CookieMonsterTeam/CookieMonster/issues) for easier tracking. This allows us 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 `dev` branch. This version can be tested by copying the `CookieMonster.js` file of the dev branch into your console. If the bug is still here, you can submit an issue for it. Please do so by using the bug report template.
|
Before submitting a bug, make sure to give a shot at the latest version of the addon on the `dev` branch. This version can be tested by copying the `CookieMonsterDev.js` file of the dev branch into your console. You can also load the dev-version by using `https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonsterDev.js` to load the mod. 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.
|
All suggestions are welcome, even the smallest ones.
|
||||||
|
|
||||||
|
## For developers
|
||||||
|
|
||||||
|
Cookie Monster exposes some of the data it creates to the global scope. This data can be found in the `CookieMonsterData` object after loading Cookie Monster.
|
||||||
|
|
||||||
|
Currently we exposes relevant data for buildings and upgrades (PP, colour and bonus income). If you would like us to add any aditional data, please feel free to open an issue or create a PR doing so!
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
To contribute you can fork and clone the repository and run `npm install`.
|
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.
|
Please also remember to run `npm run build` after saving all your changes to build the final `CookieMonsterDev.js` file.
|
||||||
|
|
||||||
|
Before pushing a new version to master and Github pages copy the `Dev` files into the normal files.
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
* **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author
|
* **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author
|
||||||
* **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer
|
* **[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
|
* **[BlackenedGem](https://github.com/BlackenedGem)**: Golden/Wrath Cookie Favicons
|
||||||
* **[Sandworm](https://github.com/svschouw)**: Modified PP calculation
|
* **[Sandworm](https://github.com/svschouw)**: Modified PP calculation
|
||||||
* **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer
|
* **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer
|
||||||
|
|||||||
5
dist/CookieMonster.js
vendored
5
dist/CookieMonster.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
3
dist/CookieMonsterDev.js
vendored
Normal file
3
dist/CookieMonsterDev.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
dist/CookieMonsterDev.js.LICENSE.txt
vendored
Normal file
10
dist/CookieMonsterDev.js.LICENSE.txt
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* jscolor - JavaScript Color Picker
|
||||||
|
*
|
||||||
|
* @link http://jscolor.com
|
||||||
|
* @license For open source use: GPLv3
|
||||||
|
* For commercial use: JSColor Commercial License
|
||||||
|
* @author Jan Odvarko - East Desire
|
||||||
|
*
|
||||||
|
* See usage examples at http://jscolor.com/examples/
|
||||||
|
*/
|
||||||
1
dist/CookieMonsterDev.js.map
vendored
Normal file
1
dist/CookieMonsterDev.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
13209
package-lock.json
generated
13209
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
134
package.json
134
package.json
@@ -1,67 +1,75 @@
|
|||||||
{
|
{
|
||||||
"name": "cookiemonster-mod",
|
"name": "cookiemonster-mod",
|
||||||
"version": "2.031.7",
|
"version": "2.031.7",
|
||||||
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
|
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
|
||||||
"main": "CookieMonster.js",
|
"main": "CookieMonster.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Cookie Clicker",
|
"Cookie Clicker",
|
||||||
"javascript",
|
"javascript",
|
||||||
"mod",
|
"mod",
|
||||||
"Dashnet",
|
"Dashnet",
|
||||||
"Orteil"
|
"Orteil"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"copy-file": "cp dist/CookieMonster.js CookieMonster.js",
|
"eslint-src": "eslint src test",
|
||||||
"eslint-src": "eslint src",
|
"build": "run-s eslint-src test pack-prod",
|
||||||
"build": "run-s eslint-src pack-prod remove-comment copy-file",
|
"build-test": "run-s pack-dev",
|
||||||
"build-test": "run-s pack-dev",
|
"pack-prod": "webpack --env production",
|
||||||
"pack-prod": "webpack --env production",
|
"pack-dev": "webpack",
|
||||||
"pack-dev": "webpack",
|
"test": "mocha"
|
||||||
"remove-comment": "sed -i '' -e '/\\/\\/# sourceMappingURL.*/d' dist/CookieMonster.js"
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/CookieMonsterTeam/CookieMonster"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"author": {
|
||||||
|
"name": "Aktanusa",
|
||||||
|
"email": "chanam.geo@yahoo.com"
|
||||||
|
},
|
||||||
|
"contributors": [
|
||||||
|
{
|
||||||
|
"name": "Daniël van Noord",
|
||||||
|
"email": "13665637+DanielNoord@users.noreply.github.com"
|
||||||
},
|
},
|
||||||
"repository": {
|
{
|
||||||
"type": "git",
|
"name": "Aran Leite",
|
||||||
"url": "git+https://github.com/Aktanusa/CookieMonster.git"
|
"email": "hyoretsu@gmail.com",
|
||||||
},
|
"url": "https://www.linkedin.com/in/aranleite"
|
||||||
"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-config-prettier": "^8.1.0",
|
|
||||||
"eslint-plugin-import": "^2.22.1",
|
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
|
||||||
"npm-run-all": "^4.1.5",
|
|
||||||
"prettier": "2.2.1",
|
|
||||||
"webpack": "^5.24.4",
|
|
||||||
"webpack-cli": "^4.5.0"
|
|
||||||
},
|
|
||||||
"ccrepo": {
|
|
||||||
"icon": [
|
|
||||||
10,
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"name": "Cookie Monster"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@eastdesire/jscolor": "^2.4.5"
|
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/CookieMonsterTeam/CookieMonster/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/CookieMonsterTeam/CookieMonster#readme",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/chai": "^4.2.19",
|
||||||
|
"@types/mocha": "^8.2.2",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^4.27.0",
|
||||||
|
"@typescript-eslint/parser": "^4.27.0",
|
||||||
|
"chai": "^4.3.4",
|
||||||
|
"eslint": "^7.29.0",
|
||||||
|
"eslint-config-airbnb-base": "^14.2.1",
|
||||||
|
"eslint-config-prettier": "^8.3.0",
|
||||||
|
"eslint-plugin-import": "^2.23.4",
|
||||||
|
"esm": "^3.2.25",
|
||||||
|
"mocha": "^8.4.0",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
|
"prettier": "2.3.1",
|
||||||
|
"ts-loader": "^9.2.3",
|
||||||
|
"ts-node": "^10.0.0",
|
||||||
|
"typescript": "^4.3.4",
|
||||||
|
"webpack": "^5.39.1",
|
||||||
|
"webpack-cli": "^4.7.2"
|
||||||
|
},
|
||||||
|
"ccrepo": {
|
||||||
|
"icon": [
|
||||||
|
10,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"name": "Cookie Monster"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@eastdesire/jscolor": "^2.4.5"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
ChoEggDiff,
|
ChoEggDiff, // eslint-disable-line no-unused-vars
|
||||||
ClicksDiff,
|
ClicksDiff, // eslint-disable-line no-unused-vars
|
||||||
CookiesDiff,
|
CookiesDiff, // eslint-disable-line no-unused-vars
|
||||||
WrinkDiff,
|
WrinkDiff, // eslint-disable-line no-unused-vars
|
||||||
WrinkFattestDiff,
|
WrinkFattestDiff, // eslint-disable-line no-unused-vars
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,11 +37,7 @@ export class CMAvgQueue {
|
|||||||
if (time > this.maxLength) time = this.maxLength;
|
if (time > this.maxLength) time = this.maxLength;
|
||||||
if (time > this.queue.length) time = this.queue.length;
|
if (time > this.queue.length) time = this.queue.length;
|
||||||
let ret = 0;
|
let ret = 0;
|
||||||
for (
|
for (let i = this.queue.length - 1; i >= 0 && i > this.queue.length - 1 - time; i--) {
|
||||||
let i = this.queue.length - 1;
|
|
||||||
i >= 0 && i > this.queue.length - 1 - time;
|
|
||||||
i--
|
|
||||||
) {
|
|
||||||
ret += this.queue[i];
|
ret += this.queue[i];
|
||||||
}
|
}
|
||||||
if (ret === 0) {
|
if (ret === 0) {
|
||||||
@@ -64,9 +60,9 @@ export class CMAvgQueue {
|
|||||||
* Called by CM.Cache.InitCache()
|
* Called by CM.Cache.InitCache()
|
||||||
*/
|
*/
|
||||||
export function InitCookiesDiff() {
|
export function InitCookiesDiff() {
|
||||||
CookiesDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
CookiesDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||||
WrinkDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
WrinkDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||||
WrinkFattestDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
WrinkFattestDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||||
ChoEggDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
ChoEggDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||||
ClicksDiff = new CMAvgQueue(ClickTimes[ClickTimes.length - 1]); // eslint-disable-line no-unused-vars
|
ClicksDiff = new CMAvgQueue(ClickTimes[ClickTimes.length - 1]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheAverageClicks,
|
CacheAverageClicks, // eslint-disable-line no-unused-vars
|
||||||
CacheAverageCPS,
|
CacheAverageCPS,
|
||||||
CacheAverageGainBank,
|
CacheAverageGainBank,
|
||||||
CacheAverageGainChoEgg,
|
CacheAverageGainChoEgg,
|
||||||
CacheAverageGainWrink,
|
CacheAverageGainWrink,
|
||||||
CacheAverageGainWrinkFattest,
|
CacheAverageGainWrinkFattest,
|
||||||
CacheAvgCPSWithChoEgg,
|
CacheAvgCPSWithChoEgg, // eslint-disable-line no-unused-vars
|
||||||
CacheLastChoEgg,
|
CacheLastChoEgg,
|
||||||
CacheLastClicks,
|
CacheLastClicks,
|
||||||
CacheLastCookies,
|
CacheLastCookies,
|
||||||
CacheLastCPSCheck,
|
CacheLastCPSCheck,
|
||||||
CacheLastWrinkCookies,
|
CacheLastWrinkCookies,
|
||||||
CacheLastWrinkFattestCookies,
|
CacheLastWrinkFattestCookies,
|
||||||
CacheRealCookiesEarned,
|
CacheRealCookiesEarned, // eslint-disable-line no-unused-vars
|
||||||
CacheSellForChoEgg,
|
CacheSellForChoEgg,
|
||||||
CacheWrinklersFattest,
|
CacheWrinklersFattest,
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal,
|
||||||
@@ -39,17 +39,15 @@ export default function CacheAvgCPS() {
|
|||||||
if ((Game.T / Game.fps) % 1 === 0) {
|
if ((Game.T / Game.fps) % 1 === 0) {
|
||||||
let choEggTotal = Game.cookies + CacheSellForChoEgg;
|
let choEggTotal = Game.cookies + CacheSellForChoEgg;
|
||||||
if (Game.cpsSucked > 0) choEggTotal += CacheWrinklersTotal;
|
if (Game.cpsSucked > 0) choEggTotal += CacheWrinklersTotal;
|
||||||
CacheRealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal); // eslint-disable-line no-unused-vars
|
CacheRealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal);
|
||||||
choEggTotal *= 0.05;
|
choEggTotal *= 0.05;
|
||||||
|
|
||||||
// Add recent gains to AvgQueue's
|
// Add recent gains to AvgQueue's
|
||||||
const timeDiff = currDate - CacheLastCPSCheck;
|
const timeDiff = currDate - CacheLastCPSCheck;
|
||||||
const bankDiffAvg = Math.max(0, Game.cookies - CacheLastCookies) / timeDiff;
|
const bankDiffAvg = Math.max(0, Game.cookies - CacheLastCookies) / timeDiff;
|
||||||
const wrinkDiffAvg =
|
const wrinkDiffAvg = Math.max(0, CacheWrinklersTotal - CacheLastWrinkCookies) / timeDiff;
|
||||||
Math.max(0, CacheWrinklersTotal - CacheLastWrinkCookies) / timeDiff;
|
|
||||||
const wrinkFattestDiffAvg =
|
const wrinkFattestDiffAvg =
|
||||||
Math.max(0, CacheWrinklersFattest[0] - CacheLastWrinkFattestCookies) /
|
Math.max(0, CacheWrinklersFattest[0] - CacheLastWrinkFattestCookies) / timeDiff;
|
||||||
timeDiff;
|
|
||||||
const choEggDiffAvg = Math.max(0, choEggTotal - CacheLastChoEgg) / timeDiff;
|
const choEggDiffAvg = Math.max(0, choEggTotal - CacheLastChoEgg) / timeDiff;
|
||||||
const clicksDiffAvg = (Game.cookieClicks - CacheLastClicks) / timeDiff;
|
const clicksDiffAvg = (Game.cookieClicks - CacheLastClicks) / timeDiff;
|
||||||
for (let i = 0; i < timeDiff; i++) {
|
for (let i = 0; i < timeDiff; i++) {
|
||||||
@@ -76,22 +74,16 @@ export default function CacheAvgCPS() {
|
|||||||
CacheAverageGainChoEgg = ChoEggDiff.calcAverage(cpsLength);
|
CacheAverageGainChoEgg = ChoEggDiff.calcAverage(cpsLength);
|
||||||
CacheAverageCPS = CacheAverageGainBank;
|
CacheAverageCPS = CacheAverageGainBank;
|
||||||
if (CMOptions.CalcWrink === 1) CacheAverageCPS += CacheAverageGainWrink;
|
if (CMOptions.CalcWrink === 1) CacheAverageCPS += CacheAverageGainWrink;
|
||||||
if (CMOptions.CalcWrink === 2)
|
if (CMOptions.CalcWrink === 2) CacheAverageCPS += CacheAverageGainWrinkFattest;
|
||||||
CacheAverageCPS += CacheAverageGainWrinkFattest;
|
|
||||||
|
|
||||||
const choEgg =
|
const choEgg = Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
||||||
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
|
||||||
|
|
||||||
if (choEgg || CMOptions.CalcWrink === 0) {
|
if (choEgg || CMOptions.CalcWrink === 0) {
|
||||||
CacheAvgCPSWithChoEgg =
|
CacheAvgCPSWithChoEgg =
|
||||||
CacheAverageGainBank +
|
CacheAverageGainBank + CacheAverageGainWrink + (choEgg ? CacheAverageGainChoEgg : 0);
|
||||||
CacheAverageGainWrink +
|
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
|
||||||
(choEgg ? CacheAverageGainChoEgg : 0);
|
|
||||||
} else CacheAvgCPSWithChoEgg = CacheAverageCPS; // eslint-disable-line no-unused-vars
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
CacheAverageClicks = ClicksDiff.calcAverage(
|
CacheAverageClicks = ClicksDiff.calcAverage(ClickTimes[CMOptions.AvgClicksHist]);
|
||||||
ClickTimes[CMOptions.AvgClicksHist],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
CacheCurrWrinklerCount,
|
|
||||||
CacheCurrWrinklerCPSMult,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the current Wrinkler CPS multiplier
|
* This functions caches the current Wrinkler CPS multiplier
|
||||||
@@ -22,8 +19,8 @@ export default function CacheCurrWrinklerCPS() {
|
|||||||
else if (godLvl === 2) godMult *= 1.1;
|
else if (godLvl === 2) godMult *= 1.1;
|
||||||
else if (godLvl === 3) godMult *= 1.05;
|
else if (godLvl === 3) godMult *= 1.05;
|
||||||
}
|
}
|
||||||
CacheCurrWrinklerCount = count; // eslint-disable-line no-unused-vars
|
CacheCurrWrinklerCount = count;
|
||||||
CacheCurrWrinklerCPSMult = // eslint-disable-line no-unused-vars
|
CacheCurrWrinklerCPSMult =
|
||||||
count *
|
count *
|
||||||
(count * 0.05 * 1.1) *
|
(count * 0.05 * 1.1) *
|
||||||
(Game.Has('Sacrilegious corruption') * 0.05 + 1) *
|
(Game.Has('Sacrilegious corruption') * 0.05 + 1) *
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
export default function GetCPSBuffMult() {
|
export default function GetCPSBuffMult() {
|
||||||
let mult = 1;
|
let mult = 1;
|
||||||
Object.keys(Game.buffs).forEach((i) => {
|
Object.keys(Game.buffs).forEach((i) => {
|
||||||
if (typeof Game.buffs[i].multCpS !== 'undefined')
|
if (typeof Game.buffs[i].multCpS !== 'undefined') mult *= Game.buffs[i].multCpS;
|
||||||
mult *= Game.buffs[i].multCpS;
|
|
||||||
});
|
});
|
||||||
return mult;
|
return mult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc';
|
import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc';
|
||||||
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData';
|
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function calculates CPS without the Golden Switch as it might be needed in other functions
|
* This function calculates CPS without the Golden Switch as it might be needed in other functions
|
||||||
@@ -9,5 +9,5 @@ import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData';
|
|||||||
export default function CacheNoGoldSwitchCPS() {
|
export default function CacheNoGoldSwitchCPS() {
|
||||||
if (Game.Has('Golden switch [off]')) {
|
if (Game.Has('Golden switch [off]')) {
|
||||||
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
|
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
|
||||||
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs; // eslint-disable-line no-unused-vars
|
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg';
|
import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg';
|
||||||
import { CacheSellForChoEgg } from '../VariablesAndData';
|
import { CacheSellForChoEgg } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the reward for selling the Chocolate egg
|
* This functions caches the reward for selling the Chocolate egg
|
||||||
@@ -20,5 +20,5 @@ export default function CacheSellAllForChoEgg() {
|
|||||||
}
|
}
|
||||||
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
||||||
sellTotal += SellBuildingsForChoEgg();
|
sellTotal += SellBuildingsForChoEgg();
|
||||||
CacheSellForChoEgg = sellTotal; // eslint-disable-line no-unused-vars
|
CacheSellForChoEgg = sellTotal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,22 +3,14 @@ import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
|
|||||||
import CacheAvgCPS from './CPS/CPS';
|
import CacheAvgCPS from './CPS/CPS';
|
||||||
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
||||||
import CachePP from './PP/PP';
|
import CachePP from './PP/PP';
|
||||||
import {
|
import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome';
|
||||||
CacheBuildingsPrices,
|
|
||||||
CacheIncome,
|
|
||||||
} from './PriceAndIncome/PriceAndIncome';
|
|
||||||
import { CacheChain } from './Stats/ChainCookies';
|
import { CacheChain } from './Stats/ChainCookies';
|
||||||
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
||||||
import CacheAllMissingUpgrades from './Stats/MissingUpgrades';
|
import CacheAllMissingUpgrades from './Stats/MissingUpgrades';
|
||||||
import CacheSeasonSpec from './Stats/Reindeer';
|
import CacheSeasonSpec from './Stats/Reindeer';
|
||||||
import {
|
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats';
|
||||||
CacheGoldenAndWrathCookiesMults,
|
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement';
|
||||||
CacheStatsCookies,
|
import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
} from './Stats/Stats';
|
|
||||||
import {
|
|
||||||
CacheAverageCookiesFromClicks,
|
|
||||||
HeavenlyChipsDiff,
|
|
||||||
} from './VariablesAndData';
|
|
||||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,11 +26,10 @@ export default function InitCache() {
|
|||||||
CacheSeasonSpec();
|
CacheSeasonSpec();
|
||||||
InitCookiesDiff();
|
InitCookiesDiff();
|
||||||
/** Used by CM.Cache.CacheHeavenlyChipsPS() */
|
/** Used by CM.Cache.CacheHeavenlyChipsPS() */
|
||||||
HeavenlyChipsDiff = new CMAvgQueue(5); // eslint-disable-line no-unused-vars
|
HeavenlyChipsDiff = new CMAvgQueue(5);
|
||||||
CacheAverageCookiesFromClicks = new CMAvgQueue( // eslint-disable-line no-unused-vars
|
CacheAverageCookiesFromClicks = new CMAvgQueue(ClickTimes[ClickTimes.length - 1] * 20);
|
||||||
ClickTimes[ClickTimes.length - 1] * 20,
|
|
||||||
);
|
|
||||||
CacheHeavenlyChipsPS();
|
CacheHeavenlyChipsPS();
|
||||||
|
AllAmountTillNextAchievement();
|
||||||
CacheAvgCPS();
|
CacheAvgCPS();
|
||||||
CacheIncome();
|
CacheIncome();
|
||||||
CacheBuildingsPrices();
|
CacheBuildingsPrices();
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { FormatTime } from '../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
import FormatTime from '../Disp/BeautifyAndFormatting/FormatTime';
|
||||||
import GetCPS from '../Disp/HelperFunctions/GetCPS';
|
import GetCPS from '../Disp/HelperFunctions/GetCPS';
|
||||||
import CacheAvgCPS from './CPS/CPS';
|
import CacheAvgCPS from './CPS/CPS';
|
||||||
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS';
|
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS';
|
||||||
import CachePP from './PP/PP';
|
import CachePP from './PP/PP';
|
||||||
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
||||||
import { CacheTimeTillNextPrestige } from './VariablesAndData';
|
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement';
|
||||||
|
import { CacheTimeTillNextPrestige } from './VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,15 +17,15 @@ export default function LoopCache() {
|
|||||||
CacheWrinklers();
|
CacheWrinklers();
|
||||||
|
|
||||||
CachePP();
|
CachePP();
|
||||||
|
AllAmountTillNextAchievement(false);
|
||||||
CacheCurrWrinklerCPS();
|
CacheCurrWrinklerCPS();
|
||||||
CacheAvgCPS();
|
CacheAvgCPS();
|
||||||
CacheHeavenlyChipsPS();
|
CacheHeavenlyChipsPS();
|
||||||
|
|
||||||
const cookiesToNext =
|
const cookiesToNext =
|
||||||
Game.HowManyCookiesReset(
|
Game.HowManyCookiesReset(
|
||||||
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) +
|
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1,
|
||||||
1,
|
|
||||||
) -
|
) -
|
||||||
(Game.cookiesEarned + Game.cookiesReset);
|
(Game.cookiesEarned + Game.cookiesReset);
|
||||||
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS()); // eslint-disable-line no-unused-vars
|
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData';
|
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the currently selected Dragon Auras
|
* This functions caches the currently selected Dragon Auras
|
||||||
*/
|
*/
|
||||||
export default function CacheDragonAuras() {
|
export default function CacheDragonAuras() {
|
||||||
CacheDragonAura = Game.dragonAura; // eslint-disable-line no-unused-vars
|
CacheDragonAura = Game.dragonAura;
|
||||||
CacheDragonAura2 = Game.dragonAura2; // eslint-disable-line no-unused-vars
|
CacheDragonAura2 = Game.dragonAura2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
/** Functions related to the Dragon */
|
/** Functions related to the Dragon */
|
||||||
|
|
||||||
import { Beautify } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../Disp/BeautifyAndFormatting/Beautify';
|
||||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||||
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import { CacheCostDragonUpgrade, CacheLastDragonLevel } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
CacheCostDragonUpgrade,
|
|
||||||
CacheLastDragonLevel,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the current cost of upgrading the dragon level so it can be displayed in the tooltip
|
* This functions caches the current cost of upgrading the dragon level so it can be displayed in the tooltip
|
||||||
@@ -17,9 +14,7 @@ export default function CacheDragonCost() {
|
|||||||
Game.dragonLevel < 25 &&
|
Game.dragonLevel < 25 &&
|
||||||
Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')
|
Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')
|
||||||
) {
|
) {
|
||||||
let target = Game.dragonLevels[Game.dragonLevel].buy
|
let target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];
|
||||||
.toString()
|
|
||||||
.match(/Objects\[(.*)\]/)[1];
|
|
||||||
const amount = Game.dragonLevels[Game.dragonLevel].buy
|
const amount = Game.dragonLevels[Game.dragonLevel].buy
|
||||||
.toString()
|
.toString()
|
||||||
.match(/sacrifice\((.*?)\)/)[1];
|
.match(/sacrifice\((.*?)\)/)[1];
|
||||||
@@ -34,10 +29,7 @@ export default function CacheDragonCost() {
|
|||||||
let price =
|
let price =
|
||||||
SimObjects[target].basePrice *
|
SimObjects[target].basePrice *
|
||||||
Game.priceIncrease **
|
Game.priceIncrease **
|
||||||
Math.max(
|
Math.max(0, SimObjects[target].amount - 1 - SimObjects[target].free);
|
||||||
0,
|
|
||||||
SimObjects[target].amount - 1 - SimObjects[target].free,
|
|
||||||
);
|
|
||||||
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
||||||
price = Math.ceil(price);
|
price = Math.ceil(price);
|
||||||
cost += price;
|
cost += price;
|
||||||
@@ -58,16 +50,13 @@ export default function CacheDragonCost() {
|
|||||||
let price =
|
let price =
|
||||||
SimObjects[target].basePrice *
|
SimObjects[target].basePrice *
|
||||||
Game.priceIncrease **
|
Game.priceIncrease **
|
||||||
Math.max(
|
Math.max(0, SimObjects[target].amount - 1 - SimObjects[target].free);
|
||||||
0,
|
|
||||||
SimObjects[target].amount - 1 - SimObjects[target].free,
|
|
||||||
);
|
|
||||||
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
||||||
price = Math.ceil(price);
|
price = Math.ceil(price);
|
||||||
cost += price;
|
cost += price;
|
||||||
SimObjects[target].amount -= 1;
|
SimObjects[target].amount -= 1;
|
||||||
}
|
}
|
||||||
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`; // eslint-disable-line no-unused-vars
|
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
|||||||
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColourGray } from '../../Disp/VariablesAndData';
|
import { ColourGray } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheMinPP,
|
CacheMinPP, // eslint-disable-line no-unused-vars
|
||||||
|
CacheMinPPBulk, // eslint-disable-line no-unused-vars
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
CacheObjects100,
|
CacheObjects100,
|
||||||
@@ -22,10 +23,7 @@ function CacheColour(target, amount) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
target[i].color = ColourOfPP(
|
target[i].color = ColourOfPP(target[i], Game.Objects[i].getSumPrice(amount));
|
||||||
target[i],
|
|
||||||
Game.Objects[i].getSumPrice(amount),
|
|
||||||
);
|
|
||||||
// Colour based on excluding certain top-buildings
|
// Colour based on excluding certain top-buildings
|
||||||
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
||||||
if (target[i].pp === CachePPArray[j][0]) target[i].color = ColourGray; // eslint-disable-line no-param-reassign
|
if (target[i].pp === CachePPArray[j][0]) target[i].color = ColourGray; // eslint-disable-line no-param-reassign
|
||||||
@@ -38,12 +36,11 @@ function CachePP(target, amount) {
|
|||||||
const price = Game.Objects[i].getSumPrice(amount);
|
const price = Game.Objects[i].getSumPrice(amount);
|
||||||
if (Game.cookiesPs) {
|
if (Game.cookiesPs) {
|
||||||
target[i].pp = // eslint-disable-line no-param-reassign
|
target[i].pp = // eslint-disable-line no-param-reassign
|
||||||
Math.max(price - (Game.cookies + GetWrinkConfigBank()), 0) /
|
Math.max(price - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs +
|
||||||
Game.cookiesPs +
|
|
||||||
price / target[i].bonus;
|
price / target[i].bonus;
|
||||||
} else target[i].pp = price / target[i].bonus; // eslint-disable-line no-param-reassign
|
} else target[i].pp = price / target[i].bonus; // eslint-disable-line no-param-reassign
|
||||||
if (!(CMOptions.PPRigidelMode && amount === 1))
|
if (!(CMOptions.PPRigidelMode && amount === 1))
|
||||||
CachePPArray.push([target[i].pp, amount]);
|
CachePPArray.push([target[i].pp, amount, price]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,16 +60,17 @@ export default function CacheBuildingsPP() {
|
|||||||
|
|
||||||
// Set CM.Cache.min to best non-excluded buidliung
|
// Set CM.Cache.min to best non-excluded buidliung
|
||||||
CachePPArray.sort((a, b) => a[0] - b[0]);
|
CachePPArray.sort((a, b) => a[0] - b[0]);
|
||||||
let indexOfMin = 0;
|
let indexOfMin = CMOptions.PPExcludeTop;
|
||||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
if (CMOptions.PPOnlyConsiderBuyable) {
|
||||||
while (CachePPArray[indexOfMin][1] > Game.cookies) {
|
while (CachePPArray[indexOfMin][2] > Game.cookies) {
|
||||||
indexOfMin += 1;
|
indexOfMin += 1;
|
||||||
if (CachePPArray.length === indexOfMin + 1) {
|
if (CachePPArray.length === indexOfMin + 1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CacheMinPP = CachePPArray[CMOptions.PPExcludeTop][indexOfMin]; // eslint-disable-line no-unused-vars
|
CacheMinPP = CachePPArray[indexOfMin][0];
|
||||||
|
CacheMinPPBulk = CachePPArray[indexOfMin][1];
|
||||||
|
|
||||||
CacheColour(CacheObjects1, 1);
|
CacheColour(CacheObjects1, 1);
|
||||||
CacheColour(CacheObjects10, 10);
|
CacheColour(CacheObjects10, 10);
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ export default function ColourOfPP(me, price) {
|
|||||||
|
|
||||||
// Colour based on price in terms of CPS
|
// Colour based on price in terms of CPS
|
||||||
if (Number(CMOptions.PPSecondsLowerLimit) !== 0) {
|
if (Number(CMOptions.PPSecondsLowerLimit) !== 0) {
|
||||||
if (price / GetCPS() < Number(CMOptions.PPSecondsLowerLimit))
|
if (price / GetCPS() < Number(CMOptions.PPSecondsLowerLimit)) color = ColourBlue;
|
||||||
color = ColourBlue;
|
|
||||||
}
|
}
|
||||||
// Colour based on being able to purchase
|
// Colour based on being able to purchase
|
||||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
if (CMOptions.PPOnlyConsiderBuyable) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Section: Functions related to caching PP */
|
* Section: Functions related to caching PP */
|
||||||
|
|
||||||
|
import { CacheObjects1, CacheObjects10, CacheObjects100, CacheUpgrades } from '../VariablesAndData';
|
||||||
import CacheBuildingsPP from './Building';
|
import CacheBuildingsPP from './Building';
|
||||||
import CacheUpgradePP from './Upgrade';
|
import CacheUpgradePP from './Upgrade';
|
||||||
|
|
||||||
@@ -11,4 +12,11 @@ import CacheUpgradePP from './Upgrade';
|
|||||||
export default function CachePP() {
|
export default function CachePP() {
|
||||||
CacheBuildingsPP();
|
CacheBuildingsPP();
|
||||||
CacheUpgradePP();
|
CacheUpgradePP();
|
||||||
|
window.CookieMonsterData.Objects1 = JSON.parse(JSON.stringify(CacheObjects1));
|
||||||
|
window.CookieMonsterData.Objects10 = JSON.parse(JSON.stringify(CacheObjects10));
|
||||||
|
window.CookieMonsterData.Objects100 = JSON.parse(JSON.stringify(CacheObjects100));
|
||||||
|
window.CookieMonsterData.Upgrades = [];
|
||||||
|
Object.entries(CacheUpgrades).forEach((i) => {
|
||||||
|
window.CookieMonsterData.Upgrades[i[0]] = JSON.parse(JSON.stringify(i[1]));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,20 +10,12 @@ export default function CacheUpgradePP() {
|
|||||||
Object.keys(CacheUpgrades).forEach((i) => {
|
Object.keys(CacheUpgrades).forEach((i) => {
|
||||||
if (Game.cookiesPs) {
|
if (Game.cookiesPs) {
|
||||||
CacheUpgrades[i].pp =
|
CacheUpgrades[i].pp =
|
||||||
Math.max(
|
Math.max(Game.Upgrades[i].getPrice() - (Game.cookies + GetWrinkConfigBank()), 0) /
|
||||||
Game.Upgrades[i].getPrice() - (Game.cookies + GetWrinkConfigBank()),
|
|
||||||
0,
|
|
||||||
) /
|
|
||||||
Game.cookiesPs +
|
Game.cookiesPs +
|
||||||
Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
||||||
} else
|
} else CacheUpgrades[i].pp = Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
||||||
CacheUpgrades[i].pp =
|
|
||||||
Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
|
||||||
if (Number.isNaN(CacheUpgrades[i].pp)) CacheUpgrades[i].pp = Infinity;
|
if (Number.isNaN(CacheUpgrades[i].pp)) CacheUpgrades[i].pp = Infinity;
|
||||||
|
|
||||||
CacheUpgrades[i].color = ColourOfPP(
|
CacheUpgrades[i].color = ColourOfPP(CacheUpgrades[i], Game.Upgrades[i].getPrice());
|
||||||
CacheUpgrades[i],
|
|
||||||
Game.Upgrades[i].getPrice(),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ import {
|
|||||||
CacheAverageGainBank,
|
CacheAverageGainBank,
|
||||||
CacheAverageGainWrink,
|
CacheAverageGainWrink,
|
||||||
CacheAverageGainWrinkFattest,
|
CacheAverageGainWrinkFattest,
|
||||||
CacheDoRemakeBuildPrices,
|
CacheDoRemakeBuildPrices, // eslint-disable-line no-unused-vars
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
CacheObjects100,
|
CacheObjects100,
|
||||||
|
CacheObjectsNextAchievement,
|
||||||
CacheUpgrades,
|
CacheUpgrades,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ function CacheBuildingIncome(amount) {
|
|||||||
result[i] = {};
|
result[i] = {};
|
||||||
result[i].bonus = BuyBuildingsBonusIncome(i, amount);
|
result[i].bonus = BuyBuildingsBonusIncome(i, amount);
|
||||||
if (amount !== 1) {
|
if (amount !== 1) {
|
||||||
CacheDoRemakeBuildPrices = 1; // eslint-disable-line no-unused-vars
|
CacheDoRemakeBuildPrices = 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
@@ -43,10 +44,8 @@ function CacheUpgradeIncome() {
|
|||||||
const bonusIncome = BuyUpgradesBonusIncome(i);
|
const bonusIncome = BuyUpgradesBonusIncome(i);
|
||||||
if (i === 'Elder Pledge') {
|
if (i === 'Elder Pledge') {
|
||||||
CacheUpgrades[i] = { bonus: Game.cookiesPs - CacheAverageGainBank };
|
CacheUpgrades[i] = { bonus: Game.cookiesPs - CacheAverageGainBank };
|
||||||
if (CMOptions.CalcWrink === 1)
|
if (CMOptions.CalcWrink === 1) CacheUpgrades[i].bonus -= CacheAverageGainWrink;
|
||||||
CacheUpgrades[i].bonus -= CacheAverageGainWrink;
|
else if (CMOptions.CalcWrink === 2) CacheUpgrades[i].bonus -= CacheAverageGainWrinkFattest;
|
||||||
else if (CMOptions.CalcWrink === 2)
|
|
||||||
CacheUpgrades[i].bonus -= CacheAverageGainWrinkFattest;
|
|
||||||
if (!Number.isFinite(CacheUpgrades[i].bonus)) CacheUpgrades[i].bonus = 0;
|
if (!Number.isFinite(CacheUpgrades[i].bonus)) CacheUpgrades[i].bonus = 0;
|
||||||
} else {
|
} else {
|
||||||
CacheUpgrades[i] = {};
|
CacheUpgrades[i] = {};
|
||||||
@@ -82,6 +81,13 @@ export function CacheBuildingsPrices() {
|
|||||||
Game.Objects[i].free,
|
Game.Objects[i].free,
|
||||||
100,
|
100,
|
||||||
);
|
);
|
||||||
|
CacheObjectsNextAchievement[i].price = BuildingGetPrice(
|
||||||
|
Game.Objects[i],
|
||||||
|
Game.Objects[i].basePrice,
|
||||||
|
Game.Objects[i].amount,
|
||||||
|
Game.Objects[i].free,
|
||||||
|
CacheObjectsNextAchievement[i].AmountNeeded,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||||
import {
|
import {
|
||||||
CacheChainFrenzyMaxReward,
|
CacheChainFrenzyMaxReward,
|
||||||
CacheChainFrenzyRequired,
|
CacheChainFrenzyRequired, // eslint-disable-line no-unused-vars
|
||||||
CacheChainFrenzyRequiredNext,
|
CacheChainFrenzyRequiredNext, // eslint-disable-line no-unused-vars
|
||||||
CacheChainFrenzyWrathMaxReward,
|
CacheChainFrenzyWrathMaxReward,
|
||||||
CacheChainFrenzyWrathRequired,
|
CacheChainFrenzyWrathRequired, // eslint-disable-line no-unused-vars
|
||||||
CacheChainFrenzyWrathRequiredNext,
|
CacheChainFrenzyWrathRequiredNext, // eslint-disable-line no-unused-vars
|
||||||
CacheChainMaxReward,
|
CacheChainMaxReward,
|
||||||
CacheChainRequired,
|
CacheChainRequired, // eslint-disable-line no-unused-vars
|
||||||
CacheChainRequiredNext,
|
CacheChainRequiredNext, // eslint-disable-line no-unused-vars
|
||||||
CacheChainWrathMaxReward,
|
CacheChainWrathMaxReward,
|
||||||
CacheChainWrathRequired,
|
CacheChainWrathRequired, // eslint-disable-line no-unused-vars
|
||||||
CacheChainWrathRequiredNext,
|
CacheChainWrathRequiredNext, // eslint-disable-line no-unused-vars
|
||||||
CacheDragonsFortuneMultAdjustment,
|
CacheDragonsFortuneMultAdjustment,
|
||||||
CacheGoldenCookiesMult,
|
CacheGoldenCookiesMult,
|
||||||
CacheNoGoldSwitchCookiesPS,
|
CacheNoGoldSwitchCookiesPS,
|
||||||
@@ -31,22 +31,15 @@ export function MaxChainCookieReward(digit, maxPayout, mult) {
|
|||||||
let moni = 0;
|
let moni = 0;
|
||||||
let nextMoni = 0;
|
let nextMoni = 0;
|
||||||
let nextRequired = 0;
|
let nextRequired = 0;
|
||||||
let chain =
|
let chain = 1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10);
|
||||||
1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10);
|
|
||||||
while (nextMoni < maxPayout * mult) {
|
while (nextMoni < maxPayout * mult) {
|
||||||
moni = Math.max(
|
moni = Math.max(
|
||||||
digit,
|
digit,
|
||||||
Math.min(
|
Math.min(Math.floor((1 / 9) * 10 ** chain * digit * mult), maxPayout * mult),
|
||||||
Math.floor((1 / 9) * 10 ** chain * digit * mult),
|
|
||||||
maxPayout * mult,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
nextMoni = Math.max(
|
nextMoni = Math.max(
|
||||||
digit,
|
digit,
|
||||||
Math.min(
|
Math.min(Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult), maxPayout * mult),
|
||||||
Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult),
|
|
||||||
maxPayout * mult,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
nextRequired = Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult);
|
nextRequired = Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult);
|
||||||
totalFromChain += moni;
|
totalFromChain += moni;
|
||||||
@@ -72,65 +65,28 @@ export function MaxChainCookieReward(digit, maxPayout, mult) {
|
|||||||
* @global {number} CM.Cache.ChainFrenzyWrathRequiredNext Total cookies needed for next level for wrath frenzy chain
|
* @global {number} CM.Cache.ChainFrenzyWrathRequiredNext Total cookies needed for next level for wrath frenzy chain
|
||||||
*/
|
*/
|
||||||
export function CacheChain() {
|
export function CacheChain() {
|
||||||
let maxPayout =
|
let maxPayout = CacheNoGoldSwitchCookiesPS * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment;
|
||||||
CacheNoGoldSwitchCookiesPS *
|
|
||||||
60 *
|
|
||||||
60 *
|
|
||||||
6 *
|
|
||||||
CacheDragonsFortuneMultAdjustment;
|
|
||||||
// Removes effect of Frenzy etc.
|
// Removes effect of Frenzy etc.
|
||||||
const cpsBuffMult = GetCPSBuffMult();
|
const cpsBuffMult = GetCPSBuffMult();
|
||||||
if (cpsBuffMult > 0) maxPayout /= cpsBuffMult;
|
if (cpsBuffMult > 0) maxPayout /= cpsBuffMult;
|
||||||
else maxPayout = 0;
|
else maxPayout = 0;
|
||||||
|
|
||||||
CacheChainMaxReward = MaxChainCookieReward(
|
CacheChainMaxReward = MaxChainCookieReward(7, maxPayout, CacheGoldenCookiesMult);
|
||||||
7,
|
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||||
maxPayout,
|
CacheChainRequiredNext = CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
CacheGoldenCookiesMult,
|
|
||||||
);
|
|
||||||
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult; // eslint-disable-line no-unused-vars
|
|
||||||
CacheChainRequiredNext = // eslint-disable-line no-unused-vars
|
|
||||||
CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
|
||||||
|
|
||||||
CacheChainWrathMaxReward = MaxChainCookieReward(
|
CacheChainWrathMaxReward = MaxChainCookieReward(6, maxPayout, CacheWrathCookiesMult);
|
||||||
6,
|
CacheChainWrathRequired = (CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||||
maxPayout,
|
CacheChainWrathRequiredNext =
|
||||||
CacheWrathCookiesMult,
|
CacheChainWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
);
|
|
||||||
CacheChainWrathRequired = // eslint-disable-line no-unused-vars
|
|
||||||
(CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
|
||||||
CacheChainWrathRequiredNext = // eslint-disable-line no-unused-vars
|
|
||||||
CacheChainWrathMaxReward[2] /
|
|
||||||
60 /
|
|
||||||
60 /
|
|
||||||
6 /
|
|
||||||
CacheDragonsFortuneMultAdjustment;
|
|
||||||
|
|
||||||
CacheChainFrenzyMaxReward = MaxChainCookieReward(
|
CacheChainFrenzyMaxReward = MaxChainCookieReward(7, maxPayout * 7, CacheGoldenCookiesMult);
|
||||||
7,
|
CacheChainFrenzyRequired = (CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||||
maxPayout * 7,
|
CacheChainFrenzyRequiredNext =
|
||||||
CacheGoldenCookiesMult,
|
CacheChainFrenzyMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
);
|
|
||||||
CacheChainFrenzyRequired = // eslint-disable-line no-unused-vars
|
|
||||||
(CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
|
||||||
CacheChainFrenzyRequiredNext = // eslint-disable-line no-unused-vars
|
|
||||||
CacheChainFrenzyMaxReward[2] /
|
|
||||||
60 /
|
|
||||||
60 /
|
|
||||||
6 /
|
|
||||||
CacheDragonsFortuneMultAdjustment;
|
|
||||||
|
|
||||||
CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(
|
CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(6, maxPayout * 7, CacheWrathCookiesMult);
|
||||||
6,
|
CacheChainFrenzyWrathRequired = (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||||
maxPayout * 7,
|
CacheChainFrenzyWrathRequiredNext =
|
||||||
CacheWrathCookiesMult,
|
CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
);
|
|
||||||
CacheChainFrenzyWrathRequired = // eslint-disable-line no-unused-vars
|
|
||||||
(CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
|
||||||
CacheChainFrenzyWrathRequiredNext = // eslint-disable-line no-unused-vars
|
|
||||||
CacheChainFrenzyWrathMaxReward[2] /
|
|
||||||
60 /
|
|
||||||
60 /
|
|
||||||
6 /
|
|
||||||
CacheDragonsFortuneMultAdjustment;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
CacheHCPerSecond,
|
CacheHCPerSecond, // eslint-disable-line no-unused-vars
|
||||||
CacheLastHeavenlyCheck,
|
CacheLastHeavenlyCheck,
|
||||||
CacheLastHeavenlyChips,
|
CacheLastHeavenlyChips,
|
||||||
HeavenlyChipsDiff,
|
HeavenlyChipsDiff,
|
||||||
@@ -15,15 +15,12 @@ export default function CacheHeavenlyChipsPS() {
|
|||||||
// Only calculate every new second
|
// Only calculate every new second
|
||||||
if ((Game.T / Game.fps) % 1 === 0) {
|
if ((Game.T / Game.fps) % 1 === 0) {
|
||||||
const chipsOwned = Game.HowMuchPrestige(Game.cookiesReset);
|
const chipsOwned = Game.HowMuchPrestige(Game.cookiesReset);
|
||||||
const ascendNowToOwn = Math.floor(
|
const ascendNowToOwn = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||||
Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned),
|
|
||||||
);
|
|
||||||
const ascendNowToGet = ascendNowToOwn - Math.floor(chipsOwned);
|
const ascendNowToGet = ascendNowToOwn - Math.floor(chipsOwned);
|
||||||
|
|
||||||
// Add recent gains to AvgQueue's
|
// Add recent gains to AvgQueue's
|
||||||
const timeDiff = currDate - CacheLastHeavenlyCheck;
|
const timeDiff = currDate - CacheLastHeavenlyCheck;
|
||||||
const heavenlyChipsDiffAvg =
|
const heavenlyChipsDiffAvg = Math.max(0, ascendNowToGet - CacheLastHeavenlyChips) / timeDiff;
|
||||||
Math.max(0, ascendNowToGet - CacheLastHeavenlyChips) / timeDiff;
|
|
||||||
for (let i = 0; i < timeDiff; i++) {
|
for (let i = 0; i < timeDiff; i++) {
|
||||||
HeavenlyChipsDiff.addLatest(heavenlyChipsDiffAvg);
|
HeavenlyChipsDiff.addLatest(heavenlyChipsDiffAvg);
|
||||||
}
|
}
|
||||||
@@ -33,6 +30,6 @@ export default function CacheHeavenlyChipsPS() {
|
|||||||
CacheLastHeavenlyChips = ascendNowToGet;
|
CacheLastHeavenlyChips = ascendNowToGet;
|
||||||
|
|
||||||
// Get average gain over period of 5 seconds
|
// Get average gain over period of 5 seconds
|
||||||
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5); // eslint-disable-line no-unused-vars
|
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades';
|
import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades';
|
||||||
import {
|
import {
|
||||||
CacheMissingUpgrades,
|
CacheMissingUpgrades, // eslint-disable-line no-unused-vars
|
||||||
CacheMissingUpgradesCookies,
|
CacheMissingUpgradesCookies, // eslint-disable-line no-unused-vars
|
||||||
CacheMissingUpgradesPrestige,
|
CacheMissingUpgradesPrestige, // eslint-disable-line no-unused-vars
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,11 +38,7 @@ export default function CacheAllMissingUpgrades() {
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str;
|
if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str;
|
||||||
else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str;
|
else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str;
|
||||||
else if (
|
else if (me.pool !== 'toggle' && me.pool !== 'unused' && me.pool !== 'debug')
|
||||||
me.pool !== 'toggle' &&
|
|
||||||
me.pool !== 'unused' &&
|
|
||||||
me.pool !== 'debug'
|
|
||||||
)
|
|
||||||
CacheMissingUpgrades += str;
|
CacheMissingUpgrades += str;
|
||||||
/* eslint-enable no-unused-vars */
|
/* eslint-enable no-unused-vars */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { CacheSeaSpec } from '../VariablesAndData';
|
import { CacheSeaSpec } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the reward of popping a reindeer
|
* This functions caches the reward of popping a reindeer
|
||||||
@@ -11,6 +11,6 @@ export default function CacheSeasonSpec() {
|
|||||||
if (Game.hasBuff('Elder frenzy')) val *= 0.5;
|
if (Game.hasBuff('Elder frenzy')) val *= 0.5;
|
||||||
if (Game.hasBuff('Frenzy')) val *= 0.75;
|
if (Game.hasBuff('Frenzy')) val *= 0.75;
|
||||||
CacheSeaSpec = Math.max(25, val);
|
CacheSeaSpec = Math.max(25, val);
|
||||||
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2; // eslint-disable-line no-unused-vars
|
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,17 +4,17 @@ import SimHas from '../../Sim/ReplacedGameFunctions/SimHas';
|
|||||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||||
import {
|
import {
|
||||||
CacheConjure,
|
CacheConjure,
|
||||||
CacheConjureReward,
|
CacheConjureReward, // eslint-disable-line no-unused-vars
|
||||||
CacheDragonsFortuneMultAdjustment,
|
CacheDragonsFortuneMultAdjustment,
|
||||||
CacheEdifice,
|
CacheEdifice,
|
||||||
CacheEdificeBuilding,
|
CacheEdificeBuilding, // eslint-disable-line no-unused-vars
|
||||||
CacheGoldenCookiesMult,
|
CacheGoldenCookiesMult,
|
||||||
CacheLucky,
|
CacheLucky,
|
||||||
CacheLuckyFrenzy,
|
CacheLuckyFrenzy,
|
||||||
CacheLuckyReward,
|
CacheLuckyReward, // eslint-disable-line no-unused-vars
|
||||||
CacheLuckyRewardFrenzy,
|
CacheLuckyRewardFrenzy, // eslint-disable-line no-unused-vars
|
||||||
CacheLuckyWrathReward,
|
CacheLuckyWrathReward, // eslint-disable-line no-unused-vars
|
||||||
CacheLuckyWrathRewardFrenzy,
|
CacheLuckyWrathRewardFrenzy, // eslint-disable-line no-unused-vars
|
||||||
CacheNoGoldSwitchCookiesPS,
|
CacheNoGoldSwitchCookiesPS,
|
||||||
CacheWrathCookiesMult,
|
CacheWrathCookiesMult,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
@@ -28,15 +28,13 @@ export function CacheStatsCookies() {
|
|||||||
const cpsBuffMult = GetCPSBuffMult();
|
const cpsBuffMult = GetCPSBuffMult();
|
||||||
if (cpsBuffMult > 0) CacheLucky /= cpsBuffMult;
|
if (cpsBuffMult > 0) CacheLucky /= cpsBuffMult;
|
||||||
else CacheLucky = 0;
|
else CacheLucky = 0;
|
||||||
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13; // eslint-disable-line no-unused-vars
|
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13;
|
||||||
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13; // eslint-disable-line no-unused-vars
|
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13;
|
||||||
CacheLuckyFrenzy = CacheLucky * 7;
|
CacheLuckyFrenzy = CacheLucky * 7;
|
||||||
CacheLuckyRewardFrenzy = // eslint-disable-line no-unused-vars
|
CacheLuckyRewardFrenzy = CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||||
CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
CacheLuckyWrathRewardFrenzy = CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||||
CacheLuckyWrathRewardFrenzy = // eslint-disable-line no-unused-vars
|
|
||||||
CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
|
||||||
CacheConjure = CacheLucky * 2;
|
CacheConjure = CacheLucky * 2;
|
||||||
CacheConjureReward = CacheConjure * 0.15; // eslint-disable-line no-unused-vars
|
CacheConjureReward = CacheConjure * 0.15;
|
||||||
|
|
||||||
CacheEdifice = 0;
|
CacheEdifice = 0;
|
||||||
let max = 0;
|
let max = 0;
|
||||||
@@ -52,7 +50,7 @@ export function CacheStatsCookies() {
|
|||||||
Game.Objects[i].price * 2 > CacheEdifice
|
Game.Objects[i].price * 2 > CacheEdifice
|
||||||
) {
|
) {
|
||||||
CacheEdifice = Game.Objects[i].price * 2;
|
CacheEdifice = Game.Objects[i].price * 2;
|
||||||
CacheEdificeBuilding = i; // eslint-disable-line no-unused-vars
|
CacheEdificeBuilding = i;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -84,7 +82,6 @@ export function CacheGoldenAndWrathCookiesMults() {
|
|||||||
// Otherwise, the aura effect will be factored in the base CPS making the multiplier not requiring adjustment.
|
// Otherwise, the aura effect will be factored in the base CPS making the multiplier not requiring adjustment.
|
||||||
CacheDragonsFortuneMultAdjustment = 1;
|
CacheDragonsFortuneMultAdjustment = 1;
|
||||||
if (Game.shimmerTypes.golden.n === 0) {
|
if (Game.shimmerTypes.golden.n === 0) {
|
||||||
CacheDragonsFortuneMultAdjustment *=
|
CacheDragonsFortuneMultAdjustment *= 1 + Game.auraMult("Dragon's Fortune") * 1.23;
|
||||||
1 + Game.auraMult("Dragon's Fortune") * 1.23;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import { CacheObjectsNextAchievement } from '../VariablesAndData';
|
||||||
|
import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This functions caches the amount of buildings needed till next achievement
|
||||||
|
* @param {boolean} forceRecalc Whether a recalcution should be forced (after CPS change)
|
||||||
|
*/
|
||||||
|
export default function AllAmountTillNextAchievement(forceRecalc) {
|
||||||
|
const result = {};
|
||||||
|
|
||||||
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
|
if (
|
||||||
|
Object.keys(CacheObjectsNextAchievement).length !== 0 &&
|
||||||
|
CacheObjectsNextAchievement[i].TotalNeeded > Game.Objects[i].amount &&
|
||||||
|
!forceRecalc
|
||||||
|
) {
|
||||||
|
result[i] = {
|
||||||
|
AmountNeeded: CacheObjectsNextAchievement[i].TotalNeeded - Game.Objects[i].amount,
|
||||||
|
TotalNeeded: CacheObjectsNextAchievement[i].TotalNeeded,
|
||||||
|
price: Game.Objects[i].getSumPrice(
|
||||||
|
CacheObjectsNextAchievement[i].TotalNeeded - Game.Objects[i].amount,
|
||||||
|
),
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
const tillNext = IndividualAmountTillNextAchievement(i);
|
||||||
|
result[i] = {
|
||||||
|
AmountNeeded: tillNext,
|
||||||
|
TotalNeeded: Game.Objects[i].amount + tillNext,
|
||||||
|
price: Game.Objects[i].getSumPrice(tillNext),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
CacheObjectsNextAchievement = result; // eslint-disable-line no-unused-vars
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||||
|
import { SimAchievementsOwned } from '../../Sim/VariablesAndData';
|
||||||
|
|
||||||
|
export default function IndividualAmountTillNextAchievement(building) {
|
||||||
|
const AchievementsAtStart = Game.AchievementsOwned;
|
||||||
|
let index = 100;
|
||||||
|
let lastIndexWithChange = 100;
|
||||||
|
while (index > -1) {
|
||||||
|
BuyBuildingsBonusIncome(building, index);
|
||||||
|
if (SimAchievementsOwned > AchievementsAtStart) {
|
||||||
|
lastIndexWithChange = index;
|
||||||
|
index -= 10;
|
||||||
|
} else if (index === 100) {
|
||||||
|
return 101;
|
||||||
|
} else {
|
||||||
|
index += 1;
|
||||||
|
while (index <= lastIndexWithChange) {
|
||||||
|
BuyBuildingsBonusIncome(building, index);
|
||||||
|
if (SimAchievementsOwned > AchievementsAtStart) {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
index += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 101;
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@ export let CacheLastChoEgg = 0;
|
|||||||
export let CacheObjects1 = {};
|
export let CacheObjects1 = {};
|
||||||
export let CacheObjects10 = {};
|
export let CacheObjects10 = {};
|
||||||
export let CacheObjects100 = {};
|
export let CacheObjects100 = {};
|
||||||
|
export let CacheObjectsNextAchievement = {};
|
||||||
|
|
||||||
export let CacheWrinklersTotal = 0;
|
export let CacheWrinklersTotal = 0;
|
||||||
export let CacheWrinklersNormal = 0;
|
export let CacheWrinklersNormal = 0;
|
||||||
@@ -68,6 +69,8 @@ export let CacheTimeTillNextPrestige = 0;
|
|||||||
|
|
||||||
/** Stores lowest PP value */
|
/** Stores lowest PP value */
|
||||||
export let CacheMinPP = 0;
|
export let CacheMinPP = 0;
|
||||||
|
/** Stores lowest PP value category */
|
||||||
|
export let CacheMinPPBulk = 0;
|
||||||
/** Stores all PP values of all buildings for all buy settings (1, 10, 100) */
|
/** Stores all PP values of all buildings for all buy settings (1, 10, 100) */
|
||||||
export let CachePPArray = [];
|
export let CachePPArray = [];
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheWrinklersFattest,
|
CacheWrinklersFattest,
|
||||||
CacheWrinklersNormal,
|
CacheWrinklersNormal, // eslint-disable-line no-unused-vars
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal, // eslint-disable-line no-unused-vars
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,11 +31,10 @@ export default function CacheWrinklers() {
|
|||||||
else if (godLvl === 2) sucked *= 1.1;
|
else if (godLvl === 2) sucked *= 1.1;
|
||||||
else if (godLvl === 3) sucked *= 1.05;
|
else if (godLvl === 3) sucked *= 1.05;
|
||||||
}
|
}
|
||||||
CacheWrinklersTotal += sucked; // eslint-disable-line no-unused-vars
|
CacheWrinklersTotal += sucked;
|
||||||
if (Game.wrinklers[i].type === 0) {
|
if (Game.wrinklers[i].type === 0) {
|
||||||
CacheWrinklersNormal += sucked; // eslint-disable-line no-unused-vars
|
CacheWrinklersNormal += sucked;
|
||||||
if (sucked > CacheWrinklersFattest[0])
|
if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i];
|
||||||
CacheWrinklersFattest = [sucked, i];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import ConfigDefault from '../../Data/SettingsDefault';
|
import ConfigDefault from '../../Data/SettingsDefault.ts';
|
||||||
import ConfigData from '../../Data/SettingsData';
|
import ConfigData from '../../Data/SettingsData';
|
||||||
import { CMOptions } from '../VariablesAndData';
|
import { CMOptions } from '../VariablesAndData';
|
||||||
import save from '../../InitSaveLoad/save';
|
import save from '../../InitSaveLoad/save';
|
||||||
@@ -19,14 +19,8 @@ export function SaveConfig() {
|
|||||||
);
|
);
|
||||||
const CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
|
const CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
|
||||||
if (CookieMonsterSave !== null) {
|
if (CookieMonsterSave !== null) {
|
||||||
const newSaveString = saveString.replace(
|
const newSaveString = saveString.replace(CookieMonsterSave[0], `CookieMonster:${save()}`);
|
||||||
CookieMonsterSave[0],
|
localStorage.setItem('CookieClickerGame', escape(`${utf8_to_b64(newSaveString)}!END!`));
|
||||||
`CookieMonster:${save()}`,
|
|
||||||
);
|
|
||||||
localStorage.setItem(
|
|
||||||
'CookieClickerGame',
|
|
||||||
escape(`${utf8_to_b64(newSaveString)}!END!`),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,15 +7,9 @@ import { CMOptions } from './VariablesAndData';
|
|||||||
* This function changes the position of both the bottom and timer bar
|
* This function changes the position of both the bottom and timer bar
|
||||||
*/
|
*/
|
||||||
export function UpdateBotTimerBarPosition() {
|
export function UpdateBotTimerBarPosition() {
|
||||||
if (
|
if (CMOptions.BotBar === 1 && CMOptions.TimerBar === 1 && CMOptions.TimerBarPos === 1) {
|
||||||
CMOptions.BotBar === 1 &&
|
|
||||||
CMOptions.TimerBar === 1 &&
|
|
||||||
CMOptions.TimerBarPos === 1
|
|
||||||
) {
|
|
||||||
l('CMBotBar').style.bottom = l('CMTimerBar').style.height;
|
l('CMBotBar').style.bottom = l('CMTimerBar').style.height;
|
||||||
l('game').style.bottom = `${
|
l('game').style.bottom = `${Number(l('CMTimerBar').style.height.replace('px', '')) + 70}px`;
|
||||||
Number(l('CMTimerBar').style.height.replace('px', '')) + 70
|
|
||||||
}px`;
|
|
||||||
} else if (CMOptions.BotBar === 1) {
|
} else if (CMOptions.BotBar === 1) {
|
||||||
l('CMBotBar').style.bottom = '0px';
|
l('CMBotBar').style.bottom = '0px';
|
||||||
l('game').style.bottom = '70px';
|
l('game').style.bottom = '70px';
|
||||||
|
|||||||
@@ -17,16 +17,13 @@ export function ToggleConfig(config) {
|
|||||||
|
|
||||||
if (CMOptions[config] === ConfigData[config].label.length) {
|
if (CMOptions[config] === ConfigData[config].label.length) {
|
||||||
CMOptions[config] = 0;
|
CMOptions[config] = 0;
|
||||||
if (ConfigData[config].toggle)
|
if (ConfigData[config].toggle) l(ConfigPrefix + config).className = 'option off';
|
||||||
l(ConfigPrefix + config).className = 'option off';
|
|
||||||
} else l(ConfigPrefix + config).className = 'option';
|
} else l(ConfigPrefix + config).className = 'option';
|
||||||
|
|
||||||
if (typeof ConfigData[config].func !== 'undefined') {
|
if (typeof ConfigData[config].func !== 'undefined') {
|
||||||
ConfigData[config].func();
|
ConfigData[config].func();
|
||||||
}
|
}
|
||||||
|
|
||||||
l(ConfigPrefix + config).innerHTML =
|
|
||||||
ConfigData[config].label[CMOptions[config]];
|
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import { FavouriteSettings } from '../../Disp/VariablesAndData';
|
|||||||
*/
|
*/
|
||||||
export default function ToggleFavouriteSetting(config) {
|
export default function ToggleFavouriteSetting(config) {
|
||||||
if (FavouriteSettings.includes(config))
|
if (FavouriteSettings.includes(config))
|
||||||
FavouriteSettings = FavouriteSettings.filter(function (ele) {
|
FavouriteSettings = FavouriteSettings.filter((ele) => ele !== config);
|
||||||
return ele !== config;
|
|
||||||
});
|
|
||||||
else FavouriteSettings.push(config);
|
else FavouriteSettings.push(config);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** Data copied directly from the game */
|
/** Data copied directly from the game */
|
||||||
|
|
||||||
/** Array of the names of all fortune cookies obtainable from the ticker */
|
/** Array of the names of all fortune cookies obtainable from the ticker */
|
||||||
export const Fortunes = [
|
export const Fortunes: string[] = [
|
||||||
'Fortune #001',
|
'Fortune #001',
|
||||||
'Fortune #002',
|
'Fortune #002',
|
||||||
'Fortune #003',
|
'Fortune #003',
|
||||||
@@ -28,7 +28,7 @@ export const Fortunes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all Halloween cookies */
|
/** Array of the names of all Halloween cookies */
|
||||||
export const HalloCookies = [
|
export const HalloCookies: string[] = [
|
||||||
'Skull cookies',
|
'Skull cookies',
|
||||||
'Ghost cookies',
|
'Ghost cookies',
|
||||||
'Bat cookies',
|
'Bat cookies',
|
||||||
@@ -39,7 +39,7 @@ export const HalloCookies = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all Christmas cookies */
|
/** Array of the names of all Christmas cookies */
|
||||||
export const ChristCookies = [
|
export const ChristCookies: string[] = [
|
||||||
'Christmas tree biscuits',
|
'Christmas tree biscuits',
|
||||||
'Snowflake biscuits',
|
'Snowflake biscuits',
|
||||||
'Snowman biscuits',
|
'Snowman biscuits',
|
||||||
@@ -50,7 +50,7 @@ export const ChristCookies = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all Valentine cookies */
|
/** Array of the names of all Valentine cookies */
|
||||||
export const ValCookies = [
|
export const ValCookies: string[] = [
|
||||||
'Pure heart biscuits',
|
'Pure heart biscuits',
|
||||||
'Ardent heart biscuits',
|
'Ardent heart biscuits',
|
||||||
'Sour heart biscuits',
|
'Sour heart biscuits',
|
||||||
@@ -61,7 +61,7 @@ export const ValCookies = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all plant drops */
|
/** Array of the names of all plant drops */
|
||||||
export const PlantDrops = [
|
export const PlantDrops: string[] = [
|
||||||
'Elderwort biscuits',
|
'Elderwort biscuits',
|
||||||
'Bakeberry cookies',
|
'Bakeberry cookies',
|
||||||
'Duketater cookies',
|
'Duketater cookies',
|
||||||
@@ -72,7 +72,7 @@ export const PlantDrops = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** All possible effects plants and other items can have with a display-title */
|
/** All possible effects plants and other items can have with a display-title */
|
||||||
export const Effects = {
|
export const Effects: { [index: string]: string } = {
|
||||||
buildingCost: 'Building prices',
|
buildingCost: 'Building prices',
|
||||||
click: 'Cookies per click',
|
click: 'Cookies per click',
|
||||||
cps: 'Total CPS',
|
cps: 'Total CPS',
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
/** Data related directly to Cookie Monster */
|
|
||||||
|
|
||||||
export const VersionMajor = '2.031';
|
|
||||||
export const VersionMinor = '7';
|
|
||||||
|
|
||||||
/** Information about Cookie Monster to be displayed in the info section */
|
|
||||||
export const ModDescription = `<div class="listing">
|
|
||||||
<a href="https://github.com/Aktanusa/CookieMonster" target="blank">Cookie Monster</a>
|
|
||||||
offers a wide range of tools and statistics to enhance your game experience.
|
|
||||||
It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.</br>
|
|
||||||
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
|
|
||||||
Please also report any bugs you may find over there!</br>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
|
||||||
export const LatestReleaseNotes = `<div class="listing">
|
|
||||||
These are the release notes for the latest update (v 2.031.7).</br>
|
|
||||||
</br>
|
|
||||||
This update implements the following functions:</br>
|
|
||||||
- Updated the ordering and description of all settings of Cookie Monster</br>
|
|
||||||
- Colours of Flash notifications can now be set by the user</br>
|
|
||||||
- You can now select a number of settings to be your 'favourite'. They will be displayed at the top of all other settings in a new section. This functionality is toggleable and you can find it in the miscellaneous section</br>
|
|
||||||
- The statistics page now shows cookies earned by clicking for a selected time period</br>
|
|
||||||
- The statistics page can now show missing normal achievements, this can be toggled in the settings</br>
|
|
||||||
</br>
|
|
||||||
This update fixes the following bugs:</br>
|
|
||||||
- Fixed some typo's</br>
|
|
||||||
- No longer show the wrinkler pop buttons when wrinklers can't spawn</br>
|
|
||||||
- Fixed incorrect calculation of plant maturity for relevant tooltips</br>
|
|
||||||
- Fixed edit prompts not working in settings</br>
|
|
||||||
- Fixed red and purple being switched around for PP colour coding</br>
|
|
||||||
- Fixed incorrect notation of numbers in Dragon tooltip and interface</br>
|
|
||||||
- Fixed incorrect calculation of changing Dragon aura cost</br>
|
|
||||||
- Fixed incorrect calculation of changing Pantheon gods effect</br>
|
|
||||||
- Fixed fluctuating PP values when god Cyclius was selected</br>
|
|
||||||
- Fixed black flickering when Golden Cookies or buffs start</br>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
32
src/Data/Moddata.ts
Normal file
32
src/Data/Moddata.ts
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/** Data related directly to Cookie Monster */
|
||||||
|
|
||||||
|
export const VersionMajor = '2.031';
|
||||||
|
export const VersionMinor = '9';
|
||||||
|
|
||||||
|
/** Information about Cookie Monster to be displayed in the info section */
|
||||||
|
export const ModDescription = `<div class="listing">
|
||||||
|
<a href="https://github.com/CookieMonsterTeam/CookieMonster" target="blank">Cookie Monster</a>
|
||||||
|
offers a wide range of tools and statistics to enhance your game experience.
|
||||||
|
It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.</br>
|
||||||
|
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
|
||||||
|
Please also report any bugs you may find over there!</br>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
||||||
|
export const LatestReleaseNotes = `<div class="listing">
|
||||||
|
This update implements the following functions:</br>
|
||||||
|
- For developers: we now expose some data calculated by Cookie Monster to the global scope. You can access it through the CookieMonsterData object</br>
|
||||||
|
- The column with the most optimal building now has a green coloured indicator whenever colour coding is turned on</br>
|
||||||
|
- The current season in the seasons statistics section is now displayed with green text for easier identification</br>
|
||||||
|
- New option to show a timer bar that counts down till next autosave</br>
|
||||||
|
- New option to sort buildings based on the "cost till next achievement"</br>
|
||||||
|
- Added extra information about achievements in statistics page</br>
|
||||||
|
</br>
|
||||||
|
This update fixes the following bugs:</br>
|
||||||
|
- Fixed a bug where ignoring certain buildings in rare cases did not create a "most optimal building"</br>
|
||||||
|
- Fixed some issues related to "left till achievement"</br>
|
||||||
|
- Fixed some cases where upgrades and buildings were not correctly sorted</br>
|
||||||
|
- Fixed the tooltip of "Pop all normal wrinklers" displaying an incorrect reward when Shiny's are present</br>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
/** Data related directly to the scales used by Cookie Monster */
|
/** Data related directly to the scales used by Cookie Monster */
|
||||||
|
|
||||||
/** Array of abbreviations used in the "Metric" scale */
|
/** Array of abbreviations used in the "Metric" scale */
|
||||||
export const metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
export const metric: string[] = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
||||||
|
|
||||||
/** Array of abbreviations used in the "Short" scale */
|
/** Array of abbreviations used in the "Short" scale */
|
||||||
export const shortScale = [
|
export const shortScale: string[] = [
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'M',
|
'M',
|
||||||
@@ -34,7 +34,7 @@ export const shortScale = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of abbreviations used in the "Abbreviated Short" scale */
|
/** Array of abbreviations used in the "Abbreviated Short" scale */
|
||||||
export const shortScaleAbbreviated = [
|
export const shortScaleAbbreviated: string[] = [
|
||||||
'',
|
'',
|
||||||
'K',
|
'K',
|
||||||
'M',
|
'M',
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/** Data related to the display titles of certain sections in menu screens */
|
/** Data related to the display titles of certain sections in menu screens */
|
||||||
|
|
||||||
/** Display titles of the headers of the Cookie Monster settings section */
|
/** Display titles of the headers of the Cookie Monster settings section */
|
||||||
export const ConfigGroups = {
|
export const ConfigGroups: { [index: string]: string } = {
|
||||||
Favourite: 'Favourite Settings',
|
Favourite: 'Favourite Settings',
|
||||||
Calculation: 'Calculation',
|
Calculation: 'Calculation',
|
||||||
Notation: 'Notation',
|
Notation: 'Notation',
|
||||||
@@ -14,7 +14,7 @@ export const ConfigGroups = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Display titles of the headers of the notification section of the Cookie Monster settings */
|
/** Display titles of the headers of the notification section of the Cookie Monster settings */
|
||||||
export const ConfigGroupsNotification = {
|
export const ConfigGroupsNotification: { [index: string]: string } = {
|
||||||
NotificationGeneral: 'General Notifications',
|
NotificationGeneral: 'General Notifications',
|
||||||
NotificationGC: 'Golden Cookie',
|
NotificationGC: 'Golden Cookie',
|
||||||
NotificationFC: 'Fortune Cookie',
|
NotificationFC: 'Fortune Cookie',
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/* eslint-disable max-classes-per-file */
|
|
||||||
/** This describes all forms of settings used by Cookie Monster */
|
|
||||||
|
|
||||||
/** The basic setting class */
|
|
||||||
export class Setting {
|
|
||||||
constructor(type, group) {
|
|
||||||
this.type = type;
|
|
||||||
this.group = group;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The standard toggle setting class */
|
|
||||||
export class SettingStandard extends Setting {
|
|
||||||
constructor(type, group, label, desc, toggle, func = null) {
|
|
||||||
super(type, group);
|
|
||||||
this.label = label;
|
|
||||||
this.desc = desc;
|
|
||||||
this.toggle = toggle;
|
|
||||||
if (func) {
|
|
||||||
this.func = func;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/** The colour picker setting class */
|
|
||||||
export class SettingColours extends Setting {
|
|
||||||
constructor(type, group, desc) {
|
|
||||||
super(type, group);
|
|
||||||
this.desc = desc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The volume level setting class */
|
|
||||||
export class SettingVolume extends Setting {
|
|
||||||
constructor(type, group, label, desc) {
|
|
||||||
super(type, group);
|
|
||||||
this.label = label;
|
|
||||||
this.desc = desc;
|
|
||||||
for (let i = 0; i < 101; i++) {
|
|
||||||
this.label[i] = `${i}%`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The number input setting class */
|
|
||||||
export class SettingInputNumber extends Setting {
|
|
||||||
constructor(type, group, label, desc, min, max) {
|
|
||||||
super(type, group);
|
|
||||||
this.label = label;
|
|
||||||
this.desc = desc;
|
|
||||||
this.min = min;
|
|
||||||
this.max = max;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
11
src/Data/SettingClasses/BaseSetting.ts
Normal file
11
src/Data/SettingClasses/BaseSetting.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/** The basic setting class */
|
||||||
|
export default class Setting {
|
||||||
|
type: string;
|
||||||
|
|
||||||
|
group: string;
|
||||||
|
|
||||||
|
constructor(type: string, group: string) {
|
||||||
|
this.type = type;
|
||||||
|
this.group = group;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
src/Data/SettingClasses/SettingColours.ts
Normal file
11
src/Data/SettingClasses/SettingColours.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import Setting from './BaseSetting';
|
||||||
|
|
||||||
|
/** The colour picker setting class */
|
||||||
|
export default class SettingColours extends Setting {
|
||||||
|
desc: string;
|
||||||
|
|
||||||
|
constructor(type: string, group: string, desc: string) {
|
||||||
|
super(type, group);
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
27
src/Data/SettingClasses/SettingInputNumber.ts
Normal file
27
src/Data/SettingClasses/SettingInputNumber.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import Setting from './BaseSetting';
|
||||||
|
|
||||||
|
/** The number input setting class */
|
||||||
|
export default class SettingInputNumber extends Setting {
|
||||||
|
label: string[];
|
||||||
|
|
||||||
|
desc: string;
|
||||||
|
|
||||||
|
min: number;
|
||||||
|
|
||||||
|
max: number;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
type: string,
|
||||||
|
group: string,
|
||||||
|
label: string[],
|
||||||
|
desc: string,
|
||||||
|
min: number,
|
||||||
|
max: number,
|
||||||
|
) {
|
||||||
|
super(type, group);
|
||||||
|
this.label = label;
|
||||||
|
this.desc = desc;
|
||||||
|
this.min = min;
|
||||||
|
this.max = max;
|
||||||
|
}
|
||||||
|
}
|
||||||
29
src/Data/SettingClasses/SettingStandard.ts
Normal file
29
src/Data/SettingClasses/SettingStandard.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import Setting from './BaseSetting';
|
||||||
|
|
||||||
|
/** The standard toggle setting class */
|
||||||
|
export default class SettingStandard extends Setting {
|
||||||
|
label: string[];
|
||||||
|
|
||||||
|
desc: string;
|
||||||
|
|
||||||
|
toggle: boolean;
|
||||||
|
|
||||||
|
func: () => void;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
type: string,
|
||||||
|
group: string,
|
||||||
|
label: string[],
|
||||||
|
desc: string,
|
||||||
|
toggle: boolean,
|
||||||
|
func?: () => void,
|
||||||
|
) {
|
||||||
|
super(type, group);
|
||||||
|
this.label = label;
|
||||||
|
this.desc = desc;
|
||||||
|
this.toggle = toggle;
|
||||||
|
if (func !== undefined) {
|
||||||
|
this.func = func;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
17
src/Data/SettingClasses/SettingVolume.ts
Normal file
17
src/Data/SettingClasses/SettingVolume.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import Setting from './BaseSetting';
|
||||||
|
|
||||||
|
/** The volume level setting class */
|
||||||
|
export default class SettingVolume extends Setting {
|
||||||
|
label: string[];
|
||||||
|
|
||||||
|
desc: string;
|
||||||
|
|
||||||
|
constructor(type: string, group: string, label: string[], desc: string) {
|
||||||
|
super(type, group);
|
||||||
|
this.label = label;
|
||||||
|
this.desc = desc;
|
||||||
|
for (let i = 0; i < 101; i++) {
|
||||||
|
this.label[i] = `${i}%`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,16 +10,15 @@ import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos
|
|||||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
||||||
import { CMOptions } from '../Config/VariablesAndData';
|
import { CMOptions } from '../Config/VariablesAndData';
|
||||||
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
|
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
|
||||||
|
import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight';
|
||||||
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
|
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
|
||||||
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
||||||
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
||||||
import { SimDoSims } from '../Sim/VariablesAndData';
|
import { SimDoSims } from '../Sim/VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
import {
|
import SettingColours from './SettingClasses/SettingColours.ts';
|
||||||
SettingStandard,
|
import SettingInputNumber from './SettingClasses/SettingInputNumber.ts';
|
||||||
SettingColours,
|
import SettingStandard from './SettingClasses/SettingStandard.ts';
|
||||||
SettingVolume,
|
import SettingVolume from './SettingClasses/SettingVolume.ts';
|
||||||
SettingInputNumber,
|
|
||||||
} from './SettingClasses';
|
|
||||||
|
|
||||||
/** This includes all options of CookieMonster and their relevant data */
|
/** This includes all options of CookieMonster and their relevant data */
|
||||||
const Config = {
|
const Config = {
|
||||||
@@ -70,8 +69,8 @@ const Config = {
|
|||||||
],
|
],
|
||||||
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers',
|
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
SimDoSims = true; // eslint-disable-line no-unused-vars
|
SimDoSims = true;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -89,7 +88,7 @@ const Config = {
|
|||||||
],
|
],
|
||||||
'Change how long numbers are formatted',
|
'Change how long numbers are formatted',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
RefreshScale();
|
RefreshScale();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -99,7 +98,7 @@ const Config = {
|
|||||||
['1 decimals', '2 decimals', '3 decimals'],
|
['1 decimals', '2 decimals', '3 decimals'],
|
||||||
`Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game's Setting Scale"`,
|
`Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game's Setting Scale"`,
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
RefreshScale();
|
RefreshScale();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -109,7 +108,7 @@ const Config = {
|
|||||||
['. for decimals (standard)', '. for thousands'],
|
['. for decimals (standard)', '. for thousands'],
|
||||||
'Set the separator used for decimals and thousands',
|
'Set the separator used for decimals and thousands',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
RefreshScale();
|
RefreshScale();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -134,7 +133,7 @@ const Config = {
|
|||||||
['Detailed time OFF', 'Detailed time ON'],
|
['Detailed time OFF', 'Detailed time ON'],
|
||||||
'Change how time is displayed in certain statistics and tooltips',
|
'Change how time is displayed in certain statistics and tooltips',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleDetailedTime();
|
ToggleDetailedTime();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -153,7 +152,7 @@ const Config = {
|
|||||||
['Building colours OFF', 'Building colours ON'],
|
['Building colours OFF', 'Building colours ON'],
|
||||||
'Colour code buildings',
|
'Colour code buildings',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -244,7 +243,7 @@ const Config = {
|
|||||||
['Bottom bar OFF', 'Bottom bar ON'],
|
['Bottom bar OFF', 'Bottom bar ON'],
|
||||||
'Building information',
|
'Building information',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleBotBar();
|
ToggleBotBar();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -254,7 +253,7 @@ const Config = {
|
|||||||
['Timer bar OFF', 'Timer bar ON'],
|
['Timer bar OFF', 'Timer bar ON'],
|
||||||
'Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy',
|
'Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleTimerBar();
|
ToggleTimerBar();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -264,32 +263,31 @@ const Config = {
|
|||||||
['Timer bar position (top left)', 'Timer bar position (bottom)'],
|
['Timer bar position (top left)', 'Timer bar position (bottom)'],
|
||||||
'Placement of the timer bar',
|
'Placement of the timer bar',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
ToggleTimerBarPos();
|
ToggleTimerBarPos();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TimerBarOverlay: new SettingStandard(
|
TimerBarOverlay: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
[
|
['Timer bar overlay OFF', 'Timer bar overlay only seconds', 'Timer bar overlay full'],
|
||||||
'Timer bar overlay OFF',
|
|
||||||
'Timer bar overlay only seconds',
|
|
||||||
'Timer bar overlay full',
|
|
||||||
],
|
|
||||||
'Overlay on timers displaying seconds and/or percentage left',
|
'Overlay on timers displaying seconds and/or percentage left',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
|
AutosaveTimerBar: new SettingStandard(
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Autosave timer bar OFF', 'Autosave timer bar ON'],
|
||||||
|
'Show a timer counting down till next autosave in the timer bar',
|
||||||
|
true,
|
||||||
|
),
|
||||||
UpBarColour: new SettingStandard(
|
UpBarColour: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
[
|
['Upgrade colours/bar OFF', 'Upgrade colours with bar ON', 'Upgrade colours without bar ON'],
|
||||||
'Upgrade colours/bar OFF',
|
|
||||||
'Upgrade colours with bar ON',
|
|
||||||
'Upgrade colours without bar ON',
|
|
||||||
],
|
|
||||||
'Colour code upgrades and optionally add a counter bar',
|
'Colour code upgrades and optionally add a counter bar',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
ToggleUpgradeBarAndColour();
|
ToggleUpgradeBarAndColour();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -299,7 +297,7 @@ const Config = {
|
|||||||
['Upgrade bar fixed position OFF', 'Upgrade bar fixed position ON'],
|
['Upgrade bar fixed position OFF', 'Upgrade bar fixed position ON'],
|
||||||
'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling',
|
'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleUpgradeBarFixedPos();
|
ToggleUpgradeBarFixedPos();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -310,10 +308,11 @@ const Config = {
|
|||||||
'Sort buildings: default',
|
'Sort buildings: default',
|
||||||
'Sort buildings: PP of x1 purchase',
|
'Sort buildings: PP of x1 purchase',
|
||||||
'Sort buildings: PP of selected bulk mode',
|
'Sort buildings: PP of selected bulk mode',
|
||||||
|
'Sort buildings: price until next achievement',
|
||||||
],
|
],
|
||||||
'Sort the display of buildings in either default order or by PP',
|
'Sort the display of buildings in default order, by PP, or until next achievement',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -323,10 +322,20 @@ const Config = {
|
|||||||
['Sort upgrades: default', 'Sort upgrades: PP'],
|
['Sort upgrades: default', 'Sort upgrades: PP'],
|
||||||
'Sort the display of upgrades in either default order or by PP',
|
'Sort the display of upgrades in either default order or by PP',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
UpdateUpgrades();
|
UpdateUpgrades();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
UpgradesNeverCollapse: new SettingStandard(
|
||||||
|
'bool',
|
||||||
|
'BarsDisplay',
|
||||||
|
['Upgrades always expanded OFF', 'Upgrades always expanded ON'],
|
||||||
|
'Toggle to make the upgrades sections always expanded to the size needed to display all upgrades',
|
||||||
|
true,
|
||||||
|
() => {
|
||||||
|
UpdateUpgradeSectionsHeight();
|
||||||
|
},
|
||||||
|
),
|
||||||
DragonAuraInfo: new SettingStandard(
|
DragonAuraInfo: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
@@ -338,7 +347,7 @@ const Config = {
|
|||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
['Grimoire magic meter timer OFF', 'Grimoire magic meter timer ON'],
|
['Grimoire magic meter timer OFF', 'Grimoire magic meter timer ON'],
|
||||||
'A timer on how long before the Grimoire magic meter is full',
|
'A timer overlay showing how long till the Grimoire magic meter is full',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
GCTimer: new SettingStandard(
|
GCTimer: new SettingStandard(
|
||||||
@@ -347,7 +356,7 @@ const Config = {
|
|||||||
['Golden cookie timer OFF', 'Golden cookie timer ON'],
|
['Golden cookie timer OFF', 'Golden cookie timer ON'],
|
||||||
'A timer on the golden cookie when it has been spawned',
|
'A timer on the golden cookie when it has been spawned',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleGCTimer();
|
ToggleGCTimer();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -357,7 +366,7 @@ const Config = {
|
|||||||
['Favicon OFF', 'Favicon ON'],
|
['Favicon OFF', 'Favicon ON'],
|
||||||
'Update favicon with golden/wrath cookie',
|
'Update favicon with golden/wrath cookie',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
UpdateFavicon();
|
UpdateFavicon();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -367,7 +376,7 @@ const Config = {
|
|||||||
['Extra wrinkler buttons OFF', 'Extra wrinkler buttons ON'],
|
['Extra wrinkler buttons OFF', 'Extra wrinkler buttons ON'],
|
||||||
'Show buttons for popping wrinklers at bottom of cookie section',
|
'Show buttons for popping wrinklers at bottom of cookie section',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleWrinklerButtons();
|
ToggleWrinklerButtons();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -377,7 +386,7 @@ const Config = {
|
|||||||
['Hide buildings/upgrades button OFF', 'Hide buildings/upgrades button ON'],
|
['Hide buildings/upgrades button OFF', 'Hide buildings/upgrades button ON'],
|
||||||
'Show buttons for hiding and showing the buildings and upgrades sections in the right column',
|
'Show buttons for hiding and showing the buildings and upgrades sections in the right column',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleSectionHideButtons();
|
ToggleSectionHideButtons();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -386,10 +395,7 @@ const Config = {
|
|||||||
TooltipBuildUpgrade: new SettingStandard(
|
TooltipBuildUpgrade: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
[
|
['Building/upgrade tooltip information OFF', 'Building/upgrade tooltip information ON'],
|
||||||
'Building/upgrade tooltip information OFF',
|
|
||||||
'Building/upgrade tooltip information ON',
|
|
||||||
],
|
|
||||||
'Extra information in building/upgrade tooltips',
|
'Extra information in building/upgrade tooltips',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
@@ -449,10 +455,7 @@ const Config = {
|
|||||||
ToolWarnBon: new SettingStandard(
|
ToolWarnBon: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
[
|
['Calculate tooltip warning with bonus CPS OFF', 'Calculate tooltip warning with bonus CPS ON'],
|
||||||
'Calculate tooltip warning with bonus CPS OFF',
|
|
||||||
'Calculate tooltip warning with bonus CPS ON',
|
|
||||||
],
|
|
||||||
'Calculate the warning with or without the bonus CPS you get from buying',
|
'Calculate the warning with or without the bonus CPS you get from buying',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
@@ -462,7 +465,7 @@ const Config = {
|
|||||||
['Tooltip warning position (left)', 'Tooltip warning position (bottom)'],
|
['Tooltip warning position (left)', 'Tooltip warning position (bottom)'],
|
||||||
'Placement of the warning boxes',
|
'Placement of the warning boxes',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
ToggleToolWarnPos();
|
ToggleToolWarnPos();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -529,7 +532,7 @@ const Config = {
|
|||||||
'Statistics',
|
'Statistics',
|
||||||
['Missing Achievements OFF', 'Missing Normal Achievements ON'],
|
['Missing Achievements OFF', 'Missing Normal Achievements ON'],
|
||||||
'Shows missing normal achievements in statistics menu.',
|
'Shows missing normal achievements in statistics menu.',
|
||||||
false,
|
true,
|
||||||
),
|
),
|
||||||
UpStats: new SettingStandard(
|
UpStats: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -575,7 +578,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when golden cookie spawns',
|
'Create a notification when golden cookie spawns',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.GCNotification);
|
CheckNotificationPermissions(CMOptions.GCNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -611,7 +614,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when fortune cookie is on the ticker',
|
'Create a notification when fortune cookie is on the ticker',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.FortuneNotification);
|
CheckNotificationPermissions(CMOptions.FortuneNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -647,7 +650,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification on season popup',
|
'Create a notification on season popup',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.SeaNotification);
|
CheckNotificationPermissions(CMOptions.SeaNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -709,7 +712,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when magic reaches maximum',
|
'Create a notification when magic reaches maximum',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.MagicNotification);
|
CheckNotificationPermissions(CMOptions.MagicNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -745,7 +748,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when a wrinkler appears',
|
'Create a notification when a wrinkler appears',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.WrinklerNotification);
|
CheckNotificationPermissions(CMOptions.WrinklerNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -781,7 +784,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when the maximum amount of wrinklers has appeared',
|
'Create a notification when the maximum amount of wrinklers has appeared',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.WrinklerMaxNotification);
|
CheckNotificationPermissions(CMOptions.WrinklerMaxNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -804,12 +807,7 @@ const Config = {
|
|||||||
'Play a sound when the maximum amount of wrinklers has appeared',
|
'Play a sound when the maximum amount of wrinklers has appeared',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
WrinklerMaxVolume: new SettingVolume(
|
WrinklerMaxVolume: new SettingVolume('vol', 'NotificationWrinkMax', [], 'Volume'),
|
||||||
'vol',
|
|
||||||
'NotificationWrinkMax',
|
|
||||||
[],
|
|
||||||
'Volume',
|
|
||||||
),
|
|
||||||
WrinklerMaxSoundURL: new SettingStandard(
|
WrinklerMaxSoundURL: new SettingStandard(
|
||||||
'url',
|
'url',
|
||||||
'NotificationWrinkMax',
|
'NotificationWrinkMax',
|
||||||
@@ -835,7 +833,7 @@ const Config = {
|
|||||||
],
|
],
|
||||||
"Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section",
|
"Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section",
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
Game.UpdateMenu();
|
Game.UpdateMenu();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
/** This array describes all default settings */
|
/** This array describes all default settings */
|
||||||
const ConfigDefault = {
|
const ConfigDefault: {
|
||||||
|
[index: string]: string | number | { [index: string]: number };
|
||||||
|
} = {
|
||||||
CPSMode: 1,
|
CPSMode: 1,
|
||||||
AvgCPSHist: 3,
|
AvgCPSHist: 3,
|
||||||
AvgClicksHist: 0,
|
AvgClicksHist: 0,
|
||||||
@@ -29,10 +31,12 @@ const ConfigDefault = {
|
|||||||
TimerBar: 1,
|
TimerBar: 1,
|
||||||
TimerBarPos: 0,
|
TimerBarPos: 0,
|
||||||
TimerBarOverlay: 2,
|
TimerBarOverlay: 2,
|
||||||
|
AutosaveTimerBar: 0,
|
||||||
UpBarColour: 1,
|
UpBarColour: 1,
|
||||||
UpgradeBarFixedPos: 1,
|
UpgradeBarFixedPos: 1,
|
||||||
SortBuildings: 0,
|
SortBuildings: 0,
|
||||||
SortUpgrades: 0,
|
SortUpgrades: 0,
|
||||||
|
UpgradesNeverCollapse: 0,
|
||||||
DragonAuraInfo: 1,
|
DragonAuraInfo: 1,
|
||||||
GrimoireBar: 1,
|
GrimoireBar: 1,
|
||||||
GCTimer: 1,
|
GCTimer: 1,
|
||||||
@@ -74,15 +78,13 @@ const ConfigDefault = {
|
|||||||
ColourFortuneFlash: '#ffffff',
|
ColourFortuneFlash: '#ffffff',
|
||||||
FortuneSound: 1,
|
FortuneSound: 1,
|
||||||
FortuneVolume: 100,
|
FortuneVolume: 100,
|
||||||
FortuneSoundURL:
|
FortuneSoundURL: 'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
||||||
'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
|
||||||
SeaNotification: 0,
|
SeaNotification: 0,
|
||||||
SeaFlash: 1,
|
SeaFlash: 1,
|
||||||
ColourSeaFlash: '#ffffff',
|
ColourSeaFlash: '#ffffff',
|
||||||
SeaSound: 1,
|
SeaSound: 1,
|
||||||
SeaVolume: 100,
|
SeaVolume: 100,
|
||||||
SeaSoundURL:
|
SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
||||||
'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
|
||||||
GardFlash: 1,
|
GardFlash: 1,
|
||||||
ColourGardFlash: '#ffffff',
|
ColourGardFlash: '#ffffff',
|
||||||
GardSound: 1,
|
GardSound: 1,
|
||||||
@@ -93,22 +95,19 @@ const ConfigDefault = {
|
|||||||
ColourMagicFlash: '#ffffff',
|
ColourMagicFlash: '#ffffff',
|
||||||
MagicSound: 1,
|
MagicSound: 1,
|
||||||
MagicVolume: 100,
|
MagicVolume: 100,
|
||||||
MagicSoundURL:
|
MagicSoundURL: 'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
||||||
'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
|
||||||
WrinklerNotification: 0,
|
WrinklerNotification: 0,
|
||||||
WrinklerFlash: 1,
|
WrinklerFlash: 1,
|
||||||
ColourWrinklerFlash: '#ffffff',
|
ColourWrinklerFlash: '#ffffff',
|
||||||
WrinklerSound: 1,
|
WrinklerSound: 1,
|
||||||
WrinklerVolume: 100,
|
WrinklerVolume: 100,
|
||||||
WrinklerSoundURL:
|
WrinklerSoundURL: 'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
||||||
'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
|
||||||
WrinklerMaxNotification: 0,
|
WrinklerMaxNotification: 0,
|
||||||
WrinklerMaxFlash: 1,
|
WrinklerMaxFlash: 1,
|
||||||
ColourWrinklerMaxFlash: '#ffffff',
|
ColourWrinklerMaxFlash: '#ffffff',
|
||||||
WrinklerMaxSound: 1,
|
WrinklerMaxSound: 1,
|
||||||
WrinklerMaxVolume: 100,
|
WrinklerMaxVolume: 100,
|
||||||
WrinklerMaxSoundURL:
|
WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
||||||
'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
|
||||||
BulkBuyBlock: 0,
|
BulkBuyBlock: 0,
|
||||||
FavouriteSettings: 1,
|
FavouriteSettings: 1,
|
||||||
Header: {
|
Header: {
|
||||||
@@ -136,6 +135,7 @@ const ConfigDefault = {
|
|||||||
Prestige: 1,
|
Prestige: 1,
|
||||||
Wrink: 1,
|
Wrink: 1,
|
||||||
Sea: 1,
|
Sea: 1,
|
||||||
|
Achievs: 1,
|
||||||
Misc: 1,
|
Misc: 1,
|
||||||
InfoTab: 1,
|
InfoTab: 1,
|
||||||
},
|
},
|
||||||
@@ -1,14 +1,8 @@
|
|||||||
/** General functions to format or beautify strings */
|
/** General functions to format or beautify strings */
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales';
|
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.ts';
|
||||||
import { BackupFunctions } from '../../Main/VariablesAndData';
|
import { BackupFunctions } from '../../Main/VariablesAndData';
|
||||||
import {
|
|
||||||
ColourGreen,
|
|
||||||
ColourOrange,
|
|
||||||
ColourRed,
|
|
||||||
ColourYellow,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function returns formats number based on the Scale setting
|
* This function returns formats number based on the Scale setting
|
||||||
@@ -17,7 +11,7 @@ import {
|
|||||||
* @param {number} forced Used to force (type 3) in certains cases
|
* @param {number} forced Used to force (type 3) in certains cases
|
||||||
* @returns {string} Formatted number
|
* @returns {string} Formatted number
|
||||||
*/
|
*/
|
||||||
export function Beautify(num, floats, forced) {
|
export default function Beautify(num, floats, forced) {
|
||||||
const decimals = CMOptions.ScaleDecimals + 1;
|
const decimals = CMOptions.ScaleDecimals + 1;
|
||||||
if (num === Infinity) {
|
if (num === Infinity) {
|
||||||
return 'Infinity';
|
return 'Infinity';
|
||||||
@@ -46,12 +40,8 @@ export function Beautify(num, floats, forced) {
|
|||||||
answer = num.toExponential(decimals).toString().replace('e', 'E');
|
answer = num.toExponential(decimals).toString().replace('e', 'E');
|
||||||
} else {
|
} else {
|
||||||
const exponential = num.toExponential().toString();
|
const exponential = num.toExponential().toString();
|
||||||
const AmountOfTenPowerThree = Math.floor(
|
const AmountOfTenPowerThree = Math.floor(exponential.slice(exponential.indexOf('e') + 1) / 3);
|
||||||
exponential.slice(exponential.indexOf('e') + 1) / 3,
|
answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed(decimals);
|
||||||
);
|
|
||||||
answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed(
|
|
||||||
decimals,
|
|
||||||
);
|
|
||||||
// answer is now "xxx.xx" (e.g., 123456789 would be 123.46)
|
// answer is now "xxx.xx" (e.g., 123456789 would be 123.46)
|
||||||
if ((CMOptions.Scale === 1 && !forced) || forced === 1) {
|
if ((CMOptions.Scale === 1 && !forced) || forced === 1) {
|
||||||
// Metric scale, 123456789 => 123.457 M
|
// Metric scale, 123456789 => 123.457 M
|
||||||
@@ -65,10 +55,7 @@ export function Beautify(num, floats, forced) {
|
|||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
||||||
} else if ((CMOptions.Scale === 3 && !forced) || forced === 3) {
|
} else if ((CMOptions.Scale === 3 && !forced) || forced === 3) {
|
||||||
// Short scale, 123456789 => 123.457 M
|
// Short scale, 123456789 => 123.457 M
|
||||||
if (
|
if (num >= 0.01 && num < Number(`1e${shortScaleAbbreviated.length * 3}`)) {
|
||||||
num >= 0.01 &&
|
|
||||||
num < Number(`1e${shortScaleAbbreviated.length * 3}`)
|
|
||||||
) {
|
|
||||||
answer += ` ${shortScaleAbbreviated[AmountOfTenPowerThree]}`;
|
answer += ` ${shortScaleAbbreviated[AmountOfTenPowerThree]}`;
|
||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
||||||
} else if ((CMOptions.Scale === 5 && !forced) || forced === 5) {
|
} else if ((CMOptions.Scale === 5 && !forced) || forced === 5) {
|
||||||
@@ -78,9 +65,7 @@ export function Beautify(num, floats, forced) {
|
|||||||
}
|
}
|
||||||
if (answer === '') {
|
if (answer === '') {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(
|
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`);
|
||||||
`Could not beautify number with Cookie Monster Beautify: ${num}`,
|
|
||||||
);
|
|
||||||
answer = BackupFunctions.Beautify(num, floats);
|
answer = BackupFunctions.Beautify(num, floats);
|
||||||
}
|
}
|
||||||
if (CMOptions.ScaleSeparator) answer = answer.replace('.', ',');
|
if (CMOptions.ScaleSeparator) answer = answer.replace('.', ',');
|
||||||
@@ -89,66 +74,3 @@ export function Beautify(num, floats, forced) {
|
|||||||
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`); // eslint-disable-line no-console
|
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`); // eslint-disable-line no-console
|
||||||
return BackupFunctions.Beautify(num, floats);
|
return BackupFunctions.Beautify(num, floats);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns time as a string depending on TimeFormat setting
|
|
||||||
* @param {number} time Time to be formatted
|
|
||||||
* @param {number} longFormat 1 or 0
|
|
||||||
* @returns {string} Formatted time
|
|
||||||
*/
|
|
||||||
export function FormatTime(time, longFormat) {
|
|
||||||
let formattedTime = time;
|
|
||||||
if (time === Infinity) return time;
|
|
||||||
if (time < 0) return 'Negative time period';
|
|
||||||
formattedTime = Math.ceil(time);
|
|
||||||
const y = Math.floor(formattedTime / 31557600);
|
|
||||||
const d = Math.floor((formattedTime % 31557600) / 86400);
|
|
||||||
const h = Math.floor((formattedTime % 86400) / 3600);
|
|
||||||
const m = Math.floor((formattedTime % 3600) / 60);
|
|
||||||
const s = Math.floor(formattedTime % 60);
|
|
||||||
let str = '';
|
|
||||||
if (CMOptions.TimeFormat) {
|
|
||||||
if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
|
|
||||||
str += `${(y < 10 ? '0' : '') + y}:`;
|
|
||||||
str += `${(d < 10 ? '0' : '') + d}:`;
|
|
||||||
str += `${(h < 10 ? '0' : '') + h}:`;
|
|
||||||
str += `${(m < 10 ? '0' : '') + m}:`;
|
|
||||||
str += (s < 10 ? '0' : '') + s;
|
|
||||||
} else {
|
|
||||||
if (formattedTime > 777600000)
|
|
||||||
return longFormat ? 'Over 9000 days!' : '>9000d';
|
|
||||||
str +=
|
|
||||||
y > 0
|
|
||||||
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary
|
|
||||||
: '';
|
|
||||||
str +=
|
|
||||||
d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : ''; // eslint-disable-line no-nested-ternary
|
|
||||||
if (str.length > 0 || h > 0)
|
|
||||||
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; // eslint-disable-line no-nested-ternary
|
|
||||||
if (str.length > 0 || m > 0)
|
|
||||||
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; // eslint-disable-line no-nested-ternary
|
|
||||||
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's'); // eslint-disable-line no-nested-ternary
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns the color to be used for time-strings
|
|
||||||
* @param {number} time Time to be coloured
|
|
||||||
* @returns {{string, string}} {text, color} Both the formatted time and color as strings in an array
|
|
||||||
*/
|
|
||||||
export function GetTimeColour(time) {
|
|
||||||
let color;
|
|
||||||
let text;
|
|
||||||
if (time <= 0) {
|
|
||||||
if (CMOptions.TimeFormat) text = '00:00:00:00:00';
|
|
||||||
else text = 'Done!';
|
|
||||||
color = ColourGreen;
|
|
||||||
} else {
|
|
||||||
text = FormatTime(time);
|
|
||||||
if (time > 300) color = ColourRed;
|
|
||||||
else if (time > 60) color = ColourOrange;
|
|
||||||
else color = ColourYellow;
|
|
||||||
}
|
|
||||||
return { text, color };
|
|
||||||
}
|
|
||||||
42
src/Disp/BeautifyAndFormatting/FormatTime.js
Normal file
42
src/Disp/BeautifyAndFormatting/FormatTime.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns time as a string depending on TimeFormat setting
|
||||||
|
* @param {number} time Time to be formatted
|
||||||
|
* @param {number} longFormat 1 or 0
|
||||||
|
* @returns {string} Formatted time
|
||||||
|
*/
|
||||||
|
export default function FormatTime(time, longFormat) {
|
||||||
|
let formattedTime = time;
|
||||||
|
if (time === Infinity) return time;
|
||||||
|
if (time < 0) return 'Negative time period';
|
||||||
|
formattedTime = Math.ceil(time);
|
||||||
|
const y = Math.floor(formattedTime / 31536000);
|
||||||
|
const d = Math.floor((formattedTime % 31536000) / 86400);
|
||||||
|
const h = Math.floor(((formattedTime % 31536000) % 86400) / 3600);
|
||||||
|
const m = Math.floor((((formattedTime % 31536000) % 86400) % 3600) / 60);
|
||||||
|
const s = Math.floor((((formattedTime % 31536000) % 86400) % 3600) % 60);
|
||||||
|
let str = '';
|
||||||
|
if (CMOptions.TimeFormat) {
|
||||||
|
if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
|
||||||
|
str += `${(y < 10 ? '0' : '') + y}:`;
|
||||||
|
str += `${(d < 10 ? '0' : '') + d}:`;
|
||||||
|
str += `${(h < 10 ? '0' : '') + h}:`;
|
||||||
|
str += `${(m < 10 ? '0' : '') + m}:`;
|
||||||
|
str += (s < 10 ? '0' : '') + s;
|
||||||
|
} else {
|
||||||
|
if (formattedTime > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||||
|
str +=
|
||||||
|
y > 0
|
||||||
|
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary
|
||||||
|
: '';
|
||||||
|
if (str.length > 0 || d > 0)
|
||||||
|
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `; // eslint-disable-line no-nested-ternary
|
||||||
|
if (str.length > 0 || h > 0)
|
||||||
|
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; // eslint-disable-line no-nested-ternary
|
||||||
|
if (str.length > 0 || m > 0)
|
||||||
|
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; // eslint-disable-line no-nested-ternary
|
||||||
|
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's'); // eslint-disable-line no-nested-ternary
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
24
src/Disp/BeautifyAndFormatting/GetTimeColour.js
Normal file
24
src/Disp/BeautifyAndFormatting/GetTimeColour.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData';
|
||||||
|
import FormatTime from './FormatTime';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns the color to be used for time-strings
|
||||||
|
* @param {number} time Time to be coloured
|
||||||
|
* @returns {{string, string}} {text, color} Both the formatted time and color as strings in an array
|
||||||
|
*/
|
||||||
|
export default function GetTimeColour(time) {
|
||||||
|
let color;
|
||||||
|
let text;
|
||||||
|
if (time <= 0) {
|
||||||
|
if (CMOptions.TimeFormat) text = '00:00:00:00:00';
|
||||||
|
else text = 'Done!';
|
||||||
|
color = ColourGreen;
|
||||||
|
} else {
|
||||||
|
text = FormatTime(time);
|
||||||
|
if (time > 300) color = ColourRed;
|
||||||
|
else if (time > 60) color = ColourOrange;
|
||||||
|
else color = ColourYellow;
|
||||||
|
}
|
||||||
|
return { text, color };
|
||||||
|
}
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
import {
|
import {
|
||||||
|
CacheMinPPBulk,
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
CacheObjects100,
|
CacheObjects100,
|
||||||
|
CacheObjectsNextAchievement,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
||||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData';
|
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,12 +30,17 @@ export default function UpdateBuildings() {
|
|||||||
else if (target === 10) target = CacheObjects10;
|
else if (target === 10) target = CacheObjects10;
|
||||||
else if (target === 100) target = CacheObjects100;
|
else if (target === 100) target = CacheObjects100;
|
||||||
|
|
||||||
|
// Remove colour if applied
|
||||||
|
l(`storeBulk1`).style.removeProperty('color');
|
||||||
|
l(`storeBulk10`).style.removeProperty('color');
|
||||||
|
l(`storeBulk100`).style.removeProperty('color');
|
||||||
|
|
||||||
if (Game.buyMode === 1) {
|
if (Game.buyMode === 1) {
|
||||||
if (CMOptions.BuildColour === 1) {
|
if (CMOptions.BuildColour === 1) {
|
||||||
Object.keys(target).forEach((i) => {
|
Object.keys(target).forEach((i) => {
|
||||||
l(`productPrice${Game.Objects[i].id}`).style.color =
|
l(`productPrice${Game.Objects[i].id}`).style.color = CMOptions[`Colour${target[i].color}`];
|
||||||
CMOptions[`Colour${target[i].color}`];
|
|
||||||
});
|
});
|
||||||
|
l(`storeBulk${CacheMinPPBulk}`).style.color = CMOptions.ColourGreen;
|
||||||
} else {
|
} else {
|
||||||
Object.keys(Game.Objects).forEach((i) => {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
l(`productPrice${Game.Objects[i].id}`).style.removeProperty('color');
|
l(`productPrice${Game.Objects[i].id}`).style.removeProperty('color');
|
||||||
@@ -57,62 +64,69 @@ export default function UpdateBuildings() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build array of pointers, sort by pp, use array index (+2) as the grid row number
|
// Build array of pointers and sort according to the user's configured sort option.
|
||||||
// (grid rows are 1-based indexing, and row 1 is the bulk buy/sell options)
|
// This regulates sorting of buildings.
|
||||||
// This regulates sorting of buildings
|
let arr;
|
||||||
if (Game.buyMode === 1 && CMOptions.SortBuildings) {
|
if (Game.buyMode !== 1 || !CMOptions.SortBuildings) {
|
||||||
let arr;
|
arr = Object.keys(CacheObjects1).map(k => {
|
||||||
if (CMOptions.SortBuildings === 1) {
|
const o = {};
|
||||||
arr = Object.keys(CacheObjects1).map((k) => {
|
|
||||||
const o = CacheObjects1[k];
|
|
||||||
o.name = k;
|
|
||||||
o.id = Game.Objects[k].id;
|
|
||||||
return o;
|
|
||||||
});
|
|
||||||
|
|
||||||
arr.sort(function (a, b) {
|
|
||||||
return ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
|
||||||
ColoursOrdering.indexOf(b.color)
|
|
||||||
? 1
|
|
||||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
|
||||||
? -1
|
|
||||||
: a.pp < b.pp
|
|
||||||
? -1
|
|
||||||
: 0;
|
|
||||||
});
|
|
||||||
} else if (CMOptions.SortBuildings === 2) {
|
|
||||||
arr = Object.keys(target).map((k) => {
|
|
||||||
const o = target[k];
|
|
||||||
o.name = k;
|
|
||||||
o.id = Game.Objects[k].id;
|
|
||||||
return o;
|
|
||||||
});
|
|
||||||
|
|
||||||
arr.sort(function (a, b) {
|
|
||||||
return ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
|
||||||
ColoursOrdering.indexOf(b.color)
|
|
||||||
? 1
|
|
||||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
|
||||||
? -1
|
|
||||||
: a.pp < b.pp
|
|
||||||
? -1
|
|
||||||
: 0;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let x = 0; x < arr.length; x++) {
|
|
||||||
Game.Objects[arr[x].name].l.style.gridRow = `${x + 2}/${x + 2}`;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const arr = Object.keys(CacheObjects1).map((k) => {
|
|
||||||
const o = CacheObjects1[k];
|
|
||||||
o.name = k;
|
o.name = k;
|
||||||
o.id = Game.Objects[k].id;
|
o.id = Game.Objects[k].id;
|
||||||
return o;
|
return o;
|
||||||
});
|
});
|
||||||
|
// Sort using default order.
|
||||||
arr.sort((a, b) => a.id - b.id);
|
arr.sort((a, b) => a.id - b.id);
|
||||||
for (let x = 0; x < arr.length; x++) {
|
} else if (CMOptions.SortBuildings === 1) {
|
||||||
Game.Objects[arr[x].name].l.style.gridRow = `${x + 2}/${x + 2}`;
|
arr = Object.keys(CacheObjects1).map(k => {
|
||||||
}
|
const o = {};
|
||||||
|
o.name = k;
|
||||||
|
o.pp = CacheObjects1[k].pp;
|
||||||
|
o.color = CacheObjects1[k].color;
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
// Sort by pp colour group, then by pp.
|
||||||
|
arr.sort((a, b) =>
|
||||||
|
ColoursOrdering.indexOf(a.color) === ColoursOrdering.indexOf(b.color)
|
||||||
|
? a.pp - b.pp
|
||||||
|
: ColoursOrdering.indexOf(a.color) - ColoursOrdering.indexOf(b.color)
|
||||||
|
);
|
||||||
|
} else if (CMOptions.SortBuildings === 2) {
|
||||||
|
arr = Object.keys(target).map(k => {
|
||||||
|
const o = {};
|
||||||
|
o.name = k;
|
||||||
|
o.pp = target[k].pp;
|
||||||
|
o.color = target[k].color;
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
// Sort by pp colour group, then by pp.
|
||||||
|
arr.sort((a, b) =>
|
||||||
|
ColoursOrdering.indexOf(a.color) === ColoursOrdering.indexOf(b.color)
|
||||||
|
? a.pp - b.pp
|
||||||
|
: ColoursOrdering.indexOf(a.color) - ColoursOrdering.indexOf(b.color)
|
||||||
|
);
|
||||||
|
} else if (CMOptions.SortBuildings === 3) {
|
||||||
|
arr = Object.keys(CacheObjectsNextAchievement).map(k => {
|
||||||
|
const o = {};
|
||||||
|
o.name = k;
|
||||||
|
o.id = Game.Objects[k].id;
|
||||||
|
o.amountUntilNext = CacheObjectsNextAchievement[k].AmountNeeded;
|
||||||
|
o.priceUntilNext = CacheObjectsNextAchievement[k].price;
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
// First, sort using default order.
|
||||||
|
arr.sort((a, b) => a.id - b.id);
|
||||||
|
// Sort by price until next achievement.
|
||||||
|
// Buildings that aren't within 100 of an achievement are placed at the end, still in
|
||||||
|
// default order relative to each other because sort() is guaranteed stable.
|
||||||
|
arr.sort((a, b) =>
|
||||||
|
(a.amountUntilNext !== 101 ? a.priceUntilNext : Infinity) -
|
||||||
|
(b.amountUntilNext !== 101 ? b.priceUntilNext : Infinity)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use array index (+2) as the grid row number.
|
||||||
|
// (grid rows are 1-based indexing, and row 1 is the bulk buy/sell options)
|
||||||
|
for (let x = 0; x < arr.length; x++) {
|
||||||
|
Game.Objects[arr[x].name].l.style.gridRow = `${x + 2}/${x + 2}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
27
src/Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight.js
Normal file
27
src/Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function toggles the upgrade to be always expanded
|
||||||
|
* It is called by a change in CM.Options.ToolWarnPos
|
||||||
|
* and upon creation of the warning tooltip by CM.Disp.UpdateTooltipWarnings()
|
||||||
|
*/
|
||||||
|
export default function UpdateUpgradeSectionsHeight() {
|
||||||
|
Object.values(document.getElementsByClassName('storeSection')).forEach((section) => {
|
||||||
|
if (CMOptions.UpgradesNeverCollapse || section.id === 'products') {
|
||||||
|
section.style.height = 'auto'; // eslint-disable-line no-param-reassign
|
||||||
|
} else if (section.id === 'vaultUpgrades') {
|
||||||
|
section.style.height = ''; // eslint-disable-line no-param-reassign
|
||||||
|
section.style.minHeight = '0px'; // eslint-disable-line no-param-reassign
|
||||||
|
} else if (section.id === 'upgrades') {
|
||||||
|
section.style.height = ''; // eslint-disable-line no-param-reassign
|
||||||
|
if (section.className.includes('hasMenu')) {
|
||||||
|
section.style.minHeight = '82px'; // eslint-disable-line no-param-reassign
|
||||||
|
} else {
|
||||||
|
section.style.minHeight = '60px'; // eslint-disable-line no-param-reassign
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
section.style.height = ''; // eslint-disable-line no-param-reassign
|
||||||
|
section.style.minHeight = '60px'; // eslint-disable-line no-param-reassign
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -38,24 +38,12 @@ function CreateUpgradeBarLegend() {
|
|||||||
return div;
|
return div;
|
||||||
};
|
};
|
||||||
|
|
||||||
legend.appendChild(
|
legend.appendChild(legendLine(ColourBlue, 'Better than the best PP of a building option'));
|
||||||
legendLine(ColourBlue, 'Better than the best PP of a building option'),
|
legend.appendChild(legendLine(ColourGreen, 'Same as the best PP building option'));
|
||||||
);
|
legend.appendChild(legendLine(ColourYellow, 'Within the top 10 of PP for buildings'));
|
||||||
legend.appendChild(
|
legend.appendChild(legendLine(ColourOrange, 'Within the top 20 of PP for buildings'));
|
||||||
legendLine(ColourGreen, 'Same as the best PP building option'),
|
legend.appendChild(legendLine(ColourRed, 'Within the top 30 of PP for buildings'));
|
||||||
);
|
legend.appendChild(legendLine(ColourPurple, 'Outside of the top 30 of PP for buildings'));
|
||||||
legend.appendChild(
|
|
||||||
legendLine(ColourYellow, 'Within the top 10 of PP for buildings'),
|
|
||||||
);
|
|
||||||
legend.appendChild(
|
|
||||||
legendLine(ColourOrange, 'Within the top 20 of PP for buildings'),
|
|
||||||
);
|
|
||||||
legend.appendChild(
|
|
||||||
legendLine(ColourRed, 'Within the top 30 of PP for buildings'),
|
|
||||||
);
|
|
||||||
legend.appendChild(
|
|
||||||
legendLine(ColourPurple, 'Outside of the top 30 of PP for buildings'),
|
|
||||||
);
|
|
||||||
legend.appendChild(legendLine(ColourGray, 'Negative or infinity PP'));
|
legend.appendChild(legendLine(ColourGray, 'Negative or infinity PP'));
|
||||||
return legend;
|
return legend;
|
||||||
}
|
}
|
||||||
@@ -67,7 +55,7 @@ export default function CreateUpgradeBar() {
|
|||||||
const UpgradeBar = document.createElement('div');
|
const UpgradeBar = document.createElement('div');
|
||||||
UpgradeBar.id = 'CMUpgradeBar';
|
UpgradeBar.id = 'CMUpgradeBar';
|
||||||
UpgradeBar.style.width = '100%';
|
UpgradeBar.style.width = '100%';
|
||||||
UpgradeBar.style.backgroundColour = 'black';
|
UpgradeBar.style.backgroundColor = 'black';
|
||||||
UpgradeBar.style.textAlign = 'center';
|
UpgradeBar.style.textAlign = 'center';
|
||||||
UpgradeBar.style.fontWeight = 'bold';
|
UpgradeBar.style.fontWeight = 'bold';
|
||||||
UpgradeBar.style.display = 'none';
|
UpgradeBar.style.display = 'none';
|
||||||
@@ -99,8 +87,5 @@ export default function CreateUpgradeBar() {
|
|||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarPurple', ColourPurple));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarPurple', ColourPurple));
|
||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarGray', ColourGray));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarGray', ColourGray));
|
||||||
|
|
||||||
l('upgrades').parentNode.insertBefore(
|
l('upgrades').parentNode.insertBefore(UpgradeBar, l('upgrades').parentNode.childNodes[3]);
|
||||||
UpgradeBar,
|
|
||||||
l('upgrades').parentNode.childNodes[3],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,8 @@ export default function UpdateUpgrades() {
|
|||||||
const me = Game.UpgradesInStore[i];
|
const me = Game.UpgradesInStore[i];
|
||||||
let addedColour = false;
|
let addedColour = false;
|
||||||
for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j += 1) {
|
for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j += 1) {
|
||||||
if (
|
if (l(`upgrade${i}`).childNodes[j].className.indexOf(ColourBackPre) !== -1) {
|
||||||
l(`upgrade${i}`).childNodes[j].className.indexOf(ColourBackPre) !== -1
|
l(`upgrade${i}`).childNodes[j].className = ColourBackPre + CacheUpgrades[me.name].color;
|
||||||
) {
|
|
||||||
l(`upgrade${i}`).childNodes[j].className =
|
|
||||||
ColourBackPre + CacheUpgrades[me.name].color;
|
|
||||||
addedColour = true;
|
addedColour = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -75,19 +72,17 @@ export default function UpdateUpgrades() {
|
|||||||
o.name = Game.UpgradesInStore[x].name;
|
o.name = Game.UpgradesInStore[x].name;
|
||||||
o.price = Game.UpgradesInStore[x].basePrice;
|
o.price = Game.UpgradesInStore[x].basePrice;
|
||||||
o.pp = CacheUpgrades[o.name].pp;
|
o.pp = CacheUpgrades[o.name].pp;
|
||||||
|
o.color = CacheUpgrades[o.name].color;
|
||||||
arr.push(o);
|
arr.push(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CMOptions.SortUpgrades) {
|
if (CMOptions.SortUpgrades) {
|
||||||
arr.sort(function (a, b) {
|
// Sort by pp colour group, then by pp.
|
||||||
return ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
arr.sort((a, b) =>
|
||||||
? 1
|
ColoursOrdering.indexOf(a.color) === ColoursOrdering.indexOf(b.color)
|
||||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
? a.pp - b.pp
|
||||||
? -1
|
: ColoursOrdering.indexOf(a.color) - ColoursOrdering.indexOf(b.color)
|
||||||
: a.pp < b.pp
|
);
|
||||||
? -1
|
|
||||||
: 0;
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
arr.sort((a, b) => a.price - b.price);
|
arr.sort((a, b) => a.price - b.price);
|
||||||
}
|
}
|
||||||
@@ -96,7 +91,6 @@ export default function UpdateUpgrades() {
|
|||||||
return arr2.findIndex((e) => e.name === upgrade.name);
|
return arr2.findIndex((e) => e.name === upgrade.name);
|
||||||
};
|
};
|
||||||
for (let x = 0; x < Game.UpgradesInStore.length; x += 1) {
|
for (let x = 0; x < Game.UpgradesInStore.length; x += 1) {
|
||||||
l(`upgrade${x}`).style.order =
|
l(`upgrade${x}`).style.order = nameChecker(arr, Game.UpgradesInStore[x]) + 1;
|
||||||
nameChecker(arr, Game.UpgradesInStore[x]) + 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ import CacheDragonCost from '../../Cache/Dragon/Dragon';
|
|||||||
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData';
|
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange';
|
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange';
|
||||||
import {
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
||||||
FormatTime,
|
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
|
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
|
||||||
@@ -16,15 +14,14 @@ import {
|
|||||||
export function AddAuraInfo(aura) {
|
export function AddAuraInfo(aura) {
|
||||||
if (CMOptions.DragonAuraInfo === 1) {
|
if (CMOptions.DragonAuraInfo === 1) {
|
||||||
const [bonusCPS, priceOfChange] = CalculateChangeAura(aura);
|
const [bonusCPS, priceOfChange] = CalculateChangeAura(aura);
|
||||||
const timeToRecover = FormatTime(
|
const timeToRecover = FormatTime(priceOfChange / (bonusCPS + Game.cookiesPs));
|
||||||
priceOfChange / (bonusCPS + Game.cookiesPs),
|
let bonusCPSPercentage;
|
||||||
);
|
if (Game.cookiesPs === 0) bonusCPSPercentage = Beautify(Infinity);
|
||||||
const bonusCPSPercentage = Beautify((bonusCPS / Game.cookiesPs) * 100);
|
else bonusCPSPercentage = Beautify((bonusCPS / Game.cookiesPs) * 100);
|
||||||
|
|
||||||
l('dragonAuraInfo').style.minHeight = '60px';
|
l('dragonAuraInfo').style.minHeight = '60px';
|
||||||
l('dragonAuraInfo').style.margin = '8px';
|
l('dragonAuraInfo').style.margin = '8px';
|
||||||
l('dragonAuraInfo').appendChild(document.createElement('div')).className =
|
l('dragonAuraInfo').appendChild(document.createElement('div')).className = 'line';
|
||||||
'line';
|
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.style.minWidth = '200px';
|
div.style.minWidth = '200px';
|
||||||
div.style.textAlign = 'center';
|
div.style.textAlign = 'center';
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
||||||
import { CMOptions } from '../Config/VariablesAndData';
|
import { CMOptions } from '../Config/VariablesAndData';
|
||||||
import { Beautify } from './BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from './BeautifyAndFormatting/Beautify';
|
||||||
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
||||||
|
import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight';
|
||||||
import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
|
import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
|
||||||
import { UpdateBotBar } from './InfoBars/BottomBar';
|
import { UpdateBotBar } from './InfoBars/BottomBar';
|
||||||
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
||||||
import RefreshMenu from './MenuSections/Refreshmenu';
|
import RefreshMenu from './MenuSections/Refreshmenu';
|
||||||
import UpdateTooltips from './Tooltips/UpdateTooltips';
|
import UpdateTooltips from './Tooltips/UpdateTooltips';
|
||||||
import {
|
import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips';
|
||||||
CheckWrinklerTooltip,
|
|
||||||
UpdateWrinklerTooltip,
|
|
||||||
} from './Tooltips/WrinklerTooltips';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function handles all custom drawing for the Game.Draw() function.
|
* This function handles all custom drawing for the Game.Draw() function.
|
||||||
@@ -26,16 +24,14 @@ export default function CMDrawHook() {
|
|||||||
) {
|
) {
|
||||||
const timer = document.getElementById('CMStatsAutosaveTimer');
|
const timer = document.getElementById('CMStatsAutosaveTimer');
|
||||||
if (timer) {
|
if (timer) {
|
||||||
timer.innerText = Game.sayTime(
|
timer.innerText = Game.sayTime(Game.fps * 60 - (Game.T % (Game.fps * 60)), 4);
|
||||||
Game.fps * 60 - (Game.T % (Game.fps * 60)),
|
|
||||||
4,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update colors
|
// Update colors
|
||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
UpdateUpgrades();
|
UpdateUpgrades();
|
||||||
|
UpdateUpgradeSectionsHeight();
|
||||||
|
|
||||||
// Redraw timers
|
// Redraw timers
|
||||||
UpdateTimerBar();
|
UpdateTimerBar();
|
||||||
@@ -58,10 +54,7 @@ export default function CMDrawHook() {
|
|||||||
|
|
||||||
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
|
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
|
||||||
if (CMOptions.Scale) {
|
if (CMOptions.Scale) {
|
||||||
let str = l('cookies').innerHTML.replace(
|
let str = l('cookies').innerHTML.replace(/.*(?=<br>)/i, Beautify(Game.cookies));
|
||||||
/.*(?=<br>)/i,
|
|
||||||
Beautify(Game.cookies),
|
|
||||||
);
|
|
||||||
if (Game.prefs.monospace) str = `<span class="monospace">${str}</span>`;
|
if (Game.prefs.monospace) str = `<span class="monospace">${str}</span>`;
|
||||||
l('cookies').innerHTML = str;
|
l('cookies').innerHTML = str;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,10 +27,8 @@ export default function CreateGCTimer(cookie) {
|
|||||||
cookie.pop();
|
cookie.pop();
|
||||||
};
|
};
|
||||||
GCTimer.onmouseover = function () {
|
GCTimer.onmouseover = function () {
|
||||||
cookie.l.style.filter = // eslint-disable-line no-param-reassign
|
cookie.l.style.filter = 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'; // eslint-disable-line no-param-reassign
|
||||||
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
cookie.l.style.webkitFilter = 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'; // eslint-disable-line no-param-reassign
|
||||||
cookie.l.style.webkitFilter = // eslint-disable-line no-param-reassign
|
|
||||||
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
|
||||||
};
|
};
|
||||||
GCTimer.onmouseout = function () {
|
GCTimer.onmouseout = function () {
|
||||||
cookie.l.style.filter = ''; // eslint-disable-line no-param-reassign
|
cookie.l.style.filter = ''; // eslint-disable-line no-param-reassign
|
||||||
|
|||||||
@@ -5,11 +5,7 @@
|
|||||||
* @param {number} targetMagic The target magic level
|
* @param {number} targetMagic The target magic level
|
||||||
* @returns {number} count / Game.fps The time it takes to reach targetMagic
|
* @returns {number} count / Game.fps The time it takes to reach targetMagic
|
||||||
*/
|
*/
|
||||||
export default function CalculateGrimoireRefillTime(
|
export default function CalculateGrimoireRefillTime(currentMagic, maxMagic, targetMagic) {
|
||||||
currentMagic,
|
|
||||||
maxMagic,
|
|
||||||
targetMagic,
|
|
||||||
) {
|
|
||||||
let magic = currentMagic;
|
let magic = currentMagic;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
while (magic < targetMagic) {
|
while (magic < targetMagic) {
|
||||||
|
|||||||
@@ -18,16 +18,10 @@ export default function GetCPS() {
|
|||||||
return Game.cookiesPs * (1 - Game.cpsSucked);
|
return Game.cookiesPs * (1 - Game.cpsSucked);
|
||||||
}
|
}
|
||||||
if (CMOptions.CalcWrink === 1) {
|
if (CMOptions.CalcWrink === 1) {
|
||||||
return (
|
return Game.cookiesPs * (CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05));
|
||||||
Game.cookiesPs *
|
|
||||||
(CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (CacheWrinklersFattest[1] !== null)
|
if (CacheWrinklersFattest[1] !== null)
|
||||||
if (
|
if (CMOptions.CalcWrink === 2 && Game.wrinklers[CacheWrinklersFattest[1]].type === 1) {
|
||||||
CMOptions.CalcWrink === 2 &&
|
|
||||||
Game.wrinklers[CacheWrinklersFattest[1]].type === 1
|
|
||||||
) {
|
|
||||||
return (
|
return (
|
||||||
Game.cookiesPs *
|
Game.cookiesPs *
|
||||||
((CacheCurrWrinklerCPSMult * 3) / CacheCurrWrinklerCount +
|
((CacheCurrWrinklerCPSMult * 3) / CacheCurrWrinklerCount +
|
||||||
@@ -36,7 +30,6 @@ export default function GetCPS() {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
Game.cookiesPs *
|
Game.cookiesPs *
|
||||||
(CacheCurrWrinklerCPSMult / CacheCurrWrinklerCount +
|
(CacheCurrWrinklerCPSMult / CacheCurrWrinklerCount + (1 - CacheCurrWrinklerCount * 0.05))
|
||||||
(1 - CacheCurrWrinklerCount * 0.05))
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData';
|
||||||
CacheWrinklersFattest,
|
|
||||||
CacheWrinklersTotal,
|
|
||||||
} from '../../Cache/VariablesAndData';
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,11 +5,8 @@
|
|||||||
*/
|
*/
|
||||||
export default function UpdateBackground() {
|
export default function UpdateBackground() {
|
||||||
Game.Background.canvas.width = Game.Background.canvas.parentNode.offsetWidth;
|
Game.Background.canvas.width = Game.Background.canvas.parentNode.offsetWidth;
|
||||||
Game.Background.canvas.height =
|
Game.Background.canvas.height = Game.Background.canvas.parentNode.offsetHeight;
|
||||||
Game.Background.canvas.parentNode.offsetHeight;
|
Game.LeftBackground.canvas.width = Game.LeftBackground.canvas.parentNode.offsetWidth;
|
||||||
Game.LeftBackground.canvas.width =
|
Game.LeftBackground.canvas.height = Game.LeftBackground.canvas.parentNode.offsetHeight;
|
||||||
Game.LeftBackground.canvas.parentNode.offsetWidth;
|
|
||||||
Game.LeftBackground.canvas.height =
|
|
||||||
Game.LeftBackground.canvas.parentNode.offsetHeight;
|
|
||||||
Game.DrawBackground();
|
Game.DrawBackground();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,15 @@
|
|||||||
/** Functions related to the Bottom Bar */
|
/** Functions related to the Bottom Bar */
|
||||||
|
|
||||||
import {
|
import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData';
|
||||||
CacheObjects1,
|
|
||||||
CacheObjects10,
|
|
||||||
CacheObjects100,
|
|
||||||
} from '../../Cache/VariablesAndData';
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts';
|
||||||
import {
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
||||||
FormatTime,
|
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour';
|
||||||
GetTimeColour,
|
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import GetCPS from '../HelperFunctions/GetCPS';
|
import GetCPS from '../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
||||||
import {
|
import { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData';
|
||||||
ColourBlue,
|
|
||||||
ColourTextPre,
|
|
||||||
ColourYellow,
|
|
||||||
LastTargetBotBar,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
|
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,12 +22,11 @@ export function CreateBotBar() {
|
|||||||
BotBar.style.width = '100%';
|
BotBar.style.width = '100%';
|
||||||
BotBar.style.position = 'absolute';
|
BotBar.style.position = 'absolute';
|
||||||
BotBar.style.display = 'none';
|
BotBar.style.display = 'none';
|
||||||
BotBar.style.backgroundColour = '#262224';
|
BotBar.style.backgroundColor = '#262224';
|
||||||
BotBar.style.backgroundImage = 'linear-gradient(to bottom, #4d4548, #000000)';
|
BotBar.style.backgroundImage = 'linear-gradient(to bottom, #4d4548, #000000)';
|
||||||
BotBar.style.borderTop = '1px solid black';
|
BotBar.style.borderTop = '1px solid black';
|
||||||
BotBar.style.overflow = 'auto';
|
BotBar.style.overflow = 'auto';
|
||||||
BotBar.style.textShadow =
|
BotBar.style.textShadow = '-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black';
|
||||||
'-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black';
|
|
||||||
|
|
||||||
const table = BotBar.appendChild(document.createElement('table'));
|
const table = BotBar.appendChild(document.createElement('table'));
|
||||||
table.style.width = '100%';
|
table.style.width = '100%';
|
||||||
@@ -54,9 +43,7 @@ export function CreateBotBar() {
|
|||||||
};
|
};
|
||||||
const type = tbody.appendChild(document.createElement('tr'));
|
const type = tbody.appendChild(document.createElement('tr'));
|
||||||
type.style.fontWeight = 'bold';
|
type.style.fontWeight = 'bold';
|
||||||
type.appendChild(
|
type.appendChild(firstCol(`CM ${VersionMajor}.${VersionMinor}`, ColourYellow));
|
||||||
firstCol(`CM ${VersionMajor}.${VersionMinor}`, ColourYellow),
|
|
||||||
);
|
|
||||||
const bonus = tbody.appendChild(document.createElement('tr'));
|
const bonus = tbody.appendChild(document.createElement('tr'));
|
||||||
bonus.appendChild(firstCol('Bonus Income', ColourBlue));
|
bonus.appendChild(firstCol('Bonus Income', ColourBlue));
|
||||||
const pp = tbody.appendChild(document.createElement('tr'));
|
const pp = tbody.appendChild(document.createElement('tr'));
|
||||||
@@ -91,37 +78,28 @@ export function UpdateBotBar() {
|
|||||||
l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[
|
||||||
count
|
count
|
||||||
].childNodes[1].textContent = Game.Objects[i].amount;
|
].childNodes[1].textContent = Game.Objects[i].amount;
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[count].textContent = Beautify(
|
||||||
count
|
target[i].bonus,
|
||||||
].textContent = Beautify(target[i].bonus, 2);
|
2,
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
|
||||||
count
|
|
||||||
].className = ColourTextPre + target[i].color;
|
|
||||||
let PPString;
|
|
||||||
if (CMOptions.PPDisplayTime)
|
|
||||||
PPString = FormatTime(Math.round(target[i].pp));
|
|
||||||
else PPString = Beautify(Math.round(target[i].pp), 2);
|
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
|
||||||
count
|
|
||||||
].textContent = PPString;
|
|
||||||
const timeColour = GetTimeColour(
|
|
||||||
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
|
|
||||||
GetCPS(),
|
|
||||||
);
|
);
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].className =
|
||||||
count
|
ColourTextPre + target[i].color;
|
||||||
].className = ColourTextPre + timeColour.color;
|
let PPString;
|
||||||
if (
|
if (CMOptions.PPDisplayTime) PPString = FormatTime(Math.round(target[i].pp));
|
||||||
timeColour.text === 'Done!' &&
|
else PPString = Beautify(Math.round(target[i].pp), 2);
|
||||||
Game.cookies < Game.Objects[i].bulkPrice
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].textContent = PPString;
|
||||||
) {
|
const timeColour = GetTimeColour(
|
||||||
|
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
|
);
|
||||||
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].className =
|
||||||
|
ColourTextPre + timeColour.color;
|
||||||
|
if (timeColour.text === 'Done!' && Game.cookies < Game.Objects[i].bulkPrice) {
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||||
count
|
count
|
||||||
].textContent = `${timeColour.text} (with Wrink)`;
|
].textContent = `${timeColour.text} (with Wrink)`;
|
||||||
} else
|
} else
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent =
|
||||||
count
|
timeColour.text;
|
||||||
].textContent = timeColour.text;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,9 +77,7 @@ export function CreateBotBarBuildingColumn(buildingName) {
|
|||||||
const i = buildingName;
|
const i = buildingName;
|
||||||
const header = type.appendChild(document.createElement('td'));
|
const header = type.appendChild(document.createElement('td'));
|
||||||
header.appendChild(
|
header.appendChild(
|
||||||
document.createTextNode(
|
document.createTextNode(`${i.indexOf(' ') !== -1 ? i.substring(0, i.indexOf(' ')) : i} (`),
|
||||||
`${i.indexOf(' ') !== -1 ? i.substring(0, i.indexOf(' ')) : i} (`,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const span = header.appendChild(document.createElement('span'));
|
const span = header.appendChild(document.createElement('span'));
|
||||||
|
|||||||
@@ -23,7 +23,13 @@ export function CreateTimerBar() {
|
|||||||
TimerBar.style.height = '0px';
|
TimerBar.style.height = '0px';
|
||||||
TimerBar.style.fontSize = '10px';
|
TimerBar.style.fontSize = '10px';
|
||||||
TimerBar.style.fontWeight = 'bold';
|
TimerBar.style.fontWeight = 'bold';
|
||||||
TimerBar.style.backgroundColour = 'black';
|
TimerBar.style.backgroundColor = 'black';
|
||||||
|
|
||||||
|
// Create standard Autosave bar
|
||||||
|
const CMTimerBarAutosave = CreateTimer('CMTimerBarAutosave', 'Autosave', [
|
||||||
|
{ id: 'CMTimerBarAutosaveBar', color: ColourPurple },
|
||||||
|
]);
|
||||||
|
TimerBar.appendChild(CMTimerBarAutosave);
|
||||||
|
|
||||||
// Create standard Golden Cookie bar
|
// Create standard Golden Cookie bar
|
||||||
const CMTimerBarGC = CreateTimer('CMTimerBarGC', 'Next Cookie', [
|
const CMTimerBarGC = CreateTimer('CMTimerBarGC', 'Next Cookie', [
|
||||||
@@ -56,29 +62,36 @@ export function UpdateTimerBar() {
|
|||||||
const maxWidthOneBar = l('CMTimerBar').offsetWidth - 133;
|
const maxWidthOneBar = l('CMTimerBar').offsetWidth - 133;
|
||||||
let numberOfTimers = 0;
|
let numberOfTimers = 0;
|
||||||
|
|
||||||
|
if (CMOptions.AutosaveTimerBar && Game.prefs.autosave) {
|
||||||
|
const timeTillNextAutosave =
|
||||||
|
(Game.fps * 60 - (Game.OnAscend ? 0 : Game.T % (Game.fps * 60))) / Game.fps;
|
||||||
|
l('CMTimerBarAutosave').style.display = '';
|
||||||
|
l('CMTimerBarAutosaveBar').style.width = `${Math.round(
|
||||||
|
(timeTillNextAutosave *
|
||||||
|
(maxWidthOneBar - Math.ceil(timeTillNextAutosave).toString().length * 8)) /
|
||||||
|
60,
|
||||||
|
)}px`;
|
||||||
|
if (CMOptions.TimerBarOverlay >= 1) {
|
||||||
|
l('CMTimerBarAutosaveBar').textContent = Math.ceil(timeTillNextAutosave);
|
||||||
|
} else l('CMTimerBarAutosaveBar').textContent = '';
|
||||||
|
l('CMTimerBarAutosaveTime').textContent = Math.ceil(timeTillNextAutosave);
|
||||||
|
numberOfTimers += 1;
|
||||||
|
} else l('CMTimerBarAutosave').style.display = 'none';
|
||||||
|
|
||||||
// Regulates visibility of Golden Cookie timer
|
// Regulates visibility of Golden Cookie timer
|
||||||
if (
|
if (Game.shimmerTypes.golden.spawned === 0 && !Game.Has('Golden switch [off]')) {
|
||||||
Game.shimmerTypes.golden.spawned === 0 &&
|
|
||||||
!Game.Has('Golden switch [off]')
|
|
||||||
) {
|
|
||||||
l('CMTimerBarGC').style.display = '';
|
l('CMTimerBarGC').style.display = '';
|
||||||
l('CMTimerBarGCMinBar').style.width = `${Math.round(
|
l('CMTimerBarGCMinBar').style.width = `${Math.round(
|
||||||
(Math.max(
|
(Math.max(0, Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) *
|
||||||
0,
|
|
||||||
Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time,
|
|
||||||
) *
|
|
||||||
maxWidthTwoBar) /
|
maxWidthTwoBar) /
|
||||||
Game.shimmerTypes.golden.maxTime,
|
Game.shimmerTypes.golden.maxTime,
|
||||||
)}px`;
|
)}px`;
|
||||||
if (CMOptions.TimerBarOverlay >= 1)
|
if (CMOptions.TimerBarOverlay >= 1)
|
||||||
l('CMTimerBarGCMinBar').textContent = Math.ceil(
|
l('CMTimerBarGCMinBar').textContent = Math.ceil(
|
||||||
(Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) /
|
(Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) / Game.fps,
|
||||||
Game.fps,
|
|
||||||
);
|
);
|
||||||
else l('CMTimerBarGCMinBar').textContent = '';
|
else l('CMTimerBarGCMinBar').textContent = '';
|
||||||
if (
|
if (Game.shimmerTypes.golden.minTime === Game.shimmerTypes.golden.maxTime) {
|
||||||
Game.shimmerTypes.golden.minTime === Game.shimmerTypes.golden.maxTime
|
|
||||||
) {
|
|
||||||
l('CMTimerBarGCMinBar').style.borderTopRightRadius = '10px';
|
l('CMTimerBarGCMinBar').style.borderTopRightRadius = '10px';
|
||||||
l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '10px';
|
l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '10px';
|
||||||
} else {
|
} else {
|
||||||
@@ -102,37 +115,27 @@ export function UpdateTimerBar() {
|
|||||||
);
|
);
|
||||||
else l('CMTimerBarGCBar').textContent = '';
|
else l('CMTimerBarGCBar').textContent = '';
|
||||||
l('CMTimerBarGCTime').textContent = Math.ceil(
|
l('CMTimerBarGCTime').textContent = Math.ceil(
|
||||||
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) /
|
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps,
|
||||||
Game.fps,
|
|
||||||
);
|
);
|
||||||
numberOfTimers += 1;
|
numberOfTimers += 1;
|
||||||
} else l('CMTimerBarGC').style.display = 'none';
|
} else l('CMTimerBarGC').style.display = 'none';
|
||||||
|
|
||||||
// Regulates visibility of Reindeer timer
|
// Regulates visibility of Reindeer timer
|
||||||
if (
|
if (Game.season === 'christmas' && Game.shimmerTypes.reindeer.spawned === 0) {
|
||||||
Game.season === 'christmas' &&
|
|
||||||
Game.shimmerTypes.reindeer.spawned === 0
|
|
||||||
) {
|
|
||||||
l('CMTimerBarRen').style.display = '';
|
l('CMTimerBarRen').style.display = '';
|
||||||
l('CMTimerBarRenMinBar').style.width = `${Math.round(
|
l('CMTimerBarRenMinBar').style.width = `${Math.round(
|
||||||
(Math.max(
|
(Math.max(0, Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) *
|
||||||
0,
|
|
||||||
Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time,
|
|
||||||
) *
|
|
||||||
maxWidthTwoBar) /
|
maxWidthTwoBar) /
|
||||||
Game.shimmerTypes.reindeer.maxTime,
|
Game.shimmerTypes.reindeer.maxTime,
|
||||||
)}px`;
|
)}px`;
|
||||||
if (CMOptions.TimerBarOverlay >= 1)
|
if (CMOptions.TimerBarOverlay >= 1)
|
||||||
l('CMTimerBarRenMinBar').textContent = Math.ceil(
|
l('CMTimerBarRenMinBar').textContent = Math.ceil(
|
||||||
(Game.shimmerTypes.reindeer.minTime -
|
(Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) / Game.fps,
|
||||||
Game.shimmerTypes.reindeer.time) /
|
|
||||||
Game.fps,
|
|
||||||
);
|
);
|
||||||
else l('CMTimerBarRenMinBar').textContent = '';
|
else l('CMTimerBarRenMinBar').textContent = '';
|
||||||
l('CMTimerBarRenBar').style.width = `${Math.round(
|
l('CMTimerBarRenBar').style.width = `${Math.round(
|
||||||
(Math.min(
|
(Math.min(
|
||||||
Game.shimmerTypes.reindeer.maxTime -
|
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime,
|
||||||
Game.shimmerTypes.reindeer.minTime,
|
|
||||||
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time,
|
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time,
|
||||||
) *
|
) *
|
||||||
maxWidthTwoBar) /
|
maxWidthTwoBar) /
|
||||||
@@ -141,16 +144,13 @@ export function UpdateTimerBar() {
|
|||||||
if (CMOptions.TimerBarOverlay >= 1)
|
if (CMOptions.TimerBarOverlay >= 1)
|
||||||
l('CMTimerBarRenBar').textContent = Math.ceil(
|
l('CMTimerBarRenBar').textContent = Math.ceil(
|
||||||
Math.min(
|
Math.min(
|
||||||
Game.shimmerTypes.reindeer.maxTime -
|
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime,
|
||||||
Game.shimmerTypes.reindeer.minTime,
|
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time,
|
||||||
Game.shimmerTypes.reindeer.maxTime -
|
|
||||||
Game.shimmerTypes.reindeer.time,
|
|
||||||
) / Game.fps,
|
) / Game.fps,
|
||||||
);
|
);
|
||||||
else l('CMTimerBarRenBar').textContent = '';
|
else l('CMTimerBarRenBar').textContent = '';
|
||||||
l('CMTimerBarRenTime').textContent = Math.ceil(
|
l('CMTimerBarRenTime').textContent = Math.ceil(
|
||||||
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) /
|
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps,
|
||||||
Game.fps,
|
|
||||||
);
|
);
|
||||||
numberOfTimers += 1;
|
numberOfTimers += 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -180,13 +180,10 @@ export function UpdateTimerBar() {
|
|||||||
else timer.lastChild.children[1].textContent = '';
|
else timer.lastChild.children[1].textContent = '';
|
||||||
timer.lastChild.children[1].style.width = `${Math.round(
|
timer.lastChild.children[1].style.width = `${Math.round(
|
||||||
(Game.buffs[i].time *
|
(Game.buffs[i].time *
|
||||||
(maxWidthOneBar -
|
(maxWidthOneBar - Math.ceil(Game.buffs[i].time / Game.fps).toString().length * 8)) /
|
||||||
Math.ceil(Game.buffs[i].time / Game.fps).toString().length * 8)) /
|
|
||||||
Game.buffs[i].maxTime,
|
Game.buffs[i].maxTime,
|
||||||
)}px`;
|
)}px`;
|
||||||
timer.lastChild.children[2].textContent = Math.ceil(
|
timer.lastChild.children[2].textContent = Math.ceil(Game.buffs[i].time / Game.fps);
|
||||||
Game.buffs[i].time / Game.fps,
|
|
||||||
);
|
|
||||||
numberOfTimers += 1;
|
numberOfTimers += 1;
|
||||||
BuffTimerBars[Game.buffs[i].name] = timer;
|
BuffTimerBars[Game.buffs[i].name] = timer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,9 @@ export default function CreateSectionHideButtons() {
|
|||||||
l('vaultUpgrades').style.display = 'none';
|
l('vaultUpgrades').style.display = 'none';
|
||||||
} else {
|
} else {
|
||||||
l('upgrades').style.display = 'flex';
|
l('upgrades').style.display = 'flex';
|
||||||
if (l('toggleUpgrades').children.length !== 0)
|
if (l('toggleUpgrades').children.length !== 0) l('toggleUpgrades').style.display = 'block';
|
||||||
l('toggleUpgrades').style.display = 'block';
|
if (l('techUpgrades').children.length !== 0) l('techUpgrades').style.display = 'block';
|
||||||
if (l('techUpgrades').children.length !== 0)
|
if (l('vaultUpgrades').children.length !== 0) l('vaultUpgrades').style.display = 'block';
|
||||||
l('techUpgrades').style.display = 'block';
|
|
||||||
if (l('vaultUpgrades').children.length !== 0)
|
|
||||||
l('vaultUpgrades').style.display = 'block';
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
a.textContent = 'Hide/Show Upgrades';
|
a.textContent = 'Hide/Show Upgrades';
|
||||||
@@ -28,8 +25,7 @@ export default function CreateSectionHideButtons() {
|
|||||||
const b = document.createElement('a');
|
const b = document.createElement('a');
|
||||||
b.className = 'option';
|
b.className = 'option';
|
||||||
b.onclick = function () {
|
b.onclick = function () {
|
||||||
if (l('products').style.display === 'grid')
|
if (l('products').style.display === 'grid') l('products').style.display = 'none';
|
||||||
l('products').style.display = 'none';
|
|
||||||
else l('products').style.display = 'grid';
|
else l('products').style.display = 'grid';
|
||||||
};
|
};
|
||||||
b.textContent = 'Hide/Show Buildings';
|
b.textContent = 'Hide/Show Buildings';
|
||||||
|
|||||||
@@ -18,13 +18,7 @@ export default function CreateWrinklerButtons() {
|
|||||||
};
|
};
|
||||||
popAllA.onmouseover = function () {
|
popAllA.onmouseover = function () {
|
||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(this, () => CreateTooltip('wb', 'PopAllNormal'), 'this');
|
||||||
this,
|
|
||||||
function () {
|
|
||||||
return CreateTooltip('wb', 'PopAll');
|
|
||||||
},
|
|
||||||
'this',
|
|
||||||
);
|
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
};
|
};
|
||||||
l('sectionLeftExtra').children[0].append(popAllA);
|
l('sectionLeftExtra').children[0].append(popAllA);
|
||||||
@@ -33,21 +27,14 @@ export default function CreateWrinklerButtons() {
|
|||||||
popFattestA.textContent = 'Pop Single Fattest';
|
popFattestA.textContent = 'Pop Single Fattest';
|
||||||
popFattestA.className = 'option';
|
popFattestA.className = 'option';
|
||||||
popFattestA.onclick = function () {
|
popFattestA.onclick = function () {
|
||||||
if (CacheWrinklersFattest[1] !== null)
|
if (CacheWrinklersFattest[1] !== null) Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
||||||
Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
|
||||||
};
|
};
|
||||||
popFattestA.onmouseout = function () {
|
popFattestA.onmouseout = function () {
|
||||||
Game.tooltip.shouldHide = 1;
|
Game.tooltip.shouldHide = 1;
|
||||||
};
|
};
|
||||||
popFattestA.onmouseover = function () {
|
popFattestA.onmouseover = function () {
|
||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(this, () => CreateTooltip('wb', 'PopFattest'), 'this');
|
||||||
this,
|
|
||||||
function () {
|
|
||||||
return CreateTooltip('wb', 'PopFattest');
|
|
||||||
},
|
|
||||||
'this',
|
|
||||||
);
|
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
};
|
};
|
||||||
l('sectionLeftExtra').children[0].append(popFattestA);
|
l('sectionLeftExtra').children[0].append(popFattestA);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { ToggleHeader } from '../../../Config/ToggleSetting';
|
import { ToggleHeader } from '../../../Config/ToggleSetting';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import { LatestReleaseNotes, ModDescription } from '../../../Data/Moddata';
|
import { LatestReleaseNotes, ModDescription } from '../../../Data/Moddata.ts';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function adds stats created by CookieMonster to the stats page
|
* This function adds stats created by CookieMonster to the stats page
|
||||||
|
|||||||
@@ -1,22 +1,15 @@
|
|||||||
import jscolor, * as JsColor from '@eastdesire/jscolor';
|
import jscolor, * as JsColor from '@eastdesire/jscolor';
|
||||||
import ToggleFavouriteSetting from '../../../Config/Toggles/ToggleFavourites';
|
import ToggleFavouriteSetting from '../../../Config/Toggles/ToggleFavourites';
|
||||||
import { SaveConfig } from '../../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
import { SaveConfig } from '../../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||||
import {
|
import { ConfigPrefix, ToggleConfig, ToggleConfigVolume } from '../../../Config/ToggleSetting';
|
||||||
ConfigPrefix,
|
|
||||||
ToggleConfig,
|
|
||||||
ToggleConfigVolume,
|
|
||||||
} from '../../../Config/ToggleSetting';
|
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import {} from '../../../Data/Sectionheaders';
|
import {} from '../../../Data/Sectionheaders.ts';
|
||||||
import Config from '../../../Data/SettingsData';
|
import Config from '../../../Data/SettingsData';
|
||||||
import RefreshScale from '../../HelperFunctions/RefreshScale';
|
import RefreshScale from '../../HelperFunctions/RefreshScale';
|
||||||
import UpdateColours from '../../HelperFunctions/UpdateColours';
|
import UpdateColours from '../../HelperFunctions/UpdateColours';
|
||||||
import Flash from '../../Notifications/Flash';
|
import Flash from '../../Notifications/Flash';
|
||||||
import PlaySound from '../../Notifications/Sound';
|
import PlaySound from '../../Notifications/Sound';
|
||||||
import {
|
import { FavouriteSettings, SimpleTooltipElements } from '../../VariablesAndData';
|
||||||
FavouriteSettings,
|
|
||||||
SimpleTooltipElements,
|
|
||||||
} from '../../VariablesAndData';
|
|
||||||
import CookieMonsterPrompt from '../Prompt';
|
import CookieMonsterPrompt from '../Prompt';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,10 +30,7 @@ function CreateFavouriteStar(config) {
|
|||||||
Game.UpdateMenu();
|
Game.UpdateMenu();
|
||||||
};
|
};
|
||||||
FavStar.onmouseover = function () {
|
FavStar.onmouseover = function () {
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(this, escape(SimpleTooltipElements.FavouriteSettingPlaceholder.innerHTML));
|
||||||
this,
|
|
||||||
escape(SimpleTooltipElements.FavouriteSettingPlaceholder.innerHTML),
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
FavStar.onmouseout = function () {
|
FavStar.onmouseout = function () {
|
||||||
Game.tooltip.hide();
|
Game.tooltip.hide();
|
||||||
@@ -70,6 +60,7 @@ export default function CreatePrefOption(config) {
|
|||||||
a.id = ConfigPrefix + config;
|
a.id = ConfigPrefix + config;
|
||||||
a.onclick = function () {
|
a.onclick = function () {
|
||||||
ToggleConfig(config);
|
ToggleConfig(config);
|
||||||
|
Game.UpdateMenu();
|
||||||
};
|
};
|
||||||
a.textContent = Config[config].label[CMOptions[config]];
|
a.textContent = Config[config].label[CMOptions[config]];
|
||||||
div.appendChild(a);
|
div.appendChild(a);
|
||||||
@@ -102,9 +93,11 @@ export default function CreatePrefOption(config) {
|
|||||||
slider.value = CMOptions[config];
|
slider.value = CMOptions[config];
|
||||||
slider.oninput = function () {
|
slider.oninput = function () {
|
||||||
ToggleConfigVolume(config);
|
ToggleConfigVolume(config);
|
||||||
|
Game.UpdateMenu();
|
||||||
};
|
};
|
||||||
slider.onchange = function () {
|
slider.onchange = function () {
|
||||||
ToggleConfigVolume(config);
|
ToggleConfigVolume(config);
|
||||||
|
Game.UpdateMenu();
|
||||||
};
|
};
|
||||||
volume.appendChild(slider);
|
volume.appendChild(slider);
|
||||||
div.appendChild(volume);
|
div.appendChild(volume);
|
||||||
@@ -221,6 +214,7 @@ export default function CreatePrefOption(config) {
|
|||||||
CMOptions[config] = this.value;
|
CMOptions[config] = this.value;
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
RefreshScale();
|
RefreshScale();
|
||||||
|
Game.UpdateMenu();
|
||||||
};
|
};
|
||||||
div.appendChild(input);
|
div.appendChild(input);
|
||||||
div.appendChild(document.createTextNode(' '));
|
div.appendChild(document.createTextNode(' '));
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import { LoadConfig } from '../../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
import { LoadConfig } from '../../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import {
|
import { ConfigGroups, ConfigGroupsNotification } from '../../../Data/Sectionheaders.ts';
|
||||||
ConfigGroups,
|
|
||||||
ConfigGroupsNotification,
|
|
||||||
} from '../../../Data/Sectionheaders';
|
|
||||||
import Config from '../../../Data/SettingsData';
|
import Config from '../../../Data/SettingsData';
|
||||||
import ConfigDefault from '../../../Data/SettingsDefault';
|
import ConfigDefault from '../../../Data/SettingsDefault.ts';
|
||||||
import { FavouriteSettings } from '../../VariablesAndData';
|
import { FavouriteSettings } from '../../VariablesAndData';
|
||||||
import CreatePrefHeader from './CreateHeader';
|
import CreatePrefHeader from './CreateHeader';
|
||||||
import CreatePrefOption from './CreateOption';
|
import CreatePrefOption from './CreateOption';
|
||||||
@@ -35,24 +32,19 @@ export default function AddMenuPref(title) {
|
|||||||
// Make sub-sections of Notification section
|
// Make sub-sections of Notification section
|
||||||
if (group === 'Notification') {
|
if (group === 'Notification') {
|
||||||
Object.keys(ConfigGroupsNotification).forEach((subGroup) => {
|
Object.keys(ConfigGroupsNotification).forEach((subGroup) => {
|
||||||
const subGroupObject = CreatePrefHeader(
|
const subGroupObject = CreatePrefHeader(subGroup, ConfigGroupsNotification[subGroup]); // (group, display-name of group)
|
||||||
subGroup,
|
|
||||||
ConfigGroupsNotification[subGroup],
|
|
||||||
); // (group, display-name of group)
|
|
||||||
subGroupObject.style.fontSize = '15px';
|
subGroupObject.style.fontSize = '15px';
|
||||||
subGroupObject.style.opacity = '0.5';
|
subGroupObject.style.opacity = '0.5';
|
||||||
frag.appendChild(subGroupObject);
|
frag.appendChild(subGroupObject);
|
||||||
if (CMOptions.Header[subGroup]) {
|
if (CMOptions.Header[subGroup]) {
|
||||||
Object.keys(Config).forEach((option) => {
|
Object.keys(Config).forEach((option) => {
|
||||||
if (Config[option].group === subGroup)
|
if (Config[option].group === subGroup) frag.appendChild(CreatePrefOption(option));
|
||||||
frag.appendChild(CreatePrefOption(option));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Object.keys(Config).forEach((option) => {
|
Object.keys(Config).forEach((option) => {
|
||||||
if (Config[option].group === group)
|
if (Config[option].group === group) frag.appendChild(CreatePrefOption(option));
|
||||||
frag.appendChild(CreatePrefOption(option));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,8 +64,6 @@ export default function AddMenuPref(title) {
|
|||||||
|
|
||||||
l('menu').childNodes[2].insertBefore(
|
l('menu').childNodes[2].insertBefore(
|
||||||
frag,
|
frag,
|
||||||
l('menu').childNodes[2].childNodes[
|
l('menu').childNodes[2].childNodes[l('menu').childNodes[2].childNodes.length - 1],
|
||||||
l('menu').childNodes[2].childNodes.length - 1
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,13 @@
|
|||||||
import { AddMissingUpgrades } from './CreateMissingUpgrades';
|
import { AddMissingUpgrades } from './CreateMissingUpgrades';
|
||||||
import * as CreateSections from './CreateStatsSections';
|
import * as CreateSections from './CreateStatsSections';
|
||||||
import * as CreateElements from './CreateDOMElements';
|
import * as CreateElements from './CreateDOMElements';
|
||||||
import * as GameData from '../../../Data/Gamedata';
|
import * as GameData from '../../../Data/Gamedata.ts';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CacheAverageClicks,
|
CacheAverageClicks,
|
||||||
CacheAverageCookiesFromClicks,
|
CacheAverageCookiesFromClicks,
|
||||||
|
CacheObjectsNextAchievement,
|
||||||
CacheWrinklersFattest,
|
CacheWrinklersFattest,
|
||||||
CacheWrinklersNormal,
|
CacheWrinklersNormal,
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal,
|
||||||
@@ -16,7 +17,7 @@ import {
|
|||||||
import PopAllNormalWrinklers from '../../HelperFunctions/PopWrinklers';
|
import PopAllNormalWrinklers from '../../HelperFunctions/PopWrinklers';
|
||||||
import { ClickTimes, CookieTimes } from '../../VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../../VariablesAndData';
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import AddMissingAchievements from './CreateMissingAchievements';
|
import AddMissingAchievements from './CreateMissingAchievements';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,9 +65,7 @@ export default function AddMenuStats(title) {
|
|||||||
const popAllFrag = document.createDocumentFragment();
|
const popAllFrag = document.createDocumentFragment();
|
||||||
popAllFrag.appendChild(
|
popAllFrag.appendChild(
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheWrinklersTotal)} / ${Beautify(
|
`${Beautify(CacheWrinklersTotal)} / ${Beautify(CacheWrinklersNormal)} `,
|
||||||
CacheWrinklersNormal,
|
|
||||||
)} `,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
const popAllA = document.createElement('a');
|
const popAllA = document.createElement('a');
|
||||||
@@ -77,31 +76,22 @@ export default function AddMenuStats(title) {
|
|||||||
};
|
};
|
||||||
popAllFrag.appendChild(popAllA);
|
popAllFrag.appendChild(popAllA);
|
||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing('basic', 'Rewards of Popping (All/Normal)', popAllFrag),
|
||||||
'basic',
|
|
||||||
'Rewards of Popping (All/Normal)',
|
|
||||||
popAllFrag,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
const popFattestFrag = document.createDocumentFragment();
|
const popFattestFrag = document.createDocumentFragment();
|
||||||
popFattestFrag.appendChild(
|
popFattestFrag.appendChild(document.createTextNode(`${Beautify(CacheWrinklersFattest[0])} `));
|
||||||
document.createTextNode(`${Beautify(CacheWrinklersFattest[0])} `),
|
|
||||||
);
|
|
||||||
const popFattestA = document.createElement('a');
|
const popFattestA = document.createElement('a');
|
||||||
popFattestA.textContent = 'Pop Single Fattest';
|
popFattestA.textContent = 'Pop Single Fattest';
|
||||||
popFattestA.className = 'option';
|
popFattestA.className = 'option';
|
||||||
popFattestA.onclick = function () {
|
popFattestA.onclick = function () {
|
||||||
if (CacheWrinklersFattest[1] !== null)
|
if (CacheWrinklersFattest[1] !== null) Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
||||||
Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
|
||||||
};
|
};
|
||||||
popFattestFrag.appendChild(popFattestA);
|
popFattestFrag.appendChild(popFattestA);
|
||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${
|
`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${
|
||||||
CacheWrinklersFattest[1] !== null
|
CacheWrinklersFattest[1] !== null ? CacheWrinklersFattest[1] : 'None'
|
||||||
? CacheWrinklersFattest[1]
|
|
||||||
: 'None'
|
|
||||||
})`,
|
})`,
|
||||||
popFattestFrag,
|
popFattestFrag,
|
||||||
),
|
),
|
||||||
@@ -111,6 +101,22 @@ export default function AddMenuStats(title) {
|
|||||||
|
|
||||||
stats.appendChild(CreateSections.SeasonSection());
|
stats.appendChild(CreateSections.SeasonSection());
|
||||||
|
|
||||||
|
stats.appendChild(CreateElements.StatsHeader('Achievements', 'Achievs'));
|
||||||
|
if (CMOptions.Header.Achievs) {
|
||||||
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
|
const ObjectsTillNext = CacheObjectsNextAchievement[i];
|
||||||
|
stats.appendChild(
|
||||||
|
CreateElements.StatsListing(
|
||||||
|
'basic',
|
||||||
|
i,
|
||||||
|
ObjectsTillNext.AmountNeeded < 101
|
||||||
|
? document.createTextNode(`Next achievement in ${ObjectsTillNext.AmountNeeded}, price: ${Beautify(ObjectsTillNext.price)}`)
|
||||||
|
: document.createTextNode('No new achievement for next 100 buildings'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Miscellaneous', 'Misc'));
|
stats.appendChild(CreateElements.StatsHeader('Miscellaneous', 'Misc'));
|
||||||
if (CMOptions.Header.Misc) {
|
if (CMOptions.Header.Misc) {
|
||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
@@ -128,9 +134,9 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
`Average cookie clicks per second (past ${
|
`Average cookie clicks per second (past ${ClickTimes[CMOptions.AvgClicksHist]}${
|
||||||
ClickTimes[CMOptions.AvgClicksHist]
|
CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'
|
||||||
}${CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'})`,
|
})`,
|
||||||
document.createTextNode(Beautify(CacheAverageClicks, 1)),
|
document.createTextNode(Beautify(CacheAverageClicks, 1)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -181,9 +187,7 @@ export default function AddMenuStats(title) {
|
|||||||
Game.fps * 60 - (Game.OnAscend ? 0 : Game.T % (Game.fps * 60)),
|
Game.fps * 60 - (Game.OnAscend ? 0 : Game.T % (Game.fps * 60)),
|
||||||
4,
|
4,
|
||||||
);
|
);
|
||||||
stats.appendChild(
|
stats.appendChild(CreateElements.StatsListing('basic', 'Time till autosave', timer));
|
||||||
CreateElements.StatsListing('basic', 'Time till autosave', timer),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,10 +64,7 @@ export function StatsListing(type, name, text, placeholder) {
|
|||||||
Game.tooltip.hide();
|
Game.tooltip.hide();
|
||||||
};
|
};
|
||||||
tooltip.onmouseover = function () {
|
tooltip.onmouseover = function () {
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(this, escape(SimpleTooltipElements[placeholder].innerHTML));
|
||||||
this,
|
|
||||||
escape(SimpleTooltipElements[placeholder].innerHTML),
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
tooltip.style.cursor = 'default';
|
tooltip.style.cursor = 'default';
|
||||||
tooltip.style.display = 'inline-block';
|
tooltip.style.display = 'inline-block';
|
||||||
@@ -87,6 +84,28 @@ export function StatsListing(type, name, text, placeholder) {
|
|||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function creates an stats-listing-object for the stats page for missing items displays
|
||||||
|
* It is called by CM.Disp.AddMenuStats()
|
||||||
|
* @param {string} type The type fo the listing
|
||||||
|
* @param {string} name The name of the option
|
||||||
|
* @param {object} text The text-object of the option
|
||||||
|
* @param {bool} current Whether the season of the item is the current season
|
||||||
|
* @returns {object} div The option object
|
||||||
|
*/
|
||||||
|
export function StatsMissDispListing(type, name, text, current) {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.className = 'listing';
|
||||||
|
|
||||||
|
const listingName = document.createElement('b');
|
||||||
|
listingName.textContent = name;
|
||||||
|
if (current === true) listingName.style.color = CMOptions.ColourGreen;
|
||||||
|
div.appendChild(listingName);
|
||||||
|
div.appendChild(document.createTextNode(': '));
|
||||||
|
div.appendChild(text);
|
||||||
|
return div;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates a tooltip containing all missing holiday items contained in the list theMissDisp
|
* This function creates a tooltip containing all missing holiday items contained in the list theMissDisp
|
||||||
* @param {list} theMissDisp A list of the missing holiday items
|
* @param {list} theMissDisp A list of the missing holiday items
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ function CrateTooltipLockedAchievements(me) {
|
|||||||
tags.push('Locked', 0);
|
tags.push('Locked', 0);
|
||||||
|
|
||||||
let neuromancy = 0;
|
let neuromancy = 0;
|
||||||
if (Game.Has('Neuromancy') || (Game.sesame && me.pool === 'debug'))
|
if (Game.Has('Neuromancy') || (Game.sesame && me.pool === 'debug')) neuromancy = 1;
|
||||||
neuromancy = 1;
|
|
||||||
if (neuromancy && me.won === 0) tags.push('Click to win!', '#00c462');
|
if (neuromancy && me.won === 0) tags.push('Click to win!', '#00c462');
|
||||||
else if (neuromancy && me.won > 0) tags.push('Click to lose!', '#00c462');
|
else if (neuromancy && me.won > 0) tags.push('Click to lose!', '#00c462');
|
||||||
|
|
||||||
@@ -21,9 +20,9 @@ function CrateTooltipLockedAchievements(me) {
|
|||||||
let tagsStr = '';
|
let tagsStr = '';
|
||||||
for (let i = 0; i < tags.length; i += 2) {
|
for (let i = 0; i < tags.length; i += 2) {
|
||||||
if (i % 2 === 0)
|
if (i % 2 === 0)
|
||||||
tagsStr += ` <div class="tag" style="color:${
|
tagsStr += ` <div class="tag" style="color:${tags[i + 1] === 0 ? '#fff' : tags[i + 1]};">[${
|
||||||
tags[i + 1] === 0 ? '#fff' : tags[i + 1]
|
tags[i]
|
||||||
};">[${tags[i]}]</div>`;
|
}]</div>`;
|
||||||
}
|
}
|
||||||
tagsStr = tagsStr.substring(1);
|
tagsStr = tagsStr.substring(1);
|
||||||
|
|
||||||
@@ -35,9 +34,9 @@ function CrateTooltipLockedAchievements(me) {
|
|||||||
${tagsStr}<div class="line"></div><div class="description">${desc}</div></div>
|
${tagsStr}<div class="line"></div><div class="description">${desc}</div></div>
|
||||||
${
|
${
|
||||||
Game.sesame
|
Game.sesame
|
||||||
? `<div style="font-size:9px;">Id : ${me.id} | Order : ${Math.floor(
|
? `<div style="font-size:9px;">Id : ${me.id} | Order : ${Math.floor(me.order)}${
|
||||||
me.order,
|
me.tier ? ` | Tier : ${me.tier}` : ''
|
||||||
)}${me.tier ? ` | Tier : ${me.tier}` : ''}</div>`
|
}</div>`
|
||||||
: ''
|
: ''
|
||||||
}`;
|
}`;
|
||||||
}
|
}
|
||||||
@@ -55,12 +54,10 @@ export default function AddMissingAchievements() {
|
|||||||
if (CMOptions.MissingAchievements) {
|
if (CMOptions.MissingAchievements) {
|
||||||
Object.values(achievs.children).forEach((achievsCrate) => {
|
Object.values(achievs.children).forEach((achievsCrate) => {
|
||||||
if (!achievsCrate.className.includes('enabled')) {
|
if (!achievsCrate.className.includes('enabled')) {
|
||||||
const id = achievsCrate.onclick.toString().match(/(?<=\[).*(?=\])/g)[0];
|
const id = achievsCrate.onclick.toString().split(/\[(.*)\]/gi)[1];
|
||||||
const { icon } = Game.AchievementsById[id];
|
const { icon } = Game.AchievementsById[id];
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
achievsCrate.style.backgroundPosition = `${-icon[0] * 48}px ${
|
achievsCrate.style.backgroundPosition = `${-icon[0] * 48}px ${-icon[1] * 48}px`;
|
||||||
-icon[1] * 48
|
|
||||||
}px`;
|
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
achievsCrate.onmouseover = function () {
|
achievsCrate.onmouseover = function () {
|
||||||
if (!Game.mouseDown) {
|
if (!Game.mouseDown) {
|
||||||
@@ -68,13 +65,10 @@ export default function AddMissingAchievements() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() =>
|
||||||
return (function () {
|
(function () {
|
||||||
return CrateTooltipLockedAchievements(
|
return CrateTooltipLockedAchievements(Game.AchievementsById[id]);
|
||||||
Game.AchievementsById[id],
|
})(),
|
||||||
);
|
|
||||||
})();
|
|
||||||
},
|
|
||||||
'top',
|
'top',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
|
|||||||
@@ -12,22 +12,16 @@ import {
|
|||||||
export function AddMissingUpgrades() {
|
export function AddMissingUpgrades() {
|
||||||
l('menu').childNodes.forEach((menuSection) => {
|
l('menu').childNodes.forEach((menuSection) => {
|
||||||
if (menuSection.children[0]) {
|
if (menuSection.children[0]) {
|
||||||
if (
|
if (menuSection.children[0].innerHTML === 'Prestige' && CacheMissingUpgradesPrestige) {
|
||||||
menuSection.children[0].innerHTML === 'Prestige' &&
|
|
||||||
CacheMissingUpgradesPrestige
|
|
||||||
) {
|
|
||||||
const prestigeUpgradesMissing =
|
const prestigeUpgradesMissing =
|
||||||
CacheMissingUpgradesPrestige.match(new RegExp('div', 'g') || [])
|
CacheMissingUpgradesPrestige.match(new RegExp('div', 'g') || []).length / 2;
|
||||||
.length / 2;
|
|
||||||
const title = document.createElement('div');
|
const title = document.createElement('div');
|
||||||
title.id = 'CMMissingUpgradesPrestigeTitle';
|
title.id = 'CMMissingUpgradesPrestigeTitle';
|
||||||
title.className = 'listing';
|
title.className = 'listing';
|
||||||
const titlefrag = document.createElement('div');
|
const titlefrag = document.createElement('div');
|
||||||
titlefrag.innerHTML = `<b>Missing Prestige upgrades:</b> ${prestigeUpgradesMissing}/${
|
titlefrag.innerHTML = `<b>Missing Prestige upgrades:</b> ${prestigeUpgradesMissing}/${
|
||||||
Game.PrestigeUpgrades.length
|
Game.PrestigeUpgrades.length
|
||||||
} (${Math.floor(
|
} (${Math.floor((prestigeUpgradesMissing / Game.PrestigeUpgrades.length) * 100)}%)`;
|
||||||
(prestigeUpgradesMissing / Game.PrestigeUpgrades.length) * 100,
|
|
||||||
)}%)`;
|
|
||||||
title.appendChild(titlefrag);
|
title.appendChild(titlefrag);
|
||||||
menuSection.appendChild(title);
|
menuSection.appendChild(title);
|
||||||
const upgrades = document.createElement('div');
|
const upgrades = document.createElement('div');
|
||||||
@@ -46,8 +40,7 @@ export function AddMissingUpgrades() {
|
|||||||
Game.UpgradesByPool[''].length + Game.UpgradesByPool.tech.length
|
Game.UpgradesByPool[''].length + Game.UpgradesByPool.tech.length
|
||||||
} (${Math.floor(
|
} (${Math.floor(
|
||||||
(normalUpgradesMissing /
|
(normalUpgradesMissing /
|
||||||
(Game.UpgradesByPool[''].length +
|
(Game.UpgradesByPool[''].length + Game.UpgradesByPool.tech.length)) *
|
||||||
Game.UpgradesByPool.tech.length)) *
|
|
||||||
100,
|
100,
|
||||||
)}%)`;
|
)}%)`;
|
||||||
title.appendChild(titlefrag);
|
title.appendChild(titlefrag);
|
||||||
@@ -62,17 +55,14 @@ export function AddMissingUpgrades() {
|
|||||||
}
|
}
|
||||||
if (CacheMissingUpgradesCookies) {
|
if (CacheMissingUpgradesCookies) {
|
||||||
const cookieUpgradesMissing =
|
const cookieUpgradesMissing =
|
||||||
CacheMissingUpgradesCookies.match(new RegExp('div', 'g') || [])
|
CacheMissingUpgradesCookies.match(new RegExp('div', 'g') || []).length / 2;
|
||||||
.length / 2;
|
|
||||||
const title = document.createElement('div');
|
const title = document.createElement('div');
|
||||||
title.id = 'CMMissingUpgradesCookiesTitle';
|
title.id = 'CMMissingUpgradesCookiesTitle';
|
||||||
title.className = 'listing';
|
title.className = 'listing';
|
||||||
const titlefrag = document.createElement('div');
|
const titlefrag = document.createElement('div');
|
||||||
titlefrag.innerHTML = `<b>Missing Cookie upgrades:</b> ${cookieUpgradesMissing}/${
|
titlefrag.innerHTML = `<b>Missing Cookie upgrades:</b> ${cookieUpgradesMissing}/${
|
||||||
Game.UpgradesByPool.cookie.length
|
Game.UpgradesByPool.cookie.length
|
||||||
} (${Math.floor(
|
} (${Math.floor((cookieUpgradesMissing / Game.UpgradesByPool.cookie.length) * 100)}%)`;
|
||||||
(cookieUpgradesMissing / Game.UpgradesByPool.cookie.length) * 100,
|
|
||||||
)}%)`;
|
|
||||||
title.appendChild(titlefrag);
|
title.appendChild(titlefrag);
|
||||||
menuSection.appendChild(title);
|
menuSection.appendChild(title);
|
||||||
const upgrades = document.createElement('div');
|
const upgrades = document.createElement('div');
|
||||||
@@ -104,8 +94,8 @@ export function crateMissing(me) {
|
|||||||
const tooltip = `function() {return Game.crateTooltip(Game.UpgradesById[${me.id}], 'stats');}`;
|
const tooltip = `function() {return Game.crateTooltip(Game.UpgradesById[${me.id}], 'stats');}`;
|
||||||
return `<div class="${classes}"
|
return `<div class="${classes}"
|
||||||
${Game.getDynamicTooltip(tooltip, 'top', true)}
|
${Game.getDynamicTooltip(tooltip, 'top', true)}
|
||||||
style = "${`${
|
style = "${`${icon[2] ? `background-image: url(${icon[2]});` : ''}background-position:${
|
||||||
icon[2] ? `background-image: url(${icon[2]});` : ''
|
-icon[0] * 48
|
||||||
}background-position:${-icon[0] * 48}px ${-icon[1] * 48}px`};">
|
}px ${-icon[1] * 48}px`};">
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/** Functions to create the individual sections of the Statistics page */
|
/** Functions to create the individual sections of the Statistics page */
|
||||||
|
|
||||||
import * as GameData from '../../../Data/Gamedata';
|
import * as GameData from '../../../Data/Gamedata.ts';
|
||||||
import { MaxChainCookieReward } from '../../../Cache/Stats/ChainCookies';
|
import { MaxChainCookieReward } from '../../../Cache/Stats/ChainCookies';
|
||||||
import {
|
import {
|
||||||
CacheAvgCPSWithChoEgg,
|
CacheAvgCPSWithChoEgg,
|
||||||
@@ -38,15 +38,17 @@ import {
|
|||||||
} from '../../../Cache/VariablesAndData';
|
} from '../../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension';
|
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension';
|
||||||
import {
|
|
||||||
Beautify,
|
|
||||||
FormatTime,
|
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
|
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData';
|
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData';
|
||||||
import { StatsListing, StatsHeader, StatsMissDisp } from './CreateDOMElements';
|
import {
|
||||||
|
StatsListing,
|
||||||
|
StatsHeader,
|
||||||
|
StatsMissDisp,
|
||||||
|
StatsMissDispListing,
|
||||||
|
} from './CreateDOMElements';
|
||||||
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
|
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates the "Lucky" section of the stats page
|
* This function creates the "Lucky" section of the stats page
|
||||||
@@ -61,13 +63,10 @@ export function LuckySection() {
|
|||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsLuckySection';
|
section.className = 'CMStatsLuckySection';
|
||||||
|
|
||||||
const luckyColour =
|
const luckyColour = Game.cookies + GetWrinkConfigBank() < CacheLucky ? ColourRed : ColourGreen;
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheLucky ? ColourRed : ColourGreen;
|
|
||||||
const luckyTime =
|
const luckyTime =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheLucky
|
Game.cookies + GetWrinkConfigBank() < CacheLucky
|
||||||
? FormatTime(
|
? FormatTime((CacheLucky - (Game.cookies + GetWrinkConfigBank())) / GetCPS())
|
||||||
(CacheLucky - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
|
||||||
)
|
|
||||||
: '';
|
: '';
|
||||||
const luckyReqFrag = document.createDocumentFragment();
|
const luckyReqFrag = document.createDocumentFragment();
|
||||||
const luckyReqSpan = document.createElement('span');
|
const luckyReqSpan = document.createElement('span');
|
||||||
@@ -81,23 +80,14 @@ export function LuckySection() {
|
|||||||
luckyReqFrag.appendChild(luckyReqSmall);
|
luckyReqFrag.appendChild(luckyReqSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing('withTooltip', '"Lucky!" cookies required', luckyReqFrag, goldCookTooltip),
|
||||||
'withTooltip',
|
|
||||||
'"Lucky!" cookies required',
|
|
||||||
luckyReqFrag,
|
|
||||||
goldCookTooltip,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const luckyColourFrenzy =
|
const luckyColourFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy ? ColourRed : ColourGreen;
|
||||||
? ColourRed
|
|
||||||
: ColourGreen;
|
|
||||||
const luckyTimeFrenzy =
|
const luckyTimeFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
||||||
? FormatTime(
|
? FormatTime((CacheLuckyFrenzy - (Game.cookies + GetWrinkConfigBank())) / GetCPS())
|
||||||
(CacheLuckyFrenzy - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
|
||||||
)
|
|
||||||
: '';
|
: '';
|
||||||
const luckyReqFrenFrag = document.createDocumentFragment();
|
const luckyReqFrenFrag = document.createDocumentFragment();
|
||||||
const luckyReqFrenSpan = document.createElement('span');
|
const luckyReqFrenSpan = document.createElement('span');
|
||||||
@@ -125,8 +115,7 @@ export function LuckySection() {
|
|||||||
luckyRewardMaxSpan.style.fontWeight = 'bold';
|
luckyRewardMaxSpan.style.fontWeight = 'bold';
|
||||||
luckyRewardMaxSpan.className = ColourTextPre + CacheLuckyReward;
|
luckyRewardMaxSpan.className = ColourTextPre + CacheLuckyReward;
|
||||||
luckyRewardMaxSpan.textContent =
|
luckyRewardMaxSpan.textContent =
|
||||||
Beautify(CacheLuckyReward) +
|
Beautify(CacheLuckyReward) + (luckySplit ? ` / ${Beautify(CacheLuckyWrathReward)}` : '');
|
||||||
(luckySplit ? ` / ${Beautify(CacheLuckyWrathReward)}` : '');
|
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
@@ -187,15 +176,10 @@ export function ChainSection() {
|
|||||||
section.className = 'CMStatsChainSection';
|
section.className = 'CMStatsChainSection';
|
||||||
|
|
||||||
const chainColour =
|
const chainColour =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainRequired ? ColourRed : ColourGreen;
|
||||||
? ColourRed
|
|
||||||
: ColourGreen;
|
|
||||||
const chainTime =
|
const chainTime =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
||||||
? FormatTime(
|
? FormatTime((CacheChainRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS())
|
||||||
(CacheChainRequired - (Game.cookies + GetWrinkConfigBank())) /
|
|
||||||
GetCPS(),
|
|
||||||
)
|
|
||||||
: '';
|
: '';
|
||||||
const chainReqFrag = document.createDocumentFragment();
|
const chainReqFrag = document.createDocumentFragment();
|
||||||
const chainReqSpan = document.createElement('span');
|
const chainReqSpan = document.createElement('span');
|
||||||
@@ -209,24 +193,14 @@ export function ChainSection() {
|
|||||||
chainReqFrag.appendChild(chainReqSmall);
|
chainReqFrag.appendChild(chainReqSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing('withTooltip', '"Chain" cookies required', chainReqFrag, goldCookTooltip),
|
||||||
'withTooltip',
|
|
||||||
'"Chain" cookies required',
|
|
||||||
chainReqFrag,
|
|
||||||
goldCookTooltip,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const chainWrathColour =
|
const chainWrathColour =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired ? ColourRed : ColourGreen;
|
||||||
? ColourRed
|
|
||||||
: ColourGreen;
|
|
||||||
const chainWrathTime =
|
const chainWrathTime =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
||||||
? FormatTime(
|
? FormatTime((CacheChainWrathRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS())
|
||||||
(CacheChainWrathRequired - (Game.cookies + GetWrinkConfigBank())) /
|
|
||||||
GetCPS(),
|
|
||||||
)
|
|
||||||
: '';
|
: '';
|
||||||
const chainWrathReqFrag = document.createDocumentFragment();
|
const chainWrathReqFrag = document.createDocumentFragment();
|
||||||
const chainWrathReqSpan = document.createElement('span');
|
const chainWrathReqSpan = document.createElement('span');
|
||||||
@@ -249,15 +223,10 @@ export function ChainSection() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const chainColourFrenzy =
|
const chainColourFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired ? ColourRed : ColourGreen;
|
||||||
? ColourRed
|
|
||||||
: ColourGreen;
|
|
||||||
const chainTimeFrenzy =
|
const chainTimeFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
||||||
? FormatTime(
|
? FormatTime((CacheChainFrenzyRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS())
|
||||||
(CacheChainFrenzyRequired - (Game.cookies + GetWrinkConfigBank())) /
|
|
||||||
GetCPS(),
|
|
||||||
)
|
|
||||||
: '';
|
: '';
|
||||||
const chainReqFrenFrag = document.createDocumentFragment();
|
const chainReqFrenFrag = document.createDocumentFragment();
|
||||||
const chainReqFrenSpan = document.createElement('span');
|
const chainReqFrenSpan = document.createElement('span');
|
||||||
@@ -280,15 +249,11 @@ export function ChainSection() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const chainWrathColourFrenzy =
|
const chainWrathColourFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired ? ColourRed : ColourGreen;
|
||||||
? ColourRed
|
|
||||||
: ColourGreen;
|
|
||||||
const chainWrathTimeFrenzy =
|
const chainWrathTimeFrenzy =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
||||||
? FormatTime(
|
? FormatTime(
|
||||||
(CacheChainFrenzyWrathRequired -
|
(CacheChainFrenzyWrathRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
(Game.cookies + GetWrinkConfigBank())) /
|
|
||||||
GetCPS(),
|
|
||||||
)
|
)
|
||||||
: '';
|
: '';
|
||||||
const chainWrathReqFrenFrag = document.createDocumentFragment();
|
const chainWrathReqFrenFrag = document.createDocumentFragment();
|
||||||
@@ -316,9 +281,7 @@ export function ChainSection() {
|
|||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" reward (max) (golden / wrath)',
|
'"Chain" reward (max) (golden / wrath)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainMaxReward[0])} / ${Beautify(
|
`${Beautify(CacheChainMaxReward[0])} / ${Beautify(CacheChainWrathMaxReward[0])}`,
|
||||||
CacheChainWrathMaxReward[0],
|
|
||||||
)}`,
|
|
||||||
),
|
),
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -329,9 +292,7 @@ export function ChainSection() {
|
|||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" reward (max) (frenzy) (golden / wrath)',
|
'"Chain" reward (max) (frenzy) (golden / wrath)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainFrenzyMaxReward[0])} / ${Beautify(
|
`${Beautify(CacheChainFrenzyMaxReward[0])} / ${Beautify(CacheChainFrenzyMaxReward[0])}`,
|
||||||
CacheChainFrenzyMaxReward[0],
|
|
||||||
)}`,
|
|
||||||
),
|
),
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -341,23 +302,13 @@ export function ChainSection() {
|
|||||||
Game.cookiesPs * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment,
|
Game.cookiesPs * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment,
|
||||||
Game.cookies * 0.5,
|
Game.cookies * 0.5,
|
||||||
);
|
);
|
||||||
const chainCur = MaxChainCookieReward(
|
const chainCur = MaxChainCookieReward(7, chainCurMax, CacheGoldenCookiesMult)[0];
|
||||||
7,
|
const chainCurWrath = MaxChainCookieReward(6, chainCurMax, CacheWrathCookiesMult)[0];
|
||||||
chainCurMax,
|
|
||||||
CacheGoldenCookiesMult,
|
|
||||||
)[0];
|
|
||||||
const chainCurWrath = MaxChainCookieReward(
|
|
||||||
6,
|
|
||||||
chainCurMax,
|
|
||||||
CacheWrathCookiesMult,
|
|
||||||
)[0];
|
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" reward (cur) (golden / wrath)',
|
'"Chain" reward (cur) (golden / wrath)',
|
||||||
document.createTextNode(
|
document.createTextNode(`${Beautify(chainCur)} / ${Beautify(chainCurWrath)}`),
|
||||||
`${Beautify(chainCur)} / ${Beautify(chainCurWrath)}`,
|
|
||||||
),
|
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -367,9 +318,7 @@ export function ChainSection() {
|
|||||||
'withTooltip',
|
'withTooltip',
|
||||||
'CPS needed for next level (g / w)',
|
'CPS needed for next level (g / w)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainRequiredNext)} / ${Beautify(
|
`${Beautify(CacheChainRequiredNext)} / ${Beautify(CacheChainWrathRequiredNext)}`,
|
||||||
CacheChainWrathRequiredNext,
|
|
||||||
)}`,
|
|
||||||
),
|
),
|
||||||
'ChainNextLevelPlaceholder',
|
'ChainNextLevelPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -398,14 +347,10 @@ export function SpellsSection() {
|
|||||||
section.className = 'CMStatsSpellsSection';
|
section.className = 'CMStatsSpellsSection';
|
||||||
|
|
||||||
const conjureColour =
|
const conjureColour =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheConjure
|
Game.cookies + GetWrinkConfigBank() < CacheConjure ? ColourRed : ColourGreen;
|
||||||
? ColourRed
|
|
||||||
: ColourGreen;
|
|
||||||
const conjureTime =
|
const conjureTime =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheConjure
|
Game.cookies + GetWrinkConfigBank() < CacheConjure
|
||||||
? FormatTime(
|
? FormatTime((CacheConjure - (Game.cookies + GetWrinkConfigBank())) / GetCPS())
|
||||||
(CacheConjure - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
|
||||||
)
|
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
const conjureReqFrag = document.createDocumentFragment();
|
const conjureReqFrag = document.createDocumentFragment();
|
||||||
@@ -437,18 +382,14 @@ export function SpellsSection() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const conjureFrenzyColour =
|
const conjureFrenzyColour =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheConjure * 7
|
Game.cookies + GetWrinkConfigBank() < CacheConjure * 7 ? ColourRed : ColourGreen;
|
||||||
? ColourRed
|
|
||||||
: ColourGreen;
|
|
||||||
const conjureFrenzyCur = Math.min(
|
const conjureFrenzyCur = Math.min(
|
||||||
(Game.cookies + GetWrinkConfigBank()) * 0.15,
|
(Game.cookies + GetWrinkConfigBank()) * 0.15,
|
||||||
CacheNoGoldSwitchCookiesPS * 60 * 30,
|
CacheNoGoldSwitchCookiesPS * 60 * 30,
|
||||||
);
|
);
|
||||||
const conjureFrenzyTime =
|
const conjureFrenzyTime =
|
||||||
Game.cookies + GetWrinkConfigBank() < CacheConjure * 7
|
Game.cookies + GetWrinkConfigBank() < CacheConjure * 7
|
||||||
? FormatTime(
|
? FormatTime((CacheConjure * 7 - (Game.cookies + GetWrinkConfigBank())) / GetCPS())
|
||||||
(CacheConjure * 7 - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
|
||||||
)
|
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
const conjureFrenzyReqFrag = document.createDocumentFragment();
|
const conjureFrenzyReqFrag = document.createDocumentFragment();
|
||||||
@@ -491,9 +432,7 @@ export function SpellsSection() {
|
|||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Spontaneous Edifice" cookies required (most expensive building)',
|
'"Spontaneous Edifice" cookies required (most expensive building)',
|
||||||
document.createTextNode(
|
document.createTextNode(`${Beautify(CacheEdifice)} (${CacheEdificeBuilding})`),
|
||||||
`${Beautify(CacheEdifice)} (${CacheEdificeBuilding})`,
|
|
||||||
),
|
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -509,60 +448,40 @@ export function GardenSection() {
|
|||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsGardenSection';
|
section.className = 'CMStatsGardenSection';
|
||||||
|
|
||||||
const bakeberryColour =
|
const bakeberryColour = Game.cookies < Game.cookiesPs * 60 * 10 * 100 ? ColourRed : ColourGreen;
|
||||||
Game.cookies < Game.cookiesPs * 60 * 10 * 100 ? ColourRed : ColourGreen;
|
|
||||||
const bakeberryFrag = document.createElement('span');
|
const bakeberryFrag = document.createElement('span');
|
||||||
bakeberryFrag.style.fontWeight = 'bold';
|
bakeberryFrag.style.fontWeight = 'bold';
|
||||||
bakeberryFrag.className = ColourTextPre + bakeberryColour;
|
bakeberryFrag.className = ColourTextPre + bakeberryColour;
|
||||||
bakeberryFrag.textContent = Beautify(Game.cookiesPs * 60 * 10 * 100);
|
bakeberryFrag.textContent = Beautify(Game.cookiesPs * 60 * 10 * 100);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing('basic', 'Cookies required for max reward of Bakeberry: ', bakeberryFrag),
|
||||||
'basic',
|
|
||||||
'Cookies required for max reward of Bakeberry: ',
|
|
||||||
bakeberryFrag,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const chocorootColour =
|
const chocorootColour = Game.cookies < Game.cookiesPs * 60 * 100 ? ColourRed : ColourGreen;
|
||||||
Game.cookies < Game.cookiesPs * 60 * 100 ? ColourRed : ColourGreen;
|
|
||||||
const chocorootFrag = document.createElement('span');
|
const chocorootFrag = document.createElement('span');
|
||||||
chocorootFrag.style.fontWeight = 'bold';
|
chocorootFrag.style.fontWeight = 'bold';
|
||||||
chocorootFrag.className = ColourTextPre + chocorootColour;
|
chocorootFrag.className = ColourTextPre + chocorootColour;
|
||||||
chocorootFrag.textContent = Beautify(Game.cookiesPs * 60 * 100);
|
chocorootFrag.textContent = Beautify(Game.cookiesPs * 60 * 100);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing('basic', 'Cookies required for max reward of Chocoroot: ', chocorootFrag),
|
||||||
'basic',
|
|
||||||
'Cookies required for max reward of Chocoroot: ',
|
|
||||||
chocorootFrag,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const queenbeetColour =
|
const queenbeetColour = Game.cookies < Game.cookiesPs * 60 * 60 * 25 ? ColourRed : ColourGreen;
|
||||||
Game.cookies < Game.cookiesPs * 60 * 60 * 25 ? ColourRed : ColourGreen;
|
|
||||||
const queenbeetFrag = document.createElement('span');
|
const queenbeetFrag = document.createElement('span');
|
||||||
queenbeetFrag.style.fontWeight = 'bold';
|
queenbeetFrag.style.fontWeight = 'bold';
|
||||||
queenbeetFrag.className = ColourTextPre + queenbeetColour;
|
queenbeetFrag.className = ColourTextPre + queenbeetColour;
|
||||||
queenbeetFrag.textContent = Beautify(Game.cookiesPs * 60 * 60 * 25);
|
queenbeetFrag.textContent = Beautify(Game.cookiesPs * 60 * 60 * 25);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing('basic', 'Cookies required for max reward of Queenbeet: ', queenbeetFrag),
|
||||||
'basic',
|
|
||||||
'Cookies required for max reward of Queenbeet: ',
|
|
||||||
queenbeetFrag,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const duketaterColour =
|
const duketaterColour = Game.cookies < Game.cookiesPs * 60 * 15 * 100 ? ColourRed : ColourGreen;
|
||||||
Game.cookies < Game.cookiesPs * 60 * 15 * 100 ? ColourRed : ColourGreen;
|
|
||||||
const duketaterFrag = document.createElement('span');
|
const duketaterFrag = document.createElement('span');
|
||||||
duketaterFrag.style.fontWeight = 'bold';
|
duketaterFrag.style.fontWeight = 'bold';
|
||||||
duketaterFrag.className = ColourTextPre + duketaterColour;
|
duketaterFrag.className = ColourTextPre + duketaterColour;
|
||||||
duketaterFrag.textContent = Beautify(Game.cookiesPs * 60 * 15 * 100);
|
duketaterFrag.textContent = Beautify(Game.cookiesPs * 60 * 15 * 100);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing('basic', 'Cookies required for max reward of Duketater: ', duketaterFrag),
|
||||||
'basic',
|
|
||||||
'Cookies required for max reward of Duketater: ',
|
|
||||||
duketaterFrag,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
const missingPlantDrops = [];
|
const missingPlantDrops = [];
|
||||||
Object.keys(GameData.PlantDrops).forEach((i) => {
|
Object.keys(GameData.PlantDrops).forEach((i) => {
|
||||||
@@ -572,11 +491,7 @@ export function GardenSection() {
|
|||||||
});
|
});
|
||||||
if (missingPlantDrops.length !== 0) {
|
if (missingPlantDrops.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing('basic', 'Rare plant drops left to unlock', StatsMissDisp(missingPlantDrops)),
|
||||||
'basic',
|
|
||||||
'Rare plant drops left to unlock',
|
|
||||||
StatsMissDisp(missingPlantDrops),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return section;
|
return section;
|
||||||
@@ -595,18 +510,14 @@ export function PrestigeSection() {
|
|||||||
CacheRealCookiesEarned +
|
CacheRealCookiesEarned +
|
||||||
Game.cookiesReset +
|
Game.cookiesReset +
|
||||||
CacheWrinklersTotal +
|
CacheWrinklersTotal +
|
||||||
(Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')
|
(Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CacheLastChoEgg : 0),
|
||||||
? CacheLastChoEgg
|
|
||||||
: 0),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'Prestige level (cur / max)',
|
'Prestige level (cur / max)',
|
||||||
document.createTextNode(
|
document.createTextNode(`${Beautify(Game.prestige)} / ${Beautify(possiblePresMax)}`),
|
||||||
`${Beautify(Game.prestige)} / ${Beautify(possiblePresMax)}`,
|
|
||||||
),
|
|
||||||
'PrestMaxTooltipPlaceholder',
|
'PrestMaxTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -617,21 +528,14 @@ export function PrestigeSection() {
|
|||||||
(CacheRealCookiesEarned +
|
(CacheRealCookiesEarned +
|
||||||
Game.cookiesReset +
|
Game.cookiesReset +
|
||||||
CacheWrinklersTotal +
|
CacheWrinklersTotal +
|
||||||
((
|
((Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CacheLastChoEgg : 0)
|
||||||
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')
|
|
||||||
? CacheLastChoEgg
|
|
||||||
: 0
|
|
||||||
)
|
|
||||||
? CacheLastChoEgg
|
? CacheLastChoEgg
|
||||||
: 0)),
|
: 0)),
|
||||||
);
|
);
|
||||||
const cookiesNextFrag = document.createDocumentFragment();
|
const cookiesNextFrag = document.createDocumentFragment();
|
||||||
cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook)));
|
cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook)));
|
||||||
const cookiesNextSmall = document.createElement('small');
|
const cookiesNextSmall = document.createElement('small');
|
||||||
cookiesNextSmall.textContent = ` (${FormatTime(
|
cookiesNextSmall.textContent = ` (${FormatTime(neededCook / CacheAvgCPSWithChoEgg, 1)})`;
|
||||||
neededCook / CacheAvgCPSWithChoEgg,
|
|
||||||
1,
|
|
||||||
)})`;
|
|
||||||
cookiesNextFrag.appendChild(cookiesNextSmall);
|
cookiesNextFrag.appendChild(cookiesNextSmall);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
@@ -666,8 +570,7 @@ export function PrestigeSection() {
|
|||||||
const HCTarget = Number(CMOptions.HeavenlyChipsTarget);
|
const HCTarget = Number(CMOptions.HeavenlyChipsTarget);
|
||||||
if (!Number.isNaN(HCTarget)) {
|
if (!Number.isNaN(HCTarget)) {
|
||||||
const CookiesTillTarget =
|
const CookiesTillTarget =
|
||||||
HCTarget -
|
HCTarget - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||||
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
|
||||||
if (CookiesTillTarget > 0) {
|
if (CookiesTillTarget > 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
@@ -680,9 +583,7 @@ export function PrestigeSection() {
|
|||||||
StatsListing(
|
StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Time till target (cur, current 5 second average)',
|
'Time till target (cur, current 5 second average)',
|
||||||
document.createTextNode(
|
document.createTextNode(FormatTime(CookiesTillTarget / CacheHCPerSecond)),
|
||||||
FormatTime(CookiesTillTarget / CacheHCPerSecond),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -698,18 +599,11 @@ export function PrestigeSection() {
|
|||||||
resetFrag.appendChild(resetSmall);
|
resetFrag.appendChild(resetSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing('withTooltip', 'Reset bonus income', resetFrag, 'ResetTooltipPlaceholder'),
|
||||||
'withTooltip',
|
|
||||||
'Reset bonus income',
|
|
||||||
resetFrag,
|
|
||||||
'ResetTooltipPlaceholder',
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const currentPrestige = Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
|
const currentPrestige = Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
|
||||||
const willHave = Math.floor(
|
const willHave = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||||
Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned),
|
|
||||||
);
|
|
||||||
const willGet = willHave - currentPrestige;
|
const willGet = willHave - currentPrestige;
|
||||||
if (!Game.Has('Lucky digit')) {
|
if (!Game.Has('Lucky digit')) {
|
||||||
let delta7 = 7 - (willHave % 10);
|
let delta7 = 7 - (willHave % 10);
|
||||||
@@ -722,9 +616,7 @@ export function PrestigeSection() {
|
|||||||
`${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`,
|
`${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
section.appendChild(
|
section.appendChild(StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7));
|
||||||
StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Game.Has('Lucky number')) {
|
if (!Game.Has('Lucky number')) {
|
||||||
@@ -738,9 +630,7 @@ export function PrestigeSection() {
|
|||||||
`${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`,
|
`${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
section.appendChild(
|
section.appendChild(StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777));
|
||||||
StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Game.Has('Lucky payout')) {
|
if (!Game.Has('Lucky payout')) {
|
||||||
@@ -754,9 +644,7 @@ export function PrestigeSection() {
|
|||||||
`${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`,
|
`${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
section.appendChild(
|
section.appendChild(StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777));
|
||||||
StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return section;
|
return section;
|
||||||
@@ -806,8 +694,7 @@ export function SeasonSection() {
|
|||||||
specDisp = true;
|
specDisp = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const choEgg =
|
const choEgg = Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
||||||
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
|
||||||
const centEgg = Game.Has('Century egg');
|
const centEgg = Game.Has('Century egg');
|
||||||
|
|
||||||
if (Game.season === 'christmas' || specDisp || choEgg || centEgg) {
|
if (Game.season === 'christmas' || specDisp || choEgg || centEgg) {
|
||||||
@@ -815,10 +702,11 @@ export function SeasonSection() {
|
|||||||
if (CMOptions.Header.Sea) {
|
if (CMOptions.Header.Sea) {
|
||||||
if (missingHalloweenCookies.length !== 0) {
|
if (missingHalloweenCookies.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Halloween cookies left to buy',
|
'Halloween cookies left to buy',
|
||||||
StatsMissDisp(missingHalloweenCookies),
|
StatsMissDisp(missingHalloweenCookies),
|
||||||
|
Game.season === 'halloween',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
let failRateHalloween = 0.95;
|
let failRateHalloween = 0.95;
|
||||||
@@ -833,25 +721,25 @@ export function SeasonSection() {
|
|||||||
}
|
}
|
||||||
const obtainedCookiesChance = missingHalloweenCookies.length / 7;
|
const obtainedCookiesChance = missingHalloweenCookies.length / 7;
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Chance of receiving a cookie from wrinkler/shiny wrinkler',
|
'Chance of receiving a cookie from wrinkler/shiny wrinkler',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(
|
`${Beautify((1 - failRateHalloween) * obtainedCookiesChance * 100)}% / ${Beautify(
|
||||||
(1 - failRateHalloween) * obtainedCookiesChance * 100,
|
|
||||||
)}% / ${Beautify(
|
|
||||||
(1 - failRateHalloween * 0.9) * obtainedCookiesChance * 100,
|
(1 - failRateHalloween * 0.9) * obtainedCookiesChance * 100,
|
||||||
)}%`,
|
)}%`,
|
||||||
),
|
),
|
||||||
|
Game.season === 'halloween',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (missingChristmasCookies.length !== 0) {
|
if (missingChristmasCookies.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Christmas cookies left to buy',
|
'Christmas cookies left to buy',
|
||||||
StatsMissDisp(missingChristmasCookies),
|
StatsMissDisp(missingChristmasCookies),
|
||||||
|
Game.season === 'christmas',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
let failRateChristmas = 0.8;
|
let failRateChristmas = 0.8;
|
||||||
@@ -866,23 +754,23 @@ export function SeasonSection() {
|
|||||||
}
|
}
|
||||||
const obtainedCookiesChance = missingChristmasCookies.length / 7;
|
const obtainedCookiesChance = missingChristmasCookies.length / 7;
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Chance of receiving a cookie from reindeer',
|
'Chance of receiving a cookie from reindeer',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(
|
`${Beautify((1 - failRateChristmas) * obtainedCookiesChance * 100)}%`,
|
||||||
(1 - failRateChristmas) * obtainedCookiesChance * 100,
|
|
||||||
)}%`,
|
|
||||||
),
|
),
|
||||||
|
Game.season === 'christmas',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (missingValentineCookies.length !== 0) {
|
if (missingValentineCookies.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Valentine cookies left to buy',
|
'Valentine cookies left to buy',
|
||||||
StatsMissDisp(missingValentineCookies),
|
StatsMissDisp(missingValentineCookies),
|
||||||
|
Game.season === 'valentines',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -900,72 +788,64 @@ export function SeasonSection() {
|
|||||||
// Calculations courtesy of @svschouw, at https://github.com/Aktanusa/CookieMonster/issues/25
|
// Calculations courtesy of @svschouw, at https://github.com/Aktanusa/CookieMonster/issues/25
|
||||||
const succesRateEgg = 1 - failRateEgg;
|
const succesRateEgg = 1 - failRateEgg;
|
||||||
const obtainedEggs = Game.eggDrops.length - missingNormalEggs.length;
|
const obtainedEggs = Game.eggDrops.length - missingNormalEggs.length;
|
||||||
const obtainedRareEggs =
|
const obtainedRareEggs = Game.rareEggDrops.length - missingRareEggs.length;
|
||||||
Game.rareEggDrops.length - missingRareEggs.length;
|
const pNormal1 = succesRateEgg * 0.9 * (1 - obtainedEggs / Game.eggDrops.length);
|
||||||
const pNormal1 =
|
const pRare1 = succesRateEgg * 0.1 * (1 - obtainedRareEggs / Game.rareEggDrops.length);
|
||||||
succesRateEgg * 0.9 * (1 - obtainedEggs / Game.eggDrops.length);
|
const pRedropNormal = succesRateEgg * 0.9 * (obtainedEggs / Game.eggDrops.length);
|
||||||
const pRare1 =
|
const pRedropRare = succesRateEgg * 0.1 * (obtainedRareEggs / Game.rareEggDrops.length);
|
||||||
succesRateEgg *
|
|
||||||
0.1 *
|
|
||||||
(1 - obtainedRareEggs / Game.rareEggDrops.length);
|
|
||||||
const pRedropNormal =
|
|
||||||
succesRateEgg * 0.9 * (obtainedEggs / Game.eggDrops.length);
|
|
||||||
const pRedropRare =
|
|
||||||
succesRateEgg * 0.1 * (obtainedRareEggs / Game.rareEggDrops.length);
|
|
||||||
const pRedrop = pRedropNormal + pRedropRare;
|
const pRedrop = pRedropNormal + pRedropRare;
|
||||||
const pNormal2 =
|
const pNormal2 = pRedrop * 0.9 * (1 - obtainedEggs / Game.eggDrops.length);
|
||||||
pRedrop * 0.9 * (1 - obtainedEggs / Game.eggDrops.length);
|
const pRare2 = pRedrop * 0.1 * (1 - obtainedRareEggs / Game.rareEggDrops.length);
|
||||||
const pRare2 =
|
|
||||||
pRedrop * 0.1 * (1 - obtainedRareEggs / Game.rareEggDrops.length);
|
|
||||||
return [pNormal1 + pNormal2, pRare1 + pRare2];
|
return [pNormal1 + pNormal2, pRare1 + pRare2];
|
||||||
};
|
};
|
||||||
if (missingNormalEggs.length !== 0) {
|
if (missingNormalEggs.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Normal easter eggs left to unlock',
|
'Normal easter eggs left to unlock',
|
||||||
StatsMissDisp(missingNormalEggs),
|
StatsMissDisp(missingNormalEggs),
|
||||||
|
Game.season === 'easter',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Chance of receiving an egg from wrinkler/golden cookie',
|
'Chance of receiving an egg from wrinkler/golden cookie',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(dropRateEgg(0.98)[0] * 100)}% / ${Beautify(
|
`${Beautify(dropRateEgg(0.98)[0] * 100)}% / ${Beautify(dropRateEgg(0.9)[0] * 100)}%`,
|
||||||
dropRateEgg(0.9)[0] * 100,
|
|
||||||
)}%`,
|
|
||||||
),
|
),
|
||||||
|
Game.season === 'easter',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (missingRareEggs.length !== 0) {
|
if (missingRareEggs.length !== 0) {
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Rare easter eggs left to unlock',
|
'Rare easter eggs left to unlock',
|
||||||
StatsMissDisp(missingRareEggs),
|
StatsMissDisp(missingRareEggs),
|
||||||
|
Game.season === 'easter',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Chance of receiving a rare egg from wrinkler/golden cookie',
|
'Chance of receiving a rare egg from wrinkler/golden cookie',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(dropRateEgg(0.98)[1] * 100)}% / ${Beautify(
|
`${Beautify(dropRateEgg(0.98)[1] * 100)}% / ${Beautify(dropRateEgg(0.9)[1] * 100)}%`,
|
||||||
dropRateEgg(0.9)[1] * 100,
|
|
||||||
)}%`,
|
|
||||||
),
|
),
|
||||||
|
Game.season === 'easter',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Game.season === 'christmas')
|
if (Game.season === 'christmas')
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsMissDispListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Reindeer reward',
|
'Reindeer reward',
|
||||||
document.createTextNode(Beautify(CacheSeaSpec)),
|
document.createTextNode(Beautify(CacheSeaSpec)),
|
||||||
|
true,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (choEgg) {
|
if (choEgg) {
|
||||||
@@ -983,9 +863,7 @@ export function SeasonSection() {
|
|||||||
StatsListing(
|
StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Century egg multiplier',
|
'Century egg multiplier',
|
||||||
document.createTextNode(
|
document.createTextNode(`${Math.round((CacheCentEgg - 1) * 10000) / 100}%`),
|
||||||
`${Math.round((CacheCentEgg - 1) * 10000) / 100}%`,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,26 +12,24 @@ import { isInitializing } from '../../InitSaveLoad/Variables';
|
|||||||
export default function Flash(mode, config, forced) {
|
export default function Flash(mode, config, forced) {
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
// The arguments check makes the sound not play upon initialization of the mod
|
||||||
if (
|
if (
|
||||||
((CMOptions[config] === 1 || forced) &&
|
((CMOptions[config] === 1 || forced) && mode === 3 && isInitializing === false) ||
|
||||||
mode === 3 &&
|
|
||||||
isInitializing === false) ||
|
|
||||||
mode === 1
|
mode === 1
|
||||||
) {
|
) {
|
||||||
l('CMFlashScreen').style.backgroundColor = CMOptions[`Colour${config}`];
|
l('CMFlashScreen').style.backgroundColor = CMOptions[`Colour${config}`];
|
||||||
l('CMFlashScreen').style.opacity = '0.5';
|
l('CMFlashScreen').style.opacity = '0.5';
|
||||||
if (mode === 3) {
|
if (mode === 3) {
|
||||||
l('CMFlashScreen').style.display = 'inline';
|
l('CMFlashScreen').style.display = 'inline';
|
||||||
setTimeout(function () {
|
setTimeout(() => {
|
||||||
Flash(2, config, true);
|
Flash(2, config, true);
|
||||||
}, 1000 / Game.fps);
|
}, 1000 / Game.fps);
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function () {
|
setTimeout(() => {
|
||||||
Flash(0, config, true);
|
Flash(0, config, true);
|
||||||
}, 1000 / Game.fps);
|
}, 1000 / Game.fps);
|
||||||
}
|
}
|
||||||
} else if (mode === 2) {
|
} else if (mode === 2) {
|
||||||
l('CMFlashScreen').style.opacity = '1';
|
l('CMFlashScreen').style.opacity = '1';
|
||||||
setTimeout(function () {
|
setTimeout(() => {
|
||||||
Flash(1, config, true);
|
Flash(1, config, true);
|
||||||
}, 1000 / Game.fps);
|
}, 1000 / Game.fps);
|
||||||
} else if (mode === 0) l('CMFlashScreen').style.display = 'none';
|
} else if (mode === 0) l('CMFlashScreen').style.display = 'none';
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ export default function PlaySound(url, sndConfig, volConfig, forced) {
|
|||||||
if ((CMOptions[sndConfig] === 1 || forced) && isInitializing === false) {
|
if ((CMOptions[sndConfig] === 1 || forced) && isInitializing === false) {
|
||||||
// eslint-disable-next-line new-cap
|
// eslint-disable-next-line new-cap
|
||||||
const sound = new Audio(url);
|
const sound = new Audio(url);
|
||||||
if (CMOptions.GeneralSound)
|
if (CMOptions.GeneralSound) sound.volume = (CMOptions[volConfig] / 100) * (Game.volume / 100);
|
||||||
sound.volume = (CMOptions[volConfig] / 100) * (Game.volume / 100);
|
|
||||||
else sound.volume = CMOptions[volConfig] / 100;
|
else sound.volume = CMOptions[volConfig] / 100;
|
||||||
sound.play();
|
sound.play();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,9 @@ export function UpdateFavicon() {
|
|||||||
if (CMOptions.Favicon === 1 && LastGoldenCookieState > 0) {
|
if (CMOptions.Favicon === 1 && LastGoldenCookieState > 0) {
|
||||||
if (CacheSpawnedGoldenShimmer.wrath)
|
if (CacheSpawnedGoldenShimmer.wrath)
|
||||||
l('CMFavicon').href =
|
l('CMFavicon').href =
|
||||||
'https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico';
|
'https://CookieMonsterTeam.github.io/CookieMonster/favicon/wrathCookie.ico';
|
||||||
else
|
else
|
||||||
l('CMFavicon').href =
|
l('CMFavicon').href =
|
||||||
'https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico';
|
'https://CookieMonsterTeam.github.io/CookieMonster/favicon/goldenCookie.ico';
|
||||||
} else
|
} else l('CMFavicon').href = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
||||||
l('CMFavicon').href =
|
|
||||||
'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
/** Functions related to updating the tab in the browser's tab-bar */
|
/** Functions related to updating the tab in the browser's tab-bar */
|
||||||
|
|
||||||
import {
|
import { CacheSeasonPopShimmer, CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData';
|
||||||
CacheSeasonPopShimmer,
|
|
||||||
CacheSpawnedGoldenShimmer,
|
|
||||||
} from '../../Cache/VariablesAndData';
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import {
|
import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData';
|
||||||
LastSeasonPopupState,
|
|
||||||
LastTickerFortuneState,
|
|
||||||
} from '../../Main/VariablesAndData';
|
|
||||||
import { Title } from '../VariablesAndData';
|
import { Title } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,14 +22,10 @@ export default function UpdateTitle() {
|
|||||||
if (CacheSpawnedGoldenShimmer) {
|
if (CacheSpawnedGoldenShimmer) {
|
||||||
if (CacheSpawnedGoldenShimmer.wrath)
|
if (CacheSpawnedGoldenShimmer.wrath)
|
||||||
titleGC = `[W${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
titleGC = `[W${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
||||||
else
|
else titleGC = `[G${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
||||||
titleGC = `[G${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
|
||||||
} else if (!Game.Has('Golden switch [off]')) {
|
} else if (!Game.Has('Golden switch [off]')) {
|
||||||
titleGC = `[${
|
titleGC = `[${Number(l('CMTimerBarGCMinBar').textContent) < 0 ? '!' : ''}${Math.ceil(
|
||||||
Number(l('CMTimerBarGCMinBar').textContent) < 0 ? '!' : ''
|
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps,
|
||||||
}${Math.ceil(
|
|
||||||
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) /
|
|
||||||
Game.fps,
|
|
||||||
)}]`;
|
)}]`;
|
||||||
} else titleGC = '[GS]';
|
} else titleGC = '[GS]';
|
||||||
|
|
||||||
@@ -46,15 +36,10 @@ export default function UpdateTitle() {
|
|||||||
|
|
||||||
if (Game.season === 'christmas') {
|
if (Game.season === 'christmas') {
|
||||||
addSP = true;
|
addSP = true;
|
||||||
if (LastSeasonPopupState)
|
if (LastSeasonPopupState) titleSP = `[R${Math.ceil(CacheSeasonPopShimmer.life / Game.fps)}]`;
|
||||||
titleSP = `[R${Math.ceil(CacheSeasonPopShimmer.life / Game.fps)}]`;
|
|
||||||
else {
|
else {
|
||||||
titleSP = `[${
|
titleSP = `[${Number(l('CMTimerBarRenMinBar').textContent) < 0 ? '!' : ''}${Math.ceil(
|
||||||
Number(l('CMTimerBarRenMinBar').textContent) < 0 ? '!' : ''
|
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps,
|
||||||
}${Math.ceil(
|
|
||||||
(Game.shimmerTypes.reindeer.maxTime -
|
|
||||||
Game.shimmerTypes.reindeer.time) /
|
|
||||||
Game.fps,
|
|
||||||
)}]`;
|
)}]`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,9 +49,7 @@ export default function UpdateTitle() {
|
|||||||
if (str.charAt(0) === '[') {
|
if (str.charAt(0) === '[') {
|
||||||
str = str.substring(str.lastIndexOf(']') + 1);
|
str = str.substring(str.lastIndexOf(']') + 1);
|
||||||
}
|
}
|
||||||
document.title = `${
|
document.title = `${titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '')} ${str}`;
|
||||||
titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '')
|
|
||||||
} ${str}`;
|
|
||||||
} else if (CMOptions.Title === 2) {
|
} else if (CMOptions.Title === 2) {
|
||||||
let str = '';
|
let str = '';
|
||||||
let spawn = false;
|
let spawn = false;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
CacheTimeTillNextPrestige,
|
CacheTimeTillNextPrestige,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates a header object for tooltips.
|
* This function creates a header object for tooltips.
|
||||||
@@ -15,44 +15,35 @@ export default function ReplaceAscendTooltip() {
|
|||||||
const cookiesToNext = Math.max(
|
const cookiesToNext = Math.max(
|
||||||
0,
|
0,
|
||||||
Game.HowManyCookiesReset(
|
Game.HowManyCookiesReset(
|
||||||
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) +
|
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1,
|
||||||
1,
|
|
||||||
) -
|
) -
|
||||||
(Game.cookiesEarned + Game.cookiesReset),
|
(Game.cookiesEarned + Game.cookiesReset),
|
||||||
);
|
);
|
||||||
|
|
||||||
const startDate = Game.sayTime(
|
const startDate = Game.sayTime(((Date.now() - Game.startDate) / 1000) * Game.fps, -1);
|
||||||
((Date.now() - Game.startDate) / 1000) * Game.fps,
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
let str = '';
|
let str = '';
|
||||||
str += `You've been on this run for <b>${
|
str += `You've been on this run for <b>${
|
||||||
startDate === '' ? 'not very long' : startDate
|
startDate === '' ? 'not very long' : startDate
|
||||||
}</b>.<br>`;
|
}</b>.<br>`;
|
||||||
str += '<div class="line"></div>';
|
str += '<div class="line"></div>';
|
||||||
if (Game.prestige > 0) {
|
if (Game.prestige > 0) {
|
||||||
str += `Your prestige level is currently <b>${Beautify(
|
str += `Your prestige level is currently <b>${Beautify(Game.prestige)}</b>.<br>(CpS +${Beautify(
|
||||||
Game.prestige,
|
Game.prestige,
|
||||||
)}</b>.<br>(CpS +${Beautify(Game.prestige)}%)`;
|
)}%)`;
|
||||||
str += '<div class="line"></div>';
|
str += '<div class="line"></div>';
|
||||||
}
|
}
|
||||||
if (CacheLastHeavenlyChips < 1)
|
if (CacheLastHeavenlyChips < 1) str += 'Ascending now would grant you no prestige.';
|
||||||
str += 'Ascending now would grant you no prestige.';
|
|
||||||
else if (CacheLastHeavenlyChips < 2)
|
else if (CacheLastHeavenlyChips < 2)
|
||||||
str +=
|
str +=
|
||||||
'Ascending now would grant you<br><b>1 prestige level</b> (+1% CpS)<br>and <b>1 heavenly chip</b> to spend.';
|
'Ascending now would grant you<br><b>1 prestige level</b> (+1% CpS)<br>and <b>1 heavenly chip</b> to spend.';
|
||||||
else
|
else
|
||||||
str += `Ascending now would grant you<br><b>${Beautify(
|
str += `Ascending now would grant you<br><b>${Beautify(
|
||||||
CacheLastHeavenlyChips,
|
CacheLastHeavenlyChips,
|
||||||
)} prestige levels</b> (+${Beautify(
|
)} prestige levels</b> (+${Beautify(CacheLastHeavenlyChips)}% CpS)<br>and <b>${Beautify(
|
||||||
CacheLastHeavenlyChips,
|
|
||||||
)}% CpS)<br>and <b>${Beautify(
|
|
||||||
CacheLastHeavenlyChips,
|
CacheLastHeavenlyChips,
|
||||||
)} heavenly chips</b> to spend.`;
|
)} heavenly chips</b> to spend.`;
|
||||||
str += '<div class="line"></div>';
|
str += '<div class="line"></div>';
|
||||||
str += `You need <b>${Beautify(
|
str += `You need <b>${Beautify(cookiesToNext)} more cookies</b> for the next level.<br>`;
|
||||||
cookiesToNext,
|
|
||||||
)} more cookies</b> for the next level.<br>`;
|
|
||||||
str += `${
|
str += `${
|
||||||
CMOptions.TooltipAscendButton
|
CMOptions.TooltipAscendButton
|
||||||
? `<div class='line'></div>It takes ${CacheTimeTillNextPrestige} to reach the next level and you were making ${Beautify(
|
? `<div class='line'></div>It takes ${CacheTimeTillNextPrestige} to reach the next level and you were making ${Beautify(
|
||||||
|
|||||||
@@ -54,13 +54,7 @@ export function TooltipCreateWarningSection() {
|
|||||||
TooltipWarn.style.bottom = 'auto';
|
TooltipWarn.style.bottom = 'auto';
|
||||||
TooltipWarn.id = 'CMDispTooltipWarningParent';
|
TooltipWarn.id = 'CMDispTooltipWarningParent';
|
||||||
|
|
||||||
const create = function (
|
const create = function (boxId, color, labelTextFront, labelTextBack, deficitId) {
|
||||||
boxId,
|
|
||||||
color,
|
|
||||||
labelTextFront,
|
|
||||||
labelTextBack,
|
|
||||||
deficitId,
|
|
||||||
) {
|
|
||||||
const box = document.createElement('div');
|
const box = document.createElement('div');
|
||||||
box.id = boxId;
|
box.id = boxId;
|
||||||
box.style.display = 'none';
|
box.style.display = 'none';
|
||||||
@@ -182,13 +176,17 @@ export function TooltipCreateCalculationSection(tooltip) {
|
|||||||
tooltip.appendChild(time);
|
tooltip.appendChild(time);
|
||||||
|
|
||||||
if (TooltipType === 'b') {
|
if (TooltipType === 'b') {
|
||||||
tooltip.appendChild(
|
tooltip.appendChild(TooltipCreateHeader('Production left till next achievement'));
|
||||||
TooltipCreateHeader('Production left till next achievement'),
|
tooltip.lastChild.id = 'CMTooltipProductionLeftHeader'; // eslint-disable-line no-param-reassign
|
||||||
);
|
|
||||||
// Assign a id in order to hide when no achiev's are left
|
|
||||||
tooltip.lastChild.id = 'CMTooltipProductionHeader'; // eslint-disable-line no-param-reassign
|
|
||||||
const production = document.createElement('div');
|
const production = document.createElement('div');
|
||||||
production.id = 'CMTooltipProduction';
|
production.id = 'CMTooltipProductionLeft';
|
||||||
|
tooltip.appendChild(production);
|
||||||
|
}
|
||||||
|
if (TooltipType === 'b') {
|
||||||
|
tooltip.appendChild(TooltipCreateHeader('Buildings (price / PP) left till next achievement'));
|
||||||
|
tooltip.lastChild.id = 'CMTooltipNextAchievementHeader'; // eslint-disable-line no-param-reassign
|
||||||
|
const production = document.createElement('div');
|
||||||
|
production.id = 'CMTooltipNextAchievement';
|
||||||
tooltip.appendChild(production);
|
tooltip.appendChild(production);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
import UpdateTooltips from './UpdateTooltips';
|
import UpdateTooltips from './UpdateTooltips';
|
||||||
import {
|
import { SimpleTooltipElements, TooltipName, TooltipType } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||||
Beautify,
|
|
||||||
GetTimeColour,
|
|
||||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import {
|
|
||||||
SimpleTooltipElements,
|
|
||||||
TooltipName,
|
|
||||||
TooltipType,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||||
|
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour';
|
||||||
|
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||||
|
|
||||||
/** All general functions related to creating and updating tooltips */
|
/** All general functions related to creating and updating tooltips */
|
||||||
|
|
||||||
@@ -95,32 +89,20 @@ export function CreateTooltip(type, name) {
|
|||||||
} else if (type === 'u') {
|
} else if (type === 'u') {
|
||||||
// Upgrades
|
// Upgrades
|
||||||
if (!Game.UpgradesInStore[name]) return '';
|
if (!Game.UpgradesInStore[name]) return '';
|
||||||
l('tooltip').innerHTML = Game.crateTooltip(
|
l('tooltip').innerHTML = Game.crateTooltip(Game.UpgradesInStore[name], 'store');
|
||||||
Game.UpgradesInStore[name],
|
|
||||||
'store',
|
|
||||||
);
|
|
||||||
} else if (type === 's') l('tooltip').innerHTML = Game.lumpTooltip();
|
} else if (type === 's') l('tooltip').innerHTML = Game.lumpTooltip();
|
||||||
// Sugar Lumps
|
// Sugar Lumps
|
||||||
else if (type === 'g')
|
else if (type === 'g')
|
||||||
l('tooltip').innerHTML = Game.Objects['Wizard tower'].minigame.spellTooltip(
|
l('tooltip').innerHTML = Game.Objects['Wizard tower'].minigame.spellTooltip(name)();
|
||||||
name,
|
|
||||||
)();
|
|
||||||
// Grimoire
|
// Grimoire
|
||||||
else if (type === 'p')
|
else if (type === 'p')
|
||||||
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(
|
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(name[0], name[1])();
|
||||||
name[0],
|
|
||||||
name[1],
|
|
||||||
)();
|
|
||||||
// Harvest all button in garden
|
// Harvest all button in garden
|
||||||
else if (type === 'ha')
|
else if (type === 'ha') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)();
|
||||||
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)();
|
|
||||||
else if (type === 'wb') l('tooltip').innerHTML = '';
|
else if (type === 'wb') l('tooltip').innerHTML = '';
|
||||||
else if (type === 'pag')
|
else if (type === 'pag') l('tooltip').innerHTML = Game.Objects.Temple.minigame.godTooltip(name)();
|
||||||
l('tooltip').innerHTML = Game.Objects.Temple.minigame.godTooltip(name)();
|
|
||||||
else if (type === 'pas')
|
else if (type === 'pas')
|
||||||
l('tooltip').innerHTML = Game.Objects.Temple.minigame.slotTooltip(
|
l('tooltip').innerHTML = Game.Objects.Temple.minigame.slotTooltip(name[0])();
|
||||||
name[0],
|
|
||||||
)();
|
|
||||||
|
|
||||||
// Adds area for extra tooltip-sections
|
// Adds area for extra tooltip-sections
|
||||||
if (
|
if (
|
||||||
@@ -140,8 +122,8 @@ export function CreateTooltip(type, name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sets global variables used by CM.Disp.UpdateTooltip()
|
// Sets global variables used by CM.Disp.UpdateTooltip()
|
||||||
TooltipType = type; // eslint-disable-line no-unused-vars
|
TooltipType = type;
|
||||||
TooltipName = name; // eslint-disable-line no-unused-vars
|
TooltipName = name;
|
||||||
|
|
||||||
UpdateTooltips();
|
UpdateTooltips();
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
|
import ColourOfPP from '../../../Cache/PP/ColourOfPP';
|
||||||
import {
|
import {
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
CacheObjects100,
|
CacheObjects100,
|
||||||
|
CacheObjectsNextAchievement,
|
||||||
} from '../../../Cache/VariablesAndData';
|
} from '../../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import BuyBuildingsBonusIncome from '../../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||||
import { SimObjects } from '../../../Sim/VariablesAndData';
|
import { SimObjects } from '../../../Sim/VariablesAndData';
|
||||||
import {
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
||||||
FormatTime,
|
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
|
||||||
GetTimeColour,
|
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import {
|
import {
|
||||||
@@ -44,9 +45,7 @@ export default function Building() {
|
|||||||
|
|
||||||
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||||
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
||||||
const increase = Math.round(
|
const increase = Math.round((TooltipBonusIncome / Game.cookiesPs) * 10000);
|
||||||
(TooltipBonusIncome / Game.cookiesPs) * 10000,
|
|
||||||
);
|
|
||||||
if (Number.isFinite(increase) && increase !== 0) {
|
if (Number.isFinite(increase) && increase !== 0) {
|
||||||
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
||||||
} else {
|
} else {
|
||||||
@@ -54,8 +53,7 @@ export default function Building() {
|
|||||||
CMOptions.ScaleSeparator ? ',' : '.'
|
CMOptions.ScaleSeparator ? ',' : '.'
|
||||||
}01% of income)`;
|
}01% of income)`;
|
||||||
}
|
}
|
||||||
l('CMTooltipBorder').className =
|
l('CMTooltipBorder').className = ColourTextPre + target[TooltipName].color;
|
||||||
ColourTextPre + target[TooltipName].color;
|
|
||||||
if (CMOptions.PPDisplayTime)
|
if (CMOptions.PPDisplayTime)
|
||||||
l('CMTooltipPP').textContent = FormatTime(target[TooltipName].pp);
|
l('CMTooltipPP').textContent = FormatTime(target[TooltipName].pp);
|
||||||
else l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
else l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
||||||
@@ -64,39 +62,61 @@ export default function Building() {
|
|||||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
);
|
);
|
||||||
l('CMTooltipTime').textContent = timeColour.text;
|
l('CMTooltipTime').textContent = timeColour.text;
|
||||||
if (
|
if (timeColour.text === 'Done!' && Game.cookies < target[TooltipName].price) {
|
||||||
timeColour.text === 'Done!' &&
|
|
||||||
Game.cookies < target[TooltipName].price
|
|
||||||
) {
|
|
||||||
l('CMTooltipTime').textContent = `${timeColour.text} (with Wrink)`;
|
l('CMTooltipTime').textContent = `${timeColour.text} (with Wrink)`;
|
||||||
} else l('CMTooltipTime').textContent = timeColour.text;
|
} else l('CMTooltipTime').textContent = timeColour.text;
|
||||||
l('CMTooltipTime').className = ColourTextPre + timeColour.color;
|
l('CMTooltipTime').className = ColourTextPre + timeColour.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add "production left till next achievement"-bar
|
// Add "production left till next achievement"-bar
|
||||||
l('CMTooltipProductionHeader').style.display = 'none';
|
l('CMTooltipProductionLeftHeader').style.display = 'none';
|
||||||
l('CMTooltipTime').style.marginBottom = '0px';
|
l('CMTooltipTime').style.marginBottom = '0px';
|
||||||
|
|
||||||
// Can this ESLint error be solved while retaining the functionality of break?
|
|
||||||
// eslint-disable-next-line no-restricted-syntax
|
// eslint-disable-next-line no-restricted-syntax
|
||||||
for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) {
|
for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) {
|
||||||
if (
|
if (!Game.HasAchiev(Game.Objects[TooltipName].productionAchievs[i].achiev.name)) {
|
||||||
!Game.HasAchiev(
|
const nextProductionAchiev = Game.Objects[TooltipName].productionAchievs[i];
|
||||||
Game.Objects[TooltipName].productionAchievs[i].achiev.name,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
const nextProductionAchiev =
|
|
||||||
Game.Objects[TooltipName].productionAchievs[i];
|
|
||||||
l('CMTooltipTime').style.marginBottom = '4px';
|
l('CMTooltipTime').style.marginBottom = '4px';
|
||||||
l('CMTooltipProductionHeader').style.display = '';
|
l('CMTooltipProductionLeftHeader').style.display = '';
|
||||||
l('CMTooltipProduction').className = `ProdAchievement${TooltipName}`;
|
l('CMTooltipProductionLeft').className = `ProdAchievement${TooltipName}`;
|
||||||
l('CMTooltipProduction').textContent = Beautify(
|
l('CMTooltipProductionLeft').textContent = Beautify(
|
||||||
nextProductionAchiev.pow - SimObjects[TooltipName].totalCookies,
|
nextProductionAchiev.pow - SimObjects[TooltipName].totalCookies,
|
||||||
15,
|
15,
|
||||||
);
|
);
|
||||||
l('CMTooltipProduction').style.color = 'white';
|
l('CMTooltipProductionLeft').style.color = 'white';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ObjectsTillNext = CacheObjectsNextAchievement[TooltipName];
|
||||||
|
if (ObjectsTillNext.AmountNeeded < 101) {
|
||||||
|
l('CMTooltipProductionLeft').style.marginBottom = '4px';
|
||||||
|
l('CMTooltipNextAchievementHeader').style.display = '';
|
||||||
|
|
||||||
|
let PPOfAmount;
|
||||||
|
if (Game.cookiesPs) {
|
||||||
|
PPOfAmount =
|
||||||
|
Math.max(ObjectsTillNext.price - (Game.cookies + GetWrinkConfigBank()), 0) /
|
||||||
|
Game.cookiesPs +
|
||||||
|
ObjectsTillNext.price /
|
||||||
|
BuyBuildingsBonusIncome(TooltipName, ObjectsTillNext.AmountNeeded);
|
||||||
|
} else
|
||||||
|
PPOfAmount =
|
||||||
|
ObjectsTillNext.price /
|
||||||
|
BuyBuildingsBonusIncome(TooltipName, ObjectsTillNext.AmountNeeded);
|
||||||
|
|
||||||
|
l('CMTooltipNextAchievement').textContent = `${Beautify(
|
||||||
|
ObjectsTillNext.AmountNeeded,
|
||||||
|
)} / ${Beautify(ObjectsTillNext.price)} / `;
|
||||||
|
l('CMTooltipNextAchievement').style.color = 'white';
|
||||||
|
const PPFrag = document.createElement('span');
|
||||||
|
if (CMOptions.PPDisplayTime) PPFrag.textContent = FormatTime(PPOfAmount);
|
||||||
|
else PPFrag.textContent = Beautify(PPOfAmount);
|
||||||
|
PPFrag.className = ColourTextPre + ColourOfPP({ pp: PPOfAmount }, ObjectsTillNext.price);
|
||||||
|
l('CMTooltipNextAchievement').appendChild(PPFrag);
|
||||||
|
} else {
|
||||||
|
l('CMTooltipNextAchievementHeader').style.display = 'none';
|
||||||
|
l('CMTooltipProductionLeft').style.marginBottom = '0px';
|
||||||
|
}
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import { TooltipName } from '../../VariablesAndData';
|
import { TooltipName } from '../../VariablesAndData';
|
||||||
import * as Create from '../CreateTooltip';
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
@@ -9,46 +9,31 @@ import * as Create from '../CreateTooltip';
|
|||||||
*/
|
*/
|
||||||
export default function GardenPlots() {
|
export default function GardenPlots() {
|
||||||
const { minigame } = Game.Objects.Farm;
|
const { minigame } = Game.Objects.Farm;
|
||||||
if (
|
if (CMOptions.TooltipPlots && minigame.plot[TooltipName[1]][TooltipName[0]][0] !== 0) {
|
||||||
CMOptions.TooltipPlots &&
|
|
||||||
minigame.plot[TooltipName[1]][TooltipName[0]][0] !== 0
|
|
||||||
) {
|
|
||||||
const mature =
|
const mature =
|
||||||
minigame.plot[TooltipName[1]][TooltipName[0]][1] >
|
minigame.plot[TooltipName[1]][TooltipName[0]][1] >
|
||||||
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1].mature;
|
||||||
.mature;
|
|
||||||
const plantName =
|
const plantName =
|
||||||
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1].name;
|
||||||
.name;
|
l('CMTooltipBorder').appendChild(Create.TooltipCreateHeader('Reward (Current / Maximum)'));
|
||||||
l('CMTooltipBorder').appendChild(
|
|
||||||
Create.TooltipCreateHeader('Reward (Current / Maximum)'),
|
|
||||||
);
|
|
||||||
const reward = document.createElement('div');
|
const reward = document.createElement('div');
|
||||||
reward.id = 'CMTooltipPlantReward';
|
reward.id = 'CMTooltipPlantReward';
|
||||||
l('CMTooltipBorder').appendChild(reward);
|
l('CMTooltipBorder').appendChild(reward);
|
||||||
if (plantName === 'Bakeberry') {
|
if (plantName === 'Bakeberry') {
|
||||||
l('CMTooltipPlantReward').textContent = `${
|
l('CMTooltipPlantReward').textContent = `${
|
||||||
mature
|
mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : '0'
|
||||||
? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30))
|
|
||||||
: '0'
|
|
||||||
} / ${Beautify(Game.cookiesPs * 60 * 30)}`;
|
} / ${Beautify(Game.cookiesPs * 60 * 30)}`;
|
||||||
} else if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
|
} else if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
|
||||||
l('CMTooltipPlantReward').textContent = `${
|
l('CMTooltipPlantReward').textContent = `${
|
||||||
mature
|
mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : '0'
|
||||||
? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3))
|
|
||||||
: '0'
|
|
||||||
} / ${Beautify(Game.cookiesPs * 60 * 3)}`;
|
} / ${Beautify(Game.cookiesPs * 60 * 3)}`;
|
||||||
} else if (plantName === 'Queenbeet') {
|
} else if (plantName === 'Queenbeet') {
|
||||||
l('CMTooltipPlantReward').textContent = `${
|
l('CMTooltipPlantReward').textContent = `${
|
||||||
mature
|
mature ? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : '0'
|
||||||
? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60))
|
|
||||||
: '0'
|
|
||||||
} / ${Beautify(Game.cookiesPs * 60 * 60)}`;
|
} / ${Beautify(Game.cookiesPs * 60 * 60)}`;
|
||||||
} else if (plantName === 'Duketater') {
|
} else if (plantName === 'Duketater') {
|
||||||
l('CMTooltipPlantReward').textContent = `${
|
l('CMTooltipPlantReward').textContent = `${
|
||||||
mature
|
mature ? Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : '0'
|
||||||
? Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120))
|
|
||||||
: '0'
|
|
||||||
} / ${Beautify(Game.cookiesPs * 60 * 120)}`;
|
} / ${Beautify(Game.cookiesPs * 60 * 120)}`;
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import { CacheNoGoldSwitchCookiesPS } from '../../../Cache/VariablesAndData';
|
import { CacheNoGoldSwitchCookiesPS } from '../../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import {
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
|
||||||
GetTimeColour,
|
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
|
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColourTextPre, TooltipName } from '../../VariablesAndData';
|
import { ColourTextPre, TooltipName } from '../../VariablesAndData';
|
||||||
@@ -50,9 +48,7 @@ export default function Grimoire() {
|
|||||||
|
|
||||||
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
|
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
|
||||||
if (TooltipName === '0') {
|
if (TooltipName === '0') {
|
||||||
tooltipBox.appendChild(
|
tooltipBox.appendChild(Create.TooltipCreateHeader('Cookies to be gained/lost'));
|
||||||
Create.TooltipCreateHeader('Cookies to be gained/lost'),
|
|
||||||
);
|
|
||||||
const conjure = document.createElement('div');
|
const conjure = document.createElement('div');
|
||||||
conjure.id = 'x';
|
conjure.id = 'x';
|
||||||
tooltipBox.appendChild(conjure);
|
tooltipBox.appendChild(conjure);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import * as Create from '../CreateTooltip';
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,9 +10,7 @@ import * as Create from '../CreateTooltip';
|
|||||||
export default function HarvestAll() {
|
export default function HarvestAll() {
|
||||||
const { minigame } = Game.Objects.Farm;
|
const { minigame } = Game.Objects.Farm;
|
||||||
if (CMOptions.TooltipLump) {
|
if (CMOptions.TooltipLump) {
|
||||||
l('CMTooltipBorder').appendChild(
|
l('CMTooltipBorder').appendChild(Create.TooltipCreateHeader('Cookies gained from harvesting:'));
|
||||||
Create.TooltipCreateHeader('Cookies gained from harvesting:'),
|
|
||||||
);
|
|
||||||
let totalGain = 0;
|
let totalGain = 0;
|
||||||
let mortal = 0;
|
let mortal = 0;
|
||||||
if (Game.keys[16] && Game.keys[17]) mortal = 1;
|
if (Game.keys[16] && Game.keys[17]) mortal = 1;
|
||||||
@@ -27,31 +25,17 @@ export default function HarvestAll() {
|
|||||||
if (mortal && me.immortal) count = false;
|
if (mortal && me.immortal) count = false;
|
||||||
if (tile[1] < me.matureBase) count = false;
|
if (tile[1] < me.matureBase) count = false;
|
||||||
if (count && plantName === 'Bakeberry') {
|
if (count && plantName === 'Bakeberry') {
|
||||||
totalGain += Math.min(
|
totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30);
|
||||||
Game.cookies * 0.03,
|
} else if ((count && plantName === 'Chocoroot') || plantName === 'White chocoroot') {
|
||||||
Game.cookiesPs * 60 * 30,
|
|
||||||
);
|
|
||||||
} else if (
|
|
||||||
(count && plantName === 'Chocoroot') ||
|
|
||||||
plantName === 'White chocoroot'
|
|
||||||
) {
|
|
||||||
totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3);
|
totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3);
|
||||||
} else if (count && plantName === 'Queenbeet') {
|
} else if (count && plantName === 'Queenbeet') {
|
||||||
totalGain += Math.min(
|
totalGain += Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60);
|
||||||
Game.cookies * 0.04,
|
|
||||||
Game.cookiesPs * 60 * 60,
|
|
||||||
);
|
|
||||||
} else if (count && plantName === 'Duketater') {
|
} else if (count && plantName === 'Duketater') {
|
||||||
totalGain += Math.min(
|
totalGain += Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120);
|
||||||
Game.cookies * 0.08,
|
|
||||||
Game.cookiesPs * 60 * 120,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
l('CMTooltipBorder').appendChild(
|
l('CMTooltipBorder').appendChild(document.createTextNode(Beautify(totalGain)));
|
||||||
document.createTextNode(Beautify(totalGain)),
|
|
||||||
);
|
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CacheGods } from '../../../Cache/VariablesAndData';
|
import { CacheGods } from '../../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
import { TooltipName, TooltipType } from '../../VariablesAndData';
|
import { TooltipName, TooltipType } from '../../VariablesAndData';
|
||||||
import * as Create from '../CreateTooltip';
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
@@ -22,15 +22,11 @@ export default function PantheonGods() {
|
|||||||
cps1.id = 'CMPantheonTooltipPosition1';
|
cps1.id = 'CMPantheonTooltipPosition1';
|
||||||
if (CacheGods[GodID][0] !== 0) {
|
if (CacheGods[GodID][0] !== 0) {
|
||||||
cps1.textContent = Beautify(CacheGods[GodID][0]);
|
cps1.textContent = Beautify(CacheGods[GodID][0]);
|
||||||
const increase = Math.round(
|
const increase = Math.round((CacheGods[GodID][0] / Game.cookiesPs) * 10000);
|
||||||
(CacheGods[GodID][0] / Game.cookiesPs) * 10000,
|
|
||||||
);
|
|
||||||
if (Number.isFinite(increase) && increase !== 0) {
|
if (Number.isFinite(increase) && increase !== 0) {
|
||||||
cps1.textContent += ` (${increase / 100}% of income)`;
|
cps1.textContent += ` (${increase / 100}% of income)`;
|
||||||
} else {
|
} else {
|
||||||
cps1.textContent += ` (<0${
|
cps1.textContent += ` (<0${CMOptions.ScaleSeparator ? ',' : '.'}01% of income)`;
|
||||||
CMOptions.ScaleSeparator ? ',' : '.'
|
|
||||||
}01% of income)`;
|
|
||||||
}
|
}
|
||||||
} else cps1.textContent = 'No effect to CPS';
|
} else cps1.textContent = 'No effect to CPS';
|
||||||
tooltipBox.appendChild(cps1);
|
tooltipBox.appendChild(cps1);
|
||||||
@@ -40,15 +36,11 @@ export default function PantheonGods() {
|
|||||||
cps2.id = 'CMPantheonTooltipPosition2';
|
cps2.id = 'CMPantheonTooltipPosition2';
|
||||||
if (CacheGods[GodID][1] !== 0) {
|
if (CacheGods[GodID][1] !== 0) {
|
||||||
cps2.textContent = Beautify(CacheGods[GodID][1]);
|
cps2.textContent = Beautify(CacheGods[GodID][1]);
|
||||||
const increase = Math.round(
|
const increase = Math.round((CacheGods[GodID][1] / Game.cookiesPs) * 10000);
|
||||||
(CacheGods[GodID][1] / Game.cookiesPs) * 10000,
|
|
||||||
);
|
|
||||||
if (Number.isFinite(increase) && increase !== 0) {
|
if (Number.isFinite(increase) && increase !== 0) {
|
||||||
cps2.textContent += ` (${increase / 100}% of income)`;
|
cps2.textContent += ` (${increase / 100}% of income)`;
|
||||||
} else {
|
} else {
|
||||||
cps2.textContent += ` (<0${
|
cps2.textContent += ` (<0${CMOptions.ScaleSeparator ? ',' : '.'}01% of income)`;
|
||||||
CMOptions.ScaleSeparator ? ',' : '.'
|
|
||||||
}01% of income)`;
|
|
||||||
}
|
}
|
||||||
} else cps2.textContent = 'No effect to CPS';
|
} else cps2.textContent = 'No effect to CPS';
|
||||||
tooltipBox.appendChild(cps2);
|
tooltipBox.appendChild(cps2);
|
||||||
@@ -58,15 +50,11 @@ export default function PantheonGods() {
|
|||||||
cps3.id = 'CMPantheonTooltipPosition2';
|
cps3.id = 'CMPantheonTooltipPosition2';
|
||||||
if (CacheGods[GodID][2] !== 0) {
|
if (CacheGods[GodID][2] !== 0) {
|
||||||
cps3.textContent = Beautify(CacheGods[GodID][2]);
|
cps3.textContent = Beautify(CacheGods[GodID][2]);
|
||||||
const increase = Math.round(
|
const increase = Math.round((CacheGods[GodID][2] / Game.cookiesPs) * 10000);
|
||||||
(CacheGods[GodID][2] / Game.cookiesPs) * 10000,
|
|
||||||
);
|
|
||||||
if (Number.isFinite(increase) && increase !== 0) {
|
if (Number.isFinite(increase) && increase !== 0) {
|
||||||
cps3.textContent += ` (${increase / 100}% of income)`;
|
cps3.textContent += ` (${increase / 100}% of income)`;
|
||||||
} else {
|
} else {
|
||||||
cps3.textContent += ` (<0${
|
cps3.textContent += ` (<0${CMOptions.ScaleSeparator ? ',' : '.'}01% of income)`;
|
||||||
CMOptions.ScaleSeparator ? ',' : '.'
|
|
||||||
}01% of income)`;
|
|
||||||
}
|
}
|
||||||
} else cps3.textContent = 'No effect to CPS';
|
} else cps3.textContent = 'No effect to CPS';
|
||||||
tooltipBox.appendChild(cps3);
|
tooltipBox.appendChild(cps3);
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
import {
|
import { CacheLastChoEgg, CacheUpgrades } from '../../../Cache/VariablesAndData';
|
||||||
CacheLastChoEgg,
|
|
||||||
CacheUpgrades,
|
|
||||||
} from '../../../Cache/VariablesAndData';
|
|
||||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
import {
|
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||||
Beautify,
|
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
||||||
FormatTime,
|
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
|
||||||
GetTimeColour,
|
|
||||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
import {
|
import {
|
||||||
@@ -16,7 +11,6 @@ import {
|
|||||||
TooltipBonusMouse,
|
TooltipBonusMouse,
|
||||||
TooltipName,
|
TooltipName,
|
||||||
TooltipPrice,
|
TooltipPrice,
|
||||||
TooltipType,
|
|
||||||
} from '../../VariablesAndData';
|
} from '../../VariablesAndData';
|
||||||
import * as Create from '../CreateTooltip';
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
@@ -27,22 +21,15 @@ export default function Upgrade() {
|
|||||||
const tooltipBox = l('CMTooltipBorder');
|
const tooltipBox = l('CMTooltipBorder');
|
||||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||||
|
|
||||||
TooltipBonusIncome =
|
TooltipBonusIncome = CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonus;
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonus;
|
TooltipPrice = Game.Upgrades[Game.UpgradesInStore[TooltipName].name].getPrice();
|
||||||
TooltipPrice = Game.Upgrades[
|
TooltipBonusMouse = CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonusMouse;
|
||||||
Game.UpgradesInStore[TooltipName].name
|
|
||||||
].getPrice();
|
|
||||||
TooltipBonusMouse =
|
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonusMouse;
|
|
||||||
|
|
||||||
if (CMOptions.TooltipBuildUpgrade === 1) {
|
if (CMOptions.TooltipBuildUpgrade === 1) {
|
||||||
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
||||||
const increase = Math.round((TooltipBonusIncome / Game.cookiesPs) * 10000);
|
const increase = Math.round((TooltipBonusIncome / Game.cookiesPs) * 10000);
|
||||||
// Don't display certain parts of tooltip if not applicable
|
// Don't display certain parts of tooltip if not applicable
|
||||||
if (
|
if (l('CMTooltipIncome').textContent === '0') {
|
||||||
l('CMTooltipIncome').textContent === '0' &&
|
|
||||||
(TooltipType === 'b' || TooltipType === 'u')
|
|
||||||
) {
|
|
||||||
l('Bonus IncomeTitle').style.display = 'none';
|
l('Bonus IncomeTitle').style.display = 'none';
|
||||||
l('CMTooltipIncome').style.display = 'none';
|
l('CMTooltipIncome').style.display = 'none';
|
||||||
l('Payback PeriodTitle').style.display = 'none';
|
l('Payback PeriodTitle').style.display = 'none';
|
||||||
@@ -56,34 +43,33 @@ export default function Upgrade() {
|
|||||||
}01% of income)`;
|
}01% of income)`;
|
||||||
}
|
}
|
||||||
l('CMTooltipBorder').className =
|
l('CMTooltipBorder').className =
|
||||||
ColourTextPre +
|
ColourTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
}
|
||||||
// If clicking power upgrade
|
|
||||||
if (TooltipBonusMouse) {
|
// If clicking power upgrade
|
||||||
l('CMTooltipCookiePerClick').textContent = Beautify(TooltipBonusMouse);
|
if (TooltipBonusMouse) {
|
||||||
l('CMTooltipCookiePerClick').style.display = 'block';
|
l('CMTooltipCookiePerClick').textContent = Beautify(TooltipBonusMouse);
|
||||||
l('CMTooltipCookiePerClick').previousSibling.style.display = 'block';
|
l('CMTooltipCookiePerClick').style.display = 'block';
|
||||||
}
|
l('CMTooltipCookiePerClick').previousSibling.style.display = 'block';
|
||||||
// If only a clicking power upgrade change PP to click-based period
|
}
|
||||||
if (TooltipBonusIncome === 0 && TooltipBonusMouse) {
|
// If only a clicking power upgrade change PP to click-based period
|
||||||
l('CMTooltipPP').textContent = `${Beautify(
|
if (!TooltipBonusIncome && TooltipBonusMouse) {
|
||||||
TooltipPrice / TooltipBonusMouse,
|
l('CMTooltipPP').textContent = `${Beautify(TooltipPrice / TooltipBonusMouse)} Clicks`;
|
||||||
)} Clicks`;
|
l('CMTooltipPP').style.color = 'white';
|
||||||
l('CMTooltipPP').style.color = 'white';
|
l('Payback PeriodTitle').style.display = 'block';
|
||||||
} else {
|
l('CMTooltipPP').style.display = 'block';
|
||||||
if (CMOptions.PPDisplayTime)
|
} else {
|
||||||
l('CMTooltipPP').textContent = FormatTime(
|
if (CMOptions.PPDisplayTime)
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
l('CMTooltipPP').textContent = FormatTime(
|
||||||
);
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||||
else
|
);
|
||||||
l('CMTooltipPP').textContent = Beautify(
|
else
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
l('CMTooltipPP').textContent = Beautify(
|
||||||
2,
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||||
);
|
2,
|
||||||
l('CMTooltipPP').className =
|
);
|
||||||
ColourTextPre +
|
l('CMTooltipPP').className =
|
||||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
ColourTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const timeColour = GetTimeColour(
|
const timeColour = GetTimeColour(
|
||||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
@@ -105,9 +91,7 @@ export default function Upgrade() {
|
|||||||
);
|
);
|
||||||
const chocolate = document.createElement('div');
|
const chocolate = document.createElement('div');
|
||||||
chocolate.style.color = 'white';
|
chocolate.style.color = 'white';
|
||||||
chocolate.textContent = `${Beautify(Game.cookies * 0.05)} / ${Beautify(
|
chocolate.textContent = `${Beautify(Game.cookies * 0.05)} / ${Beautify(CacheLastChoEgg)}`;
|
||||||
CacheLastChoEgg,
|
|
||||||
)}`;
|
|
||||||
l('CMTooltipBorder').appendChild(chocolate);
|
l('CMTooltipBorder').appendChild(chocolate);
|
||||||
}
|
}
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user