Compare commits
161 Commits
2.031.10
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
930a6c46a6 | ||
|
|
bd772e3712 | ||
|
|
69b923de89 | ||
|
|
4e6c828f8b | ||
|
|
270190feae | ||
|
|
13dd628623 | ||
|
|
5604a63652 | ||
|
|
3f867b9023 | ||
|
|
d4e243f2b7 | ||
|
|
989e984eb5 | ||
|
|
6e4644c3cc | ||
|
|
379593f7fc | ||
|
|
16ec2ff06a | ||
|
|
933a017335 | ||
|
|
492abb66dc | ||
|
|
a1aaa3de8f | ||
|
|
9e98208c19 | ||
|
|
ca1c28d1fc | ||
|
|
ce14fa6190 | ||
|
|
ec2c498b71 | ||
|
|
657ca1a963 | ||
|
|
f6ebfef6cd | ||
|
|
133ed74877 | ||
|
|
8e975c2b20 | ||
|
|
d8b9d2f20c | ||
|
|
9f78e14bec | ||
|
|
7269577009 | ||
|
|
8d89f23c35 | ||
|
|
78f62affc5 | ||
|
|
4b8c35f271 | ||
|
|
1d19545a43 | ||
|
|
76d531a5b0 | ||
|
|
54bb9f793b | ||
|
|
70cc97b0e0 | ||
|
|
adf6544e21 | ||
|
|
93702eefbe | ||
|
|
88eb28c5dd | ||
|
|
049d0153fb | ||
|
|
131547ec00 | ||
|
|
5e92bb5fa5 | ||
|
|
5ebfdfd48e | ||
|
|
1f685f823a | ||
|
|
197b744f56 | ||
|
|
ab73a78a01 | ||
|
|
8cfc980546 | ||
|
|
3fddc1d249 | ||
|
|
2555828eb9 | ||
|
|
66b2c567c2 | ||
|
|
dd66674169 | ||
|
|
cfca658703 | ||
|
|
a607842fdd | ||
|
|
501b2df220 | ||
|
|
1027d48b51 | ||
|
|
fdcbbd7ab2 | ||
|
|
9bfb8a44f9 | ||
|
|
fec312df1c | ||
|
|
1f23e58984 | ||
|
|
b1812afa2f | ||
|
|
22b8c8a61c | ||
|
|
25838daede | ||
|
|
21c0042c24 | ||
|
|
b12fd5db72 | ||
|
|
ef7d46b6dc | ||
|
|
ff8fe0644a | ||
|
|
6779133dd8 | ||
|
|
097ccd2048 | ||
|
|
c45a630286 | ||
|
|
30809c7b45 | ||
|
|
db8d722479 | ||
|
|
79f8079228 | ||
|
|
9d101ddfd4 | ||
|
|
0e69ac39dc | ||
|
|
f0757d2490 | ||
|
|
65754bc29d | ||
|
|
1d26217f80 | ||
|
|
c0751438b6 | ||
|
|
53ed8fe167 | ||
|
|
74e7c64ca2 | ||
|
|
809bd4d35d | ||
|
|
348ba4b9fd | ||
|
|
9e783cc3d7 | ||
|
|
6766c05091 | ||
|
|
1f6ca9ebe6 | ||
|
|
bbf31fe96f | ||
|
|
4be3942af3 | ||
|
|
488233c8dd | ||
|
|
a89f1eed1a | ||
|
|
790cf411c3 | ||
|
|
46853f711a | ||
|
|
60121c0be5 | ||
|
|
c7d9144dd2 | ||
|
|
aa5cad663b | ||
|
|
b191d9a434 | ||
|
|
1842c40c01 | ||
|
|
9c005b2f2f | ||
|
|
e6d89fa0c7 | ||
|
|
b74ae3eee0 | ||
|
|
e4267f4c41 | ||
|
|
62dc882e5a | ||
|
|
f7e7d171e8 | ||
|
|
669b5c1dd9 | ||
|
|
f67b561990 | ||
|
|
5def4ee13b | ||
|
|
c4812ef8fc | ||
|
|
9b9bf962b7 | ||
|
|
2940d1c631 | ||
|
|
0cf30e5cea | ||
|
|
700a5987a8 | ||
|
|
029c25f48e | ||
|
|
6fb8470432 | ||
|
|
518aff7ca7 | ||
|
|
f82b0fbc3a | ||
|
|
c0c3414dea | ||
|
|
513780efc4 | ||
|
|
295771bcec | ||
|
|
0184fde289 | ||
|
|
66d6be8039 | ||
|
|
612ab6a6f5 | ||
|
|
fd3276a9a7 | ||
|
|
b9fe2aa3fb | ||
|
|
765f2637f9 | ||
|
|
4b454cc123 | ||
|
|
725e053df6 | ||
|
|
4008c2a8ee | ||
|
|
248c36c357 | ||
|
|
5679f4ab01 | ||
|
|
40dc0b89cc | ||
|
|
c6b38aa501 | ||
|
|
667b91142f | ||
|
|
f4445f7b0a | ||
|
|
7e42c62f6b | ||
|
|
3d99f818ab | ||
|
|
5f40b2a45e | ||
|
|
1fbe7c4b51 | ||
|
|
fbaa2cc8de | ||
|
|
91dd817212 | ||
|
|
dddf786567 | ||
|
|
df392029ce | ||
|
|
5ae4ed761f | ||
|
|
c080876fc0 | ||
|
|
001efa24bd | ||
|
|
0963a2b63a | ||
|
|
fb8f6dbb49 | ||
|
|
88952e9986 | ||
|
|
946d0ff00e | ||
|
|
27fd8626c8 | ||
|
|
cb23000caa | ||
|
|
2be1716c05 | ||
|
|
b363e3a06a | ||
|
|
c909c99cb5 | ||
|
|
4c63f6d9e2 | ||
|
|
97f8e974de | ||
|
|
8e27b5980b | ||
|
|
42543370b7 | ||
|
|
ccc5f83491 | ||
|
|
b736015b1c | ||
|
|
525ea72174 | ||
|
|
2489eb16ac | ||
|
|
89f895f01e | ||
|
|
7d40e12472 | ||
|
|
ce768cb135 |
@@ -14,18 +14,6 @@
|
||||
"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
|
||||
|
||||
19
.github/CONTRIBUTING.md
vendored
19
.github/CONTRIBUTING.md
vendored
@@ -2,17 +2,18 @@ Cookie Monster is written to modify Cookie Clicker as little as possible. This m
|
||||
|
||||
The following is a short description of the various `src` directories and their contents:
|
||||
|
||||
JS | Description
|
||||
-- | -
|
||||
Cache | Functions related to creating and storing data cache
|
||||
Config | Functions related to manipulating CM configuration
|
||||
Data | Hard coded values
|
||||
Disp | Functions related to displaying CM's UI
|
||||
InitSaveLoad | Functions related to registering the CM object with the Game's Modding API
|
||||
Main | Functions related to the main loop and initializing CM
|
||||
Sim | Functions related to simulate something
|
||||
| JS | Description |
|
||||
| ------------ | -------------------------------------------------------------------------- |
|
||||
| Cache | Functions related to creating and storing data cache |
|
||||
| Config | Functions related to manipulating CM configuration |
|
||||
| Data | Hard coded values |
|
||||
| Disp | Functions related to displaying CM's UI |
|
||||
| InitSaveLoad | Functions related to registering the CM object with the Game's Modding API |
|
||||
| Main | Functions related to the main loop and initializing CM |
|
||||
| Sim | Functions related to simulate something |
|
||||
|
||||
These are some additional guidelines:
|
||||
|
||||
- Try to use DOM as much as possible instead of using string manipulation to modify HTML.
|
||||
- Please be descriptive of your commits. If the commit is related to an issue or PR, please add the issue/PR number to the commit message.
|
||||
- PR's should target the `dev` branch
|
||||
|
||||
53
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
53
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: 🐛 Bug report
|
||||
description: Report a bug in Cookie Monster
|
||||
labels: [Bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Thank you for wanting to report a bug in Cookie Monster!**
|
||||
|
||||
⚠ Please make sure that this [issue wasn't already requested][issue search], or already implemented in the ``dev`` branch.
|
||||
|
||||
|
||||
[issue search]: https://github.com/CookieMonsterTeam/CookieMonster/issues?q=is%3Aissue+is%3Aopen+
|
||||
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: Bug description
|
||||
description: What is the bug about?
|
||||
placeholder: |
|
||||
# Please describe the bug and what you would have expected the mod to do
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: To reproduce
|
||||
description: How can you reproduce the bug?
|
||||
placeholder: |
|
||||
The steps needed to reproduce the behavior:
|
||||
1.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshot
|
||||
description: Please provide any relevant screenshots
|
||||
- type: textarea
|
||||
id: savefile
|
||||
attributes:
|
||||
label: Save file
|
||||
description: Please provide a save file and paste it in between the "```"
|
||||
placeholder: |
|
||||
```SAVE FILE HERE```
|
||||
- type: textarea
|
||||
id: environment
|
||||
attributes:
|
||||
label: Browser / Steam / Version
|
||||
description: Are you playing on browser (if so, which?) or Steam? And which version?
|
||||
placeholder: Steam, version 2.04
|
||||
validations:
|
||||
required: true
|
||||
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,26 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Please use this template to report bugs you might have found
|
||||
title: ''
|
||||
labels: Bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
Please describe the bug and what you would have expected the mod to do
|
||||
|
||||
**To Reproduce**
|
||||
The steps needed to reproduce the behavior:
|
||||
1. ...
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Save file**
|
||||
```
|
||||
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
|
||||
```
|
||||
**Browser**
|
||||
Please specify your current browser. This can help find/fix the bug!
|
||||
28
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
Normal file
28
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: ✨ Feature request
|
||||
description: Request a new feature for Cookie Monster
|
||||
labels: [Enhancement]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Thank you for wanting to suggest a new function for Cookie Monster!**
|
||||
|
||||
⚠ Please make sure that this [feature wasn't already requested][issue search], or already implemented in the ``dev`` branch.
|
||||
|
||||
|
||||
[issue search]: https://github.com/CookieMonsterTeam/CookieMonster/issues?q=is%3Aissue+is%3Aopen+
|
||||
|
||||
- type: textarea
|
||||
id: what-is-wanted
|
||||
attributes:
|
||||
label: Feature description
|
||||
description: Describe the function you'd like to see added to CookieMonster
|
||||
placeholder: |
|
||||
# A clear and concise description of what you want to happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: additional-info
|
||||
attributes:
|
||||
label: Additional files
|
||||
description: Add any other files such as save files or screenshots about the feature request here.
|
||||
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for CookieMonster
|
||||
title: ''
|
||||
labels: Enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the function you'd like to see added to CookieMonster**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Additional files**
|
||||
Add any other files such as save files or screenshots about the feature request here.
|
||||
6
.github/dependabot.yml
vendored
6
.github/dependabot.yml
vendored
@@ -5,7 +5,7 @@
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/" # Location of package manifests
|
||||
- package-ecosystem: 'npm'
|
||||
directory: '/' # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
interval: 'weekly'
|
||||
|
||||
6
.github/workflows/CI.yml
vendored
6
.github/workflows/CI.yml
vendored
@@ -10,16 +10,16 @@ jobs:
|
||||
Check_linting_test_and_build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GITHUB_REGISTERY_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_REGISTRY_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 12
|
||||
node-version: 22
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Run ESLint
|
||||
run: npx eslint src
|
||||
run: npx eslint
|
||||
- name: Run Mocha tests
|
||||
run: npx mocha
|
||||
- name: Check if CookieMonsterDev.js is built correctly
|
||||
|
||||
2
.github/workflows/publish-dev.yml
vendored
2
.github/workflows/publish-dev.yml
vendored
@@ -2,7 +2,7 @@ name: Publish
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "dev"
|
||||
- 'dev'
|
||||
jobs:
|
||||
publish-dev:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{
|
||||
"recursive": true,
|
||||
"require": ["esm", "ts-node/register"]
|
||||
"recursive": true
|
||||
}
|
||||
|
||||
2
.npmrc
2
.npmrc
@@ -1,4 +1,4 @@
|
||||
always-auth=true
|
||||
registry=https://registry.npmjs.org/
|
||||
@cookiemonsterteam:registry=https://npm.pkg.github.com
|
||||
//npm.pkg.github.com/:_authToken=${GITHUB_REGISTERY_PAT}
|
||||
//npm.pkg.github.com/:_authToken=${GITHUB_REGISTRY_PAT}
|
||||
|
||||
12
.pre-commit-config.yaml
Normal file
12
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: v4.0.0-alpha.8
|
||||
hooks:
|
||||
- id: prettier
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
exclude: dist
|
||||
- id: end-of-file-fixer
|
||||
exclude: dist
|
||||
1
.prettierignore
Normal file
1
.prettierignore
Normal file
@@ -0,0 +1 @@
|
||||
dist
|
||||
@@ -1,6 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name Cookie Monster
|
||||
// @include /https?://orteil.dashnet.org/cookieclicker/
|
||||
// @include /https?://cookieclicker.ee/
|
||||
// ==/UserScript==
|
||||
|
||||
const readyCheck = setInterval(() => {
|
||||
|
||||
38
README.md
38
README.md
@@ -3,7 +3,7 @@
|
||||
## 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.
|
||||
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
|
||||
|
||||
@@ -13,7 +13,7 @@ Github Pages is hosted from the `gh-pages` branch
|
||||
|
||||
### What it does
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
```javascript
|
||||
max(cost - cookies in bank, 0)/cps + cost/Δ cps
|
||||
@@ -24,13 +24,13 @@ If the relevant option is enabled, CM will color-code each of them based on thei
|
||||
<details>
|
||||
<summary>The following standard colours are used:</summary>
|
||||
|
||||
* Light Blue: (upgrades) This item has a better PP than the best building to buy
|
||||
* Green: This building has the best PP
|
||||
* Yellow: This building is within the top 10 of best PP's
|
||||
* Orange: This building is within the top 20 of best PP's
|
||||
* Red: This building is within the top 30 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
|
||||
- Light Blue: (upgrades) This item has a better PP than the best building to buy
|
||||
- Green: This building has the best PP
|
||||
- Yellow: This building is within the top 10 of best PP's
|
||||
- Orange: This building is within the top 20 of best PP's
|
||||
- Red: This building is within the top 30 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
|
||||
|
||||
</details>
|
||||
|
||||
@@ -45,7 +45,7 @@ Copy this code and save it as a bookmark. Paste it in the URL section. To activa
|
||||
```javascript
|
||||
javascript: (function () {
|
||||
Game.LoadMod('https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonster.js');
|
||||
}());
|
||||
})();
|
||||
```
|
||||
|
||||
If (for some reason) the above doesn't work, trying pasting everything after the <code>javascript:</code> bit into your browser's console.
|
||||
@@ -68,11 +68,11 @@ All suggestions are welcome, even the smallest ones.
|
||||
|
||||
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!
|
||||
Currently we expose relevant data for buildings and upgrades (PP, colour and bonus income). If you would like us to add any additional data, please feel free to open an issue or create a PR doing so!
|
||||
|
||||
## Contributing
|
||||
|
||||
To contribute you can fork and clone the repository and run `npm install`. Note that you will need to authenticate to the GitHub Package Registery (see [this documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages)). After creating a Public Access Token you should export this variable to $GITHUB_REGISTERY_PAT as defined in `.npmrc`.
|
||||
To contribute you can fork and clone the repository and run `npm install`. Note that you will need to authenticate to the GitHub Package Registry (see [this documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages)). After creating a Public Access Token you should export this variable to $GITHUB_REGISTRY_PAT as defined in `.npmrc`.
|
||||
|
||||
Please also remember to run `npm run build-dev` after saving all your changes to build the final `CookieMonsterDev.js` file.
|
||||
|
||||
@@ -80,10 +80,10 @@ Before pushing a new version to `main` and Github pages use the `build-final` co
|
||||
|
||||
## Contributors
|
||||
|
||||
* **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author
|
||||
* **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer
|
||||
* **[BlackenedGem](https://github.com/BlackenedGem)**: Golden/Wrath Cookie Favicons
|
||||
* **[Sandworm](https://github.com/svschouw)**: Modified PP calculation
|
||||
* **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer
|
||||
* **[DanielNoord](https://github.com/DanielNoord)**: Current maintainer
|
||||
* **[bitsandbytes1708](https://github.com/bitsandbytes1708)**: Current maintainer
|
||||
- **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author
|
||||
- **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer
|
||||
- **[BlackenedGem](https://github.com/BlackenedGem)**: Golden/Wrath Cookie Favicons
|
||||
- **[Sandworm](https://github.com/svschouw)**: Modified PP calculation
|
||||
- **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer
|
||||
- **[DanielNoord](https://github.com/DanielNoord)**: Current maintainer
|
||||
- **[bitsandbytes1708](https://github.com/bitsandbytes1708)**: Current maintainer
|
||||
|
||||
2
dist/CookieMonster.js
vendored
2
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
2
dist/CookieMonsterDev.js
vendored
2
dist/CookieMonsterDev.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonsterDev.js.map
vendored
2
dist/CookieMonsterDev.js.map
vendored
File diff suppressed because one or more lines are too long
59
eslint.config.mjs
Normal file
59
eslint.config.mjs
Normal file
@@ -0,0 +1,59 @@
|
||||
import globals from 'globals';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import js from '@eslint/js';
|
||||
import { FlatCompat } from '@eslint/eslintrc';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all,
|
||||
});
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: [
|
||||
'eslint.config.mjs',
|
||||
'webpack.config.cjs',
|
||||
'**/CookieMonster.user.js',
|
||||
'dist/*',
|
||||
'node_modules/*',
|
||||
],
|
||||
},
|
||||
...compat.extends('airbnb-base', 'prettier'),
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
Game: 'writable',
|
||||
l: 'readonly',
|
||||
b64_to_utf8: 'readonly',
|
||||
utf8_to_b64: 'readonly',
|
||||
BeautifyAll: 'readonly',
|
||||
},
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
rules: {
|
||||
'import/extensions': ['error', 'ignorePackages'],
|
||||
'import/no-mutable-exports': 'off',
|
||||
'no-import-assign': 'off',
|
||||
'no-plusplus': [
|
||||
'error',
|
||||
{
|
||||
allowForLoopAfterthoughts: true,
|
||||
},
|
||||
],
|
||||
'func-names': 'off',
|
||||
'prefer-destructuring': [
|
||||
'error',
|
||||
{
|
||||
object: true,
|
||||
array: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
9380
package-lock.json
generated
9380
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
50
package.json
50
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cookiemonsterteam/cookiemonster-mod",
|
||||
"version": "2.031.10",
|
||||
"version": "2.053.10",
|
||||
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
|
||||
"main": "CookieMonster.js",
|
||||
"keywords": [
|
||||
@@ -14,7 +14,7 @@
|
||||
"build-dev": "run-s eslint test pack-prod",
|
||||
"build-final": "run-s eslint test pack-final",
|
||||
"build-test": "webpack",
|
||||
"eslint": "eslint src test",
|
||||
"eslint": "eslint",
|
||||
"pack-prod": "webpack --env minimize",
|
||||
"pack-final": "webpack --env minimize --env finalfile",
|
||||
"test": "mocha"
|
||||
@@ -43,26 +43,6 @@
|
||||
"url": "https://github.com/CookieMonsterTeam/CookieMonster/issues"
|
||||
},
|
||||
"homepage": "https://github.com/CookieMonsterTeam/CookieMonster#readme",
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.2.19",
|
||||
"@types/mocha": "^9.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.28.4",
|
||||
"@typescript-eslint/parser": "^4.28.4",
|
||||
"chai": "^4.3.4",
|
||||
"eslint": "^7.31.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.2",
|
||||
"ts-loader": "^9.2.3",
|
||||
"ts-node": "^10.0.0",
|
||||
"typescript": "^4.3.4",
|
||||
"webpack": "^5.45.1",
|
||||
"webpack-cli": "^4.7.2"
|
||||
},
|
||||
"ccrepo": {
|
||||
"icon": [
|
||||
10,
|
||||
@@ -70,8 +50,30 @@
|
||||
],
|
||||
"name": "Cookie Monster"
|
||||
},
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
},
|
||||
"dependencies": {
|
||||
"@eastdesire/jscolor": "^2.4.5",
|
||||
"@cookiemonsterteam/cookiemonsterframework": "^0.2.1"
|
||||
"@cookiemonsterteam/cookiemonsterframework": "0.2.3",
|
||||
"@eastdesire/jscolor": "^2.5.1",
|
||||
"@eslint/compat": "^1.2.7",
|
||||
"@eslint/eslintrc": "^3.2.0",
|
||||
"@eslint/js": "^9.20.0",
|
||||
"chai": "^5.2.0",
|
||||
"eslint": "^9.21.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-config-prettier": "^10.1.5",
|
||||
"globals": "^16.0.0",
|
||||
"mocha": "^11.1.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^3.5.2",
|
||||
"webpack": "^5.97.1",
|
||||
"webpack-cli": "^6.0.1"
|
||||
},
|
||||
"overrides": {
|
||||
"eslint-config-airbnb-base": {
|
||||
"eslint": "^9.20.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData.js';
|
||||
import {
|
||||
ChoEggDiff, // eslint-disable-line no-unused-vars
|
||||
ClicksDiff, // eslint-disable-line no-unused-vars
|
||||
CookiesDiff, // eslint-disable-line no-unused-vars
|
||||
WrinkDiff, // eslint-disable-line no-unused-vars
|
||||
WrinkFattestDiff, // eslint-disable-line no-unused-vars
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* @class
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import {
|
||||
CacheAverageClicks, // eslint-disable-line no-unused-vars
|
||||
CacheAverageClicks,
|
||||
CacheAverageCPS,
|
||||
CacheAverageGainBank,
|
||||
CacheAverageGainChoEgg,
|
||||
CacheAverageGainWrink,
|
||||
CacheAverageGainWrinkFattest,
|
||||
CacheAvgCPSWithChoEgg, // eslint-disable-line no-unused-vars
|
||||
CacheAvgCPSWithChoEgg,
|
||||
CacheLastChoEgg,
|
||||
CacheLastClicks,
|
||||
CacheLastCookies,
|
||||
CacheLastCPSCheck,
|
||||
CacheLastWrinkCookies,
|
||||
CacheLastWrinkFattestCookies,
|
||||
CacheRealCookiesEarned, // eslint-disable-line no-unused-vars
|
||||
CacheRealCookiesEarned,
|
||||
CacheSellForChoEgg,
|
||||
CacheWrinklersFattest,
|
||||
CacheWrinklersTotal,
|
||||
@@ -22,7 +23,7 @@ import {
|
||||
CookiesDiff,
|
||||
WrinkDiff,
|
||||
WrinkFattestDiff,
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions caches two variables related average CPS and Clicks
|
||||
@@ -88,9 +89,25 @@ export default function CacheAvgCPS() {
|
||||
CacheAverageGainBank + CacheAverageGainWrink + (choEgg ? CacheAverageGainChoEgg : 0);
|
||||
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
CacheAverageClicks = ClicksDiff.calcAverage(
|
||||
ClickTimes[Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist],
|
||||
);
|
||||
}
|
||||
|
||||
FillCMDCache({
|
||||
CacheRealCookiesEarned,
|
||||
CacheLastCPSCheck,
|
||||
CacheLastCookies,
|
||||
CacheLastWrinkCookies,
|
||||
CacheLastWrinkFattestCookies,
|
||||
CacheLastChoEgg,
|
||||
CacheLastClicks,
|
||||
CacheAverageGainBank,
|
||||
CacheAverageGainWrink,
|
||||
CacheAverageGainWrinkFattest,
|
||||
CacheAverageGainChoEgg,
|
||||
CacheAverageCPS,
|
||||
CacheAvgCPSWithChoEgg,
|
||||
CacheAverageClicks,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import { SimObjects } from '../../Sim/VariablesAndData.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions caches the current Wrinkler CPS multiplier
|
||||
@@ -26,4 +27,6 @@ export default function CacheCurrWrinklerCPS() {
|
||||
(Game.Has('Sacrilegious corruption') * 0.05 + 1) *
|
||||
(Game.Has('Wrinklerspawn') * 0.05 + 1) *
|
||||
godMult;
|
||||
|
||||
FillCMDCache({ CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult });
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc';
|
||||
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function calculates CPS without the Golden Switch as it might be needed in other functions
|
||||
@@ -10,4 +11,6 @@ export default function CacheNoGoldSwitchCPS() {
|
||||
if (Game.Has('Golden switch [off]')) {
|
||||
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
|
||||
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs;
|
||||
|
||||
FillCMDCache({ CacheNoGoldSwitchCookiesPS });
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg';
|
||||
import { CacheSellForChoEgg } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import { CacheSellForChoEgg } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions caches the reward for selling the Chocolate egg
|
||||
@@ -21,4 +22,6 @@ export default function CacheSellAllForChoEgg() {
|
||||
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
||||
sellTotal += SellBuildingsForChoEgg();
|
||||
CacheSellForChoEgg = sellTotal;
|
||||
|
||||
FillCMDCache({ CacheSellForChoEgg });
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { ClickTimes } from '../Disp/VariablesAndData';
|
||||
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
|
||||
import CacheAvgCPS from './CPS/CPS';
|
||||
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
||||
import CachePP from './PP/PP';
|
||||
import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome';
|
||||
import { CacheChain } from './Stats/ChainCookies';
|
||||
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
||||
import CacheAllMissingUpgrades from './Stats/MissingUpgrades';
|
||||
import CacheSeasonSpec from './Stats/Reindeer';
|
||||
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats';
|
||||
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement';
|
||||
import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||
import { ClickTimes } from '../Disp/VariablesAndData.js';
|
||||
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue.js';
|
||||
import CacheAvgCPS from './CPS/CPS.js';
|
||||
import CacheDragonAuras from './Dragon/CacheDragonAuras.js';
|
||||
import CachePP from './PP/PP.js';
|
||||
import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome.js';
|
||||
import { CacheChain } from './Stats/ChainCookies.js';
|
||||
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips.js';
|
||||
import CacheAllMissingUpgrades from './Stats/MissingUpgrades.js';
|
||||
import CacheSeasonSpec from './Stats/Reindeer.js';
|
||||
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats.js';
|
||||
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement.js';
|
||||
import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData.js'; // eslint-disable-line no-unused-vars
|
||||
import CacheWrinklers from './Wrinklers/Wrinklers.js';
|
||||
|
||||
/**
|
||||
* This functions runs all cache-functions to generate all "full" cache
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import FormatTime from '../Disp/BeautifyAndFormatting/FormatTime';
|
||||
import GetCPS from '../Disp/HelperFunctions/GetCPS';
|
||||
import CacheAvgCPS from './CPS/CPS';
|
||||
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS';
|
||||
import CachePP from './PP/PP';
|
||||
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
||||
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement';
|
||||
import { CacheTimeTillNextPrestige } from './VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||
import FormatTime from '../Disp/BeautifyAndFormatting/FormatTime.js';
|
||||
import GetCPS from '../Disp/HelperFunctions/GetCPS.js';
|
||||
import CacheAvgCPS from './CPS/CPS.js';
|
||||
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS.js';
|
||||
import CachePP from './PP/PP.js';
|
||||
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips.js';
|
||||
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement.js';
|
||||
import { CacheTimeTillNextPrestige } from './VariablesAndData.js'; // eslint-disable-line no-unused-vars
|
||||
import CacheWrinklers from './Wrinklers/Wrinklers.js';
|
||||
|
||||
/**
|
||||
* This functions caches variables that are needed every loop
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData.js'; // eslint-disable-line no-unused-vars
|
||||
|
||||
/**
|
||||
* This functions caches the currently selected Dragon Auras
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/** Functions related to the Dragon */
|
||||
|
||||
import Beautify from '../../Disp/BeautifyAndFormatting/Beautify';
|
||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
||||
import { CacheCostDragonUpgrade, CacheLastDragonLevel } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import Beautify from '../../Disp/BeautifyAndFormatting/Beautify.js';
|
||||
import CopyData from '../../Sim/SimulationData/CopyData.js';
|
||||
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import { CacheCostDragonUpgrade, CacheLastDragonLevel } from '../VariablesAndData.js'; // eslint-disable-line no-unused-vars
|
||||
|
||||
/**
|
||||
* This functions caches the current cost of upgrading the dragon level so it can be displayed in the tooltip
|
||||
@@ -14,7 +15,11 @@ export default function CacheDragonCost() {
|
||||
Game.dragonLevel < 25 &&
|
||||
Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')
|
||||
) {
|
||||
let target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];
|
||||
const objectMatch = Game.dragonLevels[Game.dragonLevel].buy
|
||||
.toString()
|
||||
.match(/Objects\[(.*)\]/);
|
||||
let target =
|
||||
objectMatch !== null ? objectMatch[1] : Game.ObjectsById[Game.dragonLevel - 5].name;
|
||||
const amount = Game.dragonLevels[Game.dragonLevel].buy
|
||||
.toString()
|
||||
.match(/sacrifice\((.*?)\)/)[1];
|
||||
@@ -62,4 +67,6 @@ export default function CacheDragonCost() {
|
||||
}
|
||||
CacheLastDragonLevel = Game.dragonLevel;
|
||||
}
|
||||
|
||||
FillCMDCache({ CacheLastDragonLevel });
|
||||
}
|
||||
|
||||
22
src/Cache/FillCMDCache.js
Normal file
22
src/Cache/FillCMDCache.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Insert the provided values into `window.CookieMonsterData.Cache`.
|
||||
*
|
||||
* The initial 'Cache' is dropped from the name, so e.g. `CacheWrinklersTotal`
|
||||
* becomes `window.CookieMonsterData.Cache.WrinklersTotal`.
|
||||
*/
|
||||
export default function FillCMDCache(caches) {
|
||||
if (!('Cache' in window.CookieMonsterData)) {
|
||||
window.CookieMonsterData.Cache = {};
|
||||
}
|
||||
|
||||
Object.keys(caches).forEach((name) => {
|
||||
const exportName = name.replace(/^Cache/, '');
|
||||
|
||||
if (typeof caches[name] === 'undefined') {
|
||||
window.CookieMonsterData.Cache[exportName] = undefined;
|
||||
} else {
|
||||
// Passing through JSON ensures that no references are retained.
|
||||
window.CookieMonsterData.Cache[exportName] = JSON.parse(JSON.stringify(caches[name]));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1,15 +1,16 @@
|
||||
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
||||
import { ColourGray } from '../../Disp/VariablesAndData';
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank.js';
|
||||
import { ColourGray } from '../../Disp/VariablesAndData.js';
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import {
|
||||
CacheMinPP, // eslint-disable-line no-unused-vars
|
||||
CacheMinPPBulk, // eslint-disable-line no-unused-vars
|
||||
CacheMinPP,
|
||||
CacheMinPPBulk,
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
CacheObjects100,
|
||||
CachePPArray,
|
||||
} from '../VariablesAndData';
|
||||
import ColourOfPP from './ColourOfPP';
|
||||
} from '../VariablesAndData.js';
|
||||
import ColourOfPP from './ColourOfPP.js';
|
||||
|
||||
/**
|
||||
* This functions caches the buildings of bulk-buy mode when PP is compared against optimal single-purchase building
|
||||
@@ -106,4 +107,6 @@ export default function CacheBuildingsPP() {
|
||||
CacheColour(CacheObjects1, 1);
|
||||
CacheColour(CacheObjects10, 10);
|
||||
CacheColour(CacheObjects100, 100);
|
||||
|
||||
FillCMDCache({ CacheMinPP, CacheMinPPBulk, CachePPArray });
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
||||
import GetCPS from '../../Disp/HelperFunctions/GetCPS.js';
|
||||
import {
|
||||
ColourBlue,
|
||||
ColourGray,
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
ColourPurple,
|
||||
ColourRed,
|
||||
ColourYellow,
|
||||
} from '../../Disp/VariablesAndData';
|
||||
import { CacheMinPP, CachePPArray } from '../VariablesAndData';
|
||||
} from '../../Disp/VariablesAndData.js';
|
||||
import { CacheMinPP, CachePPArray } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions return the colour assosciated with the given pp value
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
/**
|
||||
* Section: Functions related to caching PP */
|
||||
|
||||
import { CacheObjects1, CacheObjects10, CacheObjects100, CacheUpgrades } from '../VariablesAndData';
|
||||
import CacheBuildingsPP from './Building';
|
||||
import CacheUpgradePP from './Upgrade';
|
||||
import {
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
CacheObjects100,
|
||||
CacheUpgrades,
|
||||
} from '../VariablesAndData.js';
|
||||
import CacheBuildingsPP from './Building.js';
|
||||
import CacheUpgradePP from './Upgrade.js';
|
||||
|
||||
/**
|
||||
* This functions caches the PP of each building and upgrade and stores it in the cache
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
||||
import { CacheUpgrades } from '../VariablesAndData';
|
||||
import ColourOfPP from './ColourOfPP';
|
||||
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank.js';
|
||||
import { CacheUpgrades } from '../VariablesAndData.js';
|
||||
import ColourOfPP from './ColourOfPP.js';
|
||||
|
||||
/**
|
||||
* This functions caches the PP of each building it saves all date in CM.Cache.Upgrades
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import CalculateChangeGod from '../../Sim/SimulationEvents/GodChange';
|
||||
import { CacheGods } from '../VariablesAndData';
|
||||
import CalculateChangeGod from '../../Sim/SimulationEvents/GodChange.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import { CacheGods } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions caches the cps effect of each God in slot 1, 2 or 3
|
||||
@@ -10,4 +11,6 @@ export default function CachePantheonGods() {
|
||||
CacheGods[god][slot] = CalculateChangeGod(god, slot);
|
||||
}
|
||||
}
|
||||
|
||||
FillCMDCache({ CacheGods });
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/** Section: Functions related to caching income */
|
||||
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades';
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js';
|
||||
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome.js';
|
||||
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import {
|
||||
CacheAverageGainBank,
|
||||
CacheAverageGainWrink,
|
||||
@@ -13,7 +14,7 @@ import {
|
||||
CacheObjects100,
|
||||
CacheObjectsNextAchievement,
|
||||
CacheUpgrades,
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions starts the calculation/simulation of the bonus income of buildings
|
||||
@@ -93,6 +94,8 @@ export function CacheBuildingsPrices() {
|
||||
CacheObjectsNextAchievement[i].AmountNeeded,
|
||||
);
|
||||
});
|
||||
|
||||
FillCMDCache({ CacheObjectsNextAchievement });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import {
|
||||
CacheChainFrenzyMaxReward,
|
||||
CacheChainFrenzyRequired, // eslint-disable-line no-unused-vars
|
||||
CacheChainFrenzyRequiredNext, // eslint-disable-line no-unused-vars
|
||||
CacheChainFrenzyRequired,
|
||||
CacheChainFrenzyRequiredNext,
|
||||
CacheChainFrenzyWrathMaxReward,
|
||||
CacheChainFrenzyWrathRequired, // eslint-disable-line no-unused-vars
|
||||
CacheChainFrenzyWrathRequiredNext, // eslint-disable-line no-unused-vars
|
||||
CacheChainFrenzyWrathRequired,
|
||||
CacheChainFrenzyWrathRequiredNext,
|
||||
CacheChainMaxReward,
|
||||
CacheChainRequired, // eslint-disable-line no-unused-vars
|
||||
CacheChainRequiredNext, // eslint-disable-line no-unused-vars
|
||||
CacheChainRequired,
|
||||
CacheChainRequiredNext,
|
||||
CacheChainWrathMaxReward,
|
||||
CacheChainWrathRequired, // eslint-disable-line no-unused-vars
|
||||
CacheChainWrathRequiredNext, // eslint-disable-line no-unused-vars
|
||||
CacheChainWrathRequired,
|
||||
CacheChainWrathRequiredNext,
|
||||
CacheDragonsFortuneMultAdjustment,
|
||||
CacheGoldenCookiesMult,
|
||||
CacheNoGoldSwitchCookiesPS,
|
||||
CacheWrathCookiesMult,
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions calculates the max possible payout given a set of variables
|
||||
@@ -89,4 +90,19 @@ export function CacheChain() {
|
||||
CacheChainFrenzyWrathRequired = (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||
CacheChainFrenzyWrathRequiredNext =
|
||||
CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||
|
||||
FillCMDCache({
|
||||
CacheChainMaxReward,
|
||||
CacheChainRequired,
|
||||
CacheChainRequiredNext,
|
||||
CacheChainWrathMaxReward,
|
||||
CacheChainWrathRequired,
|
||||
CacheChainWrathRequiredNext,
|
||||
CacheChainFrenzyMaxReward,
|
||||
CacheChainFrenzyRequired,
|
||||
CacheChainFrenzyRequiredNext,
|
||||
CacheChainFrenzyWrathMaxReward,
|
||||
CacheChainFrenzyWrathRequired,
|
||||
CacheChainFrenzyWrathRequiredNext,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import {
|
||||
CacheHCPerSecond, // eslint-disable-line no-unused-vars
|
||||
CacheHCPerSecond,
|
||||
CacheLastHeavenlyCheck,
|
||||
CacheLastHeavenlyChips,
|
||||
HeavenlyChipsDiff,
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions caches the heavenly chips per second in the last five seconds
|
||||
@@ -32,4 +33,6 @@ export default function CacheHeavenlyChipsPS() {
|
||||
// Get average gain over period of 5 seconds
|
||||
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5);
|
||||
}
|
||||
|
||||
FillCMDCache({ CacheLastHeavenlyCheck, CacheLastHeavenlyChips, CacheHCPerSecond });
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades';
|
||||
import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades.js';
|
||||
import {
|
||||
CacheMissingUpgrades, // eslint-disable-line no-unused-vars
|
||||
CacheMissingUpgradesCookies, // eslint-disable-line no-unused-vars
|
||||
CacheMissingUpgradesPrestige, // eslint-disable-line no-unused-vars
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions caches variables related to missing upgrades
|
||||
@@ -35,12 +35,10 @@ export default function CacheAllMissingUpgrades() {
|
||||
let str = '';
|
||||
|
||||
str += crateMissing(me);
|
||||
/* eslint-disable no-unused-vars */
|
||||
if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str;
|
||||
else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str;
|
||||
else if (me.pool !== 'toggle' && me.pool !== 'unused' && me.pool !== 'debug')
|
||||
CacheMissingUpgrades += str;
|
||||
/* eslint-enable no-unused-vars */
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { CacheSeaSpec } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import { CacheSeaSpec } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions caches the reward of popping a reindeer
|
||||
@@ -13,4 +14,6 @@ export default function CacheSeasonSpec() {
|
||||
CacheSeaSpec = Math.max(25, val);
|
||||
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2;
|
||||
}
|
||||
|
||||
FillCMDCache({ CacheSeaSpec });
|
||||
}
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
/** Functions related to Caching stats */
|
||||
|
||||
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas';
|
||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas.js';
|
||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import {
|
||||
CacheConjure,
|
||||
CacheConjureReward, // eslint-disable-line no-unused-vars
|
||||
CacheConjureReward,
|
||||
CacheDragonsFortuneMultAdjustment,
|
||||
CacheEdifice,
|
||||
CacheEdificeBuilding, // eslint-disable-line no-unused-vars
|
||||
CacheEdificeBuilding,
|
||||
CacheGoldenCookiesMult,
|
||||
CacheLucky,
|
||||
CacheLuckyFrenzy,
|
||||
CacheLuckyReward, // eslint-disable-line no-unused-vars
|
||||
CacheLuckyRewardFrenzy, // eslint-disable-line no-unused-vars
|
||||
CacheLuckyWrathReward, // eslint-disable-line no-unused-vars
|
||||
CacheLuckyWrathRewardFrenzy, // eslint-disable-line no-unused-vars
|
||||
CacheLuckyReward,
|
||||
CacheLuckyRewardFrenzy,
|
||||
CacheLuckyWrathReward,
|
||||
CacheLuckyWrathRewardFrenzy,
|
||||
CacheNoGoldSwitchCookiesPS,
|
||||
CacheWrathCookiesMult,
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions caches variables related to the stats page
|
||||
@@ -53,6 +54,19 @@ export function CacheStatsCookies() {
|
||||
CacheEdificeBuilding = i;
|
||||
}
|
||||
});
|
||||
|
||||
FillCMDCache({
|
||||
CacheLucky,
|
||||
CacheLuckyReward,
|
||||
CacheLuckyWrathReward,
|
||||
CacheLuckyFrenzy,
|
||||
CacheLuckyRewardFrenzy,
|
||||
CacheLuckyWrathRewardFrenzy,
|
||||
CacheConjure,
|
||||
CacheConjureReward,
|
||||
CacheEdifice,
|
||||
CacheEdificeBuilding,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,4 +98,10 @@ export function CacheGoldenAndWrathCookiesMults() {
|
||||
if (Game.shimmerTypes.golden.n === 0) {
|
||||
CacheDragonsFortuneMultAdjustment *= 1 + Game.auraMult("Dragon's Fortune") * 1.23;
|
||||
}
|
||||
|
||||
FillCMDCache({
|
||||
CacheGoldenCookiesMult,
|
||||
CacheWrathCookiesMult,
|
||||
CacheDragonsFortuneMultAdjustment,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||
import { CacheObjectsNextAchievement } from '../VariablesAndData';
|
||||
import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement';
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import { CacheObjectsNextAchievement } from '../VariablesAndData.js';
|
||||
import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement.js';
|
||||
|
||||
/**
|
||||
* This functions caches the amount of buildings needed till next achievement
|
||||
@@ -41,5 +42,7 @@ export default function AllAmountTillNextAchievement(forceRecalc) {
|
||||
};
|
||||
}
|
||||
});
|
||||
CacheObjectsNextAchievement = result; // eslint-disable-line no-unused-vars
|
||||
CacheObjectsNextAchievement = result;
|
||||
|
||||
FillCMDCache({ CacheObjectsNextAchievement });
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||
import { SimAchievementsOwned } from '../../Sim/VariablesAndData';
|
||||
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome.js';
|
||||
import { SimAchievementsOwned } from '../../Sim/VariablesAndData.js';
|
||||
|
||||
export default function IndividualAmountTillNextAchievement(building) {
|
||||
const AchievementsAtStart = Game.AchievementsOwned;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/** Caches data related to Wrinklers */
|
||||
|
||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||
import { SimObjects } from '../../Sim/VariablesAndData.js';
|
||||
import FillCMDCache from '../FillCMDCache.js';
|
||||
import {
|
||||
CacheWrinklersFattest,
|
||||
CacheWrinklersNormal, // eslint-disable-line no-unused-vars
|
||||
CacheWrinklersTotal, // eslint-disable-line no-unused-vars
|
||||
} from '../VariablesAndData';
|
||||
CacheWrinklersNormal,
|
||||
CacheWrinklersTotal,
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This functions caches data related to Wrinklers
|
||||
@@ -37,4 +38,6 @@ export default function CacheWrinklers() {
|
||||
if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i];
|
||||
}
|
||||
}
|
||||
|
||||
FillCMDCache({ CacheWrinklersTotal, CacheWrinklersNormal, CacheWrinklersFattest });
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ function CheckNotificationPermissions(ToggleOnOff) {
|
||||
const checkNotificationPromise = function () {
|
||||
try {
|
||||
Notification.requestPermission().then();
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** Called by the "func" of individual settings */
|
||||
|
||||
import UpdateBackground from '../Disp/HelperFunctions/UpdateBackground';
|
||||
import UpdateBackground from '../Disp/HelperFunctions/UpdateBackground.js';
|
||||
|
||||
/**
|
||||
* This function changes the position of both the bottom and timer bar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { saveAndLoadingFunctions } from '@cookiemonsterteam/cookiemonsterframework/src/index';
|
||||
import { saveAndLoadingFunctions } from '@cookiemonsterteam/cookiemonsterframework/src/index.js';
|
||||
|
||||
/** Functions related to toggling or changing an individual setting */
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { UpdateBotBar } from '../../Disp/InfoBars/BottomBar';
|
||||
import { UpdateBotTimerBarPosition } from '../SpecificToggles';
|
||||
import { UpdateBotBar } from '../../Disp/InfoBars/BottomBar.js';
|
||||
import { UpdateBotTimerBarPosition } from '../SpecificToggles.js';
|
||||
|
||||
/**
|
||||
* This function toggle the bottom bar
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CMSayTime } from '../../Disp/VariablesAndData';
|
||||
import { BackupFunctions } from '../../Main/VariablesAndData';
|
||||
import { CMSayTime } from '../../Disp/VariablesAndData.js';
|
||||
import { BackupFunctions } from '../../Main/VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function changes some of the time-displays in the game to be more detailed
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
|
||||
import { GCTimers } from '../../Disp/VariablesAndData';
|
||||
import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData.js';
|
||||
import { GCTimers } from '../../Disp/VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function toggles GC Timers are visible
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades';
|
||||
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades.js';
|
||||
|
||||
/**
|
||||
* This function toggles the upgrade bar and the colours of upgrades
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import init from './InitSaveLoad/init';
|
||||
import load from './InitSaveLoad/load';
|
||||
import save from './InitSaveLoad/save';
|
||||
import init from './InitSaveLoad/init.js';
|
||||
import load from './InitSaveLoad/load.js';
|
||||
import save from './InitSaveLoad/save.js';
|
||||
|
||||
const CM = {
|
||||
init,
|
||||
@@ -8,8 +8,16 @@ const CM = {
|
||||
save,
|
||||
};
|
||||
|
||||
Game.registerMod('CookieMonster', CM);
|
||||
if (typeof Steam !== 'undefined') {
|
||||
// Need to add a delay for steam
|
||||
setTimeout(() => {
|
||||
Game.registerMod('CookieMonster', CM);
|
||||
|
||||
// Game.registerMod also calls CM.load() which calls the loop hook
|
||||
// Thus sounds normally play at start up as Season and Garden states are checked
|
||||
window.cookieMonsterFrameworkData.isInitializing = false;
|
||||
// Game.registerMod also calls CM.load() which calls the loop hook
|
||||
// Thus sounds normally play at start up as Season and Garden states are checked
|
||||
window.cookieMonsterFrameworkData.isInitializing = false;
|
||||
}, 2000);
|
||||
} else {
|
||||
Game.registerMod('CookieMonster', CM);
|
||||
window.cookieMonsterFrameworkData.isInitializing = false;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** Data copied directly from the game */
|
||||
|
||||
/** Array of the names of all fortune cookies obtainable from the ticker */
|
||||
export const Fortunes: string[] = [
|
||||
export const Fortunes = [
|
||||
'Fortune #001',
|
||||
'Fortune #002',
|
||||
'Fortune #003',
|
||||
@@ -20,6 +20,8 @@ export const Fortunes: string[] = [
|
||||
'Fortune #016',
|
||||
'Fortune #017',
|
||||
'Fortune #018',
|
||||
'Fortune #019',
|
||||
'Fortune #020',
|
||||
'Fortune #100',
|
||||
'Fortune #101',
|
||||
'Fortune #102',
|
||||
@@ -28,7 +30,7 @@ export const Fortunes: string[] = [
|
||||
];
|
||||
|
||||
/** Array of the names of all Halloween cookies */
|
||||
export const HalloCookies: string[] = [
|
||||
export const HalloCookies = [
|
||||
'Skull cookies',
|
||||
'Ghost cookies',
|
||||
'Bat cookies',
|
||||
@@ -39,7 +41,7 @@ export const HalloCookies: string[] = [
|
||||
];
|
||||
|
||||
/** Array of the names of all Christmas cookies */
|
||||
export const ChristCookies: string[] = [
|
||||
export const ChristCookies = [
|
||||
'Christmas tree biscuits',
|
||||
'Snowflake biscuits',
|
||||
'Snowman biscuits',
|
||||
@@ -50,7 +52,7 @@ export const ChristCookies: string[] = [
|
||||
];
|
||||
|
||||
/** Array of the names of all Valentine cookies */
|
||||
export const ValCookies: string[] = [
|
||||
export const ValCookies = [
|
||||
'Pure heart biscuits',
|
||||
'Ardent heart biscuits',
|
||||
'Sour heart biscuits',
|
||||
@@ -61,7 +63,7 @@ export const ValCookies: string[] = [
|
||||
];
|
||||
|
||||
/** Array of the names of all plant drops */
|
||||
export const PlantDrops: string[] = [
|
||||
export const PlantDrops = [
|
||||
'Elderwort biscuits',
|
||||
'Bakeberry cookies',
|
||||
'Duketater cookies',
|
||||
@@ -72,7 +74,7 @@ export const PlantDrops: string[] = [
|
||||
];
|
||||
|
||||
/** All possible effects plants and other items can have with a display-title */
|
||||
export const Effects: { [index: string]: string } = {
|
||||
export const Effects = {
|
||||
buildingCost: 'Building prices',
|
||||
click: 'Cookies per click',
|
||||
cps: 'Total CPS',
|
||||
21
src/Data/Moddata.js
Normal file
21
src/Data/Moddata.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/** Data related directly to Cookie Monster */
|
||||
|
||||
export const VersionMajor = '2.053';
|
||||
export const VersionMinor = '10';
|
||||
|
||||
/** Information about Cookie Monster to be displayed in the info section */
|
||||
export const ModDescription = `<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>
|
||||
`;
|
||||
|
||||
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
||||
export const LatestReleaseNotes = `This update adds support for some parts of cookie clicker 2.048</br>
|
||||
- added support for Dragon Aura 'Supreme Intellect' in the pantheon calculations</br>
|
||||
- added support for new tiers of Shimmering veil</br>
|
||||
- added support for unshackled upgrades</br>
|
||||
- updated some simulator logic to more cloesly match updated cookie clicker logic</br>
|
||||
- Bugfix: conjure backed goods tooltip used cached no gold switch raw cps instead of live cps</br>
|
||||
- Bugfix: negative calculations due to glucosimium upgrades, kittens, unshackled, and achievements</br>`;
|
||||
@@ -1,25 +0,0 @@
|
||||
/** Data related directly to Cookie Monster */
|
||||
|
||||
export const VersionMajor = '2.031';
|
||||
export const VersionMinor = '10';
|
||||
|
||||
/** Information about Cookie Monster to be displayed in the info section */
|
||||
export const ModDescription = `<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>
|
||||
`;
|
||||
|
||||
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
||||
export const LatestReleaseNotes = `This update implements the following functions:</br>
|
||||
- This updates adds a number of performance improvements which make CookieMonster about 33% more efficient</br>
|
||||
- Added a button to all buildings in the middle section that can "lock" the building. This makes the building unclickable, which might be useful for frantic clicking during cookie storms</br>
|
||||
- Added a percentage to the Golden Cookie timer bar</br>
|
||||
</br>
|
||||
This update fixes the following bugs:
|
||||
- Fix considerable lag on the Ascension screen when using the monospace font</br>
|
||||
- Fix sound playing at start-up</br>
|
||||
- Fix building tooltips and warnings not updating correctly</br>
|
||||
- Fix upgrade bar not displaying</br>
|
||||
- Fix loading of mod when no save was found</br>`;
|
||||
@@ -1,10 +1,10 @@
|
||||
/** Data related directly to the scales used by Cookie Monster */
|
||||
|
||||
/** Array of abbreviations used in the "Metric" scale */
|
||||
export const metric: string[] = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
||||
export const metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
||||
|
||||
/** Array of abbreviations used in the "Short" scale */
|
||||
export const shortScale: string[] = [
|
||||
export const shortScale = [
|
||||
'',
|
||||
'',
|
||||
'M',
|
||||
@@ -34,7 +34,7 @@ export const shortScale: string[] = [
|
||||
];
|
||||
|
||||
/** Array of abbreviations used in the "Abbreviated Short" scale */
|
||||
export const shortScaleAbbreviated: string[] = [
|
||||
export const shortScaleAbbreviated = [
|
||||
'',
|
||||
'K',
|
||||
'M',
|
||||
@@ -1,7 +1,7 @@
|
||||
/** Data related to the display titles of certain sections in menu screens */
|
||||
|
||||
/** Display titles of the headers of the Cookie Monster settings section */
|
||||
export const ConfigGroups: { [index: string]: string } = {
|
||||
export const ConfigGroups = {
|
||||
Favourite: 'Favourite Settings',
|
||||
Calculation: 'Calculation',
|
||||
Notation: 'Notation',
|
||||
@@ -14,7 +14,7 @@ export const ConfigGroups: { [index: string]: string } = {
|
||||
};
|
||||
|
||||
/** Display titles of the headers of the notification section of the Cookie Monster settings */
|
||||
export const ConfigGroupsNotification: { [index: string]: string } = {
|
||||
export const ConfigGroupsNotification = {
|
||||
NotificationGeneral: 'General Notifications',
|
||||
NotificationGC: 'Golden Cookie',
|
||||
NotificationFC: 'Fortune Cookie',
|
||||
@@ -1,21 +1,21 @@
|
||||
import { settingClasses } from '@cookiemonsterteam/cookiemonsterframework/src/index';
|
||||
import { settingClasses } from '@cookiemonsterteam/cookiemonsterframework/src/index.js';
|
||||
|
||||
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions';
|
||||
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
||||
import { SimDoSims } from '../Sim/VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
||||
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
|
||||
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
|
||||
import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons';
|
||||
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
||||
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour';
|
||||
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
||||
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
|
||||
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
||||
import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight';
|
||||
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
|
||||
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
|
||||
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions.js';
|
||||
import RefreshScale from '../Disp/HelperFunctions/RefreshScale.js';
|
||||
import { SimDoSims } from '../Sim/VariablesAndData.js'; // eslint-disable-line no-unused-vars
|
||||
import ToggleBotBar from '../Config/Toggles/ToggleBotBar.js';
|
||||
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime.js';
|
||||
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer.js';
|
||||
import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons.js';
|
||||
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos.js';
|
||||
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour.js';
|
||||
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos.js';
|
||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons.js';
|
||||
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings.js';
|
||||
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon.js';
|
||||
import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight.js';
|
||||
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades.js';
|
||||
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles.js';
|
||||
|
||||
/** This includes all options of CookieMonster and their relevant data */
|
||||
const settings = {
|
||||
@@ -129,7 +129,7 @@ const settings = {
|
||||
0,
|
||||
'bool',
|
||||
'Notation',
|
||||
['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'],
|
||||
['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX', 'Time XXx, XXx'],
|
||||
'Change the time format',
|
||||
false,
|
||||
),
|
||||
@@ -549,6 +549,14 @@ const settings = {
|
||||
'Shows a tooltip for plants that have a cookie reward.',
|
||||
true,
|
||||
),
|
||||
TooltipStocks: new settingClasses.SettingStandard(
|
||||
1,
|
||||
'bool',
|
||||
'Tooltip',
|
||||
['Stock market tooltips OFF', 'Stock market tooltips ON'],
|
||||
'Shows additional info in the stock market tooltips.',
|
||||
true,
|
||||
),
|
||||
TooltipPantheon: new settingClasses.SettingStandard(
|
||||
1,
|
||||
'bool',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** General functions to format or beautify strings */
|
||||
|
||||
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.ts';
|
||||
import { BackupFunctions } from '../../Main/VariablesAndData';
|
||||
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.js';
|
||||
import { BackupFunctions } from '../../Main/VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function returns formats number based on the Scale setting
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* @returns {string} Formatted time
|
||||
*/
|
||||
export default function FormatTime(time, longFormat) {
|
||||
/* eslint-disable no-nested-ternary */
|
||||
let formattedTime = time;
|
||||
if (time === Infinity) return time;
|
||||
if (time < 0) return 'Negative time period';
|
||||
@@ -15,7 +16,18 @@ export default function FormatTime(time, longFormat) {
|
||||
const m = Math.floor((((formattedTime % 31536000) % 86400) % 3600) / 60);
|
||||
const s = Math.floor((((formattedTime % 31536000) % 86400) % 3600) % 60);
|
||||
let str = '';
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat) {
|
||||
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat === 0) {
|
||||
if (formattedTime > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||
str += y > 0 ? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` : '';
|
||||
if (str.length > 0 || d > 0)
|
||||
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `;
|
||||
if (str.length > 0 || h > 0)
|
||||
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
|
||||
if (str.length > 0 || m > 0)
|
||||
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
|
||||
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
|
||||
} else if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat === 1) {
|
||||
if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
|
||||
str += `${(y < 10 ? '0' : '') + y}:`;
|
||||
str += `${(d < 10 ? '0' : '') + d}:`;
|
||||
@@ -23,18 +35,23 @@ export default function FormatTime(time, longFormat) {
|
||||
str += `${(m < 10 ? '0' : '') + m}:`;
|
||||
str += (s < 10 ? '0' : '') + s;
|
||||
} else {
|
||||
// Similar to TimeFormat === 0, but only two most significant components are included.
|
||||
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
|
||||
if (y > 0) {
|
||||
str += `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, `;
|
||||
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}`;
|
||||
} else if (d > 0) {
|
||||
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `;
|
||||
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}`;
|
||||
} else if (h > 0) {
|
||||
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
|
||||
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}`;
|
||||
} else if (m > 0) {
|
||||
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
|
||||
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
|
||||
} else {
|
||||
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData';
|
||||
import FormatTime from './FormatTime';
|
||||
import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData.js';
|
||||
import FormatTime from './FormatTime.js';
|
||||
|
||||
/**
|
||||
* This function returns the colour to be used for time-strings
|
||||
@@ -10,7 +10,7 @@ export default function GetTimeColour(time) {
|
||||
let colour;
|
||||
let text;
|
||||
if (time <= 0) {
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat)
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat === 1)
|
||||
text = '00:00:00:00:00';
|
||||
else text = 'Done!';
|
||||
colour = ColourGreen;
|
||||
|
||||
@@ -4,10 +4,10 @@ import {
|
||||
CacheObjects10,
|
||||
CacheObjects100,
|
||||
CacheObjectsNextAchievement,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
||||
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData';
|
||||
} from '../../Cache/VariablesAndData.js';
|
||||
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding.js';
|
||||
import Beautify from '../BeautifyAndFormatting/Beautify.js';
|
||||
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* Section: Functions related to right column of the screen (buildings/upgrades)
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
ColourRed,
|
||||
ColourTextPre,
|
||||
ColourYellow,
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function creates the legend for the upgrade bar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
||||
import { CacheUpgrades } from '../../Cache/VariablesAndData.js';
|
||||
import {
|
||||
ColourBackPre,
|
||||
ColourBlue,
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
ColourRed,
|
||||
ColoursOrdering,
|
||||
ColourYellow,
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function adjusts some things in the upgrades section
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/** Functions related to the Dragon */
|
||||
|
||||
import CacheDragonCost from '../../Cache/Dragon/Dragon';
|
||||
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData';
|
||||
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange';
|
||||
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
||||
import CacheDragonCost from '../../Cache/Dragon/Dragon.js';
|
||||
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData.js';
|
||||
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange.js';
|
||||
import Beautify from '../BeautifyAndFormatting/Beautify.js';
|
||||
import FormatTime from '../BeautifyAndFormatting/FormatTime.js';
|
||||
|
||||
/**
|
||||
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
||||
import Beautify from './BeautifyAndFormatting/Beautify';
|
||||
import UpdateBuildings from './BuildingsUpgrades/Buildings';
|
||||
import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight';
|
||||
import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
|
||||
import { UpdateBotBar } from './InfoBars/BottomBar';
|
||||
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
||||
import RefreshMenu from './MenuSections/Refreshmenu';
|
||||
import UpdateTooltips from './Tooltips/UpdateTooltips';
|
||||
import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips';
|
||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons.js';
|
||||
import UpdateBuildings from './BuildingsUpgrades/Buildings.js';
|
||||
import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight.js';
|
||||
import UpdateUpgrades from './BuildingsUpgrades/Upgrades.js';
|
||||
import { UpdateBotBar } from './InfoBars/BottomBar.js';
|
||||
import { UpdateTimerBar } from './InfoBars/TimerBar.js';
|
||||
import RefreshMenu from './MenuSections/Refreshmenu.js';
|
||||
import UpdateTooltips from './Tooltips/UpdateTooltips.js';
|
||||
import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips.js';
|
||||
|
||||
/**
|
||||
* This function handles all custom drawing for the Game.Draw() function.
|
||||
@@ -50,11 +49,4 @@ export default function CMDrawHook() {
|
||||
|
||||
// Update display of wrinkler buttons, this checks if Elder Pledge has been bought and if they should be disabled
|
||||
ToggleWrinklerButtons();
|
||||
|
||||
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.Scale && !Game.OnAscend) {
|
||||
let str = l('cookies').innerHTML.replace(/.*(?=<br>)/i, Beautify(Game.cookies));
|
||||
if (Game.prefs.monospace) str = `<span class="monospace">${str}</span>`;
|
||||
l('cookies').innerHTML = str;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** Section: Functions related to the Golden Cookie Timers */
|
||||
|
||||
import { GCTimers } from '../VariablesAndData';
|
||||
import { GCTimers } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function creates a new Golden Cookie Timer and appends it CM.Disp.GCTimers based on the id of the cookie
|
||||
|
||||
104
src/Disp/HelperFunctions/CalculateLuckyLevels.js
Normal file
104
src/Disp/HelperFunctions/CalculateLuckyLevels.js
Normal file
@@ -0,0 +1,104 @@
|
||||
const SPECIAL_DIGIT = 7;
|
||||
|
||||
/**
|
||||
* Count the number of 7s in any number
|
||||
* @param {number} number The number to count sevens for
|
||||
* @returns {number} The number of 7s in the provided number
|
||||
*/
|
||||
export function CountSevens(number) {
|
||||
return String(number).split(String(SPECIAL_DIGIT)).length - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the delta for the next number where the given digit is a 7
|
||||
* @param {number} number The starting number to calculate the delta for
|
||||
* @param {number} digitPlace 1 for ones place, 10 for tens place, 100 for hundreds place, etc
|
||||
* @returns {number} The calculated delta
|
||||
*/
|
||||
export function CalculateSevenDelta(number, digitPlace) {
|
||||
const target = SPECIAL_DIGIT * digitPlace;
|
||||
const modulus = digitPlace * 10;
|
||||
|
||||
let delta = target - (number % modulus) + (number % digitPlace);
|
||||
if (delta < 0) delta += modulus;
|
||||
|
||||
return delta;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function calculates each of the next "lucky" prestige levels
|
||||
* @param {number} currentLevel The user's prestige level, including levels earned since the last ascension
|
||||
* @returns {{number}, {number}, {number}} luckyDigit, luckyNumber, luckyPayout The next eligible level for each upgrade
|
||||
*/
|
||||
export default function CalculateLuckyLevels(currentLevel) {
|
||||
const result = {};
|
||||
let sevenCount = CountSevens(currentLevel);
|
||||
const numberOfDigits = Math.max(Math.floor(Math.log10(Math.abs(currentLevel))), 0) + 1;
|
||||
|
||||
if (sevenCount >= 1) {
|
||||
result.luckyDigit = currentLevel;
|
||||
if (sevenCount >= 2) {
|
||||
result.luckyNumber = currentLevel;
|
||||
if (sevenCount >= 4) {
|
||||
result.luckyPayout = currentLevel;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Consider only top 15 digits if it is big number
|
||||
let localLevel;
|
||||
if (numberOfDigits >= 16) {
|
||||
localLevel = Math.ceil(currentLevel / 10 ** (numberOfDigits - 15));
|
||||
} else {
|
||||
localLevel = currentLevel;
|
||||
}
|
||||
sevenCount = CountSevens(localLevel);
|
||||
|
||||
if (result.luckyDigit === undefined) {
|
||||
if (sevenCount < 1) {
|
||||
const delta = CalculateSevenDelta(localLevel, 1);
|
||||
|
||||
localLevel += delta;
|
||||
sevenCount = CountSevens(localLevel);
|
||||
}
|
||||
|
||||
result.luckyDigit = localLevel;
|
||||
if (numberOfDigits >= 16) {
|
||||
result.luckyDigit *= 10 ** Number(numberOfDigits - 15);
|
||||
}
|
||||
}
|
||||
|
||||
if (result.luckyNumber === undefined) {
|
||||
while (sevenCount < 2) {
|
||||
let delta = CalculateSevenDelta(localLevel, 1);
|
||||
if (delta === 0) delta = CalculateSevenDelta(localLevel, 10);
|
||||
|
||||
localLevel += delta;
|
||||
sevenCount = CountSevens(localLevel);
|
||||
}
|
||||
|
||||
result.luckyNumber = localLevel;
|
||||
if (numberOfDigits >= 16) {
|
||||
result.luckyNumber *= 10 ** Number(numberOfDigits - 15);
|
||||
}
|
||||
}
|
||||
|
||||
let digitPlace = 1;
|
||||
while (sevenCount < 4) {
|
||||
const delta = CalculateSevenDelta(localLevel, digitPlace);
|
||||
if (delta === 0) {
|
||||
digitPlace *= 10;
|
||||
} else {
|
||||
localLevel += delta;
|
||||
sevenCount = CountSevens(localLevel);
|
||||
}
|
||||
}
|
||||
|
||||
result.luckyPayout = localLevel;
|
||||
if (numberOfDigits >= 16) {
|
||||
result.luckyPayout *= 10 ** Number(numberOfDigits - 15);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
52
src/Disp/HelperFunctions/CalculateStockNextExpectedValue.js
Normal file
52
src/Disp/HelperFunctions/CalculateStockNextExpectedValue.js
Normal file
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* This function calculates a stock's next expected value
|
||||
* @param {number} value The stock's current value
|
||||
* @param {number} delta The stock's current delta
|
||||
* @param {number} restingValue The stock's resting value
|
||||
* @param {number} mode The stock's current mode
|
||||
* @param {number} bankLevel The bank building level
|
||||
* @param {number} dragonBoost The current aura multiplier from Supreme Intellect and Reality Bending
|
||||
* @returns {number} value + delta The stock's next expected value
|
||||
*/
|
||||
export default function CalculateStockNextExpectedValue(
|
||||
pValue,
|
||||
pDelta,
|
||||
restingValue,
|
||||
mode,
|
||||
bankLevel,
|
||||
dragonBoost,
|
||||
) {
|
||||
let value = pValue;
|
||||
let delta = pDelta;
|
||||
delta *= 0.97 + 0.01 * dragonBoost;
|
||||
switch (mode) {
|
||||
case 0:
|
||||
delta *= 0.95;
|
||||
break;
|
||||
case 1:
|
||||
delta *= 0.99;
|
||||
delta += 0.02;
|
||||
break;
|
||||
case 2:
|
||||
delta *= 0.99;
|
||||
delta -= 0.02;
|
||||
break;
|
||||
case 3:
|
||||
delta += 0.06;
|
||||
value += 2.5;
|
||||
break;
|
||||
case 4:
|
||||
delta -= 0.06;
|
||||
value -= 2.5;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
value += (restingValue - value) * 0.01;
|
||||
if (mode === 3) value -= 0.582;
|
||||
if (mode === 4) value += 0.6;
|
||||
if (value > 100 + (bankLevel - 1) * 3 && delta > 0) delta *= 0.9;
|
||||
if (value < 5) value += (5 - value) * 0.5;
|
||||
if (value < 5 && delta < 0) delta *= 0.95;
|
||||
return Math.max(value + delta, 1);
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
CacheCurrWrinklerCount,
|
||||
CacheCurrWrinklerCPSMult,
|
||||
CacheWrinklersFattest,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
} from '../../Cache/VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function returns the cps as either current or average CPS depending on CM.Options.CPSMode
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
ColourPurple,
|
||||
ColourRed,
|
||||
ColourYellow,
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function returns Name and Colour as object for sugar lump type that is given as input param.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData';
|
||||
import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function returns the total amount stored in the Wrinkler Bank
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import UpdateBuildings from '../BuildingsUpgrades/Buildings';
|
||||
import UpdateUpgrades from '../BuildingsUpgrades/Upgrades';
|
||||
import { UpdateBotBar } from '../InfoBars/BottomBar';
|
||||
import UpdateBuildings from '../BuildingsUpgrades/Buildings.js';
|
||||
import UpdateUpgrades from '../BuildingsUpgrades/Upgrades.js';
|
||||
import { UpdateBotBar } from '../InfoBars/BottomBar.js';
|
||||
|
||||
/**
|
||||
* This function refreshes all numbers after a change in scale-setting
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ToggleTimerBar } from '../../Config/SpecificToggles';
|
||||
import ToggleBotBar from '../../Config/Toggles/ToggleBotBar';
|
||||
import { ToggleTimerBar } from '../../Config/SpecificToggles.js';
|
||||
import ToggleBotBar from '../../Config/Toggles/ToggleBotBar.js';
|
||||
|
||||
import UpdateBackground from './UpdateBackground';
|
||||
import UpdateBackground from './UpdateBackground.js';
|
||||
|
||||
/**
|
||||
* This function disables and shows the bars created by CookieMonster when the game is "ascending"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import UpdateBuildings from '../BuildingsUpgrades/Buildings';
|
||||
import UpdateBuildings from '../BuildingsUpgrades/Buildings.js';
|
||||
import {
|
||||
ColourBackPre,
|
||||
ColourBorderPre,
|
||||
ColoursOrdering,
|
||||
ColourTextPre,
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function changes/refreshes colours if the user has set new standard colours
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/** Functions related to the Bottom Bar */
|
||||
|
||||
import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData';
|
||||
import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts';
|
||||
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||
import FormatTime from '../BeautifyAndFormatting/FormatTime';
|
||||
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour';
|
||||
import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData.js';
|
||||
import { VersionMajor, VersionMinor } from '../../Data/Moddata.js';
|
||||
import Beautify from '../BeautifyAndFormatting/Beautify.js';
|
||||
import FormatTime from '../BeautifyAndFormatting/FormatTime.js';
|
||||
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour.js';
|
||||
|
||||
import GetCPS from '../HelperFunctions/GetCPS';
|
||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
||||
import { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData';
|
||||
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
|
||||
import GetCPS from '../HelperFunctions/GetCPS.js';
|
||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank.js';
|
||||
import { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData.js';
|
||||
import { CreateBotBarBuildingColumn } from './CreateDOMElements.js';
|
||||
|
||||
/**
|
||||
* This function creates the bottom bar and appends it to l('wrapper')
|
||||
@@ -98,9 +98,8 @@ export function UpdateBotBar() {
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].className =
|
||||
ColourTextPre + timeColour.colour;
|
||||
if (timeColour.text === 'Done!' && Game.cookies < Game.Objects[i].bulkPrice) {
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||
count
|
||||
].textContent = `${timeColour.text} (with Wrink)`;
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent =
|
||||
`${timeColour.text} (with Wrink)`;
|
||||
} else
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent =
|
||||
timeColour.text;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** Functions to create various DOM elements used by the Bars */
|
||||
|
||||
import { ColourBackPre, ColourBlue, ColourTextPre } from '../VariablesAndData';
|
||||
import { ColourBackPre, ColourBlue, ColourTextPre } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function creates an indivudual timer for the timer bar
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** Functions related to the Timer Bar */
|
||||
|
||||
import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles';
|
||||
import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles.js';
|
||||
import {
|
||||
BuffColours,
|
||||
ColourBackPre,
|
||||
@@ -8,8 +8,9 @@ import {
|
||||
ColourOrange,
|
||||
ColourPurple,
|
||||
LastNumberOfTimers,
|
||||
} from '../VariablesAndData';
|
||||
import { CreateTimer } from './CreateDOMElements';
|
||||
} from '../VariablesAndData.js';
|
||||
import { CreateTimer } from './CreateDOMElements.js';
|
||||
import { updateChanceTotal, updateChanceTotalDeer } from '../../Main/CheckStates/Probability.js';
|
||||
|
||||
/**
|
||||
* This function creates the TimerBar and appends it to l('wrapper')
|
||||
@@ -124,11 +125,18 @@ export function UpdateTimerBar() {
|
||||
(Game.shimmerTypes.golden.time - Game.shimmerTypes.golden.minTime) /
|
||||
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime),
|
||||
) ** 5;
|
||||
const finalChance = updateChanceTotal(chanceToSpawn);
|
||||
l('CMTimerBarGCTime').textContent = `${Math.ceil(
|
||||
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps,
|
||||
)} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
|
||||
)} `;
|
||||
if (finalChance < 0.01) {
|
||||
l('CMTimerBarGCTime').textContent +=
|
||||
`<${(0.01).toLocaleString('en', { style: 'percent' })}`;
|
||||
} else {
|
||||
l('CMTimerBarGCTime').textContent += finalChance.toLocaleString('en', {
|
||||
style: 'percent',
|
||||
})}`;
|
||||
});
|
||||
}
|
||||
numberOfTimers += 1;
|
||||
} else l('CMTimerBarGC').style.display = 'none';
|
||||
|
||||
@@ -167,11 +175,18 @@ export function UpdateTimerBar() {
|
||||
(Game.shimmerTypes.reindeer.time - Game.shimmerTypes.reindeer.minTime) /
|
||||
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime),
|
||||
) ** 5;
|
||||
const deerFinalChance = updateChanceTotalDeer(chanceToSpawn);
|
||||
l('CMTimerBarRenTime').textContent = `${Math.ceil(
|
||||
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps,
|
||||
)} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
|
||||
)} `;
|
||||
if (deerFinalChance < 0.01) {
|
||||
l('CMTimerBarRenTime').textContent +=
|
||||
`<${(0.01).toLocaleString('en', { style: 'percent' })}`;
|
||||
} else {
|
||||
l('CMTimerBarRenTime').textContent += deerFinalChance.toLocaleString('en', {
|
||||
style: 'percent',
|
||||
})}`;
|
||||
});
|
||||
}
|
||||
numberOfTimers += 1;
|
||||
} else {
|
||||
l('CMTimerBarRen').style.display = 'none';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData';
|
||||
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
||||
import { CreateTooltip } from '../Tooltips/Tooltip';
|
||||
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData.js';
|
||||
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers.js';
|
||||
import { CreateTooltip } from '../Tooltips/Tooltip.js';
|
||||
|
||||
/**
|
||||
* This function creates two objects at the bottom of the left column that allowing popping of wrinklers
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DispCSS } from '../VariablesAndData';
|
||||
import { DispCSS } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function creates a CSS style that stores certain standard CSS classes used by CookieMonster
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import AddMenuStats from './Statistics/AddStatsPage';
|
||||
import createMenuOptions from './createMenuOptions.js';
|
||||
import AddMenuStats from './Statistics/AddStatsPage.js';
|
||||
|
||||
/**
|
||||
* This function adds the calll the functions to add extra info to the stats and options pages
|
||||
@@ -12,5 +13,11 @@ export default function AddMenu() {
|
||||
title.textContent = 'Cookie Monster Statistics';
|
||||
AddMenuStats(title);
|
||||
}
|
||||
} else if (Game.onMenu === 'prefs') {
|
||||
// Added because Framework is broken
|
||||
l('menu').childNodes[2].insertBefore(
|
||||
createMenuOptions(),
|
||||
l('menu').childNodes[2].childNodes[l('menu').childNodes[2].childNodes.length - 1],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/** Main function to create the sections of Cookie Monster on the Statistics page */
|
||||
|
||||
import { AddMissingUpgrades } from './CreateMissingUpgrades';
|
||||
import * as CreateSections from './CreateStatsSections';
|
||||
import * as CreateElements from './CreateDOMElements';
|
||||
import * as GameData from '../../../Data/Gamedata.ts';
|
||||
import { AddMissingUpgrades } from './CreateMissingUpgrades.js';
|
||||
import * as CreateSections from './CreateStatsSections.js';
|
||||
import * as CreateElements from './CreateDOMElements.js';
|
||||
import * as GameData from '../../../Data/Gamedata.js';
|
||||
|
||||
import {
|
||||
CacheAverageClicks,
|
||||
@@ -12,12 +12,12 @@ import {
|
||||
CacheWrinklersFattest,
|
||||
CacheWrinklersNormal,
|
||||
CacheWrinklersTotal,
|
||||
} from '../../../Cache/VariablesAndData';
|
||||
import PopAllNormalWrinklers from '../../HelperFunctions/PopWrinklers';
|
||||
import { ClickTimes, CookieTimes } from '../../VariablesAndData';
|
||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||
import AddMissingAchievements from './CreateMissingAchievements';
|
||||
} from '../../../Cache/VariablesAndData.js';
|
||||
import PopAllNormalWrinklers from '../../HelperFunctions/PopWrinklers.js';
|
||||
import { ClickTimes, CookieTimes } from '../../VariablesAndData.js';
|
||||
import GetCPS from '../../HelperFunctions/GetCPS.js';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify.js';
|
||||
import AddMissingAchievements from './CreateMissingAchievements.js';
|
||||
|
||||
/**
|
||||
* This function adds stats created by CookieMonster to the stats page
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/** Section: Functions related to the creation of basic DOM elements page */
|
||||
|
||||
import { ToggleHeader } from '../../../Config/ToggleSetting';
|
||||
import { ToggleHeader } from '../../../Config/ToggleSetting.js';
|
||||
|
||||
import { SimpleTooltipElements } from '../../VariablesAndData';
|
||||
import { SimpleTooltipElements } from '../../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function creates a header-object for the stats page
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
CacheMissingUpgrades,
|
||||
CacheMissingUpgradesCookies,
|
||||
CacheMissingUpgradesPrestige,
|
||||
} from '../../../Cache/VariablesAndData';
|
||||
} from '../../../Cache/VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function creates the missing upgrades sections for prestige, normal and cookie upgrades
|
||||
@@ -13,8 +13,7 @@ export function AddMissingUpgrades() {
|
||||
l('menu').childNodes.forEach((menuSection) => {
|
||||
if (menuSection.children[0]) {
|
||||
if (menuSection.children[0].innerHTML === 'Prestige' && CacheMissingUpgradesPrestige) {
|
||||
const prestigeUpgradesMissing =
|
||||
CacheMissingUpgradesPrestige.match(new RegExp('div', 'g') || []).length / 2;
|
||||
const prestigeUpgradesMissing = CacheMissingUpgradesPrestige.match(/div/g || []).length / 2;
|
||||
const title = document.createElement('div');
|
||||
title.id = 'CMMissingUpgradesPrestigeTitle';
|
||||
title.className = 'listing';
|
||||
@@ -30,8 +29,7 @@ export function AddMissingUpgrades() {
|
||||
menuSection.appendChild(upgrades);
|
||||
} else if (menuSection.children[0].innerHTML === 'Upgrades') {
|
||||
if (CacheMissingUpgrades) {
|
||||
const normalUpgradesMissing =
|
||||
CacheMissingUpgrades.match(new RegExp('div', 'g') || []).length / 2;
|
||||
const normalUpgradesMissing = CacheMissingUpgrades.match(/div/g || []).length / 2;
|
||||
const title = document.createElement('div');
|
||||
title.id = 'CMMissingUpgradesTitle';
|
||||
title.className = 'listing';
|
||||
@@ -54,8 +52,7 @@ export function AddMissingUpgrades() {
|
||||
);
|
||||
}
|
||||
if (CacheMissingUpgradesCookies) {
|
||||
const cookieUpgradesMissing =
|
||||
CacheMissingUpgradesCookies.match(new RegExp('div', 'g') || []).length / 2;
|
||||
const cookieUpgradesMissing = CacheMissingUpgradesCookies.match(/div/g || []).length / 2;
|
||||
const title = document.createElement('div');
|
||||
title.id = 'CMMissingUpgradesCookiesTitle';
|
||||
title.className = 'listing';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** Functions to create the individual sections of the Statistics page */
|
||||
|
||||
import * as GameData from '../../../Data/Gamedata.ts';
|
||||
import { MaxChainCookieReward } from '../../../Cache/Stats/ChainCookies';
|
||||
import * as GameData from '../../../Data/Gamedata.js';
|
||||
import { MaxChainCookieReward } from '../../../Cache/Stats/ChainCookies.js';
|
||||
import {
|
||||
CacheAvgCPSWithChoEgg,
|
||||
CacheCentEgg,
|
||||
@@ -35,19 +35,20 @@ import {
|
||||
CacheSeaSpec,
|
||||
CacheWrathCookiesMult,
|
||||
CacheWrinklersTotal,
|
||||
} from '../../../Cache/VariablesAndData';
|
||||
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension';
|
||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData';
|
||||
} from '../../../Cache/VariablesAndData.js';
|
||||
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension.js';
|
||||
import CalculateLuckyLevels from '../../HelperFunctions/CalculateLuckyLevels.js';
|
||||
import GetCPS from '../../HelperFunctions/GetCPS.js';
|
||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank.js';
|
||||
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData.js';
|
||||
import {
|
||||
StatsListing,
|
||||
StatsHeader,
|
||||
StatsMissDisp,
|
||||
StatsMissDispListing,
|
||||
} from './CreateDOMElements';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
||||
} from './CreateDOMElements.js';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify.js';
|
||||
import FormatTime from '../../BeautifyAndFormatting/FormatTime.js';
|
||||
|
||||
/**
|
||||
* This function creates the "Lucky" section of the stats page
|
||||
@@ -436,6 +437,33 @@ export function SpellsSection() {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
const { minigame } = Game.Objects['Wizard tower'];
|
||||
const spellsCast = minigame.spellsCastTotal;
|
||||
const spellsNeeded = (function (val) {
|
||||
switch (true) {
|
||||
case val < 9:
|
||||
return 9 - val;
|
||||
case val < 99:
|
||||
return 99 - val;
|
||||
case val < 999:
|
||||
return 999 - val;
|
||||
default:
|
||||
return 'NA';
|
||||
}
|
||||
})(spellsCast);
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Spells cast',
|
||||
spellsCast < 999
|
||||
? document.createTextNode(
|
||||
`Next achievement in ${spellsNeeded}, current total: ${Beautify(spellsCast)}`,
|
||||
)
|
||||
: document.createTextNode(`No new achievement, current total: ${Beautify(spellsCast)}`),
|
||||
),
|
||||
);
|
||||
|
||||
return section;
|
||||
}
|
||||
|
||||
@@ -606,46 +634,47 @@ export function PrestigeSection() {
|
||||
const currentPrestige = Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
|
||||
const willHave = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||
const willGet = willHave - currentPrestige;
|
||||
const { luckyDigit, luckyNumber, luckyPayout } = CalculateLuckyLevels(willHave);
|
||||
if (!Game.Has('Lucky digit')) {
|
||||
let delta7 = 7 - (willHave % 10);
|
||||
if (delta7 < 0) delta7 += 10;
|
||||
const next7Reset = willGet + delta7;
|
||||
const next7Total = willHave + delta7;
|
||||
const frag7 = document.createDocumentFragment();
|
||||
frag7.appendChild(
|
||||
const luckyDigitDelta = luckyDigit - willHave;
|
||||
const luckyDigitReset = willGet + luckyDigitDelta;
|
||||
const fragLuckyDigit = document.createDocumentFragment();
|
||||
fragLuckyDigit.appendChild(
|
||||
document.createTextNode(
|
||||
`${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`,
|
||||
`${luckyDigit.toLocaleString()} / ${luckyDigitReset.toLocaleString()} (+${luckyDigitDelta})`,
|
||||
),
|
||||
);
|
||||
section.appendChild(StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7));
|
||||
section.appendChild(
|
||||
StatsListing('basic', 'Next "Lucky Digit" (total / reset)', fragLuckyDigit),
|
||||
);
|
||||
}
|
||||
|
||||
if (!Game.Has('Lucky number')) {
|
||||
let delta777 = 777 - (willHave % 1000);
|
||||
if (delta777 < 0) delta777 += 1000;
|
||||
const next777Reset = willGet + delta777;
|
||||
const next777Total = willHave + delta777;
|
||||
const frag777 = document.createDocumentFragment();
|
||||
frag777.appendChild(
|
||||
const luckyNumberDelta = luckyNumber - willHave;
|
||||
const luckyNumberReset = willGet + luckyNumberDelta;
|
||||
const fragLuckyNumber = document.createDocumentFragment();
|
||||
fragLuckyNumber.appendChild(
|
||||
document.createTextNode(
|
||||
`${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`,
|
||||
`${luckyNumber.toLocaleString()} / ${luckyNumberReset.toLocaleString()} (+${luckyNumberDelta})`,
|
||||
),
|
||||
);
|
||||
section.appendChild(StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777));
|
||||
section.appendChild(
|
||||
StatsListing('basic', 'Next "Lucky Number" (total / reset)', fragLuckyNumber),
|
||||
);
|
||||
}
|
||||
|
||||
if (!Game.Has('Lucky payout')) {
|
||||
let delta777777 = 777777 - (willHave % 1000000);
|
||||
if (delta777777 < 0) delta777777 += 1000000;
|
||||
const next777777Reset = willGet + delta777777;
|
||||
const next777777Total = willHave + delta777777;
|
||||
const frag777777 = document.createDocumentFragment();
|
||||
frag777777.appendChild(
|
||||
const luckyPayoutDelta = luckyPayout - willHave;
|
||||
const luckyPayoutReset = willGet + luckyPayoutDelta;
|
||||
const fragLuckyPayout = document.createDocumentFragment();
|
||||
fragLuckyPayout.appendChild(
|
||||
document.createTextNode(
|
||||
`${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`,
|
||||
`${luckyPayout.toLocaleString()} / ${luckyPayoutReset.toLocaleString()} (+${luckyPayoutDelta})`,
|
||||
),
|
||||
);
|
||||
section.appendChild(StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777));
|
||||
section.appendChild(
|
||||
StatsListing('basic', 'Next "Lucky Payout" (total / reset)', fragLuckyPayout),
|
||||
);
|
||||
}
|
||||
|
||||
return section;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { menuFunctions } from '@cookiemonsterteam/cookiemonsterframework';
|
||||
import { LatestReleaseNotes, ModDescription } from '../../Data/Moddata.ts';
|
||||
import { LatestReleaseNotes, ModDescription } from '../../Data/Moddata.js';
|
||||
|
||||
/**
|
||||
* Creates the <div> to be added to the Info section
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { menuFunctions as mF } from '@cookiemonsterteam/cookiemonsterframework';
|
||||
import { ConfigGroups, ConfigGroupsNotification } from '../../Data/Sectionheaders.ts';
|
||||
import settings from '../../Data/settings';
|
||||
import UpdateColours from '../HelperFunctions/UpdateColours';
|
||||
import RefreshScale from '../HelperFunctions/RefreshScale';
|
||||
import { ConfigGroups, ConfigGroupsNotification } from '../../Data/Sectionheaders.js';
|
||||
import settings from '../../Data/settings.js';
|
||||
import UpdateColours from '../HelperFunctions/UpdateColours.js';
|
||||
import RefreshScale from '../HelperFunctions/RefreshScale.js';
|
||||
|
||||
/**
|
||||
* Creates the <div> to be added to the Options section
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData';
|
||||
import { LastGoldenCookieState } from '../../Main/VariablesAndData';
|
||||
import { CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData.js';
|
||||
import { LastGoldenCookieState } from '../../Main/VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function creates the Favicon, it is called by CM.Main.DelayInit()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/** Functions related to updating the tab in the browser's tab-bar */
|
||||
|
||||
import { CacheSeasonPopShimmer, CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData';
|
||||
import { CacheSeasonPopShimmer, CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData.js';
|
||||
|
||||
import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData';
|
||||
import { Title } from '../VariablesAndData';
|
||||
import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData.js';
|
||||
import { Title } from '../VariablesAndData.js';
|
||||
|
||||
/**
|
||||
* This function updates the tab title
|
||||
|
||||
@@ -2,8 +2,8 @@ import {
|
||||
CacheHCPerSecond,
|
||||
CacheLastHeavenlyChips,
|
||||
CacheTimeTillNextPrestige,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||
} from '../../Cache/VariablesAndData.js';
|
||||
import Beautify from '../BeautifyAndFormatting/Beautify.js';
|
||||
|
||||
/**
|
||||
* This function creates a header object for tooltips.
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
ColourYellow,
|
||||
ColourPurple,
|
||||
TooltipType,
|
||||
} from '../VariablesAndData';
|
||||
} from '../VariablesAndData.js';
|
||||
|
||||
/** Creates various sections of tooltips */
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import UpdateTooltips from './UpdateTooltips';
|
||||
import { SimpleTooltipElements, TooltipName, TooltipType } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour';
|
||||
import Beautify from '../BeautifyAndFormatting/Beautify';
|
||||
import UpdateTooltips from './UpdateTooltips.js';
|
||||
import { SimpleTooltipElements, TooltipName, TooltipType } from '../VariablesAndData.js'; // eslint-disable-line no-unused-vars
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js';
|
||||
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour.js';
|
||||
import Beautify from '../BeautifyAndFormatting/Beautify.js';
|
||||
|
||||
/** All general functions related to creating and updating tooltips */
|
||||
|
||||
@@ -41,7 +41,7 @@ export function CreateTooltip(type, name) {
|
||||
// Adds amortization info to the list of info per building
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TooltipAmor === 1) {
|
||||
const buildPrice = BuildingGetPrice(
|
||||
Game.Objects[name],
|
||||
name,
|
||||
Game.Objects[name].basePrice,
|
||||
0,
|
||||
Game.Objects[name].free,
|
||||
@@ -98,6 +98,8 @@ export function CreateTooltip(type, name) {
|
||||
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(name[0], name[1])();
|
||||
// Harvest all button in garden
|
||||
else if (type === 'ha') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)();
|
||||
// Stock market
|
||||
else if (type === 'sm') l('tooltip').innerHTML = Game.Objects.Bank.minigame.goodTooltip(name)();
|
||||
else if (type === 'wb') l('tooltip').innerHTML = '';
|
||||
else if (type === 'pag') l('tooltip').innerHTML = Game.Objects.Temple.minigame.godTooltip(name)();
|
||||
else if (type === 'pas')
|
||||
@@ -111,6 +113,7 @@ export function CreateTooltip(type, name) {
|
||||
type === 'g' ||
|
||||
(type === 'p' && !Game.keys[16]) ||
|
||||
type === 'ha' ||
|
||||
type === 'sm' ||
|
||||
type === 'wb' ||
|
||||
type === 'pag' ||
|
||||
(type === 'pas' && name[1] !== -1)
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
import ColourOfPP from '../../../Cache/PP/ColourOfPP';
|
||||
import ColourOfPP from '../../../Cache/PP/ColourOfPP.js';
|
||||
import {
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
CacheObjects100,
|
||||
CacheObjectsNextAchievement,
|
||||
} from '../../../Cache/VariablesAndData';
|
||||
} from '../../../Cache/VariablesAndData.js';
|
||||
|
||||
import BuyBuildingsBonusIncome from '../../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||
import { SimObjects } from '../../../Sim/VariablesAndData';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||
import FormatTime from '../../BeautifyAndFormatting/FormatTime';
|
||||
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
|
||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||
import BuyBuildingsBonusIncome from '../../../Sim/SimulationEvents/BuyBuildingBonusIncome.js';
|
||||
import { SimObjects } from '../../../Sim/VariablesAndData.js';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify.js';
|
||||
import FormatTime from '../../BeautifyAndFormatting/FormatTime.js';
|
||||
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour.js';
|
||||
import GetCPS from '../../HelperFunctions/GetCPS.js';
|
||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank.js';
|
||||
import {
|
||||
ColourTextPre,
|
||||
LastTargetTooltipBuilding,
|
||||
TooltipBonusIncome,
|
||||
TooltipName,
|
||||
TooltipPrice,
|
||||
} from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
} from '../../VariablesAndData.js';
|
||||
import * as Create from '../CreateTooltip.js';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Building tooltips
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||
import { TooltipName } from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify.js';
|
||||
import { TooltipName } from '../../VariablesAndData.js';
|
||||
import * as Create from '../CreateTooltip.js';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Garden plots tooltips
|
||||
@@ -21,14 +21,14 @@ export default function GardenPlots() {
|
||||
const reward = document.createElement('div');
|
||||
reward.id = 'CMTooltipPlantReward';
|
||||
l('CMTooltipBorder').appendChild(reward);
|
||||
if (plantName === 'Bakeberry') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 30)}`;
|
||||
} else if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
|
||||
if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 3)}`;
|
||||
} else if (plantName === 'Bakeberry') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 30)}`;
|
||||
} else if (plantName === 'Queenbeet') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature ? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : '0'
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { CacheNoGoldSwitchCookiesPS } from '../../../Cache/VariablesAndData';
|
||||
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
|
||||
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
|
||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||
import { ColourTextPre, TooltipName } from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify.js';
|
||||
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour.js';
|
||||
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime.js';
|
||||
import { ColourTextPre, TooltipName } from '../../VariablesAndData.js';
|
||||
import * as Create from '../CreateTooltip.js';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Grimoire tooltips
|
||||
@@ -58,10 +55,7 @@ export default function Grimoire() {
|
||||
const reward = document.createElement('span');
|
||||
reward.style.color = '#33FF00';
|
||||
reward.textContent = Beautify(
|
||||
Math.min(
|
||||
(Game.cookies + GetWrinkConfigBank()) * 0.15,
|
||||
CacheNoGoldSwitchCookiesPS * 60 * 30,
|
||||
),
|
||||
Math.max(Math.min(Game.cookies * 0.15, Game.cookiesPs * 60 * 30), 7),
|
||||
2,
|
||||
);
|
||||
conjure.appendChild(reward);
|
||||
@@ -70,7 +64,10 @@ export default function Grimoire() {
|
||||
conjure.appendChild(seperator);
|
||||
const loss = document.createElement('span');
|
||||
loss.style.color = 'red';
|
||||
loss.textContent = Beautify(CacheNoGoldSwitchCookiesPS * 60 * 15, 2);
|
||||
loss.textContent = Beautify(
|
||||
Math.min(Game.cookies, Math.min(Game.cookies * 0.15, Game.cookiesPs * 60 * 15) + 13),
|
||||
2,
|
||||
);
|
||||
conjure.appendChild(loss);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||
import * as Create from '../CreateTooltip';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify.js';
|
||||
import * as Create from '../CreateTooltip.js';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Garden Harvest All tooltip
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CacheGods } from '../../../Cache/VariablesAndData';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||
import { TooltipName, TooltipType } from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
import { CacheGods } from '../../../Cache/VariablesAndData.js';
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify.js';
|
||||
import { TooltipName, TooltipType } from '../../VariablesAndData.js';
|
||||
import * as Create from '../CreateTooltip.js';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Pantheon Gods tooltip
|
||||
|
||||
74
src/Disp/Tooltips/TypesOfTooltips/StockMarket.js
Normal file
74
src/Disp/Tooltips/TypesOfTooltips/StockMarket.js
Normal file
@@ -0,0 +1,74 @@
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify.js';
|
||||
import {
|
||||
TooltipName,
|
||||
ColourTextPre,
|
||||
ColourGreen,
|
||||
ColourYellow,
|
||||
ColourOrange,
|
||||
ColourRed,
|
||||
ColourPurple,
|
||||
ColourGray,
|
||||
} from '../../VariablesAndData.js';
|
||||
import CalculateStockNextExpectedValue from '../../HelperFunctions/CalculateStockNextExpectedValue.js';
|
||||
import * as Create from '../CreateTooltip.js';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the stock market
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
export default function StockMarket() {
|
||||
const { minigame } = Game.Objects.Bank;
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TooltipStocks) {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
const stock = minigame.goodsById[TooltipName];
|
||||
|
||||
// Current stock mode
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Current Mode'));
|
||||
const stockMode = document.createElement('div');
|
||||
stockMode.id = 'CMTooltipMode';
|
||||
tooltipBox.appendChild(stockMode);
|
||||
const modeIndex = stock.mode;
|
||||
const modes = ['Stable', 'Slow Rise', 'Slow Fall', 'Fast Rise', 'Fast Fall', 'Chaotic'];
|
||||
stockMode.textContent = modes[modeIndex];
|
||||
const colours = [ColourGray, ColourYellow, ColourOrange, ColourGreen, ColourRed, ColourPurple];
|
||||
stockMode.className = ColourTextPre + colours[modeIndex];
|
||||
|
||||
// Current stock delta value
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Delta'));
|
||||
const delta = document.createElement('div');
|
||||
delta.id = 'CMTooltipDelta';
|
||||
tooltipBox.appendChild(delta);
|
||||
delta.textContent = Beautify(stock.d);
|
||||
const deltaColour = stock.d < 0 ? ColourRed : ColourGreen;
|
||||
delta.className = ColourTextPre + deltaColour;
|
||||
|
||||
// Stock resting value
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Resting Value'));
|
||||
const restingValue = document.createElement('div');
|
||||
restingValue.id = 'CMTooltipRestingValue';
|
||||
tooltipBox.appendChild(restingValue);
|
||||
restingValue.textContent = `$${Beautify(minigame.getRestingVal(stock.id))}`;
|
||||
restingValue.style.color = 'white';
|
||||
|
||||
// Next expected value
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Expected Next Value'));
|
||||
const expectedNextValue = document.createElement('div');
|
||||
expectedNextValue.id = 'CMTooltipExpectedValue';
|
||||
tooltipBox.appendChild(expectedNextValue);
|
||||
const expectedValue = CalculateStockNextExpectedValue(
|
||||
stock.val,
|
||||
stock.d,
|
||||
minigame.getRestingVal(stock.id),
|
||||
stock.mode,
|
||||
Game.Objects.Bank.level,
|
||||
Game.auraMult('Supreme Intellect'),
|
||||
);
|
||||
expectedNextValue.textContent = `$${
|
||||
Beautify(expectedValue) + (expectedValue < stock.val ? '\u25bc' : '\u25b2')
|
||||
}`;
|
||||
const expectedNextValueColour = expectedValue < stock.val ? ColourRed : ColourGreen;
|
||||
expectedNextValue.className = ColourTextPre + expectedNextValueColour;
|
||||
|
||||
l('CMTooltipArea').appendChild(tooltipBox);
|
||||
} 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