Compare commits

..

124 Commits

Author SHA1 Message Date
dependabot[bot]
835b78a249 Bump @eslint/eslintrc from 3.3.0 to 3.3.1
Bumps [@eslint/eslintrc](https://github.com/eslint/eslintrc) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/eslint/eslintrc/releases)
- [Changelog](https://github.com/eslint/eslintrc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslintrc/compare/v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: "@eslint/eslintrc"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 02:59:53 +00:00
WiseDragoon
bd772e3712 Update CalculateLuckyLevels.js (#1217)
* Update CalculateLuckyLevels.js

Fixed infinite loop when currentLevel is too big

* Update CalculateLuckyLevels.js Dev build

* Update CalculateLuckyLevels.js Final build
2025-03-16 20:43:05 +01:00
Kevin Radloff
69b923de89 Show spells cast progress towards next achievement in stats 2025-03-03 20:44:43 +01:00
Kevin Radloff
4e6c828f8b Minor refactor to remove unused probability functions and combine functions that were only used in one spot. 2025-02-26 21:42:20 +01:00
Kevin Radloff
270190feae Change <0% GC/reindeer chance formatting to show <1% instead. 2025-02-26 21:42:20 +01:00
dependabot[bot]
13dd628623 Bump @eslint/compat from 1.2.6 to 1.2.7
Bumps [@eslint/compat](https://github.com/eslint/rewrite) from 1.2.6 to 1.2.7.
- [Release notes](https://github.com/eslint/rewrite/releases)
- [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json)
- [Commits](https://github.com/eslint/rewrite/compare/compat-v1.2.6...compat-v1.2.7)

---
updated-dependencies:
- dependency-name: "@eslint/compat"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 09:29:59 +01:00
dependabot[bot]
5604a63652 Bump prettier from 3.5.1 to 3.5.2
Bumps [prettier](https://github.com/prettier/prettier) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.5.1...3.5.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 09:29:34 +01:00
dependabot[bot]
3f867b9023 Bump globals from 15.15.0 to 16.0.0
Bumps [globals](https://github.com/sindresorhus/globals) from 15.15.0 to 16.0.0.
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v15.15.0...v16.0.0)

---
updated-dependencies:
- dependency-name: globals
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 09:26:04 +01:00
dependabot[bot]
d4e243f2b7 Bump eslint from 9.20.1 to 9.21.0
Bumps [eslint](https://github.com/eslint/eslint) from 9.20.1 to 9.21.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.20.1...v9.21.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 09:23:46 +01:00
Kevin Radloff
989e984eb5 Remove Cookie Clicker version check and the need for user confirmation. 2025-02-17 21:45:00 +01:00
dependabot[bot]
6e4644c3cc Bump chai from 4.5.0 to 5.2.0
Bumps [chai](https://github.com/chaijs/chai) from 4.5.0 to 5.2.0.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](https://github.com/chaijs/chai/compare/v4.5.0...v5.2.0)

---
updated-dependencies:
- dependency-name: chai
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-16 15:01:00 +01:00
Daniël van Noord
379593f7fc Remove more whitespace 2025-02-16 14:56:41 +01:00
Kevin Radloff
16ec2ff06a Specify node 22, npm update, and remove some whitespace. 2025-02-16 14:56:41 +01:00
Kevin Radloff
933a017335 Attempt to fix pre-commit hooks. 2025-02-16 14:56:41 +01:00
Kevin Radloff
492abb66dc Try out removing prettier args from pre-commit config. 2025-02-16 14:56:41 +01:00
Kevin Radloff
a1aaa3de8f Update dependencies and remove unneeded things. This allows building on node v22. Also rely on configs for eslint/prettier so CI and command line runs are guaranteed to be consistent. 2025-02-16 14:56:41 +01:00
Numbernaut
9e98208c19 Fixed Golden Cookie percentage calculation to cdf #921 (#1190)
* Added cummulative probability handling

* executed build-dev command

* executed build-final command
2024-09-08 11:17:00 +02:00
srs420
ca1c28d1fc Add stock market tooltip info (#1189)
* Add info to stock market tooltips

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add up and down arrows to expected value

---------

Co-authored-by: srs42006 <45675882+srs42006@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-02 09:22:02 +02:00
dependabot[bot]
ce14fa6190 Bump chai and @types/chai
Bumps [chai](https://github.com/chaijs/chai) and [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai). These dependencies needed to be updated together.

Updates `chai` from 4.3.6 to 4.3.7
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/4.x.x/History.md)
- [Commits](https://github.com/chaijs/chai/compare/v4.3.6...v4.3.7)

Updates `@types/chai` from 4.3.1 to 4.3.4
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

---
updated-dependencies:
- dependency-name: chai
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: "@types/chai"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-11 10:01:08 +02:00
dependabot[bot]
ec2c498b71 Bump eslint-config-prettier from 8.5.0 to 8.8.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.5.0 to 8.8.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.5.0...v8.8.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-11 09:59:43 +02:00
dependabot[bot]
657ca1a963 Bump word-wrap from 1.2.3 to 1.2.4
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-11 09:59:29 +02:00
pre-commit-ci[bot]
f6ebfef6cd [pre-commit.ci] pre-commit autoupdate (#1169) 2024-05-11 09:59:08 +02:00
Jeong Hansol
133ed74877 Calculations of lucky levels (#1179) 2024-05-11 09:57:46 +02:00
pre-commit-ci[bot]
8e975c2b20 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.6 → v3.0.2](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0-alpha.6...v3.0.2)
2023-08-22 09:37:29 +02:00
Grace Carr
d8b9d2f20c Revert "update calculations for lucky levels (#1161)"
This reverts commit 9f78e14bec.
2023-07-17 20:18:06 +02:00
Grace Carr
9f78e14bec update calculations for lucky levels (#1161)
* update calculations for lucky levels

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-17 09:40:29 +02:00
jessedufrene
7269577009 Add cookieclicker.ee to supported userscript sites 2023-06-22 21:26:58 +02:00
Stefan Ravn van Overeem
8d89f23c35 Support 2.052 (#1153)
* Support 2.052

Support new upgrades and achievements in 2.052:
- Fortune #020
- Kitten strategists
- Septcentennial (Have 700 of everything)
- Oft we mar what's well (700 upgrades)
- Undecillion fingers
- 900 and 1000 cursors
- Omniplast mouse

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-05-07 13:19:49 +02:00
dependabot[bot]
78f62affc5 Bump eslint-plugin-import from 2.26.0 to 2.27.5 (#1146)
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.26.0 to 2.27.5.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.26.0...v2.27.5)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
2023-04-18 17:05:42 +02:00
pre-commit-ci[bot]
4b8c35f271 [pre-commit.ci] pre-commit autoupdate (#1116)
updates:
- [github.com/pre-commit/mirrors-prettier: v2.7.1 → v3.0.0-alpha.6](https://github.com/pre-commit/mirrors-prettier/compare/v2.7.1...v3.0.0-alpha.6)
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
2023-04-18 14:49:38 +00:00
dependabot[bot]
1d19545a43 Bump prettier from 2.7.1 to 2.8.7
Bumps [prettier](https://github.com/prettier/prettier) from 2.7.1 to 2.8.7.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.7.1...2.8.7)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-18 16:47:29 +02:00
Costas Basdekis
76d531a5b0 Fix buying with block protection & exact cookies
The check was wrong, since it wouldn't allow you to buy a building
for the exact amount of cookies in your bank, for example when
you're trying to buy your first cursor after clicking exactly 15 times.
2023-03-15 09:04:21 +01:00
dependabot[bot]
54bb9f793b Bump json5 from 1.0.1 to 1.0.2
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 08:55:20 +01:00
dependabot[bot]
70cc97b0e0 Bump webpack from 5.73.0 to 5.76.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.73.0 to 5.76.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.73.0...v5.76.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 08:53:50 +01:00
dependabot[bot]
adf6544e21 Bump eslint from 8.20.0 to 8.36.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.20.0 to 8.36.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.20.0...v8.36.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 08:53:12 +01:00
dependabot[bot]
93702eefbe Bump terser from 5.8.0 to 5.14.2
Bumps [terser](https://github.com/terser/terser) from 5.8.0 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-20 09:07:44 +02:00
dependabot[bot]
88eb28c5dd Bump eslint from 8.19.0 to 8.20.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.19.0 to 8.20.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.19.0...v8.20.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-18 04:58:47 +02:00
dependabot[bot]
049d0153fb Bump eslint from 8.18.0 to 8.19.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.18.0 to 8.19.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.18.0...v8.19.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-08 15:10:48 +02:00
dependabot[bot]
131547ec00 Bump shell-quote from 1.7.2 to 1.7.3
Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/substack/node-shell-quote/releases)
- [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md)
- [Commits](https://github.com/substack/node-shell-quote/compare/v1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 14:07:20 +02:00
dependabot[bot]
5e92bb5fa5 Bump eslint from 7.32.0 to 8.18.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.32.0 to 8.18.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.32.0...v8.18.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-19 21:04:50 +02:00
Daniël van Noord
5ebfdfd48e Add additional hooks to pre-commit 2022-06-19 21:02:02 +02:00
Daniël van Noord
1f685f823a Rebuild files 2022-06-19 20:59:45 +02:00
Daniël van Noord
197b744f56 Add exclude to prettier 2022-06-19 20:59:41 +02:00
Daniël van Noord
ab73a78a01 Add prettier to pre-commit and run it 2022-06-19 20:57:42 +02:00
Daniël van Noord
8cfc980546 Remove everything related to TypeScript 2022-06-19 20:50:56 +02:00
dependabot[bot]
3fddc1d249 Bump prettier from 2.6.2 to 2.7.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.6.2 to 2.7.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.6.2...2.7.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-19 20:42:34 +02:00
dependabot[bot]
2555828eb9 Bump webpack-cli from 4.9.2 to 4.10.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.9.2 to 4.10.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.9.2...webpack-cli@4.10.0)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-16 14:40:04 +02:00
dependabot[bot]
66b2c567c2 Bump ts-node from 10.8.0 to 10.8.1
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.8.0 to 10.8.1.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.8.0...v10.8.1)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 22:12:28 +02:00
dependabot[bot]
dd66674169 Bump typescript from 4.7.2 to 4.7.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.7.2 to 4.7.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.7.2...v4.7.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 22:05:31 +02:00
dependabot[bot]
cfca658703 Bump webpack from 5.72.1 to 5.73.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.72.1 to 5.73.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.72.1...v5.73.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 22:04:16 +02:00
dependabot[bot]
a607842fdd Bump chai from 4.3.4 to 4.3.6
Bumps [chai](https://github.com/chaijs/chai) from 4.3.4 to 4.3.6.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/4.x.x/History.md)
- [Commits](https://github.com/chaijs/chai/compare/v4.3.4...v4.3.6)

---
updated-dependencies:
- dependency-name: chai
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 22:02:56 +02:00
dependabot[bot]
501b2df220 Bump eslint-config-prettier from 8.3.0 to 8.5.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.3.0 to 8.5.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.3.0...v8.5.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 22:02:18 +02:00
domoddball
1027d48b51 Resolve conjured baked goods tooltip miscalculation #1074 (#1087) 2022-06-04 10:42:18 +02:00
domoddball
fdcbbd7ab2 Add support for unshackled upgrades (#1086) 2022-06-03 12:19:06 +02:00
domoddball
9bfb8a44f9 Resolve Grimoire magic bar text rendering bug #1083 (#1084) 2022-06-02 08:26:04 +02:00
domoddball
fec312df1c Updates for cookieclicker v2.048 #1049 (#1079)
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
2022-06-01 19:10:16 +02:00
dependabot[bot]
1f23e58984 Bump ts-loader from 9.2.5 to 9.3.0
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.5 to 9.3.0.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.5...v9.3.0)

---
updated-dependencies:
- dependency-name: ts-loader
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 10:59:31 +02:00
dependabot[bot]
b1812afa2f Bump webpack from 5.72.0 to 5.72.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.72.0 to 5.72.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.72.0...v5.72.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 10:59:20 +02:00
dependabot[bot]
22b8c8a61c Bump ts-node from 10.2.1 to 10.8.0
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.2.1 to 10.8.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.2.1...v10.8.0)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 10:53:31 +02:00
dependabot[bot]
25838daede Bump webpack-cli from 4.8.0 to 4.9.2
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.8.0 to 4.9.2.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.8.0...webpack-cli@4.9.2)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 10:51:41 +02:00
dependabot[bot]
21c0042c24 Bump typescript from 4.4.3 to 4.7.2
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.3 to 4.7.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.4.3...v4.7.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 10:51:30 +02:00
dependabot[bot]
b12fd5db72 Bump @typescript-eslint/eslint-plugin from 4.31.1 to 4.33.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.31.1 to 4.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 21:02:02 +02:00
dependabot[bot]
ef7d46b6dc Bump @typescript-eslint/parser from 4.31.1 to 4.33.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.31.1 to 4.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:56:45 +02:00
dependabot[bot]
ff8fe0644a Bump eslint-plugin-import from 2.24.2 to 2.26.0
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.24.2 to 2.26.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.24.2...v2.26.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:56:35 +02:00
dependabot[bot]
6779133dd8 Bump ansi-regex from 3.0.0 to 3.0.1
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:56:22 +02:00
dependabot[bot]
097ccd2048 Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:53:57 +02:00
dependabot[bot]
c45a630286 Bump prettier from 2.3.2 to 2.6.2
Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.6.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.6.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:53:39 +02:00
dependabot[bot]
30809c7b45 Bump @types/chai from 4.2.21 to 4.3.1
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.21 to 4.3.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

---
updated-dependencies:
- dependency-name: "@types/chai"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:53:29 +02:00
dependabot[bot]
db8d722479 Bump webpack from 5.52.1 to 5.72.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.52.1 to 5.72.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.52.1...v5.72.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 20:53:17 +02:00
humdogm
79f8079228 Re-order Garden max rewards by amount of cookies
Build CookieMonsterDev.js and .js.map
Ran npm build-dev
2022-04-20 20:51:57 +02:00
Daniël van Noord
9d101ddfd4 Merge pull request #1037 from dsf3449/dev
fix: duplicated cookie notation
2021-12-30 09:28:16 +01:00
dsf3449
0e69ac39dc Remove no longer needed Beautify call 2021-12-30 01:03:53 -06:00
Daniël van Noord
f0757d2490 Bump cookiemonsterframework to 0.2.3 2021-09-29 23:03:37 +02:00
Daniël van Noord
65754bc29d Fix jumping of options screen 2021-09-29 21:10:25 +02:00
Daniël van Noord
1d26217f80 Merge pull request #994 from benblank/cmd-cache
Export caches via CookieMonsterData
2021-09-22 12:34:39 +02:00
Ben Blank
c0751438b6 Rebuild after updating dependencies. 2021-09-16 16:52:20 -07:00
Ben Blank
53ed8fe167 Fix handling of undefined in FillCMDCache. 2021-09-15 12:16:10 -07:00
Ben Blank
74e7c64ca2 Export caches via CookieMonsterData. 2021-09-15 12:14:22 -07:00
Daniël van Noord
809bd4d35d Update dependencies 2021-09-14 21:15:35 +02:00
Daniël van Noord
348ba4b9fd Rebuild CM.js 2021-09-14 21:07:36 +02:00
Daniël van Noord
9e783cc3d7 Bump cookiemonsterframework to 0.2.2 2021-09-14 21:06:19 +02:00
Daniël van Noord
6766c05091 Use issue forms instead of issue templates 2021-09-10 10:14:16 +02:00
Daniël van Noord
1f6ca9ebe6 Merge pull request #981 from DanielNoord/dev
Fix Krumblor
2021-09-06 15:46:38 +02:00
Daniël van Noord
bbf31fe96f Merge branch 'dev' of https://github.com/CookieMonsterTeam/CookieMonster into dev 2021-09-06 15:44:24 +02:00
Daniël van Noord
4be3942af3 Fix Krumblor on Steam 2021-09-06 15:43:41 +02:00
Daniël van Noord
488233c8dd Merge pull request #979 from Pidgeot/dev
Disable automatic sizing on grimoire bar to allow text to fit
2021-09-05 20:15:11 +02:00
Daniël van Noord
a89f1eed1a Update src/Main/ReplaceGameElements/NativeGrimoire.js 2021-09-05 20:13:58 +02:00
Michael Madsen
790cf411c3 Set grimoire bar width to 75% 2021-09-05 20:10:27 +02:00
Michael Madsen
46853f711a Disable automatic sizing on grimoire bar to allow text to fit 2021-09-05 19:33:44 +02:00
Daniël van Noord
60121c0be5 Merge pull request #977 from dmytrokyrychuk/short-time-format
Add short time format
2021-09-05 17:34:51 +02:00
Daniël van Noord
c7d9144dd2 Rebuild CookieMonster files 2021-09-05 17:33:49 +02:00
Daniël van Noord
aa5cad663b Merge branch 'dev' of https://github.com/CookieMonsterTeam/CookieMonster into short-time-format 2021-09-05 17:33:29 +02:00
Daniël van Noord
b191d9a434 Fix Grimoire bar on Steam 2021-09-05 17:31:23 +02:00
Daniël van Noord
1842c40c01 Rebuild CookieMonster files 2021-09-05 17:28:59 +02:00
Daniël van Noord
9c005b2f2f Merge branch 'dev' of https://github.com/CookieMonsterTeam/CookieMonster into short-time-format 2021-09-05 17:23:37 +02:00
Dmytro Kyrychuk
e6d89fa0c7 Add short time format 2021-09-05 17:52:27 +03:00
Daniël van Noord
b74ae3eee0 Change order of Steam delay 2021-09-05 13:02:04 +02:00
Daniël van Noord
e4267f4c41 Merge pull request #970 from DanielNoord/dev
Fix Steam delay
2021-09-04 16:18:25 +02:00
Daniël van Noord
62dc882e5a Fix the delay for Steam 2021-09-04 16:16:28 +02:00
Daniël van Noord
f7e7d171e8 Increase delay for steam to 2000ms 2021-09-04 15:45:49 +02:00
Daniël van Noord
669b5c1dd9 Merge branch 'gh-pages' into dev 2021-09-03 12:40:53 +02:00
Daniël van Noord
f67b561990 Add delay for steam 2021-09-03 12:38:38 +02:00
github-actions[bot]
5def4ee13b [Automated] Merge dev into gh-pages 2021-09-03 10:35:36 +00:00
Daniël van Noord
c4812ef8fc Add a delay for loading in Steam 2021-09-03 12:34:53 +02:00
github-actions[bot]
9b9bf962b7 [Automated] Merge dev into gh-pages 2021-09-02 21:00:13 +00:00
github-actions[bot]
0cf30e5cea [Automated] Merge dev into gh-pages 2021-09-02 20:58:35 +00:00
github-actions[bot]
6fb8470432 [Automated] Merge dev into gh-pages 2021-09-02 20:58:05 +00:00
github-actions[bot]
513780efc4 [Automated] Merge dev into gh-pages 2021-09-02 20:56:15 +00:00
github-actions[bot]
66d6be8039 [Automated] Merge dev into gh-pages 2021-09-02 20:52:31 +00:00
github-actions[bot]
fd3276a9a7 [Automated] Merge dev into gh-pages 2021-09-02 20:51:59 +00:00
github-actions[bot]
765f2637f9 [Automated] Merge dev into gh-pages 2021-09-02 20:51:46 +00:00
github-actions[bot]
667b91142f [Automated] Merge dev into gh-pages 2021-08-16 10:03:28 +00:00
github-actions[bot]
7e42c62f6b [Automated] Merge dev into gh-pages 2021-08-16 10:03:17 +00:00
github-actions[bot]
dddf786567 [Automated] Merge dev into gh-pages 2021-08-16 09:55:44 +00:00
github-actions[bot]
c080876fc0 [Automated] Merge dev into gh-pages 2021-08-16 09:53:30 +00:00
github-actions[bot]
fb8f6dbb49 [Automated] Merge dev into gh-pages 2021-08-16 09:53:16 +00:00
github-actions[bot]
27fd8626c8 [Automated] Merge dev into gh-pages 2021-08-16 09:53:00 +00:00
github-actions[bot]
4c63f6d9e2 [Automated] Merge dev into gh-pages 2021-07-25 14:23:06 +00:00
github-actions[bot]
8e27b5980b [Automated] Merge dev into gh-pages 2021-07-25 14:20:45 +00:00
github-actions[bot]
ccc5f83491 [Automated] Merge dev into gh-pages 2021-07-25 13:39:17 +00:00
github-actions[bot]
2489eb16ac [Automated] Merge dev into gh-pages 2021-07-25 13:32:56 +00:00
github-actions[bot]
89f895f01e [Automated] Merge dev into gh-pages 2021-07-25 13:28:39 +00:00
github-actions[bot]
7d40e12472 [Automated] Merge dev into gh-pages 2021-07-22 20:19:02 +00:00
github-actions[bot]
ce768cb135 [Automated] Merge dev into gh-pages 2021-07-22 20:12:43 +00:00
165 changed files with 4836 additions and 6974 deletions

View File

@@ -14,18 +14,6 @@
"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,17 +2,18 @@ Cookie Monster is written to modify Cookie Clicker as little as possible. This m
The following is a short description of the various `src` directories and their contents: 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

53
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: 🐛 Bug report
description: Report a bug in Cookie Monster
labels: [Bug]
body:
- type: markdown
attributes:
value: |
**Thank you for wanting to report a bug in Cookie Monster!**
⚠ Please make sure that this [issue wasn't already requested][issue search], or already implemented in the ``dev`` branch.
[issue search]: https://github.com/CookieMonsterTeam/CookieMonster/issues?q=is%3Aissue+is%3Aopen+
- type: textarea
id: what-happened
attributes:
label: Bug description
description: What is the bug about?
placeholder: |
# Please describe the bug and what you would have expected the mod to do
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: To reproduce
description: How can you reproduce the bug?
placeholder: |
The steps needed to reproduce the behavior:
1.
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshot
description: Please provide any relevant screenshots
- type: textarea
id: savefile
attributes:
label: Save file
description: Please provide a save file and paste it in between the "```"
placeholder: |
```SAVE FILE HERE```
- type: textarea
id: environment
attributes:
label: Browser / Steam / Version
description: Are you playing on browser (if so, which?) or Steam? And which version?
placeholder: Steam, version 2.04
validations:
required: true

View File

@@ -1,26 +0,0 @@
---
name: Bug report
about: Please use this template to report bugs you might have found
title: ''
labels: Bug
assignees: ''
---
**Describe the bug**
Please describe the bug and what you would have expected the mod to do
**To Reproduce**
The steps needed to reproduce the behavior:
1. ...
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Save file**
```
Please add a save file here.
This makes debugging much easier as we do not always have a good test save to debug the issue
```
**Browser**
Please specify your current browser. This can help find/fix the bug!

View File

@@ -0,0 +1,28 @@
name: ✨ Feature request
description: Request a new feature for Cookie Monster
labels: [Enhancement]
body:
- type: markdown
attributes:
value: |
**Thank you for wanting to suggest a new function for Cookie Monster!**
⚠ Please make sure that this [feature wasn't already requested][issue search], or already implemented in the ``dev`` branch.
[issue search]: https://github.com/CookieMonsterTeam/CookieMonster/issues?q=is%3Aissue+is%3Aopen+
- type: textarea
id: what-is-wanted
attributes:
label: Feature description
description: Describe the function you'd like to see added to CookieMonster
placeholder: |
# A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: additional-info
attributes:
label: Additional files
description: Add any other files such as save files or screenshots about the feature request here.

View File

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

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_REGISTERY_PAT: ${{ secrets.GITHUB_TOKEN }} GITHUB_REGISTRY_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: 12 node-version: 22
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
- name: Run ESLint - name: Run ESLint
run: npx eslint src run: npx eslint
- 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,4 +1,3 @@
{ {
"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_REGISTERY_PAT} //npm.pkg.github.com/:_authToken=${GITHUB_REGISTRY_PAT}

12
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: dist
- id: end-of-file-fixer
exclude: dist

1
.prettierignore Normal file
View File

@@ -0,0 +1 @@
dist

View File

@@ -1,6 +1,7 @@
// ==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 exposes relevant data for buildings and upgrades (PP, colour and bonus income). If you would like us to add any aditional data, please feel free to open an issue or create a PR doing so! Currently we expose relevant data for buildings and upgrades (PP, colour and bonus income). If you would like us to add any additional data, please feel free to open an issue or create a PR doing so!
## Contributing ## Contributing
To contribute you can fork and clone the repository and run `npm install`. Note that you will need to authenticate to the GitHub Package Registery (see [this documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages)). After creating a Public Access Token you should export this variable to $GITHUB_REGISTERY_PAT as defined in `.npmrc`. To contribute you can fork and clone the repository and run `npm install`. Note that you will need to authenticate to the GitHub Package Registry (see [this documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages)). After creating a Public Access Token you should export this variable to $GITHUB_REGISTRY_PAT as defined in `.npmrc`.
Please also remember to run `npm run build-dev` after saving all your changes to build the final `CookieMonsterDev.js` file. 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

59
eslint.config.mjs Normal file
View File

@@ -0,0 +1,59 @@
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default [
{
ignores: [
'eslint.config.mjs',
'webpack.config.cjs',
'**/CookieMonster.user.js',
'dist/*',
'node_modules/*',
],
},
...compat.extends('airbnb-base', 'prettier'),
{
languageOptions: {
globals: {
...globals.browser,
Game: 'writable',
l: 'readonly',
b64_to_utf8: 'readonly',
utf8_to_b64: 'readonly',
BeautifyAll: 'readonly',
},
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'import/extensions': ['error', 'ignorePackages'],
'import/no-mutable-exports': 'off',
'no-import-assign': 'off',
'no-plusplus': [
'error',
{
allowForLoopAfterthoughts: true,
},
],
'func-names': 'off',
'prefer-destructuring': [
'error',
{
object: true,
array: false,
},
],
},
},
];

9469
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.031.10", "version": "2.053.10",
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.", "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 src test", "eslint": "eslint",
"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,26 +43,6 @@
"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,
@@ -70,8 +50,30 @@
], ],
"name": "Cookie Monster" "name": "Cookie Monster"
}, },
"type": "module",
"engines": {
"node": ">=22"
},
"dependencies": { "dependencies": {
"@eastdesire/jscolor": "^2.4.5", "@cookiemonsterteam/cookiemonsterframework": "0.2.3",
"@cookiemonsterteam/cookiemonsterframework": "^0.2.1" "@eastdesire/jscolor": "^2.5.1",
"@eslint/compat": "^1.2.7",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.20.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'; import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData.js';
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'; } from '../VariablesAndData.js';
/** /**
* @class * @class

View File

@@ -1,19 +1,20 @@
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData'; import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData.js';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheAverageClicks, // eslint-disable-line no-unused-vars CacheAverageClicks,
CacheAverageCPS, CacheAverageCPS,
CacheAverageGainBank, CacheAverageGainBank,
CacheAverageGainChoEgg, CacheAverageGainChoEgg,
CacheAverageGainWrink, CacheAverageGainWrink,
CacheAverageGainWrinkFattest, CacheAverageGainWrinkFattest,
CacheAvgCPSWithChoEgg, // eslint-disable-line no-unused-vars CacheAvgCPSWithChoEgg,
CacheLastChoEgg, CacheLastChoEgg,
CacheLastClicks, CacheLastClicks,
CacheLastCookies, CacheLastCookies,
CacheLastCPSCheck, CacheLastCPSCheck,
CacheLastWrinkCookies, CacheLastWrinkCookies,
CacheLastWrinkFattestCookies, CacheLastWrinkFattestCookies,
CacheRealCookiesEarned, // eslint-disable-line no-unused-vars CacheRealCookiesEarned,
CacheSellForChoEgg, CacheSellForChoEgg,
CacheWrinklersFattest, CacheWrinklersFattest,
CacheWrinklersTotal, CacheWrinklersTotal,
@@ -22,7 +23,7 @@ import {
CookiesDiff, CookiesDiff,
WrinkDiff, WrinkDiff,
WrinkFattestDiff, WrinkFattestDiff,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions caches two variables related average CPS and Clicks * This functions caches two variables related average CPS and Clicks
@@ -88,9 +89,25 @@ 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,5 +1,6 @@
import { SimObjects } from '../../Sim/VariablesAndData'; import { SimObjects } from '../../Sim/VariablesAndData.js';
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import FillCMDCache from '../FillCMDCache.js';
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData.js';
/** /**
* This functions caches the current Wrinkler CPS multiplier * This functions caches the current Wrinkler CPS multiplier
@@ -26,4 +27,6 @@ export default function CacheCurrWrinklerCPS() {
(Game.Has('Sacrilegious corruption') * 0.05 + 1) * (Game.Has('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,5 +1,6 @@
import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc'; import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc.js';
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import FillCMDCache from '../FillCMDCache.js';
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData.js';
/** /**
* This function calculates CPS without the Golden Switch as it might be needed in other functions * This function calculates CPS without the Golden Switch as it might be needed in other functions
@@ -10,4 +11,6 @@ export default function CacheNoGoldSwitchCPS() {
if (Game.Has('Golden switch [off]')) { if (Game.Has('Golden switch [off]')) {
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS(); CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs; } else CacheNoGoldSwitchCookiesPS = Game.cookiesPs;
FillCMDCache({ CacheNoGoldSwitchCookiesPS });
} }

View File

@@ -1,5 +1,6 @@
import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg'; import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg.js';
import { CacheSellForChoEgg } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import FillCMDCache from '../FillCMDCache.js';
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
@@ -21,4 +22,6 @@ 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'; import { ClickTimes } from '../Disp/VariablesAndData.js';
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue'; import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue.js';
import CacheAvgCPS from './CPS/CPS'; import CacheAvgCPS from './CPS/CPS.js';
import CacheDragonAuras from './Dragon/CacheDragonAuras'; import CacheDragonAuras from './Dragon/CacheDragonAuras.js';
import CachePP from './PP/PP'; import CachePP from './PP/PP.js';
import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome'; import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome.js';
import { CacheChain } from './Stats/ChainCookies'; import { CacheChain } from './Stats/ChainCookies.js';
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips'; import CacheHeavenlyChipsPS from './Stats/HeavenlyChips.js';
import CacheAllMissingUpgrades from './Stats/MissingUpgrades'; import CacheAllMissingUpgrades from './Stats/MissingUpgrades.js';
import CacheSeasonSpec from './Stats/Reindeer'; import CacheSeasonSpec from './Stats/Reindeer.js';
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats'; import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats.js';
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement'; import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement.js';
import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData'; // eslint-disable-line no-unused-vars import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData.js'; // eslint-disable-line no-unused-vars
import CacheWrinklers from './Wrinklers/Wrinklers'; import CacheWrinklers from './Wrinklers/Wrinklers.js';
/** /**
* 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'; import FormatTime from '../Disp/BeautifyAndFormatting/FormatTime.js';
import GetCPS from '../Disp/HelperFunctions/GetCPS'; import GetCPS from '../Disp/HelperFunctions/GetCPS.js';
import CacheAvgCPS from './CPS/CPS'; import CacheAvgCPS from './CPS/CPS.js';
import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS'; import CacheCurrWrinklerCPS from './CPS/CurrWrinklerCPS.js';
import CachePP from './PP/PP'; import CachePP from './PP/PP.js';
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips'; import CacheHeavenlyChipsPS from './Stats/HeavenlyChips.js';
import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement'; import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement.js';
import { CacheTimeTillNextPrestige } from './VariablesAndData'; // eslint-disable-line no-unused-vars import { CacheTimeTillNextPrestige } from './VariablesAndData.js'; // eslint-disable-line no-unused-vars
import CacheWrinklers from './Wrinklers/Wrinklers'; import CacheWrinklers from './Wrinklers/Wrinklers.js';
/** /**
* 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'; // eslint-disable-line no-unused-vars import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData.js'; // eslint-disable-line no-unused-vars
/** /**
* This functions caches the currently selected Dragon Auras * This functions caches the currently selected Dragon Auras

View File

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

22
src/Cache/FillCMDCache.js Normal file
View File

@@ -0,0 +1,22 @@
/**
* Insert the provided values into `window.CookieMonsterData.Cache`.
*
* The initial 'Cache' is dropped from the name, so e.g. `CacheWrinklersTotal`
* becomes `window.CookieMonsterData.Cache.WrinklersTotal`.
*/
export default function FillCMDCache(caches) {
if (!('Cache' in window.CookieMonsterData)) {
window.CookieMonsterData.Cache = {};
}
Object.keys(caches).forEach((name) => {
const exportName = name.replace(/^Cache/, '');
if (typeof caches[name] === 'undefined') {
window.CookieMonsterData.Cache[exportName] = undefined;
} else {
// Passing through JSON ensures that no references are retained.
window.CookieMonsterData.Cache[exportName] = JSON.parse(JSON.stringify(caches[name]));
}
});
}

View File

@@ -1,15 +1,16 @@
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank'; import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank.js';
import { ColourGray } from '../../Disp/VariablesAndData'; import { ColourGray } from '../../Disp/VariablesAndData.js';
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheMinPP, // eslint-disable-line no-unused-vars CacheMinPP,
CacheMinPPBulk, // eslint-disable-line no-unused-vars CacheMinPPBulk,
CacheObjects1, CacheObjects1,
CacheObjects10, CacheObjects10,
CacheObjects100, CacheObjects100,
CachePPArray, CachePPArray,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
import ColourOfPP from './ColourOfPP'; import ColourOfPP from './ColourOfPP.js';
/** /**
* 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
@@ -106,4 +107,6 @@ 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'; import GetCPS from '../../Disp/HelperFunctions/GetCPS.js';
import { import {
ColourBlue, ColourBlue,
ColourGray, ColourGray,
@@ -7,8 +7,8 @@ import {
ColourPurple, ColourPurple,
ColourRed, ColourRed,
ColourYellow, ColourYellow,
} from '../../Disp/VariablesAndData'; } from '../../Disp/VariablesAndData.js';
import { CacheMinPP, CachePPArray } from '../VariablesAndData'; import { CacheMinPP, CachePPArray } from '../VariablesAndData.js';
/** /**
* 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,9 +1,14 @@
/** /**
* Section: Functions related to caching PP */ * Section: Functions related to caching PP */
import { CacheObjects1, CacheObjects10, CacheObjects100, CacheUpgrades } from '../VariablesAndData'; import {
import CacheBuildingsPP from './Building'; CacheObjects1,
import CacheUpgradePP from './Upgrade'; CacheObjects10,
CacheObjects100,
CacheUpgrades,
} from '../VariablesAndData.js';
import CacheBuildingsPP from './Building.js';
import CacheUpgradePP from './Upgrade.js';
/** /**
* This functions caches the PP of each building and upgrade and stores it in the cache * 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'; import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank.js';
import { CacheUpgrades } from '../VariablesAndData'; import { CacheUpgrades } from '../VariablesAndData.js';
import ColourOfPP from './ColourOfPP'; import ColourOfPP from './ColourOfPP.js';
/** /**
* 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,5 +1,6 @@
import CalculateChangeGod from '../../Sim/SimulationEvents/GodChange'; import CalculateChangeGod from '../../Sim/SimulationEvents/GodChange.js';
import { CacheGods } from '../VariablesAndData'; import FillCMDCache from '../FillCMDCache.js';
import { CacheGods } from '../VariablesAndData.js';
/** /**
* This functions caches the cps effect of each God in slot 1, 2 or 3 * This functions caches the cps effect of each God in slot 1, 2 or 3
@@ -10,4 +11,6 @@ export default function CachePantheonGods() {
CacheGods[god][slot] = CalculateChangeGod(god, slot); CacheGods[god][slot] = CalculateChangeGod(god, slot);
} }
} }
FillCMDCache({ CacheGods });
} }

View File

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

View File

@@ -1,22 +1,23 @@
import GetCPSBuffMult from '../CPS/GetCPSBuffMult'; import GetCPSBuffMult from '../CPS/GetCPSBuffMult.js';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheChainFrenzyMaxReward, CacheChainFrenzyMaxReward,
CacheChainFrenzyRequired, // eslint-disable-line no-unused-vars CacheChainFrenzyRequired,
CacheChainFrenzyRequiredNext, // eslint-disable-line no-unused-vars CacheChainFrenzyRequiredNext,
CacheChainFrenzyWrathMaxReward, CacheChainFrenzyWrathMaxReward,
CacheChainFrenzyWrathRequired, // eslint-disable-line no-unused-vars CacheChainFrenzyWrathRequired,
CacheChainFrenzyWrathRequiredNext, // eslint-disable-line no-unused-vars CacheChainFrenzyWrathRequiredNext,
CacheChainMaxReward, CacheChainMaxReward,
CacheChainRequired, // eslint-disable-line no-unused-vars CacheChainRequired,
CacheChainRequiredNext, // eslint-disable-line no-unused-vars CacheChainRequiredNext,
CacheChainWrathMaxReward, CacheChainWrathMaxReward,
CacheChainWrathRequired, // eslint-disable-line no-unused-vars CacheChainWrathRequired,
CacheChainWrathRequiredNext, // eslint-disable-line no-unused-vars CacheChainWrathRequiredNext,
CacheDragonsFortuneMultAdjustment, CacheDragonsFortuneMultAdjustment,
CacheGoldenCookiesMult, CacheGoldenCookiesMult,
CacheNoGoldSwitchCookiesPS, CacheNoGoldSwitchCookiesPS,
CacheWrathCookiesMult, CacheWrathCookiesMult,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions calculates the max possible payout given a set of variables * This functions calculates the max possible payout given a set of variables
@@ -89,4 +90,19 @@ 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,9 +1,10 @@
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheHCPerSecond, // eslint-disable-line no-unused-vars CacheHCPerSecond,
CacheLastHeavenlyCheck, CacheLastHeavenlyCheck,
CacheLastHeavenlyChips, CacheLastHeavenlyChips,
HeavenlyChipsDiff, HeavenlyChipsDiff,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* 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
@@ -32,4 +33,6 @@ 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'; import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades.js';
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'; } from '../VariablesAndData.js';
/** /**
* This functions caches variables related to missing upgrades * This functions caches variables related to missing upgrades
@@ -35,12 +35,10 @@ 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,4 +1,5 @@
import { CacheSeaSpec } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import FillCMDCache from '../FillCMDCache.js';
import { CacheSeaSpec } from '../VariablesAndData.js';
/** /**
* This functions caches the reward of popping a reindeer * This functions caches the reward of popping a reindeer
@@ -13,4 +14,6 @@ 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,23 +1,24 @@
/** Functions related to Caching stats */ /** Functions related to Caching stats */
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas'; import SimHas from '../../Sim/ReplacedGameFunctions/SimHas.js';
import GetCPSBuffMult from '../CPS/GetCPSBuffMult'; import GetCPSBuffMult from '../CPS/GetCPSBuffMult.js';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheConjure, CacheConjure,
CacheConjureReward, // eslint-disable-line no-unused-vars CacheConjureReward,
CacheDragonsFortuneMultAdjustment, CacheDragonsFortuneMultAdjustment,
CacheEdifice, CacheEdifice,
CacheEdificeBuilding, // eslint-disable-line no-unused-vars CacheEdificeBuilding,
CacheGoldenCookiesMult, CacheGoldenCookiesMult,
CacheLucky, CacheLucky,
CacheLuckyFrenzy, CacheLuckyFrenzy,
CacheLuckyReward, // eslint-disable-line no-unused-vars CacheLuckyReward,
CacheLuckyRewardFrenzy, // eslint-disable-line no-unused-vars CacheLuckyRewardFrenzy,
CacheLuckyWrathReward, // eslint-disable-line no-unused-vars CacheLuckyWrathReward,
CacheLuckyWrathRewardFrenzy, // eslint-disable-line no-unused-vars CacheLuckyWrathRewardFrenzy,
CacheNoGoldSwitchCookiesPS, CacheNoGoldSwitchCookiesPS,
CacheWrathCookiesMult, CacheWrathCookiesMult,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions caches variables related to the stats page * This functions caches variables related to the stats page
@@ -53,6 +54,19 @@ export function CacheStatsCookies() {
CacheEdificeBuilding = i; CacheEdificeBuilding = i;
} }
}); });
FillCMDCache({
CacheLucky,
CacheLuckyReward,
CacheLuckyWrathReward,
CacheLuckyFrenzy,
CacheLuckyRewardFrenzy,
CacheLuckyWrathRewardFrenzy,
CacheConjure,
CacheConjureReward,
CacheEdifice,
CacheEdificeBuilding,
});
} }
/** /**
@@ -84,4 +98,10 @@ export function CacheGoldenAndWrathCookiesMults() {
if (Game.shimmerTypes.golden.n === 0) { 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,6 +1,7 @@
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js';
import { CacheObjectsNextAchievement } from '../VariablesAndData'; import FillCMDCache from '../FillCMDCache.js';
import IndividualAmountTillNextAchievement from './IndividualAmountTillNextAchievement'; import { CacheObjectsNextAchievement } from '../VariablesAndData.js';
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
@@ -41,5 +42,7 @@ export default function AllAmountTillNextAchievement(forceRecalc) {
}; };
} }
}); });
CacheObjectsNextAchievement = result; // eslint-disable-line no-unused-vars CacheObjectsNextAchievement = result;
FillCMDCache({ CacheObjectsNextAchievement });
} }

View File

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

View File

@@ -1,11 +1,12 @@
/** Caches data related to Wrinklers */ /** Caches data related to Wrinklers */
import { SimObjects } from '../../Sim/VariablesAndData'; import { SimObjects } from '../../Sim/VariablesAndData.js';
import FillCMDCache from '../FillCMDCache.js';
import { import {
CacheWrinklersFattest, CacheWrinklersFattest,
CacheWrinklersNormal, // eslint-disable-line no-unused-vars CacheWrinklersNormal,
CacheWrinklersTotal, // eslint-disable-line no-unused-vars CacheWrinklersTotal,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* This functions caches data related to Wrinklers * This functions caches data related to Wrinklers
@@ -37,4 +38,6 @@ 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,6 +10,7 @@ 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'; import UpdateBackground from '../Disp/HelperFunctions/UpdateBackground.js';
/** /**
* 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'; import { saveAndLoadingFunctions } from '@cookiemonsterteam/cookiemonsterframework/src/index.js';
/** 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'; import { UpdateBotBar } from '../../Disp/InfoBars/BottomBar.js';
import { UpdateBotTimerBarPosition } from '../SpecificToggles'; import { UpdateBotTimerBarPosition } from '../SpecificToggles.js';
/** /**
* This function toggle the bottom bar * This function toggle the bottom bar

View File

@@ -1,5 +1,5 @@
import { CMSayTime } from '../../Disp/VariablesAndData'; import { CMSayTime } from '../../Disp/VariablesAndData.js';
import { BackupFunctions } from '../../Main/VariablesAndData'; import { BackupFunctions } from '../../Main/VariablesAndData.js';
/** /**
* 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'; import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData.js';
import { GCTimers } from '../../Disp/VariablesAndData'; import { GCTimers } from '../../Disp/VariablesAndData.js';
/** /**
* 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'; import UpdateUpgrades from '../../Disp/BuildingsUpgrades/Upgrades.js';
/** /**
* 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'; import init from './InitSaveLoad/init.js';
import load from './InitSaveLoad/load'; import load from './InitSaveLoad/load.js';
import save from './InitSaveLoad/save'; import save from './InitSaveLoad/save.js';
const CM = { const CM = {
init, init,
@@ -8,8 +8,16 @@ const CM = {
save, save,
}; };
Game.registerMod('CookieMonster', CM); if (typeof Steam !== 'undefined') {
// Need to add a delay for steam
setTimeout(() => {
Game.registerMod('CookieMonster', CM);
// Game.registerMod also calls CM.load() which calls the loop hook // 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: string[] = [ export const Fortunes = [
'Fortune #001', 'Fortune #001',
'Fortune #002', 'Fortune #002',
'Fortune #003', 'Fortune #003',
@@ -20,6 +20,8 @@ export const Fortunes: string[] = [
'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',
@@ -28,7 +30,7 @@ export const Fortunes: string[] = [
]; ];
/** Array of the names of all Halloween cookies */ /** Array of the names of all Halloween cookies */
export const HalloCookies: string[] = [ export const HalloCookies = [
'Skull cookies', 'Skull cookies',
'Ghost cookies', 'Ghost cookies',
'Bat cookies', 'Bat cookies',
@@ -39,7 +41,7 @@ export const HalloCookies: string[] = [
]; ];
/** Array of the names of all Christmas cookies */ /** Array of the names of all Christmas cookies */
export const ChristCookies: string[] = [ export const ChristCookies = [
'Christmas tree biscuits', 'Christmas tree biscuits',
'Snowflake biscuits', 'Snowflake biscuits',
'Snowman biscuits', 'Snowman biscuits',
@@ -50,7 +52,7 @@ export const ChristCookies: string[] = [
]; ];
/** Array of the names of all Valentine cookies */ /** Array of the names of all Valentine cookies */
export const ValCookies: string[] = [ export const ValCookies = [
'Pure heart biscuits', 'Pure heart biscuits',
'Ardent heart biscuits', 'Ardent heart biscuits',
'Sour heart biscuits', 'Sour heart biscuits',
@@ -61,7 +63,7 @@ export const ValCookies: string[] = [
]; ];
/** Array of the names of all plant drops */ /** Array of the names of all plant drops */
export const PlantDrops: string[] = [ export const PlantDrops = [
'Elderwort biscuits', 'Elderwort biscuits',
'Bakeberry cookies', 'Bakeberry cookies',
'Duketater cookies', 'Duketater cookies',
@@ -72,7 +74,7 @@ export const PlantDrops: string[] = [
]; ];
/** 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: { [index: string]: string } = { export const Effects = {
buildingCost: 'Building prices', buildingCost: 'Building prices',
click: 'Cookies per click', click: 'Cookies per click',
cps: 'Total CPS', cps: 'Total CPS',

21
src/Data/Moddata.js Normal file
View File

@@ -0,0 +1,21 @@
/** Data related directly to Cookie Monster */
export const VersionMajor = '2.053';
export const VersionMinor = '10';
/** Information about Cookie Monster to be displayed in the info section */
export const ModDescription = `<a href="https://github.com/CookieMonsterTeam/CookieMonster" target="blank">Cookie Monster</a>
offers a wide range of tools and statistics to enhance your game experience.
It is not a cheat interface although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.</br>
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
Please also report any bugs you may find over there!</br>
`;
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
export const LatestReleaseNotes = `This update adds support for some parts of cookie clicker 2.048</br>
- added support for Dragon Aura 'Supreme Intellect' in the pantheon calculations</br>
- added support for new tiers of Shimmering veil</br>
- added support for unshackled upgrades</br>
- updated some simulator logic to more cloesly match updated cookie clicker logic</br>
- Bugfix: conjure backed goods tooltip used cached no gold switch raw cps instead of live cps</br>
- Bugfix: negative calculations due to glucosimium upgrades, kittens, unshackled, and achievements</br>`;

View File

@@ -1,25 +0,0 @@
/** Data related directly to Cookie Monster */
export const VersionMajor = '2.031';
export const VersionMinor = '10';
/** Information about Cookie Monster to be displayed in the info section */
export const ModDescription = `<a href="https://github.com/CookieMonsterTeam/CookieMonster" target="blank">Cookie Monster</a>
offers a wide range of tools and statistics to enhance your game experience.
It is not a cheat interface although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.</br>
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
Please also report any bugs you may find over there!</br>
`;
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
export const LatestReleaseNotes = `This update implements the following functions:</br>
- This updates adds a number of performance improvements which make CookieMonster about 33% more efficient</br>
- Added a button to all buildings in the middle section that can "lock" the building. This makes the building unclickable, which might be useful for frantic clicking during cookie storms</br>
- Added a percentage to the Golden Cookie timer bar</br>
</br>
This update fixes the following bugs:
- Fix considerable lag on the Ascension screen when using the monospace font</br>
- Fix sound playing at start-up</br>
- Fix building tooltips and warnings not updating correctly</br>
- Fix upgrade bar not displaying</br>
- Fix loading of mod when no save was found</br>`;

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: string[] = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']; export const metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
/** Array of abbreviations used in the "Short" scale */ /** Array of abbreviations used in the "Short" scale */
export const shortScale: string[] = [ export const shortScale = [
'', '',
'', '',
'M', 'M',
@@ -34,7 +34,7 @@ export const shortScale: string[] = [
]; ];
/** Array of abbreviations used in the "Abbreviated Short" scale */ /** Array of abbreviations used in the "Abbreviated Short" scale */
export const shortScaleAbbreviated: string[] = [ export const shortScaleAbbreviated = [
'', '',
'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: { [index: string]: string } = { export const ConfigGroups = {
Favourite: 'Favourite Settings', Favourite: 'Favourite Settings',
Calculation: 'Calculation', Calculation: 'Calculation',
Notation: 'Notation', Notation: 'Notation',
@@ -14,7 +14,7 @@ export const ConfigGroups: { [index: string]: string } = {
}; };
/** Display titles of the headers of the notification section of the Cookie Monster settings */ /** Display titles of the headers of the notification section of the Cookie Monster settings */
export const ConfigGroupsNotification: { [index: string]: string } = { export const ConfigGroupsNotification = {
NotificationGeneral: 'General Notifications', 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'; import { settingClasses } from '@cookiemonsterteam/cookiemonsterframework/src/index.js';
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions'; import CheckNotificationPermissions from '../Config/CheckNotificationPermissions.js';
import RefreshScale from '../Disp/HelperFunctions/RefreshScale'; import RefreshScale from '../Disp/HelperFunctions/RefreshScale.js';
import { SimDoSims } from '../Sim/VariablesAndData'; // eslint-disable-line no-unused-vars import { SimDoSims } from '../Sim/VariablesAndData.js'; // eslint-disable-line no-unused-vars
import ToggleBotBar from '../Config/Toggles/ToggleBotBar'; import ToggleBotBar from '../Config/Toggles/ToggleBotBar.js';
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime'; import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime.js';
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer'; import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer.js';
import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons'; import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons.js';
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos'; import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos.js';
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour'; import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour.js';
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos'; import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos.js';
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons'; import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons.js';
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings'; import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings.js';
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon'; import { UpdateFavicon } from '../Disp/TabTitle/FavIcon.js';
import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight'; import UpdateUpgradeSectionsHeight from '../Disp/BuildingsUpgrades/UpdateUpgradeSectionsHeight.js';
import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades'; import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades.js';
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles'; import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles.js';
/** 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 XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX', 'Time XXx, XXx'],
'Change the time format', 'Change the time format',
false, false,
), ),
@@ -549,6 +549,14 @@ 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.ts'; import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.js';
import { BackupFunctions } from '../../Main/VariablesAndData'; import { BackupFunctions } from '../../Main/VariablesAndData.js';
/** /**
* This function returns formats number based on the Scale setting * This function returns formats number based on the Scale setting

View File

@@ -5,6 +5,7 @@
* @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';
@@ -15,7 +16,18 @@ 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}:`;
@@ -23,18 +35,23 @@ 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';
str += if (y > 0) {
y > 0 str += `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, `;
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}`;
: ''; } else if (d > 0) {
if (str.length > 0 || d > 0) str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `;
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `; // eslint-disable-line no-nested-ternary str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}`;
if (str.length > 0 || h > 0) } else if (h > 0) {
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; // eslint-disable-line no-nested-ternary str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
if (str.length > 0 || m > 0) str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}`;
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; // eslint-disable-line no-nested-ternary } else if (m > 0) {
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's'); // eslint-disable-line no-nested-ternary str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
} else {
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
}
} }
return str; return str;
} }

View File

@@ -1,5 +1,5 @@
import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData'; import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData.js';
import FormatTime from './FormatTime'; import FormatTime from './FormatTime.js';
/** /**
* 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) if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat === 1)
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'; } from '../../Cache/VariablesAndData.js';
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding'; import BuildingSell from '../../Sim/SimulationEvents/SellBuilding.js';
import Beautify from '../BeautifyAndFormatting/Beautify'; import Beautify from '../BeautifyAndFormatting/Beautify.js';
import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData'; import { ColoursOrdering, LastTargetBuildings } from '../VariablesAndData.js';
/** /**
* 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'; } from '../VariablesAndData.js';
/** /**
* 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'; import { CacheUpgrades } from '../../Cache/VariablesAndData.js';
import { import {
ColourBackPre, ColourBackPre,
ColourBlue, ColourBlue,
@@ -9,7 +9,7 @@ import {
ColourRed, ColourRed,
ColoursOrdering, ColoursOrdering,
ColourYellow, ColourYellow,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* 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'; import CacheDragonCost from '../../Cache/Dragon/Dragon.js';
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData'; import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData.js';
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange'; import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange.js';
import Beautify from '../BeautifyAndFormatting/Beautify'; import Beautify from '../BeautifyAndFormatting/Beautify.js';
import FormatTime from '../BeautifyAndFormatting/FormatTime'; import FormatTime from '../BeautifyAndFormatting/FormatTime.js';
/** /**
* 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,13 +1,12 @@
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons'; import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons.js';
import Beautify from './BeautifyAndFormatting/Beautify'; import UpdateBuildings from './BuildingsUpgrades/Buildings.js';
import UpdateBuildings from './BuildingsUpgrades/Buildings'; import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight.js';
import UpdateUpgradeSectionsHeight from './BuildingsUpgrades/UpdateUpgradeSectionsHeight'; import UpdateUpgrades from './BuildingsUpgrades/Upgrades.js';
import UpdateUpgrades from './BuildingsUpgrades/Upgrades'; import { UpdateBotBar } from './InfoBars/BottomBar.js';
import { UpdateBotBar } from './InfoBars/BottomBar'; import { UpdateTimerBar } from './InfoBars/TimerBar.js';
import { UpdateTimerBar } from './InfoBars/TimerBar'; import RefreshMenu from './MenuSections/Refreshmenu.js';
import RefreshMenu from './MenuSections/Refreshmenu'; import UpdateTooltips from './Tooltips/UpdateTooltips.js';
import UpdateTooltips from './Tooltips/UpdateTooltips'; import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips.js';
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.
@@ -50,11 +49,4 @@ export default function CMDrawHook() {
// Update display of wrinkler buttons, this checks if Elder Pledge has been bought and if they should be disabled // 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'; import { GCTimers } from '../VariablesAndData.js';
/** /**
* This function creates a new Golden Cookie Timer and appends it CM.Disp.GCTimers based on the id of the cookie * This function creates a new Golden Cookie Timer and appends it CM.Disp.GCTimers based on the id of the cookie

View File

@@ -0,0 +1,104 @@
const SPECIAL_DIGIT = 7;
/**
* Count the number of 7s in any number
* @param {number} number The number to count sevens for
* @returns {number} The number of 7s in the provided number
*/
export function CountSevens(number) {
return String(number).split(String(SPECIAL_DIGIT)).length - 1;
}
/**
* Calculate the delta for the next number where the given digit is a 7
* @param {number} number The starting number to calculate the delta for
* @param {number} digitPlace 1 for ones place, 10 for tens place, 100 for hundreds place, etc
* @returns {number} The calculated delta
*/
export function CalculateSevenDelta(number, digitPlace) {
const target = SPECIAL_DIGIT * digitPlace;
const modulus = digitPlace * 10;
let delta = target - (number % modulus) + (number % digitPlace);
if (delta < 0) delta += modulus;
return delta;
}
/**
* This function calculates each of the next "lucky" prestige levels
* @param {number} currentLevel The user's prestige level, including levels earned since the last ascension
* @returns {{number}, {number}, {number}} luckyDigit, luckyNumber, luckyPayout The next eligible level for each upgrade
*/
export default function CalculateLuckyLevels(currentLevel) {
const result = {};
let sevenCount = CountSevens(currentLevel);
const numberOfDigits = Math.max(Math.floor(Math.log10(Math.abs(currentLevel))), 0) + 1;
if (sevenCount >= 1) {
result.luckyDigit = currentLevel;
if (sevenCount >= 2) {
result.luckyNumber = currentLevel;
if (sevenCount >= 4) {
result.luckyPayout = currentLevel;
return result;
}
}
}
// Consider only top 15 digits if it is big number
let localLevel;
if (numberOfDigits >= 16) {
localLevel = Math.ceil(currentLevel / 10 ** (numberOfDigits - 15));
} else {
localLevel = currentLevel;
}
sevenCount = CountSevens(localLevel);
if (result.luckyDigit === undefined) {
if (sevenCount < 1) {
const delta = CalculateSevenDelta(localLevel, 1);
localLevel += delta;
sevenCount = CountSevens(localLevel);
}
result.luckyDigit = localLevel;
if (numberOfDigits >= 16) {
result.luckyDigit *= 10 ** Number(numberOfDigits - 15);
}
}
if (result.luckyNumber === undefined) {
while (sevenCount < 2) {
let delta = CalculateSevenDelta(localLevel, 1);
if (delta === 0) delta = CalculateSevenDelta(localLevel, 10);
localLevel += delta;
sevenCount = CountSevens(localLevel);
}
result.luckyNumber = localLevel;
if (numberOfDigits >= 16) {
result.luckyNumber *= 10 ** Number(numberOfDigits - 15);
}
}
let digitPlace = 1;
while (sevenCount < 4) {
const delta = CalculateSevenDelta(localLevel, digitPlace);
if (delta === 0) {
digitPlace *= 10;
} else {
localLevel += delta;
sevenCount = CountSevens(localLevel);
}
}
result.luckyPayout = localLevel;
if (numberOfDigits >= 16) {
result.luckyPayout *= 10 ** Number(numberOfDigits - 15);
}
return result;
}

View File

@@ -0,0 +1,52 @@
/**
* This function calculates a stock's next expected value
* @param {number} value The stock's current value
* @param {number} delta The stock's current delta
* @param {number} restingValue The stock's resting value
* @param {number} mode The stock's current mode
* @param {number} bankLevel The bank building level
* @param {number} dragonBoost The current aura multiplier from Supreme Intellect and Reality Bending
* @returns {number} value + delta The stock's next expected value
*/
export default function CalculateStockNextExpectedValue(
pValue,
pDelta,
restingValue,
mode,
bankLevel,
dragonBoost,
) {
let value = pValue;
let delta = pDelta;
delta *= 0.97 + 0.01 * dragonBoost;
switch (mode) {
case 0:
delta *= 0.95;
break;
case 1:
delta *= 0.99;
delta += 0.02;
break;
case 2:
delta *= 0.99;
delta -= 0.02;
break;
case 3:
delta += 0.06;
value += 2.5;
break;
case 4:
delta -= 0.06;
value -= 2.5;
break;
default:
break;
}
value += (restingValue - value) * 0.01;
if (mode === 3) value -= 0.582;
if (mode === 4) value += 0.6;
if (value > 100 + (bankLevel - 1) * 3 && delta > 0) delta *= 0.9;
if (value < 5) value += (5 - value) * 0.5;
if (value < 5 && delta < 0) delta *= 0.95;
return Math.max(value + delta, 1);
}

View File

@@ -3,7 +3,7 @@ import {
CacheCurrWrinklerCount, CacheCurrWrinklerCount,
CacheCurrWrinklerCPSMult, CacheCurrWrinklerCPSMult,
CacheWrinklersFattest, CacheWrinklersFattest,
} from '../../Cache/VariablesAndData'; } from '../../Cache/VariablesAndData.js';
/** /**
* 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'; } from '../VariablesAndData.js';
/** /**
* 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'; import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData.js';
/** /**
* 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'; import UpdateBuildings from '../BuildingsUpgrades/Buildings.js';
import UpdateUpgrades from '../BuildingsUpgrades/Upgrades'; import UpdateUpgrades from '../BuildingsUpgrades/Upgrades.js';
import { UpdateBotBar } from '../InfoBars/BottomBar'; import { UpdateBotBar } from '../InfoBars/BottomBar.js';
/** /**
* 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'; import { ToggleTimerBar } from '../../Config/SpecificToggles.js';
import ToggleBotBar from '../../Config/Toggles/ToggleBotBar'; import ToggleBotBar from '../../Config/Toggles/ToggleBotBar.js';
import UpdateBackground from './UpdateBackground'; import UpdateBackground from './UpdateBackground.js';
/** /**
* This function disables and shows the bars created by CookieMonster when the game is "ascending" * 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'; import UpdateBuildings from '../BuildingsUpgrades/Buildings.js';
import { import {
ColourBackPre, ColourBackPre,
ColourBorderPre, ColourBorderPre,
ColoursOrdering, ColoursOrdering,
ColourTextPre, ColourTextPre,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
/** /**
* 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'; import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData.js';
import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts'; import { VersionMajor, VersionMinor } from '../../Data/Moddata.js';
import Beautify from '../BeautifyAndFormatting/Beautify'; import Beautify from '../BeautifyAndFormatting/Beautify.js';
import FormatTime from '../BeautifyAndFormatting/FormatTime'; import FormatTime from '../BeautifyAndFormatting/FormatTime.js';
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour'; import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour.js';
import GetCPS from '../HelperFunctions/GetCPS'; import GetCPS from '../HelperFunctions/GetCPS.js';
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank'; import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank.js';
import { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData'; import { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData.js';
import { CreateBotBarBuildingColumn } from './CreateDOMElements'; import { CreateBotBarBuildingColumn } from './CreateDOMElements.js';
/** /**
* 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,9 +98,8 @@ 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[ l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent =
count `${timeColour.text} (with Wrink)`;
].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'; import { ColourBackPre, ColourBlue, ColourTextPre } from '../VariablesAndData.js';
/** /**
* 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'; import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles.js';
import { import {
BuffColours, BuffColours,
ColourBackPre, ColourBackPre,
@@ -8,8 +8,9 @@ import {
ColourOrange, ColourOrange,
ColourPurple, ColourPurple,
LastNumberOfTimers, LastNumberOfTimers,
} from '../VariablesAndData'; } from '../VariablesAndData.js';
import { CreateTimer } from './CreateDOMElements'; import { CreateTimer } from './CreateDOMElements.js';
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')
@@ -124,11 +125,18 @@ 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', { )} `;
style: 'percent', if (finalChance < 0.01) {
})}`; 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';
@@ -167,11 +175,18 @@ 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', { )} `;
style: 'percent', if (deerFinalChance < 0.01) {
})}`; 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'; import { CacheWrinklersFattest } from '../../Cache/VariablesAndData.js';
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers'; import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers.js';
import { CreateTooltip } from '../Tooltips/Tooltip'; import { CreateTooltip } from '../Tooltips/Tooltip.js';
/** /**
* 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'; import { DispCSS } from '../VariablesAndData.js';
/** /**
* 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,4 +1,5 @@
import AddMenuStats from './Statistics/AddStatsPage'; import createMenuOptions from './createMenuOptions.js';
import AddMenuStats from './Statistics/AddStatsPage.js';
/** /**
* This function adds the calll the functions to add extra info to the stats and options pages * This function adds the calll the functions to add extra info to the stats and options pages
@@ -12,5 +13,11 @@ export default function AddMenu() {
title.textContent = 'Cookie Monster Statistics'; 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'; import { AddMissingUpgrades } from './CreateMissingUpgrades.js';
import * as CreateSections from './CreateStatsSections'; import * as CreateSections from './CreateStatsSections.js';
import * as CreateElements from './CreateDOMElements'; import * as CreateElements from './CreateDOMElements.js';
import * as GameData from '../../../Data/Gamedata.ts'; import * as GameData from '../../../Data/Gamedata.js';
import { import {
CacheAverageClicks, CacheAverageClicks,
@@ -12,12 +12,12 @@ import {
CacheWrinklersFattest, CacheWrinklersFattest,
CacheWrinklersNormal, CacheWrinklersNormal,
CacheWrinklersTotal, CacheWrinklersTotal,
} from '../../../Cache/VariablesAndData'; } from '../../../Cache/VariablesAndData.js';
import PopAllNormalWrinklers from '../../HelperFunctions/PopWrinklers'; import PopAllNormalWrinklers from '../../HelperFunctions/PopWrinklers.js';
import { ClickTimes, CookieTimes } from '../../VariablesAndData'; import { ClickTimes, CookieTimes } from '../../VariablesAndData.js';
import GetCPS from '../../HelperFunctions/GetCPS'; import GetCPS from '../../HelperFunctions/GetCPS.js';
import Beautify from '../../BeautifyAndFormatting/Beautify'; import Beautify from '../../BeautifyAndFormatting/Beautify.js';
import AddMissingAchievements from './CreateMissingAchievements'; import AddMissingAchievements from './CreateMissingAchievements.js';
/** /**
* 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'; import { ToggleHeader } from '../../../Config/ToggleSetting.js';
import { SimpleTooltipElements } from '../../VariablesAndData'; import { SimpleTooltipElements } from '../../VariablesAndData.js';
/** /**
* This function creates a header-object for the stats page * 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'; } from '../../../Cache/VariablesAndData.js';
/** /**
* 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,8 +13,7 @@ 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 = const prestigeUpgradesMissing = CacheMissingUpgradesPrestige.match(/div/g || []).length / 2;
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';
@@ -30,8 +29,7 @@ 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 = const normalUpgradesMissing = CacheMissingUpgrades.match(/div/g || []).length / 2;
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';
@@ -54,8 +52,7 @@ export function AddMissingUpgrades() {
); );
} }
if (CacheMissingUpgradesCookies) { if (CacheMissingUpgradesCookies) {
const cookieUpgradesMissing = const cookieUpgradesMissing = CacheMissingUpgradesCookies.match(/div/g || []).length / 2;
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.ts'; import * as GameData from '../../../Data/Gamedata.js';
import { MaxChainCookieReward } from '../../../Cache/Stats/ChainCookies'; import { MaxChainCookieReward } from '../../../Cache/Stats/ChainCookies.js';
import { import {
CacheAvgCPSWithChoEgg, CacheAvgCPSWithChoEgg,
CacheCentEgg, CacheCentEgg,
@@ -35,19 +35,20 @@ import {
CacheSeaSpec, CacheSeaSpec,
CacheWrathCookiesMult, CacheWrathCookiesMult,
CacheWrinklersTotal, CacheWrinklersTotal,
} from '../../../Cache/VariablesAndData'; } from '../../../Cache/VariablesAndData.js';
import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension'; import ResetBonus from '../../../Sim/SimulationEvents/ResetAscension.js';
import GetCPS from '../../HelperFunctions/GetCPS'; import CalculateLuckyLevels from '../../HelperFunctions/CalculateLuckyLevels.js';
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank'; import GetCPS from '../../HelperFunctions/GetCPS.js';
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData'; import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank.js';
import { ColourGreen, ColourRed, ColourTextPre } from '../../VariablesAndData.js';
import { import {
StatsListing, StatsListing,
StatsHeader, StatsHeader,
StatsMissDisp, StatsMissDisp,
StatsMissDispListing, StatsMissDispListing,
} from './CreateDOMElements'; } from './CreateDOMElements.js';
import Beautify from '../../BeautifyAndFormatting/Beautify'; import Beautify from '../../BeautifyAndFormatting/Beautify.js';
import FormatTime from '../../BeautifyAndFormatting/FormatTime'; import FormatTime from '../../BeautifyAndFormatting/FormatTime.js';
/** /**
* This function creates the "Lucky" section of the stats page * This function creates the "Lucky" section of the stats page
@@ -436,6 +437,33 @@ export function SpellsSection() {
), ),
); );
} }
const { minigame } = Game.Objects['Wizard tower'];
const spellsCast = minigame.spellsCastTotal;
const spellsNeeded = (function (val) {
switch (true) {
case val < 9:
return 9 - val;
case val < 99:
return 99 - val;
case val < 999:
return 999 - val;
default:
return 'NA';
}
})(spellsCast);
section.appendChild(
StatsListing(
'basic',
'Spells cast',
spellsCast < 999
? document.createTextNode(
`Next achievement in ${spellsNeeded}, current total: ${Beautify(spellsCast)}`,
)
: document.createTextNode(`No new achievement, current total: ${Beautify(spellsCast)}`),
),
);
return section; return section;
} }
@@ -606,46 +634,47 @@ 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')) {
let delta7 = 7 - (willHave % 10); const luckyDigitDelta = luckyDigit - willHave;
if (delta7 < 0) delta7 += 10; const luckyDigitReset = willGet + luckyDigitDelta;
const next7Reset = willGet + delta7; const fragLuckyDigit = document.createDocumentFragment();
const next7Total = willHave + delta7; fragLuckyDigit.appendChild(
const frag7 = document.createDocumentFragment();
frag7.appendChild(
document.createTextNode( document.createTextNode(
`${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`, `${luckyDigit.toLocaleString()} / ${luckyDigitReset.toLocaleString()} (+${luckyDigitDelta})`,
), ),
); );
section.appendChild(StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7)); section.appendChild(
StatsListing('basic', 'Next "Lucky Digit" (total / reset)', fragLuckyDigit),
);
} }
if (!Game.Has('Lucky number')) { if (!Game.Has('Lucky number')) {
let delta777 = 777 - (willHave % 1000); const luckyNumberDelta = luckyNumber - willHave;
if (delta777 < 0) delta777 += 1000; const luckyNumberReset = willGet + luckyNumberDelta;
const next777Reset = willGet + delta777; const fragLuckyNumber = document.createDocumentFragment();
const next777Total = willHave + delta777; fragLuckyNumber.appendChild(
const frag777 = document.createDocumentFragment();
frag777.appendChild(
document.createTextNode( document.createTextNode(
`${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`, `${luckyNumber.toLocaleString()} / ${luckyNumberReset.toLocaleString()} (+${luckyNumberDelta})`,
), ),
); );
section.appendChild(StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777)); section.appendChild(
StatsListing('basic', 'Next "Lucky Number" (total / reset)', fragLuckyNumber),
);
} }
if (!Game.Has('Lucky payout')) { if (!Game.Has('Lucky payout')) {
let delta777777 = 777777 - (willHave % 1000000); const luckyPayoutDelta = luckyPayout - willHave;
if (delta777777 < 0) delta777777 += 1000000; const luckyPayoutReset = willGet + luckyPayoutDelta;
const next777777Reset = willGet + delta777777; const fragLuckyPayout = document.createDocumentFragment();
const next777777Total = willHave + delta777777; fragLuckyPayout.appendChild(
const frag777777 = document.createDocumentFragment();
frag777777.appendChild(
document.createTextNode( document.createTextNode(
`${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`, `${luckyPayout.toLocaleString()} / ${luckyPayoutReset.toLocaleString()} (+${luckyPayoutDelta})`,
), ),
); );
section.appendChild(StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777)); section.appendChild(
StatsListing('basic', 'Next "Lucky Payout" (total / reset)', fragLuckyPayout),
);
} }
return section; return section;

View File

@@ -1,5 +1,5 @@
import { menuFunctions } from '@cookiemonsterteam/cookiemonsterframework'; import { menuFunctions } from '@cookiemonsterteam/cookiemonsterframework';
import { LatestReleaseNotes, ModDescription } from '../../Data/Moddata.ts'; import { LatestReleaseNotes, ModDescription } from '../../Data/Moddata.js';
/** /**
* Creates the <div> to be added to the Info section * 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.ts'; import { ConfigGroups, ConfigGroupsNotification } from '../../Data/Sectionheaders.js';
import settings from '../../Data/settings'; import settings from '../../Data/settings.js';
import UpdateColours from '../HelperFunctions/UpdateColours'; import UpdateColours from '../HelperFunctions/UpdateColours.js';
import RefreshScale from '../HelperFunctions/RefreshScale'; import RefreshScale from '../HelperFunctions/RefreshScale.js';
/** /**
* 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'; import { CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData.js';
import { LastGoldenCookieState } from '../../Main/VariablesAndData'; import { LastGoldenCookieState } from '../../Main/VariablesAndData.js';
/** /**
* 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'; import { CacheSeasonPopShimmer, CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData.js';
import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData'; import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData.js';
import { Title } from '../VariablesAndData'; import { Title } from '../VariablesAndData.js';
/** /**
* 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'; } from '../../Cache/VariablesAndData.js';
import Beautify from '../BeautifyAndFormatting/Beautify'; import Beautify from '../BeautifyAndFormatting/Beautify.js';
/** /**
* 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'; } from '../VariablesAndData.js';
/** Creates various sections of tooltips */ /** Creates various sections of tooltips */

View File

@@ -1,8 +1,8 @@
import UpdateTooltips from './UpdateTooltips'; import UpdateTooltips from './UpdateTooltips.js';
import { SimpleTooltipElements, TooltipName, TooltipType } from '../VariablesAndData'; // eslint-disable-line no-unused-vars import { SimpleTooltipElements, TooltipName, TooltipType } from '../VariablesAndData.js'; // eslint-disable-line no-unused-vars
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding.js';
import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour'; import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour.js';
import Beautify from '../BeautifyAndFormatting/Beautify'; import Beautify from '../BeautifyAndFormatting/Beautify.js';
/** All general functions related to creating and updating tooltips */ /** All general functions related to creating and updating tooltips */
@@ -98,6 +98,8 @@ 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')
@@ -111,6 +113,7 @@ 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'; import ColourOfPP from '../../../Cache/PP/ColourOfPP.js';
import { import {
CacheObjects1, CacheObjects1,
CacheObjects10, CacheObjects10,
CacheObjects100, CacheObjects100,
CacheObjectsNextAchievement, CacheObjectsNextAchievement,
} from '../../../Cache/VariablesAndData'; } from '../../../Cache/VariablesAndData.js';
import BuyBuildingsBonusIncome from '../../../Sim/SimulationEvents/BuyBuildingBonusIncome'; import BuyBuildingsBonusIncome from '../../../Sim/SimulationEvents/BuyBuildingBonusIncome.js';
import { SimObjects } from '../../../Sim/VariablesAndData'; import { SimObjects } from '../../../Sim/VariablesAndData.js';
import Beautify from '../../BeautifyAndFormatting/Beautify'; import Beautify from '../../BeautifyAndFormatting/Beautify.js';
import FormatTime from '../../BeautifyAndFormatting/FormatTime'; import FormatTime from '../../BeautifyAndFormatting/FormatTime.js';
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour'; import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour.js';
import GetCPS from '../../HelperFunctions/GetCPS'; import GetCPS from '../../HelperFunctions/GetCPS.js';
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank'; import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank.js';
import { import {
ColourTextPre, ColourTextPre,
LastTargetTooltipBuilding, LastTargetTooltipBuilding,
TooltipBonusIncome, TooltipBonusIncome,
TooltipName, TooltipName,
TooltipPrice, TooltipPrice,
} from '../../VariablesAndData'; } from '../../VariablesAndData.js';
import * as Create from '../CreateTooltip'; import * as Create from '../CreateTooltip.js';
/** /**
* 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'; import Beautify from '../../BeautifyAndFormatting/Beautify.js';
import { TooltipName } from '../../VariablesAndData'; import { TooltipName } from '../../VariablesAndData.js';
import * as Create from '../CreateTooltip'; import * as Create from '../CreateTooltip.js';
/** /**
* 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 === 'Bakeberry') { if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
l('CMTooltipPlantReward').textContent = `${
mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : '0'
} / ${Beautify(Game.cookiesPs * 60 * 30)}`;
} else if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
l('CMTooltipPlantReward').textContent = `${ l('CMTooltipPlantReward').textContent = `${
mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : '0' mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : '0'
} / ${Beautify(Game.cookiesPs * 60 * 3)}`; } / ${Beautify(Game.cookiesPs * 60 * 3)}`;
} else if (plantName === 'Bakeberry') {
l('CMTooltipPlantReward').textContent = `${
mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : '0'
} / ${Beautify(Game.cookiesPs * 60 * 30)}`;
} else if (plantName === 'Queenbeet') { } 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,11 +1,8 @@
import { CacheNoGoldSwitchCookiesPS } from '../../../Cache/VariablesAndData'; import Beautify from '../../BeautifyAndFormatting/Beautify.js';
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour.js';
import Beautify from '../../BeautifyAndFormatting/Beautify'; import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime.js';
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour'; import { ColourTextPre, TooltipName } from '../../VariablesAndData.js';
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime'; import * as Create from '../CreateTooltip.js';
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
@@ -58,10 +55,7 @@ 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.min( Math.max(Math.min(Game.cookies * 0.15, Game.cookiesPs * 60 * 30), 7),
(Game.cookies + GetWrinkConfigBank()) * 0.15,
CacheNoGoldSwitchCookiesPS * 60 * 30,
),
2, 2,
); );
conjure.appendChild(reward); conjure.appendChild(reward);
@@ -70,7 +64,10 @@ 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(CacheNoGoldSwitchCookiesPS * 60 * 15, 2); loss.textContent = Beautify(
Math.min(Game.cookies, Math.min(Game.cookies * 0.15, Game.cookiesPs * 60 * 15) + 13),
2,
);
conjure.appendChild(loss); conjure.appendChild(loss);
} }

View File

@@ -1,5 +1,5 @@
import Beautify from '../../BeautifyAndFormatting/Beautify'; import Beautify from '../../BeautifyAndFormatting/Beautify.js';
import * as Create from '../CreateTooltip'; import * as Create from '../CreateTooltip.js';
/** /**
* 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'; import { CacheGods } from '../../../Cache/VariablesAndData.js';
import Beautify from '../../BeautifyAndFormatting/Beautify'; import Beautify from '../../BeautifyAndFormatting/Beautify.js';
import { TooltipName, TooltipType } from '../../VariablesAndData'; import { TooltipName, TooltipType } from '../../VariablesAndData.js';
import * as Create from '../CreateTooltip'; import * as Create from '../CreateTooltip.js';
/** /**
* 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