Compare commits

..

1 Commits

Author SHA1 Message Date
Daniël van Noord
ac7f630a8e Merge pull request #916 from CookieMonsterTeam/dev
Push hotfixes to master
2021-09-02 23:01:48 +02:00
165 changed files with 6956 additions and 4830 deletions

View File

@@ -14,6 +14,18 @@
"parserOptions": { "parserOptions": {
"ecmaVersion": 12 "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/*"], "ignorePatterns": ["*CookieMonster*.js", "dist/*", "node_modules/*"],
"rules": { "rules": {
"import/no-mutable-exports": "off", // We need to this throughout Cookie Monster "import/no-mutable-exports": "off", // We need to this throughout Cookie Monster

View File

@@ -2,18 +2,17 @@ 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: The following is a short description of the various `src` directories and their contents:
| JS | Description | JS | Description
| ------------ | -------------------------------------------------------------------------- | -- | -
| Cache | Functions related to creating and storing data cache | Cache | Functions related to creating and storing data cache
| Config | Functions related to manipulating CM configuration | Config | Functions related to manipulating CM configuration
| Data | Hard coded values | Data | Hard coded values
| Disp | Functions related to displaying CM's UI | Disp | Functions related to displaying CM's UI
| InitSaveLoad | Functions related to registering the CM object with the Game's Modding API | InitSaveLoad | Functions related to registering the CM object with the Game's Modding API
| Main | Functions related to the main loop and initializing CM | Main | Functions related to the main loop and initializing CM
| Sim | Functions related to simulate something | Sim | Functions related to simulate something
These are some additional guidelines: These are some additional guidelines:
- Try to use DOM as much as possible instead of using string manipulation to modify HTML. - 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. - 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 - PR's should target the `dev` branch

View File

@@ -1,53 +0,0 @@
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 Normal file
View File

@@ -0,0 +1,26 @@
---
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!

View File

@@ -1,28 +0,0 @@
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.

View File

@@ -0,0 +1,14 @@
---
name: Feature request
about: Suggest an idea for CookieMonster
title: ''
labels: Enhancement
assignees: ''
---
**Describe the function you'd like to see added to CookieMonster**
A clear and concise description of what you want to happen.
**Additional files**
Add any other files such as save files or screenshots about the feature request here.

View File

@@ -5,7 +5,7 @@
version: 2 version: 2
updates: updates:
- package-ecosystem: 'npm' - package-ecosystem: "npm"
directory: '/' # Location of package manifests directory: "/" # Location of package manifests
schedule: schedule:
interval: 'weekly' interval: "weekly"

View File

@@ -10,34 +10,34 @@ jobs:
Check_linting_test_and_build: Check_linting_test_and_build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
GITHUB_REGISTRY_PAT: ${{ secrets.GITHUB_TOKEN }} GITHUB_REGISTERY_PAT: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
with: with:
node-version: 22 node-version: 12
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
- name: Run ESLint - name: Run ESLint
run: npx eslint run: npx eslint src
- name: Run Mocha tests - name: Run Mocha tests
run: npx mocha run: npx mocha
- name: Check if CookieMonsterDev.js is built correctly - name: Check if CookieMonsterDev.js is built correctly
run: | run: |
npx webpack -o ./tmp --env minimize npx webpack -o ./tmp --env minimize
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
echo '### SUCCESS: CookieMonsterDev is built correctly! ###' echo '### SUCCESS: CookieMonsterDev is built correctly! ###'
else else
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build-dev" after saving all your changes! ###' echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build-dev" after saving all your changes! ###'
exit 1 exit 1
fi fi
- name: Check if CookieMonster.js is built correctly - name: Check if CookieMonster.js is built correctly
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
run: | run: |
npx webpack -o ./tmp --env minimize --env finalfile npx webpack -o ./tmp --env minimize --env finalfile
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
echo '### SUCCESS: CookieMonster is built correctly! ###' echo '### SUCCESS: CookieMonster is built correctly! ###'
else else
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build-final" after saving all your changes! ###' echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build-final" after saving all your changes! ###'
exit 1 exit 1
fi fi

View File

@@ -2,7 +2,7 @@ name: Publish
on: on:
push: push:
branches: branches:
- 'dev' - "dev"
jobs: jobs:
publish-dev: publish-dev:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@@ -1,3 +1,4 @@
{ {
"recursive": true "recursive": true,
"require": ["esm", "ts-node/register"]
} }

2
.npmrc
View File

@@ -1,4 +1,4 @@
always-auth=true always-auth=true
registry=https://registry.npmjs.org/ registry=https://registry.npmjs.org/
@cookiemonsterteam:registry=https://npm.pkg.github.com @cookiemonsterteam:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_REGISTRY_PAT} //npm.pkg.github.com/:_authToken=${GITHUB_REGISTERY_PAT}

View File

@@ -1,12 +0,0 @@
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

View File

@@ -1 +0,0 @@
dist

View File

@@ -1,7 +1,6 @@
// ==UserScript== // ==UserScript==
// @name Cookie Monster // @name Cookie Monster
// @include /https?://orteil.dashnet.org/cookieclicker/ // @include /https?://orteil.dashnet.org/cookieclicker/
// @include /https?://cookieclicker.ee/
// ==/UserScript== // ==/UserScript==
const readyCheck = setInterval(() => { const readyCheck = setInterval(() => {

View File

@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.

View File

@@ -3,7 +3,7 @@
## Cookie Monster ## Cookie Monster
**Cookie Monster** is an addon you can load into Cookie Clicker, that offers a wide range of tools and statistics to enhance the game. **It is not a cheat interface** although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. **Cookie Monster** is an addon you can load into Cookie Clicker, that offers a wide range of tools and statistics to enhance the game. **It is not a cheat interface** although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.
The mod helps you to _whichever_ degree you want, if you only need some help shortening long numbers, it does that. If you need to be accompanied by hand to pick the best buildings to buy, it does that, but **everything is an option**. The mod helps you to *whichever* degree you want, if you only need some help shortening long numbers, it does that. If you need to be accompanied by hand to pick the best buildings to buy, it does that, but **everything is an option**.
### Current version ### Current version
@@ -13,7 +13,7 @@ Github Pages is hosted from the `gh-pages` branch
### What it does ### What it does
At its core, Cookie Monster computes an index for both buildings and upgrades: the **Payback Period (PP)**. 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 ```javascript
max(cost - cookies in bank, 0)/cps + cost/Δ cps max(cost - cookies in bank, 0)/cps + cost/Δ cps
@@ -23,14 +23,14 @@ If the relevant option is enabled, CM will color-code each of them based on thei
<details> <details>
<summary>The following standard colours are used:</summary> <summary>The following standard colours are used:</summary>
- Light Blue: (upgrades) This item has a better PP than the best building to buy * Light Blue: (upgrades) This item has a better PP than the best building to buy
- Green: This building has the best PP * Green: This building has the best PP
- Yellow: This building is within the top 10 of best PP's * Yellow: This building is within the top 10 of best PP's
- Orange: This building is within the top 20 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 * 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 * Purple: This building is worse than the top 10 of best PP's
- Gray: This item does not have a PP, often this means that there is no change to CPS * Gray: This item does not have a PP, often this means that there is no change to CPS
</details> </details>
@@ -45,7 +45,7 @@ Copy this code and save it as a bookmark. Paste it in the URL section. To activa
```javascript ```javascript
javascript: (function () { javascript: (function () {
Game.LoadMod('https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonster.js'); 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. 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. 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 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! Currently we exposes relevant data for buildings and upgrades (PP, colour and bonus income). If you would like us to add any aditional data, please feel free to open an issue or create a PR doing so!
## Contributing ## Contributing
To contribute you can fork and clone the repository and run `npm install`. 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`. 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`.
Please also remember to run `npm run build-dev` after saving all your changes to build the final `CookieMonsterDev.js` file. 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 ## Contributors
- **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author * **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author
- **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer * **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer
- **[BlackenedGem](https://github.com/BlackenedGem)**: Golden/Wrath Cookie Favicons * **[BlackenedGem](https://github.com/BlackenedGem)**: Golden/Wrath Cookie Favicons
- **[Sandworm](https://github.com/svschouw)**: Modified PP calculation * **[Sandworm](https://github.com/svschouw)**: Modified PP calculation
- **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer * **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer
- **[DanielNoord](https://github.com/DanielNoord)**: Current maintainer * **[DanielNoord](https://github.com/DanielNoord)**: Current maintainer
- **[bitsandbytes1708](https://github.com/bitsandbytes1708)**: Current maintainer * **[bitsandbytes1708](https://github.com/bitsandbytes1708)**: Current maintainer

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,59 +0,0 @@
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,
},
],
},
},
];

9445
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@cookiemonsterteam/cookiemonster-mod", "name": "@cookiemonsterteam/cookiemonster-mod",
"version": "2.053.10", "version": "2.031.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.", "description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
"main": "CookieMonster.js", "main": "CookieMonster.js",
"keywords": [ "keywords": [
@@ -14,7 +14,7 @@
"build-dev": "run-s eslint test pack-prod", "build-dev": "run-s eslint test pack-prod",
"build-final": "run-s eslint test pack-final", "build-final": "run-s eslint test pack-final",
"build-test": "webpack", "build-test": "webpack",
"eslint": "eslint", "eslint": "eslint src test",
"pack-prod": "webpack --env minimize", "pack-prod": "webpack --env minimize",
"pack-final": "webpack --env minimize --env finalfile", "pack-final": "webpack --env minimize --env finalfile",
"test": "mocha" "test": "mocha"
@@ -43,6 +43,26 @@
"url": "https://github.com/CookieMonsterTeam/CookieMonster/issues" "url": "https://github.com/CookieMonsterTeam/CookieMonster/issues"
}, },
"homepage": "https://github.com/CookieMonsterTeam/CookieMonster#readme", "homepage": "https://github.com/CookieMonsterTeam/CookieMonster#readme",
"devDependencies": {
"@types/chai": "^4.2.19",
"@types/mocha": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"chai": "^4.3.4",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
"esm": "^3.2.25",
"mocha": "^8.4.0",
"npm-run-all": "^4.1.5",
"prettier": "2.3.2",
"ts-loader": "^9.2.5",
"ts-node": "^10.2.1",
"typescript": "^4.4.2",
"webpack": "^5.51.2",
"webpack-cli": "^4.8.0"
},
"ccrepo": { "ccrepo": {
"icon": [ "icon": [
10, 10,
@@ -50,30 +70,8 @@
], ],
"name": "Cookie Monster" "name": "Cookie Monster"
}, },
"type": "module",
"engines": {
"node": ">=22"
},
"dependencies": { "dependencies": {
"@cookiemonsterteam/cookiemonsterframework": "0.2.3", "@eastdesire/jscolor": "^2.4.5",
"@eastdesire/jscolor": "^2.5.1", "@cookiemonsterteam/cookiemonsterframework": "^0.2.1"
"@eslint/compat": "^1.2.7",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.27.0",
"chai": "^5.2.0",
"eslint": "^9.21.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^10.0.1",
"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"
}
} }
} }

View File

@@ -1,11 +1,11 @@
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData.js'; import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
import { import {
ChoEggDiff, // eslint-disable-line no-unused-vars ChoEggDiff, // eslint-disable-line no-unused-vars
ClicksDiff, // eslint-disable-line no-unused-vars ClicksDiff, // eslint-disable-line no-unused-vars
CookiesDiff, // eslint-disable-line no-unused-vars CookiesDiff, // eslint-disable-line no-unused-vars
WrinkDiff, // eslint-disable-line no-unused-vars WrinkDiff, // eslint-disable-line no-unused-vars
WrinkFattestDiff, // eslint-disable-line no-unused-vars WrinkFattestDiff, // eslint-disable-line no-unused-vars
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* @class * @class

View File

@@ -1,20 +1,19 @@
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData.js'; import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheAverageClicks, CacheAverageClicks, // eslint-disable-line no-unused-vars
CacheAverageCPS, CacheAverageCPS,
CacheAverageGainBank, CacheAverageGainBank,
CacheAverageGainChoEgg, CacheAverageGainChoEgg,
CacheAverageGainWrink, CacheAverageGainWrink,
CacheAverageGainWrinkFattest, CacheAverageGainWrinkFattest,
CacheAvgCPSWithChoEgg, CacheAvgCPSWithChoEgg, // eslint-disable-line no-unused-vars
CacheLastChoEgg, CacheLastChoEgg,
CacheLastClicks, CacheLastClicks,
CacheLastCookies, CacheLastCookies,
CacheLastCPSCheck, CacheLastCPSCheck,
CacheLastWrinkCookies, CacheLastWrinkCookies,
CacheLastWrinkFattestCookies, CacheLastWrinkFattestCookies,
CacheRealCookiesEarned, CacheRealCookiesEarned, // eslint-disable-line no-unused-vars
CacheSellForChoEgg, CacheSellForChoEgg,
CacheWrinklersFattest, CacheWrinklersFattest,
CacheWrinklersTotal, CacheWrinklersTotal,
@@ -23,7 +22,7 @@ import {
CookiesDiff, CookiesDiff,
WrinkDiff, WrinkDiff,
WrinkFattestDiff, WrinkFattestDiff,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This functions caches two variables related average CPS and Clicks * This functions caches two variables related average CPS and Clicks
@@ -89,25 +88,9 @@ export default function CacheAvgCPS() {
CacheAverageGainBank + CacheAverageGainWrink + (choEgg ? CacheAverageGainChoEgg : 0); CacheAverageGainBank + CacheAverageGainWrink + (choEgg ? CacheAverageGainChoEgg : 0);
} else CacheAvgCPSWithChoEgg = CacheAverageCPS; } else CacheAvgCPSWithChoEgg = CacheAverageCPS;
// eslint-disable-next-line no-unused-vars
CacheAverageClicks = ClicksDiff.calcAverage( CacheAverageClicks = ClicksDiff.calcAverage(
ClickTimes[Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist], ClickTimes[Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.AvgClicksHist],
); );
} }
FillCMDCache({
CacheRealCookiesEarned,
CacheLastCPSCheck,
CacheLastCookies,
CacheLastWrinkCookies,
CacheLastWrinkFattestCookies,
CacheLastChoEgg,
CacheLastClicks,
CacheAverageGainBank,
CacheAverageGainWrink,
CacheAverageGainWrinkFattest,
CacheAverageGainChoEgg,
CacheAverageCPS,
CacheAvgCPSWithChoEgg,
CacheAverageClicks,
});
} }

View File

@@ -1,6 +1,5 @@
import { SimObjects } from '../../Sim/VariablesAndData.js'; import { SimObjects } from '../../Sim/VariablesAndData';
import FillCMDCache from '../FillCMDCache.js'; import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData.js';
/** /**
* This functions caches the current Wrinkler CPS multiplier * This functions caches the current Wrinkler CPS multiplier
@@ -27,6 +26,4 @@ export default function CacheCurrWrinklerCPS() {
(Game.Has('Sacrilegious corruption') * 0.05 + 1) * (Game.Has('Sacrilegious corruption') * 0.05 + 1) *
(Game.Has('Wrinklerspawn') * 0.05 + 1) * (Game.Has('Wrinklerspawn') * 0.05 + 1) *
godMult; godMult;
FillCMDCache({ CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult });
} }

View File

@@ -1,6 +1,5 @@
import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc.js'; import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc';
import FillCMDCache from '../FillCMDCache.js'; import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData.js';
/** /**
* This function calculates CPS without the Golden Switch as it might be needed in other functions * This function calculates CPS without the Golden Switch as it might be needed in other functions
@@ -11,6 +10,4 @@ export default function CacheNoGoldSwitchCPS() {
if (Game.Has('Golden switch [off]')) { if (Game.Has('Golden switch [off]')) {
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS(); CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs; } else CacheNoGoldSwitchCookiesPS = Game.cookiesPs;
FillCMDCache({ CacheNoGoldSwitchCookiesPS });
} }

View File

@@ -1,6 +1,5 @@
import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg.js'; import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg';
import FillCMDCache from '../FillCMDCache.js'; import { CacheSellForChoEgg } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
import { CacheSellForChoEgg } from '../VariablesAndData.js';
/** /**
* This functions caches the reward for selling the Chocolate egg * This functions caches the reward for selling the Chocolate egg
@@ -22,6 +21,4 @@ export default function CacheSellAllForChoEgg() {
// Compute cookies earned by selling all buildings with optimal auras (ES + RB) // Compute cookies earned by selling all buildings with optimal auras (ES + RB)
sellTotal += SellBuildingsForChoEgg(); sellTotal += SellBuildingsForChoEgg();
CacheSellForChoEgg = sellTotal; CacheSellForChoEgg = sellTotal;
FillCMDCache({ CacheSellForChoEgg });
} }

View File

@@ -1,17 +1,17 @@
import { ClickTimes } from '../Disp/VariablesAndData.js'; import { ClickTimes } from '../Disp/VariablesAndData';
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue.js'; import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
import CacheAvgCPS from './CPS/CPS.js'; import CacheAvgCPS from './CPS/CPS';
import CacheDragonAuras from './Dragon/CacheDragonAuras.js'; import CacheDragonAuras from './Dragon/CacheDragonAuras';
import CachePP from './PP/PP.js'; import CachePP from './PP/PP';
import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome.js'; import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome';
import { CacheChain } from './Stats/ChainCookies.js'; import { CacheChain } from './Stats/ChainCookies';
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips.js'; import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
import CacheAllMissingUpgrades from './Stats/MissingUpgrades.js'; import CacheAllMissingUpgrades from './Stats/MissingUpgrades';
import CacheSeasonSpec from './Stats/Reindeer.js'; import CacheSeasonSpec from './Stats/Reindeer';
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats.js'; import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats';
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement.js'; import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement';
import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData.js'; // eslint-disable-line no-unused-vars import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData'; // eslint-disable-line no-unused-vars
import CacheWrinklers from './Wrinklers/Wrinklers.js'; import CacheWrinklers from './Wrinklers/Wrinklers';
/** /**
* This functions runs all cache-functions to generate all "full" cache * This functions runs all cache-functions to generate all "full" cache

View File

@@ -1,12 +1,12 @@
import FormatTime from '../Disp/BeautifyAndFormatting/FormatTime.js'; import FormatTime from '../Disp/BeautifyAndFormatting/FormatTime';
import GetCPS from '../Disp/HelperFunctions/GetCPS.js'; import GetCPS from '../Disp/HelperFunctions/GetCPS';
import CacheAvgCPS from './CPS/CPS.js'; import CacheAvgCPS from './CPS/CPS';
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS.js'; import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS';
import CachePP from './PP/PP.js'; import CachePP from './PP/PP';
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips.js'; import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement.js'; import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement';
import { CacheTimeTillNextPrestige } from './VariablesAndData.js'; // eslint-disable-line no-unused-vars import { CacheTimeTillNextPrestige } from './VariablesAndData'; // eslint-disable-line no-unused-vars
import CacheWrinklers from './Wrinklers/Wrinklers.js'; import CacheWrinklers from './Wrinklers/Wrinklers';
/** /**
* This functions caches variables that are needed every loop * This functions caches variables that are needed every loop

View File

@@ -1,4 +1,4 @@
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData.js'; // eslint-disable-line no-unused-vars import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
/** /**
* This functions caches the currently selected Dragon Auras * This functions caches the currently selected Dragon Auras

View File

@@ -1,10 +1,9 @@
/** Functions related to the Dragon */ /** Functions related to the Dragon */
import Beautify from '../../Disp/BeautifyAndFormatting/Beautify.js'; import Beautify from '../../Disp/BeautifyAndFormatting/Beautify';
import CopyData from '../../Sim/SimulationData/CopyData.js'; import CopyData from '../../Sim/SimulationData/CopyData';
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData.js'; import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
import FillCMDCache from '../FillCMDCache.js'; import { CacheCostDragonUpgrade, CacheLastDragonLevel } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
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 * This functions caches the current cost of upgrading the dragon level so it can be displayed in the tooltip
@@ -15,11 +14,7 @@ export default function CacheDragonCost() {
Game.dragonLevel < 25 && Game.dragonLevel < 25 &&
Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice') Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')
) { ) {
const objectMatch = Game.dragonLevels[Game.dragonLevel].buy let target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];
.toString()
.match(/Objects\[(.*)\]/);
let target =
objectMatch !== null ? objectMatch[1] : Game.ObjectsById[Game.dragonLevel - 5].name;
const amount = Game.dragonLevels[Game.dragonLevel].buy const amount = Game.dragonLevels[Game.dragonLevel].buy
.toString() .toString()
.match(/sacrifice\((.*?)\)/)[1]; .match(/sacrifice\((.*?)\)/)[1];
@@ -67,6 +62,4 @@ export default function CacheDragonCost() {
} }
CacheLastDragonLevel = Game.dragonLevel; CacheLastDragonLevel = Game.dragonLevel;
} }
FillCMDCache({ CacheLastDragonLevel });
} }

View File

@@ -1,22 +0,0 @@
/**
* 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]));
}
});
}

View File

@@ -1,16 +1,15 @@
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank.js'; import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
import { ColourGray } from '../../Disp/VariablesAndData.js'; import { ColourGray } from '../../Disp/VariablesAndData';
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheMinPP, CacheMinPP, // eslint-disable-line no-unused-vars
CacheMinPPBulk, CacheMinPPBulk, // eslint-disable-line no-unused-vars
CacheObjects1, CacheObjects1,
CacheObjects10, CacheObjects10,
CacheObjects100, CacheObjects100,
CachePPArray, CachePPArray,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
import ColourOfPP from './ColourOfPP.js'; import ColourOfPP from './ColourOfPP';
/** /**
* This functions caches the buildings of bulk-buy mode when PP is compared against optimal single-purchase building * This functions caches the buildings of bulk-buy mode when PP is compared against optimal single-purchase building
@@ -107,6 +106,4 @@ export default function CacheBuildingsPP() {
CacheColour(CacheObjects1, 1); CacheColour(CacheObjects1, 1);
CacheColour(CacheObjects10, 10); CacheColour(CacheObjects10, 10);
CacheColour(CacheObjects100, 100); CacheColour(CacheObjects100, 100);
FillCMDCache({ CacheMinPP, CacheMinPPBulk, CachePPArray });
} }

View File

@@ -1,4 +1,4 @@
import GetCPS from '../../Disp/HelperFunctions/GetCPS.js'; import GetCPS from '../../Disp/HelperFunctions/GetCPS';
import { import {
ColourBlue, ColourBlue,
ColourGray, ColourGray,
@@ -7,8 +7,8 @@ import {
ColourPurple, ColourPurple,
ColourRed, ColourRed,
ColourYellow, ColourYellow,
} from '../../Disp/VariablesAndData.js'; } from '../../Disp/VariablesAndData';
import { CacheMinPP, CachePPArray } from '../VariablesAndData.js'; import { CacheMinPP, CachePPArray } from '../VariablesAndData';
/** /**
* This functions return the colour assosciated with the given pp value * This functions return the colour assosciated with the given pp value

View File

@@ -1,14 +1,9 @@
/** /**
* Section: Functions related to caching PP */ * Section: Functions related to caching PP */
import { import { CacheObjects1, CacheObjects10, CacheObjects100, CacheUpgrades } from '../VariablesAndData';
CacheObjects1, import CacheBuildingsPP from './Building';
CacheObjects10, import CacheUpgradePP from './Upgrade';
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 * This functions caches the PP of each building and upgrade and stores it in the cache

View File

@@ -1,6 +1,6 @@
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank.js'; import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
import { CacheUpgrades } from '../VariablesAndData.js'; import { CacheUpgrades } from '../VariablesAndData';
import ColourOfPP from './ColourOfPP.js'; import ColourOfPP from './ColourOfPP';
/** /**
* This functions caches the PP of each building it saves all date in CM.Cache.Upgrades * This functions caches the PP of each building it saves all date in CM.Cache.Upgrades

View File

@@ -1,6 +1,5 @@
import CalculateChangeGod from '../../Sim/SimulationEvents/GodChange.js'; import CalculateChangeGod from '../../Sim/SimulationEvents/GodChange';
import FillCMDCache from '../FillCMDCache.js'; import { CacheGods } from '../VariablesAndData';
import { CacheGods } from '../VariablesAndData.js';
/** /**
* This functions caches the cps effect of each God in slot 1, 2 or 3 * This functions caches the cps effect of each God in slot 1, 2 or 3
@@ -11,6 +10,4 @@ export default function CachePantheonGods() {
CacheGods[god][slot] = CalculateChangeGod(god, slot); CacheGods[god][slot] = CalculateChangeGod(god, slot);
} }
} }
FillCMDCache({ CacheGods });
} }

View File

@@ -1,9 +1,8 @@
/** Section: Functions related to caching income */ /** Section: Functions related to caching income */
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome.js'; import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades.js'; import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheAverageGainBank, CacheAverageGainBank,
CacheAverageGainWrink, CacheAverageGainWrink,
@@ -14,7 +13,7 @@ import {
CacheObjects100, CacheObjects100,
CacheObjectsNextAchievement, CacheObjectsNextAchievement,
CacheUpgrades, CacheUpgrades,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This functions starts the calculation/simulation of the bonus income of buildings * This functions starts the calculation/simulation of the bonus income of buildings
@@ -94,8 +93,6 @@ export function CacheBuildingsPrices() {
CacheObjectsNextAchievement[i].AmountNeeded, CacheObjectsNextAchievement[i].AmountNeeded,
); );
}); });
FillCMDCache({ CacheObjectsNextAchievement });
} }
/** /**

View File

@@ -1,23 +1,22 @@
import GetCPSBuffMult from '../CPS/GetCPSBuffMult.js'; import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheChainFrenzyMaxReward, CacheChainFrenzyMaxReward,
CacheChainFrenzyRequired, CacheChainFrenzyRequired, // eslint-disable-line no-unused-vars
CacheChainFrenzyRequiredNext, CacheChainFrenzyRequiredNext, // eslint-disable-line no-unused-vars
CacheChainFrenzyWrathMaxReward, CacheChainFrenzyWrathMaxReward,
CacheChainFrenzyWrathRequired, CacheChainFrenzyWrathRequired, // eslint-disable-line no-unused-vars
CacheChainFrenzyWrathRequiredNext, CacheChainFrenzyWrathRequiredNext, // eslint-disable-line no-unused-vars
CacheChainMaxReward, CacheChainMaxReward,
CacheChainRequired, CacheChainRequired, // eslint-disable-line no-unused-vars
CacheChainRequiredNext, CacheChainRequiredNext, // eslint-disable-line no-unused-vars
CacheChainWrathMaxReward, CacheChainWrathMaxReward,
CacheChainWrathRequired, CacheChainWrathRequired, // eslint-disable-line no-unused-vars
CacheChainWrathRequiredNext, CacheChainWrathRequiredNext, // eslint-disable-line no-unused-vars
CacheDragonsFortuneMultAdjustment, CacheDragonsFortuneMultAdjustment,
CacheGoldenCookiesMult, CacheGoldenCookiesMult,
CacheNoGoldSwitchCookiesPS, CacheNoGoldSwitchCookiesPS,
CacheWrathCookiesMult, CacheWrathCookiesMult,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This functions calculates the max possible payout given a set of variables * This functions calculates the max possible payout given a set of variables
@@ -90,19 +89,4 @@ export function CacheChain() {
CacheChainFrenzyWrathRequired = (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult; CacheChainFrenzyWrathRequired = (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
CacheChainFrenzyWrathRequiredNext = CacheChainFrenzyWrathRequiredNext =
CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment; CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
FillCMDCache({
CacheChainMaxReward,
CacheChainRequired,
CacheChainRequiredNext,
CacheChainWrathMaxReward,
CacheChainWrathRequired,
CacheChainWrathRequiredNext,
CacheChainFrenzyMaxReward,
CacheChainFrenzyRequired,
CacheChainFrenzyRequiredNext,
CacheChainFrenzyWrathMaxReward,
CacheChainFrenzyWrathRequired,
CacheChainFrenzyWrathRequiredNext,
});
} }

View File

@@ -1,10 +1,9 @@
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheHCPerSecond, CacheHCPerSecond, // eslint-disable-line no-unused-vars
CacheLastHeavenlyCheck, CacheLastHeavenlyCheck,
CacheLastHeavenlyChips, CacheLastHeavenlyChips,
HeavenlyChipsDiff, HeavenlyChipsDiff,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This functions caches the heavenly chips per second in the last five seconds * This functions caches the heavenly chips per second in the last five seconds
@@ -33,6 +32,4 @@ export default function CacheHeavenlyChipsPS() {
// Get average gain over period of 5 seconds // Get average gain over period of 5 seconds
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5); CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5);
} }
FillCMDCache({ CacheLastHeavenlyCheck, CacheLastHeavenlyChips, CacheHCPerSecond });
} }

View File

@@ -1,9 +1,9 @@
import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades.js'; import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades';
import { import {
CacheMissingUpgrades, // eslint-disable-line no-unused-vars CacheMissingUpgrades, // eslint-disable-line no-unused-vars
CacheMissingUpgradesCookies, // eslint-disable-line no-unused-vars CacheMissingUpgradesCookies, // eslint-disable-line no-unused-vars
CacheMissingUpgradesPrestige, // eslint-disable-line no-unused-vars CacheMissingUpgradesPrestige, // eslint-disable-line no-unused-vars
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This functions caches variables related to missing upgrades * This functions caches variables related to missing upgrades
@@ -35,10 +35,12 @@ export default function CacheAllMissingUpgrades() {
let str = ''; let str = '';
str += crateMissing(me); str += crateMissing(me);
/* eslint-disable no-unused-vars */
if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str; if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str;
else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str; else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str;
else if (me.pool !== 'toggle' && me.pool !== 'unused' && me.pool !== 'debug') else if (me.pool !== 'toggle' && me.pool !== 'unused' && me.pool !== 'debug')
CacheMissingUpgrades += str; CacheMissingUpgrades += str;
/* eslint-enable no-unused-vars */
} }
}); });
} }

View File

@@ -1,5 +1,4 @@
import FillCMDCache from '../FillCMDCache.js'; import { CacheSeaSpec } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
import { CacheSeaSpec } from '../VariablesAndData.js';
/** /**
* This functions caches the reward of popping a reindeer * This functions caches the reward of popping a reindeer
@@ -14,6 +13,4 @@ export default function CacheSeasonSpec() {
CacheSeaSpec = Math.max(25, val); CacheSeaSpec = Math.max(25, val);
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2; if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2;
} }
FillCMDCache({ CacheSeaSpec });
} }

View File

@@ -1,24 +1,23 @@
/** Functions related to Caching stats */ /** Functions related to Caching stats */
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas.js'; import SimHas from '../../Sim/ReplacedGameFunctions/SimHas';
import GetCPSBuffMult from '../CPS/GetCPSBuffMult.js'; import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheConjure, CacheConjure,
CacheConjureReward, CacheConjureReward, // eslint-disable-line no-unused-vars
CacheDragonsFortuneMultAdjustment, CacheDragonsFortuneMultAdjustment,
CacheEdifice, CacheEdifice,
CacheEdificeBuilding, CacheEdificeBuilding, // eslint-disable-line no-unused-vars
CacheGoldenCookiesMult, CacheGoldenCookiesMult,
CacheLucky, CacheLucky,
CacheLuckyFrenzy, CacheLuckyFrenzy,
CacheLuckyReward, CacheLuckyReward, // eslint-disable-line no-unused-vars
CacheLuckyRewardFrenzy, CacheLuckyRewardFrenzy, // eslint-disable-line no-unused-vars
CacheLuckyWrathReward, CacheLuckyWrathReward, // eslint-disable-line no-unused-vars
CacheLuckyWrathRewardFrenzy, CacheLuckyWrathRewardFrenzy, // eslint-disable-line no-unused-vars
CacheNoGoldSwitchCookiesPS, CacheNoGoldSwitchCookiesPS,
CacheWrathCookiesMult, CacheWrathCookiesMult,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This functions caches variables related to the stats page * This functions caches variables related to the stats page
@@ -54,19 +53,6 @@ export function CacheStatsCookies() {
CacheEdificeBuilding = i; CacheEdificeBuilding = i;
} }
}); });
FillCMDCache({
CacheLucky,
CacheLuckyReward,
CacheLuckyWrathReward,
CacheLuckyFrenzy,
CacheLuckyRewardFrenzy,
CacheLuckyWrathRewardFrenzy,
CacheConjure,
CacheConjureReward,
CacheEdifice,
CacheEdificeBuilding,
});
} }
/** /**
@@ -98,10 +84,4 @@ export function CacheGoldenAndWrathCookiesMults() {
if (Game.shimmerTypes.golden.n === 0) { if (Game.shimmerTypes.golden.n === 0) {
CacheDragonsFortuneMultAdjustment *= 1 + Game.auraMult("Dragon's Fortune") * 1.23; CacheDragonsFortuneMultAdjustment *= 1 + Game.auraMult("Dragon's Fortune") * 1.23;
} }
FillCMDCache({
CacheGoldenCookiesMult,
CacheWrathCookiesMult,
CacheDragonsFortuneMultAdjustment,
});
} }

View File

@@ -1,7 +1,6 @@
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
import FillCMDCache from '../FillCMDCache.js'; import { CacheObjectsNextAchievement } from '../VariablesAndData';
import { CacheObjectsNextAchievement } from '../VariablesAndData.js'; import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement';
import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement.js';
/** /**
* This functions caches the amount of buildings needed till next achievement * This functions caches the amount of buildings needed till next achievement
@@ -42,7 +41,5 @@ export default function AllAmountTillNextAchievement(forceRecalc) {
}; };
} }
}); });
CacheObjectsNextAchievement = result; CacheObjectsNextAchievement = result; // eslint-disable-line no-unused-vars
FillCMDCache({ CacheObjectsNextAchievement });
} }

View File

@@ -1,5 +1,5 @@
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome.js'; import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
import { SimAchievementsOwned } from '../../Sim/VariablesAndData.js'; import { SimAchievementsOwned } from '../../Sim/VariablesAndData';
export default function IndividualAmountTillNextAchievement(building) { export default function IndividualAmountTillNextAchievement(building) {
const AchievementsAtStart = Game.AchievementsOwned; const AchievementsAtStart = Game.AchievementsOwned;

View File

@@ -1,12 +1,11 @@
/** Caches data related to Wrinklers */ /** Caches data related to Wrinklers */
import { SimObjects } from '../../Sim/VariablesAndData.js'; import { SimObjects } from '../../Sim/VariablesAndData';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheWrinklersFattest, CacheWrinklersFattest,
CacheWrinklersNormal, CacheWrinklersNormal, // eslint-disable-line no-unused-vars
CacheWrinklersTotal, CacheWrinklersTotal, // eslint-disable-line no-unused-vars
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This functions caches data related to Wrinklers * This functions caches data related to Wrinklers
@@ -38,6 +37,4 @@ export default function CacheWrinklers() {
if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i]; if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i];
} }
} }
FillCMDCache({ CacheWrinklersTotal, CacheWrinklersNormal, CacheWrinklersFattest });
} }

View File

@@ -10,7 +10,6 @@ function CheckNotificationPermissions(ToggleOnOff) {
const checkNotificationPromise = function () { const checkNotificationPromise = function () {
try { try {
Notification.requestPermission().then(); Notification.requestPermission().then();
// eslint-disable-next-line no-unused-vars
} catch (e) { } catch (e) {
return false; return false;
} }

View File

@@ -1,6 +1,6 @@
/** Called by the "func" of individual settings */ /** Called by the "func" of individual settings */
import UpdateBackground from '../Disp/HelperFunctions/UpdateBackground.js'; import UpdateBackground from '../Disp/HelperFunctions/UpdateBackground';
/** /**
* This function changes the position of both the bottom and timer bar * This function changes the position of both the bottom and timer bar

View File

@@ -1,4 +1,4 @@
import { saveAndLoadingFunctions } from '@cookiemonsterteam/cookiemonsterframework/src/index.js'; import { saveAndLoadingFunctions } from '@cookiemonsterteam/cookiemonsterframework/src/index';
/** Functions related to toggling or changing an individual setting */ /** Functions related to toggling or changing an individual setting */

View File

@@ -1,5 +1,5 @@
import { UpdateBotBar } from '../../Disp/InfoBars/BottomBar.js'; import { UpdateBotBar } from '../../Disp/InfoBars/BottomBar';
import { UpdateBotTimerBarPosition } from '../SpecificToggles.js'; import { UpdateBotTimerBarPosition } from '../SpecificToggles';
/** /**
* This function toggle the bottom bar * This function toggle the bottom bar

View File

@@ -1,5 +1,5 @@
import { CMSayTime } from '../../Disp/VariablesAndData.js'; import { CMSayTime } from '../../Disp/VariablesAndData';
import { BackupFunctions } from '../../Main/VariablesAndData.js'; import { BackupFunctions } from '../../Main/VariablesAndData';
/** /**
* This function changes some of the time-displays in the game to be more detailed * This function changes some of the time-displays in the game to be more detailed

View File

@@ -1,5 +1,5 @@
import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData.js'; import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
import { GCTimers } from '../../Disp/VariablesAndData.js'; import { GCTimers } from '../../Disp/VariablesAndData';
/** /**
* This function toggles GC Timers are visible * This function toggles GC Timers are visible

View File

@@ -1,4 +1,4 @@
import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades.js'; import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades';
/** /**
* This function toggles the upgrade bar and the colours of upgrades * This function toggles the upgrade bar and the colours of upgrades

View File

@@ -1,6 +1,6 @@
import init from './InitSaveLoad/init.js'; import init from './InitSaveLoad/init';
import load from './InitSaveLoad/load.js'; import load from './InitSaveLoad/load';
import save from './InitSaveLoad/save.js'; import save from './InitSaveLoad/save';
const CM = { const CM = {
init, init,
@@ -8,16 +8,8 @@ const CM = {
save, save,
}; };
if (typeof Steam !== 'undefined') { Game.registerMod('CookieMonster', CM);
// Need to add a delay for steam
setTimeout(() => {
Game.registerMod('CookieMonster', CM);
// Game.registerMod also calls CM.load() which calls the loop hook // 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 // Thus sounds normally play at start up as Season and Garden states are checked
window.cookieMonsterFrameworkData.isInitializing = false; window.cookieMonsterFrameworkData.isInitializing = false;
}, 2000);
} else {
Game.registerMod('CookieMonster', CM);
window.cookieMonsterFrameworkData.isInitializing = false;
}

View File

@@ -1,7 +1,7 @@
/** Data copied directly from the game */ /** Data copied directly from the game */
/** Array of the names of all fortune cookies obtainable from the ticker */ /** Array of the names of all fortune cookies obtainable from the ticker */
export const Fortunes = [ export const Fortunes: string[] = [
'Fortune #001', 'Fortune #001',
'Fortune #002', 'Fortune #002',
'Fortune #003', 'Fortune #003',
@@ -20,8 +20,6 @@ export const Fortunes = [
'Fortune #016', 'Fortune #016',
'Fortune #017', 'Fortune #017',
'Fortune #018', 'Fortune #018',
'Fortune #019',
'Fortune #020',
'Fortune #100', 'Fortune #100',
'Fortune #101', 'Fortune #101',
'Fortune #102', 'Fortune #102',
@@ -30,7 +28,7 @@ export const Fortunes = [
]; ];
/** Array of the names of all Halloween cookies */ /** Array of the names of all Halloween cookies */
export const HalloCookies = [ export const HalloCookies: string[] = [
'Skull cookies', 'Skull cookies',
'Ghost cookies', 'Ghost cookies',
'Bat cookies', 'Bat cookies',
@@ -41,7 +39,7 @@ export const HalloCookies = [
]; ];
/** Array of the names of all Christmas cookies */ /** Array of the names of all Christmas cookies */
export const ChristCookies = [ export const ChristCookies: string[] = [
'Christmas tree biscuits', 'Christmas tree biscuits',
'Snowflake biscuits', 'Snowflake biscuits',
'Snowman biscuits', 'Snowman biscuits',
@@ -52,7 +50,7 @@ export const ChristCookies = [
]; ];
/** Array of the names of all Valentine cookies */ /** Array of the names of all Valentine cookies */
export const ValCookies = [ export const ValCookies: string[] = [
'Pure heart biscuits', 'Pure heart biscuits',
'Ardent heart biscuits', 'Ardent heart biscuits',
'Sour heart biscuits', 'Sour heart biscuits',
@@ -63,7 +61,7 @@ export const ValCookies = [
]; ];
/** Array of the names of all plant drops */ /** Array of the names of all plant drops */
export const PlantDrops = [ export const PlantDrops: string[] = [
'Elderwort biscuits', 'Elderwort biscuits',
'Bakeberry cookies', 'Bakeberry cookies',
'Duketater cookies', 'Duketater cookies',
@@ -74,7 +72,7 @@ export const PlantDrops = [
]; ];
/** All possible effects plants and other items can have with a display-title */ /** All possible effects plants and other items can have with a display-title */
export const Effects = { export const Effects: { [index: string]: string } = {
buildingCost: 'Building prices', buildingCost: 'Building prices',
click: 'Cookies per click', click: 'Cookies per click',
cps: 'Total CPS', cps: 'Total CPS',

View File

@@ -1,21 +0,0 @@
/** 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>`;

25
src/Data/Moddata.ts Normal file
View File

@@ -0,0 +1,25 @@
/** 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>`;

View File

@@ -1,10 +1,10 @@
/** Data related directly to the scales used by Cookie Monster */ /** Data related directly to the scales used by Cookie Monster */
/** Array of abbreviations used in the "Metric" scale */ /** Array of abbreviations used in the "Metric" scale */
export const metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']; export const metric: string[] = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
/** Array of abbreviations used in the "Short" scale */ /** Array of abbreviations used in the "Short" scale */
export const shortScale = [ export const shortScale: string[] = [
'', '',
'', '',
'M', 'M',
@@ -34,7 +34,7 @@ export const shortScale = [
]; ];
/** Array of abbreviations used in the "Abbreviated Short" scale */ /** Array of abbreviations used in the "Abbreviated Short" scale */
export const shortScaleAbbreviated = [ export const shortScaleAbbreviated: string[] = [
'', '',
'K', 'K',
'M', 'M',

View File

@@ -1,7 +1,7 @@
/** Data related to the display titles of certain sections in menu screens */ /** Data related to the display titles of certain sections in menu screens */
/** Display titles of the headers of the Cookie Monster settings section */ /** Display titles of the headers of the Cookie Monster settings section */
export const ConfigGroups = { export const ConfigGroups: { [index: string]: string } = {
Favourite: 'Favourite Settings', Favourite: 'Favourite Settings',
Calculation: 'Calculation', Calculation: 'Calculation',
Notation: 'Notation', Notation: 'Notation',
@@ -14,7 +14,7 @@ export const ConfigGroups = {
}; };
/** Display titles of the headers of the notification section of the Cookie Monster settings */ /** Display titles of the headers of the notification section of the Cookie Monster settings */
export const ConfigGroupsNotification = { export const ConfigGroupsNotification: { [index: string]: string } = {
NotificationGeneral: 'General Notifications', NotificationGeneral: 'General Notifications',
NotificationGC: 'Golden Cookie', NotificationGC: 'Golden Cookie',
NotificationFC: 'Fortune Cookie', NotificationFC: 'Fortune Cookie',

View File

@@ -1,21 +1,21 @@
import { settingClasses } from '@cookiemonsterteam/cookiemonsterframework/src/index.js'; import { settingClasses } from '@cookiemonsterteam/cookiemonsterframework/src/index';
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions.js'; import CheckNotificationPermissions from '../Config/CheckNotificationPermissions';
import RefreshScale from '../Disp/HelperFunctions/RefreshScale.js'; import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
import { SimDoSims } from '../Sim/VariablesAndData.js'; // eslint-disable-line no-unused-vars import { SimDoSims } from '../Sim/VariablesAndData'; // eslint-disable-line no-unused-vars
import ToggleBotBar from '../Config/Toggles/ToggleBotBar.js'; import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime.js'; import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer.js'; import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons.js'; import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons';
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos.js'; import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour.js'; import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour';
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos.js'; import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons.js'; import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings.js'; import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon.js'; import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight.js'; import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight';
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades.js'; import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles.js'; import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
/** This includes all options of CookieMonster and their relevant data */ /** This includes all options of CookieMonster and their relevant data */
const settings = { const settings = {
@@ -129,7 +129,7 @@ const settings = {
0, 0,
'bool', 'bool',
'Notation', 'Notation',
['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX', 'Time XXx, XXx'], ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'],
'Change the time format', 'Change the time format',
false, false,
), ),
@@ -549,14 +549,6 @@ const settings = {
'Shows a tooltip for plants that have a cookie reward.', 'Shows a tooltip for plants that have a cookie reward.',
true, 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( TooltipPantheon: new settingClasses.SettingStandard(
1, 1,
'bool', 'bool',

View File

@@ -1,7 +1,7 @@
/** General functions to format or beautify strings */ /** General functions to format or beautify strings */
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.js'; import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.ts';
import { BackupFunctions } from '../../Main/VariablesAndData.js'; import { BackupFunctions } from '../../Main/VariablesAndData';
/** /**
* This function returns formats number based on the Scale setting * This function returns formats number based on the Scale setting

View File

@@ -5,7 +5,6 @@
* @returns {string} Formatted time * @returns {string} Formatted time
*/ */
export default function FormatTime(time, longFormat) { export default function FormatTime(time, longFormat) {
/* eslint-disable no-nested-ternary */
let formattedTime = time; let formattedTime = time;
if (time === Infinity) return time; if (time === Infinity) return time;
if (time < 0) return 'Negative time period'; if (time < 0) return 'Negative time period';
@@ -16,18 +15,7 @@ export default function FormatTime(time, longFormat) {
const m = Math.floor((((formattedTime % 31536000) % 86400) % 3600) / 60); const m = Math.floor((((formattedTime % 31536000) % 86400) % 3600) / 60);
const s = Math.floor((((formattedTime % 31536000) % 86400) % 3600) % 60); const s = Math.floor((((formattedTime % 31536000) % 86400) % 3600) % 60);
let str = ''; 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'; if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
str += `${(y < 10 ? '0' : '') + y}:`; str += `${(y < 10 ? '0' : '') + y}:`;
str += `${(d < 10 ? '0' : '') + d}:`; str += `${(d < 10 ? '0' : '') + d}:`;
@@ -35,23 +23,18 @@ export default function FormatTime(time, longFormat) {
str += `${(m < 10 ? '0' : '') + m}:`; str += `${(m < 10 ? '0' : '') + m}:`;
str += (s < 10 ? '0' : '') + s; str += (s < 10 ? '0' : '') + s;
} else { } else {
// Similar to TimeFormat === 0, but only two most significant components are included.
if (formattedTime > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d'; if (formattedTime > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
if (y > 0) { str +=
str += `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, `; y > 0
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}`; ? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary
} else if (d > 0) { : '';
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `; if (str.length > 0 || d > 0)
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}`; str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `; // eslint-disable-line no-nested-ternary
} else if (h > 0) { if (str.length > 0 || h > 0)
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; // eslint-disable-line no-nested-ternary
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}`; if (str.length > 0 || m > 0)
} else if (m > 0) { str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; // eslint-disable-line no-nested-ternary
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's'); // eslint-disable-line no-nested-ternary
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
} else {
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
}
} }
return str; return str;
} }

View File

@@ -1,5 +1,5 @@
import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData.js'; import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData';
import FormatTime from './FormatTime.js'; import FormatTime from './FormatTime';
/** /**
* This function returns the colour to be used for time-strings * This function returns the colour to be used for time-strings
@@ -10,7 +10,7 @@ export default function GetTimeColour(time) {
let colour; let colour;
let text; let text;
if (time <= 0) { if (time <= 0) {
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat === 1) if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat)
text = '00:00:00:00:00'; text = '00:00:00:00:00';
else text = 'Done!'; else text = 'Done!';
colour = ColourGreen; colour = ColourGreen;

View File

@@ -4,10 +4,10 @@ import {
CacheObjects10, CacheObjects10,
CacheObjects100, CacheObjects100,
CacheObjectsNextAchievement, CacheObjectsNextAchievement,
} from '../../Cache/VariablesAndData.js'; } from '../../Cache/VariablesAndData';
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding.js'; import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
import Beautify from '../BeautifyAndFormatting/Beautify.js'; import Beautify from '../BeautifyAndFormatting/Beautify';
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData.js'; import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData';
/** /**
* Section: Functions related to right column of the screen (buildings/upgrades) * Section: Functions related to right column of the screen (buildings/upgrades)

View File

@@ -8,7 +8,7 @@ import {
ColourRed, ColourRed,
ColourTextPre, ColourTextPre,
ColourYellow, ColourYellow,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This function creates the legend for the upgrade bar * This function creates the legend for the upgrade bar

View File

@@ -1,4 +1,4 @@
import { CacheUpgrades } from '../../Cache/VariablesAndData.js'; import { CacheUpgrades } from '../../Cache/VariablesAndData';
import { import {
ColourBackPre, ColourBackPre,
ColourBlue, ColourBlue,
@@ -9,7 +9,7 @@ import {
ColourRed, ColourRed,
ColoursOrdering, ColoursOrdering,
ColourYellow, ColourYellow,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This function adjusts some things in the upgrades section * This function adjusts some things in the upgrades section

View File

@@ -1,10 +1,10 @@
/** Functions related to the Dragon */ /** Functions related to the Dragon */
import CacheDragonCost from '../../Cache/Dragon/Dragon.js'; import CacheDragonCost from '../../Cache/Dragon/Dragon';
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData.js'; import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData';
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange.js'; import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange';
import Beautify from '../BeautifyAndFormatting/Beautify.js'; import Beautify from '../BeautifyAndFormatting/Beautify';
import FormatTime from '../BeautifyAndFormatting/FormatTime.js'; import FormatTime from '../BeautifyAndFormatting/FormatTime';
/** /**
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen * This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen

View File

@@ -1,12 +1,13 @@
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons.js'; import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
import UpdateBuildings from './BuildingsUpgrades/Buildings.js'; import Beautify from './BeautifyAndFormatting/Beautify';
import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight.js'; import UpdateBuildings from './BuildingsUpgrades/Buildings';
import UpdateUpgrades from './BuildingsUpgrades/Upgrades.js'; import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight';
import { UpdateBotBar } from './InfoBars/BottomBar.js'; import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
import { UpdateTimerBar } from './InfoBars/TimerBar.js'; import { UpdateBotBar } from './InfoBars/BottomBar';
import RefreshMenu from './MenuSections/Refreshmenu.js'; import { UpdateTimerBar } from './InfoBars/TimerBar';
import UpdateTooltips from './Tooltips/UpdateTooltips.js'; import RefreshMenu from './MenuSections/Refreshmenu';
import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips.js'; import UpdateTooltips from './Tooltips/UpdateTooltips';
import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips';
/** /**
* This function handles all custom drawing for the Game.Draw() function. * This function handles all custom drawing for the Game.Draw() function.
@@ -49,4 +50,11 @@ export default function CMDrawHook() {
// Update display of wrinkler buttons, this checks if Elder Pledge has been bought and if they should be disabled // Update display of wrinkler buttons, this checks if Elder Pledge has been bought and if they should be disabled
ToggleWrinklerButtons(); 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;
}
} }

View File

@@ -1,6 +1,6 @@
/** Section: Functions related to the Golden Cookie Timers */ /** Section: Functions related to the Golden Cookie Timers */
import { GCTimers } from '../VariablesAndData.js'; import { GCTimers } from '../VariablesAndData';
/** /**
* This function creates a new Golden Cookie Timer and appends it CM.Disp.GCTimers based on the id of the cookie * This function creates a new Golden Cookie Timer and appends it CM.Disp.GCTimers based on the id of the cookie

View File

@@ -1,104 +0,0 @@
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;
}

View File

@@ -1,52 +0,0 @@
/**
* 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);
}

View File

@@ -3,7 +3,7 @@ import {
CacheCurrWrinklerCount, CacheCurrWrinklerCount,
CacheCurrWrinklerCPSMult, CacheCurrWrinklerCPSMult,
CacheWrinklersFattest, CacheWrinklersFattest,
} from '../../Cache/VariablesAndData.js'; } from '../../Cache/VariablesAndData';
/** /**
* This function returns the cps as either current or average CPS depending on CM.Options.CPSMode * This function returns the cps as either current or average CPS depending on CM.Options.CPSMode

View File

@@ -5,7 +5,7 @@ import {
ColourPurple, ColourPurple,
ColourRed, ColourRed,
ColourYellow, ColourYellow,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This function returns Name and Colour as object for sugar lump type that is given as input param. * This function returns Name and Colour as object for sugar lump type that is given as input param.

View File

@@ -1,4 +1,4 @@
import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData.js'; import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData';
/** /**
* This function returns the total amount stored in the Wrinkler Bank * This function returns the total amount stored in the Wrinkler Bank

View File

@@ -1,6 +1,6 @@
import UpdateBuildings from '../BuildingsUpgrades/Buildings.js'; import UpdateBuildings from '../BuildingsUpgrades/Buildings';
import UpdateUpgrades from '../BuildingsUpgrades/Upgrades.js'; import UpdateUpgrades from '../BuildingsUpgrades/Upgrades';
import { UpdateBotBar } from '../InfoBars/BottomBar.js'; import { UpdateBotBar } from '../InfoBars/BottomBar';
/** /**
* This function refreshes all numbers after a change in scale-setting * This function refreshes all numbers after a change in scale-setting

View File

@@ -1,7 +1,7 @@
import { ToggleTimerBar } from '../../Config/SpecificToggles.js'; import { ToggleTimerBar } from '../../Config/SpecificToggles';
import ToggleBotBar from '../../Config/Toggles/ToggleBotBar.js'; import ToggleBotBar from '../../Config/Toggles/ToggleBotBar';
import UpdateBackground from './UpdateBackground.js'; import UpdateBackground from './UpdateBackground';
/** /**
* This function disables and shows the bars created by CookieMonster when the game is "ascending" * This function disables and shows the bars created by CookieMonster when the game is "ascending"

View File

@@ -1,10 +1,10 @@
import UpdateBuildings from '../BuildingsUpgrades/Buildings.js'; import UpdateBuildings from '../BuildingsUpgrades/Buildings';
import { import {
ColourBackPre, ColourBackPre,
ColourBorderPre, ColourBorderPre,
ColoursOrdering, ColoursOrdering,
ColourTextPre, ColourTextPre,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** /**
* This function changes/refreshes colours if the user has set new standard colours * This function changes/refreshes colours if the user has set new standard colours

View File

@@ -1,15 +1,15 @@
/** Functions related to the Bottom Bar */ /** Functions related to the Bottom Bar */
import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData.js'; import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData';
import { VersionMajor, VersionMinor } from '../../Data/Moddata.js'; import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts';
import Beautify from '../BeautifyAndFormatting/Beautify.js'; import Beautify from '../BeautifyAndFormatting/Beautify';
import FormatTime from '../BeautifyAndFormatting/FormatTime.js'; import FormatTime from '../BeautifyAndFormatting/FormatTime';
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour.js'; import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour';
import GetCPS from '../HelperFunctions/GetCPS.js'; import GetCPS from '../HelperFunctions/GetCPS';
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank.js'; import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
import { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData.js'; import { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData';
import { CreateBotBarBuildingColumn } from './CreateDOMElements.js'; import { CreateBotBarBuildingColumn } from './CreateDOMElements';
/** /**
* This function creates the bottom bar and appends it to l('wrapper') * This function creates the bottom bar and appends it to l('wrapper')
@@ -98,8 +98,9 @@ export function UpdateBotBar() {
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].className = l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].className =
ColourTextPre + timeColour.colour; ColourTextPre + timeColour.colour;
if (timeColour.text === 'Done!' && Game.cookies < Game.Objects[i].bulkPrice) { if (timeColour.text === 'Done!' && Game.cookies < Game.Objects[i].bulkPrice) {
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent = l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
`${timeColour.text} (with Wrink)`; count
].textContent = `${timeColour.text} (with Wrink)`;
} else } else
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent = l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent =
timeColour.text; timeColour.text;

View File

@@ -1,6 +1,6 @@
/** Functions to create various DOM elements used by the Bars */ /** Functions to create various DOM elements used by the Bars */
import { ColourBackPre, ColourBlue, ColourTextPre } from '../VariablesAndData.js'; import { ColourBackPre, ColourBlue, ColourTextPre } from '../VariablesAndData';
/** /**
* This function creates an indivudual timer for the timer bar * This function creates an indivudual timer for the timer bar

View File

@@ -1,6 +1,6 @@
/** Functions related to the Timer Bar */ /** Functions related to the Timer Bar */
import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles.js'; import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles';
import { import {
BuffColours, BuffColours,
ColourBackPre, ColourBackPre,
@@ -8,9 +8,8 @@ import {
ColourOrange, ColourOrange,
ColourPurple, ColourPurple,
LastNumberOfTimers, LastNumberOfTimers,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
import { CreateTimer } from './CreateDOMElements.js'; import { CreateTimer } from './CreateDOMElements';
import { updateChanceTotal, updateChanceTotalDeer } from '../../Main/CheckStates/Probability.js';
/** /**
* This function creates the TimerBar and appends it to l('wrapper') * This function creates the TimerBar and appends it to l('wrapper')
@@ -125,18 +124,11 @@ export function UpdateTimerBar() {
(Game.shimmerTypes.golden.time - Game.shimmerTypes.golden.minTime) / (Game.shimmerTypes.golden.time - Game.shimmerTypes.golden.minTime) /
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime), (Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime),
) ** 5; ) ** 5;
const finalChance = updateChanceTotal(chanceToSpawn);
l('CMTimerBarGCTime').textContent = `${Math.ceil( l('CMTimerBarGCTime').textContent = `${Math.ceil(
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps, (Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps,
)} `; )} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
if (finalChance < 0.01) { style: 'percent',
l('CMTimerBarGCTime').textContent += })}`;
`<${(0.01).toLocaleString('en', { style: 'percent' })}`;
} else {
l('CMTimerBarGCTime').textContent += finalChance.toLocaleString('en', {
style: 'percent',
});
}
numberOfTimers += 1; numberOfTimers += 1;
} else l('CMTimerBarGC').style.display = 'none'; } else l('CMTimerBarGC').style.display = 'none';
@@ -175,18 +167,11 @@ export function UpdateTimerBar() {
(Game.shimmerTypes.reindeer.time - Game.shimmerTypes.reindeer.minTime) / (Game.shimmerTypes.reindeer.time - Game.shimmerTypes.reindeer.minTime) /
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime), (Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime),
) ** 5; ) ** 5;
const deerFinalChance = updateChanceTotalDeer(chanceToSpawn);
l('CMTimerBarRenTime').textContent = `${Math.ceil( l('CMTimerBarRenTime').textContent = `${Math.ceil(
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps, (Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps,
)} `; )} ${chanceToSpawn < 0.01 ? '<' : ''}${chanceToSpawn.toLocaleString('en', {
if (deerFinalChance < 0.01) { style: 'percent',
l('CMTimerBarRenTime').textContent += })}`;
`<${(0.01).toLocaleString('en', { style: 'percent' })}`;
} else {
l('CMTimerBarRenTime').textContent += deerFinalChance.toLocaleString('en', {
style: 'percent',
});
}
numberOfTimers += 1; numberOfTimers += 1;
} else { } else {
l('CMTimerBarRen').style.display = 'none'; l('CMTimerBarRen').style.display = 'none';

View File

@@ -1,6 +1,6 @@
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData.js'; import { CacheWrinklersFattest } from '../../Cache/VariablesAndData';
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers.js'; import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
import { CreateTooltip } from '../Tooltips/Tooltip.js'; import { CreateTooltip } from '../Tooltips/Tooltip';
/** /**
* This function creates two objects at the bottom of the left column that allowing popping of wrinklers * This function creates two objects at the bottom of the left column that allowing popping of wrinklers

View File

@@ -1,4 +1,4 @@
import { DispCSS } from '../VariablesAndData.js'; import { DispCSS } from '../VariablesAndData';
/** /**
* This function creates a CSS style that stores certain standard CSS classes used by CookieMonster * This function creates a CSS style that stores certain standard CSS classes used by CookieMonster

View File

@@ -1,5 +1,4 @@
import createMenuOptions from './createMenuOptions.js'; import AddMenuStats from './Statistics/AddStatsPage';
import AddMenuStats from './Statistics/AddStatsPage.js';
/** /**
* This function adds the calll the functions to add extra info to the stats and options pages * This function adds the calll the functions to add extra info to the stats and options pages
@@ -13,11 +12,5 @@ export default function AddMenu() {
title.textContent = 'Cookie Monster Statistics'; title.textContent = 'Cookie Monster Statistics';
AddMenuStats(title); 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],
);
} }
} }

View File

@@ -1,9 +1,9 @@
/** Main function to create the sections of Cookie Monster on the Statistics page */ /** Main function to create the sections of Cookie Monster on the Statistics page */
import { AddMissingUpgrades } from './CreateMissingUpgrades.js'; import { AddMissingUpgrades } from './CreateMissingUpgrades';
import * as CreateSections from './CreateStatsSections.js'; import * as CreateSections from './CreateStatsSections';
import * as CreateElements from './CreateDOMElements.js'; import * as CreateElements from './CreateDOMElements';
import * as GameData from '../../../Data/Gamedata.js'; import * as GameData from '../../../Data/Gamedata.ts';
import { import {
CacheAverageClicks, CacheAverageClicks,
@@ -12,12 +12,12 @@ import {
CacheWrinklersFattest, CacheWrinklersFattest,
CacheWrinklersNormal, CacheWrinklersNormal,
CacheWrinklersTotal, CacheWrinklersTotal,
} from '../../../Cache/VariablesAndData.js'; } from '../../../Cache/VariablesAndData';
import PopAllNormalWrinklers from '../../HelperFunctions/PopWrinklers.js'; import PopAllNormalWrinklers from '../../HelperFunctions/PopWrinklers';
import { ClickTimes, CookieTimes } from '../../VariablesAndData.js'; import { ClickTimes, CookieTimes } from '../../VariablesAndData';
import GetCPS from '../../HelperFunctions/GetCPS.js'; import GetCPS from '../../HelperFunctions/GetCPS';
import Beautify from '../../BeautifyAndFormatting/Beautify.js'; import Beautify from '../../BeautifyAndFormatting/Beautify';
import AddMissingAchievements from './CreateMissingAchievements.js'; import AddMissingAchievements from './CreateMissingAchievements';
/** /**
* This function adds stats created by CookieMonster to the stats page * This function adds stats created by CookieMonster to the stats page

View File

@@ -1,8 +1,8 @@
/** Section: Functions related to the creation of basic DOM elements page */ /** Section: Functions related to the creation of basic DOM elements page */
import { ToggleHeader } from '../../../Config/ToggleSetting.js'; import { ToggleHeader } from '../../../Config/ToggleSetting';
import { SimpleTooltipElements } from '../../VariablesAndData.js'; import { SimpleTooltipElements } from '../../VariablesAndData';
/** /**
* This function creates a header-object for the stats page * This function creates a header-object for the stats page

View File

@@ -4,7 +4,7 @@ import {
CacheMissingUpgrades, CacheMissingUpgrades,
CacheMissingUpgradesCookies, CacheMissingUpgradesCookies,
CacheMissingUpgradesPrestige, CacheMissingUpgradesPrestige,
} from '../../../Cache/VariablesAndData.js'; } from '../../../Cache/VariablesAndData';
/** /**
* This function creates the missing upgrades sections for prestige, normal and cookie upgrades * This function creates the missing upgrades sections for prestige, normal and cookie upgrades
@@ -13,7 +13,8 @@ export function AddMissingUpgrades() {
l('menu').childNodes.forEach((menuSection) => { l('menu').childNodes.forEach((menuSection) => {
if (menuSection.children[0]) { if (menuSection.children[0]) {
if (menuSection.children[0].innerHTML === 'Prestige' && CacheMissingUpgradesPrestige) { if (menuSection.children[0].innerHTML === 'Prestige' && CacheMissingUpgradesPrestige) {
const prestigeUpgradesMissing = CacheMissingUpgradesPrestige.match(/div/g || []).length / 2; const prestigeUpgradesMissing =
CacheMissingUpgradesPrestige.match(new RegExp('div', 'g') || []).length / 2;
const title = document.createElement('div'); const title = document.createElement('div');
title.id = 'CMMissingUpgradesPrestigeTitle'; title.id = 'CMMissingUpgradesPrestigeTitle';
title.className = 'listing'; title.className = 'listing';
@@ -29,7 +30,8 @@ export function AddMissingUpgrades() {
menuSection.appendChild(upgrades); menuSection.appendChild(upgrades);
} else if (menuSection.children[0].innerHTML === 'Upgrades') { } else if (menuSection.children[0].innerHTML === 'Upgrades') {
if (CacheMissingUpgrades) { if (CacheMissingUpgrades) {
const normalUpgradesMissing = CacheMissingUpgrades.match(/div/g || []).length / 2; const normalUpgradesMissing =
CacheMissingUpgrades.match(new RegExp('div', 'g') || []).length / 2;
const title = document.createElement('div'); const title = document.createElement('div');
title.id = 'CMMissingUpgradesTitle'; title.id = 'CMMissingUpgradesTitle';
title.className = 'listing'; title.className = 'listing';
@@ -52,7 +54,8 @@ export function AddMissingUpgrades() {
); );
} }
if (CacheMissingUpgradesCookies) { if (CacheMissingUpgradesCookies) {
const cookieUpgradesMissing = CacheMissingUpgradesCookies.match(/div/g || []).length / 2; const cookieUpgradesMissing =
CacheMissingUpgradesCookies.match(new RegExp('div', 'g') || []).length / 2;
const title = document.createElement('div'); const title = document.createElement('div');
title.id = 'CMMissingUpgradesCookiesTitle'; title.id = 'CMMissingUpgradesCookiesTitle';
title.className = 'listing'; title.className = 'listing';

View File

@@ -1,7 +1,7 @@
/** Functions to create the individual sections of the Statistics page */ /** Functions to create the individual sections of the Statistics page */
import * as GameData from '../../../Data/Gamedata.js'; import * as GameData from '../../../Data/Gamedata.ts';
import { MaxChainCookieReward } from '../../../Cache/Stats/ChainCookies.js'; import { MaxChainCookieReward } from '../../../Cache/Stats/ChainCookies';
import { import {
CacheAvgCPSWithChoEgg, CacheAvgCPSWithChoEgg,
CacheCentEgg, CacheCentEgg,
@@ -35,20 +35,19 @@ import {
CacheSeaSpec, CacheSeaSpec,
CacheWrathCookiesMult, CacheWrathCookiesMult,
CacheWrinklersTotal, CacheWrinklersTotal,
} from '../../../Cache/VariablesAndData.js'; } from '../../../Cache/VariablesAndData';
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension.js'; import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension';
import CalculateLuckyLevels from '../../HelperFunctions/CalculateLuckyLevels.js'; import GetCPS from '../../HelperFunctions/GetCPS';
import GetCPS from '../../HelperFunctions/GetCPS.js'; import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank.js'; import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData';
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData.js';
import { import {
StatsListing, StatsListing,
StatsHeader, StatsHeader,
StatsMissDisp, StatsMissDisp,
StatsMissDispListing, StatsMissDispListing,
} from './CreateDOMElements.js'; } from './CreateDOMElements';
import Beautify from '../../BeautifyAndFormatting/Beautify.js'; import Beautify from '../../BeautifyAndFormatting/Beautify';
import FormatTime from '../../BeautifyAndFormatting/FormatTime.js'; import FormatTime from '../../BeautifyAndFormatting/FormatTime';
/** /**
* This function creates the "Lucky" section of the stats page * This function creates the "Lucky" section of the stats page
@@ -437,33 +436,6 @@ 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; return section;
} }
@@ -634,47 +606,46 @@ export function PrestigeSection() {
const currentPrestige = Math.floor(Game.HowMuchPrestige(Game.cookiesReset)); const currentPrestige = Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
const willHave = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)); const willHave = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
const willGet = willHave - currentPrestige; const willGet = willHave - currentPrestige;
const { luckyDigit, luckyNumber, luckyPayout } = CalculateLuckyLevels(willHave);
if (!Game.Has('Lucky digit')) { if (!Game.Has('Lucky digit')) {
const luckyDigitDelta = luckyDigit - willHave; let delta7 = 7 - (willHave % 10);
const luckyDigitReset = willGet + luckyDigitDelta; if (delta7 < 0) delta7 += 10;
const fragLuckyDigit = document.createDocumentFragment(); const next7Reset = willGet + delta7;
fragLuckyDigit.appendChild( const next7Total = willHave + delta7;
const frag7 = document.createDocumentFragment();
frag7.appendChild(
document.createTextNode( document.createTextNode(
`${luckyDigit.toLocaleString()} / ${luckyDigitReset.toLocaleString()} (+${luckyDigitDelta})`, `${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`,
), ),
); );
section.appendChild( section.appendChild(StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7));
StatsListing('basic', 'Next "Lucky Digit" (total / reset)', fragLuckyDigit),
);
} }
if (!Game.Has('Lucky number')) { if (!Game.Has('Lucky number')) {
const luckyNumberDelta = luckyNumber - willHave; let delta777 = 777 - (willHave % 1000);
const luckyNumberReset = willGet + luckyNumberDelta; if (delta777 < 0) delta777 += 1000;
const fragLuckyNumber = document.createDocumentFragment(); const next777Reset = willGet + delta777;
fragLuckyNumber.appendChild( const next777Total = willHave + delta777;
const frag777 = document.createDocumentFragment();
frag777.appendChild(
document.createTextNode( document.createTextNode(
`${luckyNumber.toLocaleString()} / ${luckyNumberReset.toLocaleString()} (+${luckyNumberDelta})`, `${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`,
), ),
); );
section.appendChild( section.appendChild(StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777));
StatsListing('basic', 'Next "Lucky Number" (total / reset)', fragLuckyNumber),
);
} }
if (!Game.Has('Lucky payout')) { if (!Game.Has('Lucky payout')) {
const luckyPayoutDelta = luckyPayout - willHave; let delta777777 = 777777 - (willHave % 1000000);
const luckyPayoutReset = willGet + luckyPayoutDelta; if (delta777777 < 0) delta777777 += 1000000;
const fragLuckyPayout = document.createDocumentFragment(); const next777777Reset = willGet + delta777777;
fragLuckyPayout.appendChild( const next777777Total = willHave + delta777777;
const frag777777 = document.createDocumentFragment();
frag777777.appendChild(
document.createTextNode( document.createTextNode(
`${luckyPayout.toLocaleString()} / ${luckyPayoutReset.toLocaleString()} (+${luckyPayoutDelta})`, `${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`,
), ),
); );
section.appendChild( section.appendChild(StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777));
StatsListing('basic', 'Next "Lucky Payout" (total / reset)', fragLuckyPayout),
);
} }
return section; return section;

View File

@@ -1,5 +1,5 @@
import { menuFunctions } from '@cookiemonsterteam/cookiemonsterframework'; import { menuFunctions } from '@cookiemonsterteam/cookiemonsterframework';
import { LatestReleaseNotes, ModDescription } from '../../Data/Moddata.js'; import { LatestReleaseNotes, ModDescription } from '../../Data/Moddata.ts';
/** /**
* Creates the <div> to be added to the Info section * Creates the <div> to be added to the Info section

View File

@@ -1,8 +1,8 @@
import { menuFunctions as mF } from '@cookiemonsterteam/cookiemonsterframework'; import { menuFunctions as mF } from '@cookiemonsterteam/cookiemonsterframework';
import { ConfigGroups, ConfigGroupsNotification } from '../../Data/Sectionheaders.js'; import { ConfigGroups, ConfigGroupsNotification } from '../../Data/Sectionheaders.ts';
import settings from '../../Data/settings.js'; import settings from '../../Data/settings';
import UpdateColours from '../HelperFunctions/UpdateColours.js'; import UpdateColours from '../HelperFunctions/UpdateColours';
import RefreshScale from '../HelperFunctions/RefreshScale.js'; import RefreshScale from '../HelperFunctions/RefreshScale';
/** /**
* Creates the <div> to be added to the Options section * Creates the <div> to be added to the Options section

View File

@@ -1,5 +1,5 @@
import { CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData.js'; import { CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData';
import { LastGoldenCookieState } from '../../Main/VariablesAndData.js'; import { LastGoldenCookieState } from '../../Main/VariablesAndData';
/** /**
* This function creates the Favicon, it is called by CM.Main.DelayInit() * This function creates the Favicon, it is called by CM.Main.DelayInit()

View File

@@ -1,9 +1,9 @@
/** Functions related to updating the tab in the browser's tab-bar */ /** Functions related to updating the tab in the browser's tab-bar */
import { CacheSeasonPopShimmer, CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData.js'; import { CacheSeasonPopShimmer, CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData';
import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData.js'; import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData';
import { Title } from '../VariablesAndData.js'; import { Title } from '../VariablesAndData';
/** /**
* This function updates the tab title * This function updates the tab title

View File

@@ -2,8 +2,8 @@ import {
CacheHCPerSecond, CacheHCPerSecond,
CacheLastHeavenlyChips, CacheLastHeavenlyChips,
CacheTimeTillNextPrestige, CacheTimeTillNextPrestige,
} from '../../Cache/VariablesAndData.js'; } from '../../Cache/VariablesAndData';
import Beautify from '../BeautifyAndFormatting/Beautify.js'; import Beautify from '../BeautifyAndFormatting/Beautify';
/** /**
* This function creates a header object for tooltips. * This function creates a header object for tooltips.

View File

@@ -7,7 +7,7 @@ import {
ColourYellow, ColourYellow,
ColourPurple, ColourPurple,
TooltipType, TooltipType,
} from '../VariablesAndData.js'; } from '../VariablesAndData';
/** Creates various sections of tooltips */ /** Creates various sections of tooltips */

View File

@@ -1,8 +1,8 @@
import UpdateTooltips from './UpdateTooltips.js'; import UpdateTooltips from './UpdateTooltips';
import { SimpleTooltipElements, TooltipName, TooltipType } from '../VariablesAndData.js'; // eslint-disable-line no-unused-vars import { SimpleTooltipElements, TooltipName, TooltipType } from '../VariablesAndData'; // eslint-disable-line no-unused-vars
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour.js'; import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour';
import Beautify from '../BeautifyAndFormatting/Beautify.js'; import Beautify from '../BeautifyAndFormatting/Beautify';
/** All general functions related to creating and updating tooltips */ /** All general functions related to creating and updating tooltips */
@@ -98,8 +98,6 @@ export function CreateTooltip(type, name) {
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(name[0], name[1])(); l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(name[0], name[1])();
// Harvest all button in garden // Harvest all button in garden
else if (type === 'ha') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)(); 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 === 'wb') l('tooltip').innerHTML = '';
else if (type === 'pag') l('tooltip').innerHTML = Game.Objects.Temple.minigame.godTooltip(name)(); else if (type === 'pag') l('tooltip').innerHTML = Game.Objects.Temple.minigame.godTooltip(name)();
else if (type === 'pas') else if (type === 'pas')
@@ -113,7 +111,6 @@ export function CreateTooltip(type, name) {
type === 'g' || type === 'g' ||
(type === 'p' && !Game.keys[16]) || (type === 'p' && !Game.keys[16]) ||
type === 'ha' || type === 'ha' ||
type === 'sm' ||
type === 'wb' || type === 'wb' ||
type === 'pag' || type === 'pag' ||
(type === 'pas' && name[1] !== -1) (type === 'pas' && name[1] !== -1)

View File

@@ -1,26 +1,26 @@
import ColourOfPP from '../../../Cache/PP/ColourOfPP.js'; import ColourOfPP from '../../../Cache/PP/ColourOfPP';
import { import {
CacheObjects1, CacheObjects1,
CacheObjects10, CacheObjects10,
CacheObjects100, CacheObjects100,
CacheObjectsNextAchievement, CacheObjectsNextAchievement,
} from '../../../Cache/VariablesAndData.js'; } from '../../../Cache/VariablesAndData';
import BuyBuildingsBonusIncome from '../../../Sim/SimulationEvents/BuyBuildingBonusIncome.js'; import BuyBuildingsBonusIncome from '../../../Sim/SimulationEvents/BuyBuildingBonusIncome';
import { SimObjects } from '../../../Sim/VariablesAndData.js'; import { SimObjects } from '../../../Sim/VariablesAndData';
import Beautify from '../../BeautifyAndFormatting/Beautify.js'; import Beautify from '../../BeautifyAndFormatting/Beautify';
import FormatTime from '../../BeautifyAndFormatting/FormatTime.js'; import FormatTime from '../../BeautifyAndFormatting/FormatTime';
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour.js'; import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
import GetCPS from '../../HelperFunctions/GetCPS.js'; import GetCPS from '../../HelperFunctions/GetCPS';
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank.js'; import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
import { import {
ColourTextPre, ColourTextPre,
LastTargetTooltipBuilding, LastTargetTooltipBuilding,
TooltipBonusIncome, TooltipBonusIncome,
TooltipName, TooltipName,
TooltipPrice, TooltipPrice,
} from '../../VariablesAndData.js'; } from '../../VariablesAndData';
import * as Create from '../CreateTooltip.js'; import * as Create from '../CreateTooltip';
/** /**
* This function adds extra info to the Building tooltips * This function adds extra info to the Building tooltips

View File

@@ -1,6 +1,6 @@
import Beautify from '../../BeautifyAndFormatting/Beautify.js'; import Beautify from '../../BeautifyAndFormatting/Beautify';
import { TooltipName } from '../../VariablesAndData.js'; import { TooltipName } from '../../VariablesAndData';
import * as Create from '../CreateTooltip.js'; import * as Create from '../CreateTooltip';
/** /**
* This function adds extra info to the Garden plots tooltips * This function adds extra info to the Garden plots tooltips
@@ -21,14 +21,14 @@ export default function GardenPlots() {
const reward = document.createElement('div'); const reward = document.createElement('div');
reward.id = 'CMTooltipPlantReward'; reward.id = 'CMTooltipPlantReward';
l('CMTooltipBorder').appendChild(reward); l('CMTooltipBorder').appendChild(reward);
if (plantName === 'Chocoroot' || plantName === 'White chocoroot') { if (plantName === 'Bakeberry') {
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 = `${ l('CMTooltipPlantReward').textContent = `${
mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : '0' mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : '0'
} / ${Beautify(Game.cookiesPs * 60 * 30)}`; } / ${Beautify(Game.cookiesPs * 60 * 30)}`;
} else if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
l('CMTooltipPlantReward').textContent = `${
mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : '0'
} / ${Beautify(Game.cookiesPs * 60 * 3)}`;
} else if (plantName === 'Queenbeet') { } else if (plantName === 'Queenbeet') {
l('CMTooltipPlantReward').textContent = `${ l('CMTooltipPlantReward').textContent = `${
mature ? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : '0' mature ? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : '0'

View File

@@ -1,8 +1,11 @@
import Beautify from '../../BeautifyAndFormatting/Beautify.js'; import { CacheNoGoldSwitchCookiesPS } from '../../../Cache/VariablesAndData';
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour.js';
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime.js'; import Beautify from '../../BeautifyAndFormatting/Beautify';
import { ColourTextPre, TooltipName } from '../../VariablesAndData.js'; import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
import * as Create from '../CreateTooltip.js'; import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
import { ColourTextPre, TooltipName } from '../../VariablesAndData';
import * as Create from '../CreateTooltip';
/** /**
* This function adds extra info to the Grimoire tooltips * This function adds extra info to the Grimoire tooltips
@@ -55,7 +58,10 @@ export default function Grimoire() {
const reward = document.createElement('span'); const reward = document.createElement('span');
reward.style.color = '#33FF00'; reward.style.color = '#33FF00';
reward.textContent = Beautify( reward.textContent = Beautify(
Math.max(Math.min(Game.cookies * 0.15, Game.cookiesPs * 60 * 30), 7), Math.min(
(Game.cookies + GetWrinkConfigBank()) * 0.15,
CacheNoGoldSwitchCookiesPS * 60 * 30,
),
2, 2,
); );
conjure.appendChild(reward); conjure.appendChild(reward);
@@ -64,10 +70,7 @@ export default function Grimoire() {
conjure.appendChild(seperator); conjure.appendChild(seperator);
const loss = document.createElement('span'); const loss = document.createElement('span');
loss.style.color = 'red'; loss.style.color = 'red';
loss.textContent = Beautify( loss.textContent = Beautify(CacheNoGoldSwitchCookiesPS * 60 * 15, 2);
Math.min(Game.cookies, Math.min(Game.cookies * 0.15, Game.cookiesPs * 60 * 15) + 13),
2,
);
conjure.appendChild(loss); conjure.appendChild(loss);
} }

View File

@@ -1,5 +1,5 @@
import Beautify from '../../BeautifyAndFormatting/Beautify.js'; import Beautify from '../../BeautifyAndFormatting/Beautify';
import * as Create from '../CreateTooltip.js'; import * as Create from '../CreateTooltip';
/** /**
* This function adds extra info to the Garden Harvest All tooltip * This function adds extra info to the Garden Harvest All tooltip

View File

@@ -1,7 +1,7 @@
import { CacheGods } from '../../../Cache/VariablesAndData.js'; import { CacheGods } from '../../../Cache/VariablesAndData';
import Beautify from '../../BeautifyAndFormatting/Beautify.js'; import Beautify from '../../BeautifyAndFormatting/Beautify';
import { TooltipName, TooltipType } from '../../VariablesAndData.js'; import { TooltipName, TooltipType } from '../../VariablesAndData';
import * as Create from '../CreateTooltip.js'; import * as Create from '../CreateTooltip';
/** /**
* This function adds extra info to the Pantheon Gods tooltip * This function adds extra info to the Pantheon Gods tooltip

Some files were not shown because too many files have changed in this diff Show More