Compare commits
62 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
641471b5bc | ||
|
|
b470d13316 | ||
|
|
36534be654 | ||
|
|
1c3a27bc9a | ||
|
|
8f5e40d3be | ||
|
|
2c309c04c2 | ||
|
|
6b2425fa19 | ||
|
|
104159e4ac | ||
|
|
00edec127c | ||
|
|
4d716e77e4 | ||
|
|
1a0750e8d7 | ||
|
|
ff81b4ff02 | ||
|
|
f3b0bfa16d | ||
|
|
9c2350a8e3 | ||
|
|
b66caab11e | ||
|
|
5390c1af58 | ||
|
|
af508ceee5 | ||
|
|
f6b2e70f9b | ||
|
|
6caee4d8fb | ||
|
|
e3d3f649c3 | ||
|
|
f138745a0f | ||
|
|
0253e9b80d | ||
|
|
d35217b6d5 | ||
|
|
b201e15c8e | ||
|
|
0a30d8e3e8 | ||
|
|
a65af049b6 | ||
|
|
26d8e75935 | ||
|
|
87eac02185 | ||
|
|
8ff50fbbb9 | ||
|
|
c3b1637d08 | ||
|
|
c72e01687f | ||
|
|
022b3860eb | ||
|
|
b09dcd6f47 | ||
|
|
eee72bceb6 | ||
|
|
7b3a7816f1 | ||
|
|
403eb59cfd | ||
|
|
220b67b440 | ||
|
|
b6d9ca8dbb | ||
|
|
1c955e5da3 | ||
|
|
9e9158ce81 | ||
|
|
71479a05e7 | ||
|
|
7ec13d80bd | ||
|
|
fd2aa16c60 | ||
|
|
7831521bc5 | ||
|
|
6193fc8d3e | ||
|
|
f85cde5fea | ||
|
|
2f34b26602 | ||
|
|
189ccbce49 | ||
|
|
3e07541fd5 | ||
|
|
932509a877 | ||
|
|
f3e7964262 | ||
|
|
9b0429c141 | ||
|
|
5dda8cac55 | ||
|
|
d6675fe86d | ||
|
|
80b8a0b834 | ||
|
|
817c5b0e3c | ||
|
|
49b8414edf | ||
|
|
99ae657c45 | ||
|
|
409a8e2911 | ||
|
|
08c2f99b21 | ||
|
|
3247057394 | ||
|
|
d1fe5c013c |
19
.eslintrc.js
19
.eslintrc.js
@@ -8,33 +8,20 @@ module.exports = {
|
|||||||
l: 'readonly',
|
l: 'readonly',
|
||||||
b64_to_utf8: 'readonly',
|
b64_to_utf8: 'readonly',
|
||||||
utf8_to_b64: 'readonly',
|
utf8_to_b64: 'readonly',
|
||||||
realAudio: 'readonly',
|
|
||||||
BeautifyAll: 'readonly',
|
BeautifyAll: 'readonly',
|
||||||
CM: 'writable',
|
|
||||||
unsafeWindow: 'readonly',
|
|
||||||
},
|
},
|
||||||
extends: 'airbnb-base',
|
extends: ['airbnb-base', 'plugin:prettier/recommended'],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaVersion: 12,
|
ecmaVersion: 12,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
indent: ['error', 'tab'],
|
|
||||||
'import/no-named-default': 'off',
|
|
||||||
'import/no-mutable-exports': 'off',
|
'import/no-mutable-exports': 'off',
|
||||||
'no-tabs': 'off',
|
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
||||||
'max-len': 'off',
|
|
||||||
'no-param-reassign': 'off',
|
|
||||||
'no-plusplus': 'off',
|
|
||||||
'no-new-func': 'off',
|
'no-new-func': 'off',
|
||||||
'no-restricted-syntax': 'off',
|
|
||||||
'no-mixed-operators': 'off',
|
|
||||||
'prefer-destructuring': 'off',
|
|
||||||
'func-names': 'off',
|
'func-names': 'off',
|
||||||
'no-console': 'off',
|
'no-console': 'off',
|
||||||
'no-nested-ternary': 'off',
|
|
||||||
'prefer-arrow-callback': 'off',
|
|
||||||
'no-new': 'off',
|
|
||||||
'no-alert': 'off',
|
'no-alert': 'off',
|
||||||
'no-restricted-globals': 'off',
|
'no-restricted-globals': 'off',
|
||||||
|
'prefer-destructuring': ['error', { object: true, array: false }],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
18
.github/CONTRIBUTING.md
vendored
Normal file
18
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
Cookie Monster is written to modify Cookie Clicker as little as possible. This means the data is copied to simulate instead of actually modifying the current values and reverting later. The benefit is that CM should never mess up any data. The downside is that there is an extra overhead to copy and store the copied data.
|
||||||
|
|
||||||
|
The following is a short description of the various `src` directories and their contents:
|
||||||
|
|
||||||
|
JS | Description
|
||||||
|
-- | -
|
||||||
|
Cache | Functions related to creating and storing data cache
|
||||||
|
Config | Functions related to manipulating CM configuration
|
||||||
|
Data | Hard coded values
|
||||||
|
Disp | Functions related to displaying CM's UI
|
||||||
|
InitSaveLoad | Functions related to registering the CM object with the Game's Modding API
|
||||||
|
Main | Functions related to the main loop and initializing CM
|
||||||
|
Sim | Functions related to simulate something
|
||||||
|
|
||||||
|
These are some additional guidelines:
|
||||||
|
- Try to use DOM as much as possible instead of using string manipulation to modify HTML.
|
||||||
|
- Please be descriptive of your commits. If the commit is related to an issue or PR, please add the issue/PR number to the commit message.
|
||||||
|
- PR's should target the `dev` branch
|
||||||
3
.github/ISSUE_TEMPLATE/bug_report.md
vendored
3
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -19,5 +19,6 @@ If applicable, add screenshots to help explain your problem.
|
|||||||
|
|
||||||
**Save file**
|
**Save file**
|
||||||
```
|
```
|
||||||
If applicable please copy your save file here
|
Please add a save file here.
|
||||||
|
This makes debugging much easier as we do not always have a good test save to debug the issue
|
||||||
```
|
```
|
||||||
|
|||||||
0
LICENSE → .github/LICENSE.md
vendored
0
LICENSE → .github/LICENSE.md
vendored
5
.prettierrc.json
Normal file
5
.prettierrc.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"printWidth": 80
|
||||||
|
}
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
The following is a description of the our approach to the project.
|
|
||||||
|
|
||||||
Cookie Monster is written to modify Cookie Clicker as little as possible. This means the data is copied to simulate instead of actually modifying the current values and reverting later. The benefit is that CM should never mess up any data. The downside is that there is an extra overhead to copy and store the copied data.
|
|
||||||
|
|
||||||
Here is a description of what should be stored in each of the source JS. Make edits to the source file first and then use the combine file to compile the final file:
|
|
||||||
|
|
||||||
JS | Description
|
|
||||||
-- | -
|
|
||||||
Cache | Functions related to creating and storing data cache
|
|
||||||
Config | Functions related to manipulating CM configuration
|
|
||||||
Data | Hard coded values
|
|
||||||
Disp | Functions related to displaying CM's UI
|
|
||||||
Footer | The footer of CM's JS (not modified often or ever)
|
|
||||||
Header | The header of CM's JS (not modified often or ever)
|
|
||||||
Main | Functions related to the main loop and initializing CM
|
|
||||||
Sim | Functions related to simulate something
|
|
||||||
|
|
||||||
These are some additional guidelines:
|
|
||||||
- Try to use DOM as much as possible instead of using string manipulation to modify HTML.
|
|
||||||
- Please be descriptive of your commits. If the commit is related to an issue or PR, please add the issue/PR number to the commit message.
|
|
||||||
- Try to follow the formatting and annotation as specified by JSCode
|
|
||||||
- PR's should target the `dev` branch
|
|
||||||
File diff suppressed because one or more lines are too long
14
README.md
14
README.md
@@ -18,13 +18,13 @@ Cookie Monster also indicates the time left before being able to buy an upgrade
|
|||||||
|
|
||||||
This index is computed for buildings and upgrades. If the relevant option is enabled, it will color-code each of them based on their value:
|
This index is computed for buildings and upgrades. If the relevant option is enabled, it will color-code each of them based on their value:
|
||||||
|
|
||||||
* Light Blue: (upgrades) This item has a better PP than any building
|
* Light Blue: (upgrades) This item has a better PP than the best building to buy
|
||||||
* Green: This item has the best PP
|
* Green: This building has the best PP
|
||||||
* Yellow: This item is not the best, but it is closer to best than it is to worst
|
* Yellow: This building is within the top 10 of best PP's
|
||||||
* Orange: This item is not the worst, but it is closer to worst than it is to best
|
* Orange: This building is within the top 20 of best PP's
|
||||||
* Red: This item has the worst PP
|
* Red: This building is within the top 30 of best PP's
|
||||||
* Purple: (upgrades) This item has a worse PP than any building
|
* Purple: This building is worse than the top 10 of best PP's
|
||||||
* Gray: (upgrades) This item has not been calculated and/or cannot be calculated due to no definitive worth.
|
* Gray: This item does not have a PP, often this means that there is no change to CPS
|
||||||
|
|
||||||
Note: For this index, **lower is better**, meaning a building with a PP of 1 is more interesting than one with a PP of 3.
|
Note: For this index, **lower is better**, meaning a building with a PP of 1 is more interesting than one with a PP of 3.
|
||||||
|
|
||||||
|
|||||||
2
dist/CookieMonster.js
vendored
2
dist/CookieMonster.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
2363
package-lock.json
generated
2363
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cookiemonster-mod",
|
"name": "cookiemonster-mod",
|
||||||
"version": "2.031.5",
|
"version": "2.031.6",
|
||||||
"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": [
|
||||||
@@ -11,12 +11,13 @@
|
|||||||
"Orteil"
|
"Orteil"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"eslint_src": "eslint src",
|
"copy-file": "cp dist/CookieMonster.js CookieMonster.js",
|
||||||
"build": "run-s eslint_src pack_prod remove_comment",
|
"eslint-src": "eslint src",
|
||||||
"build_test": "run-s pack_dev",
|
"build": "run-s eslint-src pack-prod remove-comment copy-file",
|
||||||
"pack_prod": "webpack --env production",
|
"build-test": "run-s pack-dev",
|
||||||
"pack_dev": "webpack",
|
"pack-prod": "webpack --env production",
|
||||||
"remove_comment": "sed -i '' -e '/\\/\\/# sourceMappingURL.*/d' dist/CookieMonster.js"
|
"pack-dev": "webpack",
|
||||||
|
"remove-comment": "sed -i '' -e '/\\/\\/# sourceMappingURL.*/d' dist/CookieMonster.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -45,8 +46,11 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^7.19.0",
|
"eslint": "^7.19.0",
|
||||||
"eslint-config-airbnb-base": "^14.2.1",
|
"eslint-config-airbnb-base": "^14.2.1",
|
||||||
|
"eslint-config-prettier": "^8.1.0",
|
||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.22.1",
|
||||||
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
|
"prettier": "2.2.1",
|
||||||
"webpack": "^5.24.4",
|
"webpack": "^5.24.4",
|
||||||
"webpack-cli": "^4.5.0"
|
"webpack-cli": "^4.5.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
ChoEggDiff, ClicksDiff, CookiesDiff, WrinkDiff, WrinkFattestDiff,
|
ChoEggDiff,
|
||||||
|
ClicksDiff,
|
||||||
|
CookiesDiff,
|
||||||
|
WrinkDiff,
|
||||||
|
WrinkFattestDiff,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,16 +34,21 @@ export class CMAvgQueue {
|
|||||||
* @returns {number} ret The average
|
* @returns {number} ret The average
|
||||||
*/
|
*/
|
||||||
calcAverage(timePeriod) {
|
calcAverage(timePeriod) {
|
||||||
if (timePeriod > this.maxLength) timePeriod = this.maxLength;
|
let time = timePeriod;
|
||||||
if (timePeriod > this.queue.length) timePeriod = this.queue.length;
|
if (time > this.maxLength) time = this.maxLength;
|
||||||
|
if (time > this.queue.length) time = this.queue.length;
|
||||||
let ret = 0;
|
let ret = 0;
|
||||||
for (let i = this.queue.length - 1; i >= 0 && i > this.queue.length - 1 - timePeriod; i--) {
|
for (
|
||||||
|
let i = this.queue.length - 1;
|
||||||
|
i >= 0 && i > this.queue.length - 1 - time;
|
||||||
|
i--
|
||||||
|
) {
|
||||||
ret += this.queue[i];
|
ret += this.queue[i];
|
||||||
}
|
}
|
||||||
if (ret === 0) {
|
if (ret === 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return ret / timePeriod;
|
return ret / time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,28 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheAverageClicks, CacheAverageCPS, CacheAverageGainBank, CacheAverageGainChoEgg, CacheAverageGainWrink, CacheAverageGainWrinkFattest, CacheAvgCPSWithChoEgg, CacheLastChoEgg, CacheLastClicks, CacheLastCookies, CacheLastCPSCheck, CacheLastWrinkCookies, CacheLastWrinkFattestCookies, CacheRealCookiesEarned, CacheSellForChoEgg, CacheWrinklersFattest, CacheWrinklersTotal, ChoEggDiff, ClicksDiff, CookiesDiff, WrinkDiff, WrinkFattestDiff,
|
CacheAverageClicks,
|
||||||
|
CacheAverageCPS,
|
||||||
|
CacheAverageGainBank,
|
||||||
|
CacheAverageGainChoEgg,
|
||||||
|
CacheAverageGainWrink,
|
||||||
|
CacheAverageGainWrinkFattest,
|
||||||
|
CacheAvgCPSWithChoEgg,
|
||||||
|
CacheLastChoEgg,
|
||||||
|
CacheLastClicks,
|
||||||
|
CacheLastCookies,
|
||||||
|
CacheLastCPSCheck,
|
||||||
|
CacheLastWrinkCookies,
|
||||||
|
CacheLastWrinkFattestCookies,
|
||||||
|
CacheRealCookiesEarned,
|
||||||
|
CacheSellForChoEgg,
|
||||||
|
CacheWrinklersFattest,
|
||||||
|
CacheWrinklersTotal,
|
||||||
|
ChoEggDiff,
|
||||||
|
ClicksDiff,
|
||||||
|
CookiesDiff,
|
||||||
|
WrinkDiff,
|
||||||
|
WrinkFattestDiff,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,10 +46,13 @@ export default function CacheAvgCPS() {
|
|||||||
|
|
||||||
// Add recent gains to AvgQueue's
|
// Add recent gains to AvgQueue's
|
||||||
const timeDiff = currDate - CacheLastCPSCheck;
|
const timeDiff = currDate - CacheLastCPSCheck;
|
||||||
const bankDiffAvg = Math.max(0, (Game.cookies - CacheLastCookies)) / timeDiff;
|
const bankDiffAvg = Math.max(0, Game.cookies - CacheLastCookies) / timeDiff;
|
||||||
const wrinkDiffAvg = Math.max(0, (CacheWrinklersTotal - CacheLastWrinkCookies)) / timeDiff;
|
const wrinkDiffAvg =
|
||||||
const wrinkFattestDiffAvg = Math.max(0, (CacheWrinklersFattest[0] - CacheLastWrinkFattestCookies)) / timeDiff;
|
Math.max(0, CacheWrinklersTotal - CacheLastWrinkCookies) / timeDiff;
|
||||||
const choEggDiffAvg = Math.max(0, (choEggTotal - CacheLastChoEgg)) / timeDiff;
|
const wrinkFattestDiffAvg =
|
||||||
|
Math.max(0, CacheWrinklersFattest[0] - CacheLastWrinkFattestCookies) /
|
||||||
|
timeDiff;
|
||||||
|
const choEggDiffAvg = Math.max(0, choEggTotal - CacheLastChoEgg) / timeDiff;
|
||||||
const clicksDiffAvg = (Game.cookieClicks - CacheLastClicks) / timeDiff;
|
const clicksDiffAvg = (Game.cookieClicks - CacheLastClicks) / timeDiff;
|
||||||
for (let i = 0; i < timeDiff; i++) {
|
for (let i = 0; i < timeDiff; i++) {
|
||||||
CookiesDiff.addLatest(bankDiffAvg);
|
CookiesDiff.addLatest(bankDiffAvg);
|
||||||
@@ -54,14 +78,21 @@ export default function CacheAvgCPS() {
|
|||||||
CacheAverageGainChoEgg = ChoEggDiff.calcAverage(cpsLength);
|
CacheAverageGainChoEgg = ChoEggDiff.calcAverage(cpsLength);
|
||||||
CacheAverageCPS = CacheAverageGainBank;
|
CacheAverageCPS = CacheAverageGainBank;
|
||||||
if (CMOptions.CalcWrink === 1) CacheAverageCPS += CacheAverageGainWrink;
|
if (CMOptions.CalcWrink === 1) CacheAverageCPS += CacheAverageGainWrink;
|
||||||
if (CMOptions.CalcWrink === 2) CacheAverageCPS += CacheAverageGainWrinkFattest;
|
if (CMOptions.CalcWrink === 2)
|
||||||
|
CacheAverageCPS += CacheAverageGainWrinkFattest;
|
||||||
|
|
||||||
const choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'));
|
const choEgg =
|
||||||
|
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
||||||
|
|
||||||
if (choEgg || CMOptions.CalcWrink === 0) {
|
if (choEgg || CMOptions.CalcWrink === 0) {
|
||||||
CacheAvgCPSWithChoEgg = CacheAverageGainBank + CacheAverageGainWrink + (choEgg ? CacheAverageGainChoEgg : 0);
|
CacheAvgCPSWithChoEgg =
|
||||||
|
CacheAverageGainBank +
|
||||||
|
CacheAverageGainWrink +
|
||||||
|
(choEgg ? CacheAverageGainChoEgg : 0);
|
||||||
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
|
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
|
||||||
|
|
||||||
CacheAverageClicks = ClicksDiff.calcAverage(ClickTimes[CMOptions.AvgClicksHist]);
|
CacheAverageClicks = ClicksDiff.calcAverage(
|
||||||
|
ClickTimes[CMOptions.AvgClicksHist],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData';
|
import {
|
||||||
|
CacheCurrWrinklerCount,
|
||||||
|
CacheCurrWrinklerCPSMult,
|
||||||
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the current Wrinkler CPS multiplier
|
* This functions caches the current Wrinkler CPS multiplier
|
||||||
@@ -10,9 +13,9 @@ import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAn
|
|||||||
export default function CacheCurrWrinklerCPS() {
|
export default function CacheCurrWrinklerCPS() {
|
||||||
CacheCurrWrinklerCPSMult = 0;
|
CacheCurrWrinklerCPSMult = 0;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for (const i in Game.wrinklers) {
|
Object.keys(Game.wrinklers).forEach((i) => {
|
||||||
if (Game.wrinklers[i].phase === 2) count++;
|
if (Game.wrinklers[i].phase === 2) count += 1;
|
||||||
}
|
});
|
||||||
let godMult = 1;
|
let godMult = 1;
|
||||||
if (SimObjects.Temple.minigameLoaded) {
|
if (SimObjects.Temple.minigameLoaded) {
|
||||||
const godLvl = Game.hasGod('scorn');
|
const godLvl = Game.hasGod('scorn');
|
||||||
@@ -21,5 +24,10 @@ export default function CacheCurrWrinklerCPS() {
|
|||||||
else if (godLvl === 3) godMult *= 1.05;
|
else if (godLvl === 3) godMult *= 1.05;
|
||||||
}
|
}
|
||||||
CacheCurrWrinklerCount = count;
|
CacheCurrWrinklerCount = count;
|
||||||
CacheCurrWrinklerCPSMult = count * (count * 0.05 * 1.1) * (Game.Has('Sacrilegious corruption') * 0.05 + 1) * (Game.Has('Wrinklerspawn') * 0.05 + 1) * godMult;
|
CacheCurrWrinklerCPSMult =
|
||||||
|
count *
|
||||||
|
(count * 0.05 * 1.1) *
|
||||||
|
(Game.Has('Sacrilegious corruption') * 0.05 + 1) *
|
||||||
|
(Game.Has('Wrinklerspawn') * 0.05 + 1) *
|
||||||
|
godMult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
*/
|
*/
|
||||||
export default function GetCPSBuffMult() {
|
export default function GetCPSBuffMult() {
|
||||||
let mult = 1;
|
let mult = 1;
|
||||||
for (const i of Object.keys(Game.buffs)) {
|
Object.keys(Game.buffs).forEach((i) => {
|
||||||
if (typeof Game.buffs[i].multCpS !== 'undefined') mult *= Game.buffs[i].multCpS;
|
if (typeof Game.buffs[i].multCpS !== 'undefined')
|
||||||
}
|
mult *= Game.buffs[i].multCpS;
|
||||||
|
});
|
||||||
return mult;
|
return mult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ export default function CacheSellAllForChoEgg() {
|
|||||||
if (Game.Objects.Bank.minigameLoaded) {
|
if (Game.Objects.Bank.minigameLoaded) {
|
||||||
const marketGoods = Game.Objects.Bank.minigame.goods;
|
const marketGoods = Game.Objects.Bank.minigame.goods;
|
||||||
let goodsVal = 0;
|
let goodsVal = 0;
|
||||||
for (const i of Object.keys(marketGoods)) {
|
Object.keys(marketGoods).forEach((i) => {
|
||||||
const marketGood = marketGoods[i];
|
const marketGood = marketGoods[i];
|
||||||
goodsVal += marketGood.stock * marketGood.val;
|
goodsVal += marketGood.stock * marketGood.val;
|
||||||
}
|
});
|
||||||
sellTotal += goodsVal * Game.cookiesPsRawHighest;
|
sellTotal += goodsVal * Game.cookiesPsRawHighest;
|
||||||
}
|
}
|
||||||
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
||||||
|
|||||||
@@ -3,12 +3,18 @@ import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
|
|||||||
import CacheAvgCPS from './CPS/CPS';
|
import CacheAvgCPS from './CPS/CPS';
|
||||||
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
||||||
import CachePP from './PP/PP';
|
import CachePP from './PP/PP';
|
||||||
import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome';
|
import {
|
||||||
|
CacheBuildingsPrices,
|
||||||
|
CacheIncome,
|
||||||
|
} from './PriceAndIncome/PriceAndIncome';
|
||||||
import { CacheChain } from './Stats/ChainCookies';
|
import { CacheChain } from './Stats/ChainCookies';
|
||||||
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
||||||
import CacheAllMissingUpgrades from './Stats/MissingUpgrades';
|
import CacheAllMissingUpgrades from './Stats/MissingUpgrades';
|
||||||
import CacheSeasonSpec from './Stats/Reindeer';
|
import CacheSeasonSpec from './Stats/Reindeer';
|
||||||
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats';
|
import {
|
||||||
|
CacheGoldenAndWrathCookiesMults,
|
||||||
|
CacheStatsCookies,
|
||||||
|
} from './Stats/Stats';
|
||||||
import { HeavenlyChipsDiff } from './VariablesAndData';
|
import { HeavenlyChipsDiff } from './VariablesAndData';
|
||||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ export default function LoopCache() {
|
|||||||
CacheAvgCPS();
|
CacheAvgCPS();
|
||||||
CacheHeavenlyChipsPS();
|
CacheHeavenlyChipsPS();
|
||||||
|
|
||||||
const cookiesToNext = Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1) - (Game.cookiesEarned + Game.cookiesReset);
|
const cookiesToNext =
|
||||||
|
Game.HowManyCookiesReset(
|
||||||
|
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) +
|
||||||
|
1,
|
||||||
|
) -
|
||||||
|
(Game.cookiesEarned + Game.cookiesReset);
|
||||||
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS());
|
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-restricted-syntax */
|
||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
/** Functions related to the Dragon */
|
/** Functions related to the Dragon */
|
||||||
|
|
||||||
@@ -5,7 +6,10 @@ import { Beautify } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
|||||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||||
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheCostDragonUpgrade, CacheDragonAura, CacheDragonAura2, CacheLastDragonLevel,
|
CacheCostDragonUpgrade,
|
||||||
|
CacheDragonAura,
|
||||||
|
CacheDragonAura2,
|
||||||
|
CacheLastDragonLevel,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,9 +17,16 @@ import {
|
|||||||
*/
|
*/
|
||||||
export default function CacheDragonCost() {
|
export default function CacheDragonCost() {
|
||||||
if (CacheLastDragonLevel !== Game.dragonLevel || SimDoSims) {
|
if (CacheLastDragonLevel !== Game.dragonLevel || SimDoSims) {
|
||||||
if (Game.dragonLevel < 25 && Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')) {
|
if (
|
||||||
let target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];
|
Game.dragonLevel < 25 &&
|
||||||
const amount = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];
|
Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')
|
||||||
|
) {
|
||||||
|
let target = Game.dragonLevels[Game.dragonLevel].buy
|
||||||
|
.toString()
|
||||||
|
.match(/Objects\[(.*)\]/)[1];
|
||||||
|
const amount = Game.dragonLevels[Game.dragonLevel].buy
|
||||||
|
.toString()
|
||||||
|
.match(/sacrifice\((.*?)\)/)[1];
|
||||||
if (target !== 'i') {
|
if (target !== 'i') {
|
||||||
target = target.replaceAll("'", '');
|
target = target.replaceAll("'", '');
|
||||||
if (Game.Objects[target].amount < amount) {
|
if (Game.Objects[target].amount < amount) {
|
||||||
@@ -24,13 +35,19 @@ export default function CacheDragonCost() {
|
|||||||
let cost = 0;
|
let cost = 0;
|
||||||
CopyData();
|
CopyData();
|
||||||
for (let i = 0; i < amount; i++) {
|
for (let i = 0; i < amount; i++) {
|
||||||
let price = SimObjects[target].basePrice * Game.priceIncrease ** Math.max(0, SimObjects[target].amount - 1 - SimObjects[target].free);
|
let price =
|
||||||
|
SimObjects[target].basePrice *
|
||||||
|
Game.priceIncrease **
|
||||||
|
Math.max(
|
||||||
|
0,
|
||||||
|
SimObjects[target].amount - 1 - SimObjects[target].free,
|
||||||
|
);
|
||||||
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
||||||
price = Math.ceil(price);
|
price = Math.ceil(price);
|
||||||
cost += price;
|
cost += price;
|
||||||
SimObjects[target].amount--;
|
SimObjects[target].amount -= 1;
|
||||||
}
|
}
|
||||||
CacheCostDragonUpgrade = `Cost to rebuy: ${(cost)}`;
|
CacheCostDragonUpgrade = `Cost to rebuy: ${cost}`;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let cost = 0;
|
let cost = 0;
|
||||||
@@ -42,11 +59,17 @@ export default function CacheDragonCost() {
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
for (let i = 0; i < amount; i++) {
|
for (let i = 0; i < amount; i++) {
|
||||||
let price = SimObjects[target].basePrice * Game.priceIncrease ** Math.max(0, SimObjects[target].amount - 1 - SimObjects[target].free);
|
let price =
|
||||||
|
SimObjects[target].basePrice *
|
||||||
|
Game.priceIncrease **
|
||||||
|
Math.max(
|
||||||
|
0,
|
||||||
|
SimObjects[target].amount - 1 - SimObjects[target].free,
|
||||||
|
);
|
||||||
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
||||||
price = Math.ceil(price);
|
price = Math.ceil(price);
|
||||||
cost += price;
|
cost += price;
|
||||||
SimObjects[target].amount--;
|
SimObjects[target].amount -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
|
/* eslint-disable no-param-reassign */
|
||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColorGray } from '../../Disp/VariablesAndData';
|
import { ColorGray } from '../../Disp/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheArrayOfPPs,
|
CacheMinPP,
|
||||||
CacheMaxPP, CacheMidPP, CacheMinPP, CacheObjects1, CacheObjects10, CacheObjects100,
|
CacheObjects1,
|
||||||
|
CacheObjects10,
|
||||||
|
CacheObjects100,
|
||||||
|
CachePPArray,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
import ColourOfPP from './ColourOfPP';
|
import ColourOfPP from './ColourOfPP';
|
||||||
|
|
||||||
@@ -13,14 +17,30 @@ import ColourOfPP from './ColourOfPP';
|
|||||||
* It saves all date in CM.Cache.Objects...
|
* It saves all date in CM.Cache.Objects...
|
||||||
* It is called by CM.Cache.CacheBuildingsPP()
|
* It is called by CM.Cache.CacheBuildingsPP()
|
||||||
*/
|
*/
|
||||||
function CacheBuildingsBulkPP(target) {
|
function CacheColor(target, amount) {
|
||||||
for (const i of Object.keys(target)) {
|
Object.keys(target).forEach((i) => {
|
||||||
if (Game.cookiesPs) {
|
target[i].color = ColourOfPP(
|
||||||
target[i].pp = (Math.max(target[i].price - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs) + (target[i].price / target[i].bonus);
|
target[i],
|
||||||
} else target[i].pp = (target[i].price / target[i].bonus);
|
Game.Objects[i].getSumPrice(amount),
|
||||||
|
);
|
||||||
target[i].color = ColourOfPP(target[i], target[i].price);
|
// Colour based on excluding certain top-buildings
|
||||||
|
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
||||||
|
if (target[i].pp === CachePPArray[j][0]) target[i].color = ColorGray;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function CachePP(target, amount) {
|
||||||
|
Object.keys(target).forEach((i) => {
|
||||||
|
const price = Game.Objects[i].getSumPrice(amount);
|
||||||
|
if (Game.cookiesPs) {
|
||||||
|
target[i].pp =
|
||||||
|
Math.max(price - (Game.cookies + GetWrinkConfigBank()), 0) /
|
||||||
|
Game.cookiesPs +
|
||||||
|
price / target[i].bonus;
|
||||||
|
} else target[i].pp = price / target[i].bonus;
|
||||||
|
CachePPArray.push([target[i].pp, amount]);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,73 +49,28 @@ function CacheBuildingsBulkPP(target) {
|
|||||||
*/
|
*/
|
||||||
export default function CacheBuildingsPP() {
|
export default function CacheBuildingsPP() {
|
||||||
CacheMinPP = Infinity;
|
CacheMinPP = Infinity;
|
||||||
CacheMaxPP = 1;
|
CachePPArray = [];
|
||||||
CacheArrayOfPPs = [];
|
|
||||||
if (typeof CMOptions.PPExcludeTop === 'undefined') CMOptions.PPExcludeTop = 0; // Otherwise breaks during initialization
|
if (typeof CMOptions.PPExcludeTop === 'undefined') CMOptions.PPExcludeTop = 0; // Otherwise breaks during initialization
|
||||||
|
|
||||||
// Calculate PP and colors when compared to purchase of optimal building in single-purchase mode
|
// Calculate PP and colors
|
||||||
if (CMOptions.ColorPPBulkMode === 0 && Game.buyMode > 0) {
|
CachePP(CacheObjects1, 1);
|
||||||
for (const i of Object.keys(CacheObjects1)) {
|
CachePP(CacheObjects10, 10);
|
||||||
if (Game.cookiesPs) {
|
CachePP(CacheObjects100, 100);
|
||||||
CacheObjects1[i].pp = (Math.max(Game.Objects[i].getPrice() - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Objects[i].getPrice() / CacheObjects1[i].bonus);
|
|
||||||
} else CacheObjects1[i].pp = (Game.Objects[i].getPrice() / CacheObjects1[i].bonus);
|
|
||||||
CacheArrayOfPPs.push([CacheObjects1[i].pp, Game.Objects[i].getPrice()]);
|
|
||||||
}
|
|
||||||
// Set CM.Cache.min to best non-excluded buidliung
|
|
||||||
CacheArrayOfPPs.sort((a, b) => a[0] - b[0]);
|
|
||||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
|
||||||
while (CacheArrayOfPPs[0][1] > Game.cookies) {
|
|
||||||
if (CacheArrayOfPPs.length === 1) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
CacheArrayOfPPs.shift();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CacheMinPP = CacheArrayOfPPs[CMOptions.PPExcludeTop][0];
|
|
||||||
CacheMaxPP = CacheArrayOfPPs[CacheArrayOfPPs.length - 1][0];
|
|
||||||
CacheMidPP = ((CacheMaxPP - CacheMinPP) / 2) + CacheMinPP;
|
|
||||||
for (const i of Object.keys(CacheObjects1)) {
|
|
||||||
CacheObjects1[i].color = ColourOfPP(CacheObjects1[i], Game.Objects[i].getPrice());
|
|
||||||
// Colour based on excluding certain top-buildings
|
|
||||||
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
|
||||||
if (CacheObjects1[i].pp === CacheArrayOfPPs[j][0]) CacheObjects1[i].color = ColorGray;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Calculate PP of bulk-buy modes
|
|
||||||
CacheBuildingsBulkPP(CacheObjects10);
|
|
||||||
CacheBuildingsBulkPP(CacheObjects100);
|
|
||||||
} else if (Game.buyMode > 0) {
|
|
||||||
// Calculate PP and colors when compared to purchase of selected bulk mode
|
|
||||||
let target;
|
|
||||||
if (Game.buyBulk === 1) target = CacheObjects1;
|
|
||||||
else if (Game.buyBulk === 10) target = CacheObjects10;
|
|
||||||
else if (Game.buyBulk === 100) target = CacheObjects100;
|
|
||||||
for (const i of Object.keys(target)) {
|
|
||||||
if (Game.cookiesPs) {
|
|
||||||
target[i].pp = (Math.max(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Objects[i].bulkPrice / target[i].bonus);
|
|
||||||
} else target[i].pp = (Game.Objects[i].bulkPrice / target[i].bonus);
|
|
||||||
CacheArrayOfPPs.push([target[i].pp, Game.Objects[i].bulkPrice]);
|
|
||||||
}
|
|
||||||
// Set CM.Cache.min to best non-excluded buidliung
|
|
||||||
CacheArrayOfPPs.sort((a, b) => a[0] - b[0]);
|
|
||||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
|
||||||
while (CacheArrayOfPPs[0][1] > Game.cookies) {
|
|
||||||
if (CacheArrayOfPPs.length === 1) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
CacheArrayOfPPs.shift();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CacheMinPP = CacheArrayOfPPs[CMOptions.PPExcludeTop][0];
|
|
||||||
CacheMaxPP = CacheArrayOfPPs[CacheArrayOfPPs.length - 1][0];
|
|
||||||
CacheMidPP = ((CacheMaxPP - CacheMinPP) / 2) + CacheMinPP;
|
|
||||||
|
|
||||||
for (const i of Object.keys(CacheObjects1)) {
|
// Set CM.Cache.min to best non-excluded buidliung
|
||||||
target[i].color = ColourOfPP(target[i], Game.Objects[i].bulkPrice);
|
CachePPArray.sort((a, b) => a[0] - b[0]);
|
||||||
// Colour based on excluding certain top-buildings
|
let indexOfMin = 0;
|
||||||
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
if (CMOptions.PPOnlyConsiderBuyable) {
|
||||||
if (target[i].pp === CacheArrayOfPPs[j][0]) target[i].color = ColorGray;
|
while (CachePPArray[indexOfMin][1] > Game.cookies) {
|
||||||
|
indexOfMin += 1;
|
||||||
|
if (CachePPArray.length === indexOfMin + 1) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CacheMinPP = CachePPArray[CMOptions.PPExcludeTop][indexOfMin];
|
||||||
|
|
||||||
|
CacheColor(CacheObjects1, 1);
|
||||||
|
CacheColor(CacheObjects10, 10);
|
||||||
|
CacheColor(CacheObjects100, 100);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
||||||
import {
|
import {
|
||||||
ColorBlue, ColorGray, ColorGreen, ColorOrange, ColorPurple, ColorRed, ColorYellow,
|
ColorBlue,
|
||||||
|
ColorGray,
|
||||||
|
ColorGreen,
|
||||||
|
ColorOrange,
|
||||||
|
ColorPurple,
|
||||||
|
ColorRed,
|
||||||
|
ColorYellow,
|
||||||
} from '../../Disp/VariablesAndData';
|
} from '../../Disp/VariablesAndData';
|
||||||
import { CacheMaxPP, CacheMidPP, CacheMinPP } from '../VariablesAndData';
|
import { CacheMinPP, CachePPArray } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions return the colour assosciated with the given pp value
|
* This functions return the colour assosciated with the given pp value
|
||||||
@@ -18,14 +24,15 @@ export default function ColourOfPP(me, price) {
|
|||||||
if (me.pp <= 0 || me.pp === Infinity) color = ColorGray;
|
if (me.pp <= 0 || me.pp === Infinity) color = ColorGray;
|
||||||
else if (me.pp < CacheMinPP) color = ColorBlue;
|
else if (me.pp < CacheMinPP) color = ColorBlue;
|
||||||
else if (me.pp === CacheMinPP) color = ColorGreen;
|
else if (me.pp === CacheMinPP) color = ColorGreen;
|
||||||
else if (me.pp === CacheMaxPP) color = ColorRed;
|
else if (me.pp < CachePPArray[10][0]) color = ColorYellow;
|
||||||
else if (me.pp > CacheMaxPP) color = ColorPurple;
|
else if (me.pp < CachePPArray[20][0]) color = ColorOrange;
|
||||||
else if (me.pp > CacheMidPP) color = ColorOrange;
|
else if (me.pp > CachePPArray[30][0]) color = ColorRed;
|
||||||
else color = ColorYellow;
|
else color = ColorPurple;
|
||||||
|
|
||||||
// Colour based on price in terms of CPS
|
// Colour based on price in terms of CPS
|
||||||
if (Number(CMOptions.PPSecondsLowerLimit) !== 0) {
|
if (Number(CMOptions.PPSecondsLowerLimit) !== 0) {
|
||||||
if (price / GetCPS() < Number(CMOptions.PPSecondsLowerLimit)) color = ColorBlue;
|
if (price / GetCPS() < Number(CMOptions.PPSecondsLowerLimit))
|
||||||
|
color = ColorBlue;
|
||||||
}
|
}
|
||||||
// Colour based on being able to purchase
|
// Colour based on being able to purchase
|
||||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
if (CMOptions.PPOnlyConsiderBuyable) {
|
||||||
|
|||||||
@@ -7,12 +7,23 @@ import ColourOfPP from './ColourOfPP';
|
|||||||
* It is called by CM.Cache.CachePP()
|
* It is called by CM.Cache.CachePP()
|
||||||
*/
|
*/
|
||||||
export default function CacheUpgradePP() {
|
export default function CacheUpgradePP() {
|
||||||
for (const i of Object.keys(CacheUpgrades)) {
|
Object.keys(CacheUpgrades).forEach((i) => {
|
||||||
if (Game.cookiesPs) {
|
if (Game.cookiesPs) {
|
||||||
CacheUpgrades[i].pp = (Math.max(Game.Upgrades[i].getPrice() - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus);
|
CacheUpgrades[i].pp =
|
||||||
} else CacheUpgrades[i].pp = (Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus);
|
Math.max(
|
||||||
|
Game.Upgrades[i].getPrice() - (Game.cookies + GetWrinkConfigBank()),
|
||||||
|
0,
|
||||||
|
) /
|
||||||
|
Game.cookiesPs +
|
||||||
|
Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
||||||
|
} else
|
||||||
|
CacheUpgrades[i].pp =
|
||||||
|
Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus;
|
||||||
if (Number.isNaN(CacheUpgrades[i].pp)) CacheUpgrades[i].pp = Infinity;
|
if (Number.isNaN(CacheUpgrades[i].pp)) CacheUpgrades[i].pp = Infinity;
|
||||||
|
|
||||||
CacheUpgrades[i].color = ColourOfPP(CacheUpgrades[i], Game.Upgrades[i].getPrice());
|
CacheUpgrades[i].color = ColourOfPP(
|
||||||
}
|
CacheUpgrades[i],
|
||||||
|
Game.Upgrades[i].getPrice(),
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
13
src/Cache/PantheonGods/CacheGods.js
Normal file
13
src/Cache/PantheonGods/CacheGods.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import CalculateChangeGod from '../../Sim/SimulationEvents/GodChange';
|
||||||
|
import { CacheGods } from '../VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This functions caches the cps effect of each God in slot 1, 2 or 3
|
||||||
|
*/
|
||||||
|
export default function CachePantheonGods() {
|
||||||
|
for (let god = 0; god < 11; god += 1) {
|
||||||
|
for (let slot = 0; slot < 3; slot += 1) {
|
||||||
|
CacheGods[god][slot] = CalculateChangeGod(god, slot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,21 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
/** Section: Functions related to caching income */
|
/** Section: Functions related to caching income */
|
||||||
|
|
||||||
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
||||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||||
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||||
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades';
|
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades';
|
||||||
import {
|
import {
|
||||||
CacheDoRemakeBuildPrices, CacheObjects1, CacheObjects10, CacheObjects100, CacheUpgrades,
|
CacheAverageCPS,
|
||||||
|
CacheAverageGainBank,
|
||||||
|
CacheAverageGainWrink,
|
||||||
|
CacheAverageGainWrinkFattest,
|
||||||
|
CacheDoRemakeBuildPrices,
|
||||||
|
CacheObjects1,
|
||||||
|
CacheObjects10,
|
||||||
|
CacheObjects100,
|
||||||
|
CacheUpgrades,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,13 +26,13 @@ import {
|
|||||||
*/
|
*/
|
||||||
function CacheBuildingIncome(amount, target) {
|
function CacheBuildingIncome(amount, target) {
|
||||||
const result = [];
|
const result = [];
|
||||||
for (const i of Object.keys(Game.Objects)) {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
result[i] = {};
|
result[i] = {};
|
||||||
result[i].bonus = BuyBuildingsBonusIncome(i, amount);
|
result[i].bonus = BuyBuildingsBonusIncome(i, amount);
|
||||||
if (amount !== 1) {
|
if (amount !== 1) {
|
||||||
CacheDoRemakeBuildPrices = 1;
|
CacheDoRemakeBuildPrices = 1;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,23 +42,50 @@ function CacheBuildingIncome(amount, target) {
|
|||||||
*/
|
*/
|
||||||
function CacheUpgradeIncome() {
|
function CacheUpgradeIncome() {
|
||||||
CacheUpgrades = [];
|
CacheUpgrades = [];
|
||||||
for (const i of Object.keys(Game.Upgrades)) {
|
Object.keys(Game.Upgrades).forEach((i) => {
|
||||||
const bonusIncome = BuyUpgradesBonusIncome(i);
|
const bonusIncome = BuyUpgradesBonusIncome(i);
|
||||||
|
if (i === 'Elder Pledge') {
|
||||||
|
CacheUpgrades[i] = { bonus: Game.cookiesPs - CacheAverageGainBank };
|
||||||
|
if (CMOptions.CalcWrink === 1)
|
||||||
|
CacheUpgrades[i].bonus -= CacheAverageGainWrink;
|
||||||
|
else if (CMOptions.CalcWrink === 2)
|
||||||
|
CacheUpgrades[i].bonus -= CacheAverageGainWrinkFattest;
|
||||||
|
if (!Number.isFinite(CacheUpgrades[i].bonus)) CacheUpgrades[i].bonus = 0;
|
||||||
|
} else {
|
||||||
CacheUpgrades[i] = {};
|
CacheUpgrades[i] = {};
|
||||||
if (bonusIncome[0]) CacheUpgrades[i].bonus = bonusIncome[0];
|
if (bonusIncome[0]) CacheUpgrades[i].bonus = bonusIncome[0];
|
||||||
if (bonusIncome[1]) CacheUpgrades[i].bonusMouse = bonusIncome[1];
|
if (bonusIncome[1]) CacheUpgrades[i].bonusMouse = bonusIncome[1];
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches the price of each building and stores it in the cache
|
* This functions caches the price of each building and stores it in the cache
|
||||||
*/
|
*/
|
||||||
export function CacheBuildingsPrices() {
|
export function CacheBuildingsPrices() {
|
||||||
for (const i of Object.keys(Game.Objects)) {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
CacheObjects1[i].price = BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 1);
|
CacheObjects1[i].price = BuildingGetPrice(
|
||||||
CacheObjects10[i].price = BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 10);
|
Game.Objects[i],
|
||||||
CacheObjects100[i].price = BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 100);
|
Game.Objects[i].basePrice,
|
||||||
}
|
Game.Objects[i].amount,
|
||||||
|
Game.Objects[i].free,
|
||||||
|
1,
|
||||||
|
);
|
||||||
|
CacheObjects10[i].price = BuildingGetPrice(
|
||||||
|
Game.Objects[i],
|
||||||
|
Game.Objects[i].basePrice,
|
||||||
|
Game.Objects[i].amount,
|
||||||
|
Game.Objects[i].free,
|
||||||
|
10,
|
||||||
|
);
|
||||||
|
CacheObjects100[i].price = BuildingGetPrice(
|
||||||
|
Game.Objects[i],
|
||||||
|
Game.Objects[i].basePrice,
|
||||||
|
Game.Objects[i].amount,
|
||||||
|
Game.Objects[i].free,
|
||||||
|
100,
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,22 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||||
import {
|
import {
|
||||||
CacheChainFrenzyMaxReward, CacheChainFrenzyRequired, CacheChainFrenzyRequiredNext, CacheChainFrenzyWrathMaxReward, CacheChainFrenzyWrathRequired, CacheChainFrenzyWrathRequiredNext, CacheChainMaxReward, CacheChainRequired, CacheChainRequiredNext, CacheChainWrathMaxReward, CacheChainWrathRequired, CacheChainWrathRequiredNext, CacheDragonsFortuneMultAdjustment, CacheGoldenCookiesMult, CacheNoGoldSwitchCookiesPS, CacheWrathCookiesMult,
|
CacheChainFrenzyMaxReward,
|
||||||
|
CacheChainFrenzyRequired,
|
||||||
|
CacheChainFrenzyRequiredNext,
|
||||||
|
CacheChainFrenzyWrathMaxReward,
|
||||||
|
CacheChainFrenzyWrathRequired,
|
||||||
|
CacheChainFrenzyWrathRequiredNext,
|
||||||
|
CacheChainMaxReward,
|
||||||
|
CacheChainRequired,
|
||||||
|
CacheChainRequiredNext,
|
||||||
|
CacheChainWrathMaxReward,
|
||||||
|
CacheChainWrathRequired,
|
||||||
|
CacheChainWrathRequiredNext,
|
||||||
|
CacheDragonsFortuneMultAdjustment,
|
||||||
|
CacheGoldenCookiesMult,
|
||||||
|
CacheNoGoldSwitchCookiesPS,
|
||||||
|
CacheWrathCookiesMult,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,13 +32,26 @@ export function MaxChainCookieReward(digit, maxPayout, mult) {
|
|||||||
let moni = 0;
|
let moni = 0;
|
||||||
let nextMoni = 0;
|
let nextMoni = 0;
|
||||||
let nextRequired = 0;
|
let nextRequired = 0;
|
||||||
let chain = 1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10);
|
let chain =
|
||||||
|
1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10);
|
||||||
while (nextMoni < maxPayout) {
|
while (nextMoni < maxPayout) {
|
||||||
moni = Math.max(digit, Math.min(Math.floor(1 / 9 * 10 ** chain * digit * mult), maxPayout * mult));
|
moni = Math.max(
|
||||||
nextMoni = Math.max(digit, Math.min(Math.floor(1 / 9 * 10 ** (chain + 1) * digit * mult), maxPayout * mult));
|
digit,
|
||||||
nextRequired = Math.floor(1 / 9 * 10 ** (chain + 1) * digit * mult);
|
Math.min(
|
||||||
|
Math.floor((1 / 9) * 10 ** chain * digit * mult),
|
||||||
|
maxPayout * mult,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
nextMoni = Math.max(
|
||||||
|
digit,
|
||||||
|
Math.min(
|
||||||
|
Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult),
|
||||||
|
maxPayout * mult,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
nextRequired = Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult);
|
||||||
totalFromChain += moni;
|
totalFromChain += moni;
|
||||||
chain++;
|
chain += 1;
|
||||||
}
|
}
|
||||||
return [totalFromChain, moni, nextRequired];
|
return [totalFromChain, moni, nextRequired];
|
||||||
}
|
}
|
||||||
@@ -45,25 +73,65 @@ export function MaxChainCookieReward(digit, maxPayout, mult) {
|
|||||||
* @global {number} CM.Cache.ChainFrenzyWrathRequiredNext Total cookies needed for next level for wrath frenzy chain
|
* @global {number} CM.Cache.ChainFrenzyWrathRequiredNext Total cookies needed for next level for wrath frenzy chain
|
||||||
*/
|
*/
|
||||||
export function CacheChain() {
|
export function CacheChain() {
|
||||||
let maxPayout = CacheNoGoldSwitchCookiesPS * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment;
|
let maxPayout =
|
||||||
|
CacheNoGoldSwitchCookiesPS *
|
||||||
|
60 *
|
||||||
|
60 *
|
||||||
|
6 *
|
||||||
|
CacheDragonsFortuneMultAdjustment;
|
||||||
// Removes effect of Frenzy etc.
|
// Removes effect of Frenzy etc.
|
||||||
const cpsBuffMult = GetCPSBuffMult();
|
const cpsBuffMult = GetCPSBuffMult();
|
||||||
if (cpsBuffMult > 0) maxPayout /= cpsBuffMult;
|
if (cpsBuffMult > 0) maxPayout /= cpsBuffMult;
|
||||||
else maxPayout = 0;
|
else maxPayout = 0;
|
||||||
|
|
||||||
CacheChainMaxReward = MaxChainCookieReward(7, maxPayout, CacheGoldenCookiesMult);
|
CacheChainMaxReward = MaxChainCookieReward(
|
||||||
CacheChainRequired = CacheChainMaxReward[1] * 2 / CacheGoldenCookiesMult;
|
7,
|
||||||
CacheChainRequiredNext = CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
maxPayout,
|
||||||
|
CacheGoldenCookiesMult,
|
||||||
|
);
|
||||||
|
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||||
|
CacheChainRequiredNext =
|
||||||
|
CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||||
|
|
||||||
CacheChainWrathMaxReward = MaxChainCookieReward(6, maxPayout, CacheWrathCookiesMult);
|
CacheChainWrathMaxReward = MaxChainCookieReward(
|
||||||
CacheChainWrathRequired = CacheChainWrathMaxReward[1] * 2 / CacheWrathCookiesMult;
|
6,
|
||||||
CacheChainWrathRequiredNext = CacheChainWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
maxPayout,
|
||||||
|
CacheWrathCookiesMult,
|
||||||
|
);
|
||||||
|
CacheChainWrathRequired =
|
||||||
|
(CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||||
|
CacheChainWrathRequiredNext =
|
||||||
|
CacheChainWrathMaxReward[2] /
|
||||||
|
60 /
|
||||||
|
60 /
|
||||||
|
6 /
|
||||||
|
CacheDragonsFortuneMultAdjustment;
|
||||||
|
|
||||||
CacheChainFrenzyMaxReward = MaxChainCookieReward(7, maxPayout * 7, CacheGoldenCookiesMult);
|
CacheChainFrenzyMaxReward = MaxChainCookieReward(
|
||||||
CacheChainFrenzyRequired = CacheChainFrenzyMaxReward[1] * 2 / CacheGoldenCookiesMult;
|
7,
|
||||||
CacheChainFrenzyRequiredNext = CacheChainFrenzyMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
maxPayout * 7,
|
||||||
|
CacheGoldenCookiesMult,
|
||||||
|
);
|
||||||
|
CacheChainFrenzyRequired =
|
||||||
|
(CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||||
|
CacheChainFrenzyRequiredNext =
|
||||||
|
CacheChainFrenzyMaxReward[2] /
|
||||||
|
60 /
|
||||||
|
60 /
|
||||||
|
6 /
|
||||||
|
CacheDragonsFortuneMultAdjustment;
|
||||||
|
|
||||||
CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(6, maxPayout * 7, CacheWrathCookiesMult);
|
CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(
|
||||||
CacheChainFrenzyWrathRequired = CacheChainFrenzyWrathMaxReward[1] * 2 / CacheWrathCookiesMult;
|
6,
|
||||||
CacheChainFrenzyWrathRequiredNext = CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
maxPayout * 7,
|
||||||
|
CacheWrathCookiesMult,
|
||||||
|
);
|
||||||
|
CacheChainFrenzyWrathRequired =
|
||||||
|
(CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||||
|
CacheChainFrenzyWrathRequiredNext =
|
||||||
|
CacheChainFrenzyWrathMaxReward[2] /
|
||||||
|
60 /
|
||||||
|
60 /
|
||||||
|
6 /
|
||||||
|
CacheDragonsFortuneMultAdjustment;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import {
|
import {
|
||||||
CacheHCPerSecond, CacheLastHeavenlyCheck, CacheLastHeavenlyChips, HeavenlyChipsDiff,
|
CacheHCPerSecond,
|
||||||
|
CacheLastHeavenlyCheck,
|
||||||
|
CacheLastHeavenlyChips,
|
||||||
|
HeavenlyChipsDiff,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,12 +16,15 @@ export default function CacheHeavenlyChipsPS() {
|
|||||||
// Only calculate every new second
|
// Only calculate every new second
|
||||||
if ((Game.T / Game.fps) % 1 === 0) {
|
if ((Game.T / Game.fps) % 1 === 0) {
|
||||||
const chipsOwned = Game.HowMuchPrestige(Game.cookiesReset);
|
const chipsOwned = Game.HowMuchPrestige(Game.cookiesReset);
|
||||||
const ascendNowToOwn = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
const ascendNowToOwn = Math.floor(
|
||||||
|
Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned),
|
||||||
|
);
|
||||||
const ascendNowToGet = ascendNowToOwn - Math.floor(chipsOwned);
|
const ascendNowToGet = ascendNowToOwn - Math.floor(chipsOwned);
|
||||||
|
|
||||||
// Add recent gains to AvgQueue's
|
// Add recent gains to AvgQueue's
|
||||||
const timeDiff = currDate - CacheLastHeavenlyCheck;
|
const timeDiff = currDate - CacheLastHeavenlyCheck;
|
||||||
const heavenlyChipsDiffAvg = Math.max(0, (ascendNowToGet - CacheLastHeavenlyChips)) / timeDiff;
|
const heavenlyChipsDiffAvg =
|
||||||
|
Math.max(0, ascendNowToGet - CacheLastHeavenlyChips) / timeDiff;
|
||||||
for (let i = 0; i < timeDiff; i++) {
|
for (let i = 0; i < timeDiff; i++) {
|
||||||
HeavenlyChipsDiff.addLatest(heavenlyChipsDiffAvg);
|
HeavenlyChipsDiff.addLatest(heavenlyChipsDiffAvg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import { crateMissing } from '../../Disp/MenuSections/CreateMissingUpgrades';
|
import { crateMissing } from '../../Disp/MenuSections/CreateMissingUpgrades';
|
||||||
import { CacheMissingUpgrades, CacheMissingUpgradesCookies, CacheMissingUpgradesPrestige } from '../VariablesAndData';
|
import {
|
||||||
|
CacheMissingUpgrades,
|
||||||
|
CacheMissingUpgradesCookies,
|
||||||
|
CacheMissingUpgradesPrestige,
|
||||||
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches variables related to missing upgrades
|
* This functions caches variables related to missing upgrades
|
||||||
@@ -15,9 +19,9 @@ export default function CacheAllMissingUpgrades() {
|
|||||||
CacheMissingUpgradesPrestige = '';
|
CacheMissingUpgradesPrestige = '';
|
||||||
const list = [];
|
const list = [];
|
||||||
// sort the upgrades
|
// sort the upgrades
|
||||||
for (const i of Object.keys(Game.Upgrades)) {
|
Object.keys(Game.Upgrades).forEach((i) => {
|
||||||
list.push(Game.Upgrades[i]);
|
list.push(Game.Upgrades[i]);
|
||||||
}
|
});
|
||||||
const sortMap = function (a, b) {
|
const sortMap = function (a, b) {
|
||||||
if (a.order > b.order) return 1;
|
if (a.order > b.order) return 1;
|
||||||
if (a.order < b.order) return -1;
|
if (a.order < b.order) return -1;
|
||||||
@@ -25,7 +29,7 @@ export default function CacheAllMissingUpgrades() {
|
|||||||
};
|
};
|
||||||
list.sort(sortMap);
|
list.sort(sortMap);
|
||||||
|
|
||||||
for (const i of Object.keys(list)) {
|
Object.keys(list).forEach((i) => {
|
||||||
const me = list[i];
|
const me = list[i];
|
||||||
|
|
||||||
if (me.bought === 0) {
|
if (me.bought === 0) {
|
||||||
@@ -34,7 +38,12 @@ export default function CacheAllMissingUpgrades() {
|
|||||||
str += crateMissing(me);
|
str += crateMissing(me);
|
||||||
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') CacheMissingUpgrades += str;
|
else if (
|
||||||
}
|
me.pool !== 'toggle' &&
|
||||||
|
me.pool !== 'unused' &&
|
||||||
|
me.pool !== 'debug'
|
||||||
|
)
|
||||||
|
CacheMissingUpgrades += str;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,20 @@
|
|||||||
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas';
|
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas';
|
||||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||||
import {
|
import {
|
||||||
CacheConjure, CacheConjureReward, CacheDragonsFortuneMultAdjustment, CacheEdifice, CacheEdificeBuilding, CacheGoldenCookiesMult, CacheLucky, CacheLuckyFrenzy, CacheLuckyReward, CacheLuckyRewardFrenzy, CacheLuckyWrathReward, CacheLuckyWrathRewardFrenzy, CacheNoGoldSwitchCookiesPS, CacheWrathCookiesMult,
|
CacheConjure,
|
||||||
|
CacheConjureReward,
|
||||||
|
CacheDragonsFortuneMultAdjustment,
|
||||||
|
CacheEdifice,
|
||||||
|
CacheEdificeBuilding,
|
||||||
|
CacheGoldenCookiesMult,
|
||||||
|
CacheLucky,
|
||||||
|
CacheLuckyFrenzy,
|
||||||
|
CacheLuckyReward,
|
||||||
|
CacheLuckyRewardFrenzy,
|
||||||
|
CacheLuckyWrathReward,
|
||||||
|
CacheLuckyWrathRewardFrenzy,
|
||||||
|
CacheNoGoldSwitchCookiesPS,
|
||||||
|
CacheWrathCookiesMult,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,26 +32,30 @@ export function CacheStatsCookies() {
|
|||||||
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13;
|
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13;
|
||||||
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13;
|
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13;
|
||||||
CacheLuckyFrenzy = CacheLucky * 7;
|
CacheLuckyFrenzy = CacheLucky * 7;
|
||||||
CacheLuckyRewardFrenzy = CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
CacheLuckyRewardFrenzy =
|
||||||
CacheLuckyWrathRewardFrenzy = CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||||
|
CacheLuckyWrathRewardFrenzy =
|
||||||
|
CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||||
CacheConjure = CacheLucky * 2;
|
CacheConjure = CacheLucky * 2;
|
||||||
CacheConjureReward = CacheConjure * 0.15;
|
CacheConjureReward = CacheConjure * 0.15;
|
||||||
|
|
||||||
CacheEdifice = 0;
|
CacheEdifice = 0;
|
||||||
let max = 0;
|
let max = 0;
|
||||||
let n = 0;
|
let n = 0;
|
||||||
for (const i of Object.keys(Game.Objects)) {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
if (Game.Objects[i].amount > max) max = Game.Objects[i].amount;
|
if (Game.Objects[i].amount > max) max = Game.Objects[i].amount;
|
||||||
if (Game.Objects[i].amount > 0) n++;
|
if (Game.Objects[i].amount > 0) n += 1;
|
||||||
}
|
});
|
||||||
for (const i of Object.keys(Game.Objects)) {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
if ((Game.Objects[i].amount < max || n === 1)
|
if (
|
||||||
&& Game.Objects[i].amount < 400
|
(Game.Objects[i].amount < max || n === 1) &&
|
||||||
&& Game.Objects[i].price * 2 > CacheEdifice) {
|
Game.Objects[i].amount < 400 &&
|
||||||
|
Game.Objects[i].price * 2 > CacheEdifice
|
||||||
|
) {
|
||||||
CacheEdifice = Game.Objects[i].price * 2;
|
CacheEdifice = Game.Objects[i].price * 2;
|
||||||
CacheEdificeBuilding = i;
|
CacheEdificeBuilding = i;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,6 +85,7 @@ export function CacheGoldenAndWrathCookiesMults() {
|
|||||||
// Otherwise, the aura effect will be factored in the base CPS making the multiplier not requiring adjustment.
|
// Otherwise, the aura effect will be factored in the base CPS making the multiplier not requiring adjustment.
|
||||||
CacheDragonsFortuneMultAdjustment = 1;
|
CacheDragonsFortuneMultAdjustment = 1;
|
||||||
if (Game.shimmerTypes.golden.n === 0) {
|
if (Game.shimmerTypes.golden.n === 0) {
|
||||||
CacheDragonsFortuneMultAdjustment *= 1 + Game.auraMult('Dragon\'s Fortune') * 1.23;
|
CacheDragonsFortuneMultAdjustment *=
|
||||||
|
1 + Game.auraMult("Dragon's Fortune") * 1.23;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ export let CacheWrinklersTotal = 0;
|
|||||||
export let CacheWrinklersNormal = 0;
|
export let CacheWrinklersNormal = 0;
|
||||||
export let CacheWrinklersFattest = [0, null];
|
export let CacheWrinklersFattest = [0, null];
|
||||||
|
|
||||||
export let CacheAvgCps = 0;
|
|
||||||
export let CacheCurrWrinklerCPSMult = 0;
|
export let CacheCurrWrinklerCPSMult = 0;
|
||||||
export let CacheCurrWrinklerCount = 0;
|
export let CacheCurrWrinklerCount = 0;
|
||||||
|
|
||||||
@@ -66,10 +65,10 @@ export let CacheSeasonPopShimmer = {};
|
|||||||
|
|
||||||
export let CacheTimeTillNextPrestige = 0;
|
export let CacheTimeTillNextPrestige = 0;
|
||||||
|
|
||||||
|
/** Stores lowest PP value */
|
||||||
export let CacheMinPP = 0;
|
export let CacheMinPP = 0;
|
||||||
export let CacheMidPP = 0;
|
/** Stores all PP values of all buildings for all buy settings (1, 10, 100) */
|
||||||
export let CacheMaxPP = 0;
|
export let CachePPArray = [];
|
||||||
export let CacheArrayOfPPs = [];
|
|
||||||
|
|
||||||
export let CacheGoldenShimmersByID = {};
|
export let CacheGoldenShimmersByID = {};
|
||||||
|
|
||||||
@@ -100,3 +99,18 @@ export let CacheLastHeavenlyChips;
|
|||||||
export let CacheDoRemakeBuildPrices;
|
export let CacheDoRemakeBuildPrices;
|
||||||
|
|
||||||
export let CacheHadBuildAura;
|
export let CacheHadBuildAura;
|
||||||
|
|
||||||
|
/** Store the CPS effect of each god if it was put into each slot */
|
||||||
|
export let CacheGods = {
|
||||||
|
0: [0, 0, 0],
|
||||||
|
1: [0, 0, 0],
|
||||||
|
2: [0, 0, 0],
|
||||||
|
3: [0, 0, 0],
|
||||||
|
4: [0, 0, 0],
|
||||||
|
5: [0, 0, 0],
|
||||||
|
6: [0, 0, 0],
|
||||||
|
7: [0, 0, 0],
|
||||||
|
8: [0, 0, 0],
|
||||||
|
9: [0, 0, 0],
|
||||||
|
10: [0, 0, 0],
|
||||||
|
};
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
CacheWrinklersFattest, CacheWrinklersNormal, CacheWrinklersTotal,
|
CacheWrinklersFattest,
|
||||||
|
CacheWrinklersNormal,
|
||||||
|
CacheWrinklersTotal,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,8 +16,11 @@ import {
|
|||||||
* @global {[{number}, {number}]} CM.Cache.WrinklersFattest A list containing the cookies and the id of the fattest non-shiny wrinkler
|
* @global {[{number}, {number}]} CM.Cache.WrinklersFattest A list containing the cookies and the id of the fattest non-shiny wrinkler
|
||||||
*/
|
*/
|
||||||
export default function CacheWrinklers() {
|
export default function CacheWrinklers() {
|
||||||
|
CacheWrinklersTotal = 0;
|
||||||
|
CacheWrinklersNormal = 0;
|
||||||
|
CacheWrinklersFattest = [0, null];
|
||||||
for (let i = 0; i < Game.wrinklers.length; i++) {
|
for (let i = 0; i < Game.wrinklers.length; i++) {
|
||||||
let sucked = Game.wrinklers[i].sucked;
|
let { sucked } = Game.wrinklers[i];
|
||||||
let toSuck = 1.1;
|
let toSuck = 1.1;
|
||||||
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
||||||
if (Game.wrinklers[i].type === 1) toSuck *= 3; // Shiny wrinklers
|
if (Game.wrinklers[i].type === 1) toSuck *= 3; // Shiny wrinklers
|
||||||
@@ -30,7 +35,8 @@ export default function CacheWrinklers() {
|
|||||||
CacheWrinklersTotal += sucked;
|
CacheWrinklersTotal += sucked;
|
||||||
if (Game.wrinklers[i].type === 0) {
|
if (Game.wrinklers[i].type === 0) {
|
||||||
CacheWrinklersNormal += sucked;
|
CacheWrinklersNormal += sucked;
|
||||||
if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i];
|
if (sucked > CacheWrinklersFattest[0])
|
||||||
|
CacheWrinklersFattest = [sucked, i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { default as ConfigDefault } from '../../Data/SettingsDefault';
|
import ConfigDefault from '../../Data/SettingsDefault';
|
||||||
import { default as ConfigData } from '../../Data/SettingsData';
|
import ConfigData from '../../Data/SettingsData';
|
||||||
import { CMOptions } from '../VariablesAndData';
|
import { CMOptions } from '../VariablesAndData';
|
||||||
import save from '../../InitSaveLoad/save';
|
import save from '../../InitSaveLoad/save';
|
||||||
import CMLoop from '../../Main/Loop';
|
import CMLoop from '../../Main/Loop';
|
||||||
@@ -13,11 +13,19 @@ import CMLoop from '../../Main/Loop';
|
|||||||
* CM.ToggleConfigVolume() and changes in options with type "url", "color" or "numscale"
|
* CM.ToggleConfigVolume() and changes in options with type "url", "color" or "numscale"
|
||||||
*/
|
*/
|
||||||
export function SaveConfig() {
|
export function SaveConfig() {
|
||||||
const saveString = b64_to_utf8(unescape(localStorage.getItem('CookieClickerGame')).split('!END!')[0]);
|
const saveString = b64_to_utf8(
|
||||||
|
unescape(localStorage.getItem('CookieClickerGame')).split('!END!')[0],
|
||||||
|
);
|
||||||
const CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
|
const CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
|
||||||
if (CookieMonsterSave !== null) {
|
if (CookieMonsterSave !== null) {
|
||||||
const newSaveString = saveString.replace(CookieMonsterSave[0], `CookieMonster:${save()}`);
|
const newSaveString = saveString.replace(
|
||||||
localStorage.setItem('CookieClickerGame', escape(`${utf8_to_b64(newSaveString)}!END!`));
|
CookieMonsterSave[0],
|
||||||
|
`CookieMonster:${save()}`,
|
||||||
|
);
|
||||||
|
localStorage.setItem(
|
||||||
|
'CookieClickerGame',
|
||||||
|
escape(`${utf8_to_b64(newSaveString)}!END!`),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,44 +43,55 @@ export function LoadConfig(settings) {
|
|||||||
|
|
||||||
// Check values
|
// Check values
|
||||||
let mod = false;
|
let mod = false;
|
||||||
for (const i in ConfigDefault) {
|
Object.keys(ConfigDefault).forEach((i) => {
|
||||||
if (typeof CMOptions[i] === 'undefined') {
|
if (typeof CMOptions[i] === 'undefined') {
|
||||||
mod = true;
|
mod = true;
|
||||||
CMOptions[i] = ConfigDefault[i];
|
CMOptions[i] = ConfigDefault[i];
|
||||||
} else if (i !== 'Header' && i !== 'Colors') {
|
} else if (i !== 'Header' && i !== 'Colors') {
|
||||||
if (i.indexOf('SoundURL') === -1) {
|
if (i.indexOf('SoundURL') === -1) {
|
||||||
if (!(CMOptions[i] > -1 && CMOptions[i] < ConfigData[i].label.length)) {
|
if (
|
||||||
|
!(CMOptions[i] > -1 && CMOptions[i] < ConfigData[i].label.length)
|
||||||
|
) {
|
||||||
mod = true;
|
mod = true;
|
||||||
CMOptions[i] = ConfigDefault[i];
|
CMOptions[i] = ConfigDefault[i];
|
||||||
}
|
}
|
||||||
} else if (typeof CMOptions[i] !== 'string') { // Sound URLs
|
} else if (typeof CMOptions[i] !== 'string') {
|
||||||
|
// Sound URLs
|
||||||
mod = true;
|
mod = true;
|
||||||
CMOptions[i] = ConfigDefault[i];
|
CMOptions[i] = ConfigDefault[i];
|
||||||
}
|
}
|
||||||
} else if (i === 'Header') {
|
} else if (i === 'Header') {
|
||||||
for (const j in ConfigDefault.Header) {
|
Object.keys(ConfigDefault.Header).forEach((j) => {
|
||||||
if (typeof CMOptions[i][j] === 'undefined' || !(CMOptions[i][j] > -1 && CMOptions[i][j] < 2)) {
|
if (
|
||||||
|
typeof CMOptions[i][j] === 'undefined' ||
|
||||||
|
!(CMOptions[i][j] > -1 && CMOptions[i][j] < 2)
|
||||||
|
) {
|
||||||
mod = true;
|
mod = true;
|
||||||
CMOptions[i][j] = ConfigDefault[i][j];
|
CMOptions[i][j] = ConfigDefault[i][j];
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
} else { // Colors
|
} else {
|
||||||
for (const j in ConfigDefault.Colors) {
|
// Colors
|
||||||
if (typeof CMOptions[i][j] === 'undefined' || typeof CMOptions[i][j] !== 'string') {
|
Object.keys(ConfigDefault.Colors).forEach((j) => {
|
||||||
|
if (
|
||||||
|
typeof CMOptions[i][j] === 'undefined' ||
|
||||||
|
typeof CMOptions[i][j] !== 'string'
|
||||||
|
) {
|
||||||
mod = true;
|
mod = true;
|
||||||
CMOptions[i][j] = ConfigDefault[i][j];
|
CMOptions[i][j] = ConfigDefault[i][j];
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
|
||||||
if (mod) SaveConfig();
|
if (mod) SaveConfig();
|
||||||
CMLoop(); // Do loop once
|
CMLoop(); // Do loop once
|
||||||
for (const i in ConfigDefault) {
|
Object.keys(ConfigDefault).forEach((i) => {
|
||||||
if (i !== 'Header' && typeof ConfigData[i].func !== 'undefined') {
|
if (i !== 'Header' && typeof ConfigData[i].func !== 'undefined') {
|
||||||
ConfigData[i].func();
|
ConfigData[i].func();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
} else { // Default values
|
} else {
|
||||||
|
// Default values
|
||||||
LoadConfig(ConfigDefault);
|
LoadConfig(ConfigDefault);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,15 +7,22 @@ import { CMOptions } from './VariablesAndData';
|
|||||||
* This function changes the position of both the bottom and timer bar
|
* This function changes the position of both the bottom and timer bar
|
||||||
*/
|
*/
|
||||||
export function UpdateBotTimerBarPosition() {
|
export function UpdateBotTimerBarPosition() {
|
||||||
if (CMOptions.BotBar === 1 && CMOptions.TimerBar === 1 && CMOptions.TimerBarPos === 1) {
|
if (
|
||||||
|
CMOptions.BotBar === 1 &&
|
||||||
|
CMOptions.TimerBar === 1 &&
|
||||||
|
CMOptions.TimerBarPos === 1
|
||||||
|
) {
|
||||||
l('CMBotBar').style.bottom = l('CMTimerBar').style.height;
|
l('CMBotBar').style.bottom = l('CMTimerBar').style.height;
|
||||||
l('game').style.bottom = `${Number(l('CMTimerBar').style.height.replace('px', '')) + 70}px`;
|
l('game').style.bottom = `${
|
||||||
|
Number(l('CMTimerBar').style.height.replace('px', '')) + 70
|
||||||
|
}px`;
|
||||||
} else if (CMOptions.BotBar === 1) {
|
} else if (CMOptions.BotBar === 1) {
|
||||||
l('CMBotBar').style.bottom = '0px';
|
l('CMBotBar').style.bottom = '0px';
|
||||||
l('game').style.bottom = '70px';
|
l('game').style.bottom = '70px';
|
||||||
} else if (CMOptions.TimerBar === 1 && CMOptions.TimerBarPos === 1) {
|
} else if (CMOptions.TimerBar === 1 && CMOptions.TimerBarPos === 1) {
|
||||||
l('game').style.bottom = l('CMTimerBar').style.height;
|
l('game').style.bottom = l('CMTimerBar').style.height;
|
||||||
} else { // No bars
|
} else {
|
||||||
|
// No bars
|
||||||
l('game').style.bottom = '0px';
|
l('game').style.bottom = '0px';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { default as ConfigData } from '../Data/SettingsData';
|
import ConfigData from '../Data/SettingsData';
|
||||||
import { SaveConfig } from './SaveLoadReload/SaveLoadReloadSettings';
|
import { SaveConfig } from './SaveLoadReload/SaveLoadReloadSettings';
|
||||||
import { CMOptions } from './VariablesAndData';
|
import { CMOptions } from './VariablesAndData';
|
||||||
|
|
||||||
@@ -13,18 +13,20 @@ export const ConfigPrefix = 'CMConfig';
|
|||||||
* @param {string} config The name of the option
|
* @param {string} config The name of the option
|
||||||
*/
|
*/
|
||||||
export function ToggleConfig(config) {
|
export function ToggleConfig(config) {
|
||||||
CMOptions[config]++;
|
CMOptions[config] += 1;
|
||||||
|
|
||||||
if (CMOptions[config] === ConfigData[config].label.length) {
|
if (CMOptions[config] === ConfigData[config].label.length) {
|
||||||
CMOptions[config] = 0;
|
CMOptions[config] = 0;
|
||||||
if (ConfigData[config].toggle) l(ConfigPrefix + config).className = 'option off';
|
if (ConfigData[config].toggle)
|
||||||
|
l(ConfigPrefix + config).className = 'option off';
|
||||||
} else l(ConfigPrefix + config).className = 'option';
|
} else l(ConfigPrefix + config).className = 'option';
|
||||||
|
|
||||||
if (typeof ConfigData[config].func !== 'undefined') {
|
if (typeof ConfigData[config].func !== 'undefined') {
|
||||||
ConfigData[config].func();
|
ConfigData[config].func();
|
||||||
}
|
}
|
||||||
|
|
||||||
l(ConfigPrefix + config).innerHTML = ConfigData[config].label[CMOptions[config]];
|
l(ConfigPrefix + config).innerHTML =
|
||||||
|
ConfigData[config].label[CMOptions[config]];
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +49,7 @@ export function ToggleConfigVolume(config) {
|
|||||||
* @param {string} config The name of the header
|
* @param {string} config The name of the header
|
||||||
*/
|
*/
|
||||||
export function ToggleHeader(config) {
|
export function ToggleHeader(config) {
|
||||||
CMOptions.Header[config]++;
|
CMOptions.Header[config] += 1;
|
||||||
if (CMOptions.Header[config] > 1) CMOptions.Header[config] = 0;
|
if (CMOptions.Header[config] > 1) CMOptions.Header[config] = 0;
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-return-assign */
|
||||||
import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
|
import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
|
||||||
import { GCTimers } from '../../Disp/VariablesAndData';
|
import { GCTimers } from '../../Disp/VariablesAndData';
|
||||||
import { CMOptions } from '../VariablesAndData';
|
import { CMOptions } from '../VariablesAndData';
|
||||||
@@ -8,12 +9,12 @@ import { CMOptions } from '../VariablesAndData';
|
|||||||
*/
|
*/
|
||||||
export default function ToggleGCTimer() {
|
export default function ToggleGCTimer() {
|
||||||
if (CMOptions.GCTimer === 1) {
|
if (CMOptions.GCTimer === 1) {
|
||||||
for (const i of Object.keys(GCTimers)) {
|
Object.keys(GCTimers).forEach((i) => {
|
||||||
GCTimers[i].style.display = 'block';
|
GCTimers[i].style.display = 'block';
|
||||||
GCTimers[i].style.left = CacheGoldenShimmersByID[i].l.style.left;
|
GCTimers[i].style.left = CacheGoldenShimmersByID[i].l.style.left;
|
||||||
GCTimers[i].style.top = CacheGoldenShimmersByID[i].l.style.top;
|
GCTimers[i].style.top = CacheGoldenShimmersByID[i].l.style.top;
|
||||||
}
|
});
|
||||||
} else {
|
} else {
|
||||||
for (const i of Object.keys(GCTimers)) GCTimers[i].style.display = 'none';
|
Object.keys(GCTimers).forEach((i) => (GCTimers[i].style.display = 'none'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
src/Config/Toggles/ToggleSectionHideButtons.js
Normal file
13
src/Config/Toggles/ToggleSectionHideButtons.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { CMOptions } from '../VariablesAndData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function updates the display setting of the two objects created by CM.Disp.CreateWrinklerButtons()
|
||||||
|
* It is called by changes in CM.Options.WrinklerButtons
|
||||||
|
*/
|
||||||
|
export default function ToggleSectionHideButtons() {
|
||||||
|
if (CMOptions.HideSectionsButtons) {
|
||||||
|
l('CMSectionHidButtons').style.display = '';
|
||||||
|
} else {
|
||||||
|
l('CMSectionHidButtons').style.display = 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,13 +9,16 @@ import { CMOptions } from '../VariablesAndData';
|
|||||||
* It is called by a change in CM.Options.UpBarColor
|
* It is called by a change in CM.Options.UpBarColor
|
||||||
*/
|
*/
|
||||||
export default function ToggleUpgradeBarAndColor() {
|
export default function ToggleUpgradeBarAndColor() {
|
||||||
if (CMOptions.UpBarColor === 1) { // Colours and bar on
|
if (CMOptions.UpBarColor === 1) {
|
||||||
|
// Colours and bar on
|
||||||
l('CMUpgradeBar').style.display = '';
|
l('CMUpgradeBar').style.display = '';
|
||||||
UpdateUpgrades();
|
UpdateUpgrades();
|
||||||
} else if (CMOptions.UpBarColor === 2) { // Colours on and bar off
|
} else if (CMOptions.UpBarColor === 2) {
|
||||||
|
// Colours on and bar off
|
||||||
l('CMUpgradeBar').style.display = 'none';
|
l('CMUpgradeBar').style.display = 'none';
|
||||||
UpdateUpgrades();
|
UpdateUpgrades();
|
||||||
} else { // Colours and bar off
|
} else {
|
||||||
|
// Colours and bar off
|
||||||
l('CMUpgradeBar').style.display = 'none';
|
l('CMUpgradeBar').style.display = 'none';
|
||||||
Game.RebuildUpgrades();
|
Game.RebuildUpgrades();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import { CMOptions } from '../VariablesAndData';
|
|||||||
* It is called by a change in CM.Options.UpgradeBarFixedPos
|
* It is called by a change in CM.Options.UpgradeBarFixedPos
|
||||||
*/
|
*/
|
||||||
export default function ToggleUpgradeBarFixedPos() {
|
export default function ToggleUpgradeBarFixedPos() {
|
||||||
if (CMOptions.UpgradeBarFixedPos === 1) { // Fix to top of screen when scrolling
|
if (CMOptions.UpgradeBarFixedPos === 1) {
|
||||||
|
// Fix to top of screen when scrolling
|
||||||
l('CMUpgradeBar').style.position = 'sticky';
|
l('CMUpgradeBar').style.position = 'sticky';
|
||||||
l('CMUpgradeBar').style.top = '0px';
|
l('CMUpgradeBar').style.top = '0px';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ export const HalloCookies = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all Christmas cookies */
|
/** Array of the names of all Christmas cookies */
|
||||||
export const ChristCookies = ['Christmas tree biscuits',
|
export const ChristCookies = [
|
||||||
|
'Christmas tree biscuits',
|
||||||
'Snowflake biscuits',
|
'Snowflake biscuits',
|
||||||
'Snowman biscuits',
|
'Snowman biscuits',
|
||||||
'Holly biscuits',
|
'Holly biscuits',
|
||||||
@@ -49,7 +50,8 @@ export const ChristCookies = ['Christmas tree biscuits',
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all Valentine cookies */
|
/** Array of the names of all Valentine cookies */
|
||||||
export const ValCookies = ['Pure heart biscuits',
|
export const ValCookies = [
|
||||||
|
'Pure heart biscuits',
|
||||||
'Ardent heart biscuits',
|
'Ardent heart biscuits',
|
||||||
'Sour heart biscuits',
|
'Sour heart biscuits',
|
||||||
'Weeping heart biscuits',
|
'Weeping heart biscuits',
|
||||||
@@ -59,7 +61,8 @@ export const ValCookies = ['Pure heart biscuits',
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of the names of all plant drops */
|
/** Array of the names of all plant drops */
|
||||||
export const PlantDrops = ['Elderwort biscuits',
|
export const PlantDrops = [
|
||||||
|
'Elderwort biscuits',
|
||||||
'Bakeberry cookies',
|
'Bakeberry cookies',
|
||||||
'Duketater cookies',
|
'Duketater cookies',
|
||||||
'Green yeast digestives',
|
'Green yeast digestives',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** Data related directly to Cookie Monster */
|
/** Data related directly to Cookie Monster */
|
||||||
|
|
||||||
export const VersionMajor = '2.031';
|
export const VersionMajor = '2.031';
|
||||||
export const VersionMinor = '5';
|
export const VersionMinor = '6';
|
||||||
|
|
||||||
/** Information about Cookie Monster to be displayed in the info section */
|
/** Information about Cookie Monster to be displayed in the info section */
|
||||||
export const ModDescription = `<div class="listing">
|
export const ModDescription = `<div class="listing">
|
||||||
@@ -15,15 +15,27 @@ export const ModDescription = `<div class="listing">
|
|||||||
|
|
||||||
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
||||||
export const LatestReleaseNotes = `<div class="listing">
|
export const LatestReleaseNotes = `<div class="listing">
|
||||||
The latest update (v 2.031.5) sees a total rehaul of the backend of the mod. It does not introduce any new functions, this is planned for the next release.</br>
|
The latest update (v 2.031.6) has revamped the way PP is colourcoded. In the previous versions this was not always correct and we had some settings that made it even more incorrect. With this update Cookie Monster compares the PP of a building to all other possibilities (also buying 10 or 100) of a building and colors the PP accordingly.</br>
|
||||||
We believe we have fixed all bugs related to this new code, but if you find any bugs, please report them on the GitHub!</br>
|
This means that if it is better to buy 10 of a building immediately rather than to buy in increments of 1 Cookie Monster will now show this! In this case the buy 1 option will be yellow, while the buy 10 option will be green.</br>
|
||||||
|
This also means that you will see some more diverse colors. Rather than coloring according to arbitrary "middle values" Cookie Monster now uses a top 10, 20 and 30. While this might take some getting used to we believe the new system is much better in conveying useful information to the user while also being more correct!</br>
|
||||||
</br>
|
</br>
|
||||||
<b>Besides, this update fixes the following bugs:</b></br>
|
This update also implements the following functions:</br>
|
||||||
- Fixed some upgrade tooltips which did not display the full effect of buying the upgrades</br>
|
- Added a tooltip displaying the reward to the extra pop wrinkler buttons</br>
|
||||||
- Fixed not always being able to sell when "blocking bulk buy"</br>
|
- Added tooltips to the Gods in the Pantheon</br>
|
||||||
- Fixed heavenly chips per second display</br>
|
- The tooltip for Elder Pledge now displays correctly, although it takes some time to load after Cookie Monster has been loaded</br>
|
||||||
- Fixed small display bug when pressing shift and hovering over garden plots</br>
|
- You can now test the volume and sound of notifications in the settings screen</br>
|
||||||
- Fixed some bugs with the display of numbers and formatting of them</br>
|
- The bottom bar will now flicker less and each column has received a bit of padding</br>
|
||||||
|
- Introduced new colour scheme for PP, see the explanation of colors in the Readme or the settings</br>
|
||||||
|
- Added option to show buttons that can hide the upgrade and building section</br>
|
||||||
|
- Added option to display PP as a time unit, note that these are only approximations. PP does not translate directly into time (the name is deceptive, we know...)</br>
|
||||||
|
- Statistics page now shows chance for random drops when they have not been achieved</br>
|
||||||
|
</br>
|
||||||
|
This update fixes the following bugs:</br>
|
||||||
|
- Incorrect amount for "required for max plant reward" in statistics page</br>
|
||||||
|
- Fixed the tooltips of the '?' buttons in the statistics page not showing</br>
|
||||||
|
- Fixed some unclear settings descriptions </br>
|
||||||
|
</br>
|
||||||
|
Please submit any bug reports or feature requests to the <a href="https://github.com/Aktanusa/CookieMonster">GitHub page!</a>
|
||||||
</br>
|
</br>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -1,19 +1,11 @@
|
|||||||
/** 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 = ['',
|
export const metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
||||||
'',
|
|
||||||
'M',
|
|
||||||
'G',
|
|
||||||
'T',
|
|
||||||
'P',
|
|
||||||
'E',
|
|
||||||
'Z',
|
|
||||||
'Y',
|
|
||||||
];
|
|
||||||
|
|
||||||
/** Array of abbreviations used in the "Short" scale */
|
/** Array of abbreviations used in the "Short" scale */
|
||||||
export const shortScale = ['',
|
export const shortScale = [
|
||||||
|
'',
|
||||||
'',
|
'',
|
||||||
'M',
|
'M',
|
||||||
'B',
|
'B',
|
||||||
@@ -42,7 +34,8 @@ export const shortScale = ['',
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Array of abbreviations used in the "Abbreviated Short" scale */
|
/** Array of abbreviations used in the "Abbreviated Short" scale */
|
||||||
export const shortScaleAbbreviated = ['',
|
export const shortScaleAbbreviated = [
|
||||||
|
'',
|
||||||
'K',
|
'K',
|
||||||
'M',
|
'M',
|
||||||
'B',
|
'B',
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import CachePP from '../Cache/PP/PP';
|
/* eslint-disable no-unused-vars */
|
||||||
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions';
|
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions';
|
||||||
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
|
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
|
||||||
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
||||||
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
|
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
|
||||||
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
|
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
|
||||||
|
import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons';
|
||||||
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
||||||
import ToggleUpgradeBarAndColor from '../Config/Toggles/ToggleUpgradeBarAndColor';
|
import ToggleUpgradeBarAndColor from '../Config/Toggles/ToggleUpgradeBarAndColor';
|
||||||
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
||||||
@@ -14,8 +15,12 @@ import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
|
|||||||
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
||||||
import UpdateColors from '../Disp/HelperFunctions/UpdateColors';
|
import UpdateColors from '../Disp/HelperFunctions/UpdateColors';
|
||||||
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
||||||
|
import { SimDoSims } from '../Sim/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
SettingStandard, SettingColours, SettingVolume, SettingInputNumber,
|
SettingStandard,
|
||||||
|
SettingColours,
|
||||||
|
SettingVolume,
|
||||||
|
SettingInputNumber,
|
||||||
} from './SettingClasses';
|
} from './SettingClasses';
|
||||||
|
|
||||||
/** This includes all options of CookieMonster and their relevant data */
|
/** This includes all options of CookieMonster and their relevant data */
|
||||||
@@ -27,7 +32,9 @@ const Config = {
|
|||||||
['Bottom Bar OFF', 'Bottom Bar ON'],
|
['Bottom Bar OFF', 'Bottom Bar ON'],
|
||||||
'Building Information',
|
'Building Information',
|
||||||
true,
|
true,
|
||||||
function () { ToggleBotBar(); },
|
function () {
|
||||||
|
ToggleBotBar();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
TimerBar: new SettingStandard(
|
TimerBar: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -35,7 +42,9 @@ const Config = {
|
|||||||
['Timer Bar OFF', 'Timer Bar ON'],
|
['Timer Bar OFF', 'Timer Bar ON'],
|
||||||
'Timers of Golden Cookie, Season Popup, Frenzy (Normal, Clot, Elder), Click Frenzy',
|
'Timers of Golden Cookie, Season Popup, Frenzy (Normal, Clot, Elder), Click Frenzy',
|
||||||
true,
|
true,
|
||||||
function () { ToggleTimerBar(); },
|
function () {
|
||||||
|
ToggleTimerBar();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
TimerBarPos: new SettingStandard(
|
TimerBarPos: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -43,22 +52,34 @@ const Config = {
|
|||||||
['Timer Bar Position (Top Left)', 'Timer Bar Position (Bottom)'],
|
['Timer Bar Position (Top Left)', 'Timer Bar Position (Bottom)'],
|
||||||
'Placement of the Timer Bar',
|
'Placement of the Timer Bar',
|
||||||
false,
|
false,
|
||||||
function () { ToggleTimerBarPos(); },
|
function () {
|
||||||
|
ToggleTimerBarPos();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
TimerBarOverlay: new SettingStandard(
|
TimerBarOverlay: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsColors',
|
'BarsColors',
|
||||||
['Timer Bar Overlay OFF', 'Timer Bar Overlay Only Seconds', 'Timer Bar Overlay Full'],
|
[
|
||||||
|
'Timer Bar Overlay OFF',
|
||||||
|
'Timer Bar Overlay Only Seconds',
|
||||||
|
'Timer Bar Overlay Full',
|
||||||
|
],
|
||||||
'Overlay on timers displaying seconds and/or percentage left',
|
'Overlay on timers displaying seconds and/or percentage left',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
SortBuildings: new SettingStandard(
|
SortBuildings: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsColors',
|
'BarsColors',
|
||||||
['Sort Buildings: Default', 'Sort Buildings: PP'],
|
[
|
||||||
|
'Sort Buildings: Default',
|
||||||
|
'Sort Buildings: PP of x1 purchase',
|
||||||
|
'Sort Buildings: PP of selected bulk mode',
|
||||||
|
],
|
||||||
'Sort the display of buildings in either default order or by PP',
|
'Sort the display of buildings in either default order or by PP',
|
||||||
false,
|
false,
|
||||||
function () { UpdateBuildings(); },
|
function () {
|
||||||
|
UpdateBuildings();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
SortUpgrades: new SettingStandard(
|
SortUpgrades: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -66,7 +87,9 @@ const Config = {
|
|||||||
['Sort Upgrades: Default', 'Sort Upgrades: PP'],
|
['Sort Upgrades: Default', 'Sort Upgrades: PP'],
|
||||||
'Sort the display of upgrades in either default order or by PP',
|
'Sort the display of upgrades in either default order or by PP',
|
||||||
false,
|
false,
|
||||||
function () { UpdateUpgrades(); },
|
function () {
|
||||||
|
UpdateUpgrades();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
BuildColor: new SettingStandard(
|
BuildColor: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -74,39 +97,55 @@ const Config = {
|
|||||||
['Building Colors OFF', 'Building Colors ON'],
|
['Building Colors OFF', 'Building Colors ON'],
|
||||||
'Color code buildings',
|
'Color code buildings',
|
||||||
true,
|
true,
|
||||||
function () { UpdateBuildings(); },
|
function () {
|
||||||
|
UpdateBuildings();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
BulkBuildColor: new SettingStandard(
|
PPDisplayTime: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsColors',
|
'BarsColors',
|
||||||
['Bulk Building Colors (Single Building Color)', 'Bulk Building Colors (Calculated Bulk Color)'],
|
['PP As Value (Standard)', 'PP As Time Unit'],
|
||||||
'Color code bulk buildings based on single buildings color or calculated bulk value color',
|
'Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.',
|
||||||
false,
|
false,
|
||||||
function () { UpdateBuildings(); },
|
|
||||||
),
|
),
|
||||||
UpBarColor: new SettingStandard(
|
UpBarColor: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsColors',
|
'BarsColors',
|
||||||
['Upgrade Colors/Bar OFF', 'Upgrade Colors with Bar ON', 'Upgrade Colors without Bar ON'],
|
[
|
||||||
|
'Upgrade Colors/Bar OFF',
|
||||||
|
'Upgrade Colors with Bar ON',
|
||||||
|
'Upgrade Colors without Bar ON',
|
||||||
|
],
|
||||||
'Color code upgrades and optionally add a counter bar',
|
'Color code upgrades and optionally add a counter bar',
|
||||||
false,
|
false,
|
||||||
function () { ToggleUpgradeBarAndColor(); },
|
function () {
|
||||||
|
ToggleUpgradeBarAndColor();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Colors: new SettingColours(
|
Colors: new SettingColours(
|
||||||
'color',
|
'color',
|
||||||
'BarsColors',
|
'BarsColors',
|
||||||
{
|
{
|
||||||
Blue: 'Color Blue. Used to show better than best PP building, for Click Frenzy bar, and for various labels',
|
Blue:
|
||||||
Green: 'Color Green. Used to show best PP building, for Blood Frenzy bar, and for various labels',
|
'Color Blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels',
|
||||||
Yellow: 'Color Yellow. Used to show between best and worst PP buildings closer to best, for Frenzy bar, and for various labels',
|
Green:
|
||||||
Orange: 'Color Orange. Used to show between best and worst PP buildings closer to worst, for Next Reindeer bar, and for various labels',
|
'Color Green. Used to show best PP building, for Blood Frenzy bar, and for various labels',
|
||||||
Red: 'Color Red. Used to show worst PP building, for Clot bar, and for various labels',
|
Yellow:
|
||||||
Purple: 'Color Purple. Used to show worse than worst PP building, for Next Cookie bar, and for various labels',
|
'Color Yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels',
|
||||||
Gray: 'Color Gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
|
Orange:
|
||||||
|
'Color Orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels',
|
||||||
|
Red:
|
||||||
|
'Color Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels',
|
||||||
|
Purple:
|
||||||
|
'Color Purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels',
|
||||||
|
Gray:
|
||||||
|
'Color Gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
|
||||||
Pink: 'Color Pink. Used for Dragonflight bar',
|
Pink: 'Color Pink. Used for Dragonflight bar',
|
||||||
Brown: 'Color Brown. Used for Dragon Harvest bar',
|
Brown: 'Color Brown. Used for Dragon Harvest bar',
|
||||||
},
|
},
|
||||||
function () { UpdateColors(); },
|
function () {
|
||||||
|
UpdateColors();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
UpgradeBarFixedPos: new SettingStandard(
|
UpgradeBarFixedPos: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -114,16 +153,25 @@ const Config = {
|
|||||||
['Upgrade Bar Fixed Position OFF', 'Upgrade Bar Fixed Position ON'],
|
['Upgrade Bar Fixed Position OFF', 'Upgrade Bar Fixed Position ON'],
|
||||||
'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling',
|
'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling',
|
||||||
true,
|
true,
|
||||||
function () { ToggleUpgradeBarFixedPos(); },
|
function () {
|
||||||
|
ToggleUpgradeBarFixedPos();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
// Calculation
|
// Calculation
|
||||||
CalcWrink: new SettingStandard(
|
CalcWrink: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Calculation',
|
'Calculation',
|
||||||
['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON', 'Calculate with Single Fattest Wrinkler ON'],
|
[
|
||||||
|
'Calculate with Wrinklers OFF',
|
||||||
|
'Calculate with Wrinklers ON',
|
||||||
|
'Calculate with Single Fattest Wrinkler ON',
|
||||||
|
],
|
||||||
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) Wrinklers',
|
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) Wrinklers',
|
||||||
true,
|
true,
|
||||||
|
function () {
|
||||||
|
SimDoSims = true;
|
||||||
|
},
|
||||||
),
|
),
|
||||||
CPSMode: new SettingStandard(
|
CPSMode: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -135,29 +183,41 @@ const Config = {
|
|||||||
AvgCPSHist: new SettingStandard(
|
AvgCPSHist: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Calculation',
|
'Calculation',
|
||||||
['Average CPS for past 10s', 'Average CPS for past 15s', 'Average CPS for past 30s', 'Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'],
|
[
|
||||||
|
'Average CPS for past 10s',
|
||||||
|
'Average CPS for past 15s',
|
||||||
|
'Average CPS for past 30s',
|
||||||
|
'Average CPS for past 1m',
|
||||||
|
'Average CPS for past 5m',
|
||||||
|
'Average CPS for past 10m',
|
||||||
|
'Average CPS for past 15m',
|
||||||
|
'Average CPS for past 30m',
|
||||||
|
],
|
||||||
'How much time average Cookies Per Second should consider',
|
'How much time average Cookies Per Second should consider',
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
AvgClicksHist: new SettingStandard(
|
AvgClicksHist: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Calculation',
|
'Calculation',
|
||||||
['Average Cookie Clicks for past 1s', 'Average Cookie Clicks for past 5s', 'Average Cookie Clicks for past 10s', 'Average Cookie Clicks for past 15s', 'Average Cookie Clicks for past 30s'],
|
[
|
||||||
|
'Average Cookie Clicks for past 1s',
|
||||||
|
'Average Cookie Clicks for past 5s',
|
||||||
|
'Average Cookie Clicks for past 10s',
|
||||||
|
'Average Cookie Clicks for past 15s',
|
||||||
|
'Average Cookie Clicks for past 30s',
|
||||||
|
],
|
||||||
'How much time average Cookie Clicks should consider',
|
'How much time average Cookie Clicks should consider',
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
ColorPPBulkMode: new SettingStandard(
|
|
||||||
'bool',
|
|
||||||
'Calculation',
|
|
||||||
['Color of PP (Compared to Single)', 'Color of PP (Compared to Bulk)'],
|
|
||||||
'Color PP-values based on comparison with single purchase or with selected bulk-buy mode',
|
|
||||||
false,
|
|
||||||
function () { CachePP(); },
|
|
||||||
),
|
|
||||||
PPExcludeTop: new SettingStandard(
|
PPExcludeTop: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Calculation',
|
'Calculation',
|
||||||
["Don't Ignore Any", 'Ignore 1st Best', 'Ignore 1st and 2nd Best', 'Ignore 1st, 2nd and 3rd Best'],
|
[
|
||||||
|
"Don't Ignore Any",
|
||||||
|
'Ignore 1st Best',
|
||||||
|
'Ignore 1st and 2nd Best',
|
||||||
|
'Ignore 1st, 2nd and 3rd Best',
|
||||||
|
],
|
||||||
'Makes CookieMonster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values',
|
'Makes CookieMonster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
@@ -179,7 +239,10 @@ const Config = {
|
|||||||
ToolWarnBon: new SettingStandard(
|
ToolWarnBon: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Calculation',
|
'Calculation',
|
||||||
['Calculate Tooltip Warning With Bonus CPS OFF', 'Calculate Tooltip Warning With Bonus CPS ON'],
|
[
|
||||||
|
'Calculate Tooltip Warning With Bonus CPS OFF',
|
||||||
|
'Calculate Tooltip Warning With Bonus CPS ON',
|
||||||
|
],
|
||||||
'Calculate the warning with or without the bonus CPS you get from buying',
|
'Calculate the warning with or without the bonus CPS you get from buying',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
@@ -205,7 +268,9 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when Golden Cookie spawns',
|
'Create a notification when Golden Cookie spawns',
|
||||||
true,
|
true,
|
||||||
function () { CheckNotificationPermissions(CMOptions.GCNotification); },
|
function () {
|
||||||
|
CheckNotificationPermissions(CMOptions.GCNotification);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
GCFlash: new SettingStandard(
|
GCFlash: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -221,12 +286,7 @@ const Config = {
|
|||||||
'Play a sound on Golden Cookie',
|
'Play a sound on Golden Cookie',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
GCVolume: new SettingVolume(
|
GCVolume: new SettingVolume('vol', 'NotificationGC', [], 'Volume'),
|
||||||
'vol',
|
|
||||||
'NotificationGC',
|
|
||||||
[],
|
|
||||||
'Volume',
|
|
||||||
),
|
|
||||||
GCSoundURL: new SettingStandard(
|
GCSoundURL: new SettingStandard(
|
||||||
'url',
|
'url',
|
||||||
'NotificationGC',
|
'NotificationGC',
|
||||||
@@ -239,7 +299,9 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when Fortune Cookie is on the Ticker',
|
'Create a notification when Fortune Cookie is on the Ticker',
|
||||||
true,
|
true,
|
||||||
function () { CheckNotificationPermissions(CMOptions.FortuneNotification); },
|
function () {
|
||||||
|
CheckNotificationPermissions(CMOptions.FortuneNotification);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
FortuneFlash: new SettingStandard(
|
FortuneFlash: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -255,12 +317,7 @@ const Config = {
|
|||||||
'Play a sound on Fortune Cookie',
|
'Play a sound on Fortune Cookie',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
FortuneVolume: new SettingVolume(
|
FortuneVolume: new SettingVolume('vol', 'NotificationFC', [], 'Volume'),
|
||||||
'vol',
|
|
||||||
'NotificationFC',
|
|
||||||
[],
|
|
||||||
'Volume',
|
|
||||||
),
|
|
||||||
|
|
||||||
FortuneSoundURL: new SettingStandard(
|
FortuneSoundURL: new SettingStandard(
|
||||||
'url',
|
'url',
|
||||||
@@ -274,7 +331,9 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification on Season Popup',
|
'Create a notification on Season Popup',
|
||||||
true,
|
true,
|
||||||
function () { CheckNotificationPermissions(CMOptions.SeaNotification); },
|
function () {
|
||||||
|
CheckNotificationPermissions(CMOptions.SeaNotification);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
SeaFlash: new SettingStandard(
|
SeaFlash: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -290,12 +349,7 @@ const Config = {
|
|||||||
'Play a sound on Season Popup',
|
'Play a sound on Season Popup',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
SeaVolume: new SettingVolume(
|
SeaVolume: new SettingVolume('vol', 'NotificationSea', [], 'Volume'),
|
||||||
'vol',
|
|
||||||
'NotificationSea',
|
|
||||||
[],
|
|
||||||
'Volume',
|
|
||||||
),
|
|
||||||
SeaSoundURL: new SettingStandard(
|
SeaSoundURL: new SettingStandard(
|
||||||
'url',
|
'url',
|
||||||
'NotificationSea',
|
'NotificationSea',
|
||||||
@@ -316,12 +370,7 @@ const Config = {
|
|||||||
'Play a sound on Garden Tick',
|
'Play a sound on Garden Tick',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
GardVolume: new SettingVolume(
|
GardVolume: new SettingVolume('vol', 'NotificationGard', [], 'Volume'),
|
||||||
'vol',
|
|
||||||
'NotificationGard',
|
|
||||||
[],
|
|
||||||
'Volume',
|
|
||||||
),
|
|
||||||
GardSoundURL: new SettingStandard(
|
GardSoundURL: new SettingStandard(
|
||||||
'url',
|
'url',
|
||||||
'NotificationGard',
|
'NotificationGard',
|
||||||
@@ -334,7 +383,9 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when magic reaches maximum',
|
'Create a notification when magic reaches maximum',
|
||||||
true,
|
true,
|
||||||
function () { CheckNotificationPermissions(CMOptions.MagicNotification); },
|
function () {
|
||||||
|
CheckNotificationPermissions(CMOptions.MagicNotification);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
MagicFlash: new SettingStandard(
|
MagicFlash: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -350,12 +401,7 @@ const Config = {
|
|||||||
'Play a sound when magic reaches maximum',
|
'Play a sound when magic reaches maximum',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
MagicVolume: new SettingVolume(
|
MagicVolume: new SettingVolume('vol', 'NotificationMagi', [], 'Volume'),
|
||||||
'vol',
|
|
||||||
'NotificationMagi',
|
|
||||||
[],
|
|
||||||
'Volume',
|
|
||||||
),
|
|
||||||
MagicSoundURL: new SettingStandard(
|
MagicSoundURL: new SettingStandard(
|
||||||
'url',
|
'url',
|
||||||
'NotificationMagi',
|
'NotificationMagi',
|
||||||
@@ -368,7 +414,9 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when a Wrinkler appears',
|
'Create a notification when a Wrinkler appears',
|
||||||
true,
|
true,
|
||||||
function () { CheckNotificationPermissions(CMOptions.WrinklerNotification); },
|
function () {
|
||||||
|
CheckNotificationPermissions(CMOptions.WrinklerNotification);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
WrinklerFlash: new SettingStandard(
|
WrinklerFlash: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -384,12 +432,7 @@ const Config = {
|
|||||||
'Play a sound when a Wrinkler appears',
|
'Play a sound when a Wrinkler appears',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
WrinklerVolume: new SettingVolume(
|
WrinklerVolume: new SettingVolume('vol', 'NotificationWrink', [], 'Volume'),
|
||||||
'vol',
|
|
||||||
'NotificationWrink',
|
|
||||||
[],
|
|
||||||
'Volume',
|
|
||||||
),
|
|
||||||
WrinklerSoundURL: new SettingStandard(
|
WrinklerSoundURL: new SettingStandard(
|
||||||
'url',
|
'url',
|
||||||
'NotificationWrink',
|
'NotificationWrink',
|
||||||
@@ -402,7 +445,9 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when the maximum amount of Wrinklers has appeared',
|
'Create a notification when the maximum amount of Wrinklers has appeared',
|
||||||
true,
|
true,
|
||||||
function () { CheckNotificationPermissions(CMOptions.WrinklerMaxNotification); },
|
function () {
|
||||||
|
CheckNotificationPermissions(CMOptions.WrinklerMaxNotification);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
WrinklerMaxFlash: new SettingStandard(
|
WrinklerMaxFlash: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -435,14 +480,20 @@ const Config = {
|
|||||||
TooltipBuildUpgrade: new SettingStandard(
|
TooltipBuildUpgrade: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Building/Upgrade Tooltip Information OFF', 'Building/Upgrade Tooltip Information ON'],
|
[
|
||||||
|
'Building/Upgrade Tooltip Information OFF',
|
||||||
|
'Building/Upgrade Tooltip Information ON',
|
||||||
|
],
|
||||||
'Extra information in Building/Upgrade tooltips',
|
'Extra information in Building/Upgrade tooltips',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
TooltipAmor: new SettingStandard(
|
TooltipAmor: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'],
|
[
|
||||||
|
'Buildings Tooltip Amortization Information OFF',
|
||||||
|
'Buildings Tooltip Amortization Information ON',
|
||||||
|
],
|
||||||
'Add amortization information to buildings tooltip',
|
'Add amortization information to buildings tooltip',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
@@ -495,7 +546,9 @@ const Config = {
|
|||||||
['Tooltip Warning Position (Left)', 'Tooltip Warning Position (Bottom)'],
|
['Tooltip Warning Position (Left)', 'Tooltip Warning Position (Bottom)'],
|
||||||
'Placement of the warning boxes',
|
'Placement of the warning boxes',
|
||||||
false,
|
false,
|
||||||
function () { ToggleToolWarnPos(); },
|
function () {
|
||||||
|
ToggleToolWarnPos();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
TooltipGrim: new SettingStandard(
|
TooltipGrim: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -525,6 +578,16 @@ const Config = {
|
|||||||
'Shows a tooltip for plants that have a cookie reward.',
|
'Shows a tooltip for plants that have a cookie reward.',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
|
TooltipPantheon: new SettingStandard(
|
||||||
|
'bool',
|
||||||
|
'Tooltip',
|
||||||
|
[
|
||||||
|
'Show Extra Info Pantheon Tooltip OFF',
|
||||||
|
'Show Extra Info Pantheon Tooltip ON',
|
||||||
|
],
|
||||||
|
'Shows additional info in the pantheon tooltip',
|
||||||
|
true,
|
||||||
|
),
|
||||||
DragonAuraInfo: new SettingStandard(
|
DragonAuraInfo: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'Tooltip',
|
||||||
@@ -575,7 +638,9 @@ const Config = {
|
|||||||
['Detailed Time OFF', 'Detailed Time ON'],
|
['Detailed Time OFF', 'Detailed Time ON'],
|
||||||
'Change how time is displayed in certain statistics and tooltips',
|
'Change how time is displayed in certain statistics and tooltips',
|
||||||
true,
|
true,
|
||||||
function () { ToggleDetailedTime(); },
|
function () {
|
||||||
|
ToggleDetailedTime();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
GrimoireBar: new SettingStandard(
|
GrimoireBar: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -604,18 +669,29 @@ const Config = {
|
|||||||
Scale: new SettingStandard(
|
Scale: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Notation',
|
'Notation',
|
||||||
['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Short Scale (Abbreviated)', 'Scientific Notation', 'Engineering Notation'],
|
[
|
||||||
|
"Game's Setting Scale",
|
||||||
|
'Metric',
|
||||||
|
'Short Scale',
|
||||||
|
'Short Scale (Abbreviated)',
|
||||||
|
'Scientific Notation',
|
||||||
|
'Engineering Notation',
|
||||||
|
],
|
||||||
'Change how long numbers are handled',
|
'Change how long numbers are handled',
|
||||||
false,
|
false,
|
||||||
function () { RefreshScale(); },
|
function () {
|
||||||
|
RefreshScale();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
ScaleDecimals: new SettingStandard(
|
ScaleDecimals: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Notation',
|
'Notation',
|
||||||
['1 decimals', '2 decimals', '3 decimals'],
|
['1 decimals', '2 decimals', '3 decimals'],
|
||||||
'Set the number of decimals used when applicable',
|
`Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game's Setting Scale"`,
|
||||||
false,
|
false,
|
||||||
function () { RefreshScale(); },
|
function () {
|
||||||
|
RefreshScale();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
ScaleSeparator: new SettingStandard(
|
ScaleSeparator: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -623,7 +699,9 @@ const Config = {
|
|||||||
['. for decimals (Standard)', '. for thousands'],
|
['. for decimals (Standard)', '. for thousands'],
|
||||||
'Set the separator used for decimals and thousands',
|
'Set the separator used for decimals and thousands',
|
||||||
false,
|
false,
|
||||||
function () { RefreshScale(); },
|
function () {
|
||||||
|
RefreshScale();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
ScaleCutoff: new SettingInputNumber(
|
ScaleCutoff: new SettingInputNumber(
|
||||||
'numscale',
|
'numscale',
|
||||||
@@ -641,7 +719,9 @@ const Config = {
|
|||||||
['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'],
|
['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'],
|
||||||
'A timer on the Golden Cookie when it has been spawned',
|
'A timer on the Golden Cookie when it has been spawned',
|
||||||
true,
|
true,
|
||||||
function () { ToggleGCTimer(); },
|
function () {
|
||||||
|
ToggleGCTimer();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Favicon: new SettingStandard(
|
Favicon: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
@@ -649,15 +729,29 @@ const Config = {
|
|||||||
['Favicon OFF', 'Favicon ON'],
|
['Favicon OFF', 'Favicon ON'],
|
||||||
'Update favicon with Golden/Wrath Cookie',
|
'Update favicon with Golden/Wrath Cookie',
|
||||||
true,
|
true,
|
||||||
function () { UpdateFavicon(); },
|
function () {
|
||||||
|
UpdateFavicon();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
WrinklerButtons: new SettingStandard(
|
WrinklerButtons: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Miscellaneous',
|
'Miscellaneous',
|
||||||
['Extra Buttons OFF', 'Extra Buttons ON'],
|
['Extra Wrinkler Buttons OFF', 'Extra Wrinkler Buttons ON'],
|
||||||
'Show buttons for popping wrinklers at bottom of cookie section',
|
'Show buttons for popping wrinklers at bottom of cookie section',
|
||||||
true,
|
true,
|
||||||
function () { ToggleWrinklerButtons(); },
|
function () {
|
||||||
|
ToggleWrinklerButtons();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
HideSectionsButtons: new SettingStandard(
|
||||||
|
'bool',
|
||||||
|
'Miscellaneous',
|
||||||
|
['Hide Upgrades/Buildings Button OFF', 'Hide Upgrades/Buildings Button ON'],
|
||||||
|
'Show buttons for hiding and showing the upgrades and buildings section in the right column',
|
||||||
|
true,
|
||||||
|
function () {
|
||||||
|
ToggleSectionHideButtons();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
BulkBuyBlock: new SettingStandard(
|
BulkBuyBlock: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
|
|||||||
@@ -5,18 +5,17 @@ const ConfigDefault = {
|
|||||||
TimerBarPos: 0,
|
TimerBarPos: 0,
|
||||||
TimerBarOverlay: 2,
|
TimerBarOverlay: 2,
|
||||||
BuildColor: 1,
|
BuildColor: 1,
|
||||||
BulkBuildColor: 0,
|
PPDisplayTime: 0,
|
||||||
UpBarColor: 1,
|
UpBarColor: 1,
|
||||||
UpgradeBarFixedPos: 1,
|
UpgradeBarFixedPos: 1,
|
||||||
CalcWrink: 0,
|
CalcWrink: 0,
|
||||||
CPSMode: 1,
|
CPSMode: 1,
|
||||||
AvgCPSHist: 3,
|
AvgCPSHist: 3,
|
||||||
AvgClicksHist: 0,
|
AvgClicksHist: 0,
|
||||||
ColorPPBulkMode: 1,
|
|
||||||
PPExcludeTop: 0,
|
PPExcludeTop: 0,
|
||||||
PPSecondsLowerLimit: 0,
|
PPSecondsLowerLimit: 0,
|
||||||
PPOnlyConsiderBuyable: 0,
|
PPOnlyConsiderBuyable: 0,
|
||||||
ToolWarnBon: 0,
|
ToolWarnBon: 1,
|
||||||
Title: 1,
|
Title: 1,
|
||||||
GeneralSound: 1,
|
GeneralSound: 1,
|
||||||
GCNotification: 0,
|
GCNotification: 0,
|
||||||
@@ -28,12 +27,14 @@ const ConfigDefault = {
|
|||||||
FortuneFlash: 1,
|
FortuneFlash: 1,
|
||||||
FortuneSound: 1,
|
FortuneSound: 1,
|
||||||
FortuneVolume: 100,
|
FortuneVolume: 100,
|
||||||
FortuneSoundURL: 'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
FortuneSoundURL:
|
||||||
|
'https://freesound.org/data/previews/174/174027_3242494-lq.mp3',
|
||||||
SeaNotification: 0,
|
SeaNotification: 0,
|
||||||
SeaFlash: 1,
|
SeaFlash: 1,
|
||||||
SeaSound: 1,
|
SeaSound: 1,
|
||||||
SeaVolume: 100,
|
SeaVolume: 100,
|
||||||
SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
SeaSoundURL:
|
||||||
|
'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3',
|
||||||
GardFlash: 1,
|
GardFlash: 1,
|
||||||
GardSound: 1,
|
GardSound: 1,
|
||||||
GardVolume: 100,
|
GardVolume: 100,
|
||||||
@@ -42,17 +43,20 @@ const ConfigDefault = {
|
|||||||
MagicFlash: 1,
|
MagicFlash: 1,
|
||||||
MagicSound: 1,
|
MagicSound: 1,
|
||||||
MagicVolume: 100,
|
MagicVolume: 100,
|
||||||
MagicSoundURL: 'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
MagicSoundURL:
|
||||||
|
'https://freesound.org/data/previews/221/221683_1015240-lq.mp3',
|
||||||
WrinklerNotification: 0,
|
WrinklerNotification: 0,
|
||||||
WrinklerFlash: 1,
|
WrinklerFlash: 1,
|
||||||
WrinklerSound: 1,
|
WrinklerSound: 1,
|
||||||
WrinklerVolume: 100,
|
WrinklerVolume: 100,
|
||||||
WrinklerSoundURL: 'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
WrinklerSoundURL:
|
||||||
|
'https://freesound.org/data/previews/124/124186_8043-lq.mp3',
|
||||||
WrinklerMaxNotification: 0,
|
WrinklerMaxNotification: 0,
|
||||||
WrinklerMaxFlash: 1,
|
WrinklerMaxFlash: 1,
|
||||||
WrinklerMaxSound: 1,
|
WrinklerMaxSound: 1,
|
||||||
WrinklerMaxVolume: 100,
|
WrinklerMaxVolume: 100,
|
||||||
WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
WrinklerMaxSoundURL:
|
||||||
|
'https://freesound.org/data/previews/152/152743_15663-lq.mp3',
|
||||||
TooltipBuildUpgrade: 1,
|
TooltipBuildUpgrade: 1,
|
||||||
TooltipAmor: 0,
|
TooltipAmor: 0,
|
||||||
ToolWarnLucky: 1,
|
ToolWarnLucky: 1,
|
||||||
@@ -66,6 +70,7 @@ const ConfigDefault = {
|
|||||||
TooltipWrink: 1,
|
TooltipWrink: 1,
|
||||||
TooltipLump: 1,
|
TooltipLump: 1,
|
||||||
TooltipPlots: 1,
|
TooltipPlots: 1,
|
||||||
|
TooltipPantheon: 1,
|
||||||
DragonAuraInfo: 1,
|
DragonAuraInfo: 1,
|
||||||
TooltipAscendButton: 1,
|
TooltipAscendButton: 1,
|
||||||
Stats: 1,
|
Stats: 1,
|
||||||
@@ -81,16 +86,48 @@ const ConfigDefault = {
|
|||||||
ScaleSeparator: 0,
|
ScaleSeparator: 0,
|
||||||
ScaleCutoff: 999999,
|
ScaleCutoff: 999999,
|
||||||
Colors: {
|
Colors: {
|
||||||
Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3', Pink: '#ff1493', Brown: '#8b4513',
|
Blue: '#4bb8f0',
|
||||||
|
Green: '#00ff00',
|
||||||
|
Yellow: '#ffff00',
|
||||||
|
Orange: '#ff7f00',
|
||||||
|
Red: '#ff0000',
|
||||||
|
Purple: '#ff00ff',
|
||||||
|
Gray: '#b3b3b3',
|
||||||
|
Pink: '#ff1493',
|
||||||
|
Brown: '#8b4513',
|
||||||
},
|
},
|
||||||
SortBuildings: 0,
|
SortBuildings: 0,
|
||||||
SortUpgrades: 0,
|
SortUpgrades: 0,
|
||||||
GCTimer: 1,
|
GCTimer: 1,
|
||||||
Favicon: 1,
|
Favicon: 1,
|
||||||
WrinklerButtons: 1,
|
WrinklerButtons: 1,
|
||||||
|
HideSectionsButtons: 0,
|
||||||
BulkBuyBlock: 0,
|
BulkBuyBlock: 0,
|
||||||
Header: {
|
Header: {
|
||||||
BarsColors: 1, Calculation: 1, Notification: 1, NotificationGeneral: 1, NotificationGC: 1, NotificationFC: 1, NotificationSea: 1, NotificationGard: 1, NotificationMagi: 1, NotificationWrink: 1, NotificationWrinkMax: 1, Tooltip: 1, Statistics: 1, Notation: 1, Miscellaneous: 1, Lucky: 1, Chain: 1, Spells: 1, Garden: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1, InfoTab: 1,
|
BarsColors: 1,
|
||||||
|
Calculation: 1,
|
||||||
|
Notification: 1,
|
||||||
|
NotificationGeneral: 1,
|
||||||
|
NotificationGC: 1,
|
||||||
|
NotificationFC: 1,
|
||||||
|
NotificationSea: 1,
|
||||||
|
NotificationGard: 1,
|
||||||
|
NotificationMagi: 1,
|
||||||
|
NotificationWrink: 1,
|
||||||
|
NotificationWrinkMax: 1,
|
||||||
|
Tooltip: 1,
|
||||||
|
Statistics: 1,
|
||||||
|
Notation: 1,
|
||||||
|
Miscellaneous: 1,
|
||||||
|
Lucky: 1,
|
||||||
|
Chain: 1,
|
||||||
|
Spells: 1,
|
||||||
|
Garden: 1,
|
||||||
|
Prestige: 1,
|
||||||
|
Wrink: 1,
|
||||||
|
Sea: 1,
|
||||||
|
Misc: 1,
|
||||||
|
InfoTab: 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
|
/* eslint-disable no-nested-ternary */
|
||||||
/** General functions to format or beautify strings */
|
/** General functions to format or beautify strings */
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales';
|
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales';
|
||||||
import { BackupFunctions } from '../../Main/VariablesAndData';
|
import { BackupFunctions } from '../../Main/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
ColorGreen, ColorOrange, ColorRed, ColorYellow,
|
ColorGreen,
|
||||||
|
ColorOrange,
|
||||||
|
ColorRed,
|
||||||
|
ColorYellow,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,49 +22,68 @@ export function Beautify(num, floats, forced) {
|
|||||||
const decimals = CMOptions.ScaleDecimals + 1;
|
const decimals = CMOptions.ScaleDecimals + 1;
|
||||||
if (num === Infinity) {
|
if (num === Infinity) {
|
||||||
return 'Infinity';
|
return 'Infinity';
|
||||||
} if (typeof num === 'undefined') {
|
}
|
||||||
|
if (typeof num === 'undefined') {
|
||||||
return '0';
|
return '0';
|
||||||
} if (CMOptions.Scale === 0) {
|
}
|
||||||
|
if (CMOptions.Scale === 0) {
|
||||||
return BackupFunctions.Beautify(num, floats);
|
return BackupFunctions.Beautify(num, floats);
|
||||||
} if (Number.isFinite(num)) {
|
}
|
||||||
|
if (Number.isFinite(num)) {
|
||||||
let answer = '';
|
let answer = '';
|
||||||
if (num === 0) {
|
if (num === 0) {
|
||||||
return num.toString();
|
return num.toString();
|
||||||
} if (num > 0.001 && num < CMOptions.ScaleCutoff) {
|
}
|
||||||
|
if (num > 0.001 && num < CMOptions.ScaleCutoff) {
|
||||||
if (CMOptions.ScaleSeparator) answer = num.toLocaleString('nl');
|
if (CMOptions.ScaleSeparator) answer = num.toLocaleString('nl');
|
||||||
else answer = num.toLocaleString('en');
|
else answer = num.toLocaleString('en');
|
||||||
return answer;
|
return answer;
|
||||||
} if (CMOptions.Scale === 4 && !forced || forced === 4) { // Scientific notation, 123456789 => 1.235E+8
|
}
|
||||||
|
if ((CMOptions.Scale === 4 && !forced) || forced === 4) {
|
||||||
|
// Scientific notation, 123456789 => 1.235E+8
|
||||||
answer = num.toExponential(decimals).toString().replace('e', 'E');
|
answer = num.toExponential(decimals).toString().replace('e', 'E');
|
||||||
} else {
|
} else {
|
||||||
const exponential = num.toExponential().toString();
|
const exponential = num.toExponential().toString();
|
||||||
const AmountOfTenPowerThree = Math.floor(exponential.slice(exponential.indexOf('e') + 1) / 3);
|
const AmountOfTenPowerThree = Math.floor(
|
||||||
answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed(decimals);
|
exponential.slice(exponential.indexOf('e') + 1) / 3,
|
||||||
|
);
|
||||||
|
answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed(
|
||||||
|
decimals,
|
||||||
|
);
|
||||||
// answer is now "xxx.xx" (e.g., 123456789 would be 123.46)
|
// answer is now "xxx.xx" (e.g., 123456789 would be 123.46)
|
||||||
if (CMOptions.Scale === 1 && !forced || forced === 1) { // Metric scale, 123456789 => 123.457 M
|
if ((CMOptions.Scale === 1 && !forced) || forced === 1) {
|
||||||
|
// Metric scale, 123456789 => 123.457 M
|
||||||
if (num >= 0.01 && num < Number(`1e${metric.length * 3}`)) {
|
if (num >= 0.01 && num < Number(`1e${metric.length * 3}`)) {
|
||||||
answer += ` ${metric[AmountOfTenPowerThree]}`;
|
answer += ` ${metric[AmountOfTenPowerThree]}`;
|
||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
||||||
} else if (CMOptions.Scale === 2 && !forced || forced === 2) { // Short scale, 123456789 => 123.457 M
|
} else if ((CMOptions.Scale === 2 && !forced) || forced === 2) {
|
||||||
|
// Short scale, 123456789 => 123.457 M
|
||||||
if (num >= 0.01 && num < Number(`1e${shortScale.length * 3}`)) {
|
if (num >= 0.01 && num < Number(`1e${shortScale.length * 3}`)) {
|
||||||
answer += ` ${shortScale[AmountOfTenPowerThree]}`;
|
answer += ` ${shortScale[AmountOfTenPowerThree]}`;
|
||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
||||||
} else if (CMOptions.Scale === 3 && !forced || forced === 3) { // Short scale, 123456789 => 123.457 M
|
} else if ((CMOptions.Scale === 3 && !forced) || forced === 3) {
|
||||||
if (num >= 0.01 && num < Number(`1e${shortScaleAbbreviated.length * 3}`)) {
|
// Short scale, 123456789 => 123.457 M
|
||||||
|
if (
|
||||||
|
num >= 0.01 &&
|
||||||
|
num < Number(`1e${shortScaleAbbreviated.length * 3}`)
|
||||||
|
) {
|
||||||
answer += ` ${shortScaleAbbreviated[AmountOfTenPowerThree]}`;
|
answer += ` ${shortScaleAbbreviated[AmountOfTenPowerThree]}`;
|
||||||
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
} else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation
|
||||||
} else if (CMOptions.Scale === 5 && !forced || forced === 5) { // Engineering notation, 123456789 => 123.457E+6
|
} else if ((CMOptions.Scale === 5 && !forced) || forced === 5) {
|
||||||
|
// Engineering notation, 123456789 => 123.457E+6
|
||||||
answer += `E${AmountOfTenPowerThree * 3}`;
|
answer += `E${AmountOfTenPowerThree * 3}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (answer === '') {
|
if (answer === '') {
|
||||||
console.log(`Could not beautify number with CM.Disp.Beautify: ${num}`);
|
console.log(
|
||||||
|
`Could not beautify number with Cookie Monster Beautify: ${num}`,
|
||||||
|
);
|
||||||
answer = BackupFunctions.Beautify(num, floats);
|
answer = BackupFunctions.Beautify(num, floats);
|
||||||
}
|
}
|
||||||
if (CMOptions.ScaleSeparator) answer = answer.replace('.', ',');
|
if (CMOptions.ScaleSeparator) answer = answer.replace('.', ',');
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
console.log(`Could not beautify number with CM.Disp.Beautify: ${num}`);
|
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`);
|
||||||
return BackupFunctions.Beautify(num, floats);
|
return BackupFunctions.Beautify(num, floats);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,27 +94,36 @@ export function Beautify(num, floats, forced) {
|
|||||||
* @returns {string} Formatted time
|
* @returns {string} Formatted time
|
||||||
*/
|
*/
|
||||||
export function FormatTime(time, longFormat) {
|
export function FormatTime(time, longFormat) {
|
||||||
|
let formattedTime = time;
|
||||||
if (time === Infinity) return time;
|
if (time === Infinity) return time;
|
||||||
time = Math.ceil(time);
|
if (time < 0) return 'Negative time period';
|
||||||
const y = Math.floor(time / 31557600);
|
formattedTime = Math.ceil(time);
|
||||||
const d = Math.floor(time % 31557600 / 86400);
|
const y = Math.floor(formattedTime / 31557600);
|
||||||
const h = Math.floor(time % 86400 / 3600);
|
const d = Math.floor((formattedTime % 31557600) / 86400);
|
||||||
const m = Math.floor(time % 3600 / 60);
|
const h = Math.floor((formattedTime % 86400) / 3600);
|
||||||
const s = Math.floor(time % 60);
|
const m = Math.floor((formattedTime % 3600) / 60);
|
||||||
|
const s = Math.floor(formattedTime % 60);
|
||||||
let str = '';
|
let str = '';
|
||||||
if (CMOptions.TimeFormat) {
|
if (CMOptions.TimeFormat) {
|
||||||
if (time > 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}:`;
|
||||||
str += `${(h < 10 ? '0' : '') + h}:`;
|
str += `${(h < 10 ? '0' : '') + h}:`;
|
||||||
str += `${(m < 10 ? '0' : '') + m}:`;
|
str += `${(m < 10 ? '0' : '') + m}:`;
|
||||||
str += (s < 10 ? '0' : '') + s;
|
str += (s < 10 ? '0' : '') + s;
|
||||||
} else {
|
} else {
|
||||||
if (time > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
|
if (formattedTime > 777600000)
|
||||||
str += (y > 0 ? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` : '');
|
return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||||
str += (d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : '');
|
str +=
|
||||||
if (str.length > 0 || h > 0) str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
|
y > 0
|
||||||
if (str.length > 0 || m > 0) str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
|
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, `
|
||||||
|
: '';
|
||||||
|
str +=
|
||||||
|
d > 0 ? `${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');
|
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData';
|
/* eslint-disable no-nested-ternary */
|
||||||
|
import {
|
||||||
|
CacheObjects1,
|
||||||
|
CacheObjects10,
|
||||||
|
CacheObjects100,
|
||||||
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
||||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
@@ -26,16 +31,17 @@ export default function UpdateBuildings() {
|
|||||||
|
|
||||||
if (Game.buyMode === 1) {
|
if (Game.buyMode === 1) {
|
||||||
if (CMOptions.BuildColor === 1) {
|
if (CMOptions.BuildColor === 1) {
|
||||||
for (const i of Object.keys(target)) {
|
Object.keys(target).forEach((i) => {
|
||||||
l(`productPrice${Game.Objects[i].id}`).style.color = CMOptions.Colors[target[i].color];
|
l(`productPrice${Game.Objects[i].id}`).style.color =
|
||||||
}
|
CMOptions.Colors[target[i].color];
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
for (const i of Object.keys(Game.Objects)) {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
l(`productPrice${Game.Objects[i].id}`).style.removeProperty('color');
|
l(`productPrice${Game.Objects[i].id}`).style.removeProperty('color');
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
} else if (Game.buyMode === -1) {
|
} else if (Game.buyMode === -1) {
|
||||||
for (const i of Object.keys(CacheObjects1)) {
|
Object.keys(CacheObjects1).forEach((i) => {
|
||||||
const o = Game.Objects[i];
|
const o = Game.Objects[i];
|
||||||
l(`productPrice${o.id}`).style.color = '';
|
l(`productPrice${o.id}`).style.color = '';
|
||||||
/*
|
/*
|
||||||
@@ -46,22 +52,52 @@ export default function UpdateBuildings() {
|
|||||||
*
|
*
|
||||||
* This issue is extensively detailed here: https://github.com/Aktanusa/CookieMonster/issues/359#issuecomment-735658262
|
* This issue is extensively detailed here: https://github.com/Aktanusa/CookieMonster/issues/359#issuecomment-735658262
|
||||||
*/
|
*/
|
||||||
l(`productPrice${o.id}`).innerHTML = Beautify(BuildingSell(o, o.basePrice, o.amount, o.free, Game.buyBulk, 1));
|
l(`productPrice${o.id}`).innerHTML = Beautify(
|
||||||
}
|
BuildingSell(o, o.basePrice, o.amount, o.free, Game.buyBulk, 1),
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build array of pointers, sort by pp, use array index (+2) as the grid row number
|
// Build array of pointers, sort by pp, use array index (+2) as the grid row number
|
||||||
// (grid rows are 1-based indexing, and row 1 is the bulk buy/sell options)
|
// (grid rows are 1-based indexing, and row 1 is the bulk buy/sell options)
|
||||||
// This regulates sorting of buildings
|
// This regulates sorting of buildings
|
||||||
if (Game.buyMode === 1 && CMOptions.SortBuildings) {
|
if (Game.buyMode === 1 && CMOptions.SortBuildings) {
|
||||||
const arr = Object.keys(target).map((k) => {
|
let arr;
|
||||||
|
if (CMOptions.SortBuildings === 1) {
|
||||||
|
arr = Object.keys(CacheObjects1).map((k) => {
|
||||||
|
const o = CacheObjects1[k];
|
||||||
|
o.name = k;
|
||||||
|
o.id = Game.Objects[k].id;
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
|
||||||
|
arr.sort(function (a, b) {
|
||||||
|
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
|
||||||
|
? 1
|
||||||
|
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
|
||||||
|
? -1
|
||||||
|
: a.pp < b.pp
|
||||||
|
? -1
|
||||||
|
: 0;
|
||||||
|
});
|
||||||
|
} else if (CMOptions.SortBuildings === 2) {
|
||||||
|
arr = Object.keys(target).map((k) => {
|
||||||
const o = target[k];
|
const o = target[k];
|
||||||
o.name = k;
|
o.name = k;
|
||||||
o.id = Game.Objects[k].id;
|
o.id = Game.Objects[k].id;
|
||||||
return o;
|
return o;
|
||||||
});
|
});
|
||||||
|
|
||||||
arr.sort(function (a, b) { return (Colors.indexOf(a.color) > Colors.indexOf(b.color) ? 1 : (Colors.indexOf(a.color) < Colors.indexOf(b.color) ? -1 : (a.pp < b.pp) ? -1 : 0)); });
|
arr.sort(function (a, b) {
|
||||||
|
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
|
||||||
|
? 1
|
||||||
|
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
|
||||||
|
? -1
|
||||||
|
: a.pp < b.pp
|
||||||
|
? -1
|
||||||
|
: 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
for (let x = 0; x < arr.length; x++) {
|
for (let x = 0; x < arr.length; x++) {
|
||||||
Game.Objects[arr[x].name].l.style.gridRow = `${x + 2}/${x + 2}`;
|
Game.Objects[arr[x].name].l.style.gridRow = `${x + 2}/${x + 2}`;
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
import {
|
import {
|
||||||
ColorBackPre, ColorBlue, ColorGray, ColorGreen, ColorOrange, ColorPurple, ColorRed, ColorTextPre, ColorYellow,
|
ColorBackPre,
|
||||||
|
ColorBlue,
|
||||||
|
ColorGray,
|
||||||
|
ColorGreen,
|
||||||
|
ColorOrange,
|
||||||
|
ColorPurple,
|
||||||
|
ColorRed,
|
||||||
|
ColorTextPre,
|
||||||
|
ColorYellow,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,8 +40,18 @@ function CreateUpgradeBarLegend() {
|
|||||||
|
|
||||||
legend.appendChild(legendLine(ColorBlue, 'Better than best PP building'));
|
legend.appendChild(legendLine(ColorBlue, 'Better than best PP building'));
|
||||||
legend.appendChild(legendLine(ColorGreen, 'Same as best PP building'));
|
legend.appendChild(legendLine(ColorGreen, 'Same as best PP building'));
|
||||||
legend.appendChild(legendLine(ColorYellow, 'Between best and worst PP buildings closer to best'));
|
legend.appendChild(
|
||||||
legend.appendChild(legendLine(ColorOrange, 'Between best and worst PP buildings closer to worst'));
|
legendLine(
|
||||||
|
ColorYellow,
|
||||||
|
'Between best and worst PP buildings closer to best',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
legend.appendChild(
|
||||||
|
legendLine(
|
||||||
|
ColorOrange,
|
||||||
|
'Between best and worst PP buildings closer to worst',
|
||||||
|
),
|
||||||
|
);
|
||||||
legend.appendChild(legendLine(ColorRed, 'Same as worst PP building'));
|
legend.appendChild(legendLine(ColorRed, 'Same as worst PP building'));
|
||||||
legend.appendChild(legendLine(ColorPurple, 'Worse than worst PP building'));
|
legend.appendChild(legendLine(ColorPurple, 'Worse than worst PP building'));
|
||||||
legend.appendChild(legendLine(ColorGray, 'Negative or infinity PP'));
|
legend.appendChild(legendLine(ColorGray, 'Negative or infinity PP'));
|
||||||
@@ -52,11 +70,15 @@ export default function CreateUpgradeBar() {
|
|||||||
UpgradeBar.style.fontWeight = 'bold';
|
UpgradeBar.style.fontWeight = 'bold';
|
||||||
UpgradeBar.style.display = 'none';
|
UpgradeBar.style.display = 'none';
|
||||||
UpgradeBar.style.zIndex = '21';
|
UpgradeBar.style.zIndex = '21';
|
||||||
UpgradeBar.onmouseout = function () { Game.tooltip.hide(); };
|
UpgradeBar.onmouseout = function () {
|
||||||
|
Game.tooltip.hide();
|
||||||
|
};
|
||||||
|
|
||||||
const placeholder = document.createElement('div');
|
const placeholder = document.createElement('div');
|
||||||
placeholder.appendChild(CreateUpgradeBarLegend());
|
placeholder.appendChild(CreateUpgradeBarLegend());
|
||||||
UpgradeBar.onmouseover = function () { Game.tooltip.draw(this, escape(placeholder.innerHTML), 'store'); };
|
UpgradeBar.onmouseover = function () {
|
||||||
|
Game.tooltip.draw(this, escape(placeholder.innerHTML), 'store');
|
||||||
|
};
|
||||||
|
|
||||||
const upgradeNumber = function (id, color) {
|
const upgradeNumber = function (id, color) {
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
@@ -75,5 +97,8 @@ export default function CreateUpgradeBar() {
|
|||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarPurple', ColorPurple));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarPurple', ColorPurple));
|
||||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarGray', ColorGray));
|
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarGray', ColorGray));
|
||||||
|
|
||||||
l('upgrades').parentNode.insertBefore(UpgradeBar, l('upgrades').parentNode.childNodes[3]);
|
l('upgrades').parentNode.insertBefore(
|
||||||
|
UpgradeBar,
|
||||||
|
l('upgrades').parentNode.childNodes[3],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
|
/* eslint-disable no-nested-ternary */
|
||||||
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
ColorBackPre, ColorBlue, ColorGray, ColorGreen, ColorOrange, ColorPurple, ColorRed, Colors, ColorYellow,
|
ColorBackPre,
|
||||||
|
ColorBlue,
|
||||||
|
ColorGray,
|
||||||
|
ColorGreen,
|
||||||
|
ColorOrange,
|
||||||
|
ColorPurple,
|
||||||
|
ColorRed,
|
||||||
|
Colors,
|
||||||
|
ColorYellow,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,12 +30,15 @@ export default function UpdateUpgrades() {
|
|||||||
let purple = 0;
|
let purple = 0;
|
||||||
let gray = 0;
|
let gray = 0;
|
||||||
|
|
||||||
for (const i of Object.keys(Game.UpgradesInStore)) {
|
Object.keys(Game.UpgradesInStore).forEach((i) => {
|
||||||
const me = Game.UpgradesInStore[i];
|
const me = Game.UpgradesInStore[i];
|
||||||
let addedColor = false;
|
let addedColor = false;
|
||||||
for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j++) {
|
for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j += 1) {
|
||||||
if (l(`upgrade${i}`).childNodes[j].className.indexOf(ColorBackPre) !== -1) {
|
if (
|
||||||
l(`upgrade${i}`).childNodes[j].className = ColorBackPre + CacheUpgrades[me.name].color;
|
l(`upgrade${i}`).childNodes[j].className.indexOf(ColorBackPre) !== -1
|
||||||
|
) {
|
||||||
|
l(`upgrade${i}`).childNodes[j].className =
|
||||||
|
ColorBackPre + CacheUpgrades[me.name].color;
|
||||||
addedColor = true;
|
addedColor = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -38,14 +50,14 @@ export default function UpdateUpgrades() {
|
|||||||
div.className = ColorBackPre + CacheUpgrades[me.name].color;
|
div.className = ColorBackPre + CacheUpgrades[me.name].color;
|
||||||
l(`upgrade${i}`).appendChild(div);
|
l(`upgrade${i}`).appendChild(div);
|
||||||
}
|
}
|
||||||
if (CacheUpgrades[me.name].color === ColorBlue) blue++;
|
if (CacheUpgrades[me.name].color === ColorBlue) blue += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorGreen) green++;
|
else if (CacheUpgrades[me.name].color === ColorGreen) green += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorYellow) yellow++;
|
else if (CacheUpgrades[me.name].color === ColorYellow) yellow += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorOrange) orange++;
|
else if (CacheUpgrades[me.name].color === ColorOrange) orange += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorRed) red++;
|
else if (CacheUpgrades[me.name].color === ColorRed) red += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorPurple) purple++;
|
else if (CacheUpgrades[me.name].color === ColorPurple) purple += 1;
|
||||||
else if (CacheUpgrades[me.name].color === ColorGray) gray++;
|
else if (CacheUpgrades[me.name].color === ColorGray) gray += 1;
|
||||||
}
|
});
|
||||||
|
|
||||||
l('CMUpgradeBarBlue').textContent = blue;
|
l('CMUpgradeBarBlue').textContent = blue;
|
||||||
l('CMUpgradeBarGreen').textContent = green;
|
l('CMUpgradeBarGreen').textContent = green;
|
||||||
@@ -59,7 +71,7 @@ export default function UpdateUpgrades() {
|
|||||||
const arr = [];
|
const arr = [];
|
||||||
// Build array of pointers, sort by pp, set flex positions
|
// Build array of pointers, sort by pp, set flex positions
|
||||||
// This regulates sorting of upgrades
|
// This regulates sorting of upgrades
|
||||||
for (let x = 0; x < Game.UpgradesInStore.length; x++) {
|
for (let x = 0; x < Game.UpgradesInStore.length; x += 1) {
|
||||||
const o = {};
|
const o = {};
|
||||||
o.name = Game.UpgradesInStore[x].name;
|
o.name = Game.UpgradesInStore[x].name;
|
||||||
o.price = Game.UpgradesInStore[x].basePrice;
|
o.price = Game.UpgradesInStore[x].basePrice;
|
||||||
@@ -68,7 +80,15 @@ export default function UpdateUpgrades() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CMOptions.SortUpgrades) {
|
if (CMOptions.SortUpgrades) {
|
||||||
arr.sort(function (a, b) { return (Colors.indexOf(a.color) > Colors.indexOf(b.color) ? 1 : (Colors.indexOf(a.color) < Colors.indexOf(b.color) ? -1 : (a.pp < b.pp) ? -1 : 0)); });
|
arr.sort(function (a, b) {
|
||||||
|
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
|
||||||
|
? 1
|
||||||
|
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
|
||||||
|
? -1
|
||||||
|
: a.pp < b.pp
|
||||||
|
? -1
|
||||||
|
: 0;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
arr.sort((a, b) => a.price - b.price);
|
arr.sort((a, b) => a.price - b.price);
|
||||||
}
|
}
|
||||||
@@ -76,7 +96,8 @@ export default function UpdateUpgrades() {
|
|||||||
const nameChecker = function (arr2, upgrade) {
|
const nameChecker = function (arr2, upgrade) {
|
||||||
return arr2.findIndex((e) => e.name === upgrade.name);
|
return arr2.findIndex((e) => e.name === upgrade.name);
|
||||||
};
|
};
|
||||||
for (let x = 0; x < Game.UpgradesInStore.length; x++) {
|
for (let x = 0; x < Game.UpgradesInStore.length; x += 1) {
|
||||||
l(`upgrade${x}`).style.order = nameChecker(arr, Game.UpgradesInStore[x]) + 1;
|
l(`upgrade${x}`).style.order =
|
||||||
|
nameChecker(arr, Game.UpgradesInStore[x]) + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import CacheDragonCost from '../../Cache/Dragon/Dragon';
|
|||||||
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData';
|
import { CacheCostDragonUpgrade } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange';
|
import CalculateChangeAura from '../../Sim/SimulationEvents/AuraChange';
|
||||||
import { Beautify, FormatTime } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import {
|
||||||
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
|
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
|
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
|
||||||
@@ -13,16 +16,21 @@ import { Beautify, FormatTime } from '../BeautifyAndFormatting/BeautifyFormattin
|
|||||||
export function AddAuraInfo(aura) {
|
export function AddAuraInfo(aura) {
|
||||||
if (CMOptions.DragonAuraInfo === 1) {
|
if (CMOptions.DragonAuraInfo === 1) {
|
||||||
const [bonusCPS, priceOfChange] = CalculateChangeAura(aura);
|
const [bonusCPS, priceOfChange] = CalculateChangeAura(aura);
|
||||||
const timeToRecover = FormatTime(priceOfChange / (bonusCPS + Game.cookiesPs));
|
const timeToRecover = FormatTime(
|
||||||
|
priceOfChange / (bonusCPS + Game.cookiesPs),
|
||||||
|
);
|
||||||
const bonusCPSPercentage = Beautify(bonusCPS / Game.cookiesPs);
|
const bonusCPSPercentage = Beautify(bonusCPS / Game.cookiesPs);
|
||||||
|
|
||||||
l('dragonAuraInfo').style.minHeight = '60px';
|
l('dragonAuraInfo').style.minHeight = '60px';
|
||||||
l('dragonAuraInfo').style.margin = '8px';
|
l('dragonAuraInfo').style.margin = '8px';
|
||||||
l('dragonAuraInfo').appendChild(document.createElement('div')).className = 'line';
|
l('dragonAuraInfo').appendChild(document.createElement('div')).className =
|
||||||
|
'line';
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.style.minWidth = '200px';
|
div.style.minWidth = '200px';
|
||||||
div.style.textAlign = 'center';
|
div.style.textAlign = 'center';
|
||||||
div.textContent = `Picking this aura will change CPS by ${Beautify(bonusCPS)} (${bonusCPSPercentage}% of current CPS).`;
|
div.textContent = `Picking this aura will change CPS by ${Beautify(
|
||||||
|
bonusCPS,
|
||||||
|
)} (${bonusCPSPercentage}% of current CPS).`;
|
||||||
l('dragonAuraInfo').appendChild(div);
|
l('dragonAuraInfo').appendChild(div);
|
||||||
const div2 = document.createElement('div');
|
const div2 = document.createElement('div');
|
||||||
div2.style.minWidth = '200px';
|
div2.style.minWidth = '200px';
|
||||||
@@ -38,16 +46,25 @@ export function AddAuraInfo(aura) {
|
|||||||
*/
|
*/
|
||||||
export function AddDragonLevelUpTooltip() {
|
export function AddDragonLevelUpTooltip() {
|
||||||
// Check if it is the dragon popup that is on screen
|
// Check if it is the dragon popup that is on screen
|
||||||
if ((l('specialPopup').className.match(/onScreen/) && l('specialPopup').children[0].style.background.match(/dragon/)) !== null) {
|
if (
|
||||||
|
(l('specialPopup').className.match(/onScreen/) &&
|
||||||
|
l('specialPopup').children[0].style.background.match(/dragon/)) !== null
|
||||||
|
) {
|
||||||
for (let i = 0; i < l('specialPopup').childNodes.length; i++) {
|
for (let i = 0; i < l('specialPopup').childNodes.length; i++) {
|
||||||
if (l('specialPopup').childNodes[i].className === 'optionBox') {
|
if (l('specialPopup').childNodes[i].className === 'optionBox') {
|
||||||
l('specialPopup').children[i].onmouseover = function () {
|
l('specialPopup').children[i].onmouseover = function () {
|
||||||
CacheDragonCost();
|
CacheDragonCost();
|
||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(l('specialPopup'), `<div style="min-width:200px;text-align:center;">${CacheCostDragonUpgrade}</div>`, 'this');
|
Game.tooltip.draw(
|
||||||
|
l('specialPopup'),
|
||||||
|
`<div style="min-width:200px;text-align:center;">${CacheCostDragonUpgrade}</div>`,
|
||||||
|
'this',
|
||||||
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
};
|
};
|
||||||
l('specialPopup').children[i].onmouseout = function () { Game.tooltip.shouldHide = 1; };
|
l('specialPopup').children[i].onmouseout = function () {
|
||||||
|
Game.tooltip.shouldHide = 1;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,11 @@ import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
|
|||||||
import { UpdateBotBar } from './InfoBars/BottomBar';
|
import { UpdateBotBar } from './InfoBars/BottomBar';
|
||||||
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
||||||
import RefreshMenu from './MenuSections/Refreshmenu';
|
import RefreshMenu from './MenuSections/Refreshmenu';
|
||||||
import { UpdateTooltips } from './Tooltips/Tooltip';
|
import UpdateTooltips from './Tooltips/UpdateTooltips';
|
||||||
import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips';
|
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.
|
||||||
@@ -15,12 +18,17 @@ import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/Wrinkler
|
|||||||
export default function Draw() {
|
export default function Draw() {
|
||||||
// Draw autosave timer in stats menu, this must be done here to make it count down correctly
|
// Draw autosave timer in stats menu, this must be done here to make it count down correctly
|
||||||
if (
|
if (
|
||||||
(Game.prefs.autosave && Game.drawT % 10 === 0) // with autosave ON and every 10 ticks
|
Game.prefs.autosave &&
|
||||||
&& (Game.onMenu === 'stats' && CMOptions.Stats) // while being on the stats menu only
|
Game.drawT % 10 === 0 && // with autosave ON and every 10 ticks
|
||||||
|
Game.onMenu === 'stats' &&
|
||||||
|
CMOptions.Stats // while being on the stats menu only
|
||||||
) {
|
) {
|
||||||
const timer = document.getElementById('CMStatsAutosaveTimer');
|
const timer = document.getElementById('CMStatsAutosaveTimer');
|
||||||
if (timer) {
|
if (timer) {
|
||||||
timer.innerText = Game.sayTime(Game.fps * 60 - (Game.T % (Game.fps * 60)), 4);
|
timer.innerText = Game.sayTime(
|
||||||
|
Game.fps * 60 - (Game.T % (Game.fps * 60)),
|
||||||
|
4,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,5 +53,10 @@ export default function Draw() {
|
|||||||
RefreshMenu();
|
RefreshMenu();
|
||||||
|
|
||||||
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
|
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
|
||||||
l('cookies').innerHTML = l('cookies').innerHTML.replace(/.*(?=<br>)/i, Beautify(Game.cookies));
|
let str = l('cookies').innerHTML.replace(
|
||||||
|
/.*(?=<br>)/i,
|
||||||
|
Beautify(Game.cookies),
|
||||||
|
);
|
||||||
|
if (Game.prefs.monospace) str = `<span class="monospace">${str}</span>`;
|
||||||
|
l('cookies').innerHTML = str;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-param-reassign */
|
||||||
/** Section: Functions related to the Golden Cookie Timers */
|
/** Section: Functions related to the Golden Cookie Timers */
|
||||||
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
@@ -23,9 +24,19 @@ export default function CreateGCTimer(cookie) {
|
|||||||
if (CMOptions.GCTimer === 0) GCTimer.style.display = 'none';
|
if (CMOptions.GCTimer === 0) GCTimer.style.display = 'none';
|
||||||
GCTimer.style.left = cookie.l.style.left;
|
GCTimer.style.left = cookie.l.style.left;
|
||||||
GCTimer.style.top = cookie.l.style.top;
|
GCTimer.style.top = cookie.l.style.top;
|
||||||
GCTimer.onclick = function () { cookie.pop(); };
|
GCTimer.onclick = function () {
|
||||||
GCTimer.onmouseover = function () { cookie.l.style.filter = 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'; cookie.l.style.webkitFilter = 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'; };
|
cookie.pop();
|
||||||
GCTimer.onmouseout = function () { cookie.l.style.filter = ''; cookie.l.style.webkitFilter = ''; };
|
};
|
||||||
|
GCTimer.onmouseover = function () {
|
||||||
|
cookie.l.style.filter =
|
||||||
|
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
||||||
|
cookie.l.style.webkitFilter =
|
||||||
|
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
||||||
|
};
|
||||||
|
GCTimer.onmouseout = function () {
|
||||||
|
cookie.l.style.filter = '';
|
||||||
|
cookie.l.style.webkitFilter = '';
|
||||||
|
};
|
||||||
|
|
||||||
GCTimers[cookie.id] = GCTimer;
|
GCTimers[cookie.id] = GCTimer;
|
||||||
l('shimmers').appendChild(GCTimer);
|
l('shimmers').appendChild(GCTimer);
|
||||||
|
|||||||
@@ -5,11 +5,16 @@
|
|||||||
* @param {number} targetMagic The target magic level
|
* @param {number} targetMagic The target magic level
|
||||||
* @returns {number} count / Game.fps The time it takes to reach targetMagic
|
* @returns {number} count / Game.fps The time it takes to reach targetMagic
|
||||||
*/
|
*/
|
||||||
export default function CalculateGrimoireRefillTime(currentMagic, maxMagic, targetMagic) {
|
export default function CalculateGrimoireRefillTime(
|
||||||
|
currentMagic,
|
||||||
|
maxMagic,
|
||||||
|
targetMagic,
|
||||||
|
) {
|
||||||
|
let magic = currentMagic;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
while (currentMagic < targetMagic) {
|
while (magic < targetMagic) {
|
||||||
currentMagic += Math.max(0.002, (currentMagic / Math.max(maxMagic, 100)) ** 0.5) * 0.002;
|
magic += Math.max(0.002, (magic / Math.max(maxMagic, 100)) ** 0.5) * 0.002;
|
||||||
count++;
|
count += 1;
|
||||||
}
|
}
|
||||||
return count / Game.fps;
|
return count / Game.fps;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
CacheAvgCps, CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult, CacheWrinklersFattest,
|
CacheAverageCPS,
|
||||||
|
CacheCurrWrinklerCount,
|
||||||
|
CacheCurrWrinklerCPSMult,
|
||||||
|
CacheWrinklersFattest,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
|
||||||
@@ -9,13 +12,30 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
|||||||
*/
|
*/
|
||||||
export default function GetCPS() {
|
export default function GetCPS() {
|
||||||
if (CMOptions.CPSMode) {
|
if (CMOptions.CPSMode) {
|
||||||
return CacheAvgCps;
|
return CacheAverageCPS;
|
||||||
} if (CMOptions.CalcWrink === 0) {
|
|
||||||
return (Game.cookiesPs * (1 - Game.cpsSucked));
|
|
||||||
} if (CMOptions.CalcWrink === 1) {
|
|
||||||
return Game.cookiesPs * (CacheCurrWrinklerCPSMult + (1 - (CacheCurrWrinklerCount * 0.05)));
|
|
||||||
} if (CMOptions.CalcWrink === 2 && Game.wrinklers[CacheWrinklersFattest[1]].type === 1) {
|
|
||||||
return Game.cookiesPs * ((CacheCurrWrinklerCPSMult * 3 / CacheCurrWrinklerCount) + (1 - (CacheCurrWrinklerCount * 0.05)));
|
|
||||||
}
|
}
|
||||||
return Game.cookiesPs * ((CacheCurrWrinklerCPSMult / CacheCurrWrinklerCount) + (1 - (CacheCurrWrinklerCount * 0.05)));
|
if (CMOptions.CalcWrink === 0) {
|
||||||
|
return Game.cookiesPs * (1 - Game.cpsSucked);
|
||||||
|
}
|
||||||
|
if (CMOptions.CalcWrink === 1) {
|
||||||
|
return (
|
||||||
|
Game.cookiesPs *
|
||||||
|
(CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
CMOptions.CalcWrink === 2 &&
|
||||||
|
Game.wrinklers[CacheWrinklersFattest[1]].type === 1
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
Game.cookiesPs *
|
||||||
|
((CacheCurrWrinklerCPSMult * 3) / CacheCurrWrinklerCount +
|
||||||
|
(1 - CacheCurrWrinklerCount * 0.05))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
Game.cookiesPs *
|
||||||
|
(CacheCurrWrinklerCPSMult / CacheCurrWrinklerCount +
|
||||||
|
(1 - CacheCurrWrinklerCount * 0.05))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import {
|
import {
|
||||||
ColorGray, ColorGreen, ColorOrange, ColorPurple, ColorRed, ColorYellow,
|
ColorGray,
|
||||||
|
ColorGreen,
|
||||||
|
ColorOrange,
|
||||||
|
ColorPurple,
|
||||||
|
ColorRed,
|
||||||
|
ColorYellow,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11,13 +16,17 @@ import {
|
|||||||
export default function GetLumpColor(type) {
|
export default function GetLumpColor(type) {
|
||||||
if (type === 0) {
|
if (type === 0) {
|
||||||
return { text: 'Normal', color: ColorGray };
|
return { text: 'Normal', color: ColorGray };
|
||||||
} if (type === 1) {
|
}
|
||||||
|
if (type === 1) {
|
||||||
return { text: 'Bifurcated', color: ColorGreen };
|
return { text: 'Bifurcated', color: ColorGreen };
|
||||||
} if (type === 2) {
|
}
|
||||||
|
if (type === 2) {
|
||||||
return { text: 'Golden', color: ColorYellow };
|
return { text: 'Golden', color: ColorYellow };
|
||||||
} if (type === 3) {
|
}
|
||||||
|
if (type === 3) {
|
||||||
return { text: 'Meaty', color: ColorOrange };
|
return { text: 'Meaty', color: ColorOrange };
|
||||||
} if (type === 4) {
|
}
|
||||||
|
if (type === 4) {
|
||||||
return { text: 'Caramelized', color: ColorPurple };
|
return { text: 'Caramelized', color: ColorPurple };
|
||||||
}
|
}
|
||||||
return { text: 'Unknown Sugar Lump', color: ColorRed };
|
return { text: 'Unknown Sugar Lump', color: ColorRed };
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData';
|
import {
|
||||||
|
CacheWrinklersFattest,
|
||||||
|
CacheWrinklersTotal,
|
||||||
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9,7 +12,8 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
|||||||
export default function GetWrinkConfigBank() {
|
export default function GetWrinkConfigBank() {
|
||||||
if (CMOptions.CalcWrink === 1) {
|
if (CMOptions.CalcWrink === 1) {
|
||||||
return CacheWrinklersTotal;
|
return CacheWrinklersTotal;
|
||||||
} if (CMOptions.CalcWrink === 2) {
|
}
|
||||||
|
if (CMOptions.CalcWrink === 2) {
|
||||||
return CacheWrinklersFattest[0];
|
return CacheWrinklersFattest[0];
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
* It is called by a click of the 'pop all' button created by CM.Disp.AddMenuStats()
|
* It is called by a click of the 'pop all' button created by CM.Disp.AddMenuStats()
|
||||||
*/
|
*/
|
||||||
export default function PopAllNormalWrinklers() {
|
export default function PopAllNormalWrinklers() {
|
||||||
for (const i of Object.keys(Game.wrinklers)) {
|
Object.keys(Game.wrinklers).forEach((i) => {
|
||||||
if (Game.wrinklers[i].sucked > 0 && Game.wrinklers[i].type === 0) {
|
if (Game.wrinklers[i].sucked > 0 && Game.wrinklers[i].type === 0) {
|
||||||
Game.wrinklers[i].hp = 0;
|
Game.wrinklers[i].hp = 0;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,10 @@
|
|||||||
*/
|
*/
|
||||||
export default function UpdateBackground() {
|
export default function UpdateBackground() {
|
||||||
Game.Background.canvas.width = Game.Background.canvas.parentNode.offsetWidth;
|
Game.Background.canvas.width = Game.Background.canvas.parentNode.offsetWidth;
|
||||||
Game.Background.canvas.height = Game.Background.canvas.parentNode.offsetHeight;
|
Game.Background.canvas.height =
|
||||||
Game.LeftBackground.canvas.width = Game.LeftBackground.canvas.parentNode.offsetWidth;
|
Game.Background.canvas.parentNode.offsetHeight;
|
||||||
Game.LeftBackground.canvas.height = Game.LeftBackground.canvas.parentNode.offsetHeight;
|
Game.LeftBackground.canvas.width =
|
||||||
|
Game.LeftBackground.canvas.parentNode.offsetWidth;
|
||||||
|
Game.LeftBackground.canvas.height =
|
||||||
|
Game.LeftBackground.canvas.parentNode.offsetHeight;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import UpdateBuildings from '../BuildingsUpgrades/Buildings';
|
import UpdateBuildings from '../BuildingsUpgrades/Buildings';
|
||||||
import {
|
import {
|
||||||
ColorBackPre, ColorBorderPre, Colors, ColorTextPre,
|
ColorBackPre,
|
||||||
|
ColorBorderPre,
|
||||||
|
Colors,
|
||||||
|
ColorTextPre,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11,13 +14,19 @@ import {
|
|||||||
export default function UpdateColors() {
|
export default function UpdateColors() {
|
||||||
let str = '';
|
let str = '';
|
||||||
for (let i = 0; i < Colors.length; i++) {
|
for (let i = 0; i < Colors.length; i++) {
|
||||||
str += `.${ColorTextPre}${Colors[i]} { color: ${CMOptions.Colors[Colors[i]]}; }\n`;
|
str += `.${ColorTextPre}${Colors[i]} { color: ${
|
||||||
|
CMOptions.Colors[Colors[i]]
|
||||||
|
}; }\n`;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < Colors.length; i++) {
|
for (let i = 0; i < Colors.length; i++) {
|
||||||
str += `.${ColorBackPre}${Colors[i]} { background-color: ${CMOptions.Colors[Colors[i]]}; }\n`;
|
str += `.${ColorBackPre}${Colors[i]} { background-color: ${
|
||||||
|
CMOptions.Colors[Colors[i]]
|
||||||
|
}; }\n`;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < Colors.length; i++) {
|
for (let i = 0; i < Colors.length; i++) {
|
||||||
str += `.${ColorBorderPre}${Colors[i]} { border: 1px solid ${CMOptions.Colors[Colors[i]]}; }\n`;
|
str += `.${ColorBorderPre}${Colors[i]} { border: 1px solid ${
|
||||||
|
CMOptions.Colors[Colors[i]]
|
||||||
|
}; }\n`;
|
||||||
}
|
}
|
||||||
l('CMCSS').textContent = str;
|
l('CMCSS').textContent = str;
|
||||||
UpdateBuildings(); // Class has been already set
|
UpdateBuildings(); // Class has been already set
|
||||||
|
|||||||
@@ -1,13 +1,24 @@
|
|||||||
/** 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';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
import { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
||||||
import { Beautify, GetTimeColor } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import {
|
||||||
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
|
GetTimeColor,
|
||||||
|
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import GetCPS from '../HelperFunctions/GetCPS';
|
import GetCPS from '../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
||||||
import {
|
import {
|
||||||
ColorBlue, ColorTextPre, ColorYellow, LastTargetBotBar,
|
ColorBlue,
|
||||||
|
ColorTextPre,
|
||||||
|
ColorYellow,
|
||||||
|
LastTargetBotBar,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
|
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
|
||||||
|
|
||||||
@@ -25,7 +36,8 @@ export function CreateBotBar() {
|
|||||||
BotBar.style.backgroundImage = 'linear-gradient(to bottom, #4d4548, #000000)';
|
BotBar.style.backgroundImage = 'linear-gradient(to bottom, #4d4548, #000000)';
|
||||||
BotBar.style.borderTop = '1px solid black';
|
BotBar.style.borderTop = '1px solid black';
|
||||||
BotBar.style.overflow = 'auto';
|
BotBar.style.overflow = 'auto';
|
||||||
BotBar.style.textShadow = '-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black';
|
BotBar.style.textShadow =
|
||||||
|
'-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black';
|
||||||
|
|
||||||
const table = BotBar.appendChild(document.createElement('table'));
|
const table = BotBar.appendChild(document.createElement('table'));
|
||||||
table.style.width = '100%';
|
table.style.width = '100%';
|
||||||
@@ -52,9 +64,9 @@ export function CreateBotBar() {
|
|||||||
|
|
||||||
l('wrapper').appendChild(BotBar);
|
l('wrapper').appendChild(BotBar);
|
||||||
|
|
||||||
for (const i of Object.keys(Game.Objects)) {
|
Object.keys(Game.Objects).forEach((i) => {
|
||||||
CreateBotBarBuildingColumn(i);
|
CreateBotBarBuildingColumn(i);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,7 +75,7 @@ export function CreateBotBar() {
|
|||||||
export function UpdateBotBar() {
|
export function UpdateBotBar() {
|
||||||
if (CMOptions.BotBar === 1 && CacheObjects1 && Game.buyMode === 1) {
|
if (CMOptions.BotBar === 1 && CacheObjects1 && Game.buyMode === 1) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for (const i of Object.keys(CacheObjects1)) {
|
Object.keys(CacheObjects1).forEach((i) => {
|
||||||
let target = Game.buyBulk;
|
let target = Game.buyBulk;
|
||||||
if (Game.buyMode === 1) {
|
if (Game.buyMode === 1) {
|
||||||
LastTargetBotBar = target;
|
LastTargetBotBar = target;
|
||||||
@@ -73,16 +85,41 @@ export function UpdateBotBar() {
|
|||||||
if (target === 1) target = CacheObjects1;
|
if (target === 1) target = CacheObjects1;
|
||||||
if (target === 10) target = CacheObjects10;
|
if (target === 10) target = CacheObjects10;
|
||||||
if (target === 100) target = CacheObjects100;
|
if (target === 100) target = CacheObjects100;
|
||||||
count++;
|
count += 1;
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[count].childNodes[1].textContent = Game.Objects[i].amount;
|
l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[count].textContent = Beautify(target[i].bonus, 2);
|
count
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].className = ColorTextPre + target[i].color;
|
].childNodes[1].textContent = Game.Objects[i].amount;
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].textContent = Beautify(target[i].pp, 2);
|
l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[
|
||||||
const timeColor = GetTimeColor((Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS());
|
count
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].className = ColorTextPre + timeColor.color;
|
].textContent = Beautify(target[i].bonus, 2);
|
||||||
if (timeColor.text === 'Done!' && Game.cookies < Game.Objects[i].bulkPrice) {
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent = `${timeColor.text} (with Wrink)`;
|
count
|
||||||
} else l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent = timeColor.text;
|
].className = ColorTextPre + target[i].color;
|
||||||
}
|
let PPString;
|
||||||
|
if (CMOptions.PPDisplayTime)
|
||||||
|
PPString = FormatTime(Math.round(target[i].pp));
|
||||||
|
else PPString = Beautify(Math.round(target[i].pp), 2);
|
||||||
|
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||||
|
count
|
||||||
|
].textContent = PPString;
|
||||||
|
const timeColor = GetTimeColor(
|
||||||
|
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
|
||||||
|
GetCPS(),
|
||||||
|
);
|
||||||
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||||
|
count
|
||||||
|
].className = ColorTextPre + timeColor.color;
|
||||||
|
if (
|
||||||
|
timeColor.text === 'Done!' &&
|
||||||
|
Game.cookies < Game.Objects[i].bulkPrice
|
||||||
|
) {
|
||||||
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||||
|
count
|
||||||
|
].textContent = `${timeColor.text} (with Wrink)`;
|
||||||
|
} else
|
||||||
|
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||||
|
count
|
||||||
|
].textContent = timeColor.text;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,14 +76,22 @@ export function CreateBotBarBuildingColumn(buildingName) {
|
|||||||
|
|
||||||
const i = buildingName;
|
const i = buildingName;
|
||||||
const header = type.appendChild(document.createElement('td'));
|
const header = type.appendChild(document.createElement('td'));
|
||||||
header.appendChild(document.createTextNode(`${i.indexOf(' ') !== -1 ? i.substring(0, i.indexOf(' ')) : i} (`));
|
header.appendChild(
|
||||||
|
document.createTextNode(
|
||||||
|
`${i.indexOf(' ') !== -1 ? i.substring(0, i.indexOf(' ')) : i} (`,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const span = header.appendChild(document.createElement('span'));
|
const span = header.appendChild(document.createElement('span'));
|
||||||
span.className = ColorTextPre + ColorBlue;
|
span.className = ColorTextPre + ColorBlue;
|
||||||
|
|
||||||
header.appendChild(document.createTextNode(')'));
|
header.appendChild(document.createTextNode(')'));
|
||||||
|
type.lastChild.style.paddingLeft = '8px';
|
||||||
bonus.appendChild(document.createElement('td'));
|
bonus.appendChild(document.createElement('td'));
|
||||||
|
bonus.lastChild.style.paddingLeft = '8px';
|
||||||
pp.appendChild(document.createElement('td'));
|
pp.appendChild(document.createElement('td'));
|
||||||
|
pp.lastChild.style.paddingLeft = '8px';
|
||||||
time.appendChild(document.createElement('td'));
|
time.appendChild(document.createElement('td'));
|
||||||
|
time.lastChild.style.paddingLeft = '2px';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles';
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
BuffColors,
|
BuffColors,
|
||||||
ColorBackPre, ColorGray, ColorOrange, ColorPurple, LastNumberOfTimers,
|
ColorBackPre,
|
||||||
|
ColorGray,
|
||||||
|
ColorOrange,
|
||||||
|
ColorPurple,
|
||||||
|
LastNumberOfTimers,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
import { CreateTimer } from './CreateDOMElements';
|
import { CreateTimer } from './CreateDOMElements';
|
||||||
|
|
||||||
@@ -22,16 +26,21 @@ export function CreateTimerBar() {
|
|||||||
TimerBar.style.backgroundColor = 'black';
|
TimerBar.style.backgroundColor = 'black';
|
||||||
|
|
||||||
// Create standard Golden Cookie bar
|
// Create standard Golden Cookie bar
|
||||||
const CMTimerBarGC = CreateTimer('CMTimerBarGC',
|
const CMTimerBarGC = CreateTimer('CMTimerBarGC', 'Next Cookie', [
|
||||||
'Next Cookie',
|
{ id: 'CMTimerBarGCMinBar', color: ColorGray },
|
||||||
[{ id: 'CMTimerBarGCMinBar', color: ColorGray }, { id: 'CMTimerBarGCBar', color: ColorPurple }]);
|
{ id: 'CMTimerBarGCBar', color: ColorPurple },
|
||||||
|
]);
|
||||||
TimerBar.appendChild(CMTimerBarGC);
|
TimerBar.appendChild(CMTimerBarGC);
|
||||||
|
|
||||||
// Create standard Reindeer bar
|
// Create standard Reindeer bar
|
||||||
const CMTimerBarRen = CreateTimer('CMTimerBarRen',
|
const CMTimerBarRen = CreateTimer('CMTimerBarRen', 'Next Reindeer', [
|
||||||
'Next Reindeer',
|
{ id: 'CMTimerBarRenMinBar', color: ColorGray },
|
||||||
[{ id: 'CMTimerBarRenMinBar', color: ColorGray }, { id: 'CMTimerBarRenBar', color: ColorOrange }]);
|
{ id: 'CMTimerBarRenBar', color: ColorOrange },
|
||||||
|
]);
|
||||||
TimerBar.appendChild(CMTimerBarRen);
|
TimerBar.appendChild(CMTimerBarRen);
|
||||||
|
const TimerBarBuffTimers = document.createElement('div');
|
||||||
|
TimerBarBuffTimers.id = 'CMTimerBarBuffTimers';
|
||||||
|
TimerBar.appendChild(TimerBarBuffTimers);
|
||||||
|
|
||||||
l('wrapper').appendChild(TimerBar);
|
l('wrapper').appendChild(TimerBar);
|
||||||
}
|
}
|
||||||
@@ -48,45 +57,114 @@ export function UpdateTimerBar() {
|
|||||||
let numberOfTimers = 0;
|
let numberOfTimers = 0;
|
||||||
|
|
||||||
// Regulates visibility of Golden Cookie timer
|
// Regulates visibility of Golden Cookie timer
|
||||||
if (Game.shimmerTypes.golden.spawned === 0 && !Game.Has('Golden switch [off]')) {
|
if (
|
||||||
|
Game.shimmerTypes.golden.spawned === 0 &&
|
||||||
|
!Game.Has('Golden switch [off]')
|
||||||
|
) {
|
||||||
l('CMTimerBarGC').style.display = '';
|
l('CMTimerBarGC').style.display = '';
|
||||||
l('CMTimerBarGCMinBar').style.width = `${Math.round(Math.max(0, Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) * maxWidthTwoBar / Game.shimmerTypes.golden.maxTime)}px`;
|
l('CMTimerBarGCMinBar').style.width = `${Math.round(
|
||||||
if (CMOptions.TimerBarOverlay >= 1) l('CMTimerBarGCMinBar').textContent = Math.ceil((Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) / Game.fps);
|
(Math.max(
|
||||||
|
0,
|
||||||
|
Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time,
|
||||||
|
) *
|
||||||
|
maxWidthTwoBar) /
|
||||||
|
Game.shimmerTypes.golden.maxTime,
|
||||||
|
)}px`;
|
||||||
|
if (CMOptions.TimerBarOverlay >= 1)
|
||||||
|
l('CMTimerBarGCMinBar').textContent = Math.ceil(
|
||||||
|
(Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) /
|
||||||
|
Game.fps,
|
||||||
|
);
|
||||||
else l('CMTimerBarGCMinBar').textContent = '';
|
else l('CMTimerBarGCMinBar').textContent = '';
|
||||||
if (Game.shimmerTypes.golden.minTime === Game.shimmerTypes.golden.maxTime) {
|
if (
|
||||||
|
Game.shimmerTypes.golden.minTime === Game.shimmerTypes.golden.maxTime
|
||||||
|
) {
|
||||||
l('CMTimerBarGCMinBar').style.borderTopRightRadius = '10px';
|
l('CMTimerBarGCMinBar').style.borderTopRightRadius = '10px';
|
||||||
l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '10px';
|
l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '10px';
|
||||||
} else {
|
} else {
|
||||||
l('CMTimerBarGCMinBar').style.borderTopRightRadius = '';
|
l('CMTimerBarGCMinBar').style.borderTopRightRadius = '';
|
||||||
l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '';
|
l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '';
|
||||||
}
|
}
|
||||||
l('CMTimerBarGCBar').style.width = `${Math.round(Math.min(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime, Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) * maxWidthTwoBar / Game.shimmerTypes.golden.maxTime)}px`;
|
l('CMTimerBarGCBar').style.width = `${Math.round(
|
||||||
if (CMOptions.TimerBarOverlay >= 1) l('CMTimerBarGCBar').textContent = Math.ceil(Math.min(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime, Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps);
|
(Math.min(
|
||||||
|
Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime,
|
||||||
|
Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time,
|
||||||
|
) *
|
||||||
|
maxWidthTwoBar) /
|
||||||
|
Game.shimmerTypes.golden.maxTime,
|
||||||
|
)}px`;
|
||||||
|
if (CMOptions.TimerBarOverlay >= 1)
|
||||||
|
l('CMTimerBarGCBar').textContent = Math.ceil(
|
||||||
|
Math.min(
|
||||||
|
Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime,
|
||||||
|
Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time,
|
||||||
|
) / Game.fps,
|
||||||
|
);
|
||||||
else l('CMTimerBarGCBar').textContent = '';
|
else l('CMTimerBarGCBar').textContent = '';
|
||||||
l('CMTimerBarGCTime').textContent = Math.ceil((Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps);
|
l('CMTimerBarGCTime').textContent = Math.ceil(
|
||||||
numberOfTimers++;
|
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) /
|
||||||
|
Game.fps,
|
||||||
|
);
|
||||||
|
numberOfTimers += 1;
|
||||||
} else l('CMTimerBarGC').style.display = 'none';
|
} else l('CMTimerBarGC').style.display = 'none';
|
||||||
|
|
||||||
// Regulates visibility of Reindeer timer
|
// Regulates visibility of Reindeer timer
|
||||||
if (Game.season === 'christmas' && Game.shimmerTypes.reindeer.spawned === 0) {
|
if (
|
||||||
|
Game.season === 'christmas' &&
|
||||||
|
Game.shimmerTypes.reindeer.spawned === 0
|
||||||
|
) {
|
||||||
l('CMTimerBarRen').style.display = '';
|
l('CMTimerBarRen').style.display = '';
|
||||||
l('CMTimerBarRenMinBar').style.width = `${Math.round(Math.max(0, Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) * maxWidthTwoBar / Game.shimmerTypes.reindeer.maxTime)}px`;
|
l('CMTimerBarRenMinBar').style.width = `${Math.round(
|
||||||
if (CMOptions.TimerBarOverlay >= 1) l('CMTimerBarRenMinBar').textContent = Math.ceil((Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) / Game.fps);
|
(Math.max(
|
||||||
|
0,
|
||||||
|
Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time,
|
||||||
|
) *
|
||||||
|
maxWidthTwoBar) /
|
||||||
|
Game.shimmerTypes.reindeer.maxTime,
|
||||||
|
)}px`;
|
||||||
|
if (CMOptions.TimerBarOverlay >= 1)
|
||||||
|
l('CMTimerBarRenMinBar').textContent = Math.ceil(
|
||||||
|
(Game.shimmerTypes.reindeer.minTime -
|
||||||
|
Game.shimmerTypes.reindeer.time) /
|
||||||
|
Game.fps,
|
||||||
|
);
|
||||||
else l('CMTimerBarRenMinBar').textContent = '';
|
else l('CMTimerBarRenMinBar').textContent = '';
|
||||||
l('CMTimerBarRenBar').style.width = `${Math.round(Math.min(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime, Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) * maxWidthTwoBar / Game.shimmerTypes.reindeer.maxTime)}px`;
|
l('CMTimerBarRenBar').style.width = `${Math.round(
|
||||||
if (CMOptions.TimerBarOverlay >= 1) l('CMTimerBarRenBar').textContent = Math.ceil(Math.min(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime, Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps);
|
(Math.min(
|
||||||
|
Game.shimmerTypes.reindeer.maxTime -
|
||||||
|
Game.shimmerTypes.reindeer.minTime,
|
||||||
|
Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time,
|
||||||
|
) *
|
||||||
|
maxWidthTwoBar) /
|
||||||
|
Game.shimmerTypes.reindeer.maxTime,
|
||||||
|
)}px`;
|
||||||
|
if (CMOptions.TimerBarOverlay >= 1)
|
||||||
|
l('CMTimerBarRenBar').textContent = Math.ceil(
|
||||||
|
Math.min(
|
||||||
|
Game.shimmerTypes.reindeer.maxTime -
|
||||||
|
Game.shimmerTypes.reindeer.minTime,
|
||||||
|
Game.shimmerTypes.reindeer.maxTime -
|
||||||
|
Game.shimmerTypes.reindeer.time,
|
||||||
|
) / Game.fps,
|
||||||
|
);
|
||||||
else l('CMTimerBarRenBar').textContent = '';
|
else l('CMTimerBarRenBar').textContent = '';
|
||||||
l('CMTimerBarRenTime').textContent = Math.ceil((Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps);
|
l('CMTimerBarRenTime').textContent = Math.ceil(
|
||||||
numberOfTimers++;
|
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) /
|
||||||
|
Game.fps,
|
||||||
|
);
|
||||||
|
numberOfTimers += 1;
|
||||||
} else {
|
} else {
|
||||||
l('CMTimerBarRen').style.display = 'none';
|
l('CMTimerBarRen').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
// On every frame all buff-timers are deleted and re-created
|
// On every frame all buff-timers are deleted and re-created
|
||||||
const BuffTimerBars = {};
|
const BuffTimerBars = {};
|
||||||
for (const i of Object.keys(Game.buffs)) {
|
l('CMTimerBarBuffTimers').innerHTML = '';
|
||||||
|
Object.keys(Game.buffs).forEach((i) => {
|
||||||
if (Game.buffs[i]) {
|
if (Game.buffs[i]) {
|
||||||
const timer = CreateTimer(Game.buffs[i].name, Game.buffs[i].name, [{ id: `${Game.buffs[i].name}Bar` }]);
|
const timer = CreateTimer(Game.buffs[i].name, Game.buffs[i].name, [
|
||||||
|
{ id: `${Game.buffs[i].name}Bar` },
|
||||||
|
]);
|
||||||
timer.style.display = '';
|
timer.style.display = '';
|
||||||
let classColor = '';
|
let classColor = '';
|
||||||
// Gives specific timers specific colors
|
// Gives specific timers specific colors
|
||||||
@@ -95,17 +173,27 @@ export function UpdateTimerBar() {
|
|||||||
} else classColor = ColorPurple;
|
} else classColor = ColorPurple;
|
||||||
timer.lastChild.children[1].className = ColorBackPre + classColor;
|
timer.lastChild.children[1].className = ColorBackPre + classColor;
|
||||||
timer.lastChild.children[1].style.color = 'black';
|
timer.lastChild.children[1].style.color = 'black';
|
||||||
if (CMOptions.TimerBarOverlay === 2) timer.lastChild.children[1].textContent = `${Math.round(100 * (Game.buffs[i].time / Game.buffs[i].maxTime))}%`;
|
if (CMOptions.TimerBarOverlay === 2)
|
||||||
|
timer.lastChild.children[1].textContent = `${Math.round(
|
||||||
|
100 * (Game.buffs[i].time / Game.buffs[i].maxTime),
|
||||||
|
)}%`;
|
||||||
else timer.lastChild.children[1].textContent = '';
|
else timer.lastChild.children[1].textContent = '';
|
||||||
timer.lastChild.children[1].style.width = `${Math.round(Game.buffs[i].time * (maxWidthOneBar - Math.ceil(Game.buffs[i].time / Game.fps).toString().length * 8) / Game.buffs[i].maxTime)}px`;
|
timer.lastChild.children[1].style.width = `${Math.round(
|
||||||
timer.lastChild.children[2].textContent = Math.ceil(Game.buffs[i].time / Game.fps);
|
(Game.buffs[i].time *
|
||||||
numberOfTimers++;
|
(maxWidthOneBar -
|
||||||
|
Math.ceil(Game.buffs[i].time / Game.fps).toString().length * 8)) /
|
||||||
|
Game.buffs[i].maxTime,
|
||||||
|
)}px`;
|
||||||
|
timer.lastChild.children[2].textContent = Math.ceil(
|
||||||
|
Game.buffs[i].time / Game.fps,
|
||||||
|
);
|
||||||
|
numberOfTimers += 1;
|
||||||
BuffTimerBars[Game.buffs[i].name] = timer;
|
BuffTimerBars[Game.buffs[i].name] = timer;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
for (const i of Object.keys(BuffTimerBars)) {
|
Object.keys(BuffTimerBars).forEach((i) => {
|
||||||
l('CMTimerBar').appendChild(BuffTimerBars[i]);
|
l('CMTimerBarBuffTimers').appendChild(BuffTimerBars[i]);
|
||||||
}
|
});
|
||||||
|
|
||||||
if (numberOfTimers !== 0) {
|
if (numberOfTimers !== 0) {
|
||||||
l('CMTimerBar').style.height = `${numberOfTimers * 12 + 2}px`;
|
l('CMTimerBar').style.height = `${numberOfTimers * 12 + 2}px`;
|
||||||
|
|||||||
38
src/Disp/Initialization/CreateSectionHideButtons.js
Normal file
38
src/Disp/Initialization/CreateSectionHideButtons.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* This function creates two objects at the top of the right column that allowing hiding the upgrade and building section
|
||||||
|
*/
|
||||||
|
export default function CreateSectionHideButtons() {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.id = 'CMSectionHidButtons';
|
||||||
|
div.style.textAlign = 'center';
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.className = 'option';
|
||||||
|
a.onclick = function () {
|
||||||
|
if (l('upgrades').style.display === 'flex') {
|
||||||
|
l('upgrades').style.display = 'none';
|
||||||
|
l('toggleUpgrades').style.display = 'none';
|
||||||
|
l('techUpgrades').style.display = 'none';
|
||||||
|
l('vaultUpgrades').style.display = 'none';
|
||||||
|
} else {
|
||||||
|
l('upgrades').style.display = 'flex';
|
||||||
|
if (l('toggleUpgrades').children.length !== 0)
|
||||||
|
l('toggleUpgrades').style.display = 'block';
|
||||||
|
if (l('techUpgrades').children.length !== 0)
|
||||||
|
l('techUpgrades').style.display = 'block';
|
||||||
|
if (l('vaultUpgrades').children.length !== 0)
|
||||||
|
l('vaultUpgrades').style.display = 'block';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
a.textContent = 'Hide/Show Upgrades';
|
||||||
|
div.appendChild(a);
|
||||||
|
const b = document.createElement('a');
|
||||||
|
b.className = 'option';
|
||||||
|
b.onclick = function () {
|
||||||
|
if (l('products').style.display === 'grid')
|
||||||
|
l('products').style.display = 'none';
|
||||||
|
else l('products').style.display = 'grid';
|
||||||
|
};
|
||||||
|
b.textContent = 'Hide/Show Buildings';
|
||||||
|
div.appendChild(b);
|
||||||
|
l('store').insertBefore(div, l('store').childNodes[2]);
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData';
|
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData';
|
||||||
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
||||||
|
import { CreateTooltip } from '../Tooltips/Tooltip';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates two objects at the bottom of the left column that allowing popping of wrinklers
|
* This function creates two objects at the bottom of the left column that allowing popping of wrinklers
|
||||||
@@ -9,12 +10,45 @@ export default function CreateWrinklerButtons() {
|
|||||||
popAllA.id = 'PopAllNormalWrinklerButton';
|
popAllA.id = 'PopAllNormalWrinklerButton';
|
||||||
popAllA.textContent = 'Pop All Normal';
|
popAllA.textContent = 'Pop All Normal';
|
||||||
popAllA.className = 'option';
|
popAllA.className = 'option';
|
||||||
popAllA.onclick = function () { PopAllNormalWrinklers(); };
|
popAllA.onclick = function () {
|
||||||
|
PopAllNormalWrinklers();
|
||||||
|
};
|
||||||
|
popAllA.onmouseout = function () {
|
||||||
|
Game.tooltip.shouldHide = 1;
|
||||||
|
};
|
||||||
|
popAllA.onmouseover = function () {
|
||||||
|
Game.tooltip.dynamic = 1;
|
||||||
|
Game.tooltip.draw(
|
||||||
|
this,
|
||||||
|
function () {
|
||||||
|
return CreateTooltip('wb', 'PopAll');
|
||||||
|
},
|
||||||
|
'this',
|
||||||
|
);
|
||||||
|
Game.tooltip.wobble();
|
||||||
|
};
|
||||||
l('sectionLeftExtra').children[0].append(popAllA);
|
l('sectionLeftExtra').children[0].append(popAllA);
|
||||||
const popFattestA = document.createElement('a');
|
const popFattestA = document.createElement('a');
|
||||||
popFattestA.id = 'PopFattestWrinklerButton';
|
popFattestA.id = 'PopFattestWrinklerButton';
|
||||||
popFattestA.textContent = 'Pop Single Fattest';
|
popFattestA.textContent = 'Pop Single Fattest';
|
||||||
popFattestA.className = 'option';
|
popFattestA.className = 'option';
|
||||||
popFattestA.onclick = function () { if (CacheWrinklersFattest[1] !== null) Game.wrinklers[CacheWrinklersFattest[1]].hp = 0; };
|
popFattestA.onclick = function () {
|
||||||
|
if (CacheWrinklersFattest[1] !== null)
|
||||||
|
Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
||||||
|
};
|
||||||
|
popFattestA.onmouseout = function () {
|
||||||
|
Game.tooltip.shouldHide = 1;
|
||||||
|
};
|
||||||
|
popFattestA.onmouseover = function () {
|
||||||
|
Game.tooltip.dynamic = 1;
|
||||||
|
Game.tooltip.draw(
|
||||||
|
this,
|
||||||
|
function () {
|
||||||
|
return CreateTooltip('wb', 'PopFattest');
|
||||||
|
},
|
||||||
|
'this',
|
||||||
|
);
|
||||||
|
Game.tooltip.wobble();
|
||||||
|
};
|
||||||
l('sectionLeftExtra').children[0].append(popFattestA);
|
l('sectionLeftExtra').children[0].append(popFattestA);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ import * as GameData from '../../Data/Gamedata';
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CacheAverageClicks, CacheCentEgg, CacheLastChoEgg, CacheSeaSpec, CacheWrinklersFattest, CacheWrinklersNormal, CacheWrinklersTotal,
|
CacheAverageClicks,
|
||||||
|
CacheWrinklersFattest,
|
||||||
|
CacheWrinklersNormal,
|
||||||
|
CacheWrinklersTotal,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
||||||
import { ClickTimes, CookieTimes } from '../VariablesAndData';
|
import { ClickTimes, CookieTimes } from '../VariablesAndData';
|
||||||
@@ -57,113 +60,113 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(CreateElements.StatsHeader('Wrinklers', 'Wrink'));
|
stats.appendChild(CreateElements.StatsHeader('Wrinklers', 'Wrink'));
|
||||||
if (CMOptions.Header.Wrink) {
|
if (CMOptions.Header.Wrink) {
|
||||||
const popAllFrag = document.createDocumentFragment();
|
const popAllFrag = document.createDocumentFragment();
|
||||||
popAllFrag.appendChild(document.createTextNode(`${Beautify(CacheWrinklersTotal)} / ${Beautify(CacheWrinklersNormal)} `));
|
popAllFrag.appendChild(
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(CacheWrinklersTotal)} / ${Beautify(
|
||||||
|
CacheWrinklersNormal,
|
||||||
|
)} `,
|
||||||
|
),
|
||||||
|
);
|
||||||
const popAllA = document.createElement('a');
|
const popAllA = document.createElement('a');
|
||||||
popAllA.textContent = 'Pop All Normal';
|
popAllA.textContent = 'Pop All Normal';
|
||||||
popAllA.className = 'option';
|
popAllA.className = 'option';
|
||||||
popAllA.onclick = function () { PopAllNormalWrinklers(); };
|
popAllA.onclick = function () {
|
||||||
|
PopAllNormalWrinklers();
|
||||||
|
};
|
||||||
popAllFrag.appendChild(popAllA);
|
popAllFrag.appendChild(popAllA);
|
||||||
stats.appendChild(CreateElements.StatsListing('basic', 'Rewards of Popping (All/Normal)', popAllFrag));
|
stats.appendChild(
|
||||||
|
CreateElements.StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Rewards of Popping (All/Normal)',
|
||||||
|
popAllFrag,
|
||||||
|
),
|
||||||
|
);
|
||||||
const popFattestFrag = document.createDocumentFragment();
|
const popFattestFrag = document.createDocumentFragment();
|
||||||
popFattestFrag.appendChild(document.createTextNode(`${Beautify(CacheWrinklersFattest[0])} `));
|
popFattestFrag.appendChild(
|
||||||
|
document.createTextNode(`${Beautify(CacheWrinklersFattest[0])} `),
|
||||||
|
);
|
||||||
const popFattestA = document.createElement('a');
|
const popFattestA = document.createElement('a');
|
||||||
popFattestA.textContent = 'Pop Single Fattest';
|
popFattestA.textContent = 'Pop Single Fattest';
|
||||||
popFattestA.className = 'option';
|
popFattestA.className = 'option';
|
||||||
popFattestA.onclick = function () { if (CacheWrinklersFattest[1] !== null) Game.wrinklers[CacheWrinklersFattest[1]].hp = 0; };
|
popFattestA.onclick = function () {
|
||||||
|
if (CacheWrinklersFattest[1] !== null)
|
||||||
|
Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
||||||
|
};
|
||||||
popFattestFrag.appendChild(popFattestA);
|
popFattestFrag.appendChild(popFattestA);
|
||||||
stats.appendChild(CreateElements.StatsListing('basic', `Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${CacheWrinklersFattest[1] !== null ? CacheWrinklersFattest[1] : 'None'})`, popFattestFrag));
|
stats.appendChild(
|
||||||
|
CreateElements.StatsListing(
|
||||||
|
'basic',
|
||||||
|
`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${
|
||||||
|
CacheWrinklersFattest[1] !== null
|
||||||
|
? CacheWrinklersFattest[1]
|
||||||
|
: 'None'
|
||||||
|
})`,
|
||||||
|
popFattestFrag,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let specDisp = false;
|
stats.appendChild(CreateSections.SeasonSection());
|
||||||
const missingHalloweenCookies = [];
|
|
||||||
for (const i of Object.keys(GameData.HalloCookies)) {
|
|
||||||
if (!Game.Has(GameData.HalloCookies[i])) {
|
|
||||||
missingHalloweenCookies.push(GameData.HalloCookies[i]);
|
|
||||||
specDisp = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const missingChristmasCookies = [];
|
|
||||||
for (const i of Object.keys(GameData.ChristCookies)) {
|
|
||||||
if (!Game.Has(GameData.ChristCookies[i])) {
|
|
||||||
missingChristmasCookies.push(GameData.ChristCookies[i]);
|
|
||||||
specDisp = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const missingValentineCookies = [];
|
|
||||||
for (const i of Object.keys(GameData.ValCookies)) {
|
|
||||||
if (!Game.Has(GameData.ValCookies[i])) {
|
|
||||||
missingValentineCookies.push(GameData.ValCookies[i]);
|
|
||||||
specDisp = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const missingNormalEggs = [];
|
|
||||||
for (const i of Object.keys(Game.eggDrops)) {
|
|
||||||
if (!Game.HasUnlocked(Game.eggDrops[i])) {
|
|
||||||
missingNormalEggs.push(Game.eggDrops[i]);
|
|
||||||
specDisp = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const missingRareEggs = [];
|
|
||||||
for (const i of Object.keys(Game.rareEggDrops)) {
|
|
||||||
if (!Game.HasUnlocked(Game.rareEggDrops[i])) {
|
|
||||||
missingRareEggs.push(Game.rareEggDrops[i]);
|
|
||||||
specDisp = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const missingPlantDrops = [];
|
|
||||||
for (const i of Object.keys(GameData.PlantDrops)) {
|
|
||||||
if (!Game.HasUnlocked(GameData.PlantDrops[i])) {
|
|
||||||
missingPlantDrops.push(GameData.PlantDrops[i]);
|
|
||||||
specDisp = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'));
|
|
||||||
const centEgg = Game.Has('Century egg');
|
|
||||||
|
|
||||||
if (Game.season === 'christmas' || specDisp || choEgg || centEgg) {
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Season Specials', 'Sea'));
|
|
||||||
if (CMOptions.Header.Sea) {
|
|
||||||
if (missingHalloweenCookies.length !== 0) stats.appendChild(CreateElements.StatsListing('basic', 'Halloween Cookies Left to Buy', CreateElements.StatsMissDisp(missingHalloweenCookies)));
|
|
||||||
if (missingChristmasCookies.length !== 0) stats.appendChild(CreateElements.StatsListing('basic', 'Christmas Cookies Left to Buy', CreateElements.StatsMissDisp(missingChristmasCookies)));
|
|
||||||
if (missingValentineCookies.length !== 0) stats.appendChild(CreateElements.StatsListing('basic', 'Valentine Cookies Left to Buy', CreateElements.StatsMissDisp(missingValentineCookies)));
|
|
||||||
if (missingNormalEggs.length !== 0) stats.appendChild(CreateElements.StatsListing('basic', 'Normal Easter Eggs Left to Unlock', CreateElements.StatsMissDisp(missingNormalEggs)));
|
|
||||||
if (missingRareEggs.length !== 0) stats.appendChild(CreateElements.StatsListing('basic', 'Rare Easter Eggs Left to Unlock', CreateElements.StatsMissDisp(missingRareEggs)));
|
|
||||||
if (missingPlantDrops.length !== 0) stats.appendChild(CreateElements.StatsListing('basic', 'Rare Plant Drops Left to Unlock', CreateElements.StatsMissDisp(missingPlantDrops)));
|
|
||||||
|
|
||||||
if (Game.season === 'christmas') stats.appendChild(CreateElements.StatsListing('basic', 'Reindeer Reward', document.createTextNode(Beautify(CacheSeaSpec))));
|
|
||||||
if (choEgg) {
|
|
||||||
stats.appendChild(CreateElements.StatsListing('withTooltip', 'Chocolate Egg Cookies', document.createTextNode(Beautify(CacheLastChoEgg)), 'ChoEggTooltipPlaceholder'));
|
|
||||||
}
|
|
||||||
if (centEgg) {
|
|
||||||
stats.appendChild(CreateElements.StatsListing('basic', 'Century Egg Multiplier', document.createTextNode(`${Math.round((CacheCentEgg - 1) * 10000) / 100}%`)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stats.appendChild(CreateElements.StatsHeader('Miscellaneous', 'Misc'));
|
stats.appendChild(CreateElements.StatsHeader('Miscellaneous', 'Misc'));
|
||||||
if (CMOptions.Header.Misc) {
|
if (CMOptions.Header.Misc) {
|
||||||
stats.appendChild(CreateElements.StatsListing('basic',
|
stats.appendChild(
|
||||||
`Average Cookies Per Second (Past ${CookieTimes[CMOptions.AvgCPSHist] < 60 ? (`${CookieTimes[CMOptions.AvgCPSHist]} seconds`) : ((CookieTimes[CMOptions.AvgCPSHist] / 60) + (CMOptions.AvgCPSHist === 3 ? ' minute' : ' minutes'))})`,
|
CreateElements.StatsListing(
|
||||||
document.createTextNode(Beautify(GetCPS(), 3))));
|
'basic',
|
||||||
stats.appendChild(CreateElements.StatsListing('basic', `Average Cookie Clicks Per Second (Past ${ClickTimes[CMOptions.AvgClicksHist]}${CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'})`, document.createTextNode(Beautify(CacheAverageClicks, 1))));
|
`Average Cookies Per Second (Past ${
|
||||||
|
CookieTimes[CMOptions.AvgCPSHist] < 60
|
||||||
|
? `${CookieTimes[CMOptions.AvgCPSHist]} seconds`
|
||||||
|
: CookieTimes[CMOptions.AvgCPSHist] / 60 +
|
||||||
|
(CMOptions.AvgCPSHist === 3 ? ' minute' : ' minutes')
|
||||||
|
})`,
|
||||||
|
document.createTextNode(Beautify(GetCPS(), 3)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
stats.appendChild(
|
||||||
|
CreateElements.StatsListing(
|
||||||
|
'basic',
|
||||||
|
`Average Cookie Clicks Per Second (Past ${
|
||||||
|
ClickTimes[CMOptions.AvgClicksHist]
|
||||||
|
}${CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'})`,
|
||||||
|
document.createTextNode(Beautify(CacheAverageClicks, 1)),
|
||||||
|
),
|
||||||
|
);
|
||||||
if (Game.Has('Fortune cookies')) {
|
if (Game.Has('Fortune cookies')) {
|
||||||
const fortunes = [];
|
const fortunes = [];
|
||||||
for (const i of Object.keys(GameData.Fortunes)) {
|
Object.keys(GameData.Fortunes).forEach((i) => {
|
||||||
if (!Game.Has(GameData.Fortunes[i])) {
|
if (!Game.Has(GameData.Fortunes[i])) {
|
||||||
fortunes.push(GameData.Fortunes[i]);
|
fortunes.push(GameData.Fortunes[i]);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
if (fortunes.length !== 0) stats.appendChild(CreateElements.StatsListing('basic', 'Fortune Upgrades Left to Buy', CreateElements.StatsMissDisp(fortunes)));
|
if (fortunes.length !== 0)
|
||||||
|
stats.appendChild(
|
||||||
|
CreateElements.StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Fortune Upgrades Left to Buy',
|
||||||
|
CreateElements.StatsMissDisp(fortunes),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (CMOptions.ShowMissedGC) {
|
if (CMOptions.ShowMissedGC) {
|
||||||
stats.appendChild(CreateElements.StatsListing('basic', 'Missed Golden Cookies', document.createTextNode(Beautify(Game.missedGoldenClicks))));
|
stats.appendChild(
|
||||||
|
CreateElements.StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Missed Golden Cookies',
|
||||||
|
document.createTextNode(Beautify(Game.missedGoldenClicks)),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (Game.prefs.autosave) {
|
if (Game.prefs.autosave) {
|
||||||
const timer = document.createElement('span');
|
const timer = document.createElement('span');
|
||||||
timer.id = 'CMStatsAutosaveTimer';
|
timer.id = 'CMStatsAutosaveTimer';
|
||||||
timer.innerText = Game.sayTime(Game.fps * 60 - (Game.OnAscend ? 0 : (Game.T % (Game.fps * 60))), 4);
|
timer.innerText = Game.sayTime(
|
||||||
stats.appendChild(CreateElements.StatsListing('basic', 'Time till autosave', timer));
|
Game.fps * 60 - (Game.OnAscend ? 0 : Game.T % (Game.fps * 60)),
|
||||||
|
4,
|
||||||
|
);
|
||||||
|
stats.appendChild(
|
||||||
|
CreateElements.StatsListing('basic', 'Time till autosave', timer),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { ToggleHeader } from '../../Config/ToggleSetting';
|
import { ToggleHeader } from '../../Config/ToggleSetting';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { TooltipText } from '../VariablesAndData';
|
import { SimpleTooltipElements } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates a header-object for the stats page
|
* This function creates a header-object for the stats page
|
||||||
@@ -31,7 +31,10 @@ export function StatsHeader(text, config) {
|
|||||||
span.style.fontSize = '13px';
|
span.style.fontSize = '13px';
|
||||||
span.style.verticalAlign = 'middle';
|
span.style.verticalAlign = 'middle';
|
||||||
span.textContent = CMOptions.Header[config] ? '-' : '+';
|
span.textContent = CMOptions.Header[config] ? '-' : '+';
|
||||||
span.onclick = function () { ToggleHeader(config); Game.UpdateMenu(); };
|
span.onclick = function () {
|
||||||
|
ToggleHeader(config);
|
||||||
|
Game.UpdateMenu();
|
||||||
|
};
|
||||||
div.appendChild(span);
|
div.appendChild(span);
|
||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
@@ -57,8 +60,15 @@ export function StatsListing(type, name, text, placeholder) {
|
|||||||
div.appendChild(document.createTextNode(' '));
|
div.appendChild(document.createTextNode(' '));
|
||||||
|
|
||||||
const tooltip = document.createElement('span');
|
const tooltip = document.createElement('span');
|
||||||
tooltip.onmouseout = function () { Game.tooltip.hide(); };
|
tooltip.onmouseout = function () {
|
||||||
tooltip.onmouseover = function () { Game.tooltip.draw(this, escape(TooltipText[placeholder].innerHTML)); };
|
Game.tooltip.hide();
|
||||||
|
};
|
||||||
|
tooltip.onmouseover = function () {
|
||||||
|
Game.tooltip.draw(
|
||||||
|
this,
|
||||||
|
escape(SimpleTooltipElements[placeholder].innerHTML),
|
||||||
|
);
|
||||||
|
};
|
||||||
tooltip.style.cursor = 'default';
|
tooltip.style.cursor = 'default';
|
||||||
tooltip.style.display = 'inline-block';
|
tooltip.style.display = 'inline-block';
|
||||||
tooltip.style.height = '10px';
|
tooltip.style.height = '10px';
|
||||||
@@ -86,7 +96,9 @@ export function StatsMissDisp(theMissDisp) {
|
|||||||
const frag = document.createDocumentFragment();
|
const frag = document.createDocumentFragment();
|
||||||
frag.appendChild(document.createTextNode(`${theMissDisp.length} `));
|
frag.appendChild(document.createTextNode(`${theMissDisp.length} `));
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
span.onmouseout = function () { Game.tooltip.hide(); };
|
span.onmouseout = function () {
|
||||||
|
Game.tooltip.hide();
|
||||||
|
};
|
||||||
const placeholder = document.createElement('div');
|
const placeholder = document.createElement('div');
|
||||||
const missing = document.createElement('div');
|
const missing = document.createElement('div');
|
||||||
missing.style.minWidth = '140px';
|
missing.style.minWidth = '140px';
|
||||||
@@ -97,14 +109,16 @@ export function StatsMissDisp(theMissDisp) {
|
|||||||
title.style.textAlign = 'center';
|
title.style.textAlign = 'center';
|
||||||
title.textContent = 'Missing';
|
title.textContent = 'Missing';
|
||||||
missing.appendChild(title);
|
missing.appendChild(title);
|
||||||
for (const i of Object.keys(theMissDisp)) {
|
Object.keys(theMissDisp).forEach((i) => {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.style.textAlign = 'center';
|
div.style.textAlign = 'center';
|
||||||
div.appendChild(document.createTextNode(theMissDisp[i]));
|
div.appendChild(document.createTextNode(theMissDisp[i]));
|
||||||
missing.appendChild(div);
|
missing.appendChild(div);
|
||||||
}
|
});
|
||||||
placeholder.appendChild(missing);
|
placeholder.appendChild(missing);
|
||||||
span.onmouseover = function () { Game.tooltip.draw(this, escape(placeholder.innerHTML)); };
|
span.onmouseover = function () {
|
||||||
|
Game.tooltip.draw(this, escape(placeholder.innerHTML));
|
||||||
|
};
|
||||||
span.style.cursor = 'default';
|
span.style.cursor = 'default';
|
||||||
span.style.display = 'inline-block';
|
span.style.display = 'inline-block';
|
||||||
span.style.height = '10px';
|
span.style.height = '10px';
|
||||||
|
|||||||
@@ -1,20 +1,33 @@
|
|||||||
/** Functions related to displaying the missing upgrades in the Statistics page */
|
/** Functions related to displaying the missing upgrades in the Statistics page */
|
||||||
|
|
||||||
import { CacheMissingUpgrades, CacheMissingUpgradesCookies, CacheMissingUpgradesPrestige } from '../../Cache/VariablesAndData';
|
import {
|
||||||
|
CacheMissingUpgrades,
|
||||||
|
CacheMissingUpgradesCookies,
|
||||||
|
CacheMissingUpgradesPrestige,
|
||||||
|
} from '../../Cache/VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates the missing upgrades sections for prestige, normal and cookie upgrades
|
* This function creates the missing upgrades sections for prestige, normal and cookie upgrades
|
||||||
*/
|
*/
|
||||||
export function AddMissingUpgrades() {
|
export function AddMissingUpgrades() {
|
||||||
for (const menuSection of (l('menu').children)) {
|
l('menu').childNodes.forEach((menuSection) => {
|
||||||
if (menuSection.children[0]) {
|
if (menuSection.children[0]) {
|
||||||
if (menuSection.children[0].innerHTML === 'Prestige' && CacheMissingUpgradesPrestige) {
|
if (
|
||||||
const prestigeUpgradesMissing = CacheMissingUpgradesPrestige.match(new RegExp('div', 'g') || []).length / 2;
|
menuSection.children[0].innerHTML === 'Prestige' &&
|
||||||
|
CacheMissingUpgradesPrestige
|
||||||
|
) {
|
||||||
|
const prestigeUpgradesMissing =
|
||||||
|
CacheMissingUpgradesPrestige.match(new RegExp('div', 'g') || [])
|
||||||
|
.length / 2;
|
||||||
const title = document.createElement('div');
|
const title = document.createElement('div');
|
||||||
title.id = 'CMMissingUpgradesPrestigeTitle';
|
title.id = 'CMMissingUpgradesPrestigeTitle';
|
||||||
title.className = 'listing';
|
title.className = 'listing';
|
||||||
const titlefrag = document.createElement('div');
|
const titlefrag = document.createElement('div');
|
||||||
titlefrag.innerHTML = `<b>Missing Prestige upgrades:</b> ${prestigeUpgradesMissing}/${Game.PrestigeUpgrades.length} (${Math.floor((prestigeUpgradesMissing / Game.PrestigeUpgrades.length) * 100)}%)`;
|
titlefrag.innerHTML = `<b>Missing Prestige upgrades:</b> ${prestigeUpgradesMissing}/${
|
||||||
|
Game.PrestigeUpgrades.length
|
||||||
|
} (${Math.floor(
|
||||||
|
(prestigeUpgradesMissing / Game.PrestigeUpgrades.length) * 100,
|
||||||
|
)}%)`;
|
||||||
title.appendChild(titlefrag);
|
title.appendChild(titlefrag);
|
||||||
menuSection.appendChild(title);
|
menuSection.appendChild(title);
|
||||||
const upgrades = document.createElement('div');
|
const upgrades = document.createElement('div');
|
||||||
@@ -23,26 +36,43 @@ export function AddMissingUpgrades() {
|
|||||||
menuSection.appendChild(upgrades);
|
menuSection.appendChild(upgrades);
|
||||||
} else if (menuSection.children[0].innerHTML === 'Upgrades') {
|
} else if (menuSection.children[0].innerHTML === 'Upgrades') {
|
||||||
if (CacheMissingUpgrades) {
|
if (CacheMissingUpgrades) {
|
||||||
const normalUpgradesMissing = CacheMissingUpgrades.match(new RegExp('div', 'g') || []).length / 2;
|
const normalUpgradesMissing =
|
||||||
|
CacheMissingUpgrades.match(new RegExp('div', 'g') || []).length / 2;
|
||||||
const title = document.createElement('div');
|
const title = document.createElement('div');
|
||||||
title.id = 'CMMissingUpgradesTitle';
|
title.id = 'CMMissingUpgradesTitle';
|
||||||
title.className = 'listing';
|
title.className = 'listing';
|
||||||
const titlefrag = document.createElement('div');
|
const titlefrag = document.createElement('div');
|
||||||
titlefrag.innerHTML = `<b>Missing normal upgrades:</b> ${normalUpgradesMissing}/${Game.UpgradesByPool[''].length + Game.UpgradesByPool.tech.length} (${Math.floor((normalUpgradesMissing / (Game.UpgradesByPool[''].length + Game.UpgradesByPool.tech.length)) * 100)}%)`;
|
titlefrag.innerHTML = `<b>Missing normal upgrades:</b> ${normalUpgradesMissing}/${
|
||||||
|
Game.UpgradesByPool[''].length + Game.UpgradesByPool.tech.length
|
||||||
|
} (${Math.floor(
|
||||||
|
(normalUpgradesMissing /
|
||||||
|
(Game.UpgradesByPool[''].length +
|
||||||
|
Game.UpgradesByPool.tech.length)) *
|
||||||
|
100,
|
||||||
|
)}%)`;
|
||||||
title.appendChild(titlefrag);
|
title.appendChild(titlefrag);
|
||||||
menuSection.insertBefore(title, menuSection.childNodes[3]);
|
menuSection.insertBefore(title, menuSection.childNodes[3]);
|
||||||
const upgrades = document.createElement('div');
|
const upgrades = document.createElement('div');
|
||||||
upgrades.className = 'listing crateBox';
|
upgrades.className = 'listing crateBox';
|
||||||
upgrades.innerHTML = CacheMissingUpgrades;
|
upgrades.innerHTML = CacheMissingUpgrades;
|
||||||
menuSection.insertBefore(upgrades, document.getElementById('CMMissingUpgradesTitle').nextSibling);
|
menuSection.insertBefore(
|
||||||
|
upgrades,
|
||||||
|
document.getElementById('CMMissingUpgradesTitle').nextSibling,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (CacheMissingUpgradesCookies) {
|
if (CacheMissingUpgradesCookies) {
|
||||||
const cookieUpgradesMissing = CacheMissingUpgradesCookies.match(new RegExp('div', 'g') || []).length / 2;
|
const cookieUpgradesMissing =
|
||||||
|
CacheMissingUpgradesCookies.match(new RegExp('div', 'g') || [])
|
||||||
|
.length / 2;
|
||||||
const title = document.createElement('div');
|
const title = document.createElement('div');
|
||||||
title.id = 'CMMissingUpgradesCookiesTitle';
|
title.id = 'CMMissingUpgradesCookiesTitle';
|
||||||
title.className = 'listing';
|
title.className = 'listing';
|
||||||
const titlefrag = document.createElement('div');
|
const titlefrag = document.createElement('div');
|
||||||
titlefrag.innerHTML = `<b>Missing Cookie upgrades:</b> ${cookieUpgradesMissing}/${Game.UpgradesByPool.cookie.length} (${Math.floor((cookieUpgradesMissing / Game.UpgradesByPool.cookie.length) * 100)}%)`;
|
titlefrag.innerHTML = `<b>Missing Cookie upgrades:</b> ${cookieUpgradesMissing}/${
|
||||||
|
Game.UpgradesByPool.cookie.length
|
||||||
|
} (${Math.floor(
|
||||||
|
(cookieUpgradesMissing / Game.UpgradesByPool.cookie.length) * 100,
|
||||||
|
)}%)`;
|
||||||
title.appendChild(titlefrag);
|
title.appendChild(titlefrag);
|
||||||
menuSection.appendChild(title);
|
menuSection.appendChild(title);
|
||||||
const upgrades = document.createElement('div');
|
const upgrades = document.createElement('div');
|
||||||
@@ -52,7 +82,7 @@ export function AddMissingUpgrades() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,11 +99,13 @@ export function crateMissing(me) {
|
|||||||
if (!Game.prefs.crates) noFrame = 1;
|
if (!Game.prefs.crates) noFrame = 1;
|
||||||
if (noFrame) classes += ' noFrame';
|
if (noFrame) classes += ' noFrame';
|
||||||
|
|
||||||
let icon = me.icon;
|
let { icon } = me;
|
||||||
if (me.iconFunction) icon = me.iconFunction();
|
if (me.iconFunction) icon = me.iconFunction();
|
||||||
const tooltip = `function() {return Game.crateTooltip(Game.UpgradesById[${me.id}], 'stats');}`;
|
const tooltip = `function() {return Game.crateTooltip(Game.UpgradesById[${me.id}], 'stats');}`;
|
||||||
return `<div class="${classes}"
|
return `<div class="${classes}"
|
||||||
${Game.getDynamicTooltip(tooltip, 'top', true)}
|
${Game.getDynamicTooltip(tooltip, 'top', true)}
|
||||||
style = "${(`${icon[2] ? `background-image: url(${icon[2]});` : ''}background-position:${-icon[0] * 48}px ${-icon[1] * 48}px`)};">
|
style = "${`${
|
||||||
|
icon[2] ? `background-image: url(${icon[2]});` : ''
|
||||||
|
}background-position:${-icon[0] * 48}px ${-icon[1] * 48}px`};">
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
/** Functions to create the individual sections of the Statistics page */
|
/** Functions to create the individual sections of the Statistics page */
|
||||||
|
|
||||||
|
import * as GameData from '../../Data/Gamedata';
|
||||||
import { MaxChainCookieReward } from '../../Cache/Stats/ChainCookies';
|
import { MaxChainCookieReward } from '../../Cache/Stats/ChainCookies';
|
||||||
import {
|
import {
|
||||||
CacheAvgCPSWithChoEgg,
|
CacheAvgCPSWithChoEgg,
|
||||||
|
CacheCentEgg,
|
||||||
CacheChainFrenzyMaxReward,
|
CacheChainFrenzyMaxReward,
|
||||||
CacheChainFrenzyRequired,
|
CacheChainFrenzyRequired,
|
||||||
CacheChainFrenzyRequiredNext,
|
CacheChainFrenzyRequiredNext,
|
||||||
@@ -20,16 +22,31 @@ import {
|
|||||||
CacheEdifice,
|
CacheEdifice,
|
||||||
CacheEdificeBuilding,
|
CacheEdificeBuilding,
|
||||||
CacheGoldenCookiesMult,
|
CacheGoldenCookiesMult,
|
||||||
CacheHCPerSecond, CacheLastChoEgg, CacheLucky, CacheLuckyFrenzy, CacheLuckyReward, CacheLuckyRewardFrenzy, CacheLuckyWrathReward, CacheLuckyWrathRewardFrenzy, CacheNoGoldSwitchCookiesPS, CacheRealCookiesEarned, CacheWrathCookiesMult, CacheWrinklersTotal,
|
CacheHCPerSecond,
|
||||||
|
CacheLastChoEgg,
|
||||||
|
CacheLucky,
|
||||||
|
CacheLuckyFrenzy,
|
||||||
|
CacheLuckyReward,
|
||||||
|
CacheLuckyRewardFrenzy,
|
||||||
|
CacheLuckyWrathReward,
|
||||||
|
CacheLuckyWrathRewardFrenzy,
|
||||||
|
CacheNoGoldSwitchCookiesPS,
|
||||||
|
CacheRealCookiesEarned,
|
||||||
|
CacheSeaSpec,
|
||||||
|
CacheWrathCookiesMult,
|
||||||
|
CacheWrinklersTotal,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import ResetBonus from '../../Sim/SimulationEvents/ResetAscension';
|
import ResetBonus from '../../Sim/SimulationEvents/ResetAscension';
|
||||||
import { Beautify, FormatTime } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import {
|
||||||
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
|
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
|
||||||
import GetCPS from '../HelperFunctions/GetCPS';
|
import GetCPS from '../HelperFunctions/GetCPS';
|
||||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
||||||
import { ColorGreen, ColorRed, ColorTextPre } from '../VariablesAndData';
|
import { ColorGreen, ColorRed, ColorTextPre } from '../VariablesAndData';
|
||||||
import { StatsListing } from './CreateDOMElements';
|
import { StatsListing, StatsHeader, StatsMissDisp } from './CreateDOMElements';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates the "Lucky" section of the stats page
|
* This function creates the "Lucky" section of the stats page
|
||||||
@@ -37,13 +54,21 @@ import { StatsListing } from './CreateDOMElements';
|
|||||||
*/
|
*/
|
||||||
export function LuckySection() {
|
export function LuckySection() {
|
||||||
// This sets which tooltip to display for certain stats
|
// This sets which tooltip to display for certain stats
|
||||||
const goldCookTooltip = Game.auraMult('Dragon\'s Fortune') ? 'GoldCookDragonsFortuneTooltipPlaceholder' : 'GoldCookTooltipPlaceholder';
|
const goldCookTooltip = Game.auraMult("Dragon's Fortune")
|
||||||
|
? 'GoldCookDragonsFortuneTooltipPlaceholder'
|
||||||
|
: 'GoldCookTooltipPlaceholder';
|
||||||
|
|
||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsLuckySection';
|
section.className = 'CMStatsLuckySection';
|
||||||
|
|
||||||
const luckyColor = ((Game.cookies + GetWrinkConfigBank()) < CacheLucky) ? ColorRed : ColorGreen;
|
const luckyColor =
|
||||||
const luckyTime = ((Game.cookies + GetWrinkConfigBank()) < CacheLucky) ? FormatTime((CacheLucky - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
Game.cookies + GetWrinkConfigBank() < CacheLucky ? ColorRed : ColorGreen;
|
||||||
|
const luckyTime =
|
||||||
|
Game.cookies + GetWrinkConfigBank() < CacheLucky
|
||||||
|
? FormatTime(
|
||||||
|
(CacheLucky - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
|
)
|
||||||
|
: '';
|
||||||
const luckyReqFrag = document.createDocumentFragment();
|
const luckyReqFrag = document.createDocumentFragment();
|
||||||
const luckyReqSpan = document.createElement('span');
|
const luckyReqSpan = document.createElement('span');
|
||||||
luckyReqSpan.style.fontWeight = 'bold';
|
luckyReqSpan.style.fontWeight = 'bold';
|
||||||
@@ -55,10 +80,25 @@ export function LuckySection() {
|
|||||||
luckyReqSmall.textContent = ` (${luckyTime})`;
|
luckyReqSmall.textContent = ` (${luckyTime})`;
|
||||||
luckyReqFrag.appendChild(luckyReqSmall);
|
luckyReqFrag.appendChild(luckyReqSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(StatsListing('withTooltip', '"Lucky!" Cookies Required', luckyReqFrag, goldCookTooltip));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Lucky!" Cookies Required',
|
||||||
|
luckyReqFrag,
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const luckyColorFrenzy = ((Game.cookies + GetWrinkConfigBank()) < CacheLuckyFrenzy) ? ColorRed : ColorGreen;
|
const luckyColorFrenzy =
|
||||||
const luckyTimeFrenzy = ((Game.cookies + GetWrinkConfigBank()) < CacheLuckyFrenzy) ? FormatTime((CacheLuckyFrenzy - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
||||||
|
? ColorRed
|
||||||
|
: ColorGreen;
|
||||||
|
const luckyTimeFrenzy =
|
||||||
|
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
||||||
|
? FormatTime(
|
||||||
|
(CacheLuckyFrenzy - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
|
)
|
||||||
|
: '';
|
||||||
const luckyReqFrenFrag = document.createDocumentFragment();
|
const luckyReqFrenFrag = document.createDocumentFragment();
|
||||||
const luckyReqFrenSpan = document.createElement('span');
|
const luckyReqFrenSpan = document.createElement('span');
|
||||||
luckyReqFrenSpan.style.fontWeight = 'bold';
|
luckyReqFrenSpan.style.fontWeight = 'bold';
|
||||||
@@ -70,28 +110,66 @@ export function LuckySection() {
|
|||||||
luckyReqFrenSmall.textContent = ` (${luckyTimeFrenzy})`;
|
luckyReqFrenSmall.textContent = ` (${luckyTimeFrenzy})`;
|
||||||
luckyReqFrenFrag.appendChild(luckyReqFrenSmall);
|
luckyReqFrenFrag.appendChild(luckyReqFrenSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(StatsListing('withTooltip', '"Lucky!" Cookies Required (Frenzy)', luckyReqFrenFrag, goldCookTooltip));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Lucky!" Cookies Required (Frenzy)',
|
||||||
|
luckyReqFrenFrag,
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const luckySplit = CacheLuckyReward !== CacheLuckyWrathReward;
|
const luckySplit = CacheLuckyReward !== CacheLuckyWrathReward;
|
||||||
|
|
||||||
const luckyRewardMaxSpan = document.createElement('span');
|
const luckyRewardMaxSpan = document.createElement('span');
|
||||||
luckyRewardMaxSpan.style.fontWeight = 'bold';
|
luckyRewardMaxSpan.style.fontWeight = 'bold';
|
||||||
luckyRewardMaxSpan.className = ColorTextPre + CacheLuckyReward;
|
luckyRewardMaxSpan.className = ColorTextPre + CacheLuckyReward;
|
||||||
luckyRewardMaxSpan.textContent = Beautify(CacheLuckyReward) + (luckySplit ? (` / ${Beautify(CacheLuckyWrathReward)}`) : '');
|
luckyRewardMaxSpan.textContent =
|
||||||
section.appendChild(StatsListing('withTooltip', `"Lucky!" Reward (MAX)${luckySplit ? ' (Golden / Wrath)' : ''}`, luckyRewardMaxSpan, goldCookTooltip));
|
Beautify(CacheLuckyReward) +
|
||||||
|
(luckySplit ? ` / ${Beautify(CacheLuckyWrathReward)}` : '');
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
`"Lucky!" Reward (MAX)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
||||||
|
luckyRewardMaxSpan,
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const luckyRewardFrenzyMaxSpan = document.createElement('span');
|
const luckyRewardFrenzyMaxSpan = document.createElement('span');
|
||||||
luckyRewardFrenzyMaxSpan.style.fontWeight = 'bold';
|
luckyRewardFrenzyMaxSpan.style.fontWeight = 'bold';
|
||||||
luckyRewardFrenzyMaxSpan.className = ColorTextPre + luckyRewardFrenzyMaxSpan;
|
luckyRewardFrenzyMaxSpan.className = ColorTextPre + luckyRewardFrenzyMaxSpan;
|
||||||
luckyRewardFrenzyMaxSpan.textContent = Beautify(CacheLuckyRewardFrenzy) + (luckySplit ? (` / ${Beautify(CacheLuckyWrathRewardFrenzy)}`) : '');
|
luckyRewardFrenzyMaxSpan.textContent =
|
||||||
section.appendChild(StatsListing('withTooltip', `"Lucky!" Reward (MAX) (Frenzy)${luckySplit ? ' (Golden / Wrath)' : ''}`, luckyRewardFrenzyMaxSpan, goldCookTooltip));
|
Beautify(CacheLuckyRewardFrenzy) +
|
||||||
|
(luckySplit ? ` / ${Beautify(CacheLuckyWrathRewardFrenzy)}` : '');
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
`"Lucky!" Reward (MAX) (Frenzy)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
||||||
|
luckyRewardFrenzyMaxSpan,
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const luckyCurBase = Math.min((Game.cookies + GetWrinkConfigBank()) * 0.15, CacheNoGoldSwitchCookiesPS * CacheDragonsFortuneMultAdjustment * 60 * 15) + 13;
|
const luckyCurBase =
|
||||||
|
Math.min(
|
||||||
|
(Game.cookies + GetWrinkConfigBank()) * 0.15,
|
||||||
|
CacheNoGoldSwitchCookiesPS * CacheDragonsFortuneMultAdjustment * 60 * 15,
|
||||||
|
) + 13;
|
||||||
const luckyCurSpan = document.createElement('span');
|
const luckyCurSpan = document.createElement('span');
|
||||||
luckyCurSpan.style.fontWeight = 'bold';
|
luckyCurSpan.style.fontWeight = 'bold';
|
||||||
luckyCurSpan.className = ColorTextPre + luckyCurSpan;
|
luckyCurSpan.className = ColorTextPre + luckyCurSpan;
|
||||||
luckyCurSpan.textContent = Beautify(CacheGoldenCookiesMult * luckyCurBase) + (luckySplit ? (` / ${Beautify(CacheWrathCookiesMult * luckyCurBase)}`) : '');
|
luckyCurSpan.textContent =
|
||||||
section.appendChild(StatsListing('withTooltip', `"Lucky!" Reward (CUR)${luckySplit ? ' (Golden / Wrath)' : ''}`, luckyCurSpan, goldCookTooltip));
|
Beautify(CacheGoldenCookiesMult * luckyCurBase) +
|
||||||
|
(luckySplit ? ` / ${Beautify(CacheWrathCookiesMult * luckyCurBase)}` : '');
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
`"Lucky!" Reward (CUR)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
||||||
|
luckyCurSpan,
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,13 +179,24 @@ export function LuckySection() {
|
|||||||
*/
|
*/
|
||||||
export function ChainSection() {
|
export function ChainSection() {
|
||||||
// This sets which tooltip to display for certain stats
|
// This sets which tooltip to display for certain stats
|
||||||
const goldCookTooltip = Game.auraMult('Dragon\'s Fortune') ? 'GoldCookDragonsFortuneTooltipPlaceholder' : 'GoldCookTooltipPlaceholder';
|
const goldCookTooltip = Game.auraMult("Dragon's Fortune")
|
||||||
|
? 'GoldCookDragonsFortuneTooltipPlaceholder'
|
||||||
|
: 'GoldCookTooltipPlaceholder';
|
||||||
|
|
||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsChainSection';
|
section.className = 'CMStatsChainSection';
|
||||||
|
|
||||||
const chainColor = ((Game.cookies + GetWrinkConfigBank()) < CacheChainRequired) ? ColorRed : ColorGreen;
|
const chainColor =
|
||||||
const chainTime = ((Game.cookies + GetWrinkConfigBank()) < CacheChainRequired) ? FormatTime((CacheChainRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
||||||
|
? ColorRed
|
||||||
|
: ColorGreen;
|
||||||
|
const chainTime =
|
||||||
|
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
||||||
|
? FormatTime(
|
||||||
|
(CacheChainRequired - (Game.cookies + GetWrinkConfigBank())) /
|
||||||
|
GetCPS(),
|
||||||
|
)
|
||||||
|
: '';
|
||||||
const chainReqFrag = document.createDocumentFragment();
|
const chainReqFrag = document.createDocumentFragment();
|
||||||
const chainReqSpan = document.createElement('span');
|
const chainReqSpan = document.createElement('span');
|
||||||
chainReqSpan.style.fontWeight = 'bold';
|
chainReqSpan.style.fontWeight = 'bold';
|
||||||
@@ -119,10 +208,26 @@ export function ChainSection() {
|
|||||||
chainReqSmall.textContent = ` (${chainTime})`;
|
chainReqSmall.textContent = ` (${chainTime})`;
|
||||||
chainReqFrag.appendChild(chainReqSmall);
|
chainReqFrag.appendChild(chainReqSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(StatsListing('withTooltip', '"Chain" Cookies Required', chainReqFrag, goldCookTooltip));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Chain" Cookies Required',
|
||||||
|
chainReqFrag,
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const chainWrathColor = ((Game.cookies + GetWrinkConfigBank()) < CacheChainWrathRequired) ? ColorRed : ColorGreen;
|
const chainWrathColor =
|
||||||
const chainWrathTime = ((Game.cookies + GetWrinkConfigBank()) < CacheChainWrathRequired) ? FormatTime((CacheChainWrathRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
||||||
|
? ColorRed
|
||||||
|
: ColorGreen;
|
||||||
|
const chainWrathTime =
|
||||||
|
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
||||||
|
? FormatTime(
|
||||||
|
(CacheChainWrathRequired - (Game.cookies + GetWrinkConfigBank())) /
|
||||||
|
GetCPS(),
|
||||||
|
)
|
||||||
|
: '';
|
||||||
const chainWrathReqFrag = document.createDocumentFragment();
|
const chainWrathReqFrag = document.createDocumentFragment();
|
||||||
const chainWrathReqSpan = document.createElement('span');
|
const chainWrathReqSpan = document.createElement('span');
|
||||||
chainWrathReqSpan.style.fontWeight = 'bold';
|
chainWrathReqSpan.style.fontWeight = 'bold';
|
||||||
@@ -134,10 +239,26 @@ export function ChainSection() {
|
|||||||
chainWrathReqSmall.textContent = ` (${chainWrathTime})`;
|
chainWrathReqSmall.textContent = ` (${chainWrathTime})`;
|
||||||
chainWrathReqFrag.appendChild(chainWrathReqSmall);
|
chainWrathReqFrag.appendChild(chainWrathReqSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(StatsListing('withTooltip', '"Chain" Cookies Required (Wrath)', chainWrathReqFrag, goldCookTooltip));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Chain" Cookies Required (Wrath)',
|
||||||
|
chainWrathReqFrag,
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const chainColorFrenzy = ((Game.cookies + GetWrinkConfigBank()) < CacheChainFrenzyRequired) ? ColorRed : ColorGreen;
|
const chainColorFrenzy =
|
||||||
const chainTimeFrenzy = ((Game.cookies + GetWrinkConfigBank()) < CacheChainFrenzyRequired) ? FormatTime((CacheChainFrenzyRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
||||||
|
? ColorRed
|
||||||
|
: ColorGreen;
|
||||||
|
const chainTimeFrenzy =
|
||||||
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
||||||
|
? FormatTime(
|
||||||
|
(CacheChainFrenzyRequired - (Game.cookies + GetWrinkConfigBank())) /
|
||||||
|
GetCPS(),
|
||||||
|
)
|
||||||
|
: '';
|
||||||
const chainReqFrenFrag = document.createDocumentFragment();
|
const chainReqFrenFrag = document.createDocumentFragment();
|
||||||
const chainReqFrenSpan = document.createElement('span');
|
const chainReqFrenSpan = document.createElement('span');
|
||||||
chainReqFrenSpan.style.fontWeight = 'bold';
|
chainReqFrenSpan.style.fontWeight = 'bold';
|
||||||
@@ -149,10 +270,27 @@ export function ChainSection() {
|
|||||||
chainReqFrenSmall.textContent = ` (${chainTimeFrenzy})`;
|
chainReqFrenSmall.textContent = ` (${chainTimeFrenzy})`;
|
||||||
chainReqFrenFrag.appendChild(chainReqFrenSmall);
|
chainReqFrenFrag.appendChild(chainReqFrenSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(StatsListing('withTooltip', '"Chain" Cookies Required (Frenzy)', chainReqFrenFrag, goldCookTooltip));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Chain" Cookies Required (Frenzy)',
|
||||||
|
chainReqFrenFrag,
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const chainWrathColorFrenzy = ((Game.cookies + GetWrinkConfigBank()) < CacheChainFrenzyWrathRequired) ? ColorRed : ColorGreen;
|
const chainWrathColorFrenzy =
|
||||||
const chainWrathTimeFrenzy = ((Game.cookies + GetWrinkConfigBank()) < CacheChainFrenzyWrathRequired) ? FormatTime((CacheChainFrenzyWrathRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
||||||
|
? ColorRed
|
||||||
|
: ColorGreen;
|
||||||
|
const chainWrathTimeFrenzy =
|
||||||
|
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
||||||
|
? FormatTime(
|
||||||
|
(CacheChainFrenzyWrathRequired -
|
||||||
|
(Game.cookies + GetWrinkConfigBank())) /
|
||||||
|
GetCPS(),
|
||||||
|
)
|
||||||
|
: '';
|
||||||
const chainWrathReqFrenFrag = document.createDocumentFragment();
|
const chainWrathReqFrenFrag = document.createDocumentFragment();
|
||||||
const chainWrathReqFrenSpan = document.createElement('span');
|
const chainWrathReqFrenSpan = document.createElement('span');
|
||||||
chainWrathReqFrenSpan.style.fontWeight = 'bold';
|
chainWrathReqFrenSpan.style.fontWeight = 'bold';
|
||||||
@@ -164,19 +302,90 @@ export function ChainSection() {
|
|||||||
chainWrathReqFrenSmall.textContent = ` (${chainWrathTimeFrenzy})`;
|
chainWrathReqFrenSmall.textContent = ` (${chainWrathTimeFrenzy})`;
|
||||||
chainWrathReqFrenFrag.appendChild(chainWrathReqFrenSmall);
|
chainWrathReqFrenFrag.appendChild(chainWrathReqFrenSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(StatsListing('withTooltip', '"Chain" Cookies Required (Frenzy) (Wrath)', chainWrathReqFrenFrag, goldCookTooltip));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Chain" Cookies Required (Frenzy) (Wrath)',
|
||||||
|
chainWrathReqFrenFrag,
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
section.appendChild(StatsListing('withTooltip', '"Chain" Reward (MAX) (Golden / Wrath)', document.createTextNode(`${Beautify(CacheChainMaxReward[0])} / ${Beautify(CacheChainWrathMaxReward[0])}`), goldCookTooltip));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Chain" Reward (MAX) (Golden / Wrath)',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(CacheChainMaxReward[0])} / ${Beautify(
|
||||||
|
CacheChainWrathMaxReward[0],
|
||||||
|
)}`,
|
||||||
|
),
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
section.appendChild(StatsListing('withTooltip', '"Chain" Reward (MAX) (Frenzy) (Golden / Wrath)', document.createTextNode((`${Beautify(CacheChainFrenzyMaxReward[0])} / ${Beautify(CacheChainFrenzyMaxReward[0])}`)), goldCookTooltip));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Chain" Reward (MAX) (Frenzy) (Golden / Wrath)',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(CacheChainFrenzyMaxReward[0])} / ${Beautify(
|
||||||
|
CacheChainFrenzyMaxReward[0],
|
||||||
|
)}`,
|
||||||
|
),
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const chainCurMax = Math.min(Game.cookiesPs * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment, Game.cookies * 0.5);
|
const chainCurMax = Math.min(
|
||||||
const chainCur = MaxChainCookieReward(7, chainCurMax, CacheGoldenCookiesMult)[0];
|
Game.cookiesPs * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment,
|
||||||
const chainCurWrath = MaxChainCookieReward(6, chainCurMax, CacheWrathCookiesMult)[0];
|
Game.cookies * 0.5,
|
||||||
section.appendChild(StatsListing('withTooltip', '"Chain" Reward (CUR) (Golden / Wrath)', document.createTextNode((`${Beautify(chainCur)} / ${Beautify(chainCurWrath)}`)), goldCookTooltip));
|
);
|
||||||
|
const chainCur = MaxChainCookieReward(
|
||||||
|
7,
|
||||||
|
chainCurMax,
|
||||||
|
CacheGoldenCookiesMult,
|
||||||
|
)[0];
|
||||||
|
const chainCurWrath = MaxChainCookieReward(
|
||||||
|
6,
|
||||||
|
chainCurMax,
|
||||||
|
CacheWrathCookiesMult,
|
||||||
|
)[0];
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Chain" Reward (CUR) (Golden / Wrath)',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(chainCur)} / ${Beautify(chainCurWrath)}`,
|
||||||
|
),
|
||||||
|
goldCookTooltip,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
section.appendChild(StatsListing('withTooltip', 'CPS Needed For Next Level (G / W)', document.createTextNode((`${Beautify(CacheChainRequiredNext)} / ${Beautify(CacheChainWrathRequiredNext)}`)), 'ChainNextLevelPlaceholder'));
|
section.appendChild(
|
||||||
section.appendChild(StatsListing('withTooltip', 'CPS Needed For Next Level (Frenzy) (G / W)', document.createTextNode((`${Beautify(CacheChainFrenzyRequiredNext)} / ${Beautify(CacheChainFrenzyWrathRequiredNext)}`)), 'ChainNextLevelPlaceholder'));
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'CPS Needed For Next Level (G / W)',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(CacheChainRequiredNext)} / ${Beautify(
|
||||||
|
CacheChainWrathRequiredNext,
|
||||||
|
)}`,
|
||||||
|
),
|
||||||
|
'ChainNextLevelPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'CPS Needed For Next Level (Frenzy) (G / W)',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(CacheChainFrenzyRequiredNext)} / ${Beautify(
|
||||||
|
CacheChainFrenzyWrathRequiredNext,
|
||||||
|
)}`,
|
||||||
|
),
|
||||||
|
'ChainNextLevelPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,8 +397,14 @@ export function SpellsSection() {
|
|||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsSpellsSection';
|
section.className = 'CMStatsSpellsSection';
|
||||||
|
|
||||||
const conjureColor = ((Game.cookies + GetWrinkConfigBank()) < CacheConjure) ? ColorRed : ColorGreen;
|
const conjureColor =
|
||||||
const conjureTime = ((Game.cookies + GetWrinkConfigBank()) < CacheConjure) ? FormatTime((CacheConjure - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
Game.cookies + GetWrinkConfigBank() < CacheConjure ? ColorRed : ColorGreen;
|
||||||
|
const conjureTime =
|
||||||
|
Game.cookies + GetWrinkConfigBank() < CacheConjure
|
||||||
|
? FormatTime(
|
||||||
|
(CacheConjure - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
|
)
|
||||||
|
: '';
|
||||||
|
|
||||||
const conjureReqFrag = document.createDocumentFragment();
|
const conjureReqFrag = document.createDocumentFragment();
|
||||||
const conjureReqSpan = document.createElement('span');
|
const conjureReqSpan = document.createElement('span');
|
||||||
@@ -202,12 +417,37 @@ export function SpellsSection() {
|
|||||||
conjureReqSmall.textContent = ` (${conjureTime})`;
|
conjureReqSmall.textContent = ` (${conjureTime})`;
|
||||||
conjureReqFrag.appendChild(conjureReqSmall);
|
conjureReqFrag.appendChild(conjureReqSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(StatsListing('withTooltip', '"Conjure Baked Goods" Cookies Required', conjureReqFrag, 'GoldCookTooltipPlaceholder'));
|
section.appendChild(
|
||||||
section.appendChild(StatsListing('withTooltip', '"Conjure Baked Goods" Reward (MAX)', document.createTextNode(Beautify(CacheConjureReward)), 'GoldCookTooltipPlaceholder'));
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Conjure Baked Goods" Cookies Required',
|
||||||
|
conjureReqFrag,
|
||||||
|
'GoldCookTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Conjure Baked Goods" Reward (MAX)',
|
||||||
|
document.createTextNode(Beautify(CacheConjureReward)),
|
||||||
|
'GoldCookTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const conjureFrenzyColor = ((Game.cookies + GetWrinkConfigBank()) < CacheConjure * 7) ? ColorRed : ColorGreen;
|
const conjureFrenzyColor =
|
||||||
const conjureFrenzyCur = Math.min((Game.cookies + GetWrinkConfigBank()) * 0.15, CacheNoGoldSwitchCookiesPS * 60 * 30);
|
Game.cookies + GetWrinkConfigBank() < CacheConjure * 7
|
||||||
const conjureFrenzyTime = ((Game.cookies + GetWrinkConfigBank()) < CacheConjure * 7) ? FormatTime((CacheConjure * 7 - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
? ColorRed
|
||||||
|
: ColorGreen;
|
||||||
|
const conjureFrenzyCur = Math.min(
|
||||||
|
(Game.cookies + GetWrinkConfigBank()) * 0.15,
|
||||||
|
CacheNoGoldSwitchCookiesPS * 60 * 30,
|
||||||
|
);
|
||||||
|
const conjureFrenzyTime =
|
||||||
|
Game.cookies + GetWrinkConfigBank() < CacheConjure * 7
|
||||||
|
? FormatTime(
|
||||||
|
(CacheConjure * 7 - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
|
)
|
||||||
|
: '';
|
||||||
|
|
||||||
const conjureFrenzyReqFrag = document.createDocumentFragment();
|
const conjureFrenzyReqFrag = document.createDocumentFragment();
|
||||||
const conjureFrenzyReqSpan = document.createElement('span');
|
const conjureFrenzyReqSpan = document.createElement('span');
|
||||||
@@ -220,11 +460,41 @@ export function SpellsSection() {
|
|||||||
conjureFrenzyReqSmall.textContent = ` (${conjureFrenzyTime})`;
|
conjureFrenzyReqSmall.textContent = ` (${conjureFrenzyTime})`;
|
||||||
conjureFrenzyReqFrag.appendChild(conjureFrenzyReqSmall);
|
conjureFrenzyReqFrag.appendChild(conjureFrenzyReqSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(StatsListing('withTooltip', '"Conjure Baked Goods" Cookies Required (Frenzy)', conjureFrenzyReqFrag, 'GoldCookTooltipPlaceholder'));
|
section.appendChild(
|
||||||
section.appendChild(StatsListing('withTooltip', '"Conjure Baked Goods" Reward (MAX) (Frenzy)', document.createTextNode(Beautify(CacheConjureReward * 7)), 'GoldCookTooltipPlaceholder'));
|
StatsListing(
|
||||||
section.appendChild(StatsListing('withTooltip', '"Conjure Baked Goods" Reward (CUR)', document.createTextNode(Beautify(conjureFrenzyCur)), 'GoldCookTooltipPlaceholder'));
|
'withTooltip',
|
||||||
|
'"Conjure Baked Goods" Cookies Required (Frenzy)',
|
||||||
|
conjureFrenzyReqFrag,
|
||||||
|
'GoldCookTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Conjure Baked Goods" Reward (MAX) (Frenzy)',
|
||||||
|
document.createTextNode(Beautify(CacheConjureReward * 7)),
|
||||||
|
'GoldCookTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Conjure Baked Goods" Reward (CUR)',
|
||||||
|
document.createTextNode(Beautify(conjureFrenzyCur)),
|
||||||
|
'GoldCookTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
if (CacheEdifice) {
|
if (CacheEdifice) {
|
||||||
section.appendChild(StatsListing('withTooltip', '"Spontaneous Edifice" Cookies Required (most expensive building)', document.createTextNode(`${Beautify(CacheEdifice)} (${CacheEdificeBuilding})`), 'GoldCookTooltipPlaceholder'));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'"Spontaneous Edifice" Cookies Required (most expensive building)',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(CacheEdifice)} (${CacheEdificeBuilding})`,
|
||||||
|
),
|
||||||
|
'GoldCookTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
@@ -237,33 +507,61 @@ export function GardenSection() {
|
|||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsGardenSection';
|
section.className = 'CMStatsGardenSection';
|
||||||
|
|
||||||
const bakeberryColor = (Game.cookies < Game.cookiesPs * 60 * 30) ? ColorRed : ColorGreen;
|
const bakeberryColor =
|
||||||
|
Game.cookies < Game.cookiesPs * 60 * 10 * 100 ? ColorRed : ColorGreen;
|
||||||
const bakeberryFrag = document.createElement('span');
|
const bakeberryFrag = document.createElement('span');
|
||||||
bakeberryFrag.style.fontWeight = 'bold';
|
bakeberryFrag.style.fontWeight = 'bold';
|
||||||
bakeberryFrag.className = ColorTextPre + bakeberryColor;
|
bakeberryFrag.className = ColorTextPre + bakeberryColor;
|
||||||
bakeberryFrag.textContent = Beautify(Game.cookiesPs * 60 * 30);
|
bakeberryFrag.textContent = Beautify(Game.cookiesPs * 60 * 10 * 100);
|
||||||
section.appendChild(StatsListing('basic', 'Cookies required for max reward of Bakeberry: ', bakeberryFrag));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Cookies required for max reward of Bakeberry: ',
|
||||||
|
bakeberryFrag,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const chocorootColor = (Game.cookies < Game.cookiesPs * 60 * 3) ? ColorRed : ColorGreen;
|
const chocorootColor =
|
||||||
|
Game.cookies < Game.cookiesPs * 60 * 100 ? ColorRed : ColorGreen;
|
||||||
const chocorootFrag = document.createElement('span');
|
const chocorootFrag = document.createElement('span');
|
||||||
chocorootFrag.style.fontWeight = 'bold';
|
chocorootFrag.style.fontWeight = 'bold';
|
||||||
chocorootFrag.className = ColorTextPre + chocorootColor;
|
chocorootFrag.className = ColorTextPre + chocorootColor;
|
||||||
chocorootFrag.textContent = Beautify(Game.cookiesPs * 60 * 3);
|
chocorootFrag.textContent = Beautify(Game.cookiesPs * 60 * 100);
|
||||||
section.appendChild(StatsListing('basic', 'Cookies required for max reward of Chocoroot: ', chocorootFrag));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Cookies required for max reward of Chocoroot: ',
|
||||||
|
chocorootFrag,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const queenbeetColor = (Game.cookies < Game.cookiesPs * 60 * 60) ? ColorRed : ColorGreen;
|
const queenbeetColor =
|
||||||
|
Game.cookies < Game.cookiesPs * 60 * 60 * 25 ? ColorRed : ColorGreen;
|
||||||
const queenbeetFrag = document.createElement('span');
|
const queenbeetFrag = document.createElement('span');
|
||||||
queenbeetFrag.style.fontWeight = 'bold';
|
queenbeetFrag.style.fontWeight = 'bold';
|
||||||
queenbeetFrag.className = ColorTextPre + queenbeetColor;
|
queenbeetFrag.className = ColorTextPre + queenbeetColor;
|
||||||
queenbeetFrag.textContent = Beautify(Game.cookiesPs * 60 * 60);
|
queenbeetFrag.textContent = Beautify(Game.cookiesPs * 60 * 60 * 25);
|
||||||
section.appendChild(StatsListing('basic', 'Cookies required for max reward of Queenbeet: ', queenbeetFrag));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Cookies required for max reward of Queenbeet: ',
|
||||||
|
queenbeetFrag,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const duketaterColor = (Game.cookies < Game.cookiesPs * 60 * 120) ? ColorRed : ColorGreen;
|
const duketaterColor =
|
||||||
|
Game.cookies < Game.cookiesPs * 60 * 15 * 100 ? ColorRed : ColorGreen;
|
||||||
const duketaterFrag = document.createElement('span');
|
const duketaterFrag = document.createElement('span');
|
||||||
duketaterFrag.style.fontWeight = 'bold';
|
duketaterFrag.style.fontWeight = 'bold';
|
||||||
duketaterFrag.className = ColorTextPre + duketaterColor;
|
duketaterFrag.className = ColorTextPre + duketaterColor;
|
||||||
duketaterFrag.textContent = Beautify(Game.cookiesPs * 60 * 120);
|
duketaterFrag.textContent = Beautify(Game.cookiesPs * 60 * 15 * 100);
|
||||||
section.appendChild(StatsListing('basic', 'Cookies required for max reward of Duketater: ', duketaterFrag));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Cookies required for max reward of Duketater: ',
|
||||||
|
duketaterFrag,
|
||||||
|
),
|
||||||
|
);
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,45 +573,126 @@ export function PrestigeSection() {
|
|||||||
const section = document.createElement('div');
|
const section = document.createElement('div');
|
||||||
section.className = 'CMStatsPrestigeSection';
|
section.className = 'CMStatsPrestigeSection';
|
||||||
|
|
||||||
const possiblePresMax = Math.floor(Game.HowMuchPrestige(CacheRealCookiesEarned
|
const possiblePresMax = Math.floor(
|
||||||
+ Game.cookiesReset + CacheWrinklersTotal
|
Game.HowMuchPrestige(
|
||||||
+ (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CacheLastChoEgg : 0)));
|
CacheRealCookiesEarned +
|
||||||
section.appendChild(StatsListing('withTooltip', 'Prestige Level (CUR / MAX)', document.createTextNode(`${Beautify(Game.prestige)} / ${Beautify(possiblePresMax)}`), 'PrestMaxTooltipPlaceholder'));
|
Game.cookiesReset +
|
||||||
|
CacheWrinklersTotal +
|
||||||
|
(Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')
|
||||||
|
? CacheLastChoEgg
|
||||||
|
: 0),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'Prestige Level (CUR / MAX)',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(Game.prestige)} / ${Beautify(possiblePresMax)}`,
|
||||||
|
),
|
||||||
|
'PrestMaxTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const neededCook = Game.HowManyCookiesReset(possiblePresMax + 1) - (CacheRealCookiesEarned + Game.cookiesReset + CacheWrinklersTotal + ((Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CacheLastChoEgg : 0) ? CacheLastChoEgg : 0));
|
const neededCook = Math.max(
|
||||||
|
0,
|
||||||
|
Game.HowManyCookiesReset(possiblePresMax + 1) -
|
||||||
|
(CacheRealCookiesEarned +
|
||||||
|
Game.cookiesReset +
|
||||||
|
CacheWrinklersTotal +
|
||||||
|
((
|
||||||
|
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')
|
||||||
|
? CacheLastChoEgg
|
||||||
|
: 0
|
||||||
|
)
|
||||||
|
? CacheLastChoEgg
|
||||||
|
: 0)),
|
||||||
|
);
|
||||||
const cookiesNextFrag = document.createDocumentFragment();
|
const cookiesNextFrag = document.createDocumentFragment();
|
||||||
cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook)));
|
cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook)));
|
||||||
const cookiesNextSmall = document.createElement('small');
|
const cookiesNextSmall = document.createElement('small');
|
||||||
cookiesNextSmall.textContent = ` (${FormatTime(neededCook / CacheAvgCPSWithChoEgg, 1)})`;
|
cookiesNextSmall.textContent = ` (${FormatTime(
|
||||||
|
neededCook / CacheAvgCPSWithChoEgg,
|
||||||
|
1,
|
||||||
|
)})`;
|
||||||
cookiesNextFrag.appendChild(cookiesNextSmall);
|
cookiesNextFrag.appendChild(cookiesNextSmall);
|
||||||
section.appendChild(StatsListing('withTooltip', 'Cookies To Next Level', cookiesNextFrag, 'NextPrestTooltipPlaceholder'));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'Cookies To Next Level',
|
||||||
|
cookiesNextFrag,
|
||||||
|
'NextPrestTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
section.appendChild(StatsListing('withTooltip', 'Heavenly Chips (CUR / MAX)', document.createTextNode(`${Beautify(Game.heavenlyChips)} / ${Beautify((possiblePresMax - Game.prestige) + Game.heavenlyChips)}`), 'HeavenChipMaxTooltipPlaceholder'));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'Heavenly Chips (CUR / MAX)',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(Game.heavenlyChips)} / ${Beautify(
|
||||||
|
possiblePresMax - Game.prestige + Game.heavenlyChips,
|
||||||
|
)}`,
|
||||||
|
),
|
||||||
|
'HeavenChipMaxTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
section.appendChild(StatsListing('basic', 'Heavenly Chips Per Second (last 5 seconds)', document.createTextNode(Beautify(CacheHCPerSecond, 2))));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Heavenly Chips Per Second (last 5 seconds)',
|
||||||
|
document.createTextNode(Beautify(CacheHCPerSecond, 2)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const HCTarget = Number(CMOptions.HeavenlyChipsTarget);
|
const HCTarget = Number(CMOptions.HeavenlyChipsTarget);
|
||||||
if (!Number.isNaN(HCTarget)) {
|
if (!Number.isNaN(HCTarget)) {
|
||||||
const CookiesTillTarget = HCTarget - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
const CookiesTillTarget =
|
||||||
|
HCTarget -
|
||||||
|
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||||
if (CookiesTillTarget > 0) {
|
if (CookiesTillTarget > 0) {
|
||||||
section.appendChild(StatsListing('basic', 'Heavenly Chips To Target Set In Settings (CUR)', document.createTextNode(Beautify(CookiesTillTarget))));
|
section.appendChild(
|
||||||
section.appendChild(StatsListing('basic', 'Time To Target (CUR, Current 5 Second Average)', document.createTextNode(FormatTime(CookiesTillTarget / CacheHCPerSecond))));
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Heavenly Chips To Target Set In Settings (CUR)',
|
||||||
|
document.createTextNode(Beautify(CookiesTillTarget)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Time To Target (CUR, Current 5 Second Average)',
|
||||||
|
document.createTextNode(
|
||||||
|
FormatTime(CookiesTillTarget / CacheHCPerSecond),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const resetBonus = ResetBonus(possiblePresMax);
|
const resetBonus = ResetBonus(possiblePresMax);
|
||||||
const resetFrag = document.createDocumentFragment();
|
const resetFrag = document.createDocumentFragment();
|
||||||
resetFrag.appendChild(document.createTextNode(Beautify(resetBonus)));
|
resetFrag.appendChild(document.createTextNode(Beautify(resetBonus)));
|
||||||
const increase = Math.round(resetBonus / Game.cookiesPs * 10000);
|
const increase = Math.round((resetBonus / Game.cookiesPs) * 10000);
|
||||||
if (Number.isFinite(increase) && increase !== 0) {
|
if (Number.isFinite(increase) && increase !== 0) {
|
||||||
const resetSmall = document.createElement('small');
|
const resetSmall = document.createElement('small');
|
||||||
resetSmall.textContent = ` (${increase / 100}% of income)`;
|
resetSmall.textContent = ` (${increase / 100}% of income)`;
|
||||||
resetFrag.appendChild(resetSmall);
|
resetFrag.appendChild(resetSmall);
|
||||||
}
|
}
|
||||||
section.appendChild(StatsListing('withTooltip', 'Reset Bonus Income', resetFrag, 'ResetTooltipPlaceholder'));
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'Reset Bonus Income',
|
||||||
|
resetFrag,
|
||||||
|
'ResetTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const currentPrestige = Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
|
const currentPrestige = Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
|
||||||
const willHave = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
const willHave = Math.floor(
|
||||||
|
Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned),
|
||||||
|
);
|
||||||
const willGet = willHave - currentPrestige;
|
const willGet = willHave - currentPrestige;
|
||||||
if (!Game.Has('Lucky digit')) {
|
if (!Game.Has('Lucky digit')) {
|
||||||
let delta7 = 7 - (willHave % 10);
|
let delta7 = 7 - (willHave % 10);
|
||||||
@@ -321,8 +700,14 @@ export function PrestigeSection() {
|
|||||||
const next7Reset = willGet + delta7;
|
const next7Reset = willGet + delta7;
|
||||||
const next7Total = willHave + delta7;
|
const next7Total = willHave + delta7;
|
||||||
const frag7 = document.createDocumentFragment();
|
const frag7 = document.createDocumentFragment();
|
||||||
frag7.appendChild(document.createTextNode(`${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`));
|
frag7.appendChild(
|
||||||
section.appendChild(StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7));
|
document.createTextNode(
|
||||||
|
`${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Game.Has('Lucky number')) {
|
if (!Game.Has('Lucky number')) {
|
||||||
@@ -331,8 +716,14 @@ export function PrestigeSection() {
|
|||||||
const next777Reset = willGet + delta777;
|
const next777Reset = willGet + delta777;
|
||||||
const next777Total = willHave + delta777;
|
const next777Total = willHave + delta777;
|
||||||
const frag777 = document.createDocumentFragment();
|
const frag777 = document.createDocumentFragment();
|
||||||
frag777.appendChild(document.createTextNode(`${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`));
|
frag777.appendChild(
|
||||||
section.appendChild(StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777));
|
document.createTextNode(
|
||||||
|
`${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Game.Has('Lucky payout')) {
|
if (!Game.Has('Lucky payout')) {
|
||||||
@@ -341,9 +732,257 @@ export function PrestigeSection() {
|
|||||||
const next777777Reset = willGet + delta777777;
|
const next777777Reset = willGet + delta777777;
|
||||||
const next777777Total = willHave + delta777777;
|
const next777777Total = willHave + delta777777;
|
||||||
const frag777777 = document.createDocumentFragment();
|
const frag777777 = document.createDocumentFragment();
|
||||||
frag777777.appendChild(document.createTextNode(`${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`));
|
frag777777.appendChild(
|
||||||
section.appendChild(StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777));
|
document.createTextNode(
|
||||||
|
`${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function creates the "Season Specials" section of the stats page
|
||||||
|
* @returns {object} section The object contating the Season Specials section
|
||||||
|
*/
|
||||||
|
export function SeasonSection() {
|
||||||
|
const section = document.createElement('div');
|
||||||
|
section.className = 'CMStatsSeasonSection';
|
||||||
|
|
||||||
|
let specDisp = false;
|
||||||
|
const missingHalloweenCookies = [];
|
||||||
|
Object.keys(GameData.HalloCookies).forEach((i) => {
|
||||||
|
if (!Game.Has(GameData.HalloCookies[i])) {
|
||||||
|
missingHalloweenCookies.push(GameData.HalloCookies[i]);
|
||||||
|
specDisp = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const missingChristmasCookies = [];
|
||||||
|
Object.keys(GameData.ChristCookies).forEach((i) => {
|
||||||
|
if (!Game.Has(GameData.ChristCookies[i])) {
|
||||||
|
missingChristmasCookies.push(GameData.ChristCookies[i]);
|
||||||
|
specDisp = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const missingValentineCookies = [];
|
||||||
|
Object.keys(GameData.ValCookies).forEach((i) => {
|
||||||
|
if (!Game.Has(GameData.ValCookies[i])) {
|
||||||
|
missingValentineCookies.push(GameData.ValCookies[i]);
|
||||||
|
specDisp = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const missingNormalEggs = [];
|
||||||
|
Object.keys(Game.eggDrops).forEach((i) => {
|
||||||
|
if (!Game.HasUnlocked(Game.eggDrops[i])) {
|
||||||
|
missingNormalEggs.push(Game.eggDrops[i]);
|
||||||
|
specDisp = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const missingRareEggs = [];
|
||||||
|
Object.keys(Game.rareEggDrops).forEach((i) => {
|
||||||
|
if (!Game.HasUnlocked(Game.rareEggDrops[i])) {
|
||||||
|
missingRareEggs.push(Game.rareEggDrops[i]);
|
||||||
|
specDisp = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const missingPlantDrops = [];
|
||||||
|
Object.keys(GameData.PlantDrops).forEach((i) => {
|
||||||
|
if (!Game.HasUnlocked(GameData.PlantDrops[i])) {
|
||||||
|
missingPlantDrops.push(GameData.PlantDrops[i]);
|
||||||
|
specDisp = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const choEgg =
|
||||||
|
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
||||||
|
const centEgg = Game.Has('Century egg');
|
||||||
|
|
||||||
|
if (Game.season === 'christmas' || specDisp || choEgg || centEgg) {
|
||||||
|
section.appendChild(StatsHeader('Season Specials', 'Sea'));
|
||||||
|
if (CMOptions.Header.Sea) {
|
||||||
|
if (missingHalloweenCookies.length !== 0) {
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Halloween cookies left to buy',
|
||||||
|
StatsMissDisp(missingHalloweenCookies),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
let failRateHalloween = 0.95;
|
||||||
|
if (Game.HasAchiev('Spooky cookies')) failRateHalloween = 0.8;
|
||||||
|
if (Game.Has('Starterror')) failRateHalloween *= 0.9;
|
||||||
|
failRateHalloween *= 1 / Game.dropRateMult();
|
||||||
|
if (Game.hasGod) {
|
||||||
|
const godLvl = Game.hasGod('seasons');
|
||||||
|
if (godLvl === 1) failRateHalloween *= 0.9;
|
||||||
|
else if (godLvl === 2) failRateHalloween *= 0.95;
|
||||||
|
else if (godLvl === 3) failRateHalloween *= 0.97;
|
||||||
|
}
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Chance of receiving a cookie from wrinkler/shiny wrinkler',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify((1 - failRateHalloween) * 100)}% / ${Beautify(
|
||||||
|
(1 - failRateHalloween * 0.9) * 100,
|
||||||
|
)}%`,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (missingChristmasCookies.length !== 0) {
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Christmas cookies left to buy',
|
||||||
|
StatsMissDisp(missingChristmasCookies),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
let failRateChristmas = 0.8;
|
||||||
|
if (Game.HasAchiev('Let it snow')) failRateChristmas = 0.6;
|
||||||
|
failRateChristmas *= 1 / Game.dropRateMult();
|
||||||
|
if (Game.Has('Starsnow')) failRateChristmas *= 0.95;
|
||||||
|
if (Game.hasGod) {
|
||||||
|
const godLvl = Game.hasGod('seasons');
|
||||||
|
if (godLvl === 1) failRateChristmas *= 0.9;
|
||||||
|
else if (godLvl === 2) failRateChristmas *= 0.95;
|
||||||
|
else if (godLvl === 3) failRateChristmas *= 0.97;
|
||||||
|
}
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Chance of receiving a cookie from reindeer',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify((1 - failRateChristmas) * 100)}%`,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (missingValentineCookies.length !== 0) {
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Valentine cookies left to buy',
|
||||||
|
StatsMissDisp(missingValentineCookies),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const dropRateEgg = function (StartingFailRate) {
|
||||||
|
let failRateEgg = StartingFailRate * (1 / Game.dropRateMult());
|
||||||
|
if (Game.HasAchiev('Hide & seek champion')) failRateEgg *= 0.7;
|
||||||
|
if (Game.Has('Omelette')) failRateEgg *= 0.9;
|
||||||
|
if (Game.Has('Starspawn')) failRateEgg *= 0.9;
|
||||||
|
if (Game.hasGod) {
|
||||||
|
const godLvl = Game.hasGod('seasons');
|
||||||
|
if (godLvl === 1) failRateEgg *= 0.9;
|
||||||
|
else if (godLvl === 2) failRateEgg *= 0.95;
|
||||||
|
else if (godLvl === 3) failRateEgg *= 0.97;
|
||||||
|
}
|
||||||
|
// Calculations courtesy of @svschouw, at https://github.com/Aktanusa/CookieMonster/issues/25
|
||||||
|
const succesRateEgg = 1 - failRateEgg;
|
||||||
|
const obtainedEggs = Game.eggDrops.length - missingNormalEggs.length;
|
||||||
|
const obtainedRareEggs =
|
||||||
|
Game.rareEggDrops.length - missingRareEggs.length;
|
||||||
|
const pNormal1 =
|
||||||
|
succesRateEgg * 0.9 * (1 - obtainedEggs / Game.eggDrops.length);
|
||||||
|
const pRare1 =
|
||||||
|
succesRateEgg *
|
||||||
|
0.1 *
|
||||||
|
(1 - obtainedRareEggs / Game.rareEggDrops.length);
|
||||||
|
const pRedropNormal =
|
||||||
|
succesRateEgg * 0.9 * (obtainedEggs / Game.eggDrops.length);
|
||||||
|
const pRedropRare =
|
||||||
|
succesRateEgg * 0.1 * (obtainedRareEggs / Game.rareEggDrops.length);
|
||||||
|
const pRedrop = pRedropNormal + pRedropRare;
|
||||||
|
const pNormal2 =
|
||||||
|
pRedrop * 0.9 * (1 - obtainedEggs / Game.eggDrops.length);
|
||||||
|
const pRare2 =
|
||||||
|
pRedrop * 0.1 * (1 - obtainedRareEggs / Game.rareEggDrops.length);
|
||||||
|
return [pNormal1 + pNormal2, pRare1 + pRare2];
|
||||||
|
};
|
||||||
|
if (missingNormalEggs.length !== 0) {
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Normal easter eggs left to unlock',
|
||||||
|
StatsMissDisp(missingNormalEggs),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Chance of receiving an egg from wrinkler/golden cookie',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(dropRateEgg(0.98)[0] * 100)}% / ${Beautify(
|
||||||
|
dropRateEgg(0.9)[0] * 100,
|
||||||
|
)}%`,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (missingRareEggs.length !== 0) {
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Rare easter eggs left to unlock',
|
||||||
|
StatsMissDisp(missingRareEggs),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Chance of receiving a rare egg from wrinkler/golden cookie',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Beautify(dropRateEgg(0.98)[1] * 100)}% / ${Beautify(
|
||||||
|
dropRateEgg(0.9)[1] * 100,
|
||||||
|
)}%`,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (missingPlantDrops.length !== 0) {
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Rare plant drops left to unlock',
|
||||||
|
StatsMissDisp(missingPlantDrops),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Game.season === 'christmas')
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Reindeer reward',
|
||||||
|
document.createTextNode(Beautify(CacheSeaSpec)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (choEgg) {
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'withTooltip',
|
||||||
|
'Chocolate egg cookies',
|
||||||
|
document.createTextNode(Beautify(CacheLastChoEgg)),
|
||||||
|
'ChoEggTooltipPlaceholder',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (centEgg) {
|
||||||
|
section.appendChild(
|
||||||
|
StatsListing(
|
||||||
|
'basic',
|
||||||
|
'Century egg multiplier',
|
||||||
|
document.createTextNode(
|
||||||
|
`${Math.round((CacheCentEgg - 1) * 10000) / 100}%`,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return section;
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ export default function AddMenuInfo(title) {
|
|||||||
span.style.fontSize = '13px';
|
span.style.fontSize = '13px';
|
||||||
span.style.verticalAlign = 'middle';
|
span.style.verticalAlign = 'middle';
|
||||||
span.textContent = CMOptions.Header.InfoTab ? '-' : '+';
|
span.textContent = CMOptions.Header.InfoTab ? '-' : '+';
|
||||||
span.onclick = function () { ToggleHeader('InfoTab'); Game.UpdateMenu(); };
|
span.onclick = function () {
|
||||||
|
ToggleHeader('InfoTab');
|
||||||
|
Game.UpdateMenu();
|
||||||
|
};
|
||||||
title.appendChild(span);
|
title.appendChild(span);
|
||||||
info.appendChild(title);
|
info.appendChild(title);
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,11 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
|||||||
* It is called by CM.Disp.Draw()
|
* It is called by CM.Disp.Draw()
|
||||||
*/
|
*/
|
||||||
export default function RefreshMenu() {
|
export default function RefreshMenu() {
|
||||||
if (CMOptions.UpStats && Game.onMenu === 'stats' && (Game.drawT - 1) % (Game.fps * 5) !== 0 && (Game.drawT - 1) % Game.fps === 0) Game.UpdateMenu();
|
if (
|
||||||
|
CMOptions.UpStats &&
|
||||||
|
Game.onMenu === 'stats' &&
|
||||||
|
(Game.drawT - 1) % (Game.fps * 5) !== 0 &&
|
||||||
|
(Game.drawT - 1) % Game.fps === 0
|
||||||
|
)
|
||||||
|
Game.UpdateMenu();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,26 @@
|
|||||||
/** Functions related to the Options/Preferences page */
|
/** Functions related to the Options/Preferences page */
|
||||||
|
|
||||||
import jscolor, * as JsColor from '@eastdesire/jscolor';
|
import jscolor, * as JsColor from '@eastdesire/jscolor';
|
||||||
import { LoadConfig, SaveConfig } from '../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
|
||||||
import {
|
import {
|
||||||
ConfigPrefix, ToggleConfig, ToggleConfigVolume, ToggleHeader,
|
LoadConfig,
|
||||||
|
SaveConfig,
|
||||||
|
} from '../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||||
|
import {
|
||||||
|
ConfigPrefix,
|
||||||
|
ToggleConfig,
|
||||||
|
ToggleConfigVolume,
|
||||||
|
ToggleHeader,
|
||||||
} from '../../Config/ToggleSetting';
|
} from '../../Config/ToggleSetting';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { ConfigGroups, ConfigGroupsNotification } from '../../Data/Sectionheaders';
|
import {
|
||||||
|
ConfigGroups,
|
||||||
|
ConfigGroupsNotification,
|
||||||
|
} from '../../Data/Sectionheaders';
|
||||||
import Config from '../../Data/SettingsData';
|
import Config from '../../Data/SettingsData';
|
||||||
import ConfigDefault from '../../Data/SettingsDefault';
|
import ConfigDefault from '../../Data/SettingsDefault';
|
||||||
import RefreshScale from '../HelperFunctions/RefreshScale';
|
import RefreshScale from '../HelperFunctions/RefreshScale';
|
||||||
import UpdateColors from '../HelperFunctions/UpdateColors';
|
import UpdateColors from '../HelperFunctions/UpdateColors';
|
||||||
|
import PlaySound from '../Notifications/Sound';
|
||||||
import { Colors } from '../VariablesAndData';
|
import { Colors } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +48,10 @@ function CreatePrefHeader(config, text) {
|
|||||||
span.style.fontSize = '13px';
|
span.style.fontSize = '13px';
|
||||||
span.style.verticalAlign = 'middle';
|
span.style.verticalAlign = 'middle';
|
||||||
span.textContent = CMOptions.Header[config] ? '-' : '+';
|
span.textContent = CMOptions.Header[config] ? '-' : '+';
|
||||||
span.onclick = function () { ToggleHeader(config); Game.UpdateMenu(); };
|
span.onclick = function () {
|
||||||
|
ToggleHeader(config);
|
||||||
|
Game.UpdateMenu();
|
||||||
|
};
|
||||||
div.appendChild(span);
|
div.appendChild(span);
|
||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
@@ -59,14 +72,17 @@ function CreatePrefOption(config) {
|
|||||||
a.className = 'option';
|
a.className = 'option';
|
||||||
}
|
}
|
||||||
a.id = ConfigPrefix + config;
|
a.id = ConfigPrefix + config;
|
||||||
a.onclick = function () { ToggleConfig(config); };
|
a.onclick = function () {
|
||||||
|
ToggleConfig(config);
|
||||||
|
};
|
||||||
a.textContent = Config[config].label[CMOptions[config]];
|
a.textContent = Config[config].label[CMOptions[config]];
|
||||||
div.appendChild(a);
|
div.appendChild(a);
|
||||||
const label = document.createElement('label');
|
const label = document.createElement('label');
|
||||||
label.textContent = Config[config].desc;
|
label.textContent = Config[config].desc;
|
||||||
div.appendChild(label);
|
div.appendChild(label);
|
||||||
return div;
|
return div;
|
||||||
} if (Config[config].type === 'vol') {
|
}
|
||||||
|
if (Config[config].type === 'vol') {
|
||||||
const volume = document.createElement('div');
|
const volume = document.createElement('div');
|
||||||
volume.className = 'sliderBox';
|
volume.className = 'sliderBox';
|
||||||
const title = document.createElement('div');
|
const title = document.createElement('div');
|
||||||
@@ -87,12 +103,29 @@ function CreatePrefOption(config) {
|
|||||||
slider.max = '100';
|
slider.max = '100';
|
||||||
slider.step = '1';
|
slider.step = '1';
|
||||||
slider.value = CMOptions[config];
|
slider.value = CMOptions[config];
|
||||||
slider.oninput = function () { ToggleConfigVolume(config); };
|
slider.oninput = function () {
|
||||||
slider.onchange = function () { ToggleConfigVolume(config); };
|
ToggleConfigVolume(config);
|
||||||
|
};
|
||||||
|
slider.onchange = function () {
|
||||||
|
ToggleConfigVolume(config);
|
||||||
|
};
|
||||||
volume.appendChild(slider);
|
volume.appendChild(slider);
|
||||||
div.appendChild(volume);
|
div.appendChild(volume);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.className = 'option';
|
||||||
|
a.onclick = function () {
|
||||||
|
PlaySound(
|
||||||
|
CMOptions[config.replace('Volume', 'SoundURL')],
|
||||||
|
config.replace('Volume', 'Sound'),
|
||||||
|
config,
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
a.textContent = 'Test sound';
|
||||||
|
div.appendChild(a);
|
||||||
return div;
|
return div;
|
||||||
} if (Config[config].type === 'url') {
|
}
|
||||||
|
if (Config[config].type === 'url') {
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
span.className = 'option';
|
span.className = 'option';
|
||||||
span.textContent = `${Config[config].label} `;
|
span.textContent = `${Config[config].label} `;
|
||||||
@@ -114,7 +147,18 @@ function CreatePrefOption(config) {
|
|||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.className = 'option';
|
a.className = 'option';
|
||||||
a.onclick = function () {
|
a.onclick = function () {
|
||||||
Game.Prompt(inputPrompt.outerHTML, [['Save', function () { CMOptions[`${config}`] = l(`${ConfigPrefix}${config}Prompt`).value; SaveConfig(); Game.ClosePrompt(); Game.UpdateMenu(); }], 'Cancel']);
|
Game.Prompt(inputPrompt.outerHTML, [
|
||||||
|
[
|
||||||
|
'Save',
|
||||||
|
function () {
|
||||||
|
CMOptions[`${config}`] = l(`${ConfigPrefix}${config}Prompt`).value;
|
||||||
|
SaveConfig();
|
||||||
|
Game.ClosePrompt();
|
||||||
|
Game.UpdateMenu();
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'Cancel',
|
||||||
|
]);
|
||||||
};
|
};
|
||||||
a.textContent = 'Edit';
|
a.textContent = 'Edit';
|
||||||
div.appendChild(a);
|
div.appendChild(a);
|
||||||
@@ -122,7 +166,8 @@ function CreatePrefOption(config) {
|
|||||||
label.textContent = Config[config].desc;
|
label.textContent = Config[config].desc;
|
||||||
div.appendChild(label);
|
div.appendChild(label);
|
||||||
return div;
|
return div;
|
||||||
} if (Config[config].type === 'color') {
|
}
|
||||||
|
if (Config[config].type === 'color') {
|
||||||
div.className = '';
|
div.className = '';
|
||||||
for (let i = 0; i < Colors.length; i++) {
|
for (let i = 0; i < Colors.length; i++) {
|
||||||
const innerDiv = document.createElement('div');
|
const innerDiv = document.createElement('div');
|
||||||
@@ -138,6 +183,7 @@ function CreatePrefOption(config) {
|
|||||||
SaveConfig();
|
SaveConfig();
|
||||||
Game.UpdateMenu();
|
Game.UpdateMenu();
|
||||||
};
|
};
|
||||||
|
// eslint-disable-next-line no-new
|
||||||
new JsColor(input, { hash: true, position: 'right', onInput: change });
|
new JsColor(input, { hash: true, position: 'right', onInput: change });
|
||||||
const label = document.createElement('label');
|
const label = document.createElement('label');
|
||||||
label.textContent = Config.Colors.desc[Colors[i]];
|
label.textContent = Config.Colors.desc[Colors[i]];
|
||||||
@@ -146,7 +192,8 @@ function CreatePrefOption(config) {
|
|||||||
}
|
}
|
||||||
jscolor.init();
|
jscolor.init();
|
||||||
return div;
|
return div;
|
||||||
} if (Config[config].type === 'numscale') {
|
}
|
||||||
|
if (Config[config].type === 'numscale') {
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
span.className = 'option';
|
span.className = 'option';
|
||||||
span.textContent = `${Config[config].label} `;
|
span.textContent = `${Config[config].label} `;
|
||||||
@@ -155,7 +202,7 @@ function CreatePrefOption(config) {
|
|||||||
input.id = ConfigPrefix + config;
|
input.id = ConfigPrefix + config;
|
||||||
input.className = 'option';
|
input.className = 'option';
|
||||||
input.type = 'number';
|
input.type = 'number';
|
||||||
input.value = (CMOptions[config]);
|
input.value = CMOptions[config];
|
||||||
input.min = Config[config].min;
|
input.min = Config[config].min;
|
||||||
input.max = Config[config].max;
|
input.max = Config[config].max;
|
||||||
input.oninput = function () {
|
input.oninput = function () {
|
||||||
@@ -183,39 +230,52 @@ export default function AddMenuPref(title) {
|
|||||||
const frag = document.createDocumentFragment();
|
const frag = document.createDocumentFragment();
|
||||||
frag.appendChild(title);
|
frag.appendChild(title);
|
||||||
|
|
||||||
for (const group of Object.keys(ConfigGroups)) {
|
Object.keys(ConfigGroups).forEach((group) => {
|
||||||
const groupObject = CreatePrefHeader(group, ConfigGroups[group]); // (group, display-name of group)
|
const groupObject = CreatePrefHeader(group, ConfigGroups[group]); // (group, display-name of group)
|
||||||
frag.appendChild(groupObject);
|
frag.appendChild(groupObject);
|
||||||
if (CMOptions.Header[group]) { // 0 is show, 1 is collapsed
|
if (CMOptions.Header[group]) {
|
||||||
|
// 0 is show, 1 is collapsed
|
||||||
// Make sub-sections of Notification section
|
// Make sub-sections of Notification section
|
||||||
if (group === 'Notification') {
|
if (group === 'Notification') {
|
||||||
for (const subGroup of Object.keys(ConfigGroupsNotification)) {
|
Object.keys(ConfigGroupsNotification).forEach((subGroup) => {
|
||||||
const subGroupObject = CreatePrefHeader(subGroup, ConfigGroupsNotification[subGroup]); // (group, display-name of group)
|
const subGroupObject = CreatePrefHeader(
|
||||||
|
subGroup,
|
||||||
|
ConfigGroupsNotification[subGroup],
|
||||||
|
); // (group, display-name of group)
|
||||||
subGroupObject.style.fontSize = '15px';
|
subGroupObject.style.fontSize = '15px';
|
||||||
subGroupObject.style.opacity = '0.5';
|
subGroupObject.style.opacity = '0.5';
|
||||||
frag.appendChild(subGroupObject);
|
frag.appendChild(subGroupObject);
|
||||||
if (CMOptions.Header[subGroup]) {
|
if (CMOptions.Header[subGroup]) {
|
||||||
for (const option in Config) {
|
Object.keys(Config).forEach((option) => {
|
||||||
if (Config[option].group === subGroup) frag.appendChild(CreatePrefOption(option));
|
if (Config[option].group === subGroup)
|
||||||
}
|
frag.appendChild(CreatePrefOption(option));
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
for (const option of Object.keys(Config)) {
|
Object.keys(Config).forEach((option) => {
|
||||||
if (Config[option].group === group) frag.appendChild(CreatePrefOption(option));
|
if (Config[option].group === group)
|
||||||
}
|
frag.appendChild(CreatePrefOption(option));
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const resDef = document.createElement('div');
|
const resDef = document.createElement('div');
|
||||||
resDef.className = 'listing';
|
resDef.className = 'listing';
|
||||||
const resDefBut = document.createElement('a');
|
const resDefBut = document.createElement('a');
|
||||||
resDefBut.className = 'option';
|
resDefBut.className = 'option';
|
||||||
resDefBut.onclick = function () { LoadConfig(ConfigDefault); };
|
resDefBut.onclick = function () {
|
||||||
|
LoadConfig(ConfigDefault);
|
||||||
|
};
|
||||||
resDefBut.textContent = 'Restore Default';
|
resDefBut.textContent = 'Restore Default';
|
||||||
resDef.appendChild(resDefBut);
|
resDef.appendChild(resDefBut);
|
||||||
frag.appendChild(resDef);
|
frag.appendChild(resDef);
|
||||||
|
|
||||||
l('menu').childNodes[2].insertBefore(frag, l('menu').childNodes[2].childNodes[l('menu').childNodes[2].childNodes.length - 1]);
|
l('menu').childNodes[2].insertBefore(
|
||||||
|
frag,
|
||||||
|
l('menu').childNodes[2].childNodes[
|
||||||
|
l('menu').childNodes[2].childNodes.length - 1
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,16 +10,25 @@ import { isInitializing } from '../../InitSaveLoad/Variables';
|
|||||||
*/
|
*/
|
||||||
export default function Flash(mode, config) {
|
export default function Flash(mode, config) {
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
// The arguments check makes the sound not play upon initialization of the mod
|
||||||
if ((CMOptions[config] === 1 && mode === 3 && isInitializing === false) || mode === 1) {
|
if (
|
||||||
|
(CMOptions[config] === 1 && mode === 3 && isInitializing === false) ||
|
||||||
|
mode === 1
|
||||||
|
) {
|
||||||
l('CMWhiteScreen').style.opacity = '0.5';
|
l('CMWhiteScreen').style.opacity = '0.5';
|
||||||
if (mode === 3) {
|
if (mode === 3) {
|
||||||
l('CMWhiteScreen').style.display = 'inline';
|
l('CMWhiteScreen').style.display = 'inline';
|
||||||
setTimeout(function () { Flash(2, config); }, 1000 / Game.fps);
|
setTimeout(function () {
|
||||||
|
Flash(2, config);
|
||||||
|
}, 1000 / Game.fps);
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function () { Flash(0, config); }, 1000 / Game.fps);
|
setTimeout(function () {
|
||||||
|
Flash(0, config);
|
||||||
|
}, 1000 / Game.fps);
|
||||||
}
|
}
|
||||||
} else if (mode === 2) {
|
} else if (mode === 2) {
|
||||||
l('CMWhiteScreen').style.opacity = '1';
|
l('CMWhiteScreen').style.opacity = '1';
|
||||||
setTimeout(function () { Flash(1, config); }, 1000 / Game.fps);
|
setTimeout(function () {
|
||||||
|
Flash(1, config);
|
||||||
|
}, 1000 / Game.fps);
|
||||||
} else if (mode === 0) l('CMWhiteScreen').style.display = 'none';
|
} else if (mode === 0) l('CMWhiteScreen').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,10 +10,15 @@ import { isInitializing } from '../../InitSaveLoad/Variables';
|
|||||||
* @param {string} title The title of the to-be created notifications
|
* @param {string} title The title of the to-be created notifications
|
||||||
* @param {string} message The text of the to-be created notifications
|
* @param {string} message The text of the to-be created notifications
|
||||||
*/
|
*/
|
||||||
export default function Notification(notifyConfig, title, message) {
|
export default function CreateNotification(notifyConfig, title, message) {
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
// The arguments check makes the sound not play upon initialization of the mod
|
||||||
if (CMOptions[notifyConfig] === 1 && document.visibilityState === 'hidden' && isInitializing === false) {
|
if (
|
||||||
|
CMOptions[notifyConfig] === 1 &&
|
||||||
|
document.visibilityState === 'hidden' &&
|
||||||
|
isInitializing === false
|
||||||
|
) {
|
||||||
const CookieIcon = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
const CookieIcon = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
||||||
|
// eslint-disable-next-line no-new
|
||||||
new Notification(title, { body: message, badge: CookieIcon });
|
new Notification(title, { body: message, badge: CookieIcon });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,14 +7,16 @@ import { isInitializing } from '../../InitSaveLoad/Variables';
|
|||||||
* @param {variable} url A variable that gives the url for the sound (e.g., CM.Options.GCSoundURL)
|
* @param {variable} url A variable that gives the url for the sound (e.g., CM.Options.GCSoundURL)
|
||||||
* @param {string} sndConfig The setting in CM.Options that is checked before creating the sound
|
* @param {string} sndConfig The setting in CM.Options that is checked before creating the sound
|
||||||
* @param {string} volConfig The setting in CM.Options that is checked to determine volume
|
* @param {string} volConfig The setting in CM.Options that is checked to determine volume
|
||||||
|
* @param {bool} forced Whether the sound should play regardless of settings, used to test the sound
|
||||||
*/
|
*/
|
||||||
export default function PlaySound(url, sndConfig, volConfig) {
|
export default function PlaySound(url, sndConfig, volConfig, forced) {
|
||||||
// The arguments check makes the sound not play upon initialization of the mod
|
// The arguments check makes the sound not play upon initialization of the mod
|
||||||
if (CMOptions[sndConfig] === 1 && isInitializing === false) {
|
if ((CMOptions[sndConfig] === 1 || forced) && isInitializing === false) {
|
||||||
// eslint-disable-next-line new-cap
|
// eslint-disable-next-line new-cap
|
||||||
const sound = new realAudio(url);
|
const sound = new Audio(url);
|
||||||
if (CMOptions.GeneralSound) sound.volume = (CMOptions[volConfig] / 100) * (Game.volume / 100);
|
if (CMOptions.GeneralSound)
|
||||||
else sound.volume = (CMOptions[volConfig] / 100);
|
sound.volume = (CMOptions[volConfig] / 100) * (Game.volume / 100);
|
||||||
|
else sound.volume = CMOptions[volConfig] / 100;
|
||||||
sound.play();
|
sound.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,13 @@ export function CreateFavicon() {
|
|||||||
*/
|
*/
|
||||||
export function UpdateFavicon() {
|
export function UpdateFavicon() {
|
||||||
if (CMOptions.Favicon === 1 && LastGoldenCookieState > 0) {
|
if (CMOptions.Favicon === 1 && LastGoldenCookieState > 0) {
|
||||||
if (CacheSpawnedGoldenShimmer.wrath) l('CMFavicon').href = 'https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico';
|
if (CacheSpawnedGoldenShimmer.wrath)
|
||||||
else l('CMFavicon').href = 'https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico';
|
l('CMFavicon').href =
|
||||||
} else l('CMFavicon').href = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
'https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico';
|
||||||
|
else
|
||||||
|
l('CMFavicon').href =
|
||||||
|
'https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico';
|
||||||
|
} else
|
||||||
|
l('CMFavicon').href =
|
||||||
|
'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
/** 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';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData';
|
import {
|
||||||
|
LastSeasonPopupState,
|
||||||
|
LastTickerFortuneState,
|
||||||
|
} from '../../Main/VariablesAndData';
|
||||||
import { Title } from '../VariablesAndData';
|
import { Title } from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,10 +26,17 @@ export default function UpdateTitle() {
|
|||||||
let titleSP;
|
let titleSP;
|
||||||
|
|
||||||
if (CacheSpawnedGoldenShimmer) {
|
if (CacheSpawnedGoldenShimmer) {
|
||||||
if (CacheSpawnedGoldenShimmer.wrath) titleGC = `[W${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
if (CacheSpawnedGoldenShimmer.wrath)
|
||||||
else titleGC = `[G${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
titleGC = `[W${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
||||||
|
else
|
||||||
|
titleGC = `[G${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
||||||
} else if (!Game.Has('Golden switch [off]')) {
|
} else if (!Game.Has('Golden switch [off]')) {
|
||||||
titleGC = `[${Number(l('CMTimerBarGCMinBar').textContent) < 0 ? '!' : ''}${Math.ceil((Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps)}]`;
|
titleGC = `[${
|
||||||
|
Number(l('CMTimerBarGCMinBar').textContent) < 0 ? '!' : ''
|
||||||
|
}${Math.ceil(
|
||||||
|
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) /
|
||||||
|
Game.fps,
|
||||||
|
)}]`;
|
||||||
} else titleGC = '[GS]';
|
} else titleGC = '[GS]';
|
||||||
|
|
||||||
if (LastTickerFortuneState) {
|
if (LastTickerFortuneState) {
|
||||||
@@ -33,9 +46,16 @@ export default function UpdateTitle() {
|
|||||||
|
|
||||||
if (Game.season === 'christmas') {
|
if (Game.season === 'christmas') {
|
||||||
addSP = true;
|
addSP = true;
|
||||||
if (LastSeasonPopupState) titleSP = `[R${Math.ceil(CacheSeasonPopShimmer.life / Game.fps)}]`;
|
if (LastSeasonPopupState)
|
||||||
|
titleSP = `[R${Math.ceil(CacheSeasonPopShimmer.life / Game.fps)}]`;
|
||||||
else {
|
else {
|
||||||
titleSP = `[${Number(l('CMTimerBarRenMinBar').textContent) < 0 ? '!' : ''}${Math.ceil((Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps)}]`;
|
titleSP = `[${
|
||||||
|
Number(l('CMTimerBarRenMinBar').textContent) < 0 ? '!' : ''
|
||||||
|
}${Math.ceil(
|
||||||
|
(Game.shimmerTypes.reindeer.maxTime -
|
||||||
|
Game.shimmerTypes.reindeer.time) /
|
||||||
|
Game.fps,
|
||||||
|
)}]`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,13 +64,16 @@ export default function UpdateTitle() {
|
|||||||
if (str.charAt(0) === '[') {
|
if (str.charAt(0) === '[') {
|
||||||
str = str.substring(str.lastIndexOf(']') + 1);
|
str = str.substring(str.lastIndexOf(']') + 1);
|
||||||
}
|
}
|
||||||
document.title = `${titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '')} ${str}`;
|
document.title = `${
|
||||||
|
titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '')
|
||||||
|
} ${str}`;
|
||||||
} else if (CMOptions.Title === 2) {
|
} else if (CMOptions.Title === 2) {
|
||||||
let str = '';
|
let str = '';
|
||||||
let spawn = false;
|
let spawn = false;
|
||||||
if (CacheSpawnedGoldenShimmer) {
|
if (CacheSpawnedGoldenShimmer) {
|
||||||
spawn = true;
|
spawn = true;
|
||||||
if (CacheSpawnedGoldenShimmer.wrath) str += `[W${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
if (CacheSpawnedGoldenShimmer.wrath)
|
||||||
|
str += `[W${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
||||||
else str += `[G${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
else str += `[G${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
||||||
}
|
}
|
||||||
if (LastTickerFortuneState) {
|
if (LastTickerFortuneState) {
|
||||||
|
|||||||
65
src/Disp/Tooltips/AscendButton.js
Normal file
65
src/Disp/Tooltips/AscendButton.js
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import {
|
||||||
|
CacheHCPerSecond,
|
||||||
|
CacheLastHeavenlyChips,
|
||||||
|
CacheTimeTillNextPrestige,
|
||||||
|
} from '../../Cache/VariablesAndData';
|
||||||
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function creates a header object for tooltips.
|
||||||
|
* @param {string} text Title of header
|
||||||
|
* @returns {object} div An object containing the stylized header
|
||||||
|
*/
|
||||||
|
export default function ReplaceAscendTooltip() {
|
||||||
|
const cookiesToNext = Math.max(
|
||||||
|
0,
|
||||||
|
Game.HowManyCookiesReset(
|
||||||
|
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) +
|
||||||
|
1,
|
||||||
|
) -
|
||||||
|
(Game.cookiesEarned + Game.cookiesReset),
|
||||||
|
);
|
||||||
|
|
||||||
|
const startDate = Game.sayTime(
|
||||||
|
((Date.now() - Game.startDate) / 1000) * Game.fps,
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
let str = '';
|
||||||
|
str += `You've been on this run for <b>${
|
||||||
|
startDate === '' ? 'not very long' : startDate
|
||||||
|
}</b>.<br>`;
|
||||||
|
str += '<div class="line"></div>';
|
||||||
|
if (Game.prestige > 0) {
|
||||||
|
str += `Your prestige level is currently <b>${Beautify(
|
||||||
|
Game.prestige,
|
||||||
|
)}</b>.<br>(CpS +${Beautify(Game.prestige)}%)`;
|
||||||
|
str += '<div class="line"></div>';
|
||||||
|
}
|
||||||
|
if (CacheLastHeavenlyChips < 1)
|
||||||
|
str += 'Ascending now would grant you no prestige.';
|
||||||
|
else if (CacheLastHeavenlyChips < 2)
|
||||||
|
str +=
|
||||||
|
'Ascending now would grant you<br><b>1 prestige level</b> (+1% CpS)<br>and <b>1 heavenly chip</b> to spend.';
|
||||||
|
else
|
||||||
|
str += `Ascending now would grant you<br><b>${Beautify(
|
||||||
|
CacheLastHeavenlyChips,
|
||||||
|
)} prestige levels</b> (+${Beautify(
|
||||||
|
CacheLastHeavenlyChips,
|
||||||
|
)}% CpS)<br>and <b>${Beautify(
|
||||||
|
CacheLastHeavenlyChips,
|
||||||
|
)} heavenly chips</b> to spend.`;
|
||||||
|
str += '<div class="line"></div>';
|
||||||
|
str += `You need <b>${Beautify(
|
||||||
|
cookiesToNext,
|
||||||
|
)} more cookies</b> for the next level.<br>`;
|
||||||
|
str += `${
|
||||||
|
CMOptions.TooltipAscendButton
|
||||||
|
? `<div class='line'></div>It takes ${CacheTimeTillNextPrestige} to reach the next level and you are making ${Beautify(
|
||||||
|
CacheHCPerSecond,
|
||||||
|
2,
|
||||||
|
)} chips on average in the last 5 seconds.<br>`
|
||||||
|
: ''
|
||||||
|
}`;
|
||||||
|
l('ascendTooltip').innerHTML = str;
|
||||||
|
}
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
/* eslint-disable no-param-reassign */
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
ColorTextPre, ColorBorderPre, ColorGray, ColorBlue, ColorRed, ColorYellow, ColorPurple, TooltipType,
|
ColorTextPre,
|
||||||
|
ColorBorderPre,
|
||||||
|
ColorGray,
|
||||||
|
ColorBlue,
|
||||||
|
ColorRed,
|
||||||
|
ColorYellow,
|
||||||
|
ColorPurple,
|
||||||
|
TooltipType,
|
||||||
} from '../VariablesAndData';
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/** Creates various sections of tooltips */
|
/** Creates various sections of tooltips */
|
||||||
@@ -47,7 +55,13 @@ export function TooltipCreateWarningSection() {
|
|||||||
TooltipWarn.style.bottom = 'auto';
|
TooltipWarn.style.bottom = 'auto';
|
||||||
TooltipWarn.id = 'CMDispTooltipWarningParent';
|
TooltipWarn.id = 'CMDispTooltipWarningParent';
|
||||||
|
|
||||||
const create = function (boxId, color, labelTextFront, labelTextBack, deficitId) {
|
const create = function (
|
||||||
|
boxId,
|
||||||
|
color,
|
||||||
|
labelTextFront,
|
||||||
|
labelTextBack,
|
||||||
|
deficitId,
|
||||||
|
) {
|
||||||
const box = document.createElement('div');
|
const box = document.createElement('div');
|
||||||
box.id = boxId;
|
box.id = boxId;
|
||||||
box.style.display = 'none';
|
box.style.display = 'none';
|
||||||
@@ -72,17 +86,65 @@ export function TooltipCreateWarningSection() {
|
|||||||
return box;
|
return box;
|
||||||
};
|
};
|
||||||
|
|
||||||
TooltipWarn.appendChild(create('CMDispTooltipWarnLucky', ColorRed, 'Warning: ', 'Purchase of this item will put you under the number of Cookies required for "Lucky!"', 'CMDispTooltipWarnLuckyText'));
|
TooltipWarn.appendChild(
|
||||||
|
create(
|
||||||
|
'CMDispTooltipWarnLucky',
|
||||||
|
ColorRed,
|
||||||
|
'Warning: ',
|
||||||
|
'Purchase of this item will put you under the number of Cookies required for "Lucky!"',
|
||||||
|
'CMDispTooltipWarnLuckyText',
|
||||||
|
),
|
||||||
|
);
|
||||||
TooltipWarn.firstChild.style.marginBottom = '4px';
|
TooltipWarn.firstChild.style.marginBottom = '4px';
|
||||||
TooltipWarn.appendChild(create('CMDispTooltipWarnLuckyFrenzy', ColorYellow, 'Warning: ', 'Purchase of this item will put you under the number of Cookies required for "Lucky!" (Frenzy)', 'CMDispTooltipWarnLuckyFrenzyText'));
|
TooltipWarn.appendChild(
|
||||||
|
create(
|
||||||
|
'CMDispTooltipWarnLuckyFrenzy',
|
||||||
|
ColorYellow,
|
||||||
|
'Warning: ',
|
||||||
|
'Purchase of this item will put you under the number of Cookies required for "Lucky!" (Frenzy)',
|
||||||
|
'CMDispTooltipWarnLuckyFrenzyText',
|
||||||
|
),
|
||||||
|
);
|
||||||
TooltipWarn.lastChild.style.marginBottom = '4px';
|
TooltipWarn.lastChild.style.marginBottom = '4px';
|
||||||
TooltipWarn.appendChild(create('CMDispTooltipWarnConjure', ColorPurple, 'Warning: ', 'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods"', 'CMDispTooltipWarnConjureText'));
|
TooltipWarn.appendChild(
|
||||||
|
create(
|
||||||
|
'CMDispTooltipWarnConjure',
|
||||||
|
ColorPurple,
|
||||||
|
'Warning: ',
|
||||||
|
'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods"',
|
||||||
|
'CMDispTooltipWarnConjureText',
|
||||||
|
),
|
||||||
|
);
|
||||||
TooltipWarn.lastChild.style.marginBottom = '4px';
|
TooltipWarn.lastChild.style.marginBottom = '4px';
|
||||||
TooltipWarn.appendChild(create('CMDispTooltipWarnConjureFrenzy', ColorPurple, 'Warning: ', 'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods" (Frenzy)', 'CMDispTooltipWarnConjureFrenzyText'));
|
TooltipWarn.appendChild(
|
||||||
|
create(
|
||||||
|
'CMDispTooltipWarnConjureFrenzy',
|
||||||
|
ColorPurple,
|
||||||
|
'Warning: ',
|
||||||
|
'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods" (Frenzy)',
|
||||||
|
'CMDispTooltipWarnConjureFrenzyText',
|
||||||
|
),
|
||||||
|
);
|
||||||
TooltipWarn.lastChild.style.marginBottom = '4px';
|
TooltipWarn.lastChild.style.marginBottom = '4px';
|
||||||
TooltipWarn.appendChild(create('CMDispTooltipWarnEdifice', ColorPurple, 'Warning: ', 'Purchase of this item will put you under the number of Cookies needed for "Spontaneous Edifice" to possibly give you your most expensive building"', 'CMDispTooltipWarnEdificeText'));
|
TooltipWarn.appendChild(
|
||||||
|
create(
|
||||||
|
'CMDispTooltipWarnEdifice',
|
||||||
|
ColorPurple,
|
||||||
|
'Warning: ',
|
||||||
|
'Purchase of this item will put you under the number of Cookies needed for "Spontaneous Edifice" to possibly give you your most expensive building"',
|
||||||
|
'CMDispTooltipWarnEdificeText',
|
||||||
|
),
|
||||||
|
);
|
||||||
TooltipWarn.lastChild.style.marginBottom = '4px';
|
TooltipWarn.lastChild.style.marginBottom = '4px';
|
||||||
TooltipWarn.appendChild(create('CMDispTooltipWarnUser', ColorRed, 'Warning: ', `Purchase of this item will put you under the number of Cookies equal to ${CMOptions.ToolWarnUser} seconds of CPS`, 'CMDispTooltipWarnUserText'));
|
TooltipWarn.appendChild(
|
||||||
|
create(
|
||||||
|
'CMDispTooltipWarnUser',
|
||||||
|
ColorRed,
|
||||||
|
'Warning: ',
|
||||||
|
`Purchase of this item will put you under the number of Cookies equal to ${CMOptions.ToolWarnUser} seconds of CPS`,
|
||||||
|
'CMDispTooltipWarnUserText',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
return TooltipWarn;
|
return TooltipWarn;
|
||||||
}
|
}
|
||||||
@@ -121,7 +183,9 @@ export function TooltipCreateCalculationSection(tooltip) {
|
|||||||
tooltip.appendChild(time);
|
tooltip.appendChild(time);
|
||||||
|
|
||||||
if (TooltipType === 'b') {
|
if (TooltipType === 'b') {
|
||||||
tooltip.appendChild(TooltipCreateHeader('Production left till next achievement'));
|
tooltip.appendChild(
|
||||||
|
TooltipCreateHeader('Production left till next achievement'),
|
||||||
|
);
|
||||||
tooltip.lastChild.id = 'CMTooltipProductionHeader'; // Assign a id in order to hid when no achiev's are left
|
tooltip.lastChild.id = 'CMTooltipProductionHeader'; // Assign a id in order to hid when no achiev's are left
|
||||||
const production = document.createElement('div');
|
const production = document.createElement('div');
|
||||||
production.id = 'CMTooltipProduction';
|
production.id = 'CMTooltipProduction';
|
||||||
|
|||||||
@@ -7,10 +7,21 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
|||||||
export default function UpdateTooltipLocation() {
|
export default function UpdateTooltipLocation() {
|
||||||
if (Game.tooltip.origin === 'store') {
|
if (Game.tooltip.origin === 'store') {
|
||||||
let warnOffset = 0;
|
let warnOffset = 0;
|
||||||
if (CMOptions.ToolWarnLucky === 1 && CMOptions.ToolWarnPos === 1 && l('CMDispTooltipWarningParent') !== null) {
|
if (
|
||||||
|
CMOptions.ToolWarnLucky === 1 &&
|
||||||
|
CMOptions.ToolWarnPos === 1 &&
|
||||||
|
l('CMDispTooltipWarningParent') !== null
|
||||||
|
) {
|
||||||
warnOffset = l('CMDispTooltipWarningParent').clientHeight - 4;
|
warnOffset = l('CMDispTooltipWarningParent').clientHeight - 4;
|
||||||
}
|
}
|
||||||
Game.tooltip.tta.style.top = `${Math.min(parseInt(Game.tooltip.tta.style.top, 10), (l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - warnOffset - 46)}px`;
|
Game.tooltip.tta.style.top = `${Math.min(
|
||||||
|
parseInt(Game.tooltip.tta.style.top, 10),
|
||||||
|
l('game').clientHeight +
|
||||||
|
l('topBar').clientHeight -
|
||||||
|
Game.tooltip.tt.clientHeight -
|
||||||
|
warnOffset -
|
||||||
|
46,
|
||||||
|
)}px`;
|
||||||
}
|
}
|
||||||
// Kept for future possible use if the code changes again
|
// Kept for future possible use if the code changes again
|
||||||
/* else if (!Game.onCrate && !Game.OnAscend && CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 0) {
|
/* else if (!Game.onCrate && !Game.OnAscend && CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 0) {
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import * as UpdateTooltip from './UpdateTooltips';
|
import UpdateTooltips, * as UpdateTooltip from './UpdateTooltips';
|
||||||
import { TooltipCreateTooltipBox } from './CreateTooltip';
|
import { TooltipCreateTooltipBox } from './CreateTooltip';
|
||||||
import { Beautify, GetTimeColor } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import {
|
||||||
|
Beautify,
|
||||||
|
GetTimeColor,
|
||||||
|
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||||
import { TooltipName, TooltipType } from '../VariablesAndData';
|
import {
|
||||||
|
SimpleTooltipElements,
|
||||||
|
TooltipName,
|
||||||
|
TooltipType,
|
||||||
|
} from '../VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||||
|
|
||||||
@@ -27,37 +34,7 @@ export function CreateSimpleTooltip(placeholder, text, minWidth) {
|
|||||||
div.textContent = text;
|
div.textContent = text;
|
||||||
desc.appendChild(div);
|
desc.appendChild(div);
|
||||||
Tooltip.appendChild(desc);
|
Tooltip.appendChild(desc);
|
||||||
}
|
SimpleTooltipElements[placeholder] = Tooltip;
|
||||||
|
|
||||||
/**
|
|
||||||
* This function updates the sections of the tooltips created by CookieMonster
|
|
||||||
*/
|
|
||||||
export function UpdateTooltips() {
|
|
||||||
CopyData();
|
|
||||||
if (l('tooltipAnchor').style.display !== 'none' && l('CMTooltipArea')) {
|
|
||||||
l('CMTooltipArea').innerHTML = '';
|
|
||||||
const tooltipBox = TooltipCreateTooltipBox();
|
|
||||||
l('CMTooltipArea').appendChild(tooltipBox);
|
|
||||||
|
|
||||||
if (TooltipType === 'b') {
|
|
||||||
UpdateTooltip.Building();
|
|
||||||
} else if (TooltipType === 'u') {
|
|
||||||
UpdateTooltip.Upgrade();
|
|
||||||
} else if (TooltipType === 's') {
|
|
||||||
UpdateTooltip.SugarLump();
|
|
||||||
} else if (TooltipType === 'g') {
|
|
||||||
UpdateTooltip.Grimoire();
|
|
||||||
} else if (TooltipType === 'p') {
|
|
||||||
UpdateTooltip.GardenPlots();
|
|
||||||
} else if (TooltipType === 'ha') {
|
|
||||||
UpdateTooltip.HarvestAll();
|
|
||||||
}
|
|
||||||
UpdateTooltip.Warnings();
|
|
||||||
} else if (l('CMTooltipArea') === null) { // Remove warnings if its a basic tooltip
|
|
||||||
if (l('CMDispTooltipWarningParent') !== null) {
|
|
||||||
l('CMDispTooltipWarningParent').remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,16 +45,32 @@ export function UpdateTooltips() {
|
|||||||
* @returns {string} l('tooltip').innerHTML The HTML of the l('tooltip')-object
|
* @returns {string} l('tooltip').innerHTML The HTML of the l('tooltip')-object
|
||||||
*/
|
*/
|
||||||
export function CreateTooltip(type, name) {
|
export function CreateTooltip(type, name) {
|
||||||
if (type === 'b') { // Buildings
|
if (type === 'b') {
|
||||||
|
// Buildings
|
||||||
l('tooltip').innerHTML = Game.Objects[name].tooltip();
|
l('tooltip').innerHTML = Game.Objects[name].tooltip();
|
||||||
// Adds amortization info to the list of info per building
|
// Adds amortization info to the list of info per building
|
||||||
if (CMOptions.TooltipAmor === 1) {
|
if (CMOptions.TooltipAmor === 1) {
|
||||||
const buildPrice = BuildingGetPrice(Game.Objects[name], Game.Objects[name].basePrice, 0, Game.Objects[name].free, Game.Objects[name].amount);
|
const buildPrice = BuildingGetPrice(
|
||||||
|
Game.Objects[name],
|
||||||
|
Game.Objects[name].basePrice,
|
||||||
|
0,
|
||||||
|
Game.Objects[name].free,
|
||||||
|
Game.Objects[name].amount,
|
||||||
|
);
|
||||||
const amortizeAmount = buildPrice - Game.Objects[name].totalCookies;
|
const amortizeAmount = buildPrice - Game.Objects[name].totalCookies;
|
||||||
if (amortizeAmount > 0) {
|
if (amortizeAmount > 0) {
|
||||||
l('tooltip').innerHTML = l('tooltip').innerHTML
|
l('tooltip').innerHTML = l('tooltip')
|
||||||
.split('so far</div>')
|
.innerHTML.split('so far</div>')
|
||||||
.join(`so far<br/>• <b>${Beautify(amortizeAmount)}</b> ${Math.floor(amortizeAmount) === 1 ? 'cookie' : 'cookies'} left to amortize (${GetTimeColor((buildPrice - Game.Objects[name].totalCookies) / (Game.Objects[name].storedTotalCps * Game.globalCpsMult)).text})</div>`);
|
.join(
|
||||||
|
`so far<br/>• <b>${Beautify(amortizeAmount)}</b> ${
|
||||||
|
Math.floor(amortizeAmount) === 1 ? 'cookie' : 'cookies'
|
||||||
|
} left to amortize (${
|
||||||
|
GetTimeColor(
|
||||||
|
(buildPrice - Game.Objects[name].totalCookies) /
|
||||||
|
(Game.Objects[name].storedTotalCps * Game.globalCpsMult),
|
||||||
|
).text
|
||||||
|
})</div>`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Game.buyMode === -1) {
|
if (Game.buyMode === -1) {
|
||||||
@@ -89,18 +82,61 @@ export function CreateTooltip(type, name) {
|
|||||||
*
|
*
|
||||||
* This issue is extensively detailed here: https://github.com/Aktanusa/CookieMonster/issues/359#issuecomment-735658262
|
* This issue is extensively detailed here: https://github.com/Aktanusa/CookieMonster/issues/359#issuecomment-735658262
|
||||||
*/
|
*/
|
||||||
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].bulkPrice)).join(Beautify((Game.Objects[name], Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.buyBulk, 1)));
|
l('tooltip').innerHTML = l('tooltip')
|
||||||
|
.innerHTML.split(Beautify(Game.Objects[name].bulkPrice))
|
||||||
|
.join(
|
||||||
|
Beautify(
|
||||||
|
(Game.Objects[name],
|
||||||
|
Game.Objects[name].basePrice,
|
||||||
|
Game.Objects[name].amount,
|
||||||
|
Game.Objects[name].free,
|
||||||
|
Game.buyBulk,
|
||||||
|
1),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else if (type === 'u') { // Upgrades
|
} else if (type === 'u') {
|
||||||
|
// Upgrades
|
||||||
if (!Game.UpgradesInStore[name]) return '';
|
if (!Game.UpgradesInStore[name]) return '';
|
||||||
l('tooltip').innerHTML = Game.crateTooltip(Game.UpgradesInStore[name], 'store');
|
l('tooltip').innerHTML = Game.crateTooltip(
|
||||||
} else if (type === 's') l('tooltip').innerHTML = Game.lumpTooltip(); // Sugar Lumps
|
Game.UpgradesInStore[name],
|
||||||
else if (type === 'g') l('tooltip').innerHTML = Game.Objects['Wizard tower'].minigame.spellTooltip(name)(); // Grimoire
|
'store',
|
||||||
else if (type === 'p') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(name[0], name[1])(); // Garden plots
|
);
|
||||||
else if (type === 'ha') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)(); // Harvest all button in garden
|
} else if (type === 's') l('tooltip').innerHTML = Game.lumpTooltip();
|
||||||
|
// Sugar Lumps
|
||||||
|
else if (type === 'g')
|
||||||
|
l('tooltip').innerHTML = Game.Objects['Wizard tower'].minigame.spellTooltip(
|
||||||
|
name,
|
||||||
|
)();
|
||||||
|
// Grimoire
|
||||||
|
else if (type === 'p')
|
||||||
|
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(
|
||||||
|
name[0],
|
||||||
|
name[1],
|
||||||
|
)();
|
||||||
|
// Harvest all button in garden
|
||||||
|
else if (type === 'ha')
|
||||||
|
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)();
|
||||||
|
else if (type === 'wb') l('tooltip').innerHTML = '';
|
||||||
|
else if (type === 'pag')
|
||||||
|
l('tooltip').innerHTML = Game.Objects.Temple.minigame.godTooltip(name)();
|
||||||
|
else if (type === 'pas')
|
||||||
|
l('tooltip').innerHTML = Game.Objects.Temple.minigame.slotTooltip(
|
||||||
|
name[0],
|
||||||
|
)();
|
||||||
|
|
||||||
// Adds area for extra tooltip-sections
|
// Adds area for extra tooltip-sections
|
||||||
if ((type === 'b' && Game.buyMode === 1) || type === 'u' || type === 's' || type === 'g' || (type === 'p' && !Game.keys[16]) || type === 'ha') {
|
if (
|
||||||
|
(type === 'b' && Game.buyMode === 1) ||
|
||||||
|
type === 'u' ||
|
||||||
|
type === 's' ||
|
||||||
|
type === 'g' ||
|
||||||
|
(type === 'p' && !Game.keys[16]) ||
|
||||||
|
type === 'ha' ||
|
||||||
|
type === 'wb' ||
|
||||||
|
type === 'pag' ||
|
||||||
|
(type === 'pas' && name[1] !== -1)
|
||||||
|
) {
|
||||||
const area = document.createElement('div');
|
const area = document.createElement('div');
|
||||||
area.id = 'CMTooltipArea';
|
area.id = 'CMTooltipArea';
|
||||||
l('tooltip').appendChild(area);
|
l('tooltip').appendChild(area);
|
||||||
|
|||||||
99
src/Disp/Tooltips/TypesOfTooltips/Building.js
Normal file
99
src/Disp/Tooltips/TypesOfTooltips/Building.js
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
/* eslint-disable no-restricted-syntax */
|
||||||
|
import {
|
||||||
|
CacheObjects1,
|
||||||
|
CacheObjects10,
|
||||||
|
CacheObjects100,
|
||||||
|
} from '../../../Cache/VariablesAndData';
|
||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import { SimObjects } from '../../../Sim/VariablesAndData';
|
||||||
|
import {
|
||||||
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
|
GetTimeColor,
|
||||||
|
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
|
import {
|
||||||
|
ColorTextPre,
|
||||||
|
LastTargetTooltipBuilding,
|
||||||
|
TooltipBonusIncome,
|
||||||
|
TooltipName,
|
||||||
|
TooltipPrice,
|
||||||
|
} from '../../VariablesAndData';
|
||||||
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function adds extra info to the Building tooltips
|
||||||
|
*/
|
||||||
|
export default function Building() {
|
||||||
|
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||||
|
const tooltipBox = l('CMTooltipBorder');
|
||||||
|
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||||
|
|
||||||
|
let target;
|
||||||
|
if (Game.buyMode === 1) {
|
||||||
|
LastTargetTooltipBuilding = target;
|
||||||
|
} else {
|
||||||
|
target = LastTargetTooltipBuilding;
|
||||||
|
}
|
||||||
|
if (Game.buyBulk === 1) target = CacheObjects1;
|
||||||
|
else if (Game.buyBulk === 10) target = CacheObjects10;
|
||||||
|
else if (Game.buyBulk === 100) target = CacheObjects100;
|
||||||
|
|
||||||
|
TooltipPrice = Game.Objects[TooltipName].bulkPrice;
|
||||||
|
TooltipBonusIncome = target[TooltipName].bonus;
|
||||||
|
|
||||||
|
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||||
|
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
||||||
|
const increase = Math.round(
|
||||||
|
(TooltipBonusIncome / Game.cookiesPs) * 10000,
|
||||||
|
);
|
||||||
|
if (Number.isFinite(increase) && increase !== 0) {
|
||||||
|
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
||||||
|
} else {
|
||||||
|
l('CMTooltipIncome').textContent += ` (<0${
|
||||||
|
CMOptions.ScaleSeparator ? ',' : '.'
|
||||||
|
}01% of income)`;
|
||||||
|
}
|
||||||
|
l('CMTooltipBorder').className = ColorTextPre + target[TooltipName].color;
|
||||||
|
if (CMOptions.PPDisplayTime)
|
||||||
|
l('CMTooltipPP').textContent = FormatTime(target[TooltipName].pp);
|
||||||
|
else l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
||||||
|
l('CMTooltipPP').className = ColorTextPre + target[TooltipName].color;
|
||||||
|
const timeColor = GetTimeColor(
|
||||||
|
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
|
);
|
||||||
|
l('CMTooltipTime').textContent = timeColor.text;
|
||||||
|
if (
|
||||||
|
timeColor.text === 'Done!' &&
|
||||||
|
Game.cookies < target[TooltipName].price
|
||||||
|
) {
|
||||||
|
l('CMTooltipTime').textContent = `${timeColor.text} (with Wrink)`;
|
||||||
|
} else l('CMTooltipTime').textContent = timeColor.text;
|
||||||
|
l('CMTooltipTime').className = ColorTextPre + timeColor.color;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add "production left till next achievement"-bar
|
||||||
|
l('CMTooltipProductionHeader').style.display = 'none';
|
||||||
|
l('CMTooltipTime').style.marginBottom = '0px';
|
||||||
|
for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) {
|
||||||
|
if (
|
||||||
|
!Game.HasAchiev(
|
||||||
|
Game.Objects[TooltipName].productionAchievs[i].achiev.name,
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
const nextProductionAchiev =
|
||||||
|
Game.Objects[TooltipName].productionAchievs[i];
|
||||||
|
l('CMTooltipTime').style.marginBottom = '4px';
|
||||||
|
l('CMTooltipProductionHeader').style.display = '';
|
||||||
|
l('CMTooltipProduction').className = `ProdAchievement${TooltipName}`;
|
||||||
|
l('CMTooltipProduction').textContent = Beautify(
|
||||||
|
nextProductionAchiev.pow - SimObjects[TooltipName].totalCookies,
|
||||||
|
15,
|
||||||
|
);
|
||||||
|
l('CMTooltipProduction').style.color = 'white';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
|
}
|
||||||
55
src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js
Normal file
55
src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
import { TooltipName } from '../../VariablesAndData';
|
||||||
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function adds extra info to the Garden plots tooltips
|
||||||
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
|
*/
|
||||||
|
export default function GardenPlots() {
|
||||||
|
const { minigame } = Game.Objects.Farm;
|
||||||
|
if (
|
||||||
|
CMOptions.TooltipPlots &&
|
||||||
|
minigame.plot[TooltipName[1]][TooltipName[0]][0] !== 0
|
||||||
|
) {
|
||||||
|
const mature =
|
||||||
|
minigame.plot[TooltipName[1]][TooltipName[0]][1] >
|
||||||
|
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
||||||
|
.matureBase;
|
||||||
|
const plantName =
|
||||||
|
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
||||||
|
.name;
|
||||||
|
l('CMTooltipBorder').appendChild(
|
||||||
|
Create.TooltipCreateHeader('Reward (Current / Maximum)'),
|
||||||
|
);
|
||||||
|
const reward = document.createElement('div');
|
||||||
|
reward.id = 'CMTooltipPlantReward';
|
||||||
|
l('CMTooltipBorder').appendChild(reward);
|
||||||
|
if (plantName === 'Bakeberry') {
|
||||||
|
l('CMTooltipPlantReward').textContent = `${
|
||||||
|
mature
|
||||||
|
? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30))
|
||||||
|
: '0'
|
||||||
|
} / ${Beautify(Game.cookiesPs * 60 * 30)}`;
|
||||||
|
} else if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
|
||||||
|
l('CMTooltipPlantReward').textContent = `${
|
||||||
|
mature
|
||||||
|
? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3))
|
||||||
|
: '0'
|
||||||
|
} / ${Beautify(Game.cookiesPs * 60 * 3)}`;
|
||||||
|
} else if (plantName === 'Queenbeet') {
|
||||||
|
l('CMTooltipPlantReward').textContent = `${
|
||||||
|
mature
|
||||||
|
? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60))
|
||||||
|
: '0'
|
||||||
|
} / ${Beautify(Game.cookiesPs * 60 * 60)}`;
|
||||||
|
} else if (plantName === 'Duketater') {
|
||||||
|
l('CMTooltipPlantReward').textContent = `${
|
||||||
|
mature
|
||||||
|
? Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120))
|
||||||
|
: '0'
|
||||||
|
} / ${Beautify(Game.cookiesPs * 60 * 120)}`;
|
||||||
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
|
}
|
||||||
80
src/Disp/Tooltips/TypesOfTooltips/Grimoire.js
Normal file
80
src/Disp/Tooltips/TypesOfTooltips/Grimoire.js
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
import { CacheNoGoldSwitchCookiesPS } from '../../../Cache/VariablesAndData';
|
||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import {
|
||||||
|
Beautify,
|
||||||
|
GetTimeColor,
|
||||||
|
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
|
||||||
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
|
import { ColorTextPre, TooltipName } from '../../VariablesAndData';
|
||||||
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function adds extra info to the Grimoire tooltips
|
||||||
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
|
*/
|
||||||
|
export default function Grimoire() {
|
||||||
|
const { minigame } = Game.Objects['Wizard tower'];
|
||||||
|
const spellCost = minigame.getSpellCost(minigame.spellsById[TooltipName]);
|
||||||
|
|
||||||
|
if (CMOptions.TooltipGrim === 1 && spellCost <= minigame.magicM) {
|
||||||
|
const tooltipBox = l('CMTooltipBorder');
|
||||||
|
|
||||||
|
// Time left till enough magic for spell
|
||||||
|
tooltipBox.appendChild(Create.TooltipCreateHeader('Time Left'));
|
||||||
|
const time = document.createElement('div');
|
||||||
|
time.id = 'CMTooltipTime';
|
||||||
|
tooltipBox.appendChild(time);
|
||||||
|
const timeColor = GetTimeColor(
|
||||||
|
CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, spellCost),
|
||||||
|
);
|
||||||
|
time.textContent = timeColor.text;
|
||||||
|
time.className = ColorTextPre + timeColor.color;
|
||||||
|
|
||||||
|
// Time left untill magic spent is recovered
|
||||||
|
if (spellCost <= minigame.magic) {
|
||||||
|
tooltipBox.appendChild(Create.TooltipCreateHeader('Recover Time'));
|
||||||
|
const recover = document.createElement('div');
|
||||||
|
recover.id = 'CMTooltipRecover';
|
||||||
|
tooltipBox.appendChild(recover);
|
||||||
|
const recoverColor = GetTimeColor(
|
||||||
|
CalculateGrimoireRefillTime(
|
||||||
|
Math.max(0, minigame.magic - spellCost),
|
||||||
|
minigame.magicM,
|
||||||
|
minigame.magic,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
recover.textContent = recoverColor.text;
|
||||||
|
recover.className = ColorTextPre + recoverColor.color;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
|
||||||
|
if (TooltipName === '0') {
|
||||||
|
tooltipBox.appendChild(
|
||||||
|
Create.TooltipCreateHeader('Cookies to be gained/lost'),
|
||||||
|
);
|
||||||
|
const conjure = document.createElement('div');
|
||||||
|
conjure.id = 'x';
|
||||||
|
tooltipBox.appendChild(conjure);
|
||||||
|
const reward = document.createElement('span');
|
||||||
|
reward.style.color = '#33FF00';
|
||||||
|
reward.textContent = Beautify(
|
||||||
|
Math.min(
|
||||||
|
(Game.cookies + GetWrinkConfigBank()) * 0.15,
|
||||||
|
CacheNoGoldSwitchCookiesPS * 60 * 30,
|
||||||
|
),
|
||||||
|
2,
|
||||||
|
);
|
||||||
|
conjure.appendChild(reward);
|
||||||
|
const seperator = document.createElement('span');
|
||||||
|
seperator.textContent = ' / ';
|
||||||
|
conjure.appendChild(seperator);
|
||||||
|
const loss = document.createElement('span');
|
||||||
|
loss.style.color = 'red';
|
||||||
|
loss.textContent = Beautify(CacheNoGoldSwitchCookiesPS * 60 * 15, 2);
|
||||||
|
conjure.appendChild(loss);
|
||||||
|
}
|
||||||
|
|
||||||
|
l('CMTooltipArea').appendChild(tooltipBox);
|
||||||
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
|
}
|
||||||
57
src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js
Normal file
57
src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function adds extra info to the Garden Harvest All tooltip
|
||||||
|
* It is called when the Harvest All tooltip is created or refreshed by CM.Disp.UpdateTooltip()
|
||||||
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
|
*/
|
||||||
|
export default function HarvestAll() {
|
||||||
|
const { minigame } = Game.Objects.Farm;
|
||||||
|
if (CMOptions.TooltipLump) {
|
||||||
|
l('CMTooltipBorder').appendChild(
|
||||||
|
Create.TooltipCreateHeader('Cookies gained from harvesting:'),
|
||||||
|
);
|
||||||
|
let totalGain = 0;
|
||||||
|
let mortal = 0;
|
||||||
|
if (Game.keys[16] && Game.keys[17]) mortal = 1;
|
||||||
|
for (let y = 0; y < 6; y++) {
|
||||||
|
for (let x = 0; x < 6; x++) {
|
||||||
|
if (minigame.plot[y][x][0] >= 1) {
|
||||||
|
const tile = minigame.plot[y][x];
|
||||||
|
const me = minigame.plantsById[tile[0] - 1];
|
||||||
|
const plantName = me.name;
|
||||||
|
|
||||||
|
let count = true;
|
||||||
|
if (mortal && me.immortal) count = false;
|
||||||
|
if (tile[1] < me.matureBase) count = false;
|
||||||
|
if (count && plantName === 'Bakeberry') {
|
||||||
|
totalGain += Math.min(
|
||||||
|
Game.cookies * 0.03,
|
||||||
|
Game.cookiesPs * 60 * 30,
|
||||||
|
);
|
||||||
|
} else if (
|
||||||
|
(count && plantName === 'Chocoroot') ||
|
||||||
|
plantName === 'White chocoroot'
|
||||||
|
) {
|
||||||
|
totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3);
|
||||||
|
} else if (count && plantName === 'Queenbeet') {
|
||||||
|
totalGain += Math.min(
|
||||||
|
Game.cookies * 0.04,
|
||||||
|
Game.cookiesPs * 60 * 60,
|
||||||
|
);
|
||||||
|
} else if (count && plantName === 'Duketater') {
|
||||||
|
totalGain += Math.min(
|
||||||
|
Game.cookies * 0.08,
|
||||||
|
Game.cookiesPs * 60 * 120,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
l('CMTooltipBorder').appendChild(
|
||||||
|
document.createTextNode(Beautify(totalGain)),
|
||||||
|
);
|
||||||
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
|
}
|
||||||
76
src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js
Normal file
76
src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
import { CacheGods } from '../../../Cache/VariablesAndData';
|
||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
import { TooltipName, TooltipType } from '../../VariablesAndData';
|
||||||
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function adds extra info to the Pantheon Gods tooltip
|
||||||
|
* It is called when the Harvest All tooltip is created or refreshed by CM.Disp.UpdateTooltip()
|
||||||
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
|
*/
|
||||||
|
export default function PantheonGods() {
|
||||||
|
if (CMOptions.TooltipPantheon === 1) {
|
||||||
|
const tooltipBox = l('CMTooltipBorder');
|
||||||
|
let GodID;
|
||||||
|
if (TooltipType === 'pas') GodID = TooltipName[1];
|
||||||
|
else GodID = TooltipName;
|
||||||
|
|
||||||
|
// Time left till enough magic for spell
|
||||||
|
tooltipBox.appendChild(Create.TooltipCreateHeader('Effect in position 1:'));
|
||||||
|
const cps1 = document.createElement('div');
|
||||||
|
cps1.id = 'CMPantheonTooltipPosition1';
|
||||||
|
if (CacheGods[GodID][0] !== 0) {
|
||||||
|
cps1.textContent = Beautify(CacheGods[GodID][0]);
|
||||||
|
const increase = Math.round(
|
||||||
|
(CacheGods[GodID][0] / Game.cookiesPs) * 10000,
|
||||||
|
);
|
||||||
|
if (Number.isFinite(increase) && increase !== 0) {
|
||||||
|
cps1.textContent += ` (${increase / 100}% of income)`;
|
||||||
|
} else {
|
||||||
|
cps1.textContent += ` (<0${
|
||||||
|
CMOptions.ScaleSeparator ? ',' : '.'
|
||||||
|
}01% of income)`;
|
||||||
|
}
|
||||||
|
} else cps1.textContent = 'No effect to CPS';
|
||||||
|
tooltipBox.appendChild(cps1);
|
||||||
|
|
||||||
|
tooltipBox.appendChild(Create.TooltipCreateHeader('Effect in position 2:'));
|
||||||
|
const cps2 = document.createElement('div');
|
||||||
|
cps2.id = 'CMPantheonTooltipPosition2';
|
||||||
|
if (CacheGods[GodID][1] !== 0) {
|
||||||
|
cps2.textContent = Beautify(CacheGods[GodID][1]);
|
||||||
|
const increase = Math.round(
|
||||||
|
(CacheGods[GodID][1] / Game.cookiesPs) * 10000,
|
||||||
|
);
|
||||||
|
if (Number.isFinite(increase) && increase !== 0) {
|
||||||
|
cps2.textContent += ` (${increase / 100}% of income)`;
|
||||||
|
} else {
|
||||||
|
cps2.textContent += ` (<0${
|
||||||
|
CMOptions.ScaleSeparator ? ',' : '.'
|
||||||
|
}01% of income)`;
|
||||||
|
}
|
||||||
|
} else cps2.textContent = 'No effect to CPS';
|
||||||
|
tooltipBox.appendChild(cps2);
|
||||||
|
|
||||||
|
tooltipBox.appendChild(Create.TooltipCreateHeader('Effect in position 3:'));
|
||||||
|
const cps3 = document.createElement('div');
|
||||||
|
cps3.id = 'CMPantheonTooltipPosition2';
|
||||||
|
if (CacheGods[GodID][2] !== 0) {
|
||||||
|
cps3.textContent = Beautify(CacheGods[GodID][2]);
|
||||||
|
const increase = Math.round(
|
||||||
|
(CacheGods[GodID][2] / Game.cookiesPs) * 10000,
|
||||||
|
);
|
||||||
|
if (Number.isFinite(increase) && increase !== 0) {
|
||||||
|
cps3.textContent += ` (${increase / 100}% of income)`;
|
||||||
|
} else {
|
||||||
|
cps3.textContent += ` (<0${
|
||||||
|
CMOptions.ScaleSeparator ? ',' : '.'
|
||||||
|
}01% of income)`;
|
||||||
|
}
|
||||||
|
} else cps3.textContent = 'No effect to CPS';
|
||||||
|
tooltipBox.appendChild(cps3);
|
||||||
|
|
||||||
|
l('CMTooltipArea').appendChild(tooltipBox);
|
||||||
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
|
}
|
||||||
22
src/Disp/Tooltips/TypesOfTooltips/SugarLump.js
Normal file
22
src/Disp/Tooltips/TypesOfTooltips/SugarLump.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import GetLumpColor from '../../HelperFunctions/GetLumpColor';
|
||||||
|
import { ColorTextPre } from '../../VariablesAndData';
|
||||||
|
import * as Create from '../CreateTooltip';
|
||||||
|
/**
|
||||||
|
* This function adds extra info to the Sugar Lump tooltip
|
||||||
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
|
*/
|
||||||
|
export default function SugarLump() {
|
||||||
|
if (CMOptions.TooltipLump === 1) {
|
||||||
|
const tooltipBox = l('CMTooltipBorder');
|
||||||
|
|
||||||
|
tooltipBox.appendChild(Create.TooltipCreateHeader('Current Sugar Lump'));
|
||||||
|
|
||||||
|
const lumpType = document.createElement('div');
|
||||||
|
lumpType.id = 'CMTooltipTime';
|
||||||
|
tooltipBox.appendChild(lumpType);
|
||||||
|
const lumpColor = GetLumpColor(Game.lumpCurrentType);
|
||||||
|
lumpType.textContent = lumpColor.text;
|
||||||
|
lumpType.className = ColorTextPre + lumpColor.color;
|
||||||
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
|
}
|
||||||
114
src/Disp/Tooltips/TypesOfTooltips/Upgrade.js
Normal file
114
src/Disp/Tooltips/TypesOfTooltips/Upgrade.js
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
import {
|
||||||
|
CacheLastChoEgg,
|
||||||
|
CacheUpgrades,
|
||||||
|
} from '../../../Cache/VariablesAndData';
|
||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
import {
|
||||||
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
|
GetTimeColor,
|
||||||
|
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
|
import {
|
||||||
|
ColorTextPre,
|
||||||
|
TooltipBonusIncome,
|
||||||
|
TooltipBonusMouse,
|
||||||
|
TooltipName,
|
||||||
|
TooltipPrice,
|
||||||
|
TooltipType,
|
||||||
|
} from '../../VariablesAndData';
|
||||||
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function adds extra info to the Upgrade tooltips
|
||||||
|
*/
|
||||||
|
export default function Upgrade() {
|
||||||
|
const tooltipBox = l('CMTooltipBorder');
|
||||||
|
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||||
|
|
||||||
|
TooltipBonusIncome =
|
||||||
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonus;
|
||||||
|
TooltipPrice = Game.Upgrades[
|
||||||
|
Game.UpgradesInStore[TooltipName].name
|
||||||
|
].getPrice();
|
||||||
|
TooltipBonusMouse =
|
||||||
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonusMouse;
|
||||||
|
|
||||||
|
if (CMOptions.TooltipBuildUpgrade === 1) {
|
||||||
|
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
||||||
|
const increase = Math.round((TooltipBonusIncome / Game.cookiesPs) * 10000);
|
||||||
|
// Don't display certain parts of tooltip if not applicable
|
||||||
|
if (
|
||||||
|
l('CMTooltipIncome').textContent === '0' &&
|
||||||
|
(TooltipType === 'b' || TooltipType === 'u')
|
||||||
|
) {
|
||||||
|
l('Bonus IncomeTitle').style.display = 'none';
|
||||||
|
l('CMTooltipIncome').style.display = 'none';
|
||||||
|
l('Payback PeriodTitle').style.display = 'none';
|
||||||
|
l('CMTooltipPP').style.display = 'none';
|
||||||
|
} else {
|
||||||
|
if (Number.isFinite(increase) && increase !== 0) {
|
||||||
|
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
||||||
|
} else {
|
||||||
|
l('CMTooltipIncome').textContent += ` (<0${
|
||||||
|
CMOptions.ScaleSeparator ? ',' : '.'
|
||||||
|
}01% of income)`;
|
||||||
|
}
|
||||||
|
l('CMTooltipBorder').className =
|
||||||
|
ColorTextPre +
|
||||||
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||||
|
// If clicking power upgrade
|
||||||
|
if (TooltipBonusMouse) {
|
||||||
|
l('CMTooltipCookiePerClick').textContent = Beautify(TooltipBonusMouse);
|
||||||
|
l('CMTooltipCookiePerClick').style.display = 'block';
|
||||||
|
l('CMTooltipCookiePerClick').previousSibling.style.display = 'block';
|
||||||
|
}
|
||||||
|
// If only a clicking power upgrade change PP to click-based period
|
||||||
|
if (TooltipBonusIncome === 0 && TooltipBonusMouse) {
|
||||||
|
l('CMTooltipPP').textContent = `${Beautify(
|
||||||
|
TooltipPrice / TooltipBonusMouse,
|
||||||
|
)} Clicks`;
|
||||||
|
l('CMTooltipPP').style.color = 'white';
|
||||||
|
} else {
|
||||||
|
if (CMOptions.PPDisplayTime)
|
||||||
|
l('CMTooltipPP').textContent = FormatTime(
|
||||||
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||||
|
);
|
||||||
|
else
|
||||||
|
l('CMTooltipPP').textContent = Beautify(
|
||||||
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||||
|
2,
|
||||||
|
);
|
||||||
|
l('CMTooltipPP').className =
|
||||||
|
ColorTextPre +
|
||||||
|
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const timeColor = GetTimeColor(
|
||||||
|
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||||
|
);
|
||||||
|
l('CMTooltipTime').textContent = timeColor.text;
|
||||||
|
if (
|
||||||
|
timeColor.text === 'Done!' &&
|
||||||
|
Game.cookies < Game.UpgradesInStore[TooltipName].getPrice()
|
||||||
|
) {
|
||||||
|
l('CMTooltipTime').textContent = `${timeColor.text} (with Wrink)`;
|
||||||
|
} else l('CMTooltipTime').textContent = timeColor.text;
|
||||||
|
l('CMTooltipTime').className = ColorTextPre + timeColor.color;
|
||||||
|
|
||||||
|
// Add extra info to Chocolate egg tooltip
|
||||||
|
if (Game.UpgradesInStore[TooltipName].name === 'Chocolate egg') {
|
||||||
|
l('CMTooltipBorder').lastChild.style.marginBottom = '4px';
|
||||||
|
l('CMTooltipBorder').appendChild(
|
||||||
|
Create.TooltipCreateHeader('Cookies to be gained (Currently/Max)'),
|
||||||
|
);
|
||||||
|
const chocolate = document.createElement('div');
|
||||||
|
chocolate.style.color = 'white';
|
||||||
|
chocolate.textContent = `${Beautify(Game.cookies * 0.05)} / ${Beautify(
|
||||||
|
CacheLastChoEgg,
|
||||||
|
)}`;
|
||||||
|
l('CMTooltipBorder').appendChild(chocolate);
|
||||||
|
}
|
||||||
|
} else l('CMTooltipArea').style.display = 'none';
|
||||||
|
}
|
||||||
144
src/Disp/Tooltips/TypesOfTooltips/Warnings.js
Normal file
144
src/Disp/Tooltips/TypesOfTooltips/Warnings.js
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
import GetCPSBuffMult from '../../../Cache/CPS/GetCPSBuffMult';
|
||||||
|
import { CacheEdifice, CacheLucky } from '../../../Cache/VariablesAndData';
|
||||||
|
import ToggleToolWarnPos from '../../../Config/Toggles/ToggleToolWarnPos';
|
||||||
|
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||||
|
|
||||||
|
import {
|
||||||
|
Beautify,
|
||||||
|
FormatTime,
|
||||||
|
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
|
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||||
|
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||||
|
import {
|
||||||
|
TooltipBonusIncome,
|
||||||
|
TooltipPrice,
|
||||||
|
TooltipType,
|
||||||
|
} from '../../VariablesAndData';
|
||||||
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function updates the warnings section of the building and upgrade tooltips
|
||||||
|
*/
|
||||||
|
export default function Warnings() {
|
||||||
|
if (TooltipType === 'b' || TooltipType === 'u') {
|
||||||
|
if (document.getElementById('CMDispTooltipWarningParent') === null) {
|
||||||
|
l('tooltipAnchor').appendChild(Create.TooltipCreateWarningSection());
|
||||||
|
ToggleToolWarnPos();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CMOptions.ToolWarnPos === 0)
|
||||||
|
l('CMDispTooltipWarningParent').style.right = '0px';
|
||||||
|
else
|
||||||
|
l('CMDispTooltipWarningParent').style.top = `${
|
||||||
|
l('tooltip').offsetHeight
|
||||||
|
}px`;
|
||||||
|
|
||||||
|
l('CMDispTooltipWarningParent').style.width = `${
|
||||||
|
l('tooltip').offsetWidth - 6
|
||||||
|
}px`;
|
||||||
|
|
||||||
|
const amount = Game.cookies + GetWrinkConfigBank() - TooltipPrice;
|
||||||
|
const bonusIncomeUsed = CMOptions.ToolWarnBon ? TooltipBonusIncome : 0;
|
||||||
|
let limitLucky = CacheLucky;
|
||||||
|
if (CMOptions.ToolWarnBon === 1) {
|
||||||
|
let bonusNoFren = TooltipBonusIncome;
|
||||||
|
bonusNoFren /= GetCPSBuffMult();
|
||||||
|
limitLucky += (bonusNoFren * 60 * 15) / 0.15;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CMOptions.ToolWarnLucky === 1) {
|
||||||
|
if (amount < limitLucky && (TooltipType !== 'b' || Game.buyMode === 1)) {
|
||||||
|
l('CMDispTooltipWarnLucky').style.display = '';
|
||||||
|
l('CMDispTooltipWarnLuckyText').textContent = `${Beautify(
|
||||||
|
limitLucky - amount,
|
||||||
|
)} (${FormatTime(
|
||||||
|
(limitLucky - amount) / (GetCPS() + bonusIncomeUsed),
|
||||||
|
)})`;
|
||||||
|
} else l('CMDispTooltipWarnLucky').style.display = 'none';
|
||||||
|
} else l('CMDispTooltipWarnLucky').style.display = 'none';
|
||||||
|
|
||||||
|
if (CMOptions.ToolWarnLuckyFrenzy === 1) {
|
||||||
|
const limitLuckyFrenzy = limitLucky * 7;
|
||||||
|
if (
|
||||||
|
amount < limitLuckyFrenzy &&
|
||||||
|
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||||
|
) {
|
||||||
|
l('CMDispTooltipWarnLuckyFrenzy').style.display = '';
|
||||||
|
l('CMDispTooltipWarnLuckyFrenzyText').textContent = `${Beautify(
|
||||||
|
limitLuckyFrenzy - amount,
|
||||||
|
)} (${FormatTime(
|
||||||
|
(limitLuckyFrenzy - amount) / (GetCPS() + bonusIncomeUsed),
|
||||||
|
)})`;
|
||||||
|
} else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none';
|
||||||
|
} else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none';
|
||||||
|
|
||||||
|
if (CMOptions.ToolWarnConjure === 1) {
|
||||||
|
const limitConjure = limitLucky * 2;
|
||||||
|
if (
|
||||||
|
amount < limitConjure &&
|
||||||
|
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||||
|
) {
|
||||||
|
l('CMDispTooltipWarnConjure').style.display = '';
|
||||||
|
l('CMDispTooltipWarnConjureText').textContent = `${Beautify(
|
||||||
|
limitConjure - amount,
|
||||||
|
)} (${FormatTime(
|
||||||
|
(limitConjure - amount) / (GetCPS() + bonusIncomeUsed),
|
||||||
|
)})`;
|
||||||
|
} else l('CMDispTooltipWarnConjure').style.display = 'none';
|
||||||
|
} else l('CMDispTooltipWarnConjure').style.display = 'none';
|
||||||
|
|
||||||
|
if (CMOptions.ToolWarnConjureFrenzy === 1) {
|
||||||
|
const limitConjureFrenzy = limitLucky * 2 * 7;
|
||||||
|
if (
|
||||||
|
amount < limitConjureFrenzy &&
|
||||||
|
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||||
|
) {
|
||||||
|
l('CMDispTooltipWarnConjureFrenzy').style.display = '';
|
||||||
|
l('CMDispTooltipWarnConjureFrenzyText').textContent = `${Beautify(
|
||||||
|
limitConjureFrenzy - amount,
|
||||||
|
)} (${FormatTime(
|
||||||
|
(limitConjureFrenzy - amount) / (GetCPS() + bonusIncomeUsed),
|
||||||
|
)})`;
|
||||||
|
} else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none';
|
||||||
|
} else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none';
|
||||||
|
|
||||||
|
if (
|
||||||
|
CMOptions.ToolWarnEdifice === 1 &&
|
||||||
|
Game.Objects['Wizard tower'].minigameLoaded
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
CacheEdifice &&
|
||||||
|
amount < CacheEdifice &&
|
||||||
|
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||||
|
) {
|
||||||
|
l('CMDispTooltipWarnEdifice').style.display = '';
|
||||||
|
l('CMDispTooltipWarnEdificeText').textContent = `${Beautify(
|
||||||
|
CacheEdifice - amount,
|
||||||
|
)} (${FormatTime(
|
||||||
|
(CacheEdifice - amount) / (GetCPS() + bonusIncomeUsed),
|
||||||
|
)})`;
|
||||||
|
} else l('CMDispTooltipWarnEdifice').style.display = 'none';
|
||||||
|
} else l('CMDispTooltipWarnEdifice').style.display = 'none';
|
||||||
|
|
||||||
|
if (CMOptions.ToolWarnUser > 0) {
|
||||||
|
if (
|
||||||
|
amount < CMOptions.ToolWarnUser * GetCPS() &&
|
||||||
|
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||||
|
) {
|
||||||
|
l('CMDispTooltipWarnUser').style.display = '';
|
||||||
|
// Need to update tooltip text dynamically
|
||||||
|
l(
|
||||||
|
'CMDispTooltipWarnUser',
|
||||||
|
).children[0].textContent = `Purchase of this item will put you under the number of Cookies equal to ${CMOptions.ToolWarnUser} seconds of CPS`;
|
||||||
|
l('CMDispTooltipWarnUserText').textContent = `${Beautify(
|
||||||
|
CMOptions.ToolWarnUser * GetCPS() - amount,
|
||||||
|
)} (${FormatTime(
|
||||||
|
(CMOptions.ToolWarnUser * GetCPS() - amount) /
|
||||||
|
(GetCPS() + bonusIncomeUsed),
|
||||||
|
)})`;
|
||||||
|
} else l('CMDispTooltipWarnUser').style.display = 'none';
|
||||||
|
} else l('CMDispTooltipWarnUser').style.display = 'none';
|
||||||
|
} else if (l('CMDispTooltipWarningParent') !== null) {
|
||||||
|
l('CMDispTooltipWarningParent').remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js
Normal file
25
src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import {
|
||||||
|
CacheWrinklersFattest,
|
||||||
|
CacheWrinklersTotal,
|
||||||
|
} from '../../../Cache/VariablesAndData';
|
||||||
|
import { TooltipName } from '../../VariablesAndData';
|
||||||
|
import * as Create from '../CreateTooltip';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function adds extra info to the wrinkler button tooltip
|
||||||
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
|
*/
|
||||||
|
export default function WrinklerButton() {
|
||||||
|
l('tooltip').innerHTML = '';
|
||||||
|
l('tooltip').appendChild(Create.TooltipCreateHeader('Reward:'));
|
||||||
|
|
||||||
|
const WrinklerReward = document.createElement('div');
|
||||||
|
WrinklerReward.id = 'CMWrinklerReward';
|
||||||
|
if (TooltipName === 'PopAll') {
|
||||||
|
WrinklerReward.textContent = CacheWrinklersTotal;
|
||||||
|
} else if (TooltipName === 'PopFattest') {
|
||||||
|
WrinklerReward.textContent = CacheWrinklersFattest[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
l('tooltip').appendChild(WrinklerReward);
|
||||||
|
}
|
||||||
@@ -1,344 +1,51 @@
|
|||||||
import GetCPSBuffMult from '../../Cache/CPS/GetCPSBuffMult';
|
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||||
import {
|
import { TooltipName, TooltipType } from '../VariablesAndData';
|
||||||
CacheEdifice, CacheLastChoEgg, CacheLucky, CacheNoGoldSwitchCookiesPS, CacheObjects1, CacheObjects10, CacheObjects100, CacheUpgrades,
|
|
||||||
} from '../../Cache/VariablesAndData';
|
|
||||||
import ToggleToolWarnPos from '../../Config/Toggles/ToggleToolWarnPos';
|
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
|
||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
|
||||||
import { Beautify, FormatTime, GetTimeColor } from '../BeautifyAndFormatting/BeautifyFormatting';
|
|
||||||
import CalculateGrimoireRefillTime from '../HelperFunctions/CalculateGrimoireRefillTime';
|
|
||||||
import GetCPS from '../HelperFunctions/GetCPS';
|
|
||||||
import GetLumpColor from '../HelperFunctions/GetLumpColor';
|
|
||||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
|
||||||
import {
|
|
||||||
ColorTextPre, LastTargetTooltipBuilding, TooltipBonusIncome, TooltipBonusMouse, TooltipName, TooltipPrice, TooltipType,
|
|
||||||
} from '../VariablesAndData';
|
|
||||||
import * as Create from './CreateTooltip';
|
import * as Create from './CreateTooltip';
|
||||||
|
import Building from './TypesOfTooltips/Building';
|
||||||
/** Functions that update specific types of tooltips */
|
import GardenPlots from './TypesOfTooltips/GardenPlots';
|
||||||
|
import Grimoire from './TypesOfTooltips/Grimoire';
|
||||||
|
import HarvestAll from './TypesOfTooltips/HarvestAll';
|
||||||
|
import PantheonGods from './TypesOfTooltips/PantheonGods';
|
||||||
|
import SugarLump from './TypesOfTooltips/SugarLump';
|
||||||
|
import Upgrade from './TypesOfTooltips/Upgrade';
|
||||||
|
import Warnings from './TypesOfTooltips/Warnings';
|
||||||
|
import WrinklerButton from './TypesOfTooltips/WrinklerButton';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function adds extra info to the Building tooltips
|
* This function updates the sections of the tooltips created by CookieMonster
|
||||||
*/
|
*/
|
||||||
export function Building() {
|
export default function UpdateTooltips() {
|
||||||
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
CopyData();
|
||||||
const tooltipBox = l('CMTooltipBorder');
|
if (l('tooltipAnchor').style.display !== 'none' && l('CMTooltipArea')) {
|
||||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
l('CMTooltipArea').innerHTML = '';
|
||||||
|
const tooltipBox = Create.TooltipCreateTooltipBox();
|
||||||
let target;
|
|
||||||
if (Game.buyMode === 1) {
|
|
||||||
LastTargetTooltipBuilding = target;
|
|
||||||
} else {
|
|
||||||
target = LastTargetTooltipBuilding;
|
|
||||||
}
|
|
||||||
if (Game.buyBulk === 1) target = CacheObjects1;
|
|
||||||
else if (Game.buyBulk === 10) target = CacheObjects10;
|
|
||||||
else if (Game.buyBulk === 100) target = CacheObjects100;
|
|
||||||
|
|
||||||
TooltipPrice = Game.Objects[TooltipName].bulkPrice;
|
|
||||||
TooltipBonusIncome = target[TooltipName].bonus;
|
|
||||||
|
|
||||||
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
|
||||||
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
|
||||||
const increase = Math.round(TooltipBonusIncome / Game.cookiesPs * 10000);
|
|
||||||
if (Number.isFinite(increase) && increase !== 0) {
|
|
||||||
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
|
||||||
}
|
|
||||||
l('CMTooltipBorder').className = ColorTextPre + target[TooltipName].color;
|
|
||||||
l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
|
||||||
l('CMTooltipPP').className = ColorTextPre + target[TooltipName].color;
|
|
||||||
const timeColor = GetTimeColor((TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS());
|
|
||||||
l('CMTooltipTime').textContent = timeColor.text;
|
|
||||||
if (timeColor.text === 'Done!' && Game.cookies < target[TooltipName].price) {
|
|
||||||
l('CMTooltipTime').textContent = `${timeColor.text} (with Wrink)`;
|
|
||||||
} else l('CMTooltipTime').textContent = timeColor.text;
|
|
||||||
l('CMTooltipTime').className = ColorTextPre + timeColor.color;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add "production left till next achievement"-bar
|
|
||||||
l('CMTooltipProductionHeader').style.display = 'none';
|
|
||||||
l('CMTooltipTime').style.marginBottom = '0px';
|
|
||||||
for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) {
|
|
||||||
if (!Game.HasAchiev(Game.Objects[TooltipName].productionAchievs[i].achiev.name)) {
|
|
||||||
const nextProductionAchiev = Game.Objects[TooltipName].productionAchievs[i];
|
|
||||||
l('CMTooltipTime').style.marginBottom = '4px';
|
|
||||||
l('CMTooltipProductionHeader').style.display = '';
|
|
||||||
l('CMTooltipProduction').className = `ProdAchievement${TooltipName}`;
|
|
||||||
l('CMTooltipProduction').textContent = Beautify(nextProductionAchiev.pow - SimObjects[TooltipName].totalCookies, 15);
|
|
||||||
l('CMTooltipProduction').style.color = 'white';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function adds extra info to the Upgrade tooltips
|
|
||||||
*/
|
|
||||||
export function Upgrade() {
|
|
||||||
const tooltipBox = l('CMTooltipBorder');
|
|
||||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
|
||||||
|
|
||||||
TooltipBonusIncome = CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonus;
|
|
||||||
TooltipPrice = Game.Upgrades[Game.UpgradesInStore[TooltipName].name].getPrice();
|
|
||||||
TooltipBonusMouse = CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonusMouse;
|
|
||||||
|
|
||||||
if (CMOptions.TooltipBuildUpgrade === 1) {
|
|
||||||
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
|
||||||
const increase = Math.round(TooltipBonusIncome / Game.cookiesPs * 10000);
|
|
||||||
// Don't display certain parts of tooltip if not applicable
|
|
||||||
if (l('CMTooltipIncome').textContent === '0' && (TooltipType === 'b' || TooltipType === 'u')) {
|
|
||||||
l('Bonus IncomeTitle').style.display = 'none';
|
|
||||||
l('CMTooltipIncome').style.display = 'none';
|
|
||||||
l('Payback PeriodTitle').style.display = 'none';
|
|
||||||
l('CMTooltipPP').style.display = 'none';
|
|
||||||
} else {
|
|
||||||
if (Number.isFinite(increase) && increase !== 0) {
|
|
||||||
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
|
||||||
}
|
|
||||||
l('CMTooltipBorder').className = ColorTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
|
||||||
// If clicking power upgrade
|
|
||||||
if (TooltipBonusMouse) {
|
|
||||||
l('CMTooltipCookiePerClick').textContent = Beautify(TooltipBonusMouse);
|
|
||||||
l('CMTooltipCookiePerClick').style.display = 'block';
|
|
||||||
l('CMTooltipCookiePerClick').previousSibling.style.display = 'block';
|
|
||||||
}
|
|
||||||
// If only a clicking power upgrade change PP to click-based period
|
|
||||||
if (TooltipBonusIncome === 0 && TooltipBonusMouse) {
|
|
||||||
l('CMTooltipPP').textContent = `${Beautify(TooltipPrice / TooltipBonusMouse)} Clicks`;
|
|
||||||
l('CMTooltipPP').style.color = 'white';
|
|
||||||
} else {
|
|
||||||
l('CMTooltipPP').textContent = Beautify(CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp, 2);
|
|
||||||
l('CMTooltipPP').className = ColorTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const timeColor = GetTimeColor((TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS());
|
|
||||||
l('CMTooltipTime').textContent = timeColor.text;
|
|
||||||
if (timeColor.text === 'Done!' && Game.cookies < Game.UpgradesInStore[TooltipName].getPrice()) {
|
|
||||||
l('CMTooltipTime').textContent = `${timeColor.text} (with Wrink)`;
|
|
||||||
} else l('CMTooltipTime').textContent = timeColor.text;
|
|
||||||
l('CMTooltipTime').className = ColorTextPre + timeColor.color;
|
|
||||||
|
|
||||||
// Add extra info to Chocolate egg tooltip
|
|
||||||
if (Game.UpgradesInStore[TooltipName].name === 'Chocolate egg') {
|
|
||||||
l('CMTooltipBorder').lastChild.style.marginBottom = '4px';
|
|
||||||
l('CMTooltipBorder').appendChild(Create.TooltipCreateHeader('Cookies to be gained (Currently/Max)'));
|
|
||||||
const chocolate = document.createElement('div');
|
|
||||||
chocolate.style.color = 'white';
|
|
||||||
chocolate.textContent = `${Beautify(Game.cookies * 0.05)} / ${Beautify(CacheLastChoEgg)}`;
|
|
||||||
l('CMTooltipBorder').appendChild(chocolate);
|
|
||||||
}
|
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function adds extra info to the Sugar Lump tooltip
|
|
||||||
* It adds to the additional information to l('CMTooltipArea')
|
|
||||||
*/
|
|
||||||
export function SugarLump() {
|
|
||||||
if (CMOptions.TooltipLump === 1) {
|
|
||||||
const tooltipBox = l('CMTooltipBorder');
|
|
||||||
|
|
||||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Current Sugar Lump'));
|
|
||||||
|
|
||||||
const lumpType = document.createElement('div');
|
|
||||||
lumpType.id = 'CMTooltipTime';
|
|
||||||
tooltipBox.appendChild(lumpType);
|
|
||||||
const lumpColor = GetLumpColor(Game.lumpCurrentType);
|
|
||||||
lumpType.textContent = lumpColor.text;
|
|
||||||
lumpType.className = ColorTextPre + lumpColor.color;
|
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function adds extra info to the Grimoire tooltips
|
|
||||||
* It adds to the additional information to l('CMTooltipArea')
|
|
||||||
*/
|
|
||||||
export function Grimoire() {
|
|
||||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
|
||||||
const spellCost = minigame.getSpellCost(minigame.spellsById[TooltipName]);
|
|
||||||
|
|
||||||
if (CMOptions.TooltipGrim === 1 && spellCost <= minigame.magicM) {
|
|
||||||
const tooltipBox = l('CMTooltipBorder');
|
|
||||||
|
|
||||||
// Time left till enough magic for spell
|
|
||||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Time Left'));
|
|
||||||
const time = document.createElement('div');
|
|
||||||
time.id = 'CMTooltipTime';
|
|
||||||
tooltipBox.appendChild(time);
|
|
||||||
const timeColor = GetTimeColor(CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, spellCost));
|
|
||||||
time.textContent = timeColor.text;
|
|
||||||
time.className = ColorTextPre + timeColor.color;
|
|
||||||
|
|
||||||
// Time left untill magic spent is recovered
|
|
||||||
if (spellCost <= minigame.magic) {
|
|
||||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Recover Time'));
|
|
||||||
const recover = document.createElement('div');
|
|
||||||
recover.id = 'CMTooltipRecover';
|
|
||||||
tooltipBox.appendChild(recover);
|
|
||||||
const recoverColor = GetTimeColor(CalculateGrimoireRefillTime(Math.max(0, minigame.magic - spellCost), minigame.magicM, minigame.magic));
|
|
||||||
recover.textContent = recoverColor.text;
|
|
||||||
recover.className = ColorTextPre + recoverColor.color;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
|
|
||||||
if (TooltipName === '0') {
|
|
||||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Cookies to be gained/lost'));
|
|
||||||
const conjure = document.createElement('div');
|
|
||||||
conjure.id = 'x';
|
|
||||||
tooltipBox.appendChild(conjure);
|
|
||||||
const reward = document.createElement('span');
|
|
||||||
reward.style.color = '#33FF00';
|
|
||||||
reward.textContent = Beautify(Math.min((Game.cookies + GetWrinkConfigBank()) * 0.15, CacheNoGoldSwitchCookiesPS * 60 * 30), 2);
|
|
||||||
conjure.appendChild(reward);
|
|
||||||
const seperator = document.createElement('span');
|
|
||||||
seperator.textContent = ' / ';
|
|
||||||
conjure.appendChild(seperator);
|
|
||||||
const loss = document.createElement('span');
|
|
||||||
loss.style.color = 'red';
|
|
||||||
loss.textContent = Beautify((CacheNoGoldSwitchCookiesPS * 60 * 15), 2);
|
|
||||||
conjure.appendChild(loss);
|
|
||||||
}
|
|
||||||
|
|
||||||
l('CMTooltipArea').appendChild(tooltipBox);
|
l('CMTooltipArea').appendChild(tooltipBox);
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
if (TooltipType === 'b') {
|
||||||
* This function adds extra info to the Garden plots tooltips
|
Building();
|
||||||
* It adds to the additional information to l('CMTooltipArea')
|
} else if (TooltipType === 'u') {
|
||||||
*/
|
Upgrade();
|
||||||
export function GardenPlots() {
|
} else if (TooltipType === 's') {
|
||||||
const minigame = Game.Objects.Farm.minigame;
|
SugarLump();
|
||||||
if (CMOptions.TooltipPlots && minigame.plot[TooltipName[1]][TooltipName[0]][0] !== 0) {
|
} else if (TooltipType === 'g') {
|
||||||
const mature = minigame.plot[TooltipName[1]][TooltipName[0]][1] > minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1].matureBase;
|
Grimoire();
|
||||||
const plantName = minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1].name;
|
} else if (TooltipType === 'p') {
|
||||||
l('CMTooltipBorder').appendChild(Create.TooltipCreateHeader('Reward (Current / Maximum)'));
|
GardenPlots();
|
||||||
const reward = document.createElement('div');
|
} else if (TooltipType === 'ha') {
|
||||||
reward.id = 'CMTooltipPlantReward';
|
HarvestAll();
|
||||||
l('CMTooltipBorder').appendChild(reward);
|
} else if (TooltipType === 'wb') {
|
||||||
if (plantName === 'Bakeberry') {
|
WrinklerButton();
|
||||||
l('CMTooltipPlantReward').textContent = `${mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : '0'} / ${Beautify(Game.cookiesPs * 60 * 30)}`;
|
} else if (
|
||||||
} else if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
|
TooltipType === 'pag' ||
|
||||||
l('CMTooltipPlantReward').textContent = `${mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : '0'} / ${Beautify(Game.cookiesPs * 60 * 3)}`;
|
(TooltipType === 'pas' && TooltipName[1] !== -1)
|
||||||
} else if (plantName === 'Queenbeet') {
|
) {
|
||||||
l('CMTooltipPlantReward').textContent = `${mature ? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : '0'} / ${Beautify(Game.cookiesPs * 60 * 60)}`;
|
PantheonGods();
|
||||||
} else if (plantName === 'Duketater') {
|
|
||||||
l('CMTooltipPlantReward').textContent = `${mature ? Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : '0'} / ${Beautify(Game.cookiesPs * 60 * 120)}`;
|
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function adds extra info to the Garden Harvest All tooltip
|
|
||||||
* It is called when the Harvest All tooltip is created or refreshed by CM.Disp.UpdateTooltip()
|
|
||||||
* It adds to the additional information to l('CMTooltipArea')
|
|
||||||
*/
|
|
||||||
export function HarvestAll() {
|
|
||||||
const minigame = Game.Objects.Farm.minigame;
|
|
||||||
if (CMOptions.TooltipLump) {
|
|
||||||
l('CMTooltipBorder').appendChild(Create.TooltipCreateHeader('Cookies gained from harvesting:'));
|
|
||||||
let totalGain = 0;
|
|
||||||
let mortal = 0;
|
|
||||||
if (Game.keys[16] && Game.keys[17]) mortal = 1;
|
|
||||||
for (let y = 0; y < 6; y++) {
|
|
||||||
for (let x = 0; x < 6; x++) {
|
|
||||||
if (minigame.plot[y][x][0] >= 1) {
|
|
||||||
const tile = minigame.plot[y][x];
|
|
||||||
const me = minigame.plantsById[tile[0] - 1];
|
|
||||||
const plantName = me.name;
|
|
||||||
|
|
||||||
let count = true;
|
|
||||||
if (mortal && me.immortal) count = false;
|
|
||||||
if (tile[1] < me.matureBase) count = false;
|
|
||||||
if (count && plantName === 'Bakeberry') {
|
|
||||||
totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30);
|
|
||||||
} else if (count && plantName === 'Chocoroot' || plantName === 'White chocoroot') {
|
|
||||||
totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3);
|
|
||||||
} else if (count && plantName === 'Queenbeet') {
|
|
||||||
totalGain += Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60);
|
|
||||||
} else if (count && plantName === 'Duketater') {
|
|
||||||
totalGain += Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120);
|
|
||||||
}
|
}
|
||||||
}
|
Warnings();
|
||||||
}
|
} else if (l('CMTooltipArea') === null) {
|
||||||
}
|
// Remove warnings if its a basic tooltip
|
||||||
l('CMTooltipBorder').appendChild(document.createTextNode(Beautify(totalGain)));
|
if (l('CMDispTooltipWarningParent') !== null) {
|
||||||
} else l('CMTooltipArea').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function updates the warnings section of the building and upgrade tooltips
|
|
||||||
* It is called by CM.Disp.UpdateTooltip()
|
|
||||||
*/
|
|
||||||
export function Warnings() {
|
|
||||||
if (TooltipType === 'b' || TooltipType === 'u') {
|
|
||||||
if (document.getElementById('CMDispTooltipWarningParent') === null) {
|
|
||||||
l('tooltipAnchor').appendChild(Create.TooltipCreateWarningSection());
|
|
||||||
ToggleToolWarnPos();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CMOptions.ToolWarnPos === 0) l('CMDispTooltipWarningParent').style.right = '0px';
|
|
||||||
else l('CMDispTooltipWarningParent').style.top = `${l('tooltip').offsetHeight}px`;
|
|
||||||
|
|
||||||
l('CMDispTooltipWarningParent').style.width = `${l('tooltip').offsetWidth - 6}px`;
|
|
||||||
|
|
||||||
const amount = (Game.cookies + GetWrinkConfigBank()) - TooltipPrice;
|
|
||||||
const bonusIncomeUsed = CMOptions.ToolWarnBon ? TooltipBonusIncome : 0;
|
|
||||||
let limitLucky = CacheLucky;
|
|
||||||
if (CMOptions.ToolWarnBon === 1) {
|
|
||||||
let bonusNoFren = TooltipBonusIncome;
|
|
||||||
bonusNoFren /= GetCPSBuffMult();
|
|
||||||
limitLucky += ((bonusNoFren * 60 * 15) / 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CMOptions.ToolWarnLucky === 1) {
|
|
||||||
if (amount < limitLucky && (TooltipType !== 'b' || Game.buyMode === 1)) {
|
|
||||||
l('CMDispTooltipWarnLucky').style.display = '';
|
|
||||||
l('CMDispTooltipWarnLuckyText').textContent = `${Beautify(limitLucky - amount)} (${FormatTime((limitLucky - amount) / (GetCPS() + bonusIncomeUsed))})`;
|
|
||||||
} else l('CMDispTooltipWarnLucky').style.display = 'none';
|
|
||||||
} else l('CMDispTooltipWarnLucky').style.display = 'none';
|
|
||||||
|
|
||||||
if (CMOptions.ToolWarnLuckyFrenzy === 1) {
|
|
||||||
const limitLuckyFrenzy = limitLucky * 7;
|
|
||||||
if (amount < limitLuckyFrenzy && (TooltipType !== 'b' || Game.buyMode === 1)) {
|
|
||||||
l('CMDispTooltipWarnLuckyFrenzy').style.display = '';
|
|
||||||
l('CMDispTooltipWarnLuckyFrenzyText').textContent = `${Beautify(limitLuckyFrenzy - amount)} (${FormatTime((limitLuckyFrenzy - amount) / (GetCPS() + bonusIncomeUsed))})`;
|
|
||||||
} else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none';
|
|
||||||
} else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none';
|
|
||||||
|
|
||||||
if (CMOptions.ToolWarnConjure === 1) {
|
|
||||||
const limitConjure = limitLucky * 2;
|
|
||||||
if ((amount < limitConjure) && (TooltipType !== 'b' || Game.buyMode === 1)) {
|
|
||||||
l('CMDispTooltipWarnConjure').style.display = '';
|
|
||||||
l('CMDispTooltipWarnConjureText').textContent = `${Beautify(limitConjure - amount)} (${FormatTime((limitConjure - amount) / (GetCPS() + bonusIncomeUsed))})`;
|
|
||||||
} else l('CMDispTooltipWarnConjure').style.display = 'none';
|
|
||||||
} else l('CMDispTooltipWarnConjure').style.display = 'none';
|
|
||||||
|
|
||||||
if (CMOptions.ToolWarnConjureFrenzy === 1) {
|
|
||||||
const limitConjureFrenzy = limitLucky * 2 * 7;
|
|
||||||
if ((amount < limitConjureFrenzy) && (TooltipType !== 'b' || Game.buyMode === 1)) {
|
|
||||||
l('CMDispTooltipWarnConjureFrenzy').style.display = '';
|
|
||||||
l('CMDispTooltipWarnConjureFrenzyText').textContent = `${Beautify(limitConjureFrenzy - amount)} (${FormatTime((limitConjureFrenzy - amount) / (GetCPS() + bonusIncomeUsed))})`;
|
|
||||||
} else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none';
|
|
||||||
} else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none';
|
|
||||||
|
|
||||||
if (CMOptions.ToolWarnEdifice === 1 && Game.Objects['Wizard tower'].minigameLoaded) {
|
|
||||||
if (CacheEdifice && amount < CacheEdifice && (TooltipType !== 'b' || Game.buyMode === 1)) {
|
|
||||||
l('CMDispTooltipWarnEdifice').style.display = '';
|
|
||||||
l('CMDispTooltipWarnEdificeText').textContent = `${Beautify(CacheEdifice - amount)} (${FormatTime((CacheEdifice - amount) / (GetCPS() + bonusIncomeUsed))})`;
|
|
||||||
} else l('CMDispTooltipWarnEdifice').style.display = 'none';
|
|
||||||
} else l('CMDispTooltipWarnEdifice').style.display = 'none';
|
|
||||||
|
|
||||||
if (CMOptions.ToolWarnUser > 0) {
|
|
||||||
if (amount < CMOptions.ToolWarnUser * GetCPS() && (TooltipType !== 'b' || Game.buyMode === 1)) {
|
|
||||||
l('CMDispTooltipWarnUser').style.display = '';
|
|
||||||
// Need to update tooltip text dynamically
|
|
||||||
l('CMDispTooltipWarnUser').children[0].textContent = `Purchase of this item will put you under the number of Cookies equal to ${CMOptions.ToolWarnUser} seconds of CPS`;
|
|
||||||
l('CMDispTooltipWarnUserText').textContent = `${Beautify(CMOptions.ToolWarnUser * GetCPS() - amount)} (${FormatTime((CMOptions.ToolWarnUser * GetCPS() - amount) / (GetCPS() + bonusIncomeUsed))})`;
|
|
||||||
} else l('CMDispTooltipWarnUser').style.display = 'none';
|
|
||||||
} else l('CMDispTooltipWarnUser').style.display = 'none';
|
|
||||||
} else if (l('CMDispTooltipWarningParent') !== null) {
|
|
||||||
l('CMDispTooltipWarningParent').remove();
|
l('CMDispTooltipWarningParent').remove();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||||
import { TooltipWrinkler, TooltipWrinklerArea, TooltipWrinklerBeingShown } from '../VariablesAndData';
|
import {
|
||||||
|
TooltipWrinkler,
|
||||||
|
TooltipWrinklerArea,
|
||||||
|
TooltipWrinklerBeingShown,
|
||||||
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function checks and create a tooltip for the wrinklers
|
* This function checks and create a tooltip for the wrinklers
|
||||||
@@ -9,13 +13,17 @@ import { TooltipWrinkler, TooltipWrinklerArea, TooltipWrinklerBeingShown } from
|
|||||||
* As wrinklers are not appended to the DOM we us a different system than for other tooltips
|
* As wrinklers are not appended to the DOM we us a different system than for other tooltips
|
||||||
*/
|
*/
|
||||||
export function CheckWrinklerTooltip() {
|
export function CheckWrinklerTooltip() {
|
||||||
if (CMOptions.TooltipWrink === 1 && TooltipWrinklerArea === 1) { // Latter is set by CM.Main.AddWrinklerAreaDetect
|
if (CMOptions.TooltipWrink === 1 && TooltipWrinklerArea === 1) {
|
||||||
|
// Latter is set by CM.Main.AddWrinklerAreaDetect
|
||||||
let showingTooltip = false;
|
let showingTooltip = false;
|
||||||
for (const i of Object.keys(Game.wrinklers)) {
|
Object.keys(Game.wrinklers).forEach((i) => {
|
||||||
const me = Game.wrinklers[i];
|
const me = Game.wrinklers[i];
|
||||||
if (me.phase > 0 && me.selected) {
|
if (me.phase > 0 && me.selected) {
|
||||||
showingTooltip = true;
|
showingTooltip = true;
|
||||||
if (TooltipWrinklerBeingShown[i] === 0 || TooltipWrinklerBeingShown[i] === undefined) {
|
if (
|
||||||
|
TooltipWrinklerBeingShown[i] === 0 ||
|
||||||
|
TooltipWrinklerBeingShown[i] === undefined
|
||||||
|
) {
|
||||||
const placeholder = document.createElement('div');
|
const placeholder = document.createElement('div');
|
||||||
const wrinkler = document.createElement('div');
|
const wrinkler = document.createElement('div');
|
||||||
wrinkler.style.minWidth = '120px';
|
wrinkler.style.minWidth = '120px';
|
||||||
@@ -28,11 +36,11 @@ export function CheckWrinklerTooltip() {
|
|||||||
Game.tooltip.draw(this, escape(placeholder.innerHTML));
|
Game.tooltip.draw(this, escape(placeholder.innerHTML));
|
||||||
TooltipWrinkler = i;
|
TooltipWrinkler = i;
|
||||||
TooltipWrinklerBeingShown[i] = 1;
|
TooltipWrinklerBeingShown[i] = 1;
|
||||||
} else break;
|
}
|
||||||
} else {
|
} else {
|
||||||
TooltipWrinklerBeingShown[i] = 0;
|
TooltipWrinklerBeingShown[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
if (!showingTooltip) {
|
if (!showingTooltip) {
|
||||||
Game.tooltip.hide();
|
Game.tooltip.hide();
|
||||||
}
|
}
|
||||||
@@ -46,7 +54,7 @@ export function CheckWrinklerTooltip() {
|
|||||||
*/
|
*/
|
||||||
export function UpdateWrinklerTooltip() {
|
export function UpdateWrinklerTooltip() {
|
||||||
if (CMOptions.TooltipWrink === 1 && l('CMTooltipWrinkler') !== null) {
|
if (CMOptions.TooltipWrink === 1 && l('CMTooltipWrinkler') !== null) {
|
||||||
let sucked = Game.wrinklers[TooltipWrinkler].sucked;
|
let { sucked } = Game.wrinklers[TooltipWrinkler];
|
||||||
let toSuck = 1.1;
|
let toSuck = 1.1;
|
||||||
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
||||||
if (Game.wrinklers[TooltipWrinkler].type === 1) toSuck *= 3; // Shiny wrinklers
|
if (Game.wrinklers[TooltipWrinkler].type === 1) toSuck *= 3; // Shiny wrinklers
|
||||||
|
|||||||
@@ -23,7 +23,17 @@ export const ColorPurple = 'Purple';
|
|||||||
export const ColorGray = 'Gray';
|
export const ColorGray = 'Gray';
|
||||||
export const ColorPink = 'Pink';
|
export const ColorPink = 'Pink';
|
||||||
export const ColorBrown = 'Brown';
|
export const ColorBrown = 'Brown';
|
||||||
export const Colors = [ColorGray, ColorBlue, ColorGreen, ColorYellow, ColorOrange, ColorRed, ColorPurple, ColorPink, ColorBrown];
|
export const Colors = [
|
||||||
|
ColorGray,
|
||||||
|
ColorBlue,
|
||||||
|
ColorGreen,
|
||||||
|
ColorYellow,
|
||||||
|
ColorOrange,
|
||||||
|
ColorRed,
|
||||||
|
ColorPurple,
|
||||||
|
ColorPink,
|
||||||
|
ColorBrown,
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This list is used to make some very basic tooltips.
|
* This list is used to make some very basic tooltips.
|
||||||
@@ -34,14 +44,43 @@ export const Colors = [ColorGray, ColorBlue, ColorGreen, ColorYellow, ColorOrang
|
|||||||
*/
|
*/
|
||||||
export const TooltipText = [
|
export const TooltipText = [
|
||||||
['GoldCookTooltipPlaceholder', 'Calculated with Golden Switch off', '200px'],
|
['GoldCookTooltipPlaceholder', 'Calculated with Golden Switch off', '200px'],
|
||||||
['GoldCookDragonsFortuneTooltipPlaceholder', 'Calculated with Golden Switch off and at least one golden cookie on-screen', '240px'],
|
[
|
||||||
['PrestMaxTooltipPlaceholder', 'The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg', '320px'],
|
'GoldCookDragonsFortuneTooltipPlaceholder',
|
||||||
['NextPrestTooltipPlaceholder', 'Calculated with cookies gained from wrinklers and Chocolate egg', '200px'],
|
'Calculated with Golden Switch off and at least one golden cookie on-screen',
|
||||||
['HeavenChipMaxTooltipPlaceholder', 'The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg', '330px'],
|
'240px',
|
||||||
['ResetTooltipPlaceholder', 'The bonus income you would get from new prestige levels unlocked at 100% of its potential and from ascension achievements if you have the same buildings/upgrades after reset', '370px'],
|
],
|
||||||
['ChoEggTooltipPlaceholder', 'The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg', '300px'],
|
[
|
||||||
['ChainNextLevelPlaceholder', 'Cheated cookies might break this formula', '250px'],
|
'PrestMaxTooltipPlaceholder',
|
||||||
|
'The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg',
|
||||||
|
'320px',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'NextPrestTooltipPlaceholder',
|
||||||
|
'Calculated with cookies gained from wrinklers and Chocolate egg',
|
||||||
|
'200px',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'HeavenChipMaxTooltipPlaceholder',
|
||||||
|
'The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg',
|
||||||
|
'330px',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'ResetTooltipPlaceholder',
|
||||||
|
'The bonus income you would get from new prestige levels unlocked at 100% of its potential and from ascension achievements if you have the same buildings/upgrades after reset',
|
||||||
|
'370px',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'ChoEggTooltipPlaceholder',
|
||||||
|
'The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg',
|
||||||
|
'300px',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'ChainNextLevelPlaceholder',
|
||||||
|
'Cheated cookies might break this formula',
|
||||||
|
'250px',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
export const SimpleTooltipElements = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These are variables used by the functions that create tooltips for wrinklers
|
* These are variables used by the functions that create tooltips for wrinklers
|
||||||
@@ -78,7 +117,12 @@ export const ClickTimes = [1, 5, 10, 15, 30];
|
|||||||
* This array is used to give certain timers specific colours
|
* This array is used to give certain timers specific colours
|
||||||
*/
|
*/
|
||||||
export const BuffColors = {
|
export const BuffColors = {
|
||||||
Frenzy: ColorYellow, 'Dragon Harvest': ColorBrown, 'Elder frenzy': ColorGreen, Clot: ColorRed, 'Click frenzy': ColorBlue, Dragonflight: ColorPink,
|
Frenzy: ColorYellow,
|
||||||
|
'Dragon Harvest': ColorBrown,
|
||||||
|
'Elder frenzy': ColorGreen,
|
||||||
|
Clot: ColorRed,
|
||||||
|
'Click frenzy': ColorBlue,
|
||||||
|
Dragonflight: ColorPink,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ export default function init() {
|
|||||||
isInitializing = true;
|
isInitializing = true;
|
||||||
let proceed = true;
|
let proceed = true;
|
||||||
if (Game.version !== Number(VersionMajor)) {
|
if (Game.version !== Number(VersionMajor)) {
|
||||||
proceed = confirm(`Cookie Monster version ${VersionMajor}.${VersionMinor} is meant for Game version ${VersionMajor}. Loading a different version may cause errors. Do you still want to load Cookie Monster?`);
|
proceed = confirm(
|
||||||
|
`Cookie Monster version ${VersionMajor}.${VersionMinor} is meant for Game version ${VersionMajor}. Loading a different version may cause errors. Do you still want to load Cookie Monster?`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (proceed) {
|
if (proceed) {
|
||||||
InitializeCookieMonster();
|
InitializeCookieMonster();
|
||||||
|
|||||||
@@ -11,7 +11,17 @@ export default function load(str) {
|
|||||||
InitData();
|
InitData();
|
||||||
LoadConfig(save.settings);
|
LoadConfig(save.settings);
|
||||||
if (save.version !== `${VersionMajor}.${VersionMinor}`) {
|
if (save.version !== `${VersionMajor}.${VersionMinor}`) {
|
||||||
if (Game.prefs.popups) Game.Popup('A new version of Cookie Monster has been loaded, check out the release notes in the info tab!');
|
if (Game.prefs.popups)
|
||||||
else Game.Notify('A new version of Cookie Monster has been loaded, check out the release notes in the info tab!', '', '', 0, 1);
|
Game.Popup(
|
||||||
|
'A new version of Cookie Monster has been loaded, check out the release notes in the info tab!',
|
||||||
|
);
|
||||||
|
else
|
||||||
|
Game.Notify(
|
||||||
|
'A new version of Cookie Monster has been loaded, check out the release notes in the info tab!',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,13 @@ import { LastGardenNextStep } from '../VariablesAndData';
|
|||||||
* This function checks if a garden tick has happened
|
* This function checks if a garden tick has happened
|
||||||
*/
|
*/
|
||||||
export default function CheckGardenTick() {
|
export default function CheckGardenTick() {
|
||||||
if (Game.Objects.Farm.minigameLoaded && LastGardenNextStep !== Game.Objects.Farm.minigame.nextStep) {
|
if (
|
||||||
|
Game.Objects.Farm.minigameLoaded &&
|
||||||
|
LastGardenNextStep !== Game.Objects.Farm.minigame.nextStep
|
||||||
|
) {
|
||||||
if (LastGardenNextStep !== 0 && LastGardenNextStep < Date.now()) {
|
if (LastGardenNextStep !== 0 && LastGardenNextStep < Date.now()) {
|
||||||
Flash(3, 'GardFlash');
|
Flash(3, 'GardFlash');
|
||||||
PlaySound(CMOptions.GardSoundURL, 'GardSound', 'GardVolume');
|
PlaySound(CMOptions.GardSoundURL, 'GardSound', 'GardVolume', false);
|
||||||
}
|
}
|
||||||
LastGardenNextStep = Game.Objects.Farm.minigame.nextStep;
|
LastGardenNextStep = Game.Objects.Farm.minigame.nextStep;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import { CacheSpawnedGoldenShimmer, CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
|
import {
|
||||||
|
CacheSpawnedGoldenShimmer,
|
||||||
|
CacheGoldenShimmersByID,
|
||||||
|
} from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import CreateGCTimer from '../../Disp/GoldenCookieTimers/GoldenCookieTimers';
|
import CreateGCTimer from '../../Disp/GoldenCookieTimers/GoldenCookieTimers';
|
||||||
import Flash from '../../Disp/Notifications/Flash';
|
import Flash from '../../Disp/Notifications/Flash';
|
||||||
import Notification from '../../Disp/Notifications/Notification';
|
import CreateNotification from '../../Disp/Notifications/Notification';
|
||||||
import PlaySound from '../../Disp/Notifications/Sound';
|
import PlaySound from '../../Disp/Notifications/Sound';
|
||||||
import { UpdateFavicon } from '../../Disp/TabTitle/FavIcon';
|
import { UpdateFavicon } from '../../Disp/TabTitle/FavIcon';
|
||||||
import { GCTimers } from '../../Disp/VariablesAndData';
|
import { GCTimers } from '../../Disp/VariablesAndData';
|
||||||
import { CurrSpawnedGoldenCookieState, LastGoldenCookieState, LastSpawnedGoldenCookieState } from '../VariablesAndData';
|
import {
|
||||||
|
CurrSpawnedGoldenCookieState,
|
||||||
|
LastGoldenCookieState,
|
||||||
|
LastSpawnedGoldenCookieState,
|
||||||
|
} from '../VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auxilirary function that finds all currently spawned shimmers.
|
* Auxilirary function that finds all currently spawned shimmers.
|
||||||
@@ -17,13 +24,13 @@ import { CurrSpawnedGoldenCookieState, LastGoldenCookieState, LastSpawnedGoldenC
|
|||||||
function FindShimmer() {
|
function FindShimmer() {
|
||||||
CurrSpawnedGoldenCookieState = 0;
|
CurrSpawnedGoldenCookieState = 0;
|
||||||
CacheGoldenShimmersByID = {};
|
CacheGoldenShimmersByID = {};
|
||||||
for (const i of Object.keys(Game.shimmers)) {
|
Object.keys(Game.shimmers).forEach((i) => {
|
||||||
CacheGoldenShimmersByID[Game.shimmers[i].id] = Game.shimmers[i];
|
CacheGoldenShimmersByID[Game.shimmers[i].id] = Game.shimmers[i];
|
||||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'golden') {
|
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'golden') {
|
||||||
CacheSpawnedGoldenShimmer = Game.shimmers[i];
|
CacheSpawnedGoldenShimmer = Game.shimmers[i];
|
||||||
CurrSpawnedGoldenCookieState += 1;
|
CurrSpawnedGoldenCookieState += 1;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,35 +39,42 @@ function FindShimmer() {
|
|||||||
*/
|
*/
|
||||||
export default function CheckGoldenCookie() {
|
export default function CheckGoldenCookie() {
|
||||||
FindShimmer();
|
FindShimmer();
|
||||||
for (const i of Object.keys(GCTimers)) {
|
Object.keys(GCTimers).forEach((i) => {
|
||||||
if (typeof CacheGoldenShimmersByID[i] === 'undefined') {
|
if (typeof CacheGoldenShimmersByID[i] === 'undefined') {
|
||||||
GCTimers[i].parentNode.removeChild(GCTimers[i]);
|
GCTimers[i].parentNode.removeChild(GCTimers[i]);
|
||||||
delete GCTimers[i];
|
delete GCTimers[i];
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
if (LastGoldenCookieState !== Game.shimmerTypes.golden.n) {
|
if (LastGoldenCookieState !== Game.shimmerTypes.golden.n) {
|
||||||
LastGoldenCookieState = Game.shimmerTypes.golden.n;
|
LastGoldenCookieState = Game.shimmerTypes.golden.n;
|
||||||
if (LastGoldenCookieState) {
|
if (LastGoldenCookieState) {
|
||||||
if (LastSpawnedGoldenCookieState < CurrSpawnedGoldenCookieState) {
|
if (LastSpawnedGoldenCookieState < CurrSpawnedGoldenCookieState) {
|
||||||
Flash(3, 'GCFlash');
|
Flash(3, 'GCFlash');
|
||||||
PlaySound(CMOptions.GCSoundURL, 'GCSound', 'GCVolume');
|
PlaySound(CMOptions.GCSoundURL, 'GCSound', 'GCVolume', false);
|
||||||
Notification('GCNotification', 'Golden Cookie Spawned', 'A Golden Cookie has spawned. Click it now!');
|
CreateNotification(
|
||||||
|
'GCNotification',
|
||||||
|
'Golden Cookie Spawned',
|
||||||
|
'A Golden Cookie has spawned. Click it now!',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const i of Object.keys(Game.shimmers)) {
|
Object.keys(Game.shimmers).forEach((i) => {
|
||||||
if (typeof GCTimers[Game.shimmers[i].id] === 'undefined') {
|
if (typeof GCTimers[Game.shimmers[i].id] === 'undefined') {
|
||||||
CreateGCTimer(Game.shimmers[i]);
|
CreateGCTimer(Game.shimmers[i]);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
UpdateFavicon();
|
UpdateFavicon();
|
||||||
LastSpawnedGoldenCookieState = CurrSpawnedGoldenCookieState;
|
LastSpawnedGoldenCookieState = CurrSpawnedGoldenCookieState;
|
||||||
if (CurrSpawnedGoldenCookieState === 0) CacheSpawnedGoldenShimmer = 0;
|
if (CurrSpawnedGoldenCookieState === 0) CacheSpawnedGoldenShimmer = 0;
|
||||||
} else if (CMOptions.GCTimer === 1 && LastGoldenCookieState) {
|
} else if (CMOptions.GCTimer === 1 && LastGoldenCookieState) {
|
||||||
for (const i of Object.keys(GCTimers)) {
|
Object.keys(GCTimers).forEach((i) => {
|
||||||
GCTimers[i].style.opacity = CacheGoldenShimmersByID[i].l.style.opacity;
|
GCTimers[i].style.opacity = CacheGoldenShimmersByID[i].l.style.opacity;
|
||||||
GCTimers[i].style.transform = CacheGoldenShimmersByID[i].l.style.transform;
|
GCTimers[i].style.transform =
|
||||||
GCTimers[i].textContent = Math.ceil(CacheGoldenShimmersByID[i].life / Game.fps);
|
CacheGoldenShimmersByID[i].l.style.transform;
|
||||||
}
|
GCTimers[i].textContent = Math.ceil(
|
||||||
|
CacheGoldenShimmersByID[i].life / Game.fps,
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import Flash from '../../Disp/Notifications/Flash';
|
import Flash from '../../Disp/Notifications/Flash';
|
||||||
import Notification from '../../Disp/Notifications/Notification';
|
import CreateNotification from '../../Disp/Notifications/Notification';
|
||||||
import PlaySound from '../../Disp/Notifications/Sound';
|
import PlaySound from '../../Disp/Notifications/Sound';
|
||||||
import { LastMagicBarFull } from '../VariablesAndData';
|
import { LastMagicBarFull } from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -9,14 +9,21 @@ import { LastMagicBarFull } from '../VariablesAndData';
|
|||||||
* It is called by CM.Main.Loop
|
* It is called by CM.Main.Loop
|
||||||
*/
|
*/
|
||||||
export default function CheckMagicMeter() {
|
export default function CheckMagicMeter() {
|
||||||
if (Game.Objects['Wizard tower'].minigameLoaded && CMOptions.GrimoireBar === 1) {
|
if (
|
||||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
Game.Objects['Wizard tower'].minigameLoaded &&
|
||||||
|
CMOptions.GrimoireBar === 1
|
||||||
|
) {
|
||||||
|
const { minigame } = Game.Objects['Wizard tower'];
|
||||||
if (minigame.magic < minigame.magicM) LastMagicBarFull = false;
|
if (minigame.magic < minigame.magicM) LastMagicBarFull = false;
|
||||||
else if (!LastMagicBarFull) {
|
else if (!LastMagicBarFull) {
|
||||||
LastMagicBarFull = true;
|
LastMagicBarFull = true;
|
||||||
Flash(3, 'MagicFlash');
|
Flash(3, 'MagicFlash');
|
||||||
PlaySound(CMOptions.MagicSoundURL, 'MagicSound', 'MagicVolume');
|
PlaySound(CMOptions.MagicSoundURL, 'MagicSound', 'MagicVolume', false);
|
||||||
Notification('MagicNotification', 'Magic Meter full', 'Your Magic Meter is full. Cast a spell!');
|
CreateNotification(
|
||||||
|
'MagicNotification',
|
||||||
|
'Magic Meter full',
|
||||||
|
'Your Magic Meter is full. Cast a spell!',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { CacheSeasonPopShimmer } from '../../Cache/VariablesAndData';
|
import { CacheSeasonPopShimmer } from '../../Cache/VariablesAndData';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import Flash from '../../Disp/Notifications/Flash';
|
import Flash from '../../Disp/Notifications/Flash';
|
||||||
import Notification from '../../Disp/Notifications/Notification';
|
import CreateNotification from '../../Disp/Notifications/Notification';
|
||||||
import PlaySound from '../../Disp/Notifications/Sound';
|
import PlaySound from '../../Disp/Notifications/Sound';
|
||||||
import { LastSeasonPopupState } from '../VariablesAndData';
|
import { LastSeasonPopupState } from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -13,14 +13,17 @@ import { LastSeasonPopupState } from '../VariablesAndData';
|
|||||||
export default function CheckSeasonPopup() {
|
export default function CheckSeasonPopup() {
|
||||||
if (LastSeasonPopupState !== Game.shimmerTypes.reindeer.spawned) {
|
if (LastSeasonPopupState !== Game.shimmerTypes.reindeer.spawned) {
|
||||||
LastSeasonPopupState = Game.shimmerTypes.reindeer.spawned;
|
LastSeasonPopupState = Game.shimmerTypes.reindeer.spawned;
|
||||||
for (const i of Object.keys(Game.shimmers)) {
|
Object.keys(Game.shimmers).forEach((i) => {
|
||||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'reindeer') {
|
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'reindeer') {
|
||||||
CacheSeasonPopShimmer = Game.shimmers[i];
|
CacheSeasonPopShimmer = Game.shimmers[i];
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
Flash(3, 'SeaFlash');
|
Flash(3, 'SeaFlash');
|
||||||
PlaySound(CMOptions.SeaSoundURL, 'SeaSound', 'SeaVolume');
|
PlaySound(CMOptions.SeaSoundURL, 'SeaSound', 'SeaVolume', false);
|
||||||
Notification('SeaNotification', 'Reindeer sighted!', 'A Reindeer has spawned. Click it now!');
|
CreateNotification(
|
||||||
|
'SeaNotification',
|
||||||
|
'Reindeer sighted!',
|
||||||
|
'A Reindeer has spawned. Click it now!',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import Flash from '../../Disp/Notifications/Flash';
|
import Flash from '../../Disp/Notifications/Flash';
|
||||||
import Notification from '../../Disp/Notifications/Notification';
|
import CreateNotification from '../../Disp/Notifications/Notification';
|
||||||
import PlaySound from '../../Disp/Notifications/Sound';
|
import PlaySound from '../../Disp/Notifications/Sound';
|
||||||
import { LastTickerFortuneState } from '../VariablesAndData';
|
import { LastTickerFortuneState } from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -8,12 +9,25 @@ import { LastTickerFortuneState } from '../VariablesAndData';
|
|||||||
* It is called by CM.Main.Loop
|
* It is called by CM.Main.Loop
|
||||||
*/
|
*/
|
||||||
export default function CheckTickerFortune() {
|
export default function CheckTickerFortune() {
|
||||||
if (LastTickerFortuneState !== (Game.TickerEffect && Game.TickerEffect.type === 'fortune')) {
|
if (
|
||||||
LastTickerFortuneState = (Game.TickerEffect && Game.TickerEffect.type === 'fortune');
|
LastTickerFortuneState !==
|
||||||
|
(Game.TickerEffect && Game.TickerEffect.type === 'fortune')
|
||||||
|
) {
|
||||||
|
LastTickerFortuneState =
|
||||||
|
Game.TickerEffect && Game.TickerEffect.type === 'fortune';
|
||||||
if (LastTickerFortuneState) {
|
if (LastTickerFortuneState) {
|
||||||
Flash(3, 'FortuneFlash');
|
Flash(3, 'FortuneFlash');
|
||||||
PlaySound(CM.Options.FortuneSoundURL, 'FortuneSound', 'FortuneVolume');
|
PlaySound(
|
||||||
Notification('FortuneNotification', 'Fortune Cookie found', 'A Fortune Cookie has appeared on the Ticker.');
|
CMOptions.FortuneSoundURL,
|
||||||
|
'FortuneSound',
|
||||||
|
'FortuneVolume',
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
CreateNotification(
|
||||||
|
'FortuneNotification',
|
||||||
|
'Fortune Cookie found',
|
||||||
|
'A Fortune Cookie has appeared on the Ticker.',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
import Flash from '../../Disp/Notifications/Flash';
|
import Flash from '../../Disp/Notifications/Flash';
|
||||||
import Notification from '../../Disp/Notifications/Notification';
|
import CreateNotification from '../../Disp/Notifications/Notification';
|
||||||
import PlaySound from '../../Disp/Notifications/Sound';
|
import PlaySound from '../../Disp/Notifications/Sound';
|
||||||
import { LastWrinklerCount } from '../VariablesAndData';
|
import { LastWrinklerCount } from '../VariablesAndData';
|
||||||
|
|
||||||
@@ -11,25 +11,52 @@ import { LastWrinklerCount } from '../VariablesAndData';
|
|||||||
export default function CheckWrinklerCount() {
|
export default function CheckWrinklerCount() {
|
||||||
if (Game.elderWrath > 0) {
|
if (Game.elderWrath > 0) {
|
||||||
let CurrentWrinklers = 0;
|
let CurrentWrinklers = 0;
|
||||||
for (const i in Game.wrinklers) {
|
Object.keys(Game.wrinklers).forEach((i) => {
|
||||||
if (Game.wrinklers[i].phase === 2) CurrentWrinklers++;
|
if (Game.wrinklers[i].phase === 2) CurrentWrinklers += 1;
|
||||||
}
|
});
|
||||||
if (CurrentWrinklers > LastWrinklerCount) {
|
if (CurrentWrinklers > LastWrinklerCount) {
|
||||||
LastWrinklerCount = CurrentWrinklers;
|
LastWrinklerCount = CurrentWrinklers;
|
||||||
if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxFlash) {
|
if (
|
||||||
|
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||||
|
CMOptions.WrinklerMaxFlash
|
||||||
|
) {
|
||||||
Flash(3, 'WrinklerMaxFlash');
|
Flash(3, 'WrinklerMaxFlash');
|
||||||
} else {
|
} else {
|
||||||
Flash(3, 'WrinklerFlash');
|
Flash(3, 'WrinklerFlash');
|
||||||
}
|
}
|
||||||
if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxSound) {
|
if (
|
||||||
PlaySound(CMOptions.WrinklerMaxSoundURL, 'WrinklerMaxSound', 'WrinklerMaxVolume');
|
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||||
|
CMOptions.WrinklerMaxSound
|
||||||
|
) {
|
||||||
|
PlaySound(
|
||||||
|
CMOptions.WrinklerMaxSoundURL,
|
||||||
|
'WrinklerMaxSound',
|
||||||
|
'WrinklerMaxVolume',
|
||||||
|
false,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
PlaySound(CMOptions.WrinklerSoundURL, 'WrinklerSound', 'WrinklerVolume');
|
PlaySound(
|
||||||
|
CMOptions.WrinklerSoundURL,
|
||||||
|
'WrinklerSound',
|
||||||
|
'WrinklerVolume',
|
||||||
|
false,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxNotification) {
|
if (
|
||||||
Notification('WrinklerMaxNotification', 'Maximum Wrinklers Reached', 'You have reached your maximum ammount of wrinklers');
|
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||||
|
CMOptions.WrinklerMaxNotification
|
||||||
|
) {
|
||||||
|
CreateNotification(
|
||||||
|
'WrinklerMaxNotification',
|
||||||
|
'Maximum Wrinklers Reached',
|
||||||
|
'You have reached your maximum ammount of wrinklers',
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
Notification('WrinklerNotification', 'A Wrinkler appeared', 'A new wrinkler has appeared');
|
CreateNotification(
|
||||||
|
'WrinklerNotification',
|
||||||
|
'A Wrinkler appeared',
|
||||||
|
'A new wrinkler has appeared',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LastWrinklerCount = CurrentWrinklers;
|
LastWrinklerCount = CurrentWrinklers;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
|||||||
import CreateUpgradeBar from '../Disp/BuildingsUpgrades/UpgradeBar';
|
import CreateUpgradeBar from '../Disp/BuildingsUpgrades/UpgradeBar';
|
||||||
import { CreateBotBar } from '../Disp/InfoBars/BottomBar';
|
import { CreateBotBar } from '../Disp/InfoBars/BottomBar';
|
||||||
import { CreateTimerBar } from '../Disp/InfoBars/TimerBar';
|
import { CreateTimerBar } from '../Disp/InfoBars/TimerBar';
|
||||||
|
import CreateSectionHideButtons from '../Disp/Initialization/CreateSectionHideButtons';
|
||||||
import CreateWrinklerButtons from '../Disp/Initialization/CreateWrinklerButton';
|
import CreateWrinklerButtons from '../Disp/Initialization/CreateWrinklerButton';
|
||||||
import CreateCssArea from '../Disp/Initialization/CssArea';
|
import CreateCssArea from '../Disp/Initialization/CssArea';
|
||||||
import UpdateBuildingUpgradeStyle from '../Disp/Initialization/UpdateBuildingUpgradeStyle';
|
import UpdateBuildingUpgradeStyle from '../Disp/Initialization/UpdateBuildingUpgradeStyle';
|
||||||
@@ -37,10 +38,15 @@ export default function InitializeCookieMonster() {
|
|||||||
CreateTimerBar();
|
CreateTimerBar();
|
||||||
CreateUpgradeBar();
|
CreateUpgradeBar();
|
||||||
CreateWhiteScreen();
|
CreateWhiteScreen();
|
||||||
|
CreateSectionHideButtons();
|
||||||
CreateFavicon();
|
CreateFavicon();
|
||||||
for (const i of Object.keys(TooltipText)) {
|
Object.keys(TooltipText).forEach((i) => {
|
||||||
CreateSimpleTooltip(TooltipText[i][0], TooltipText[i][1], TooltipText[i][2]);
|
CreateSimpleTooltip(
|
||||||
}
|
TooltipText[i][0],
|
||||||
|
TooltipText[i][1],
|
||||||
|
TooltipText[i][2],
|
||||||
|
);
|
||||||
|
});
|
||||||
CreateWrinklerButtons();
|
CreateWrinklerButtons();
|
||||||
UpdateBuildingUpgradeStyle();
|
UpdateBuildingUpgradeStyle();
|
||||||
|
|
||||||
@@ -55,8 +61,18 @@ export default function InitializeCookieMonster() {
|
|||||||
LoadConfig(); // Must be after all things are created!
|
LoadConfig(); // Must be after all things are created!
|
||||||
CMLastAscendState = Game.OnAscend;
|
CMLastAscendState = Game.OnAscend;
|
||||||
|
|
||||||
if (Game.prefs.popups) Game.Popup(`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`);
|
if (Game.prefs.popups)
|
||||||
else Game.Notify(`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`, '', '', 1, 1);
|
Game.Popup(
|
||||||
|
`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`,
|
||||||
|
);
|
||||||
|
else
|
||||||
|
Game.Notify(
|
||||||
|
`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
);
|
||||||
|
|
||||||
Game.Win('Third-party');
|
Game.Win('Third-party');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,21 @@ import LoopCache from '../Cache/CacheLoop';
|
|||||||
import CacheNoGoldSwitchCPS from '../Cache/CPS/NoGoldSwitchCPS';
|
import CacheNoGoldSwitchCPS from '../Cache/CPS/NoGoldSwitchCPS';
|
||||||
import CacheSellAllForChoEgg from '../Cache/CPS/SellChoEgg';
|
import CacheSellAllForChoEgg from '../Cache/CPS/SellChoEgg';
|
||||||
import CacheDragonCost from '../Cache/Dragon/Dragon';
|
import CacheDragonCost from '../Cache/Dragon/Dragon';
|
||||||
import { CacheBuildingsPrices, CacheIncome } from '../Cache/PriceAndIncome/PriceAndIncome';
|
import CachePantheonGods from '../Cache/PantheonGods/CacheGods';
|
||||||
|
import {
|
||||||
|
CacheBuildingsPrices,
|
||||||
|
CacheIncome,
|
||||||
|
} from '../Cache/PriceAndIncome/PriceAndIncome';
|
||||||
import { CacheChain } from '../Cache/Stats/ChainCookies';
|
import { CacheChain } from '../Cache/Stats/ChainCookies';
|
||||||
import CacheAllMissingUpgrades from '../Cache/Stats/MissingUpgrades';
|
import CacheAllMissingUpgrades from '../Cache/Stats/MissingUpgrades';
|
||||||
import CacheSeasonSpec from '../Cache/Stats/Reindeer';
|
import CacheSeasonSpec from '../Cache/Stats/Reindeer';
|
||||||
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from '../Cache/Stats/Stats';
|
|
||||||
import {
|
import {
|
||||||
CacheDoRemakeBuildPrices, CacheHadBuildAura,
|
CacheGoldenAndWrathCookiesMults,
|
||||||
|
CacheStatsCookies,
|
||||||
|
} from '../Cache/Stats/Stats';
|
||||||
|
import {
|
||||||
|
CacheDoRemakeBuildPrices,
|
||||||
|
CacheHadBuildAura,
|
||||||
} from '../Cache/VariablesAndData';
|
} from '../Cache/VariablesAndData';
|
||||||
import UpdateAscendState from '../Disp/HelperFunctions/UpdateAscendState';
|
import UpdateAscendState from '../Disp/HelperFunctions/UpdateAscendState';
|
||||||
import { LastAscendState } from '../Disp/VariablesAndData';
|
import { LastAscendState } from '../Disp/VariablesAndData';
|
||||||
@@ -50,6 +58,7 @@ export default function CMLoop() {
|
|||||||
CacheAllMissingUpgrades();
|
CacheAllMissingUpgrades();
|
||||||
CacheChain();
|
CacheChain();
|
||||||
CacheDragonCost();
|
CacheDragonCost();
|
||||||
|
CachePantheonGods();
|
||||||
|
|
||||||
CacheSeasonSpec();
|
CacheSeasonSpec();
|
||||||
CacheSellAllForChoEgg();
|
CacheSellAllForChoEgg();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user