Added prettier (#661)
* Added prettier * Added prettier * Added prettier
This commit is contained in:
@@ -13,26 +13,21 @@ module.exports = {
|
||||
CM: 'writable',
|
||||
unsafeWindow: 'readonly',
|
||||
},
|
||||
extends: 'airbnb-base',
|
||||
extends: ['airbnb-base', 'plugin:prettier/recommended'],
|
||||
parserOptions: {
|
||||
ecmaVersion: 12,
|
||||
},
|
||||
rules: {
|
||||
indent: ['error', 'tab'],
|
||||
'import/no-named-default': 'off',
|
||||
'import/no-mutable-exports': 'off',
|
||||
'no-tabs': 'off',
|
||||
'max-len': 'off',
|
||||
'no-param-reassign': 'off',
|
||||
'no-plusplus': 'off',
|
||||
'no-new-func': 'off',
|
||||
'no-restricted-syntax': 'off',
|
||||
'no-mixed-operators': 'off',
|
||||
'prefer-destructuring': 'off',
|
||||
'func-names': 'off',
|
||||
'no-console': 'off',
|
||||
'no-nested-ternary': 'off',
|
||||
'prefer-arrow-callback': 'off',
|
||||
'no-new': 'off',
|
||||
'no-alert': 'off',
|
||||
'no-restricted-globals': 'off',
|
||||
|
||||
5
.prettierrc.json
Normal file
5
.prettierrc.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 80
|
||||
}
|
||||
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
107
package-lock.json
generated
107
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "cookiemonster-mod",
|
||||
"version": "2.031.5",
|
||||
"version": "2.031.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "cookiemonster-mod",
|
||||
"version": "2.031.5",
|
||||
"version": "2.031.6",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eastdesire/jscolor": "^2.4.5"
|
||||
@@ -14,8 +14,11 @@
|
||||
"devDependencies": {
|
||||
"eslint": "^7.19.0",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "2.2.1",
|
||||
"webpack": "^5.24.4",
|
||||
"webpack-cli": "^4.5.0"
|
||||
}
|
||||
@@ -857,6 +860,18 @@
|
||||
"eslint-plugin-import": "^2.22.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-config-prettier": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz",
|
||||
"integrity": "sha512-oKMhGv3ihGbCIimCAjqkdzx2Q+jthoqnXSP+d86M9tptwugycmTFdVR4IpLgq2c4SHifbwO90z2fQ8/Aio73yw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"eslint-config-prettier": "bin/cli.js"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-import-resolver-node": {
|
||||
"version": "0.3.4",
|
||||
"dev": true,
|
||||
@@ -954,6 +969,27 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/eslint-plugin-prettier": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz",
|
||||
"integrity": "sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"prettier-linter-helpers": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": ">=5.0.0",
|
||||
"prettier": ">=1.13.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"eslint-config-prettier": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-scope": {
|
||||
"version": "5.1.1",
|
||||
"dev": true,
|
||||
@@ -1118,6 +1154,12 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-diff": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
|
||||
"integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/fast-json-stable-stringify": {
|
||||
"version": "2.1.0",
|
||||
"dev": true,
|
||||
@@ -2271,6 +2313,30 @@
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz",
|
||||
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"prettier": "bin-prettier.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier-linter-helpers": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
|
||||
"integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fast-diff": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/progress": {
|
||||
"version": "2.0.3",
|
||||
"dev": true,
|
||||
@@ -3639,6 +3705,13 @@
|
||||
"object.entries": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"eslint-config-prettier": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz",
|
||||
"integrity": "sha512-oKMhGv3ihGbCIimCAjqkdzx2Q+jthoqnXSP+d86M9tptwugycmTFdVR4IpLgq2c4SHifbwO90z2fQ8/Aio73yw==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"eslint-import-resolver-node": {
|
||||
"version": "0.3.4",
|
||||
"dev": true,
|
||||
@@ -3721,6 +3794,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"eslint-plugin-prettier": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz",
|
||||
"integrity": "sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"prettier-linter-helpers": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"eslint-scope": {
|
||||
"version": "5.1.1",
|
||||
"dev": true,
|
||||
@@ -3822,6 +3904,12 @@
|
||||
"version": "3.1.3",
|
||||
"dev": true
|
||||
},
|
||||
"fast-diff": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
|
||||
"integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
|
||||
"dev": true
|
||||
},
|
||||
"fast-json-stable-stringify": {
|
||||
"version": "2.1.0",
|
||||
"dev": true
|
||||
@@ -4538,6 +4626,21 @@
|
||||
"version": "1.2.1",
|
||||
"dev": true
|
||||
},
|
||||
"prettier": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz",
|
||||
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==",
|
||||
"dev": true
|
||||
},
|
||||
"prettier-linter-helpers": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
|
||||
"integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-diff": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"progress": {
|
||||
"version": "2.0.3",
|
||||
"dev": true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cookiemonster-mod",
|
||||
"version": "2.031.6",
|
||||
"version": "2.031.5",
|
||||
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
|
||||
"main": "CookieMonster.js",
|
||||
"keywords": [
|
||||
@@ -45,8 +45,11 @@
|
||||
"devDependencies": {
|
||||
"eslint": "^7.19.0",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "2.2.1",
|
||||
"webpack": "^5.24.4",
|
||||
"webpack-cli": "^4.5.0"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||
import {
|
||||
ChoEggDiff, ClicksDiff, CookiesDiff, WrinkDiff, WrinkFattestDiff,
|
||||
ChoEggDiff,
|
||||
ClicksDiff,
|
||||
CookiesDiff,
|
||||
WrinkDiff,
|
||||
WrinkFattestDiff,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -33,7 +37,11 @@ export class CMAvgQueue {
|
||||
if (timePeriod > this.maxLength) timePeriod = this.maxLength;
|
||||
if (timePeriod > this.queue.length) timePeriod = this.queue.length;
|
||||
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 - timePeriod;
|
||||
i--
|
||||
) {
|
||||
ret += this.queue[i];
|
||||
}
|
||||
if (ret === 0) {
|
||||
|
||||
@@ -3,7 +3,28 @@
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||
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';
|
||||
|
||||
/**
|
||||
@@ -25,10 +46,13 @@ export default function CacheAvgCPS() {
|
||||
|
||||
// Add recent gains to AvgQueue's
|
||||
const timeDiff = currDate - CacheLastCPSCheck;
|
||||
const bankDiffAvg = Math.max(0, (Game.cookies - CacheLastCookies)) / timeDiff;
|
||||
const wrinkDiffAvg = Math.max(0, (CacheWrinklersTotal - CacheLastWrinkCookies)) / timeDiff;
|
||||
const wrinkFattestDiffAvg = Math.max(0, (CacheWrinklersFattest[0] - CacheLastWrinkFattestCookies)) / timeDiff;
|
||||
const choEggDiffAvg = Math.max(0, (choEggTotal - CacheLastChoEgg)) / timeDiff;
|
||||
const bankDiffAvg = Math.max(0, Game.cookies - CacheLastCookies) / timeDiff;
|
||||
const wrinkDiffAvg =
|
||||
Math.max(0, CacheWrinklersTotal - CacheLastWrinkCookies) / timeDiff;
|
||||
const wrinkFattestDiffAvg =
|
||||
Math.max(0, CacheWrinklersFattest[0] - CacheLastWrinkFattestCookies) /
|
||||
timeDiff;
|
||||
const choEggDiffAvg = Math.max(0, choEggTotal - CacheLastChoEgg) / timeDiff;
|
||||
const clicksDiffAvg = (Game.cookieClicks - CacheLastClicks) / timeDiff;
|
||||
for (let i = 0; i < timeDiff; i++) {
|
||||
CookiesDiff.addLatest(bankDiffAvg);
|
||||
@@ -54,14 +78,21 @@ export default function CacheAvgCPS() {
|
||||
CacheAverageGainChoEgg = ChoEggDiff.calcAverage(cpsLength);
|
||||
CacheAverageCPS = CacheAverageGainBank;
|
||||
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) {
|
||||
CacheAvgCPSWithChoEgg = CacheAverageGainBank + CacheAverageGainWrink + (choEgg ? CacheAverageGainChoEgg : 0);
|
||||
CacheAvgCPSWithChoEgg =
|
||||
CacheAverageGainBank +
|
||||
CacheAverageGainWrink +
|
||||
(choEgg ? CacheAverageGainChoEgg : 0);
|
||||
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
|
||||
|
||||
CacheAverageClicks = ClicksDiff.calcAverage(ClickTimes[CMOptions.AvgClicksHist]);
|
||||
CacheAverageClicks = ClicksDiff.calcAverage(
|
||||
ClickTimes[CMOptions.AvgClicksHist],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||
import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData';
|
||||
import {
|
||||
CacheCurrWrinklerCount,
|
||||
CacheCurrWrinklerCPSMult,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This functions caches the current Wrinkler CPS multiplier
|
||||
@@ -21,5 +24,10 @@ export default function CacheCurrWrinklerCPS() {
|
||||
else if (godLvl === 3) godMult *= 1.05;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
export default function GetCPSBuffMult() {
|
||||
let mult = 1;
|
||||
for (const i of Object.keys(Game.buffs)) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -3,12 +3,18 @@ import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
|
||||
import CacheAvgCPS from './CPS/CPS';
|
||||
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
||||
import CachePP from './PP/PP';
|
||||
import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome';
|
||||
import {
|
||||
CacheBuildingsPrices,
|
||||
CacheIncome,
|
||||
} from './PriceAndIncome/PriceAndIncome';
|
||||
import { CacheChain } from './Stats/ChainCookies';
|
||||
import CacheHeavenlyChipsPS from './Stats/HeavenlyChips';
|
||||
import CacheAllMissingUpgrades from './Stats/MissingUpgrades';
|
||||
import CacheSeasonSpec from './Stats/Reindeer';
|
||||
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats';
|
||||
import {
|
||||
CacheGoldenAndWrathCookiesMults,
|
||||
CacheStatsCookies,
|
||||
} from './Stats/Stats';
|
||||
import { HeavenlyChipsDiff } from './VariablesAndData';
|
||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||
|
||||
|
||||
@@ -21,6 +21,11 @@ export default function LoopCache() {
|
||||
CacheAvgCPS();
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -5,7 +5,10 @@ import { Beautify } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
||||
import {
|
||||
CacheCostDragonUpgrade, CacheDragonAura, CacheDragonAura2, CacheLastDragonLevel,
|
||||
CacheCostDragonUpgrade,
|
||||
CacheDragonAura,
|
||||
CacheDragonAura2,
|
||||
CacheLastDragonLevel,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -13,9 +16,16 @@ import {
|
||||
*/
|
||||
export default function CacheDragonCost() {
|
||||
if (CacheLastDragonLevel !== Game.dragonLevel || SimDoSims) {
|
||||
if (Game.dragonLevel < 25 && 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 (
|
||||
Game.dragonLevel < 25 &&
|
||||
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') {
|
||||
target = target.replaceAll("'", '');
|
||||
if (Game.Objects[target].amount < amount) {
|
||||
@@ -24,13 +34,19 @@ export default function CacheDragonCost() {
|
||||
let cost = 0;
|
||||
CopyData();
|
||||
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 = Math.ceil(price);
|
||||
cost += price;
|
||||
SimObjects[target].amount--;
|
||||
}
|
||||
CacheCostDragonUpgrade = `Cost to rebuy: ${(cost)}`;
|
||||
CacheCostDragonUpgrade = `Cost to rebuy: ${cost}`;
|
||||
}
|
||||
} else {
|
||||
let cost = 0;
|
||||
@@ -42,7 +58,13 @@ export default function CacheDragonCost() {
|
||||
break;
|
||||
} else {
|
||||
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 = Math.ceil(price);
|
||||
cost += price;
|
||||
|
||||
@@ -4,7 +4,12 @@ import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
||||
import { ColorGray } from '../../Disp/VariablesAndData';
|
||||
import {
|
||||
CacheArrayOfPPs,
|
||||
CacheMaxPP, CacheMidPP, CacheMinPP, CacheObjects1, CacheObjects10, CacheObjects100,
|
||||
CacheMaxPP,
|
||||
CacheMidPP,
|
||||
CacheMinPP,
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
CacheObjects100,
|
||||
} from '../VariablesAndData';
|
||||
import ColourOfPP from './ColourOfPP';
|
||||
|
||||
@@ -16,8 +21,11 @@ import ColourOfPP from './ColourOfPP';
|
||||
function CacheBuildingsBulkPP(target) {
|
||||
for (const i of Object.keys(target)) {
|
||||
if (Game.cookiesPs) {
|
||||
target[i].pp = (Math.max(target[i].price - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs) + (target[i].price / target[i].bonus);
|
||||
} else target[i].pp = (target[i].price / target[i].bonus);
|
||||
target[i].pp =
|
||||
Math.max(target[i].price - (Game.cookies + GetWrinkConfigBank()), 0) /
|
||||
Game.cookiesPs +
|
||||
target[i].price / target[i].bonus;
|
||||
} else target[i].pp = target[i].price / target[i].bonus;
|
||||
|
||||
target[i].color = ColourOfPP(target[i], target[i].price);
|
||||
}
|
||||
@@ -37,8 +45,16 @@ export default function CacheBuildingsPP() {
|
||||
if (CMOptions.ColorPPBulkMode === 0 && Game.buyMode > 0) {
|
||||
for (const i of Object.keys(CacheObjects1)) {
|
||||
if (Game.cookiesPs) {
|
||||
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);
|
||||
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
|
||||
@@ -53,12 +69,16 @@ export default function CacheBuildingsPP() {
|
||||
}
|
||||
CacheMinPP = CacheArrayOfPPs[CMOptions.PPExcludeTop][0];
|
||||
CacheMaxPP = CacheArrayOfPPs[CacheArrayOfPPs.length - 1][0];
|
||||
CacheMidPP = ((CacheMaxPP - CacheMinPP) / 2) + CacheMinPP;
|
||||
CacheMidPP = (CacheMaxPP - CacheMinPP) / 2 + CacheMinPP;
|
||||
for (const i of Object.keys(CacheObjects1)) {
|
||||
CacheObjects1[i].color = ColourOfPP(CacheObjects1[i], Game.Objects[i].getPrice());
|
||||
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;
|
||||
if (CacheObjects1[i].pp === CacheArrayOfPPs[j][0])
|
||||
CacheObjects1[i].color = ColorGray;
|
||||
}
|
||||
}
|
||||
// Calculate PP of bulk-buy modes
|
||||
@@ -72,8 +92,14 @@ export default function CacheBuildingsPP() {
|
||||
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);
|
||||
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
|
||||
@@ -88,7 +114,7 @@ export default function CacheBuildingsPP() {
|
||||
}
|
||||
CacheMinPP = CacheArrayOfPPs[CMOptions.PPExcludeTop][0];
|
||||
CacheMaxPP = CacheArrayOfPPs[CacheArrayOfPPs.length - 1][0];
|
||||
CacheMidPP = ((CacheMaxPP - CacheMinPP) / 2) + CacheMinPP;
|
||||
CacheMidPP = (CacheMaxPP - CacheMinPP) / 2 + CacheMinPP;
|
||||
|
||||
for (const i of Object.keys(CacheObjects1)) {
|
||||
target[i].color = ColourOfPP(target[i], Game.Objects[i].bulkPrice);
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
||||
import {
|
||||
ColorBlue, ColorGray, ColorGreen, ColorOrange, ColorPurple, ColorRed, ColorYellow,
|
||||
ColorBlue,
|
||||
ColorGray,
|
||||
ColorGreen,
|
||||
ColorOrange,
|
||||
ColorPurple,
|
||||
ColorRed,
|
||||
ColorYellow,
|
||||
} from '../../Disp/VariablesAndData';
|
||||
import { CacheMaxPP, CacheMidPP, CacheMinPP } from '../VariablesAndData';
|
||||
|
||||
@@ -25,7 +31,8 @@ export default function ColourOfPP(me, price) {
|
||||
|
||||
// Colour based on price in terms of CPS
|
||||
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
|
||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
||||
|
||||
@@ -9,10 +9,21 @@ import ColourOfPP from './ColourOfPP';
|
||||
export default function CacheUpgradePP() {
|
||||
for (const i of Object.keys(CacheUpgrades)) {
|
||||
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);
|
||||
} else CacheUpgrades[i].pp = (Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus);
|
||||
CacheUpgrades[i].pp =
|
||||
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;
|
||||
|
||||
CacheUpgrades[i].color = ColourOfPP(CacheUpgrades[i], Game.Upgrades[i].getPrice());
|
||||
CacheUpgrades[i].color = ColourOfPP(
|
||||
CacheUpgrades[i],
|
||||
Game.Upgrades[i].getPrice(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,11 @@ import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades';
|
||||
import {
|
||||
CacheDoRemakeBuildPrices, CacheObjects1, CacheObjects10, CacheObjects100, CacheUpgrades,
|
||||
CacheDoRemakeBuildPrices,
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
CacheObjects100,
|
||||
CacheUpgrades,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -45,9 +49,27 @@ function CacheUpgradeIncome() {
|
||||
*/
|
||||
export function CacheBuildingsPrices() {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
CacheObjects1[i].price = BuildingGetPrice(Game.Objects[i], 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);
|
||||
CacheObjects1[i].price = BuildingGetPrice(
|
||||
Game.Objects[i],
|
||||
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 */
|
||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||
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';
|
||||
|
||||
/**
|
||||
@@ -17,11 +32,24 @@ export function MaxChainCookieReward(digit, maxPayout, mult) {
|
||||
let moni = 0;
|
||||
let nextMoni = 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) {
|
||||
moni = Math.max(digit, 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);
|
||||
moni = Math.max(
|
||||
digit,
|
||||
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;
|
||||
chain++;
|
||||
}
|
||||
@@ -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
|
||||
*/
|
||||
export function CacheChain() {
|
||||
let maxPayout = CacheNoGoldSwitchCookiesPS * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment;
|
||||
let maxPayout =
|
||||
CacheNoGoldSwitchCookiesPS *
|
||||
60 *
|
||||
60 *
|
||||
6 *
|
||||
CacheDragonsFortuneMultAdjustment;
|
||||
// Removes effect of Frenzy etc.
|
||||
const cpsBuffMult = GetCPSBuffMult();
|
||||
if (cpsBuffMult > 0) maxPayout /= cpsBuffMult;
|
||||
else maxPayout = 0;
|
||||
|
||||
CacheChainMaxReward = MaxChainCookieReward(7, maxPayout, CacheGoldenCookiesMult);
|
||||
CacheChainRequired = CacheChainMaxReward[1] * 2 / CacheGoldenCookiesMult;
|
||||
CacheChainRequiredNext = CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||
CacheChainMaxReward = MaxChainCookieReward(
|
||||
7,
|
||||
maxPayout,
|
||||
CacheGoldenCookiesMult,
|
||||
);
|
||||
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||
CacheChainRequiredNext =
|
||||
CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||
|
||||
CacheChainWrathMaxReward = MaxChainCookieReward(6, maxPayout, CacheWrathCookiesMult);
|
||||
CacheChainWrathRequired = CacheChainWrathMaxReward[1] * 2 / CacheWrathCookiesMult;
|
||||
CacheChainWrathRequiredNext = CacheChainWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||
CacheChainWrathMaxReward = MaxChainCookieReward(
|
||||
6,
|
||||
maxPayout,
|
||||
CacheWrathCookiesMult,
|
||||
);
|
||||
CacheChainWrathRequired =
|
||||
(CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||
CacheChainWrathRequiredNext =
|
||||
CacheChainWrathMaxReward[2] /
|
||||
60 /
|
||||
60 /
|
||||
6 /
|
||||
CacheDragonsFortuneMultAdjustment;
|
||||
|
||||
CacheChainFrenzyMaxReward = MaxChainCookieReward(7, maxPayout * 7, CacheGoldenCookiesMult);
|
||||
CacheChainFrenzyRequired = CacheChainFrenzyMaxReward[1] * 2 / CacheGoldenCookiesMult;
|
||||
CacheChainFrenzyRequiredNext = CacheChainFrenzyMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||
CacheChainFrenzyMaxReward = MaxChainCookieReward(
|
||||
7,
|
||||
maxPayout * 7,
|
||||
CacheGoldenCookiesMult,
|
||||
);
|
||||
CacheChainFrenzyRequired =
|
||||
(CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||
CacheChainFrenzyRequiredNext =
|
||||
CacheChainFrenzyMaxReward[2] /
|
||||
60 /
|
||||
60 /
|
||||
6 /
|
||||
CacheDragonsFortuneMultAdjustment;
|
||||
|
||||
CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(6, maxPayout * 7, CacheWrathCookiesMult);
|
||||
CacheChainFrenzyWrathRequired = CacheChainFrenzyWrathMaxReward[1] * 2 / CacheWrathCookiesMult;
|
||||
CacheChainFrenzyWrathRequiredNext = CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||
CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(
|
||||
6,
|
||||
maxPayout * 7,
|
||||
CacheWrathCookiesMult,
|
||||
);
|
||||
CacheChainFrenzyWrathRequired =
|
||||
(CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||
CacheChainFrenzyWrathRequiredNext =
|
||||
CacheChainFrenzyWrathMaxReward[2] /
|
||||
60 /
|
||||
60 /
|
||||
6 /
|
||||
CacheDragonsFortuneMultAdjustment;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import {
|
||||
CacheHCPerSecond, CacheLastHeavenlyCheck, CacheLastHeavenlyChips, HeavenlyChipsDiff,
|
||||
CacheHCPerSecond,
|
||||
CacheLastHeavenlyCheck,
|
||||
CacheLastHeavenlyChips,
|
||||
HeavenlyChipsDiff,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -13,12 +16,15 @@ export default function CacheHeavenlyChipsPS() {
|
||||
// Only calculate every new second
|
||||
if ((Game.T / Game.fps) % 1 === 0) {
|
||||
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);
|
||||
|
||||
// Add recent gains to AvgQueue's
|
||||
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++) {
|
||||
HeavenlyChipsDiff.addLatest(heavenlyChipsDiffAvg);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
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
|
||||
@@ -34,7 +38,12 @@ export default function CacheAllMissingUpgrades() {
|
||||
str += crateMissing(me);
|
||||
if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str;
|
||||
else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str;
|
||||
else if (me.pool !== 'toggle' && me.pool !== 'unused' && me.pool !== 'debug') CacheMissingUpgrades += str;
|
||||
else if (
|
||||
me.pool !== 'toggle' &&
|
||||
me.pool !== 'unused' &&
|
||||
me.pool !== 'debug'
|
||||
)
|
||||
CacheMissingUpgrades += str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,20 @@
|
||||
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas';
|
||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||
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';
|
||||
|
||||
/**
|
||||
@@ -19,8 +32,10 @@ export function CacheStatsCookies() {
|
||||
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13;
|
||||
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13;
|
||||
CacheLuckyFrenzy = CacheLucky * 7;
|
||||
CacheLuckyRewardFrenzy = CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||
CacheLuckyWrathRewardFrenzy = CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||
CacheLuckyRewardFrenzy =
|
||||
CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||
CacheLuckyWrathRewardFrenzy =
|
||||
CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||
CacheConjure = CacheLucky * 2;
|
||||
CacheConjureReward = CacheConjure * 0.15;
|
||||
|
||||
@@ -32,9 +47,11 @@ export function CacheStatsCookies() {
|
||||
if (Game.Objects[i].amount > 0) n++;
|
||||
}
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
if ((Game.Objects[i].amount < max || n === 1)
|
||||
&& Game.Objects[i].amount < 400
|
||||
&& Game.Objects[i].price * 2 > CacheEdifice) {
|
||||
if (
|
||||
(Game.Objects[i].amount < max || n === 1) &&
|
||||
Game.Objects[i].amount < 400 &&
|
||||
Game.Objects[i].price * 2 > CacheEdifice
|
||||
) {
|
||||
CacheEdifice = Game.Objects[i].price * 2;
|
||||
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.
|
||||
CacheDragonsFortuneMultAdjustment = 1;
|
||||
if (Game.shimmerTypes.golden.n === 0) {
|
||||
CacheDragonsFortuneMultAdjustment *= 1 + Game.auraMult('Dragon\'s Fortune') * 1.23;
|
||||
CacheDragonsFortuneMultAdjustment *=
|
||||
1 + Game.auraMult("Dragon's Fortune") * 1.23;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||
import {
|
||||
CacheWrinklersFattest, CacheWrinklersNormal, CacheWrinklersTotal,
|
||||
CacheWrinklersFattest,
|
||||
CacheWrinklersNormal,
|
||||
CacheWrinklersTotal,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -30,7 +32,8 @@ export default function CacheWrinklers() {
|
||||
CacheWrinklersTotal += sucked;
|
||||
if (Game.wrinklers[i].type === 0) {
|
||||
CacheWrinklersNormal += sucked;
|
||||
if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i];
|
||||
if (sucked > CacheWrinklersFattest[0])
|
||||
CacheWrinklersFattest = [sucked, i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,19 @@ import CMLoop from '../../Main/Loop';
|
||||
* CM.ToggleConfigVolume() and changes in options with type "url", "color" or "numscale"
|
||||
*/
|
||||
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.*(;|$)/);
|
||||
if (CookieMonsterSave !== null) {
|
||||
const newSaveString = saveString.replace(CookieMonsterSave[0], `CookieMonster:${save()}`);
|
||||
localStorage.setItem('CookieClickerGame', escape(`${utf8_to_b64(newSaveString)}!END!`));
|
||||
const newSaveString = saveString.replace(
|
||||
CookieMonsterSave[0],
|
||||
`CookieMonster:${save()}`,
|
||||
);
|
||||
localStorage.setItem(
|
||||
'CookieClickerGame',
|
||||
escape(`${utf8_to_b64(newSaveString)}!END!`),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,24 +49,34 @@ export function LoadConfig(settings) {
|
||||
CMOptions[i] = ConfigDefault[i];
|
||||
} else if (i !== 'Header' && i !== 'Colors') {
|
||||
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;
|
||||
CMOptions[i] = ConfigDefault[i];
|
||||
}
|
||||
} else if (typeof CMOptions[i] !== 'string') { // Sound URLs
|
||||
} else if (typeof CMOptions[i] !== 'string') {
|
||||
// Sound URLs
|
||||
mod = true;
|
||||
CMOptions[i] = ConfigDefault[i];
|
||||
}
|
||||
} else if (i === 'Header') {
|
||||
for (const j in ConfigDefault.Header) {
|
||||
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;
|
||||
CMOptions[i][j] = ConfigDefault[i][j];
|
||||
}
|
||||
}
|
||||
} else { // Colors
|
||||
} else {
|
||||
// Colors
|
||||
for (const j in ConfigDefault.Colors) {
|
||||
if (typeof CMOptions[i][j] === 'undefined' || typeof CMOptions[i][j] !== 'string') {
|
||||
if (
|
||||
typeof CMOptions[i][j] === 'undefined' ||
|
||||
typeof CMOptions[i][j] !== 'string'
|
||||
) {
|
||||
mod = true;
|
||||
CMOptions[i][j] = ConfigDefault[i][j];
|
||||
}
|
||||
@@ -72,7 +90,8 @@ export function LoadConfig(settings) {
|
||||
ConfigData[i].func();
|
||||
}
|
||||
}
|
||||
} else { // Default values
|
||||
} else {
|
||||
// Default values
|
||||
LoadConfig(ConfigDefault);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,15 +7,22 @@ import { CMOptions } from './VariablesAndData';
|
||||
* This function changes the position of both the bottom and timer bar
|
||||
*/
|
||||
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('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) {
|
||||
l('CMBotBar').style.bottom = '0px';
|
||||
l('game').style.bottom = '70px';
|
||||
} else if (CMOptions.TimerBar === 1 && CMOptions.TimerBarPos === 1) {
|
||||
l('game').style.bottom = l('CMTimerBar').style.height;
|
||||
} else { // No bars
|
||||
} else {
|
||||
// No bars
|
||||
l('game').style.bottom = '0px';
|
||||
}
|
||||
|
||||
|
||||
@@ -17,14 +17,16 @@ export function ToggleConfig(config) {
|
||||
|
||||
if (CMOptions[config] === ConfigData[config].label.length) {
|
||||
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';
|
||||
|
||||
if (typeof ConfigData[config].func !== 'undefined') {
|
||||
ConfigData[config].func();
|
||||
}
|
||||
|
||||
l(ConfigPrefix + config).innerHTML = ConfigData[config].label[CMOptions[config]];
|
||||
l(ConfigPrefix + config).innerHTML =
|
||||
ConfigData[config].label[CMOptions[config]];
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@ import { CMOptions } from '../VariablesAndData';
|
||||
* It is called by a change in CM.Options.UpBarColor
|
||||
*/
|
||||
export default function ToggleUpgradeBarAndColor() {
|
||||
if (CMOptions.UpBarColor === 1) { // Colours and bar on
|
||||
if (CMOptions.UpBarColor === 1) {
|
||||
// Colours and bar on
|
||||
l('CMUpgradeBar').style.display = '';
|
||||
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';
|
||||
UpdateUpgrades();
|
||||
} else { // Colours and bar off
|
||||
} else {
|
||||
// Colours and bar off
|
||||
l('CMUpgradeBar').style.display = 'none';
|
||||
Game.RebuildUpgrades();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ import { CMOptions } from '../VariablesAndData';
|
||||
* It is called by a change in CM.Options.UpgradeBarFixedPos
|
||||
*/
|
||||
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.top = '0px';
|
||||
} else {
|
||||
|
||||
@@ -39,7 +39,8 @@ export const HalloCookies = [
|
||||
];
|
||||
|
||||
/** Array of the names of all Christmas cookies */
|
||||
export const ChristCookies = ['Christmas tree biscuits',
|
||||
export const ChristCookies = [
|
||||
'Christmas tree biscuits',
|
||||
'Snowflake biscuits',
|
||||
'Snowman biscuits',
|
||||
'Holly biscuits',
|
||||
@@ -49,7 +50,8 @@ export const ChristCookies = ['Christmas tree biscuits',
|
||||
];
|
||||
|
||||
/** Array of the names of all Valentine cookies */
|
||||
export const ValCookies = ['Pure heart biscuits',
|
||||
export const ValCookies = [
|
||||
'Pure heart biscuits',
|
||||
'Ardent heart biscuits',
|
||||
'Sour heart biscuits',
|
||||
'Weeping heart biscuits',
|
||||
@@ -59,7 +61,8 @@ export const ValCookies = ['Pure heart biscuits',
|
||||
];
|
||||
|
||||
/** Array of the names of all plant drops */
|
||||
export const PlantDrops = ['Elderwort biscuits',
|
||||
export const PlantDrops = [
|
||||
'Elderwort biscuits',
|
||||
'Bakeberry cookies',
|
||||
'Duketater cookies',
|
||||
'Green yeast digestives',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** Data related directly to Cookie Monster */
|
||||
|
||||
export const VersionMajor = '2.031';
|
||||
export const VersionMinor = '6';
|
||||
export const VersionMinor = '5';
|
||||
|
||||
/** Information about Cookie Monster to be displayed in the info section */
|
||||
export const ModDescription = `<div class="listing">
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
/** Data related directly to the scales used by Cookie Monster */
|
||||
|
||||
/** Array of abbreviations used in the "Metric" scale */
|
||||
export const metric = ['',
|
||||
'',
|
||||
'M',
|
||||
'G',
|
||||
'T',
|
||||
'P',
|
||||
'E',
|
||||
'Z',
|
||||
'Y',
|
||||
];
|
||||
export const metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
||||
|
||||
/** Array of abbreviations used in the "Short" scale */
|
||||
export const shortScale = ['',
|
||||
export const shortScale = [
|
||||
'',
|
||||
'',
|
||||
'M',
|
||||
'B',
|
||||
@@ -42,7 +34,8 @@ export const shortScale = ['',
|
||||
];
|
||||
|
||||
/** Array of abbreviations used in the "Abbreviated Short" scale */
|
||||
export const shortScaleAbbreviated = ['',
|
||||
export const shortScaleAbbreviated = [
|
||||
'',
|
||||
'K',
|
||||
'M',
|
||||
'B',
|
||||
|
||||
@@ -15,7 +15,10 @@ import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
||||
import UpdateColors from '../Disp/HelperFunctions/UpdateColors';
|
||||
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
||||
import {
|
||||
SettingStandard, SettingColours, SettingVolume, SettingInputNumber,
|
||||
SettingStandard,
|
||||
SettingColours,
|
||||
SettingVolume,
|
||||
SettingInputNumber,
|
||||
} from './SettingClasses';
|
||||
|
||||
/** This includes all options of CookieMonster and their relevant data */
|
||||
@@ -27,7 +30,9 @@ const Config = {
|
||||
['Bottom Bar OFF', 'Bottom Bar ON'],
|
||||
'Building Information',
|
||||
true,
|
||||
function () { ToggleBotBar(); },
|
||||
function () {
|
||||
ToggleBotBar();
|
||||
},
|
||||
),
|
||||
TimerBar: new SettingStandard(
|
||||
'bool',
|
||||
@@ -35,7 +40,9 @@ const Config = {
|
||||
['Timer Bar OFF', 'Timer Bar ON'],
|
||||
'Timers of Golden Cookie, Season Popup, Frenzy (Normal, Clot, Elder), Click Frenzy',
|
||||
true,
|
||||
function () { ToggleTimerBar(); },
|
||||
function () {
|
||||
ToggleTimerBar();
|
||||
},
|
||||
),
|
||||
TimerBarPos: new SettingStandard(
|
||||
'bool',
|
||||
@@ -43,12 +50,18 @@ const Config = {
|
||||
['Timer Bar Position (Top Left)', 'Timer Bar Position (Bottom)'],
|
||||
'Placement of the Timer Bar',
|
||||
false,
|
||||
function () { ToggleTimerBarPos(); },
|
||||
function () {
|
||||
ToggleTimerBarPos();
|
||||
},
|
||||
),
|
||||
TimerBarOverlay: new SettingStandard(
|
||||
'bool',
|
||||
'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',
|
||||
true,
|
||||
),
|
||||
@@ -58,7 +71,9 @@ const Config = {
|
||||
['Sort Buildings: Default', 'Sort Buildings: PP'],
|
||||
'Sort the display of buildings in either default order or by PP',
|
||||
false,
|
||||
function () { UpdateBuildings(); },
|
||||
function () {
|
||||
UpdateBuildings();
|
||||
},
|
||||
),
|
||||
SortUpgrades: new SettingStandard(
|
||||
'bool',
|
||||
@@ -66,7 +81,9 @@ const Config = {
|
||||
['Sort Upgrades: Default', 'Sort Upgrades: PP'],
|
||||
'Sort the display of upgrades in either default order or by PP',
|
||||
false,
|
||||
function () { UpdateUpgrades(); },
|
||||
function () {
|
||||
UpdateUpgrades();
|
||||
},
|
||||
),
|
||||
BuildColor: new SettingStandard(
|
||||
'bool',
|
||||
@@ -74,39 +91,61 @@ const Config = {
|
||||
['Building Colors OFF', 'Building Colors ON'],
|
||||
'Color code buildings',
|
||||
true,
|
||||
function () { UpdateBuildings(); },
|
||||
function () {
|
||||
UpdateBuildings();
|
||||
},
|
||||
),
|
||||
BulkBuildColor: new SettingStandard(
|
||||
'bool',
|
||||
'BarsColors',
|
||||
['Bulk Building Colors (Single Building Color)', 'Bulk Building Colors (Calculated Bulk Color)'],
|
||||
[
|
||||
'Bulk Building Colors (Single Building Color)',
|
||||
'Bulk Building Colors (Calculated Bulk Color)',
|
||||
],
|
||||
'Color code bulk buildings based on single buildings color or calculated bulk value color',
|
||||
false,
|
||||
function () { UpdateBuildings(); },
|
||||
function () {
|
||||
UpdateBuildings();
|
||||
},
|
||||
),
|
||||
UpBarColor: new SettingStandard(
|
||||
'bool',
|
||||
'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',
|
||||
false,
|
||||
function () { ToggleUpgradeBarAndColor(); },
|
||||
function () {
|
||||
ToggleUpgradeBarAndColor();
|
||||
},
|
||||
),
|
||||
Colors: new SettingColours(
|
||||
'color',
|
||||
'BarsColors',
|
||||
{
|
||||
Blue: 'Color Blue. Used to show better than best PP building, for Click Frenzy bar, and for various labels',
|
||||
Green: 'Color Green. Used to show best PP building, for Blood 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',
|
||||
Orange: 'Color Orange. Used to show between best and worst PP buildings closer to worst, for Next Reindeer bar, and for various labels',
|
||||
Red: 'Color Red. Used to show worst PP building, for Clot bar, and for various labels',
|
||||
Purple: 'Color Purple. Used to show worse than worst PP building, 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',
|
||||
Blue:
|
||||
'Color Blue. Used to show better than best PP building, for Click Frenzy bar, and for various labels',
|
||||
Green:
|
||||
'Color Green. Used to show best PP building, for Blood 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',
|
||||
Orange:
|
||||
'Color Orange. Used to show between best and worst PP buildings closer to worst, for Next Reindeer bar, and for various labels',
|
||||
Red:
|
||||
'Color Red. Used to show worst PP building, for Clot bar, and for various labels',
|
||||
Purple:
|
||||
'Color Purple. Used to show worse than worst PP building, 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',
|
||||
Brown: 'Color Brown. Used for Dragon Harvest bar',
|
||||
},
|
||||
function () { UpdateColors(); },
|
||||
function () {
|
||||
UpdateColors();
|
||||
},
|
||||
),
|
||||
UpgradeBarFixedPos: new SettingStandard(
|
||||
'bool',
|
||||
@@ -114,14 +153,20 @@ const Config = {
|
||||
['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',
|
||||
true,
|
||||
function () { ToggleUpgradeBarFixedPos(); },
|
||||
function () {
|
||||
ToggleUpgradeBarFixedPos();
|
||||
},
|
||||
),
|
||||
|
||||
// Calculation
|
||||
CalcWrink: new SettingStandard(
|
||||
'bool',
|
||||
'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',
|
||||
true,
|
||||
),
|
||||
@@ -135,14 +180,29 @@ const Config = {
|
||||
AvgCPSHist: new SettingStandard(
|
||||
'bool',
|
||||
'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',
|
||||
false,
|
||||
),
|
||||
AvgClicksHist: new SettingStandard(
|
||||
'bool',
|
||||
'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',
|
||||
false,
|
||||
),
|
||||
@@ -152,12 +212,19 @@ const Config = {
|
||||
['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(); },
|
||||
function () {
|
||||
CachePP();
|
||||
},
|
||||
),
|
||||
PPExcludeTop: new SettingStandard(
|
||||
'bool',
|
||||
'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',
|
||||
true,
|
||||
),
|
||||
@@ -179,7 +246,10 @@ const Config = {
|
||||
ToolWarnBon: new SettingStandard(
|
||||
'bool',
|
||||
'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',
|
||||
true,
|
||||
),
|
||||
@@ -205,7 +275,9 @@ const Config = {
|
||||
['Notification OFF', 'Notification ON'],
|
||||
'Create a notification when Golden Cookie spawns',
|
||||
true,
|
||||
function () { CheckNotificationPermissions(CMOptions.GCNotification); },
|
||||
function () {
|
||||
CheckNotificationPermissions(CMOptions.GCNotification);
|
||||
},
|
||||
),
|
||||
GCFlash: new SettingStandard(
|
||||
'bool',
|
||||
@@ -221,12 +293,7 @@ const Config = {
|
||||
'Play a sound on Golden Cookie',
|
||||
true,
|
||||
),
|
||||
GCVolume: new SettingVolume(
|
||||
'vol',
|
||||
'NotificationGC',
|
||||
[],
|
||||
'Volume',
|
||||
),
|
||||
GCVolume: new SettingVolume('vol', 'NotificationGC', [], 'Volume'),
|
||||
GCSoundURL: new SettingStandard(
|
||||
'url',
|
||||
'NotificationGC',
|
||||
@@ -239,7 +306,9 @@ const Config = {
|
||||
['Notification OFF', 'Notification ON'],
|
||||
'Create a notification when Fortune Cookie is on the Ticker',
|
||||
true,
|
||||
function () { CheckNotificationPermissions(CMOptions.FortuneNotification); },
|
||||
function () {
|
||||
CheckNotificationPermissions(CMOptions.FortuneNotification);
|
||||
},
|
||||
),
|
||||
FortuneFlash: new SettingStandard(
|
||||
'bool',
|
||||
@@ -255,12 +324,7 @@ const Config = {
|
||||
'Play a sound on Fortune Cookie',
|
||||
true,
|
||||
),
|
||||
FortuneVolume: new SettingVolume(
|
||||
'vol',
|
||||
'NotificationFC',
|
||||
[],
|
||||
'Volume',
|
||||
),
|
||||
FortuneVolume: new SettingVolume('vol', 'NotificationFC', [], 'Volume'),
|
||||
|
||||
FortuneSoundURL: new SettingStandard(
|
||||
'url',
|
||||
@@ -274,7 +338,9 @@ const Config = {
|
||||
['Notification OFF', 'Notification ON'],
|
||||
'Create a notification on Season Popup',
|
||||
true,
|
||||
function () { CheckNotificationPermissions(CMOptions.SeaNotification); },
|
||||
function () {
|
||||
CheckNotificationPermissions(CMOptions.SeaNotification);
|
||||
},
|
||||
),
|
||||
SeaFlash: new SettingStandard(
|
||||
'bool',
|
||||
@@ -290,12 +356,7 @@ const Config = {
|
||||
'Play a sound on Season Popup',
|
||||
true,
|
||||
),
|
||||
SeaVolume: new SettingVolume(
|
||||
'vol',
|
||||
'NotificationSea',
|
||||
[],
|
||||
'Volume',
|
||||
),
|
||||
SeaVolume: new SettingVolume('vol', 'NotificationSea', [], 'Volume'),
|
||||
SeaSoundURL: new SettingStandard(
|
||||
'url',
|
||||
'NotificationSea',
|
||||
@@ -316,12 +377,7 @@ const Config = {
|
||||
'Play a sound on Garden Tick',
|
||||
true,
|
||||
),
|
||||
GardVolume: new SettingVolume(
|
||||
'vol',
|
||||
'NotificationGard',
|
||||
[],
|
||||
'Volume',
|
||||
),
|
||||
GardVolume: new SettingVolume('vol', 'NotificationGard', [], 'Volume'),
|
||||
GardSoundURL: new SettingStandard(
|
||||
'url',
|
||||
'NotificationGard',
|
||||
@@ -334,7 +390,9 @@ const Config = {
|
||||
['Notification OFF', 'Notification ON'],
|
||||
'Create a notification when magic reaches maximum',
|
||||
true,
|
||||
function () { CheckNotificationPermissions(CMOptions.MagicNotification); },
|
||||
function () {
|
||||
CheckNotificationPermissions(CMOptions.MagicNotification);
|
||||
},
|
||||
),
|
||||
MagicFlash: new SettingStandard(
|
||||
'bool',
|
||||
@@ -350,12 +408,7 @@ const Config = {
|
||||
'Play a sound when magic reaches maximum',
|
||||
true,
|
||||
),
|
||||
MagicVolume: new SettingVolume(
|
||||
'vol',
|
||||
'NotificationMagi',
|
||||
[],
|
||||
'Volume',
|
||||
),
|
||||
MagicVolume: new SettingVolume('vol', 'NotificationMagi', [], 'Volume'),
|
||||
MagicSoundURL: new SettingStandard(
|
||||
'url',
|
||||
'NotificationMagi',
|
||||
@@ -368,7 +421,9 @@ const Config = {
|
||||
['Notification OFF', 'Notification ON'],
|
||||
'Create a notification when a Wrinkler appears',
|
||||
true,
|
||||
function () { CheckNotificationPermissions(CMOptions.WrinklerNotification); },
|
||||
function () {
|
||||
CheckNotificationPermissions(CMOptions.WrinklerNotification);
|
||||
},
|
||||
),
|
||||
WrinklerFlash: new SettingStandard(
|
||||
'bool',
|
||||
@@ -384,12 +439,7 @@ const Config = {
|
||||
'Play a sound when a Wrinkler appears',
|
||||
true,
|
||||
),
|
||||
WrinklerVolume: new SettingVolume(
|
||||
'vol',
|
||||
'NotificationWrink',
|
||||
[],
|
||||
'Volume',
|
||||
),
|
||||
WrinklerVolume: new SettingVolume('vol', 'NotificationWrink', [], 'Volume'),
|
||||
WrinklerSoundURL: new SettingStandard(
|
||||
'url',
|
||||
'NotificationWrink',
|
||||
@@ -402,7 +452,9 @@ const Config = {
|
||||
['Notification OFF', 'Notification ON'],
|
||||
'Create a notification when the maximum amount of Wrinklers has appeared',
|
||||
true,
|
||||
function () { CheckNotificationPermissions(CMOptions.WrinklerMaxNotification); },
|
||||
function () {
|
||||
CheckNotificationPermissions(CMOptions.WrinklerMaxNotification);
|
||||
},
|
||||
),
|
||||
WrinklerMaxFlash: new SettingStandard(
|
||||
'bool',
|
||||
@@ -435,14 +487,20 @@ const Config = {
|
||||
TooltipBuildUpgrade: new SettingStandard(
|
||||
'bool',
|
||||
'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',
|
||||
true,
|
||||
),
|
||||
TooltipAmor: new SettingStandard(
|
||||
'bool',
|
||||
'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',
|
||||
true,
|
||||
),
|
||||
@@ -495,7 +553,9 @@ const Config = {
|
||||
['Tooltip Warning Position (Left)', 'Tooltip Warning Position (Bottom)'],
|
||||
'Placement of the warning boxes',
|
||||
false,
|
||||
function () { ToggleToolWarnPos(); },
|
||||
function () {
|
||||
ToggleToolWarnPos();
|
||||
},
|
||||
),
|
||||
TooltipGrim: new SettingStandard(
|
||||
'bool',
|
||||
@@ -575,7 +635,9 @@ const Config = {
|
||||
['Detailed Time OFF', 'Detailed Time ON'],
|
||||
'Change how time is displayed in certain statistics and tooltips',
|
||||
true,
|
||||
function () { ToggleDetailedTime(); },
|
||||
function () {
|
||||
ToggleDetailedTime();
|
||||
},
|
||||
),
|
||||
GrimoireBar: new SettingStandard(
|
||||
'bool',
|
||||
@@ -604,10 +666,19 @@ const Config = {
|
||||
Scale: new SettingStandard(
|
||||
'bool',
|
||||
'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',
|
||||
false,
|
||||
function () { RefreshScale(); },
|
||||
function () {
|
||||
RefreshScale();
|
||||
},
|
||||
),
|
||||
ScaleDecimals: new SettingStandard(
|
||||
'bool',
|
||||
@@ -615,7 +686,9 @@ const Config = {
|
||||
['1 decimals', '2 decimals', '3 decimals'],
|
||||
'Set the number of decimals used when applicable',
|
||||
false,
|
||||
function () { RefreshScale(); },
|
||||
function () {
|
||||
RefreshScale();
|
||||
},
|
||||
),
|
||||
ScaleSeparator: new SettingStandard(
|
||||
'bool',
|
||||
@@ -623,7 +696,9 @@ const Config = {
|
||||
['. for decimals (Standard)', '. for thousands'],
|
||||
'Set the separator used for decimals and thousands',
|
||||
false,
|
||||
function () { RefreshScale(); },
|
||||
function () {
|
||||
RefreshScale();
|
||||
},
|
||||
),
|
||||
ScaleCutoff: new SettingInputNumber(
|
||||
'numscale',
|
||||
@@ -641,7 +716,9 @@ const Config = {
|
||||
['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'],
|
||||
'A timer on the Golden Cookie when it has been spawned',
|
||||
true,
|
||||
function () { ToggleGCTimer(); },
|
||||
function () {
|
||||
ToggleGCTimer();
|
||||
},
|
||||
),
|
||||
Favicon: new SettingStandard(
|
||||
'bool',
|
||||
@@ -649,7 +726,9 @@ const Config = {
|
||||
['Favicon OFF', 'Favicon ON'],
|
||||
'Update favicon with Golden/Wrath Cookie',
|
||||
true,
|
||||
function () { UpdateFavicon(); },
|
||||
function () {
|
||||
UpdateFavicon();
|
||||
},
|
||||
),
|
||||
WrinklerButtons: new SettingStandard(
|
||||
'bool',
|
||||
@@ -657,7 +736,9 @@ const Config = {
|
||||
['Extra Buttons OFF', 'Extra Buttons ON'],
|
||||
'Show buttons for popping wrinklers at bottom of cookie section',
|
||||
true,
|
||||
function () { ToggleWrinklerButtons(); },
|
||||
function () {
|
||||
ToggleWrinklerButtons();
|
||||
},
|
||||
),
|
||||
BulkBuyBlock: new SettingStandard(
|
||||
'bool',
|
||||
|
||||
@@ -28,12 +28,14 @@ const ConfigDefault = {
|
||||
FortuneFlash: 1,
|
||||
FortuneSound: 1,
|
||||
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,
|
||||
SeaFlash: 1,
|
||||
SeaSound: 1,
|
||||
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,
|
||||
GardSound: 1,
|
||||
GardVolume: 100,
|
||||
@@ -42,17 +44,20 @@ const ConfigDefault = {
|
||||
MagicFlash: 1,
|
||||
MagicSound: 1,
|
||||
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,
|
||||
WrinklerFlash: 1,
|
||||
WrinklerSound: 1,
|
||||
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,
|
||||
WrinklerMaxFlash: 1,
|
||||
WrinklerMaxSound: 1,
|
||||
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,
|
||||
TooltipAmor: 0,
|
||||
ToolWarnLucky: 1,
|
||||
@@ -81,7 +86,15 @@ const ConfigDefault = {
|
||||
ScaleSeparator: 0,
|
||||
ScaleCutoff: 999999,
|
||||
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,
|
||||
SortUpgrades: 0,
|
||||
@@ -90,7 +103,30 @@ const ConfigDefault = {
|
||||
WrinklerButtons: 1,
|
||||
BulkBuyBlock: 0,
|
||||
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,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales';
|
||||
import { BackupFunctions } from '../../Main/VariablesAndData';
|
||||
import {
|
||||
ColorGreen, ColorOrange, ColorRed, ColorYellow,
|
||||
ColorGreen,
|
||||
ColorOrange,
|
||||
ColorRed,
|
||||
ColorYellow,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -18,38 +21,55 @@ export function Beautify(num, floats, forced) {
|
||||
const decimals = CMOptions.ScaleDecimals + 1;
|
||||
if (num === Infinity) {
|
||||
return 'Infinity';
|
||||
} if (typeof num === 'undefined') {
|
||||
}
|
||||
if (typeof num === 'undefined') {
|
||||
return '0';
|
||||
} if (CMOptions.Scale === 0) {
|
||||
}
|
||||
if (CMOptions.Scale === 0) {
|
||||
return BackupFunctions.Beautify(num, floats);
|
||||
} if (Number.isFinite(num)) {
|
||||
}
|
||||
if (Number.isFinite(num)) {
|
||||
let answer = '';
|
||||
if (num === 0) {
|
||||
return num.toString();
|
||||
} if (num > 0.001 && num < CMOptions.ScaleCutoff) {
|
||||
}
|
||||
if (num > 0.001 && num < CMOptions.ScaleCutoff) {
|
||||
if (CMOptions.ScaleSeparator) answer = num.toLocaleString('nl');
|
||||
else answer = num.toLocaleString('en');
|
||||
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');
|
||||
} else {
|
||||
const exponential = num.toExponential().toString();
|
||||
const AmountOfTenPowerThree = Math.floor(exponential.slice(exponential.indexOf('e') + 1) / 3);
|
||||
answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed(decimals);
|
||||
const AmountOfTenPowerThree = Math.floor(
|
||||
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)
|
||||
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}`)) {
|
||||
answer += ` ${metric[AmountOfTenPowerThree]}`;
|
||||
} 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}`)) {
|
||||
answer += ` ${shortScale[AmountOfTenPowerThree]}`;
|
||||
} 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
|
||||
if (num >= 0.01 && num < Number(`1e${shortScaleAbbreviated.length * 3}`)) {
|
||||
} else if ((CMOptions.Scale === 3 && !forced) || forced === 3) {
|
||||
// Short scale, 123456789 => 123.457 M
|
||||
if (
|
||||
num >= 0.01 &&
|
||||
num < Number(`1e${shortScaleAbbreviated.length * 3}`)
|
||||
) {
|
||||
answer += ` ${shortScaleAbbreviated[AmountOfTenPowerThree]}`;
|
||||
} 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}`;
|
||||
}
|
||||
}
|
||||
@@ -74,9 +94,9 @@ export function FormatTime(time, longFormat) {
|
||||
if (time === Infinity) return time;
|
||||
time = Math.ceil(time);
|
||||
const y = Math.floor(time / 31557600);
|
||||
const d = Math.floor(time % 31557600 / 86400);
|
||||
const h = Math.floor(time % 86400 / 3600);
|
||||
const m = Math.floor(time % 3600 / 60);
|
||||
const d = Math.floor((time % 31557600) / 86400);
|
||||
const h = Math.floor((time % 86400) / 3600);
|
||||
const m = Math.floor((time % 3600) / 60);
|
||||
const s = Math.floor(time % 60);
|
||||
let str = '';
|
||||
if (CMOptions.TimeFormat) {
|
||||
@@ -88,10 +108,16 @@ export function FormatTime(time, longFormat) {
|
||||
str += (s < 10 ? '0' : '') + s;
|
||||
} else {
|
||||
if (time > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||
str += (y > 0 ? `${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 +=
|
||||
y > 0
|
||||
? `${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');
|
||||
}
|
||||
return str;
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData';
|
||||
import {
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
CacheObjects100,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import BuildingSell from '../../Sim/SimulationEvents/SellBuilding';
|
||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
@@ -27,7 +31,8 @@ export default function UpdateBuildings() {
|
||||
if (Game.buyMode === 1) {
|
||||
if (CMOptions.BuildColor === 1) {
|
||||
for (const i of Object.keys(target)) {
|
||||
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 {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
@@ -46,7 +51,9 @@ export default function UpdateBuildings() {
|
||||
*
|
||||
* 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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +68,15 @@ export default function UpdateBuildings() {
|
||||
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++) {
|
||||
Game.Objects[arr[x].name].l.style.gridRow = `${x + 2}/${x + 2}`;
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import {
|
||||
ColorBackPre, ColorBlue, ColorGray, ColorGreen, ColorOrange, ColorPurple, ColorRed, ColorTextPre, ColorYellow,
|
||||
ColorBackPre,
|
||||
ColorBlue,
|
||||
ColorGray,
|
||||
ColorGreen,
|
||||
ColorOrange,
|
||||
ColorPurple,
|
||||
ColorRed,
|
||||
ColorTextPre,
|
||||
ColorYellow,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -32,8 +40,18 @@ function CreateUpgradeBarLegend() {
|
||||
|
||||
legend.appendChild(legendLine(ColorBlue, 'Better than 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(legendLine(ColorOrange, 'Between best and worst PP buildings closer to worst'));
|
||||
legend.appendChild(
|
||||
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(ColorPurple, 'Worse than worst PP building'));
|
||||
legend.appendChild(legendLine(ColorGray, 'Negative or infinity PP'));
|
||||
@@ -52,11 +70,15 @@ export default function CreateUpgradeBar() {
|
||||
UpgradeBar.style.fontWeight = 'bold';
|
||||
UpgradeBar.style.display = 'none';
|
||||
UpgradeBar.style.zIndex = '21';
|
||||
UpgradeBar.onmouseout = function () { Game.tooltip.hide(); };
|
||||
UpgradeBar.onmouseout = function () {
|
||||
Game.tooltip.hide();
|
||||
};
|
||||
|
||||
const placeholder = document.createElement('div');
|
||||
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 span = document.createElement('span');
|
||||
@@ -75,5 +97,8 @@ export default function CreateUpgradeBar() {
|
||||
UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarPurple', ColorPurple));
|
||||
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,15 @@
|
||||
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import {
|
||||
ColorBackPre, ColorBlue, ColorGray, ColorGreen, ColorOrange, ColorPurple, ColorRed, Colors, ColorYellow,
|
||||
ColorBackPre,
|
||||
ColorBlue,
|
||||
ColorGray,
|
||||
ColorGreen,
|
||||
ColorOrange,
|
||||
ColorPurple,
|
||||
ColorRed,
|
||||
Colors,
|
||||
ColorYellow,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -25,8 +33,11 @@ export default function UpdateUpgrades() {
|
||||
const me = Game.UpgradesInStore[i];
|
||||
let addedColor = false;
|
||||
for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j++) {
|
||||
if (l(`upgrade${i}`).childNodes[j].className.indexOf(ColorBackPre) !== -1) {
|
||||
l(`upgrade${i}`).childNodes[j].className = ColorBackPre + CacheUpgrades[me.name].color;
|
||||
if (
|
||||
l(`upgrade${i}`).childNodes[j].className.indexOf(ColorBackPre) !== -1
|
||||
) {
|
||||
l(`upgrade${i}`).childNodes[j].className =
|
||||
ColorBackPre + CacheUpgrades[me.name].color;
|
||||
addedColor = true;
|
||||
break;
|
||||
}
|
||||
@@ -68,7 +79,15 @@ export default function UpdateUpgrades() {
|
||||
}
|
||||
|
||||
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 {
|
||||
arr.sort((a, b) => a.price - b.price);
|
||||
}
|
||||
@@ -77,6 +96,7 @@ export default function UpdateUpgrades() {
|
||||
return arr2.findIndex((e) => e.name === upgrade.name);
|
||||
};
|
||||
for (let x = 0; x < Game.UpgradesInStore.length; x++) {
|
||||
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 { CMOptions } from '../../Config/VariablesAndData';
|
||||
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
|
||||
@@ -13,16 +16,21 @@ import { Beautify, FormatTime } from '../BeautifyAndFormatting/BeautifyFormattin
|
||||
export function AddAuraInfo(aura) {
|
||||
if (CMOptions.DragonAuraInfo === 1) {
|
||||
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);
|
||||
|
||||
l('dragonAuraInfo').style.minHeight = '60px';
|
||||
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');
|
||||
div.style.minWidth = '200px';
|
||||
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);
|
||||
const div2 = document.createElement('div');
|
||||
div2.style.minWidth = '200px';
|
||||
@@ -38,16 +46,25 @@ export function AddAuraInfo(aura) {
|
||||
*/
|
||||
export function AddDragonLevelUpTooltip() {
|
||||
// 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++) {
|
||||
if (l('specialPopup').childNodes[i].className === 'optionBox') {
|
||||
l('specialPopup').children[i].onmouseover = function () {
|
||||
CacheDragonCost();
|
||||
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();
|
||||
};
|
||||
l('specialPopup').children[i].onmouseout = function () { Game.tooltip.shouldHide = 1; };
|
||||
l('specialPopup').children[i].onmouseout = function () {
|
||||
Game.tooltip.shouldHide = 1;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@ import { UpdateBotBar } from './InfoBars/BottomBar';
|
||||
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
||||
import RefreshMenu from './MenuSections/Refreshmenu';
|
||||
import { UpdateTooltips } from './Tooltips/Tooltip';
|
||||
import { CheckWrinklerTooltip, UpdateWrinklerTooltip } from './Tooltips/WrinklerTooltips';
|
||||
import {
|
||||
CheckWrinklerTooltip,
|
||||
UpdateWrinklerTooltip,
|
||||
} from './Tooltips/WrinklerTooltips';
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
// Draw autosave timer in stats menu, this must be done here to make it count down correctly
|
||||
if (
|
||||
(Game.prefs.autosave && Game.drawT % 10 === 0) // with autosave ON and every 10 ticks
|
||||
&& (Game.onMenu === 'stats' && CMOptions.Stats) // while being on the stats menu only
|
||||
Game.prefs.autosave &&
|
||||
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');
|
||||
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,8 @@ export default function Draw() {
|
||||
RefreshMenu();
|
||||
|
||||
// Replace Cookies counter because Orteil uses very weird code to "pad" it...
|
||||
l('cookies').innerHTML = l('cookies').innerHTML.replace(/.*(?=<br>)/i, Beautify(Game.cookies));
|
||||
l('cookies').innerHTML = l('cookies').innerHTML.replace(
|
||||
/.*(?=<br>)/i,
|
||||
Beautify(Game.cookies),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,9 +23,19 @@ export default function CreateGCTimer(cookie) {
|
||||
if (CMOptions.GCTimer === 0) GCTimer.style.display = 'none';
|
||||
GCTimer.style.left = cookie.l.style.left;
|
||||
GCTimer.style.top = cookie.l.style.top;
|
||||
GCTimer.onclick = function () { cookie.pop(); };
|
||||
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 = ''; };
|
||||
GCTimer.onclick = function () {
|
||||
cookie.pop();
|
||||
};
|
||||
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;
|
||||
l('shimmers').appendChild(GCTimer);
|
||||
|
||||
@@ -5,10 +5,15 @@
|
||||
* @param {number} targetMagic The target magic level
|
||||
* @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 count = 0;
|
||||
while (currentMagic < targetMagic) {
|
||||
currentMagic += Math.max(0.002, (currentMagic / Math.max(maxMagic, 100)) ** 0.5) * 0.002;
|
||||
currentMagic +=
|
||||
Math.max(0.002, (currentMagic / Math.max(maxMagic, 100)) ** 0.5) * 0.002;
|
||||
count++;
|
||||
}
|
||||
return count / Game.fps;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import {
|
||||
CacheAverageCPS, CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult, CacheWrinklersFattest,
|
||||
CacheAverageCPS,
|
||||
CacheCurrWrinklerCount,
|
||||
CacheCurrWrinklerCPSMult,
|
||||
CacheWrinklersFattest,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
|
||||
@@ -10,12 +13,29 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
||||
export default function GetCPS() {
|
||||
if (CMOptions.CPSMode) {
|
||||
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 {
|
||||
ColorGray, ColorGreen, ColorOrange, ColorPurple, ColorRed, ColorYellow,
|
||||
ColorGray,
|
||||
ColorGreen,
|
||||
ColorOrange,
|
||||
ColorPurple,
|
||||
ColorRed,
|
||||
ColorYellow,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -11,13 +16,17 @@ import {
|
||||
export default function GetLumpColor(type) {
|
||||
if (type === 0) {
|
||||
return { text: 'Normal', color: ColorGray };
|
||||
} if (type === 1) {
|
||||
}
|
||||
if (type === 1) {
|
||||
return { text: 'Bifurcated', color: ColorGreen };
|
||||
} if (type === 2) {
|
||||
}
|
||||
if (type === 2) {
|
||||
return { text: 'Golden', color: ColorYellow };
|
||||
} if (type === 3) {
|
||||
}
|
||||
if (type === 3) {
|
||||
return { text: 'Meaty', color: ColorOrange };
|
||||
} if (type === 4) {
|
||||
}
|
||||
if (type === 4) {
|
||||
return { text: 'Caramelized', color: ColorPurple };
|
||||
}
|
||||
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';
|
||||
|
||||
/**
|
||||
@@ -9,7 +12,8 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
||||
export default function GetWrinkConfigBank() {
|
||||
if (CMOptions.CalcWrink === 1) {
|
||||
return CacheWrinklersTotal;
|
||||
} if (CMOptions.CalcWrink === 2) {
|
||||
}
|
||||
if (CMOptions.CalcWrink === 2) {
|
||||
return CacheWrinklersFattest[0];
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
*/
|
||||
export default function UpdateBackground() {
|
||||
Game.Background.canvas.width = Game.Background.canvas.parentNode.offsetWidth;
|
||||
Game.Background.canvas.height = Game.Background.canvas.parentNode.offsetHeight;
|
||||
Game.LeftBackground.canvas.width = Game.LeftBackground.canvas.parentNode.offsetWidth;
|
||||
Game.LeftBackground.canvas.height = Game.LeftBackground.canvas.parentNode.offsetHeight;
|
||||
Game.Background.canvas.height =
|
||||
Game.Background.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 UpdateBuildings from '../BuildingsUpgrades/Buildings';
|
||||
import {
|
||||
ColorBackPre, ColorBorderPre, Colors, ColorTextPre,
|
||||
ColorBackPre,
|
||||
ColorBorderPre,
|
||||
Colors,
|
||||
ColorTextPre,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -11,13 +14,19 @@ import {
|
||||
export default function UpdateColors() {
|
||||
let str = '';
|
||||
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++) {
|
||||
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++) {
|
||||
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;
|
||||
UpdateBuildings(); // Class has been already set
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
/** 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 { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
||||
import { Beautify, GetTimeColor } from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import {
|
||||
Beautify,
|
||||
GetTimeColor,
|
||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import GetCPS from '../HelperFunctions/GetCPS';
|
||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
||||
import {
|
||||
ColorBlue, ColorTextPre, ColorYellow, LastTargetBotBar,
|
||||
ColorBlue,
|
||||
ColorTextPre,
|
||||
ColorYellow,
|
||||
LastTargetBotBar,
|
||||
} from '../VariablesAndData';
|
||||
import { CreateBotBarBuildingColumn } from './CreateDOMElements';
|
||||
|
||||
@@ -25,7 +35,8 @@ export function CreateBotBar() {
|
||||
BotBar.style.backgroundImage = 'linear-gradient(to bottom, #4d4548, #000000)';
|
||||
BotBar.style.borderTop = '1px solid black';
|
||||
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'));
|
||||
table.style.width = '100%';
|
||||
@@ -74,15 +85,36 @@ export function UpdateBotBar() {
|
||||
if (target === 10) target = CacheObjects10;
|
||||
if (target === 100) target = CacheObjects100;
|
||||
count++;
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[count].childNodes[1].textContent = Game.Objects[i].amount;
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[count].textContent = Beautify(target[i].bonus, 2);
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].className = ColorTextPre + target[i].color;
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].textContent = Beautify(target[i].pp, 2);
|
||||
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;
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[
|
||||
count
|
||||
].childNodes[1].textContent = Game.Objects[i].amount;
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[
|
||||
count
|
||||
].textContent = Beautify(target[i].bonus, 2);
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||
count
|
||||
].className = ColorTextPre + target[i].color;
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||
count
|
||||
].textContent = Beautify(target[i].pp, 2);
|
||||
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,7 +76,11 @@ export function CreateBotBarBuildingColumn(buildingName) {
|
||||
|
||||
const i = buildingName;
|
||||
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'));
|
||||
span.className = ColorTextPre + ColorBlue;
|
||||
|
||||
@@ -4,7 +4,11 @@ import { UpdateBotTimerBarPosition } from '../../Config/SpecificToggles';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import {
|
||||
BuffColors,
|
||||
ColorBackPre, ColorGray, ColorOrange, ColorPurple, LastNumberOfTimers,
|
||||
ColorBackPre,
|
||||
ColorGray,
|
||||
ColorOrange,
|
||||
ColorPurple,
|
||||
LastNumberOfTimers,
|
||||
} from '../VariablesAndData';
|
||||
import { CreateTimer } from './CreateDOMElements';
|
||||
|
||||
@@ -22,15 +26,17 @@ export function CreateTimerBar() {
|
||||
TimerBar.style.backgroundColor = 'black';
|
||||
|
||||
// Create standard Golden Cookie bar
|
||||
const CMTimerBarGC = CreateTimer('CMTimerBarGC',
|
||||
'Next Cookie',
|
||||
[{ id: 'CMTimerBarGCMinBar', color: ColorGray }, { id: 'CMTimerBarGCBar', color: ColorPurple }]);
|
||||
const CMTimerBarGC = CreateTimer('CMTimerBarGC', 'Next Cookie', [
|
||||
{ id: 'CMTimerBarGCMinBar', color: ColorGray },
|
||||
{ id: 'CMTimerBarGCBar', color: ColorPurple },
|
||||
]);
|
||||
TimerBar.appendChild(CMTimerBarGC);
|
||||
|
||||
// Create standard Reindeer bar
|
||||
const CMTimerBarRen = CreateTimer('CMTimerBarRen',
|
||||
'Next Reindeer',
|
||||
[{ id: 'CMTimerBarRenMinBar', color: ColorGray }, { id: 'CMTimerBarRenBar', color: ColorOrange }]);
|
||||
const CMTimerBarRen = CreateTimer('CMTimerBarRen', 'Next Reindeer', [
|
||||
{ id: 'CMTimerBarRenMinBar', color: ColorGray },
|
||||
{ id: 'CMTimerBarRenBar', color: ColorOrange },
|
||||
]);
|
||||
TimerBar.appendChild(CMTimerBarRen);
|
||||
const TimerBarBuffTimers = document.createElement('div');
|
||||
TimerBarBuffTimers.id = 'CMTimerBarBuffTimers';
|
||||
@@ -51,35 +57,101 @@ export function UpdateTimerBar() {
|
||||
let numberOfTimers = 0;
|
||||
|
||||
// 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('CMTimerBarGCMinBar').style.width = `${Math.round(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);
|
||||
l('CMTimerBarGCMinBar').style.width = `${Math.round(
|
||||
(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 = '';
|
||||
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.borderBottomRightRadius = '10px';
|
||||
} else {
|
||||
l('CMTimerBarGCMinBar').style.borderTopRightRadius = '';
|
||||
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`;
|
||||
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);
|
||||
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`;
|
||||
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 = '';
|
||||
l('CMTimerBarGCTime').textContent = Math.ceil((Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps);
|
||||
l('CMTimerBarGCTime').textContent = Math.ceil(
|
||||
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) /
|
||||
Game.fps,
|
||||
);
|
||||
numberOfTimers++;
|
||||
} else l('CMTimerBarGC').style.display = 'none';
|
||||
|
||||
// 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('CMTimerBarRenMinBar').style.width = `${Math.round(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);
|
||||
l('CMTimerBarRenMinBar').style.width = `${Math.round(
|
||||
(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 = '';
|
||||
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`;
|
||||
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);
|
||||
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`;
|
||||
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 = '';
|
||||
l('CMTimerBarRenTime').textContent = Math.ceil((Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps);
|
||||
l('CMTimerBarRenTime').textContent = Math.ceil(
|
||||
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) /
|
||||
Game.fps,
|
||||
);
|
||||
numberOfTimers++;
|
||||
} else {
|
||||
l('CMTimerBarRen').style.display = 'none';
|
||||
@@ -90,7 +162,9 @@ export function UpdateTimerBar() {
|
||||
l('CMTimerBarBuffTimers').innerHTML = '';
|
||||
for (const i of Object.keys(Game.buffs)) {
|
||||
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 = '';
|
||||
let classColor = '';
|
||||
// Gives specific timers specific colors
|
||||
@@ -99,10 +173,20 @@ export function UpdateTimerBar() {
|
||||
} else classColor = ColorPurple;
|
||||
timer.lastChild.children[1].className = ColorBackPre + classColor;
|
||||
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 = '';
|
||||
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[2].textContent = Math.ceil(Game.buffs[i].time / Game.fps);
|
||||
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[2].textContent = Math.ceil(
|
||||
Game.buffs[i].time / Game.fps,
|
||||
);
|
||||
numberOfTimers++;
|
||||
BuffTimerBars[Game.buffs[i].name] = timer;
|
||||
}
|
||||
|
||||
@@ -9,12 +9,17 @@ export default function CreateWrinklerButtons() {
|
||||
popAllA.id = 'PopAllNormalWrinklerButton';
|
||||
popAllA.textContent = 'Pop All Normal';
|
||||
popAllA.className = 'option';
|
||||
popAllA.onclick = function () { PopAllNormalWrinklers(); };
|
||||
popAllA.onclick = function () {
|
||||
PopAllNormalWrinklers();
|
||||
};
|
||||
l('sectionLeftExtra').children[0].append(popAllA);
|
||||
const popFattestA = document.createElement('a');
|
||||
popFattestA.id = 'PopFattestWrinklerButton';
|
||||
popFattestA.textContent = 'Pop Single Fattest';
|
||||
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;
|
||||
};
|
||||
l('sectionLeftExtra').children[0].append(popFattestA);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,13 @@ import * as GameData from '../../Data/Gamedata';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
|
||||
import {
|
||||
CacheAverageClicks, CacheCentEgg, CacheLastChoEgg, CacheSeaSpec, CacheWrinklersFattest, CacheWrinklersNormal, CacheWrinklersTotal,
|
||||
CacheAverageClicks,
|
||||
CacheCentEgg,
|
||||
CacheLastChoEgg,
|
||||
CacheSeaSpec,
|
||||
CacheWrinklersFattest,
|
||||
CacheWrinklersNormal,
|
||||
CacheWrinklersTotal,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
||||
import { ClickTimes, CookieTimes } from '../VariablesAndData';
|
||||
@@ -57,21 +63,50 @@ export default function AddMenuStats(title) {
|
||||
stats.appendChild(CreateElements.StatsHeader('Wrinklers', 'Wrink'));
|
||||
if (CMOptions.Header.Wrink) {
|
||||
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');
|
||||
popAllA.textContent = 'Pop All Normal';
|
||||
popAllA.className = 'option';
|
||||
popAllA.onclick = function () { PopAllNormalWrinklers(); };
|
||||
popAllA.onclick = function () {
|
||||
PopAllNormalWrinklers();
|
||||
};
|
||||
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();
|
||||
popFattestFrag.appendChild(document.createTextNode(`${Beautify(CacheWrinklersFattest[0])} `));
|
||||
popFattestFrag.appendChild(
|
||||
document.createTextNode(`${Beautify(CacheWrinklersFattest[0])} `),
|
||||
);
|
||||
const popFattestA = document.createElement('a');
|
||||
popFattestA.textContent = 'Pop Single Fattest';
|
||||
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);
|
||||
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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,35 +153,117 @@ export default function AddMenuStats(title) {
|
||||
specDisp = true;
|
||||
}
|
||||
}
|
||||
const choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'));
|
||||
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 (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 (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'));
|
||||
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.StatsListing(
|
||||
'basic',
|
||||
'Century Egg Multiplier',
|
||||
document.createTextNode(
|
||||
`${Math.round((CacheCentEgg - 1) * 10000) / 100}%`,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stats.appendChild(CreateElements.StatsHeader('Miscellaneous', 'Misc'));
|
||||
if (CMOptions.Header.Misc) {
|
||||
stats.appendChild(CreateElements.StatsListing('basic',
|
||||
`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))));
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
'basic',
|
||||
`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')) {
|
||||
const fortunes = [];
|
||||
for (const i of Object.keys(GameData.Fortunes)) {
|
||||
@@ -154,16 +271,34 @@ export default function AddMenuStats(title) {
|
||||
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) {
|
||||
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) {
|
||||
const timer = document.createElement('span');
|
||||
timer.id = 'CMStatsAutosaveTimer';
|
||||
timer.innerText = Game.sayTime(Game.fps * 60 - (Game.OnAscend ? 0 : (Game.T % (Game.fps * 60))), 4);
|
||||
stats.appendChild(CreateElements.StatsListing('basic', 'Time till autosave', timer));
|
||||
timer.innerText = Game.sayTime(
|
||||
Game.fps * 60 - (Game.OnAscend ? 0 : Game.T % (Game.fps * 60)),
|
||||
4,
|
||||
);
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing('basic', 'Time till autosave', timer),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,10 @@ export function StatsHeader(text, config) {
|
||||
span.style.fontSize = '13px';
|
||||
span.style.verticalAlign = 'middle';
|
||||
span.textContent = CMOptions.Header[config] ? '-' : '+';
|
||||
span.onclick = function () { ToggleHeader(config); Game.UpdateMenu(); };
|
||||
span.onclick = function () {
|
||||
ToggleHeader(config);
|
||||
Game.UpdateMenu();
|
||||
};
|
||||
div.appendChild(span);
|
||||
return div;
|
||||
}
|
||||
@@ -57,8 +60,12 @@ export function StatsListing(type, name, text, placeholder) {
|
||||
div.appendChild(document.createTextNode(' '));
|
||||
|
||||
const tooltip = document.createElement('span');
|
||||
tooltip.onmouseout = function () { Game.tooltip.hide(); };
|
||||
tooltip.onmouseover = function () { Game.tooltip.draw(this, escape(TooltipText[placeholder].innerHTML)); };
|
||||
tooltip.onmouseout = function () {
|
||||
Game.tooltip.hide();
|
||||
};
|
||||
tooltip.onmouseover = function () {
|
||||
Game.tooltip.draw(this, escape(TooltipText[placeholder].innerHTML));
|
||||
};
|
||||
tooltip.style.cursor = 'default';
|
||||
tooltip.style.display = 'inline-block';
|
||||
tooltip.style.height = '10px';
|
||||
@@ -86,7 +93,9 @@ export function StatsMissDisp(theMissDisp) {
|
||||
const frag = document.createDocumentFragment();
|
||||
frag.appendChild(document.createTextNode(`${theMissDisp.length} `));
|
||||
const span = document.createElement('span');
|
||||
span.onmouseout = function () { Game.tooltip.hide(); };
|
||||
span.onmouseout = function () {
|
||||
Game.tooltip.hide();
|
||||
};
|
||||
const placeholder = document.createElement('div');
|
||||
const missing = document.createElement('div');
|
||||
missing.style.minWidth = '140px';
|
||||
@@ -104,7 +113,9 @@ export function StatsMissDisp(theMissDisp) {
|
||||
missing.appendChild(div);
|
||||
}
|
||||
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.display = 'inline-block';
|
||||
span.style.height = '10px';
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
/** 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
|
||||
*/
|
||||
export function AddMissingUpgrades() {
|
||||
for (const menuSection of (l('menu').children)) {
|
||||
for (const menuSection of l('menu').children) {
|
||||
if (menuSection.children[0]) {
|
||||
if (menuSection.children[0].innerHTML === 'Prestige' && CacheMissingUpgradesPrestige) {
|
||||
const prestigeUpgradesMissing = CacheMissingUpgradesPrestige.match(new RegExp('div', 'g') || []).length / 2;
|
||||
if (
|
||||
menuSection.children[0].innerHTML === 'Prestige' &&
|
||||
CacheMissingUpgradesPrestige
|
||||
) {
|
||||
const prestigeUpgradesMissing =
|
||||
CacheMissingUpgradesPrestige.match(new RegExp('div', 'g') || [])
|
||||
.length / 2;
|
||||
const title = document.createElement('div');
|
||||
title.id = 'CMMissingUpgradesPrestigeTitle';
|
||||
title.className = 'listing';
|
||||
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);
|
||||
menuSection.appendChild(title);
|
||||
const upgrades = document.createElement('div');
|
||||
@@ -23,26 +36,43 @@ export function AddMissingUpgrades() {
|
||||
menuSection.appendChild(upgrades);
|
||||
} else if (menuSection.children[0].innerHTML === 'Upgrades') {
|
||||
if (CacheMissingUpgrades) {
|
||||
const normalUpgradesMissing = CacheMissingUpgrades.match(new RegExp('div', 'g') || []).length / 2;
|
||||
const normalUpgradesMissing =
|
||||
CacheMissingUpgrades.match(new RegExp('div', 'g') || []).length / 2;
|
||||
const title = document.createElement('div');
|
||||
title.id = 'CMMissingUpgradesTitle';
|
||||
title.className = 'listing';
|
||||
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);
|
||||
menuSection.insertBefore(title, menuSection.childNodes[3]);
|
||||
const upgrades = document.createElement('div');
|
||||
upgrades.className = 'listing crateBox';
|
||||
upgrades.innerHTML = CacheMissingUpgrades;
|
||||
menuSection.insertBefore(upgrades, document.getElementById('CMMissingUpgradesTitle').nextSibling);
|
||||
menuSection.insertBefore(
|
||||
upgrades,
|
||||
document.getElementById('CMMissingUpgradesTitle').nextSibling,
|
||||
);
|
||||
}
|
||||
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');
|
||||
title.id = 'CMMissingUpgradesCookiesTitle';
|
||||
title.className = 'listing';
|
||||
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);
|
||||
menuSection.appendChild(title);
|
||||
const upgrades = document.createElement('div');
|
||||
@@ -74,6 +104,8 @@ export function crateMissing(me) {
|
||||
const tooltip = `function() {return Game.crateTooltip(Game.UpgradesById[${me.id}], 'stats');}`;
|
||||
return `<div class="${classes}"
|
||||
${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>`;
|
||||
}
|
||||
|
||||
@@ -20,11 +20,25 @@ import {
|
||||
CacheEdifice,
|
||||
CacheEdificeBuilding,
|
||||
CacheGoldenCookiesMult,
|
||||
CacheHCPerSecond, CacheLastChoEgg, CacheLucky, CacheLuckyFrenzy, CacheLuckyReward, CacheLuckyRewardFrenzy, CacheLuckyWrathReward, CacheLuckyWrathRewardFrenzy, CacheNoGoldSwitchCookiesPS, CacheRealCookiesEarned, CacheWrathCookiesMult, CacheWrinklersTotal,
|
||||
CacheHCPerSecond,
|
||||
CacheLastChoEgg,
|
||||
CacheLucky,
|
||||
CacheLuckyFrenzy,
|
||||
CacheLuckyReward,
|
||||
CacheLuckyRewardFrenzy,
|
||||
CacheLuckyWrathReward,
|
||||
CacheLuckyWrathRewardFrenzy,
|
||||
CacheNoGoldSwitchCookiesPS,
|
||||
CacheRealCookiesEarned,
|
||||
CacheWrathCookiesMult,
|
||||
CacheWrinklersTotal,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import ResetBonus from '../../Sim/SimulationEvents/ResetAscension';
|
||||
import { Beautify, FormatTime } from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import {
|
||||
Beautify,
|
||||
FormatTime,
|
||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
|
||||
import GetCPS from '../HelperFunctions/GetCPS';
|
||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
||||
@@ -37,13 +51,21 @@ import { StatsListing } from './CreateDOMElements';
|
||||
*/
|
||||
export function LuckySection() {
|
||||
// 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');
|
||||
section.className = 'CMStatsLuckySection';
|
||||
|
||||
const luckyColor = ((Game.cookies + GetWrinkConfigBank()) < CacheLucky) ? ColorRed : ColorGreen;
|
||||
const luckyTime = ((Game.cookies + GetWrinkConfigBank()) < CacheLucky) ? FormatTime((CacheLucky - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
||||
const luckyColor =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheLucky ? ColorRed : ColorGreen;
|
||||
const luckyTime =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheLucky
|
||||
? FormatTime(
|
||||
(CacheLucky - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
)
|
||||
: '';
|
||||
const luckyReqFrag = document.createDocumentFragment();
|
||||
const luckyReqSpan = document.createElement('span');
|
||||
luckyReqSpan.style.fontWeight = 'bold';
|
||||
@@ -55,10 +77,25 @@ export function LuckySection() {
|
||||
luckyReqSmall.textContent = ` (${luckyTime})`;
|
||||
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 luckyTimeFrenzy = ((Game.cookies + GetWrinkConfigBank()) < CacheLuckyFrenzy) ? FormatTime((CacheLuckyFrenzy - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
||||
const luckyColorFrenzy =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
||||
? ColorRed
|
||||
: ColorGreen;
|
||||
const luckyTimeFrenzy =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy
|
||||
? FormatTime(
|
||||
(CacheLuckyFrenzy - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
)
|
||||
: '';
|
||||
const luckyReqFrenFrag = document.createDocumentFragment();
|
||||
const luckyReqFrenSpan = document.createElement('span');
|
||||
luckyReqFrenSpan.style.fontWeight = 'bold';
|
||||
@@ -70,28 +107,66 @@ export function LuckySection() {
|
||||
luckyReqFrenSmall.textContent = ` (${luckyTimeFrenzy})`;
|
||||
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 luckyRewardMaxSpan = document.createElement('span');
|
||||
luckyRewardMaxSpan.style.fontWeight = 'bold';
|
||||
luckyRewardMaxSpan.className = ColorTextPre + CacheLuckyReward;
|
||||
luckyRewardMaxSpan.textContent = Beautify(CacheLuckyReward) + (luckySplit ? (` / ${Beautify(CacheLuckyWrathReward)}`) : '');
|
||||
section.appendChild(StatsListing('withTooltip', `"Lucky!" Reward (MAX)${luckySplit ? ' (Golden / Wrath)' : ''}`, luckyRewardMaxSpan, goldCookTooltip));
|
||||
luckyRewardMaxSpan.textContent =
|
||||
Beautify(CacheLuckyReward) +
|
||||
(luckySplit ? ` / ${Beautify(CacheLuckyWrathReward)}` : '');
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'withTooltip',
|
||||
`"Lucky!" Reward (MAX)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
||||
luckyRewardMaxSpan,
|
||||
goldCookTooltip,
|
||||
),
|
||||
);
|
||||
|
||||
const luckyRewardFrenzyMaxSpan = document.createElement('span');
|
||||
luckyRewardFrenzyMaxSpan.style.fontWeight = 'bold';
|
||||
luckyRewardFrenzyMaxSpan.className = ColorTextPre + luckyRewardFrenzyMaxSpan;
|
||||
luckyRewardFrenzyMaxSpan.textContent = Beautify(CacheLuckyRewardFrenzy) + (luckySplit ? (` / ${Beautify(CacheLuckyWrathRewardFrenzy)}`) : '');
|
||||
section.appendChild(StatsListing('withTooltip', `"Lucky!" Reward (MAX) (Frenzy)${luckySplit ? ' (Golden / Wrath)' : ''}`, luckyRewardFrenzyMaxSpan, goldCookTooltip));
|
||||
luckyRewardFrenzyMaxSpan.textContent =
|
||||
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');
|
||||
luckyCurSpan.style.fontWeight = 'bold';
|
||||
luckyCurSpan.className = ColorTextPre + luckyCurSpan;
|
||||
luckyCurSpan.textContent = Beautify(CacheGoldenCookiesMult * luckyCurBase) + (luckySplit ? (` / ${Beautify(CacheWrathCookiesMult * luckyCurBase)}`) : '');
|
||||
section.appendChild(StatsListing('withTooltip', `"Lucky!" Reward (CUR)${luckySplit ? ' (Golden / Wrath)' : ''}`, luckyCurSpan, goldCookTooltip));
|
||||
luckyCurSpan.textContent =
|
||||
Beautify(CacheGoldenCookiesMult * luckyCurBase) +
|
||||
(luckySplit ? ` / ${Beautify(CacheWrathCookiesMult * luckyCurBase)}` : '');
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'withTooltip',
|
||||
`"Lucky!" Reward (CUR)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
||||
luckyCurSpan,
|
||||
goldCookTooltip,
|
||||
),
|
||||
);
|
||||
return section;
|
||||
}
|
||||
|
||||
@@ -101,13 +176,24 @@ export function LuckySection() {
|
||||
*/
|
||||
export function ChainSection() {
|
||||
// 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');
|
||||
section.className = 'CMStatsChainSection';
|
||||
|
||||
const chainColor = ((Game.cookies + GetWrinkConfigBank()) < CacheChainRequired) ? ColorRed : ColorGreen;
|
||||
const chainTime = ((Game.cookies + GetWrinkConfigBank()) < CacheChainRequired) ? FormatTime((CacheChainRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
||||
const chainColor =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
||||
? ColorRed
|
||||
: ColorGreen;
|
||||
const chainTime =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheChainRequired
|
||||
? FormatTime(
|
||||
(CacheChainRequired - (Game.cookies + GetWrinkConfigBank())) /
|
||||
GetCPS(),
|
||||
)
|
||||
: '';
|
||||
const chainReqFrag = document.createDocumentFragment();
|
||||
const chainReqSpan = document.createElement('span');
|
||||
chainReqSpan.style.fontWeight = 'bold';
|
||||
@@ -119,10 +205,26 @@ export function ChainSection() {
|
||||
chainReqSmall.textContent = ` (${chainTime})`;
|
||||
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 chainWrathTime = ((Game.cookies + GetWrinkConfigBank()) < CacheChainWrathRequired) ? FormatTime((CacheChainWrathRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
||||
const chainWrathColor =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
||||
? ColorRed
|
||||
: ColorGreen;
|
||||
const chainWrathTime =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired
|
||||
? FormatTime(
|
||||
(CacheChainWrathRequired - (Game.cookies + GetWrinkConfigBank())) /
|
||||
GetCPS(),
|
||||
)
|
||||
: '';
|
||||
const chainWrathReqFrag = document.createDocumentFragment();
|
||||
const chainWrathReqSpan = document.createElement('span');
|
||||
chainWrathReqSpan.style.fontWeight = 'bold';
|
||||
@@ -134,10 +236,26 @@ export function ChainSection() {
|
||||
chainWrathReqSmall.textContent = ` (${chainWrathTime})`;
|
||||
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 chainTimeFrenzy = ((Game.cookies + GetWrinkConfigBank()) < CacheChainFrenzyRequired) ? FormatTime((CacheChainFrenzyRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
||||
const chainColorFrenzy =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
||||
? ColorRed
|
||||
: ColorGreen;
|
||||
const chainTimeFrenzy =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired
|
||||
? FormatTime(
|
||||
(CacheChainFrenzyRequired - (Game.cookies + GetWrinkConfigBank())) /
|
||||
GetCPS(),
|
||||
)
|
||||
: '';
|
||||
const chainReqFrenFrag = document.createDocumentFragment();
|
||||
const chainReqFrenSpan = document.createElement('span');
|
||||
chainReqFrenSpan.style.fontWeight = 'bold';
|
||||
@@ -149,10 +267,27 @@ export function ChainSection() {
|
||||
chainReqFrenSmall.textContent = ` (${chainTimeFrenzy})`;
|
||||
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 chainWrathTimeFrenzy = ((Game.cookies + GetWrinkConfigBank()) < CacheChainFrenzyWrathRequired) ? FormatTime((CacheChainFrenzyWrathRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
||||
const chainWrathColorFrenzy =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
||||
? ColorRed
|
||||
: ColorGreen;
|
||||
const chainWrathTimeFrenzy =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired
|
||||
? FormatTime(
|
||||
(CacheChainFrenzyWrathRequired -
|
||||
(Game.cookies + GetWrinkConfigBank())) /
|
||||
GetCPS(),
|
||||
)
|
||||
: '';
|
||||
const chainWrathReqFrenFrag = document.createDocumentFragment();
|
||||
const chainWrathReqFrenSpan = document.createElement('span');
|
||||
chainWrathReqFrenSpan.style.fontWeight = 'bold';
|
||||
@@ -164,19 +299,90 @@ export function ChainSection() {
|
||||
chainWrathReqFrenSmall.textContent = ` (${chainWrathTimeFrenzy})`;
|
||||
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 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));
|
||||
const chainCurMax = Math.min(
|
||||
Game.cookiesPs * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment,
|
||||
Game.cookies * 0.5,
|
||||
);
|
||||
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(StatsListing('withTooltip', 'CPS Needed For Next Level (Frenzy) (G / W)', document.createTextNode((`${Beautify(CacheChainFrenzyRequiredNext)} / ${Beautify(CacheChainFrenzyWrathRequiredNext)}`)), 'ChainNextLevelPlaceholder'));
|
||||
section.appendChild(
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -188,8 +394,14 @@ export function SpellsSection() {
|
||||
const section = document.createElement('div');
|
||||
section.className = 'CMStatsSpellsSection';
|
||||
|
||||
const conjureColor = ((Game.cookies + GetWrinkConfigBank()) < CacheConjure) ? ColorRed : ColorGreen;
|
||||
const conjureTime = ((Game.cookies + GetWrinkConfigBank()) < CacheConjure) ? FormatTime((CacheConjure - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : '';
|
||||
const conjureColor =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheConjure ? ColorRed : ColorGreen;
|
||||
const conjureTime =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheConjure
|
||||
? FormatTime(
|
||||
(CacheConjure - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
)
|
||||
: '';
|
||||
|
||||
const conjureReqFrag = document.createDocumentFragment();
|
||||
const conjureReqSpan = document.createElement('span');
|
||||
@@ -202,12 +414,37 @@ export function SpellsSection() {
|
||||
conjureReqSmall.textContent = ` (${conjureTime})`;
|
||||
conjureReqFrag.appendChild(conjureReqSmall);
|
||||
}
|
||||
section.appendChild(StatsListing('withTooltip', '"Conjure Baked Goods" Cookies Required', conjureReqFrag, 'GoldCookTooltipPlaceholder'));
|
||||
section.appendChild(StatsListing('withTooltip', '"Conjure Baked Goods" Reward (MAX)', document.createTextNode(Beautify(CacheConjureReward)), 'GoldCookTooltipPlaceholder'));
|
||||
section.appendChild(
|
||||
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 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 conjureFrenzyColor =
|
||||
Game.cookies + GetWrinkConfigBank() < CacheConjure * 7
|
||||
? 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 conjureFrenzyReqSpan = document.createElement('span');
|
||||
@@ -220,11 +457,41 @@ export function SpellsSection() {
|
||||
conjureFrenzyReqSmall.textContent = ` (${conjureFrenzyTime})`;
|
||||
conjureFrenzyReqFrag.appendChild(conjureFrenzyReqSmall);
|
||||
}
|
||||
section.appendChild(StatsListing('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'));
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'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) {
|
||||
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;
|
||||
}
|
||||
@@ -237,33 +504,61 @@ export function GardenSection() {
|
||||
const section = document.createElement('div');
|
||||
section.className = 'CMStatsGardenSection';
|
||||
|
||||
const bakeberryColor = (Game.cookies < Game.cookiesPs * 60 * 30) ? ColorRed : ColorGreen;
|
||||
const bakeberryColor =
|
||||
Game.cookies < Game.cookiesPs * 60 * 30 ? ColorRed : ColorGreen;
|
||||
const bakeberryFrag = document.createElement('span');
|
||||
bakeberryFrag.style.fontWeight = 'bold';
|
||||
bakeberryFrag.className = ColorTextPre + bakeberryColor;
|
||||
bakeberryFrag.textContent = Beautify(Game.cookiesPs * 60 * 30);
|
||||
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 * 3 ? ColorRed : ColorGreen;
|
||||
const chocorootFrag = document.createElement('span');
|
||||
chocorootFrag.style.fontWeight = 'bold';
|
||||
chocorootFrag.className = ColorTextPre + chocorootColor;
|
||||
chocorootFrag.textContent = Beautify(Game.cookiesPs * 60 * 3);
|
||||
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 ? ColorRed : ColorGreen;
|
||||
const queenbeetFrag = document.createElement('span');
|
||||
queenbeetFrag.style.fontWeight = 'bold';
|
||||
queenbeetFrag.className = ColorTextPre + queenbeetColor;
|
||||
queenbeetFrag.textContent = Beautify(Game.cookiesPs * 60 * 60);
|
||||
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 * 120 ? ColorRed : ColorGreen;
|
||||
const duketaterFrag = document.createElement('span');
|
||||
duketaterFrag.style.fontWeight = 'bold';
|
||||
duketaterFrag.className = ColorTextPre + duketaterColor;
|
||||
duketaterFrag.textContent = Beautify(Game.cookiesPs * 60 * 120);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -275,45 +570,124 @@ export function PrestigeSection() {
|
||||
const section = document.createElement('div');
|
||||
section.className = 'CMStatsPrestigeSection';
|
||||
|
||||
const possiblePresMax = Math.floor(Game.HowMuchPrestige(CacheRealCookiesEarned
|
||||
+ 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 possiblePresMax = Math.floor(
|
||||
Game.HowMuchPrestige(
|
||||
CacheRealCookiesEarned +
|
||||
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 =
|
||||
Game.HowManyCookiesReset(possiblePresMax + 1) -
|
||||
(CacheRealCookiesEarned +
|
||||
Game.cookiesReset +
|
||||
CacheWrinklersTotal +
|
||||
((
|
||||
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')
|
||||
? CacheLastChoEgg
|
||||
: 0
|
||||
)
|
||||
? CacheLastChoEgg
|
||||
: 0));
|
||||
const cookiesNextFrag = document.createDocumentFragment();
|
||||
cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook)));
|
||||
const cookiesNextSmall = document.createElement('small');
|
||||
cookiesNextSmall.textContent = ` (${FormatTime(neededCook / CacheAvgCPSWithChoEgg, 1)})`;
|
||||
cookiesNextSmall.textContent = ` (${FormatTime(
|
||||
neededCook / CacheAvgCPSWithChoEgg,
|
||||
1,
|
||||
)})`;
|
||||
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);
|
||||
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) {
|
||||
section.appendChild(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))));
|
||||
section.appendChild(
|
||||
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 resetFrag = document.createDocumentFragment();
|
||||
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) {
|
||||
const resetSmall = document.createElement('small');
|
||||
resetSmall.textContent = ` (${increase / 100}% of income)`;
|
||||
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 willHave = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||
const willHave = Math.floor(
|
||||
Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned),
|
||||
);
|
||||
const willGet = willHave - currentPrestige;
|
||||
if (!Game.Has('Lucky digit')) {
|
||||
let delta7 = 7 - (willHave % 10);
|
||||
@@ -321,8 +695,14 @@ export function PrestigeSection() {
|
||||
const next7Reset = willGet + delta7;
|
||||
const next7Total = willHave + delta7;
|
||||
const frag7 = document.createDocumentFragment();
|
||||
frag7.appendChild(document.createTextNode(`${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`));
|
||||
section.appendChild(StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7));
|
||||
frag7.appendChild(
|
||||
document.createTextNode(
|
||||
`${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`,
|
||||
),
|
||||
);
|
||||
section.appendChild(
|
||||
StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7),
|
||||
);
|
||||
}
|
||||
|
||||
if (!Game.Has('Lucky number')) {
|
||||
@@ -331,8 +711,14 @@ export function PrestigeSection() {
|
||||
const next777Reset = willGet + delta777;
|
||||
const next777Total = willHave + delta777;
|
||||
const frag777 = document.createDocumentFragment();
|
||||
frag777.appendChild(document.createTextNode(`${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`));
|
||||
section.appendChild(StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777));
|
||||
frag777.appendChild(
|
||||
document.createTextNode(
|
||||
`${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`,
|
||||
),
|
||||
);
|
||||
section.appendChild(
|
||||
StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777),
|
||||
);
|
||||
}
|
||||
|
||||
if (!Game.Has('Lucky payout')) {
|
||||
@@ -341,8 +727,14 @@ export function PrestigeSection() {
|
||||
const next777777Reset = willGet + delta777777;
|
||||
const next777777Total = willHave + delta777777;
|
||||
const frag777777 = document.createDocumentFragment();
|
||||
frag777777.appendChild(document.createTextNode(`${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`));
|
||||
section.appendChild(StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777));
|
||||
frag777777.appendChild(
|
||||
document.createTextNode(
|
||||
`${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`,
|
||||
),
|
||||
);
|
||||
section.appendChild(
|
||||
StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777),
|
||||
);
|
||||
}
|
||||
|
||||
return section;
|
||||
|
||||
@@ -24,7 +24,10 @@ export default function AddMenuInfo(title) {
|
||||
span.style.fontSize = '13px';
|
||||
span.style.verticalAlign = 'middle';
|
||||
span.textContent = CMOptions.Header.InfoTab ? '-' : '+';
|
||||
span.onclick = function () { ToggleHeader('InfoTab'); Game.UpdateMenu(); };
|
||||
span.onclick = function () {
|
||||
ToggleHeader('InfoTab');
|
||||
Game.UpdateMenu();
|
||||
};
|
||||
title.appendChild(span);
|
||||
info.appendChild(title);
|
||||
|
||||
|
||||
@@ -5,5 +5,11 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
||||
* It is called by CM.Disp.Draw()
|
||||
*/
|
||||
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,12 +1,21 @@
|
||||
/** Functions related to the Options/Preferences page */
|
||||
|
||||
import jscolor, * as JsColor from '@eastdesire/jscolor';
|
||||
import { LoadConfig, SaveConfig } from '../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||
import {
|
||||
ConfigPrefix, ToggleConfig, ToggleConfigVolume, ToggleHeader,
|
||||
LoadConfig,
|
||||
SaveConfig,
|
||||
} from '../../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||
import {
|
||||
ConfigPrefix,
|
||||
ToggleConfig,
|
||||
ToggleConfigVolume,
|
||||
ToggleHeader,
|
||||
} from '../../Config/ToggleSetting';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { ConfigGroups, ConfigGroupsNotification } from '../../Data/Sectionheaders';
|
||||
import {
|
||||
ConfigGroups,
|
||||
ConfigGroupsNotification,
|
||||
} from '../../Data/Sectionheaders';
|
||||
import Config from '../../Data/SettingsData';
|
||||
import ConfigDefault from '../../Data/SettingsDefault';
|
||||
import RefreshScale from '../HelperFunctions/RefreshScale';
|
||||
@@ -38,7 +47,10 @@ function CreatePrefHeader(config, text) {
|
||||
span.style.fontSize = '13px';
|
||||
span.style.verticalAlign = 'middle';
|
||||
span.textContent = CMOptions.Header[config] ? '-' : '+';
|
||||
span.onclick = function () { ToggleHeader(config); Game.UpdateMenu(); };
|
||||
span.onclick = function () {
|
||||
ToggleHeader(config);
|
||||
Game.UpdateMenu();
|
||||
};
|
||||
div.appendChild(span);
|
||||
return div;
|
||||
}
|
||||
@@ -59,14 +71,17 @@ function CreatePrefOption(config) {
|
||||
a.className = 'option';
|
||||
}
|
||||
a.id = ConfigPrefix + config;
|
||||
a.onclick = function () { ToggleConfig(config); };
|
||||
a.onclick = function () {
|
||||
ToggleConfig(config);
|
||||
};
|
||||
a.textContent = Config[config].label[CMOptions[config]];
|
||||
div.appendChild(a);
|
||||
const label = document.createElement('label');
|
||||
label.textContent = Config[config].desc;
|
||||
div.appendChild(label);
|
||||
return div;
|
||||
} if (Config[config].type === 'vol') {
|
||||
}
|
||||
if (Config[config].type === 'vol') {
|
||||
const volume = document.createElement('div');
|
||||
volume.className = 'sliderBox';
|
||||
const title = document.createElement('div');
|
||||
@@ -87,12 +102,17 @@ function CreatePrefOption(config) {
|
||||
slider.max = '100';
|
||||
slider.step = '1';
|
||||
slider.value = CMOptions[config];
|
||||
slider.oninput = function () { ToggleConfigVolume(config); };
|
||||
slider.onchange = function () { ToggleConfigVolume(config); };
|
||||
slider.oninput = function () {
|
||||
ToggleConfigVolume(config);
|
||||
};
|
||||
slider.onchange = function () {
|
||||
ToggleConfigVolume(config);
|
||||
};
|
||||
volume.appendChild(slider);
|
||||
div.appendChild(volume);
|
||||
return div;
|
||||
} if (Config[config].type === 'url') {
|
||||
}
|
||||
if (Config[config].type === 'url') {
|
||||
const span = document.createElement('span');
|
||||
span.className = 'option';
|
||||
span.textContent = `${Config[config].label} `;
|
||||
@@ -114,7 +134,18 @@ function CreatePrefOption(config) {
|
||||
const a = document.createElement('a');
|
||||
a.className = 'option';
|
||||
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';
|
||||
div.appendChild(a);
|
||||
@@ -122,7 +153,8 @@ function CreatePrefOption(config) {
|
||||
label.textContent = Config[config].desc;
|
||||
div.appendChild(label);
|
||||
return div;
|
||||
} if (Config[config].type === 'color') {
|
||||
}
|
||||
if (Config[config].type === 'color') {
|
||||
div.className = '';
|
||||
for (let i = 0; i < Colors.length; i++) {
|
||||
const innerDiv = document.createElement('div');
|
||||
@@ -146,7 +178,8 @@ function CreatePrefOption(config) {
|
||||
}
|
||||
jscolor.init();
|
||||
return div;
|
||||
} if (Config[config].type === 'numscale') {
|
||||
}
|
||||
if (Config[config].type === 'numscale') {
|
||||
const span = document.createElement('span');
|
||||
span.className = 'option';
|
||||
span.textContent = `${Config[config].label} `;
|
||||
@@ -155,7 +188,7 @@ function CreatePrefOption(config) {
|
||||
input.id = ConfigPrefix + config;
|
||||
input.className = 'option';
|
||||
input.type = 'number';
|
||||
input.value = (CMOptions[config]);
|
||||
input.value = CMOptions[config];
|
||||
input.min = Config[config].min;
|
||||
input.max = Config[config].max;
|
||||
input.oninput = function () {
|
||||
@@ -186,23 +219,29 @@ export default function AddMenuPref(title) {
|
||||
for (const group of Object.keys(ConfigGroups)) {
|
||||
const groupObject = CreatePrefHeader(group, ConfigGroups[group]); // (group, display-name of group)
|
||||
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
|
||||
if (group === 'Notification') {
|
||||
for (const subGroup of Object.keys(ConfigGroupsNotification)) {
|
||||
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.opacity = '0.5';
|
||||
frag.appendChild(subGroupObject);
|
||||
if (CMOptions.Header[subGroup]) {
|
||||
for (const option in Config) {
|
||||
if (Config[option].group === subGroup) frag.appendChild(CreatePrefOption(option));
|
||||
if (Config[option].group === subGroup)
|
||||
frag.appendChild(CreatePrefOption(option));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (const option of Object.keys(Config)) {
|
||||
if (Config[option].group === group) frag.appendChild(CreatePrefOption(option));
|
||||
if (Config[option].group === group)
|
||||
frag.appendChild(CreatePrefOption(option));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,10 +251,17 @@ export default function AddMenuPref(title) {
|
||||
resDef.className = 'listing';
|
||||
const resDefBut = document.createElement('a');
|
||||
resDefBut.className = 'option';
|
||||
resDefBut.onclick = function () { LoadConfig(ConfigDefault); };
|
||||
resDefBut.onclick = function () {
|
||||
LoadConfig(ConfigDefault);
|
||||
};
|
||||
resDefBut.textContent = 'Restore Default';
|
||||
resDef.appendChild(resDefBut);
|
||||
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) {
|
||||
// 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';
|
||||
if (mode === 3) {
|
||||
l('CMWhiteScreen').style.display = 'inline';
|
||||
setTimeout(function () { Flash(2, config); }, 1000 / Game.fps);
|
||||
setTimeout(function () {
|
||||
Flash(2, config);
|
||||
}, 1000 / Game.fps);
|
||||
} else {
|
||||
setTimeout(function () { Flash(0, config); }, 1000 / Game.fps);
|
||||
setTimeout(function () {
|
||||
Flash(0, config);
|
||||
}, 1000 / Game.fps);
|
||||
}
|
||||
} else if (mode === 2) {
|
||||
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';
|
||||
}
|
||||
|
||||
@@ -12,7 +12,11 @@ import { isInitializing } from '../../InitSaveLoad/Variables';
|
||||
*/
|
||||
export default function Notification(notifyConfig, title, message) {
|
||||
// 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';
|
||||
new Notification(title, { body: message, badge: CookieIcon });
|
||||
}
|
||||
|
||||
@@ -13,8 +13,9 @@ export default function PlaySound(url, sndConfig, volConfig) {
|
||||
if (CMOptions[sndConfig] === 1 && isInitializing === false) {
|
||||
// eslint-disable-next-line new-cap
|
||||
const sound = new realAudio(url);
|
||||
if (CMOptions.GeneralSound) sound.volume = (CMOptions[volConfig] / 100) * (Game.volume / 100);
|
||||
else sound.volume = (CMOptions[volConfig] / 100);
|
||||
if (CMOptions.GeneralSound)
|
||||
sound.volume = (CMOptions[volConfig] / 100) * (Game.volume / 100);
|
||||
else sound.volume = CMOptions[volConfig] / 100;
|
||||
sound.play();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,13 @@ export function CreateFavicon() {
|
||||
*/
|
||||
export function UpdateFavicon() {
|
||||
if (CMOptions.Favicon === 1 && LastGoldenCookieState > 0) {
|
||||
if (CacheSpawnedGoldenShimmer.wrath) l('CMFavicon').href = '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';
|
||||
if (CacheSpawnedGoldenShimmer.wrath)
|
||||
l('CMFavicon').href =
|
||||
'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 */
|
||||
|
||||
import { CacheSeasonPopShimmer, CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData';
|
||||
import {
|
||||
CacheSeasonPopShimmer,
|
||||
CacheSpawnedGoldenShimmer,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData';
|
||||
import {
|
||||
LastSeasonPopupState,
|
||||
LastTickerFortuneState,
|
||||
} from '../../Main/VariablesAndData';
|
||||
import { Title } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -20,10 +26,17 @@ export default function UpdateTitle() {
|
||||
let titleSP;
|
||||
|
||||
if (CacheSpawnedGoldenShimmer) {
|
||||
if (CacheSpawnedGoldenShimmer.wrath) titleGC = `[W${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
||||
else titleGC = `[G${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
||||
if (CacheSpawnedGoldenShimmer.wrath)
|
||||
titleGC = `[W${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
||||
else
|
||||
titleGC = `[G${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`;
|
||||
} 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]';
|
||||
|
||||
if (LastTickerFortuneState) {
|
||||
@@ -33,9 +46,16 @@ export default function UpdateTitle() {
|
||||
|
||||
if (Game.season === 'christmas') {
|
||||
addSP = true;
|
||||
if (LastSeasonPopupState) titleSP = `[R${Math.ceil(CacheSeasonPopShimmer.life / Game.fps)}]`;
|
||||
if (LastSeasonPopupState)
|
||||
titleSP = `[R${Math.ceil(CacheSeasonPopShimmer.life / Game.fps)}]`;
|
||||
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) === '[') {
|
||||
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) {
|
||||
let str = '';
|
||||
let spawn = false;
|
||||
if (CacheSpawnedGoldenShimmer) {
|
||||
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)}]`;
|
||||
}
|
||||
if (LastTickerFortuneState) {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { CacheHCPerSecond, CacheTimeTillNextPrestige } from '../../Cache/VariablesAndData';
|
||||
import {
|
||||
CacheHCPerSecond,
|
||||
CacheTimeTillNextPrestige,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
|
||||
@@ -8,21 +11,53 @@ import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
* @returns {object} div An object containing the stylized header
|
||||
*/
|
||||
export default function ReplaceAscendTooltip() {
|
||||
const ascendNowToGet = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) - Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
|
||||
const cookiesToNext = 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);
|
||||
const ascendNowToGet =
|
||||
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) -
|
||||
Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
|
||||
const cookiesToNext =
|
||||
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 += `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 += `Your prestige level is currently <b>${Beautify(
|
||||
Game.prestige,
|
||||
)}</b>.<br>(CpS +${Beautify(Game.prestige)}%)`;
|
||||
str += '<div class="line"></div>';
|
||||
}
|
||||
if (ascendNowToGet < 1) str += 'Ascending now would grant you no prestige.';
|
||||
else if (ascendNowToGet < 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(ascendNowToGet)} prestige levels</b> (+${Beautify(ascendNowToGet)}% CpS)<br>and <b>${Beautify(ascendNowToGet)} heavenly chips</b> to spend.`;
|
||||
else if (ascendNowToGet < 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(
|
||||
ascendNowToGet,
|
||||
)} prestige levels</b> (+${Beautify(
|
||||
ascendNowToGet,
|
||||
)}% CpS)<br>and <b>${Beautify(
|
||||
ascendNowToGet,
|
||||
)} 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>` : ''}`;
|
||||
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,13 @@
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import {
|
||||
ColorTextPre, ColorBorderPre, ColorGray, ColorBlue, ColorRed, ColorYellow, ColorPurple, TooltipType,
|
||||
ColorTextPre,
|
||||
ColorBorderPre,
|
||||
ColorGray,
|
||||
ColorBlue,
|
||||
ColorRed,
|
||||
ColorYellow,
|
||||
ColorPurple,
|
||||
TooltipType,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/** Creates various sections of tooltips */
|
||||
@@ -47,7 +54,13 @@ export function TooltipCreateWarningSection() {
|
||||
TooltipWarn.style.bottom = 'auto';
|
||||
TooltipWarn.id = 'CMDispTooltipWarningParent';
|
||||
|
||||
const create = function (boxId, color, labelTextFront, labelTextBack, deficitId) {
|
||||
const create = function (
|
||||
boxId,
|
||||
color,
|
||||
labelTextFront,
|
||||
labelTextBack,
|
||||
deficitId,
|
||||
) {
|
||||
const box = document.createElement('div');
|
||||
box.id = boxId;
|
||||
box.style.display = 'none';
|
||||
@@ -72,17 +85,65 @@ export function TooltipCreateWarningSection() {
|
||||
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.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.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.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.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.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;
|
||||
}
|
||||
@@ -121,7 +182,9 @@ export function TooltipCreateCalculationSection(tooltip) {
|
||||
tooltip.appendChild(time);
|
||||
|
||||
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
|
||||
const production = document.createElement('div');
|
||||
production.id = 'CMTooltipProduction';
|
||||
|
||||
@@ -7,10 +7,21 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
||||
export default function UpdateTooltipLocation() {
|
||||
if (Game.tooltip.origin === 'store') {
|
||||
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;
|
||||
}
|
||||
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
|
||||
/* else if (!Game.onCrate && !Game.OnAscend && CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 0) {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import * as UpdateTooltip from './UpdateTooltips';
|
||||
import { TooltipCreateTooltipBox } from './CreateTooltip';
|
||||
import { Beautify, GetTimeColor } from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import {
|
||||
Beautify,
|
||||
GetTimeColor,
|
||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||
import { TooltipName, TooltipType } from '../VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
@@ -53,7 +56,8 @@ export function UpdateTooltips() {
|
||||
UpdateTooltip.HarvestAll();
|
||||
}
|
||||
UpdateTooltip.Warnings();
|
||||
} else if (l('CMTooltipArea') === null) { // Remove warnings if its a basic tooltip
|
||||
} else if (l('CMTooltipArea') === null) {
|
||||
// Remove warnings if its a basic tooltip
|
||||
if (l('CMDispTooltipWarningParent') !== null) {
|
||||
l('CMDispTooltipWarningParent').remove();
|
||||
}
|
||||
@@ -68,16 +72,32 @@ export function UpdateTooltips() {
|
||||
* @returns {string} l('tooltip').innerHTML The HTML of the l('tooltip')-object
|
||||
*/
|
||||
export function CreateTooltip(type, name) {
|
||||
if (type === 'b') { // Buildings
|
||||
if (type === 'b') {
|
||||
// Buildings
|
||||
l('tooltip').innerHTML = Game.Objects[name].tooltip();
|
||||
// Adds amortization info to the list of info per building
|
||||
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;
|
||||
if (amortizeAmount > 0) {
|
||||
l('tooltip').innerHTML = l('tooltip').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>`);
|
||||
l('tooltip').innerHTML = l('tooltip')
|
||||
.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>`,
|
||||
);
|
||||
}
|
||||
}
|
||||
if (Game.buyMode === -1) {
|
||||
@@ -89,18 +109,51 @@ export function CreateTooltip(type, name) {
|
||||
*
|
||||
* 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 '';
|
||||
l('tooltip').innerHTML = Game.crateTooltip(Game.UpgradesInStore[name], 'store');
|
||||
} 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])(); // Garden plots
|
||||
else if (type === 'ha') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)(); // Harvest all button in garden
|
||||
l('tooltip').innerHTML = Game.crateTooltip(
|
||||
Game.UpgradesInStore[name],
|
||||
'store',
|
||||
);
|
||||
} 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],
|
||||
)();
|
||||
// Garden plots
|
||||
else if (type === 'ha')
|
||||
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)(); // Harvest all button in garden
|
||||
|
||||
// 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'
|
||||
) {
|
||||
const area = document.createElement('div');
|
||||
area.id = 'CMTooltipArea';
|
||||
l('tooltip').appendChild(area);
|
||||
|
||||
@@ -1,17 +1,34 @@
|
||||
import GetCPSBuffMult from '../../Cache/CPS/GetCPSBuffMult';
|
||||
import {
|
||||
CacheEdifice, CacheLastChoEgg, CacheLucky, CacheNoGoldSwitchCookiesPS, CacheObjects1, CacheObjects10, CacheObjects100, CacheUpgrades,
|
||||
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 {
|
||||
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,
|
||||
ColorTextPre,
|
||||
LastTargetTooltipBuilding,
|
||||
TooltipBonusIncome,
|
||||
TooltipBonusMouse,
|
||||
TooltipName,
|
||||
TooltipPrice,
|
||||
TooltipType,
|
||||
} from '../VariablesAndData';
|
||||
import * as Create from './CreateTooltip';
|
||||
|
||||
@@ -40,16 +57,23 @@ export function Building() {
|
||||
|
||||
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
||||
const increase = Math.round(TooltipBonusIncome / Game.cookiesPs * 10000);
|
||||
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());
|
||||
const timeColor = GetTimeColor(
|
||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
);
|
||||
l('CMTooltipTime').textContent = timeColor.text;
|
||||
if (timeColor.text === 'Done!' && Game.cookies < target[TooltipName].price) {
|
||||
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;
|
||||
@@ -59,12 +83,20 @@ export function Building() {
|
||||
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];
|
||||
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').textContent = Beautify(
|
||||
nextProductionAchiev.pow - SimObjects[TooltipName].totalCookies,
|
||||
15,
|
||||
);
|
||||
l('CMTooltipProduction').style.color = 'white';
|
||||
break;
|
||||
}
|
||||
@@ -79,15 +111,22 @@ 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;
|
||||
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);
|
||||
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')) {
|
||||
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';
|
||||
@@ -96,7 +135,9 @@ export function Upgrade() {
|
||||
if (Number.isFinite(increase) && increase !== 0) {
|
||||
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
||||
}
|
||||
l('CMTooltipBorder').className = ColorTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||
l('CMTooltipBorder').className =
|
||||
ColorTextPre +
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||
// If clicking power upgrade
|
||||
if (TooltipBonusMouse) {
|
||||
l('CMTooltipCookiePerClick').textContent = Beautify(TooltipBonusMouse);
|
||||
@@ -105,16 +146,28 @@ export function Upgrade() {
|
||||
}
|
||||
// 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').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;
|
||||
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());
|
||||
const timeColor = GetTimeColor(
|
||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
);
|
||||
l('CMTooltipTime').textContent = timeColor.text;
|
||||
if (timeColor.text === 'Done!' && Game.cookies < Game.UpgradesInStore[TooltipName].getPrice()) {
|
||||
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;
|
||||
@@ -122,10 +175,14 @@ export function Upgrade() {
|
||||
// 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)'));
|
||||
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)}`;
|
||||
chocolate.textContent = `${Beautify(Game.cookies * 0.05)} / ${Beautify(
|
||||
CacheLastChoEgg,
|
||||
)}`;
|
||||
l('CMTooltipBorder').appendChild(chocolate);
|
||||
}
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
@@ -166,7 +223,9 @@ export function Grimoire() {
|
||||
const time = document.createElement('div');
|
||||
time.id = 'CMTooltipTime';
|
||||
tooltipBox.appendChild(time);
|
||||
const timeColor = GetTimeColor(CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, spellCost));
|
||||
const timeColor = GetTimeColor(
|
||||
CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, spellCost),
|
||||
);
|
||||
time.textContent = timeColor.text;
|
||||
time.className = ColorTextPre + timeColor.color;
|
||||
|
||||
@@ -176,27 +235,41 @@ export function Grimoire() {
|
||||
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));
|
||||
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'));
|
||||
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);
|
||||
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);
|
||||
loss.textContent = Beautify(CacheNoGoldSwitchCookiesPS * 60 * 15, 2);
|
||||
conjure.appendChild(loss);
|
||||
}
|
||||
|
||||
@@ -210,21 +283,47 @@ export function Grimoire() {
|
||||
*/
|
||||
export function GardenPlots() {
|
||||
const minigame = Game.Objects.Farm.minigame;
|
||||
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)'));
|
||||
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)}`;
|
||||
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)}`;
|
||||
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)}`;
|
||||
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)}`;
|
||||
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';
|
||||
}
|
||||
@@ -237,7 +336,9 @@ export function GardenPlots() {
|
||||
export function HarvestAll() {
|
||||
const minigame = Game.Objects.Farm.minigame;
|
||||
if (CMOptions.TooltipLump) {
|
||||
l('CMTooltipBorder').appendChild(Create.TooltipCreateHeader('Cookies gained from harvesting:'));
|
||||
l('CMTooltipBorder').appendChild(
|
||||
Create.TooltipCreateHeader('Cookies gained from harvesting:'),
|
||||
);
|
||||
let totalGain = 0;
|
||||
let mortal = 0;
|
||||
if (Game.keys[16] && Game.keys[17]) mortal = 1;
|
||||
@@ -252,18 +353,32 @@ export function HarvestAll() {
|
||||
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 * 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);
|
||||
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);
|
||||
totalGain += Math.min(
|
||||
Game.cookies * 0.08,
|
||||
Game.cookiesPs * 60 * 120,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
l('CMTooltipBorder').appendChild(document.createTextNode(Beautify(totalGain)));
|
||||
l('CMTooltipBorder').appendChild(
|
||||
document.createTextNode(Beautify(totalGain)),
|
||||
);
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
|
||||
@@ -278,64 +393,116 @@ export function Warnings() {
|
||||
ToggleToolWarnPos();
|
||||
}
|
||||
|
||||
if (CMOptions.ToolWarnPos === 0) l('CMDispTooltipWarningParent').style.right = '0px';
|
||||
else l('CMDispTooltipWarningParent').style.top = `${l('tooltip').offsetHeight}px`;
|
||||
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`;
|
||||
l('CMDispTooltipWarningParent').style.width = `${
|
||||
l('tooltip').offsetWidth - 6
|
||||
}px`;
|
||||
|
||||
const amount = (Game.cookies + GetWrinkConfigBank()) - TooltipPrice;
|
||||
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);
|
||||
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))})`;
|
||||
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)) {
|
||||
if (
|
||||
amount < limitLuckyFrenzy &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnLuckyFrenzy').style.display = '';
|
||||
l('CMDispTooltipWarnLuckyFrenzyText').textContent = `${Beautify(limitLuckyFrenzy - amount)} (${FormatTime((limitLuckyFrenzy - amount) / (GetCPS() + bonusIncomeUsed))})`;
|
||||
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)) {
|
||||
if (
|
||||
amount < limitConjure &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnConjure').style.display = '';
|
||||
l('CMDispTooltipWarnConjureText').textContent = `${Beautify(limitConjure - amount)} (${FormatTime((limitConjure - amount) / (GetCPS() + bonusIncomeUsed))})`;
|
||||
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)) {
|
||||
if (
|
||||
amount < limitConjureFrenzy &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnConjureFrenzy').style.display = '';
|
||||
l('CMDispTooltipWarnConjureFrenzyText').textContent = `${Beautify(limitConjureFrenzy - amount)} (${FormatTime((limitConjureFrenzy - amount) / (GetCPS() + bonusIncomeUsed))})`;
|
||||
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)) {
|
||||
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))})`;
|
||||
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)) {
|
||||
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))})`;
|
||||
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) {
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||
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
|
||||
@@ -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
|
||||
*/
|
||||
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;
|
||||
for (const i of Object.keys(Game.wrinklers)) {
|
||||
const me = Game.wrinklers[i];
|
||||
if (me.phase > 0 && me.selected) {
|
||||
showingTooltip = true;
|
||||
if (TooltipWrinklerBeingShown[i] === 0 || TooltipWrinklerBeingShown[i] === undefined) {
|
||||
if (
|
||||
TooltipWrinklerBeingShown[i] === 0 ||
|
||||
TooltipWrinklerBeingShown[i] === undefined
|
||||
) {
|
||||
const placeholder = document.createElement('div');
|
||||
const wrinkler = document.createElement('div');
|
||||
wrinkler.style.minWidth = '120px';
|
||||
|
||||
@@ -23,7 +23,17 @@ export const ColorPurple = 'Purple';
|
||||
export const ColorGray = 'Gray';
|
||||
export const ColorPink = 'Pink';
|
||||
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.
|
||||
@@ -34,13 +44,41 @@ export const Colors = [ColorGray, ColorBlue, ColorGreen, ColorYellow, ColorOrang
|
||||
*/
|
||||
export const TooltipText = [
|
||||
['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'],
|
||||
['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'],
|
||||
[
|
||||
'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',
|
||||
],
|
||||
[
|
||||
'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',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -78,7 +116,12 @@ export const ClickTimes = [1, 5, 10, 15, 30];
|
||||
* This array is used to give certain timers specific colours
|
||||
*/
|
||||
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;
|
||||
let proceed = true;
|
||||
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) {
|
||||
InitializeCookieMonster();
|
||||
|
||||
@@ -11,7 +11,17 @@ export default function load(str) {
|
||||
InitData();
|
||||
LoadConfig(save.settings);
|
||||
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!');
|
||||
else Game.Notify('A new version of Cookie Monster has been loaded, check out the release notes in the info tab!', '', '', 0, 1);
|
||||
if (Game.prefs.popups)
|
||||
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,7 +7,10 @@ import { LastGardenNextStep } from '../VariablesAndData';
|
||||
* This function checks if a garden tick has happened
|
||||
*/
|
||||
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()) {
|
||||
Flash(3, 'GardFlash');
|
||||
PlaySound(CMOptions.GardSoundURL, 'GardSound', 'GardVolume');
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { CacheSpawnedGoldenShimmer, CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
|
||||
import {
|
||||
CacheSpawnedGoldenShimmer,
|
||||
CacheGoldenShimmersByID,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import CreateGCTimer from '../../Disp/GoldenCookieTimers/GoldenCookieTimers';
|
||||
import Flash from '../../Disp/Notifications/Flash';
|
||||
@@ -7,7 +10,11 @@ import Notification from '../../Disp/Notifications/Notification';
|
||||
import PlaySound from '../../Disp/Notifications/Sound';
|
||||
import { UpdateFavicon } from '../../Disp/TabTitle/FavIcon';
|
||||
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.
|
||||
@@ -44,7 +51,11 @@ export default function CheckGoldenCookie() {
|
||||
if (LastSpawnedGoldenCookieState < CurrSpawnedGoldenCookieState) {
|
||||
Flash(3, 'GCFlash');
|
||||
PlaySound(CMOptions.GCSoundURL, 'GCSound', 'GCVolume');
|
||||
Notification('GCNotification', 'Golden Cookie Spawned', 'A Golden Cookie has spawned. Click it now!');
|
||||
Notification(
|
||||
'GCNotification',
|
||||
'Golden Cookie Spawned',
|
||||
'A Golden Cookie has spawned. Click it now!',
|
||||
);
|
||||
}
|
||||
|
||||
for (const i of Object.keys(Game.shimmers)) {
|
||||
@@ -59,8 +70,11 @@ export default function CheckGoldenCookie() {
|
||||
} else if (CMOptions.GCTimer === 1 && LastGoldenCookieState) {
|
||||
for (const i of Object.keys(GCTimers)) {
|
||||
GCTimers[i].style.opacity = CacheGoldenShimmersByID[i].l.style.opacity;
|
||||
GCTimers[i].style.transform = CacheGoldenShimmersByID[i].l.style.transform;
|
||||
GCTimers[i].textContent = Math.ceil(CacheGoldenShimmersByID[i].life / Game.fps);
|
||||
GCTimers[i].style.transform =
|
||||
CacheGoldenShimmersByID[i].l.style.transform;
|
||||
GCTimers[i].textContent = Math.ceil(
|
||||
CacheGoldenShimmersByID[i].life / Game.fps,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,21 @@ import { LastMagicBarFull } from '../VariablesAndData';
|
||||
* It is called by CM.Main.Loop
|
||||
*/
|
||||
export default function CheckMagicMeter() {
|
||||
if (Game.Objects['Wizard tower'].minigameLoaded && CMOptions.GrimoireBar === 1) {
|
||||
if (
|
||||
Game.Objects['Wizard tower'].minigameLoaded &&
|
||||
CMOptions.GrimoireBar === 1
|
||||
) {
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
if (minigame.magic < minigame.magicM) LastMagicBarFull = false;
|
||||
else if (!LastMagicBarFull) {
|
||||
LastMagicBarFull = true;
|
||||
Flash(3, 'MagicFlash');
|
||||
PlaySound(CMOptions.MagicSoundURL, 'MagicSound', 'MagicVolume');
|
||||
Notification('MagicNotification', 'Magic Meter full', 'Your Magic Meter is full. Cast a spell!');
|
||||
Notification(
|
||||
'MagicNotification',
|
||||
'Magic Meter full',
|
||||
'Your Magic Meter is full. Cast a spell!',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ export default function CheckSeasonPopup() {
|
||||
}
|
||||
Flash(3, 'SeaFlash');
|
||||
PlaySound(CMOptions.SeaSoundURL, 'SeaSound', 'SeaVolume');
|
||||
Notification('SeaNotification', 'Reindeer sighted!', 'A Reindeer has spawned. Click it now!');
|
||||
Notification(
|
||||
'SeaNotification',
|
||||
'Reindeer sighted!',
|
||||
'A Reindeer has spawned. Click it now!',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,20 @@ import { LastTickerFortuneState } from '../VariablesAndData';
|
||||
* It is called by CM.Main.Loop
|
||||
*/
|
||||
export default function CheckTickerFortune() {
|
||||
if (LastTickerFortuneState !== (Game.TickerEffect && Game.TickerEffect.type === 'fortune')) {
|
||||
LastTickerFortuneState = (Game.TickerEffect && Game.TickerEffect.type === 'fortune');
|
||||
if (
|
||||
LastTickerFortuneState !==
|
||||
(Game.TickerEffect && Game.TickerEffect.type === 'fortune')
|
||||
) {
|
||||
LastTickerFortuneState =
|
||||
Game.TickerEffect && Game.TickerEffect.type === 'fortune';
|
||||
if (LastTickerFortuneState) {
|
||||
Flash(3, 'FortuneFlash');
|
||||
PlaySound(CM.Options.FortuneSoundURL, 'FortuneSound', 'FortuneVolume');
|
||||
Notification('FortuneNotification', 'Fortune Cookie found', 'A Fortune Cookie has appeared on the Ticker.');
|
||||
Notification(
|
||||
'FortuneNotification',
|
||||
'Fortune Cookie found',
|
||||
'A Fortune Cookie has appeared on the Ticker.',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,20 +16,45 @@ export default function CheckWrinklerCount() {
|
||||
}
|
||||
if (CurrentWrinklers > LastWrinklerCount) {
|
||||
LastWrinklerCount = CurrentWrinklers;
|
||||
if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxFlash) {
|
||||
if (
|
||||
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||
CMOptions.WrinklerMaxFlash
|
||||
) {
|
||||
Flash(3, 'WrinklerMaxFlash');
|
||||
} else {
|
||||
Flash(3, 'WrinklerFlash');
|
||||
}
|
||||
if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxSound) {
|
||||
PlaySound(CMOptions.WrinklerMaxSoundURL, 'WrinklerMaxSound', 'WrinklerMaxVolume');
|
||||
if (
|
||||
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||
CMOptions.WrinklerMaxSound
|
||||
) {
|
||||
PlaySound(
|
||||
CMOptions.WrinklerMaxSoundURL,
|
||||
'WrinklerMaxSound',
|
||||
'WrinklerMaxVolume',
|
||||
);
|
||||
} else {
|
||||
PlaySound(CMOptions.WrinklerSoundURL, 'WrinklerSound', 'WrinklerVolume');
|
||||
PlaySound(
|
||||
CMOptions.WrinklerSoundURL,
|
||||
'WrinklerSound',
|
||||
'WrinklerVolume',
|
||||
);
|
||||
}
|
||||
if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxNotification) {
|
||||
Notification('WrinklerMaxNotification', 'Maximum Wrinklers Reached', 'You have reached your maximum ammount of wrinklers');
|
||||
if (
|
||||
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||
CMOptions.WrinklerMaxNotification
|
||||
) {
|
||||
Notification(
|
||||
'WrinklerMaxNotification',
|
||||
'Maximum Wrinklers Reached',
|
||||
'You have reached your maximum ammount of wrinklers',
|
||||
);
|
||||
} else {
|
||||
Notification('WrinklerNotification', 'A Wrinkler appeared', 'A new wrinkler has appeared');
|
||||
Notification(
|
||||
'WrinklerNotification',
|
||||
'A Wrinkler appeared',
|
||||
'A new wrinkler has appeared',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
LastWrinklerCount = CurrentWrinklers;
|
||||
|
||||
@@ -39,7 +39,11 @@ export default function InitializeCookieMonster() {
|
||||
CreateWhiteScreen();
|
||||
CreateFavicon();
|
||||
for (const i of Object.keys(TooltipText)) {
|
||||
CreateSimpleTooltip(TooltipText[i][0], TooltipText[i][1], TooltipText[i][2]);
|
||||
CreateSimpleTooltip(
|
||||
TooltipText[i][0],
|
||||
TooltipText[i][1],
|
||||
TooltipText[i][2],
|
||||
);
|
||||
}
|
||||
CreateWrinklerButtons();
|
||||
UpdateBuildingUpgradeStyle();
|
||||
@@ -55,8 +59,18 @@ export default function InitializeCookieMonster() {
|
||||
LoadConfig(); // Must be after all things are created!
|
||||
CMLastAscendState = Game.OnAscend;
|
||||
|
||||
if (Game.prefs.popups) Game.Popup(`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`);
|
||||
else Game.Notify(`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`, '', '', 1, 1);
|
||||
if (Game.prefs.popups)
|
||||
Game.Popup(
|
||||
`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`,
|
||||
);
|
||||
else
|
||||
Game.Notify(
|
||||
`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`,
|
||||
'',
|
||||
'',
|
||||
1,
|
||||
1,
|
||||
);
|
||||
|
||||
Game.Win('Third-party');
|
||||
}
|
||||
|
||||
@@ -3,13 +3,20 @@ import LoopCache from '../Cache/CacheLoop';
|
||||
import CacheNoGoldSwitchCPS from '../Cache/CPS/NoGoldSwitchCPS';
|
||||
import CacheSellAllForChoEgg from '../Cache/CPS/SellChoEgg';
|
||||
import CacheDragonCost from '../Cache/Dragon/Dragon';
|
||||
import { CacheBuildingsPrices, CacheIncome } from '../Cache/PriceAndIncome/PriceAndIncome';
|
||||
import {
|
||||
CacheBuildingsPrices,
|
||||
CacheIncome,
|
||||
} from '../Cache/PriceAndIncome/PriceAndIncome';
|
||||
import { CacheChain } from '../Cache/Stats/ChainCookies';
|
||||
import CacheAllMissingUpgrades from '../Cache/Stats/MissingUpgrades';
|
||||
import CacheSeasonSpec from '../Cache/Stats/Reindeer';
|
||||
import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from '../Cache/Stats/Stats';
|
||||
import {
|
||||
CacheDoRemakeBuildPrices, CacheHadBuildAura,
|
||||
CacheGoldenAndWrathCookiesMults,
|
||||
CacheStatsCookies,
|
||||
} from '../Cache/Stats/Stats';
|
||||
import {
|
||||
CacheDoRemakeBuildPrices,
|
||||
CacheHadBuildAura,
|
||||
} from '../Cache/VariablesAndData';
|
||||
import UpdateAscendState from '../Disp/HelperFunctions/UpdateAscendState';
|
||||
import { LastAscendState } from '../Disp/VariablesAndData';
|
||||
|
||||
@@ -4,7 +4,11 @@ import { FormatTime } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting'
|
||||
|
||||
import CalculateGrimoireRefillTime from '../../Disp/HelperFunctions/CalculateGrimoireRefillTime';
|
||||
import {
|
||||
BackupGrimoireDraw, BackupGrimoireLaunch, BackupGrimoireLaunchMod, HasReplaceNativeGrimoireDraw, HasReplaceNativeGrimoireLaunch,
|
||||
BackupGrimoireDraw,
|
||||
BackupGrimoireLaunch,
|
||||
BackupGrimoireLaunchMod,
|
||||
HasReplaceNativeGrimoireDraw,
|
||||
HasReplaceNativeGrimoireLaunch,
|
||||
} from '../VariablesAndData';
|
||||
import ReplaceTooltipGrimoire from './TooltipGrimoire';
|
||||
|
||||
@@ -12,13 +16,22 @@ import ReplaceTooltipGrimoire from './TooltipGrimoire';
|
||||
* This function fixes replaces the .draw function of the Grimoire
|
||||
*/
|
||||
function ReplaceNativeGrimoireDraw() {
|
||||
if (!HasReplaceNativeGrimoireDraw && Game.Objects['Wizard tower'].minigameLoaded) {
|
||||
if (
|
||||
!HasReplaceNativeGrimoireDraw &&
|
||||
Game.Objects['Wizard tower'].minigameLoaded
|
||||
) {
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
BackupGrimoireDraw = minigame.draw;
|
||||
Game.Objects['Wizard tower'].minigame.draw = function () {
|
||||
BackupGrimoireDraw();
|
||||
if (CMOptions.GrimoireBar === 1 && minigame.magic < minigame.magicM) {
|
||||
minigame.magicBarTextL.innerHTML += ` (${FormatTime(CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, minigame.magicM))})`;
|
||||
minigame.magicBarTextL.innerHTML += ` (${FormatTime(
|
||||
CalculateGrimoireRefillTime(
|
||||
minigame.magic,
|
||||
minigame.magicM,
|
||||
minigame.magicM,
|
||||
),
|
||||
)})`;
|
||||
}
|
||||
};
|
||||
HasReplaceNativeGrimoireDraw = true;
|
||||
@@ -29,10 +42,18 @@ function ReplaceNativeGrimoireDraw() {
|
||||
* This function fixes replaces the .launch function of the Grimoire
|
||||
*/
|
||||
function ReplaceNativeGrimoireLaunch() {
|
||||
if (!HasReplaceNativeGrimoireLaunch && Game.Objects['Wizard tower'].minigameLoaded) {
|
||||
if (
|
||||
!HasReplaceNativeGrimoireLaunch &&
|
||||
Game.Objects['Wizard tower'].minigameLoaded
|
||||
) {
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
BackupGrimoireLaunch = minigame.launch;
|
||||
BackupGrimoireLaunchMod = new Function(`return ${minigame.launch.toString().split('=this').join('= Game.Objects[\'Wizard tower\'].minigame')}`);
|
||||
BackupGrimoireLaunchMod = new Function(
|
||||
`return ${minigame.launch
|
||||
.toString()
|
||||
.split('=this')
|
||||
.join("= Game.Objects['Wizard tower'].minigame")}`,
|
||||
);
|
||||
Game.Objects['Wizard tower'].minigame.launch = function () {
|
||||
BackupGrimoireLaunchMod();
|
||||
ReplaceTooltipGrimoire();
|
||||
|
||||
@@ -11,7 +11,13 @@ export default function ReplaceTooltipGrimoire() {
|
||||
TooltipGrimoireBackup[i] = l(`grimoireSpell${i}`).onmouseover;
|
||||
l(`grimoireSpell${i}`).onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(this, function () { return CreateTooltip('g', `${i}`); }, 'this');
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
function () {
|
||||
return CreateTooltip('g', `${i}`);
|
||||
},
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,9 +15,13 @@ export default function ReplaceTooltipUpgrade() {
|
||||
if (!Game.mouseDown) {
|
||||
Game.setOnCrate(this);
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(this, function () {
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
function () {
|
||||
return CreateTooltip('u', `${i}`);
|
||||
}, 'store');
|
||||
},
|
||||
'store',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
import { CreateTooltip } from '../../Disp/Tooltips/Tooltip';
|
||||
import {
|
||||
LoadMinigames, TooltipBuildBackup, TooltipLumpBackup,
|
||||
LoadMinigames,
|
||||
TooltipBuildBackup,
|
||||
TooltipLumpBackup,
|
||||
} from '../VariablesAndData';
|
||||
import ReplaceNativeGrimoire from './NativeGrimoire';
|
||||
import ReplaceTooltipGrimoire from './TooltipGrimoire';
|
||||
@@ -18,7 +20,13 @@ function ReplaceTooltipBuild() {
|
||||
TooltipBuildBackup[i] = l(`product${me.id}`).onmouseover;
|
||||
l(`product${me.id}`).onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(this, function () { return CreateTooltip('b', `${i}`); }, 'store');
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
function () {
|
||||
return CreateTooltip('b', `${i}`);
|
||||
},
|
||||
'store',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
@@ -33,7 +41,13 @@ function ReplaceTooltipLump() {
|
||||
TooltipLumpBackup = l('lumps').onmouseover;
|
||||
l('lumps').onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(this, function () { return CreateTooltip('s', 'Lump'); }, 'this');
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
function () {
|
||||
return CreateTooltip('s', 'Lump');
|
||||
},
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
@@ -44,12 +58,28 @@ function ReplaceTooltipLump() {
|
||||
*/
|
||||
function ReplaceTooltipGarden() {
|
||||
if (Game.Objects.Farm.minigameLoaded) {
|
||||
l('gardenTool-1').onmouseover = function () { Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function () { return CreateTooltip('ha', 'HarvestAllButton'); }, 'this'); Game.tooltip.wobble(); };
|
||||
l('gardenTool-1').onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
function () {
|
||||
return CreateTooltip('ha', 'HarvestAllButton');
|
||||
},
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
Array.from(l('gardenPlot').children).forEach((child) => {
|
||||
const coords = child.id.slice(-3);
|
||||
child.onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(this, function () { return CreateTooltip('p', [`${coords[0]}`, `${coords[2]}`]); }, 'this');
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
function () {
|
||||
return CreateTooltip('p', [`${coords[0]}`, `${coords[2]}`]);
|
||||
},
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import jscolor from '@eastdesire/jscolor';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { Beautify as CMBeautify, FormatTime } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
||||
import {
|
||||
Beautify as CMBeautify,
|
||||
FormatTime,
|
||||
} from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
||||
import { AddAuraInfo, AddDragonLevelUpTooltip } from '../../Disp/Dragon/Dragon';
|
||||
import AddMenu from '../../Disp/MenuSections/AddMenus';
|
||||
import UpdateTitle from '../../Disp/TabTitle/TabTitle';
|
||||
import ReplaceAscendTooltip from '../../Disp/Tooltips/AscendButton';
|
||||
import UpdateTooltipLocation from '../../Disp/Tooltips/PositionLocation';
|
||||
import { CMSayTime, Title } from '../../Disp/VariablesAndData';
|
||||
import { SimDateAges, SimDateCentury, SimDoSims } from '../../Sim/VariablesAndData';
|
||||
import {
|
||||
SimDateAges,
|
||||
SimDateCentury,
|
||||
SimDoSims,
|
||||
} from '../../Sim/VariablesAndData';
|
||||
import ReplaceTooltipUpgrade from '../ReplaceGameElements/TooltipUpgrades';
|
||||
import { BackupFunctions } from '../VariablesAndData';
|
||||
import FixMouseY from './FixMouse';
|
||||
@@ -32,13 +39,20 @@ export default function ReplaceNative() {
|
||||
|
||||
BackupFunctions.tooltip = {};
|
||||
BackupFunctions.tooltip.draw = Game.tooltip.draw;
|
||||
BackupFunctions.tooltip.drawMod = new Function(`return ${Game.tooltip.draw.toString().split('this').join('Game.tooltip')}`)();
|
||||
BackupFunctions.tooltip.drawMod = new Function(
|
||||
`return ${Game.tooltip.draw.toString().split('this').join('Game.tooltip')}`,
|
||||
)();
|
||||
Game.tooltip.draw = function (from, text, origin) {
|
||||
BackupFunctions.tooltip.drawMod(from, text, origin);
|
||||
};
|
||||
|
||||
BackupFunctions.tooltip.update = Game.tooltip.update;
|
||||
BackupFunctions.tooltip.updateMod = new Function(`return ${Game.tooltip.update.toString().split('this.').join('Game.tooltip.')}`)();
|
||||
BackupFunctions.tooltip.updateMod = new Function(
|
||||
`return ${Game.tooltip.update
|
||||
.toString()
|
||||
.split('this.')
|
||||
.join('Game.tooltip.')}`,
|
||||
)();
|
||||
Game.tooltip.update = function () {
|
||||
BackupFunctions.tooltip.updateMod();
|
||||
UpdateTooltipLocation();
|
||||
@@ -56,7 +70,13 @@ export default function ReplaceNative() {
|
||||
|
||||
// Assumes newer browsers
|
||||
l('bigCookie').removeEventListener('click', Game.ClickCookie, false);
|
||||
l('bigCookie').addEventListener('click', function () { FixMouseY(Game.ClickCookie); }, false);
|
||||
l('bigCookie').addEventListener(
|
||||
'click',
|
||||
function () {
|
||||
FixMouseY(Game.ClickCookie);
|
||||
},
|
||||
false,
|
||||
);
|
||||
|
||||
BackupFunctions.RebuildUpgrades = Game.RebuildUpgrades;
|
||||
Game.RebuildUpgrades = function () {
|
||||
@@ -71,7 +91,11 @@ export default function ReplaceNative() {
|
||||
* If the options is 1 (on) bulkPrice is under cookies you can't buy the building.
|
||||
*/
|
||||
Game.ClickProduct = function (what) {
|
||||
if (!CMOptions.BulkBuyBlock || (Game.ObjectsById[what].bulkPrice < Game.cookies || Game.buyMode === -1)) {
|
||||
if (
|
||||
!CMOptions.BulkBuyBlock ||
|
||||
Game.ObjectsById[what].bulkPrice < Game.cookies ||
|
||||
Game.buyMode === -1
|
||||
) {
|
||||
BackupFunctions.ClickProduct(what);
|
||||
}
|
||||
};
|
||||
@@ -98,7 +122,10 @@ export default function ReplaceNative() {
|
||||
|
||||
BackupFunctions.UpdateMenu = Game.UpdateMenu;
|
||||
Game.UpdateMenu = function () {
|
||||
if (typeof jscolor.picker === 'undefined' || typeof jscolor.picker.owner === 'undefined') {
|
||||
if (
|
||||
typeof jscolor.picker === 'undefined' ||
|
||||
typeof jscolor.picker.owner === 'undefined'
|
||||
) {
|
||||
BackupFunctions.UpdateMenu();
|
||||
AddMenu();
|
||||
}
|
||||
@@ -106,7 +133,8 @@ export default function ReplaceNative() {
|
||||
|
||||
BackupFunctions.sayTime = Game.sayTime;
|
||||
CMSayTime = function (time, detail) {
|
||||
if (Number.isNaN(time) || time <= 0) return BackupFunctions.sayTime(time, detail);
|
||||
if (Number.isNaN(time) || time <= 0)
|
||||
return BackupFunctions.sayTime(time, detail);
|
||||
return FormatTime(time / Game.fps, 1);
|
||||
};
|
||||
|
||||
@@ -117,7 +145,9 @@ export default function ReplaceNative() {
|
||||
// Update tab title
|
||||
let title = 'Cookie Clicker';
|
||||
if (Game.season === 'fools') title = 'Cookie Baker';
|
||||
Title = `${(Game.OnAscend ? 'Ascending! ' : '')}${CMBeautify(Game.cookies)} ${(Game.cookies === 1 ? 'cookie' : 'cookies')} - ${title}`;
|
||||
Title = `${Game.OnAscend ? 'Ascending! ' : ''}${CMBeautify(Game.cookies)} ${
|
||||
Game.cookies === 1 ? 'cookie' : 'cookies'
|
||||
} - ${title}`;
|
||||
UpdateTitle();
|
||||
|
||||
// Since the Ascend Tooltip is not actually a tooltip we need to add our additional info here...
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { TooltipWrinklerArea, TooltipWrinklerBeingShown } from '../../Disp/VariablesAndData';
|
||||
import {
|
||||
TooltipWrinklerArea,
|
||||
TooltipWrinklerBeingShown,
|
||||
} from '../../Disp/VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function creates .onmouseover/out events that determine if the mouse is hovering-over a Wrinkler
|
||||
* As wrinklers are not appended to the DOM we us a different system than for other tooltips
|
||||
*/
|
||||
export default function AddWrinklerAreaDetect() {
|
||||
l('backgroundLeftCanvas').onmouseover = function () { TooltipWrinklerArea = 1; };
|
||||
l('backgroundLeftCanvas').onmouseover = function () {
|
||||
TooltipWrinklerArea = 1;
|
||||
};
|
||||
l('backgroundLeftCanvas').onmouseout = function () {
|
||||
TooltipWrinklerArea = 0;
|
||||
Game.tooltip.hide();
|
||||
|
||||
@@ -8,7 +8,16 @@ import SimHas from '../ReplacedGameFunctions/SimHas';
|
||||
import SimHasGod from '../ReplacedGameFunctions/SimHasGod';
|
||||
import SimWin from '../SimulationData/SimWin';
|
||||
import {
|
||||
SimAchievementsOwned, SimCookiesPs, SimCookiesPsRaw, SimDateAges, SimDateCentury, SimEffs, SimHeavenlyPower, SimObjects, SimPrestige, SimUpgrades,
|
||||
SimAchievementsOwned,
|
||||
SimCookiesPs,
|
||||
SimCookiesPsRaw,
|
||||
SimDateAges,
|
||||
SimDateCentury,
|
||||
SimEffs,
|
||||
SimHeavenlyPower,
|
||||
SimObjects,
|
||||
SimPrestige,
|
||||
SimUpgrades,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -33,11 +42,17 @@ export default function CalculateGains() {
|
||||
}
|
||||
SimEffs = effs;
|
||||
|
||||
if (Game.ascensionMode !== 1) mult += parseFloat(SimPrestige) * 0.01 * SimHeavenlyPower * SimGetHeavenlyMultiplier();
|
||||
if (Game.ascensionMode !== 1)
|
||||
mult +=
|
||||
parseFloat(SimPrestige) *
|
||||
0.01 *
|
||||
SimHeavenlyPower *
|
||||
SimGetHeavenlyMultiplier();
|
||||
|
||||
mult *= SimEff('cps');
|
||||
|
||||
if (SimHas('Heralds') && Game.ascensionMode !== 1) mult *= 1 + 0.01 * Game.heralds;
|
||||
if (SimHas('Heralds') && Game.ascensionMode !== 1)
|
||||
mult *= 1 + 0.01 * Game.heralds;
|
||||
|
||||
for (const i of Object.keys(Game.cookieUpgrades)) {
|
||||
const me = Game.cookieUpgrades[i];
|
||||
@@ -45,9 +60,9 @@ export default function CalculateGains() {
|
||||
// Some upgrades have a functio as .power (notably the valentine cookies)
|
||||
// CM.Sim.InitialBuildingData has changed to use CM.Sim.Has instead of Game.Has etc.
|
||||
// Therefore this call is to the .power of the Sim.Object
|
||||
if (typeof (me.power) === 'function') {
|
||||
mult *= 1 + (SimUpgrades[me.name].power(SimUpgrades[me.name]) * 0.01);
|
||||
} else mult *= 1 + (me.power * 0.01);
|
||||
if (typeof me.power === 'function') {
|
||||
mult *= 1 + SimUpgrades[me.name].power(SimUpgrades[me.name]) * 0.01;
|
||||
} else mult *= 1 + me.power * 0.01;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +76,7 @@ export default function CalculateGains() {
|
||||
if (SimHas('Improved jolliness')) mult *= 1.15;
|
||||
if (SimHas('A lump of coal')) mult *= 1.01;
|
||||
if (SimHas('An itchy sweater')) mult *= 1.01;
|
||||
if (SimHas('Santa\'s dominion')) mult *= 1.2;
|
||||
if (SimHas("Santa's dominion")) mult *= 1.2;
|
||||
|
||||
if (SimHas('Fortune #100')) mult *= 1.01;
|
||||
if (SimHas('Fortune #101')) mult *= 1.07;
|
||||
@@ -77,9 +92,17 @@ export default function CalculateGains() {
|
||||
else if (godLvl === 3) mult *= 1.05;
|
||||
|
||||
godLvl = SimHasGod('ages');
|
||||
if (godLvl === 1) mult *= 1 + 0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 3)) * Math.PI * 2);
|
||||
else if (godLvl === 2) mult *= 1 + 0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 12)) * Math.PI * 2);
|
||||
else if (godLvl === 3) mult *= 1 + 0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 24)) * Math.PI * 2);
|
||||
if (godLvl === 1)
|
||||
mult *=
|
||||
1 + 0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 3)) * Math.PI * 2);
|
||||
else if (godLvl === 2)
|
||||
mult *=
|
||||
1 +
|
||||
0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 12)) * Math.PI * 2);
|
||||
else if (godLvl === 3)
|
||||
mult *=
|
||||
1 +
|
||||
0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 24)) * Math.PI * 2);
|
||||
|
||||
godLvl = SimHasGod('decadence');
|
||||
if (godLvl === 1) buildMult *= 0.93;
|
||||
@@ -97,11 +120,11 @@ export default function CalculateGains() {
|
||||
else if (godLvl === 3) buildMult *= 0.99;
|
||||
}
|
||||
|
||||
if (SimHas('Santa\'s legacy')) mult *= 1 + (Game.santaLevel + 1) * 0.03;
|
||||
if (SimHas("Santa's legacy")) mult *= 1 + (Game.santaLevel + 1) * 0.03;
|
||||
|
||||
const milkProgress = SimAchievementsOwned / 25;
|
||||
let milkMult = 1;
|
||||
if (SimHas('Santa\'s milk and cookies')) milkMult *= 1.05;
|
||||
if (SimHas("Santa's milk and cookies")) milkMult *= 1.05;
|
||||
// if (CM.Sim.hasAura('Breath of Milk')) milkMult *= 1.05;
|
||||
milkMult *= 1 + SimAuraMult('Breath of Milk') * 0.05;
|
||||
if (SimHasGod) {
|
||||
@@ -114,27 +137,39 @@ export default function CalculateGains() {
|
||||
|
||||
let catMult = 1;
|
||||
|
||||
if (SimHas('Kitten helpers')) catMult *= (1 + milkProgress * 0.1 * milkMult);
|
||||
if (SimHas('Kitten workers')) catMult *= (1 + milkProgress * 0.125 * milkMult);
|
||||
if (SimHas('Kitten engineers')) catMult *= (1 + milkProgress * 0.15 * milkMult);
|
||||
if (SimHas('Kitten overseers')) catMult *= (1 + milkProgress * 0.175 * milkMult);
|
||||
if (SimHas('Kitten managers')) catMult *= (1 + milkProgress * 0.2 * milkMult);
|
||||
if (SimHas('Kitten accountants')) catMult *= (1 + milkProgress * 0.2 * milkMult);
|
||||
if (SimHas('Kitten specialists')) catMult *= (1 + milkProgress * 0.2 * milkMult);
|
||||
if (SimHas('Kitten experts')) catMult *= (1 + milkProgress * 0.2 * milkMult);
|
||||
if (SimHas('Kitten consultants')) catMult *= (1 + milkProgress * 0.2 * milkMult);
|
||||
if (SimHas('Kitten assistants to the regional manager')) catMult *= (1 + milkProgress * 0.175 * milkMult);
|
||||
if (SimHas('Kitten marketeers')) catMult *= (1 + milkProgress * 0.15 * milkMult);
|
||||
if (SimHas('Kitten analysts')) catMult *= (1 + milkProgress * 0.125 * milkMult);
|
||||
if (SimHas('Kitten executives')) catMult *= (1 + milkProgress * 0.115 * milkMult);
|
||||
if (SimHas('Kitten angels')) catMult *= (1 + milkProgress * 0.1 * milkMult);
|
||||
if (SimHas('Fortune #103')) catMult *= (1 + milkProgress * 0.05 * milkMult);
|
||||
if (SimHas('Kitten helpers')) catMult *= 1 + milkProgress * 0.1 * milkMult;
|
||||
if (SimHas('Kitten workers')) catMult *= 1 + milkProgress * 0.125 * milkMult;
|
||||
if (SimHas('Kitten engineers')) catMult *= 1 + milkProgress * 0.15 * milkMult;
|
||||
if (SimHas('Kitten overseers'))
|
||||
catMult *= 1 + milkProgress * 0.175 * milkMult;
|
||||
if (SimHas('Kitten managers')) catMult *= 1 + milkProgress * 0.2 * milkMult;
|
||||
if (SimHas('Kitten accountants'))
|
||||
catMult *= 1 + milkProgress * 0.2 * milkMult;
|
||||
if (SimHas('Kitten specialists'))
|
||||
catMult *= 1 + milkProgress * 0.2 * milkMult;
|
||||
if (SimHas('Kitten experts')) catMult *= 1 + milkProgress * 0.2 * milkMult;
|
||||
if (SimHas('Kitten consultants'))
|
||||
catMult *= 1 + milkProgress * 0.2 * milkMult;
|
||||
if (SimHas('Kitten assistants to the regional manager'))
|
||||
catMult *= 1 + milkProgress * 0.175 * milkMult;
|
||||
if (SimHas('Kitten marketeers'))
|
||||
catMult *= 1 + milkProgress * 0.15 * milkMult;
|
||||
if (SimHas('Kitten analysts')) catMult *= 1 + milkProgress * 0.125 * milkMult;
|
||||
if (SimHas('Kitten executives'))
|
||||
catMult *= 1 + milkProgress * 0.115 * milkMult;
|
||||
if (SimHas('Kitten angels')) catMult *= 1 + milkProgress * 0.1 * milkMult;
|
||||
if (SimHas('Fortune #103')) catMult *= 1 + milkProgress * 0.05 * milkMult;
|
||||
|
||||
for (const i of Object.keys(SimObjects)) {
|
||||
const me = SimObjects[i];
|
||||
let storedCps = me.cps(me);
|
||||
if (Game.ascensionMode !== 1) storedCps *= (1 + me.level * 0.01) * buildMult;
|
||||
if (me.name === 'Grandma' && SimHas('Milkhelp® lactose intolerance relief tablets')) storedCps *= 1 + 0.05 * milkProgress * milkMult;
|
||||
if (Game.ascensionMode !== 1)
|
||||
storedCps *= (1 + me.level * 0.01) * buildMult;
|
||||
if (
|
||||
me.name === 'Grandma' &&
|
||||
SimHas('Milkhelp® lactose intolerance relief tablets')
|
||||
)
|
||||
storedCps *= 1 + 0.05 * milkProgress * milkMult;
|
||||
SimCookiesPs += me.amount * storedCps;
|
||||
}
|
||||
|
||||
@@ -157,7 +192,11 @@ export default function CalculateGains() {
|
||||
if (SimHas('Ant larva')) eggMult *= 1.01;
|
||||
if (SimHas('Century egg')) {
|
||||
// The boost increases a little every day, with diminishing returns up to +10% on the 100th day
|
||||
let day = Math.floor((SimDateCentury - Game.startDate) / 1000 / 10) * 10 / 60 / 60 / 24;
|
||||
let day =
|
||||
(Math.floor((SimDateCentury - Game.startDate) / 1000 / 10) * 10) /
|
||||
60 /
|
||||
60 /
|
||||
24;
|
||||
day = Math.min(day, 100);
|
||||
// Sets a Cache value to be displayed in the Stats page, could be moved...
|
||||
CacheCentEgg = 1 + (1 - (1 - day / 100) ** 3) * 0.1;
|
||||
@@ -165,20 +204,21 @@ export default function CalculateGains() {
|
||||
}
|
||||
mult *= eggMult;
|
||||
|
||||
if (SimHas('Sugar baking')) mult *= (1 + Math.min(100, Game.lumps) * 0.01);
|
||||
if (SimHas('Sugar baking')) mult *= 1 + Math.min(100, Game.lumps) * 0.01;
|
||||
|
||||
// if (CM.Sim.hasAura('Radiant Appetite')) mult *= 2;
|
||||
mult *= 1 + SimAuraMult('Radiant Appetite');
|
||||
|
||||
const rawCookiesPs = SimCookiesPs * mult;
|
||||
for (const i of Object.keys(Game.CpsAchievements)) {
|
||||
if (rawCookiesPs >= Game.CpsAchievements[i].threshold) SimWin(Game.CpsAchievements[i].name);
|
||||
if (rawCookiesPs >= Game.CpsAchievements[i].threshold)
|
||||
SimWin(Game.CpsAchievements[i].name);
|
||||
}
|
||||
|
||||
SimCookiesPsRaw = rawCookiesPs;
|
||||
|
||||
const n = Game.shimmerTypes.golden.n;
|
||||
const auraMult = SimAuraMult('Dragon\'s Fortune');
|
||||
const auraMult = SimAuraMult("Dragon's Fortune");
|
||||
for (let i = 0; i < n; i++) {
|
||||
mult *= 1 + auraMult * 1.23;
|
||||
}
|
||||
|
||||
@@ -25,10 +25,18 @@ export default function CheckOtherAchiev() {
|
||||
buildingsOwned += SimObjects[i].amount;
|
||||
minAmount = Math.min(SimObjects[i].amount, minAmount);
|
||||
if (!SimHasAchiev('Mathematician')) {
|
||||
if (SimObjects[i].amount < Math.min(128, 2 ** ((Game.ObjectsById.length - Game.Objects[i].id) - 1))) mathematician = 0;
|
||||
if (
|
||||
SimObjects[i].amount <
|
||||
Math.min(128, 2 ** (Game.ObjectsById.length - Game.Objects[i].id - 1))
|
||||
)
|
||||
mathematician = 0;
|
||||
}
|
||||
if (!SimHasAchiev('Base 10')) {
|
||||
if (SimObjects[i].amount < (Game.ObjectsById.length - Game.Objects[i].id) * 10) base10 = 0;
|
||||
if (
|
||||
SimObjects[i].amount <
|
||||
(Game.ObjectsById.length - Game.Objects[i].id) * 10
|
||||
)
|
||||
base10 = 0;
|
||||
}
|
||||
}
|
||||
if (minAmount >= 1) SimWin('One with everything');
|
||||
@@ -58,12 +66,14 @@ export default function CheckOtherAchiev() {
|
||||
if (SimUpgradesOwned >= 100) SimWin('Upgrader');
|
||||
if (SimUpgradesOwned >= 200) SimWin('Lord of Progress');
|
||||
if (SimUpgradesOwned >= 300) SimWin('The full picture');
|
||||
if (SimUpgradesOwned >= 400) SimWin('When there\'s nothing left to add');
|
||||
if (SimUpgradesOwned >= 400) SimWin("When there's nothing left to add");
|
||||
|
||||
if (buildingsOwned >= 4000 && SimUpgradesOwned >= 300) SimWin('Polymath');
|
||||
if (buildingsOwned >= 8000 && SimUpgradesOwned >= 400) SimWin('Renaissance baker');
|
||||
if (buildingsOwned >= 8000 && SimUpgradesOwned >= 400)
|
||||
SimWin('Renaissance baker');
|
||||
|
||||
if (SimObjects.Cursor.amount + SimObjects.Grandma.amount >= 777) SimWin('The elder scrolls');
|
||||
if (SimObjects.Cursor.amount + SimObjects.Grandma.amount >= 777)
|
||||
SimWin('The elder scrolls');
|
||||
|
||||
let hasAllHalloCook = true;
|
||||
for (const i of Object.keys(HalloCookies)) {
|
||||
|
||||
@@ -12,7 +12,7 @@ export default function InitUpgrade(upgradeName) {
|
||||
const you = {};
|
||||
// Some upgrades have a function for .power (notably the valentine cookies)
|
||||
you.power = me.power;
|
||||
if (typeof (me.power) === 'function') {
|
||||
if (typeof me.power === 'function') {
|
||||
if (me.name === 'Sugar crystal cookies') {
|
||||
me.power = function () {
|
||||
let n = 5;
|
||||
|
||||
@@ -29,12 +29,22 @@ export default function InitialBuildingData(buildingName) {
|
||||
if (SimHas('Nonillion fingers')) add *= 20;
|
||||
let mult = 1;
|
||||
let num = 0;
|
||||
for (const i in SimObjects) { if (SimObjects[i].name !== 'Cursor') num += SimObjects[i].amount; }
|
||||
for (const i in SimObjects) {
|
||||
if (SimObjects[i].name !== 'Cursor') num += SimObjects[i].amount;
|
||||
}
|
||||
add *= num;
|
||||
mult *= SimGetTieredCpsMult(it);
|
||||
mult *= Game.magicCpS('Cursor');
|
||||
mult *= SimEff('cursorCps');
|
||||
return Game.ComputeCps(0.1, SimHas('Reinforced index finger') + SimHas('Carpal tunnel prevention cream') + SimHas('Ambidextrous'), add) * mult;
|
||||
return (
|
||||
Game.ComputeCps(
|
||||
0.1,
|
||||
SimHas('Reinforced index finger') +
|
||||
SimHas('Carpal tunnel prevention cream') +
|
||||
SimHas('Ambidextrous'),
|
||||
add,
|
||||
) * mult
|
||||
);
|
||||
};
|
||||
} else if (me.name === 'Grandma') {
|
||||
you.cps = function (it) {
|
||||
@@ -60,11 +70,14 @@ export default function InitialBuildingData(buildingName) {
|
||||
|
||||
let add = 0;
|
||||
if (SimHas('One mind')) add += SimObjects.Grandma.amount * 0.02;
|
||||
if (SimHas('Communal brainsweep')) add += SimObjects.Grandma.amount * 0.02;
|
||||
if (SimHas('Communal brainsweep'))
|
||||
add += SimObjects.Grandma.amount * 0.02;
|
||||
if (SimHas('Elder Pact')) add += SimObjects.Portal.amount * 0.05;
|
||||
|
||||
let num = 0;
|
||||
for (const i in SimObjects) { if (SimObjects[i].name !== 'Grandma') num += SimObjects[i].amount; }
|
||||
for (const i in SimObjects) {
|
||||
if (SimObjects[i].name !== 'Grandma') num += SimObjects[i].amount;
|
||||
}
|
||||
// if (Game.hasAura('Elder Battalion')) mult*=1+0.01*num;
|
||||
mult *= 1 + SimAuraMult('Elder Battalion') * 0.01 * num;
|
||||
|
||||
|
||||
@@ -5,7 +5,15 @@ import { SimDragonAura, SimDragonAura2 } from '../VariablesAndData';
|
||||
*/
|
||||
export default function SimAuraMult(what) {
|
||||
let n = 0;
|
||||
if (Game.dragonAuras[SimDragonAura].name === what || Game.dragonAuras[SimDragonAura2].name === what) n = 1;
|
||||
if (Game.dragonAuras[SimDragonAura].name === 'Reality Bending' || Game.dragonAuras[SimDragonAura2].name === 'Reality Bending') n += 0.1;
|
||||
if (
|
||||
Game.dragonAuras[SimDragonAura].name === what ||
|
||||
Game.dragonAuras[SimDragonAura2].name === what
|
||||
)
|
||||
n = 1;
|
||||
if (
|
||||
Game.dragonAuras[SimDragonAura].name === 'Reality Bending' ||
|
||||
Game.dragonAuras[SimDragonAura2].name === 'Reality Bending'
|
||||
)
|
||||
n += 0.1;
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { SimEffs } from '../VariablesAndData';
|
||||
*/
|
||||
export default function SimEff(name, def) {
|
||||
if (typeof SimEffs[name] === 'undefined') {
|
||||
return (typeof def === 'undefined' ? 1 : def);
|
||||
} return SimEffs[name];
|
||||
return typeof def === 'undefined' ? 1 : def;
|
||||
}
|
||||
return SimEffs[name];
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import SimHasGod from './SimHasGod';
|
||||
export default function SimGetHeavenlyMultiplier() {
|
||||
let heavenlyMult = 0;
|
||||
if (SimHas('Heavenly chip secret')) heavenlyMult += 0.05;
|
||||
if (SimHas('Heavenly cookie stand')) heavenlyMult += 0.20;
|
||||
if (SimHas('Heavenly cookie stand')) heavenlyMult += 0.2;
|
||||
if (SimHas('Heavenly bakery')) heavenlyMult += 0.25;
|
||||
if (SimHas('Heavenly confectionery')) heavenlyMult += 0.25;
|
||||
if (SimHas('Heavenly key')) heavenlyMult += 0.25;
|
||||
|
||||
@@ -7,24 +7,39 @@ import SimHas from './SimHas';
|
||||
export default function SimGetTieredCpsMult(me) {
|
||||
let mult = 1;
|
||||
for (const i in me.tieredUpgrades) {
|
||||
if (!Game.Tiers[me.tieredUpgrades[i].tier].special && SimHas(me.tieredUpgrades[i].name)) mult *= 2;
|
||||
if (
|
||||
!Game.Tiers[me.tieredUpgrades[i].tier].special &&
|
||||
SimHas(me.tieredUpgrades[i].name)
|
||||
)
|
||||
mult *= 2;
|
||||
}
|
||||
for (const i in me.synergies) {
|
||||
if (SimHas(me.synergies[i].name)) {
|
||||
const syn = me.synergies[i];
|
||||
if (syn.buildingTie1.name === me.name) mult *= (1 + 0.05 * syn.buildingTie2.amount);
|
||||
else if (syn.buildingTie2.name === me.name) mult *= (1 + 0.001 * syn.buildingTie1.amount);
|
||||
if (syn.buildingTie1.name === me.name)
|
||||
mult *= 1 + 0.05 * syn.buildingTie2.amount;
|
||||
else if (syn.buildingTie2.name === me.name)
|
||||
mult *= 1 + 0.001 * syn.buildingTie1.amount;
|
||||
}
|
||||
}
|
||||
if (me.fortune && SimHas(me.fortune.name)) mult *= 1.07;
|
||||
if (me.grandma && SimHas(me.grandma.name)) mult *= (1 + SimObjects.Grandma.amount * 0.01 * (1 / (me.id - 1)));
|
||||
if (me.grandma && SimHas(me.grandma.name))
|
||||
mult *= 1 + SimObjects.Grandma.amount * 0.01 * (1 / (me.id - 1));
|
||||
if (typeof me.tieredUpgrades.misfortune === 'object') {
|
||||
if (me.vanilla === 1 && SimHas(me.tieredUpgrades.misfortune.name)) {
|
||||
switch (Game.elderWrath) {
|
||||
default: mult *= 1; break;
|
||||
case 1: mult *= 1.02; break;
|
||||
case 2: mult *= 1.04; break;
|
||||
case 3: mult *= 1.06; break;
|
||||
default:
|
||||
mult *= 1;
|
||||
break;
|
||||
case 1:
|
||||
mult *= 1.02;
|
||||
break;
|
||||
case 2:
|
||||
mult *= 1.04;
|
||||
break;
|
||||
case 3:
|
||||
mult *= 1.06;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,10 @@ import { SimUpgrades } from '../VariablesAndData';
|
||||
*/
|
||||
export default function SimHas(what) {
|
||||
const it = SimUpgrades[what];
|
||||
if (Game.ascensionMode === 1 && (it.pool === 'prestige' || it.tier === 'fortune')) return 0;
|
||||
return (it ? it.bought : 0);
|
||||
if (
|
||||
Game.ascensionMode === 1 &&
|
||||
(it.pool === 'prestige' || it.tier === 'fortune')
|
||||
)
|
||||
return 0;
|
||||
return it ? it.bought : 0;
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ import { SimAchievements } from '../VariablesAndData';
|
||||
* This functions creates functions similarly to Game.HasAchiev but checks Sim Data instead of Game Data
|
||||
*/
|
||||
export default function SimHasAchiev(what) {
|
||||
return (SimAchievements[what] ? SimAchievements[what].won : 0);
|
||||
return SimAchievements[what] ? SimAchievements[what].won : 0;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ import { SimDragonAura, SimDragonAura2 } from '../VariablesAndData';
|
||||
* This functions creates functions similarly to Game.hasAura but checks Sim Data instead of Game Data
|
||||
*/
|
||||
export default function SimHasAura(what) {
|
||||
if (Game.dragonAuras[SimDragonAura].name === what || Game.dragonAuras[SimDragonAura2].name === what) {
|
||||
if (
|
||||
Game.dragonAuras[SimDragonAura].name === what ||
|
||||
Game.dragonAuras[SimDragonAura2].name === what
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -12,7 +12,7 @@ import SimHasGod from './SimHasGod';
|
||||
*/
|
||||
export default function SimModifyBuildingPrice(building, price) {
|
||||
if (SimHas('Season savings')) price *= 0.99;
|
||||
if (SimHas('Santa\'s dominion')) price *= 0.99;
|
||||
if (SimHas("Santa's dominion")) price *= 0.99;
|
||||
if (SimHas('Faberge egg')) price *= 0.99;
|
||||
if (SimHas('Divine discount')) price *= 0.99;
|
||||
if (SimHas('Fortune #100')) price *= 0.99;
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import CacheDragonAuras from '../../Cache/Dragon/CacheDragonAuras';
|
||||
import { CacheDragonAura, CacheDragonAura2 } from '../../Cache/VariablesAndData';
|
||||
import {
|
||||
CacheDragonAura,
|
||||
CacheDragonAura2,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import { CreateBotBarBuildingColumn } from '../../Disp/InfoBars/CreateDOMElements';
|
||||
import InitAchievement from '../InitializeData/InitAchievement';
|
||||
import InitialBuildingData from '../InitializeData/InitialBuildingData';
|
||||
import InitUpgrade from '../InitializeData/InitUpgrade';
|
||||
import {
|
||||
SimAchievements, SimAchievementsOwned, SimDragonAura, SimDragonAura2, SimHeavenlyPower, SimObjects, SimPledges, SimPrestige, SimUpgrades, SimUpgradesOwned,
|
||||
SimAchievements,
|
||||
SimAchievementsOwned,
|
||||
SimDragonAura,
|
||||
SimDragonAura2,
|
||||
SimHeavenlyPower,
|
||||
SimObjects,
|
||||
SimPledges,
|
||||
SimPrestige,
|
||||
SimUpgrades,
|
||||
SimUpgradesOwned,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -25,7 +37,8 @@ export default function CopyData() {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
const me = Game.Objects[i];
|
||||
let you = SimObjects[i];
|
||||
if (you === undefined) { // New building!
|
||||
if (you === undefined) {
|
||||
// New building!
|
||||
SimObjects[i] = InitialBuildingData(i);
|
||||
you = SimObjects[i];
|
||||
CreateBotBarBuildingColumn(i); // Add new building to the bottom bar
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { CacheDragonAura, CacheDragonAura2 } from '../../Cache/VariablesAndData';
|
||||
import {
|
||||
CacheDragonAura,
|
||||
CacheDragonAura2,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import CalculateGains from '../Calculations/CalculateGains';
|
||||
import CheckOtherAchiev from '../Calculations/CheckOtherAchiev';
|
||||
import CopyData from '../SimulationData/CopyData';
|
||||
import {
|
||||
SimAchievementsOwned, SimBuildingsOwned, SimCookiesPs, SimDragonAura, SimDragonAura2, SimObjects,
|
||||
SimAchievementsOwned,
|
||||
SimBuildingsOwned,
|
||||
SimCookiesPs,
|
||||
SimDragonAura,
|
||||
SimDragonAura2,
|
||||
SimObjects,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -17,19 +25,32 @@ export default function CalculateChangeAura(aura) {
|
||||
CopyData();
|
||||
|
||||
// Check if aura being changed is first or second aura
|
||||
const auraToBeChanged = l('promptContent').children[0].innerHTML.includes('secondary');
|
||||
const auraToBeChanged = l('promptContent').children[0].innerHTML.includes(
|
||||
'secondary',
|
||||
);
|
||||
if (auraToBeChanged) SimDragonAura2 = aura;
|
||||
else SimDragonAura = aura;
|
||||
|
||||
// Sell highest building but only if aura is different
|
||||
let price = 0;
|
||||
if (SimDragonAura !== CacheDragonAura || SimDragonAura2 !== CacheDragonAura2) {
|
||||
if (
|
||||
SimDragonAura !== CacheDragonAura ||
|
||||
SimDragonAura2 !== CacheDragonAura2
|
||||
) {
|
||||
for (let i = Game.ObjectsById.length - 1; i > -1; --i) {
|
||||
if (Game.ObjectsById[i - 1].amount > 0) {
|
||||
const highestBuilding = SimObjects[Game.ObjectsById[i].name].name;
|
||||
SimObjects[highestBuilding].amount -= 1;
|
||||
SimBuildingsOwned -= 1;
|
||||
price = SimObjects[highestBuilding].basePrice * Game.priceIncrease ** Math.max(0, SimObjects[highestBuilding].amount - 1 - SimObjects[highestBuilding].free);
|
||||
price =
|
||||
SimObjects[highestBuilding].basePrice *
|
||||
Game.priceIncrease **
|
||||
Math.max(
|
||||
0,
|
||||
SimObjects[highestBuilding].amount -
|
||||
1 -
|
||||
SimObjects[highestBuilding].free,
|
||||
);
|
||||
price = Game.modifyBuildingPrice(SimObjects[highestBuilding], price);
|
||||
price = Math.ceil(price);
|
||||
break;
|
||||
|
||||
@@ -9,7 +9,13 @@
|
||||
* @param {number} increase Increase of building
|
||||
* @returns {number} moni Total price
|
||||
*/
|
||||
export default function BuildingGetPrice(build, basePrice, start, free, increase) {
|
||||
export default function BuildingGetPrice(
|
||||
build,
|
||||
basePrice,
|
||||
start,
|
||||
free,
|
||||
increase,
|
||||
) {
|
||||
let moni = 0;
|
||||
for (let i = 0; i < increase; i++) {
|
||||
let price = basePrice * Game.priceIncrease ** Math.max(0, start - free);
|
||||
|
||||
@@ -2,7 +2,11 @@ import CalculateGains from '../Calculations/CalculateGains';
|
||||
import CheckOtherAchiev from '../Calculations/CheckOtherAchiev';
|
||||
import CopyData from '../SimulationData/CopyData';
|
||||
import SimWin from '../SimulationData/SimWin';
|
||||
import { SimAchievementsOwned, SimCookiesPs, SimObjects } from '../VariablesAndData';
|
||||
import {
|
||||
SimAchievementsOwned,
|
||||
SimCookiesPs,
|
||||
SimObjects,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function calculates the bonus income of buying a building
|
||||
@@ -27,10 +31,13 @@ export default function BuyBuildingsBonusIncome(building, amount) {
|
||||
if (me.amount >= 500) SimWin('Thumbs, phalanges, metacarpals');
|
||||
if (me.amount >= 600) SimWin('With her finger and her thumb');
|
||||
if (me.amount >= 700) SimWin('Gotta hand it to you');
|
||||
if (me.amount >= 800) SimWin('The devil\'s workshop');
|
||||
if (me.amount >= 800) SimWin("The devil's workshop");
|
||||
} else {
|
||||
for (const j in Game.Objects[me.name].tieredAchievs) {
|
||||
if (me.amount >= Game.Tiers[Game.Objects[me.name].tieredAchievs[j].tier].achievUnlock) {
|
||||
if (
|
||||
me.amount >=
|
||||
Game.Tiers[Game.Objects[me.name].tieredAchievs[j].tier].achievUnlock
|
||||
) {
|
||||
SimWin(Game.Objects[me.name].tieredAchievs[j].name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,12 @@ import SimHasGod from '../ReplacedGameFunctions/SimHasGod';
|
||||
import CopyData from '../SimulationData/CopyData';
|
||||
import SimWin from '../SimulationData/SimWin';
|
||||
import {
|
||||
SimAchievementsOwned, SimCookiesPs, SimObjects, SimPledges, SimUpgrades, SimUpgradesOwned,
|
||||
SimAchievementsOwned,
|
||||
SimCookiesPs,
|
||||
SimObjects,
|
||||
SimPledges,
|
||||
SimUpgrades,
|
||||
SimUpgradesOwned,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -29,7 +34,9 @@ function MouseCps() {
|
||||
if (SimHas('Octillion fingers')) add *= 20;
|
||||
if (SimHas('Nonillion fingers')) add *= 20;
|
||||
let num = 0;
|
||||
for (const i of Object.keys(SimObjects)) { num += SimObjects[i].amount; }
|
||||
for (const i of Object.keys(SimObjects)) {
|
||||
num += SimObjects[i].amount;
|
||||
}
|
||||
num -= SimObjects.Cursor.amount;
|
||||
add *= num;
|
||||
|
||||
@@ -51,13 +58,19 @@ function MouseCps() {
|
||||
if (SimHas('Fortune #104')) add += SimCookiesPs * 0.01;
|
||||
|
||||
let mult = 1;
|
||||
if (SimHas('Santa\'s helpers')) mult *= 1.1;
|
||||
if (SimHas("Santa's helpers")) mult *= 1.1;
|
||||
if (SimHas('Cookie egg')) mult *= 1.1;
|
||||
if (SimHas('Halo gloves')) mult *= 1.1;
|
||||
if (SimHas('Dragon claw')) mult *= 1.03;
|
||||
|
||||
if (SimHas('Aura gloves')) {
|
||||
mult *= 1 + 0.05 * Math.min(Game.Objects.Cursor.level, SimHas('Luminous gloves') ? 20 : 10);
|
||||
mult *=
|
||||
1 +
|
||||
0.05 *
|
||||
Math.min(
|
||||
Game.Objects.Cursor.level,
|
||||
SimHas('Luminous gloves') ? 20 : 10,
|
||||
);
|
||||
}
|
||||
|
||||
mult *= SimEff('click');
|
||||
@@ -71,14 +84,23 @@ function MouseCps() {
|
||||
}
|
||||
|
||||
for (const i of Object.keys(Game.buffs)) {
|
||||
if (typeof Game.buffs[i].multClick !== 'undefined') mult *= Game.buffs[i].multClick;
|
||||
if (typeof Game.buffs[i].multClick !== 'undefined')
|
||||
mult *= Game.buffs[i].multClick;
|
||||
}
|
||||
|
||||
// if (CM.Sim.auraMult('Dragon Cursor')) mult*=1.05;
|
||||
mult *= 1 + SimAuraMult('Dragon Cursor') * 0.05;
|
||||
|
||||
// No need to make this function a CM function
|
||||
let out = mult * Game.ComputeCps(1, SimHas('Reinforced index finger') + SimHas('Carpal tunnel prevention cream') + SimHas('Ambidextrous'), add);
|
||||
let out =
|
||||
mult *
|
||||
Game.ComputeCps(
|
||||
1,
|
||||
SimHas('Reinforced index finger') +
|
||||
SimHas('Carpal tunnel prevention cream') +
|
||||
SimHas('Ambidextrous'),
|
||||
add,
|
||||
);
|
||||
|
||||
out = Game.runModHookOnValue('cookiesPerClick', out);
|
||||
|
||||
@@ -94,7 +116,12 @@ function MouseCps() {
|
||||
* @returns {[{number, number}]} The bonus income of the upgrade and the difference in MouseCPS
|
||||
*/
|
||||
export default function BuyUpgradesBonusIncome(upgrade) {
|
||||
if (Game.Upgrades[upgrade].pool === 'toggle' || (Game.Upgrades[upgrade].bought === 0 && Game.Upgrades[upgrade].unlocked && Game.Upgrades[upgrade].pool !== 'prestige')) {
|
||||
if (
|
||||
Game.Upgrades[upgrade].pool === 'toggle' ||
|
||||
(Game.Upgrades[upgrade].bought === 0 &&
|
||||
Game.Upgrades[upgrade].unlocked &&
|
||||
Game.Upgrades[upgrade].pool !== 'prestige')
|
||||
) {
|
||||
CopyData();
|
||||
if (SimUpgrades[upgrade].name === 'Shimmering veil [on]') {
|
||||
SimUpgrades['Shimmering veil [off]'].bought = 0;
|
||||
@@ -104,7 +131,8 @@ export default function BuyUpgradesBonusIncome(upgrade) {
|
||||
SimUpgrades[upgrade].bought = (SimUpgrades[upgrade].bought + 1) % 2;
|
||||
}
|
||||
const me = SimUpgrades[upgrade];
|
||||
if (Game.CountsAsUpgradeOwned(Game.Upgrades[upgrade].pool)) SimUpgradesOwned++;
|
||||
if (Game.CountsAsUpgradeOwned(Game.Upgrades[upgrade].pool))
|
||||
SimUpgradesOwned++;
|
||||
|
||||
if (upgrade === 'Elder Pledge') {
|
||||
SimPledges++;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user