12
.eslintrc.js
12
.eslintrc.js
@@ -8,28 +8,20 @@ module.exports = {
|
||||
l: 'readonly',
|
||||
b64_to_utf8: 'readonly',
|
||||
utf8_to_b64: 'readonly',
|
||||
realAudio: 'readonly',
|
||||
BeautifyAll: 'readonly',
|
||||
CM: 'writable',
|
||||
unsafeWindow: 'readonly',
|
||||
},
|
||||
extends: ['airbnb-base', 'plugin:prettier/recommended'],
|
||||
parserOptions: {
|
||||
ecmaVersion: 12,
|
||||
},
|
||||
rules: {
|
||||
'import/no-named-default': 'off',
|
||||
'import/no-mutable-exports': 'off',
|
||||
'no-param-reassign': 'off',
|
||||
'no-plusplus': 'off',
|
||||
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
||||
'no-new-func': 'off',
|
||||
'no-restricted-syntax': 'off',
|
||||
'prefer-destructuring': 'off',
|
||||
'func-names': 'off',
|
||||
'no-console': 'off',
|
||||
'no-nested-ternary': 'off',
|
||||
'no-new': 'off',
|
||||
'no-alert': 'off',
|
||||
'no-restricted-globals': 'off',
|
||||
'prefer-destructuring': ['error', { object: true, array: false }],
|
||||
},
|
||||
};
|
||||
|
||||
18
.github/CONTRIBUTING.md
vendored
Normal file
18
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
Cookie Monster is written to modify Cookie Clicker as little as possible. This means the data is copied to simulate instead of actually modifying the current values and reverting later. The benefit is that CM should never mess up any data. The downside is that there is an extra overhead to copy and store the copied data.
|
||||
|
||||
The following is a short description of the various `src` directories and their contents:
|
||||
|
||||
JS | Description
|
||||
-- | -
|
||||
Cache | Functions related to creating and storing data cache
|
||||
Config | Functions related to manipulating CM configuration
|
||||
Data | Hard coded values
|
||||
Disp | Functions related to displaying CM's UI
|
||||
InitSaveLoad | Functions related to registering the CM object with the Game's Modding API
|
||||
Main | Functions related to the main loop and initializing CM
|
||||
Sim | Functions related to simulate something
|
||||
|
||||
These are some additional guidelines:
|
||||
- Try to use DOM as much as possible instead of using string manipulation to modify HTML.
|
||||
- Please be descriptive of your commits. If the commit is related to an issue or PR, please add the issue/PR number to the commit message.
|
||||
- PR's should target the `dev` branch
|
||||
3
.github/ISSUE_TEMPLATE/bug_report.md
vendored
3
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -19,5 +19,6 @@ If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Save file**
|
||||
```
|
||||
If applicable please copy your save file here
|
||||
Please add a save file here.
|
||||
This makes debugging much easier as we do not always have a good test save to debug the issue
|
||||
```
|
||||
|
||||
0
LICENSE → .github/LICENSE.md
vendored
0
LICENSE → .github/LICENSE.md
vendored
@@ -1,22 +0,0 @@
|
||||
The following is a description of the our approach to the project.
|
||||
|
||||
Cookie Monster is written to modify Cookie Clicker as little as possible. This means the data is copied to simulate instead of actually modifying the current values and reverting later. The benefit is that CM should never mess up any data. The downside is that there is an extra overhead to copy and store the copied data.
|
||||
|
||||
Here is a description of what should be stored in each of the source JS. Make edits to the source file first and then use the combine file to compile the final file:
|
||||
|
||||
JS | Description
|
||||
-- | -
|
||||
Cache | Functions related to creating and storing data cache
|
||||
Config | Functions related to manipulating CM configuration
|
||||
Data | Hard coded values
|
||||
Disp | Functions related to displaying CM's UI
|
||||
Footer | The footer of CM's JS (not modified often or ever)
|
||||
Header | The header of CM's JS (not modified often or ever)
|
||||
Main | Functions related to the main loop and initializing CM
|
||||
Sim | Functions related to simulate something
|
||||
|
||||
These are some additional guidelines:
|
||||
- Try to use DOM as much as possible instead of using string manipulation to modify HTML.
|
||||
- Please be descriptive of your commits. If the commit is related to an issue or PR, please add the issue/PR number to the commit message.
|
||||
- Try to follow the formatting and annotation as specified by JSCode
|
||||
- PR's should target the `dev` branch
|
||||
File diff suppressed because one or more lines are too long
14
README.md
14
README.md
@@ -18,13 +18,13 @@ Cookie Monster also indicates the time left before being able to buy an upgrade
|
||||
|
||||
This index is computed for buildings and upgrades. If the relevant option is enabled, it will color-code each of them based on their value:
|
||||
|
||||
* Light Blue: (upgrades) This item has a better PP than any building
|
||||
* Green: This item has the best PP
|
||||
* Yellow: This item is not the best, but it is closer to best than it is to worst
|
||||
* Orange: This item is not the worst, but it is closer to worst than it is to best
|
||||
* Red: This item has the worst PP
|
||||
* Purple: (upgrades) This item has a worse PP than any building
|
||||
* Gray: (upgrades) This item has not been calculated and/or cannot be calculated due to no definitive worth.
|
||||
* Light Blue: (upgrades) This item has a better PP than the best building to buy
|
||||
* Green: This building has the best PP
|
||||
* Yellow: This building is within the top 10 of best PP's
|
||||
* Orange: This building is within the top 20 of best PP's
|
||||
* Red: This building is within the top 30 of best PP's
|
||||
* Purple: This building is worse than the top 10 of best PP's
|
||||
* Gray: This item does not have a PP, often this means that there is no change to CPS
|
||||
|
||||
Note: For this index, **lower is better**, meaning a building with a PP of 1 is more interesting than one with a PP of 3.
|
||||
|
||||
|
||||
2
dist/CookieMonster.js
vendored
2
dist/CookieMonster.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
2266
package-lock.json
generated
2266
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cookiemonster-mod",
|
||||
"version": "2.031.5",
|
||||
"version": "2.031.6",
|
||||
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
|
||||
"main": "CookieMonster.js",
|
||||
"keywords": [
|
||||
@@ -12,12 +12,12 @@
|
||||
],
|
||||
"scripts": {
|
||||
"copy-file": "cp dist/CookieMonster.js CookieMonster.js",
|
||||
"eslint_src": "eslint src",
|
||||
"build": "run-s eslint_src pack_prod remove_comment copy-file",
|
||||
"build_test": "run-s pack_dev",
|
||||
"pack_prod": "webpack --env production",
|
||||
"pack_dev": "webpack",
|
||||
"remove_comment": "sed -i '' -e '/\\/\\/# sourceMappingURL.*/d' dist/CookieMonster.js"
|
||||
"eslint-src": "eslint src",
|
||||
"build": "run-s eslint-src pack-prod remove-comment copy-file",
|
||||
"build-test": "run-s pack-dev",
|
||||
"pack-prod": "webpack --env production",
|
||||
"pack-dev": "webpack",
|
||||
"remove-comment": "sed -i '' -e '/\\/\\/# sourceMappingURL.*/d' dist/CookieMonster.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -34,12 +34,13 @@ export class CMAvgQueue {
|
||||
* @returns {number} ret The average
|
||||
*/
|
||||
calcAverage(timePeriod) {
|
||||
if (timePeriod > this.maxLength) timePeriod = this.maxLength;
|
||||
if (timePeriod > this.queue.length) timePeriod = this.queue.length;
|
||||
let time = timePeriod;
|
||||
if (time > this.maxLength) time = this.maxLength;
|
||||
if (time > this.queue.length) time = this.queue.length;
|
||||
let ret = 0;
|
||||
for (
|
||||
let i = this.queue.length - 1;
|
||||
i >= 0 && i > this.queue.length - 1 - timePeriod;
|
||||
i >= 0 && i > this.queue.length - 1 - time;
|
||||
i--
|
||||
) {
|
||||
ret += this.queue[i];
|
||||
@@ -47,7 +48,7 @@ export class CMAvgQueue {
|
||||
if (ret === 0) {
|
||||
return 0;
|
||||
}
|
||||
return ret / timePeriod;
|
||||
return ret / time;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ import {
|
||||
export default function CacheCurrWrinklerCPS() {
|
||||
CacheCurrWrinklerCPSMult = 0;
|
||||
let count = 0;
|
||||
for (const i in Game.wrinklers) {
|
||||
if (Game.wrinklers[i].phase === 2) count++;
|
||||
}
|
||||
Object.keys(Game.wrinklers).forEach((i) => {
|
||||
if (Game.wrinklers[i].phase === 2) count += 1;
|
||||
});
|
||||
let godMult = 1;
|
||||
if (SimObjects.Temple.minigameLoaded) {
|
||||
const godLvl = Game.hasGod('scorn');
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
*/
|
||||
export default function GetCPSBuffMult() {
|
||||
let mult = 1;
|
||||
for (const i of Object.keys(Game.buffs)) {
|
||||
Object.keys(Game.buffs).forEach((i) => {
|
||||
if (typeof Game.buffs[i].multCpS !== 'undefined')
|
||||
mult *= Game.buffs[i].multCpS;
|
||||
}
|
||||
});
|
||||
return mult;
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ export default function CacheSellAllForChoEgg() {
|
||||
if (Game.Objects.Bank.minigameLoaded) {
|
||||
const marketGoods = Game.Objects.Bank.minigame.goods;
|
||||
let goodsVal = 0;
|
||||
for (const i of Object.keys(marketGoods)) {
|
||||
Object.keys(marketGoods).forEach((i) => {
|
||||
const marketGood = marketGoods[i];
|
||||
goodsVal += marketGood.stock * marketGood.val;
|
||||
}
|
||||
});
|
||||
sellTotal += goodsVal * Game.cookiesPsRawHighest;
|
||||
}
|
||||
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
/* eslint-disable no-unused-vars */
|
||||
/** Functions related to the Dragon */
|
||||
|
||||
@@ -44,7 +45,7 @@ export default function CacheDragonCost() {
|
||||
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
||||
price = Math.ceil(price);
|
||||
cost += price;
|
||||
SimObjects[target].amount--;
|
||||
SimObjects[target].amount -= 1;
|
||||
}
|
||||
CacheCostDragonUpgrade = `Cost to rebuy: ${cost}`;
|
||||
}
|
||||
@@ -68,7 +69,7 @@ export default function CacheDragonCost() {
|
||||
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
||||
price = Math.ceil(price);
|
||||
cost += price;
|
||||
SimObjects[target].amount--;
|
||||
SimObjects[target].amount -= 1;
|
||||
}
|
||||
}
|
||||
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
||||
import { ColorGray } from '../../Disp/VariablesAndData';
|
||||
import {
|
||||
CacheArrayOfPPs,
|
||||
CacheMaxPP,
|
||||
CacheMidPP,
|
||||
CacheMinPP,
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
CacheObjects100,
|
||||
CachePPArray,
|
||||
} from '../VariablesAndData';
|
||||
import ColourOfPP from './ColourOfPP';
|
||||
|
||||
@@ -18,17 +17,30 @@ import ColourOfPP from './ColourOfPP';
|
||||
* It saves all date in CM.Cache.Objects...
|
||||
* It is called by CM.Cache.CacheBuildingsPP()
|
||||
*/
|
||||
function CacheBuildingsBulkPP(target) {
|
||||
for (const i of Object.keys(target)) {
|
||||
function CacheColor(target, amount) {
|
||||
Object.keys(target).forEach((i) => {
|
||||
target[i].color = ColourOfPP(
|
||||
target[i],
|
||||
Game.Objects[i].getSumPrice(amount),
|
||||
);
|
||||
// Colour based on excluding certain top-buildings
|
||||
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
||||
if (target[i].pp === CachePPArray[j][0]) target[i].color = ColorGray;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function CachePP(target, amount) {
|
||||
Object.keys(target).forEach((i) => {
|
||||
const price = Game.Objects[i].getSumPrice(amount);
|
||||
if (Game.cookiesPs) {
|
||||
target[i].pp =
|
||||
Math.max(target[i].price - (Game.cookies + GetWrinkConfigBank()), 0) /
|
||||
Math.max(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);
|
||||
}
|
||||
price / target[i].bonus;
|
||||
} else target[i].pp = price / target[i].bonus;
|
||||
CachePPArray.push([target[i].pp, amount]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,91 +49,28 @@ function CacheBuildingsBulkPP(target) {
|
||||
*/
|
||||
export default function CacheBuildingsPP() {
|
||||
CacheMinPP = Infinity;
|
||||
CacheMaxPP = 1;
|
||||
CacheArrayOfPPs = [];
|
||||
CachePPArray = [];
|
||||
if (typeof CMOptions.PPExcludeTop === 'undefined') CMOptions.PPExcludeTop = 0; // Otherwise breaks during initialization
|
||||
|
||||
// Calculate PP and colors when compared to purchase of optimal building in single-purchase mode
|
||||
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;
|
||||
CacheArrayOfPPs.push([CacheObjects1[i].pp, Game.Objects[i].getPrice()]);
|
||||
}
|
||||
// Set CM.Cache.min to best non-excluded buidliung
|
||||
CacheArrayOfPPs.sort((a, b) => a[0] - b[0]);
|
||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
||||
while (CacheArrayOfPPs[0][1] > Game.cookies) {
|
||||
if (CacheArrayOfPPs.length === 1) {
|
||||
break;
|
||||
}
|
||||
CacheArrayOfPPs.shift();
|
||||
}
|
||||
}
|
||||
CacheMinPP = CacheArrayOfPPs[CMOptions.PPExcludeTop][0];
|
||||
CacheMaxPP = CacheArrayOfPPs[CacheArrayOfPPs.length - 1][0];
|
||||
CacheMidPP = (CacheMaxPP - CacheMinPP) / 2 + CacheMinPP;
|
||||
for (const i of Object.keys(CacheObjects1)) {
|
||||
CacheObjects1[i].color = ColourOfPP(
|
||||
CacheObjects1[i],
|
||||
Game.Objects[i].getPrice(),
|
||||
);
|
||||
// Colour based on excluding certain top-buildings
|
||||
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
||||
if (CacheObjects1[i].pp === CacheArrayOfPPs[j][0])
|
||||
CacheObjects1[i].color = ColorGray;
|
||||
}
|
||||
}
|
||||
// Calculate PP of bulk-buy modes
|
||||
CacheBuildingsBulkPP(CacheObjects10);
|
||||
CacheBuildingsBulkPP(CacheObjects100);
|
||||
} else if (Game.buyMode > 0) {
|
||||
// Calculate PP and colors when compared to purchase of selected bulk mode
|
||||
let target;
|
||||
if (Game.buyBulk === 1) target = CacheObjects1;
|
||||
else if (Game.buyBulk === 10) target = CacheObjects10;
|
||||
else if (Game.buyBulk === 100) target = CacheObjects100;
|
||||
for (const i of Object.keys(target)) {
|
||||
if (Game.cookiesPs) {
|
||||
target[i].pp =
|
||||
Math.max(
|
||||
Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank()),
|
||||
0,
|
||||
) /
|
||||
Game.cookiesPs +
|
||||
Game.Objects[i].bulkPrice / target[i].bonus;
|
||||
} else target[i].pp = Game.Objects[i].bulkPrice / target[i].bonus;
|
||||
CacheArrayOfPPs.push([target[i].pp, Game.Objects[i].bulkPrice]);
|
||||
}
|
||||
// Set CM.Cache.min to best non-excluded buidliung
|
||||
CacheArrayOfPPs.sort((a, b) => a[0] - b[0]);
|
||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
||||
while (CacheArrayOfPPs[0][1] > Game.cookies) {
|
||||
if (CacheArrayOfPPs.length === 1) {
|
||||
break;
|
||||
}
|
||||
CacheArrayOfPPs.shift();
|
||||
}
|
||||
}
|
||||
CacheMinPP = CacheArrayOfPPs[CMOptions.PPExcludeTop][0];
|
||||
CacheMaxPP = CacheArrayOfPPs[CacheArrayOfPPs.length - 1][0];
|
||||
CacheMidPP = (CacheMaxPP - CacheMinPP) / 2 + CacheMinPP;
|
||||
// Calculate PP and colors
|
||||
CachePP(CacheObjects1, 1);
|
||||
CachePP(CacheObjects10, 10);
|
||||
CachePP(CacheObjects100, 100);
|
||||
|
||||
for (const i of Object.keys(CacheObjects1)) {
|
||||
target[i].color = ColourOfPP(target[i], Game.Objects[i].bulkPrice);
|
||||
// Colour based on excluding certain top-buildings
|
||||
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
||||
if (target[i].pp === CacheArrayOfPPs[j][0]) target[i].color = ColorGray;
|
||||
// Set CM.Cache.min to best non-excluded buidliung
|
||||
CachePPArray.sort((a, b) => a[0] - b[0]);
|
||||
let indexOfMin = 0;
|
||||
if (CMOptions.PPOnlyConsiderBuyable) {
|
||||
while (CachePPArray[indexOfMin][1] > Game.cookies) {
|
||||
indexOfMin += 1;
|
||||
if (CachePPArray.length === indexOfMin + 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
CacheMinPP = CachePPArray[CMOptions.PPExcludeTop][indexOfMin];
|
||||
|
||||
CacheColor(CacheObjects1, 1);
|
||||
CacheColor(CacheObjects10, 10);
|
||||
CacheColor(CacheObjects100, 100);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
ColorRed,
|
||||
ColorYellow,
|
||||
} from '../../Disp/VariablesAndData';
|
||||
import { CacheMaxPP, CacheMidPP, CacheMinPP } from '../VariablesAndData';
|
||||
import { CacheMinPP, CachePPArray } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This functions return the colour assosciated with the given pp value
|
||||
@@ -24,10 +24,10 @@ export default function ColourOfPP(me, price) {
|
||||
if (me.pp <= 0 || me.pp === Infinity) color = ColorGray;
|
||||
else if (me.pp < CacheMinPP) color = ColorBlue;
|
||||
else if (me.pp === CacheMinPP) color = ColorGreen;
|
||||
else if (me.pp === CacheMaxPP) color = ColorRed;
|
||||
else if (me.pp > CacheMaxPP) color = ColorPurple;
|
||||
else if (me.pp > CacheMidPP) color = ColorOrange;
|
||||
else color = ColorYellow;
|
||||
else if (me.pp < CachePPArray[10][0]) color = ColorYellow;
|
||||
else if (me.pp < CachePPArray[20][0]) color = ColorOrange;
|
||||
else if (me.pp > CachePPArray[30][0]) color = ColorRed;
|
||||
else color = ColorPurple;
|
||||
|
||||
// Colour based on price in terms of CPS
|
||||
if (Number(CMOptions.PPSecondsLowerLimit) !== 0) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import ColourOfPP from './ColourOfPP';
|
||||
* It is called by CM.Cache.CachePP()
|
||||
*/
|
||||
export default function CacheUpgradePP() {
|
||||
for (const i of Object.keys(CacheUpgrades)) {
|
||||
Object.keys(CacheUpgrades).forEach((i) => {
|
||||
if (Game.cookiesPs) {
|
||||
CacheUpgrades[i].pp =
|
||||
Math.max(
|
||||
@@ -25,5 +25,5 @@ export default function CacheUpgradePP() {
|
||||
CacheUpgrades[i],
|
||||
Game.Upgrades[i].getPrice(),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
13
src/Cache/PantheonGods/CacheGods.js
Normal file
13
src/Cache/PantheonGods/CacheGods.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import CalculateChangeGod from '../../Sim/SimulationEvents/GodChange';
|
||||
import { CacheGods } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This functions caches the cps effect of each God in slot 1, 2 or 3
|
||||
*/
|
||||
export default function CachePantheonGods() {
|
||||
for (let god = 0; god < 11; god += 1) {
|
||||
for (let slot = 0; slot < 3; slot += 1) {
|
||||
CacheGods[god][slot] = CalculateChangeGod(god, slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,16 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
/** Section: Functions related to caching income */
|
||||
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades';
|
||||
import {
|
||||
CacheAverageCPS,
|
||||
CacheAverageGainBank,
|
||||
CacheAverageGainWrink,
|
||||
CacheAverageGainWrinkFattest,
|
||||
CacheDoRemakeBuildPrices,
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
@@ -20,13 +26,13 @@ import {
|
||||
*/
|
||||
function CacheBuildingIncome(amount, target) {
|
||||
const result = [];
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
result[i] = {};
|
||||
result[i].bonus = BuyBuildingsBonusIncome(i, amount);
|
||||
if (amount !== 1) {
|
||||
CacheDoRemakeBuildPrices = 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -36,19 +42,28 @@ function CacheBuildingIncome(amount, target) {
|
||||
*/
|
||||
function CacheUpgradeIncome() {
|
||||
CacheUpgrades = [];
|
||||
for (const i of Object.keys(Game.Upgrades)) {
|
||||
Object.keys(Game.Upgrades).forEach((i) => {
|
||||
const bonusIncome = BuyUpgradesBonusIncome(i);
|
||||
if (i === 'Elder Pledge') {
|
||||
CacheUpgrades[i] = { bonus: Game.cookiesPs - CacheAverageGainBank };
|
||||
if (CMOptions.CalcWrink === 1)
|
||||
CacheUpgrades[i].bonus -= CacheAverageGainWrink;
|
||||
else if (CMOptions.CalcWrink === 2)
|
||||
CacheUpgrades[i].bonus -= CacheAverageGainWrinkFattest;
|
||||
if (!Number.isFinite(CacheUpgrades[i].bonus)) CacheUpgrades[i].bonus = 0;
|
||||
} else {
|
||||
CacheUpgrades[i] = {};
|
||||
if (bonusIncome[0]) CacheUpgrades[i].bonus = bonusIncome[0];
|
||||
if (bonusIncome[1]) CacheUpgrades[i].bonusMouse = bonusIncome[1];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* This functions caches the price of each building and stores it in the cache
|
||||
*/
|
||||
export function CacheBuildingsPrices() {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
CacheObjects1[i].price = BuildingGetPrice(
|
||||
Game.Objects[i],
|
||||
Game.Objects[i].basePrice,
|
||||
@@ -70,7 +85,7 @@ export function CacheBuildingsPrices() {
|
||||
Game.Objects[i].free,
|
||||
100,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,7 +51,7 @@ export function MaxChainCookieReward(digit, maxPayout, mult) {
|
||||
);
|
||||
nextRequired = Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult);
|
||||
totalFromChain += moni;
|
||||
chain++;
|
||||
chain += 1;
|
||||
}
|
||||
return [totalFromChain, moni, nextRequired];
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ export default function CacheAllMissingUpgrades() {
|
||||
CacheMissingUpgradesPrestige = '';
|
||||
const list = [];
|
||||
// sort the upgrades
|
||||
for (const i of Object.keys(Game.Upgrades)) {
|
||||
Object.keys(Game.Upgrades).forEach((i) => {
|
||||
list.push(Game.Upgrades[i]);
|
||||
}
|
||||
});
|
||||
const sortMap = function (a, b) {
|
||||
if (a.order > b.order) return 1;
|
||||
if (a.order < b.order) return -1;
|
||||
@@ -29,7 +29,7 @@ export default function CacheAllMissingUpgrades() {
|
||||
};
|
||||
list.sort(sortMap);
|
||||
|
||||
for (const i of Object.keys(list)) {
|
||||
Object.keys(list).forEach((i) => {
|
||||
const me = list[i];
|
||||
|
||||
if (me.bought === 0) {
|
||||
@@ -45,5 +45,5 @@ export default function CacheAllMissingUpgrades() {
|
||||
)
|
||||
CacheMissingUpgrades += str;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,11 +42,11 @@ export function CacheStatsCookies() {
|
||||
CacheEdifice = 0;
|
||||
let max = 0;
|
||||
let n = 0;
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
if (Game.Objects[i].amount > max) max = Game.Objects[i].amount;
|
||||
if (Game.Objects[i].amount > 0) n++;
|
||||
}
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
if (Game.Objects[i].amount > 0) n += 1;
|
||||
});
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
if (
|
||||
(Game.Objects[i].amount < max || n === 1) &&
|
||||
Game.Objects[i].amount < 400 &&
|
||||
@@ -55,7 +55,7 @@ export function CacheStatsCookies() {
|
||||
CacheEdifice = Game.Objects[i].price * 2;
|
||||
CacheEdificeBuilding = i;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -65,10 +65,10 @@ export let CacheSeasonPopShimmer = {};
|
||||
|
||||
export let CacheTimeTillNextPrestige = 0;
|
||||
|
||||
/** Stores lowest PP value */
|
||||
export let CacheMinPP = 0;
|
||||
export let CacheMidPP = 0;
|
||||
export let CacheMaxPP = 0;
|
||||
export let CacheArrayOfPPs = [];
|
||||
/** Stores all PP values of all buildings for all buy settings (1, 10, 100) */
|
||||
export let CachePPArray = [];
|
||||
|
||||
export let CacheGoldenShimmersByID = {};
|
||||
|
||||
@@ -99,3 +99,18 @@ export let CacheLastHeavenlyChips;
|
||||
export let CacheDoRemakeBuildPrices;
|
||||
|
||||
export let CacheHadBuildAura;
|
||||
|
||||
/** Store the CPS effect of each god if it was put into each slot */
|
||||
export let CacheGods = {
|
||||
0: [0, 0, 0],
|
||||
1: [0, 0, 0],
|
||||
2: [0, 0, 0],
|
||||
3: [0, 0, 0],
|
||||
4: [0, 0, 0],
|
||||
5: [0, 0, 0],
|
||||
6: [0, 0, 0],
|
||||
7: [0, 0, 0],
|
||||
8: [0, 0, 0],
|
||||
9: [0, 0, 0],
|
||||
10: [0, 0, 0],
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ export default function CacheWrinklers() {
|
||||
CacheWrinklersNormal = 0;
|
||||
CacheWrinklersFattest = [0, null];
|
||||
for (let i = 0; i < Game.wrinklers.length; i++) {
|
||||
let sucked = Game.wrinklers[i].sucked;
|
||||
let { sucked } = Game.wrinklers[i];
|
||||
let toSuck = 1.1;
|
||||
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
||||
if (Game.wrinklers[i].type === 1) toSuck *= 3; // Shiny wrinklers
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { default as ConfigDefault } from '../../Data/SettingsDefault';
|
||||
import { default as ConfigData } from '../../Data/SettingsData';
|
||||
import ConfigDefault from '../../Data/SettingsDefault';
|
||||
import ConfigData from '../../Data/SettingsData';
|
||||
import { CMOptions } from '../VariablesAndData';
|
||||
import save from '../../InitSaveLoad/save';
|
||||
import CMLoop from '../../Main/Loop';
|
||||
@@ -43,7 +43,7 @@ export function LoadConfig(settings) {
|
||||
|
||||
// Check values
|
||||
let mod = false;
|
||||
for (const i in ConfigDefault) {
|
||||
Object.keys(ConfigDefault).forEach((i) => {
|
||||
if (typeof CMOptions[i] === 'undefined') {
|
||||
mod = true;
|
||||
CMOptions[i] = ConfigDefault[i];
|
||||
@@ -61,7 +61,7 @@ export function LoadConfig(settings) {
|
||||
CMOptions[i] = ConfigDefault[i];
|
||||
}
|
||||
} else if (i === 'Header') {
|
||||
for (const j in ConfigDefault.Header) {
|
||||
Object.keys(ConfigDefault.Header).forEach((j) => {
|
||||
if (
|
||||
typeof CMOptions[i][j] === 'undefined' ||
|
||||
!(CMOptions[i][j] > -1 && CMOptions[i][j] < 2)
|
||||
@@ -69,10 +69,10 @@ export function LoadConfig(settings) {
|
||||
mod = true;
|
||||
CMOptions[i][j] = ConfigDefault[i][j];
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Colors
|
||||
for (const j in ConfigDefault.Colors) {
|
||||
Object.keys(ConfigDefault.Colors).forEach((j) => {
|
||||
if (
|
||||
typeof CMOptions[i][j] === 'undefined' ||
|
||||
typeof CMOptions[i][j] !== 'string'
|
||||
@@ -80,16 +80,16 @@ export function LoadConfig(settings) {
|
||||
mod = true;
|
||||
CMOptions[i][j] = ConfigDefault[i][j];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (mod) SaveConfig();
|
||||
CMLoop(); // Do loop once
|
||||
for (const i in ConfigDefault) {
|
||||
Object.keys(ConfigDefault).forEach((i) => {
|
||||
if (i !== 'Header' && typeof ConfigData[i].func !== 'undefined') {
|
||||
ConfigData[i].func();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Default values
|
||||
LoadConfig(ConfigDefault);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { default as ConfigData } from '../Data/SettingsData';
|
||||
import ConfigData from '../Data/SettingsData';
|
||||
import { SaveConfig } from './SaveLoadReload/SaveLoadReloadSettings';
|
||||
import { CMOptions } from './VariablesAndData';
|
||||
|
||||
@@ -13,7 +13,7 @@ export const ConfigPrefix = 'CMConfig';
|
||||
* @param {string} config The name of the option
|
||||
*/
|
||||
export function ToggleConfig(config) {
|
||||
CMOptions[config]++;
|
||||
CMOptions[config] += 1;
|
||||
|
||||
if (CMOptions[config] === ConfigData[config].label.length) {
|
||||
CMOptions[config] = 0;
|
||||
@@ -49,7 +49,7 @@ export function ToggleConfigVolume(config) {
|
||||
* @param {string} config The name of the header
|
||||
*/
|
||||
export function ToggleHeader(config) {
|
||||
CMOptions.Header[config]++;
|
||||
CMOptions.Header[config] += 1;
|
||||
if (CMOptions.Header[config] > 1) CMOptions.Header[config] = 0;
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-return-assign */
|
||||
import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
|
||||
import { GCTimers } from '../../Disp/VariablesAndData';
|
||||
import { CMOptions } from '../VariablesAndData';
|
||||
@@ -8,12 +9,12 @@ import { CMOptions } from '../VariablesAndData';
|
||||
*/
|
||||
export default function ToggleGCTimer() {
|
||||
if (CMOptions.GCTimer === 1) {
|
||||
for (const i of Object.keys(GCTimers)) {
|
||||
Object.keys(GCTimers).forEach((i) => {
|
||||
GCTimers[i].style.display = 'block';
|
||||
GCTimers[i].style.left = CacheGoldenShimmersByID[i].l.style.left;
|
||||
GCTimers[i].style.top = CacheGoldenShimmersByID[i].l.style.top;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
for (const i of Object.keys(GCTimers)) GCTimers[i].style.display = 'none';
|
||||
Object.keys(GCTimers).forEach((i) => (GCTimers[i].style.display = 'none'));
|
||||
}
|
||||
}
|
||||
|
||||
13
src/Config/Toggles/ToggleSectionHideButtons.js
Normal file
13
src/Config/Toggles/ToggleSectionHideButtons.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { CMOptions } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function updates the display setting of the two objects created by CM.Disp.CreateWrinklerButtons()
|
||||
* It is called by changes in CM.Options.WrinklerButtons
|
||||
*/
|
||||
export default function ToggleSectionHideButtons() {
|
||||
if (CMOptions.HideSectionsButtons) {
|
||||
l('CMSectionHidButtons').style.display = '';
|
||||
} else {
|
||||
l('CMSectionHidButtons').style.display = 'none';
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/** Data related directly to Cookie Monster */
|
||||
|
||||
export const VersionMajor = '2.031';
|
||||
export const VersionMinor = '5';
|
||||
export const VersionMinor = '6';
|
||||
|
||||
/** Information about Cookie Monster to be displayed in the info section */
|
||||
export const ModDescription = `<div class="listing">
|
||||
@@ -15,15 +15,27 @@ export const ModDescription = `<div class="listing">
|
||||
|
||||
/** Latest releasenotes of Cookie Monster to be displayed in the info section */
|
||||
export const LatestReleaseNotes = `<div class="listing">
|
||||
The latest update (v 2.031.5) sees a total rehaul of the backend of the mod. It does not introduce any new functions, this is planned for the next release.</br>
|
||||
We believe we have fixed all bugs related to this new code, but if you find any bugs, please report them on the GitHub!</br>
|
||||
The latest update (v 2.031.6) has revamped the way PP is colourcoded. In the previous versions this was not always correct and we had some settings that made it even more incorrect. With this update Cookie Monster compares the PP of a building to all other possibilities (also buying 10 or 100) of a building and colors the PP accordingly.</br>
|
||||
This means that if it is better to buy 10 of a building immediately rather than to buy in increments of 1 Cookie Monster will now show this! In this case the buy 1 option will be yellow, while the buy 10 option will be green.</br>
|
||||
This also means that you will see some more diverse colors. Rather than coloring according to arbitrary "middle values" Cookie Monster now uses a top 10, 20 and 30. While this might take some getting used to we believe the new system is much better in conveying useful information to the user while also being more correct!</br>
|
||||
</br>
|
||||
<b>Besides, this update fixes the following bugs:</b></br>
|
||||
- Fixed some upgrade tooltips which did not display the full effect of buying the upgrades</br>
|
||||
- Fixed not always being able to sell when "blocking bulk buy"</br>
|
||||
- Fixed heavenly chips per second display</br>
|
||||
- Fixed small display bug when pressing shift and hovering over garden plots</br>
|
||||
- Fixed some bugs with the display of numbers and formatting of them</br>
|
||||
This update also implements the following functions:</br>
|
||||
- Added a tooltip displaying the reward to the extra pop wrinkler buttons</br>
|
||||
- Added tooltips to the Gods in the Pantheon</br>
|
||||
- The tooltip for Elder Pledge now displays correctly, although it takes some time to load after Cookie Monster has been loaded</br>
|
||||
- You can now test the volume and sound of notifications in the settings screen</br>
|
||||
- The bottom bar will now flicker less and each column has received a bit of padding</br>
|
||||
- Introduced new colour scheme for PP, see the explanation of colors in the Readme or the settings</br>
|
||||
- Added option to show buttons that can hide the upgrade and building section</br>
|
||||
- Added option to display PP as a time unit, note that these are only approximations. PP does not translate directly into time (the name is deceptive, we know...)</br>
|
||||
- Statistics page now shows chance for random drops when they have not been achieved</br>
|
||||
</br>
|
||||
This update fixes the following bugs:</br>
|
||||
- Incorrect amount for "required for max plant reward" in statistics page</br>
|
||||
- Fixed the tooltips of the '?' buttons in the statistics page not showing</br>
|
||||
- Fixed some unclear settings descriptions </br>
|
||||
</br>
|
||||
Please submit any bug reports or feature requests to the <a href="https://github.com/Aktanusa/CookieMonster">GitHub page!</a>
|
||||
</br>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import CachePP from '../Cache/PP/PP';
|
||||
/* eslint-disable no-unused-vars */
|
||||
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions';
|
||||
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
|
||||
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
||||
import ToggleDetailedTime from '../Config/Toggles/ToggleDetailedTime';
|
||||
import ToggleGCTimer from '../Config/Toggles/ToggleGCTimer';
|
||||
import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons';
|
||||
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
||||
import ToggleUpgradeBarAndColor from '../Config/Toggles/ToggleUpgradeBarAndColor';
|
||||
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
||||
@@ -14,6 +15,7 @@ import UpdateUpgrades from '../Disp/BuildingsUpgrades/Upgrades';
|
||||
import RefreshScale from '../Disp/HelperFunctions/RefreshScale';
|
||||
import UpdateColors from '../Disp/HelperFunctions/UpdateColors';
|
||||
import { UpdateFavicon } from '../Disp/TabTitle/FavIcon';
|
||||
import { SimDoSims } from '../Sim/VariablesAndData';
|
||||
import {
|
||||
SettingStandard,
|
||||
SettingColours,
|
||||
@@ -68,7 +70,11 @@ const Config = {
|
||||
SortBuildings: new SettingStandard(
|
||||
'bool',
|
||||
'BarsColors',
|
||||
['Sort Buildings: Default', 'Sort Buildings: PP'],
|
||||
[
|
||||
'Sort Buildings: Default',
|
||||
'Sort Buildings: PP of x1 purchase',
|
||||
'Sort Buildings: PP of selected bulk mode',
|
||||
],
|
||||
'Sort the display of buildings in either default order or by PP',
|
||||
false,
|
||||
function () {
|
||||
@@ -95,18 +101,12 @@ const Config = {
|
||||
UpdateBuildings();
|
||||
},
|
||||
),
|
||||
BulkBuildColor: new SettingStandard(
|
||||
PPDisplayTime: new SettingStandard(
|
||||
'bool',
|
||||
'BarsColors',
|
||||
[
|
||||
'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',
|
||||
['PP As Value (Standard)', 'PP As Time Unit'],
|
||||
'Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.',
|
||||
false,
|
||||
function () {
|
||||
UpdateBuildings();
|
||||
},
|
||||
),
|
||||
UpBarColor: new SettingStandard(
|
||||
'bool',
|
||||
@@ -127,17 +127,17 @@ const Config = {
|
||||
'BarsColors',
|
||||
{
|
||||
Blue:
|
||||
'Color Blue. Used to show better than best PP building, for Click Frenzy bar, and for various labels',
|
||||
'Color Blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels',
|
||||
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',
|
||||
'Color Yellow. Used to show buildings within the top 10 of PP, 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',
|
||||
'Color Orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels',
|
||||
Red:
|
||||
'Color Red. Used to show worst PP building, for Clot bar, and for various labels',
|
||||
'Color Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels',
|
||||
Purple:
|
||||
'Color Purple. Used to show worse than worst PP building, for Next Cookie bar, and for various labels',
|
||||
'Color Purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels',
|
||||
Gray:
|
||||
'Color Gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
|
||||
Pink: 'Color Pink. Used for Dragonflight bar',
|
||||
@@ -169,6 +169,9 @@ const Config = {
|
||||
],
|
||||
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) Wrinklers',
|
||||
true,
|
||||
function () {
|
||||
SimDoSims = true;
|
||||
},
|
||||
),
|
||||
CPSMode: new SettingStandard(
|
||||
'bool',
|
||||
@@ -206,16 +209,6 @@ const Config = {
|
||||
'How much time average Cookie Clicks should consider',
|
||||
false,
|
||||
),
|
||||
ColorPPBulkMode: new SettingStandard(
|
||||
'bool',
|
||||
'Calculation',
|
||||
['Color of PP (Compared to Single)', 'Color of PP (Compared to Bulk)'],
|
||||
'Color PP-values based on comparison with single purchase or with selected bulk-buy mode',
|
||||
false,
|
||||
function () {
|
||||
CachePP();
|
||||
},
|
||||
),
|
||||
PPExcludeTop: new SettingStandard(
|
||||
'bool',
|
||||
'Calculation',
|
||||
@@ -585,6 +578,16 @@ const Config = {
|
||||
'Shows a tooltip for plants that have a cookie reward.',
|
||||
true,
|
||||
),
|
||||
TooltipPantheon: new SettingStandard(
|
||||
'bool',
|
||||
'Tooltip',
|
||||
[
|
||||
'Show Extra Info Pantheon Tooltip OFF',
|
||||
'Show Extra Info Pantheon Tooltip ON',
|
||||
],
|
||||
'Shows additional info in the pantheon tooltip',
|
||||
true,
|
||||
),
|
||||
DragonAuraInfo: new SettingStandard(
|
||||
'bool',
|
||||
'Tooltip',
|
||||
@@ -684,7 +687,7 @@ const Config = {
|
||||
'bool',
|
||||
'Notation',
|
||||
['1 decimals', '2 decimals', '3 decimals'],
|
||||
'Set the number of decimals used when applicable',
|
||||
`Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game's Setting Scale"`,
|
||||
false,
|
||||
function () {
|
||||
RefreshScale();
|
||||
@@ -733,13 +736,23 @@ const Config = {
|
||||
WrinklerButtons: new SettingStandard(
|
||||
'bool',
|
||||
'Miscellaneous',
|
||||
['Extra Buttons OFF', 'Extra Buttons ON'],
|
||||
['Extra Wrinkler Buttons OFF', 'Extra Wrinkler Buttons ON'],
|
||||
'Show buttons for popping wrinklers at bottom of cookie section',
|
||||
true,
|
||||
function () {
|
||||
ToggleWrinklerButtons();
|
||||
},
|
||||
),
|
||||
HideSectionsButtons: new SettingStandard(
|
||||
'bool',
|
||||
'Miscellaneous',
|
||||
['Hide Upgrades/Buildings Button OFF', 'Hide Upgrades/Buildings Button ON'],
|
||||
'Show buttons for hiding and showing the upgrades and buildings section in the right column',
|
||||
true,
|
||||
function () {
|
||||
ToggleSectionHideButtons();
|
||||
},
|
||||
),
|
||||
BulkBuyBlock: new SettingStandard(
|
||||
'bool',
|
||||
'Miscellaneous',
|
||||
|
||||
@@ -5,18 +5,17 @@ const ConfigDefault = {
|
||||
TimerBarPos: 0,
|
||||
TimerBarOverlay: 2,
|
||||
BuildColor: 1,
|
||||
BulkBuildColor: 0,
|
||||
PPDisplayTime: 0,
|
||||
UpBarColor: 1,
|
||||
UpgradeBarFixedPos: 1,
|
||||
CalcWrink: 0,
|
||||
CPSMode: 1,
|
||||
AvgCPSHist: 3,
|
||||
AvgClicksHist: 0,
|
||||
ColorPPBulkMode: 1,
|
||||
PPExcludeTop: 0,
|
||||
PPSecondsLowerLimit: 0,
|
||||
PPOnlyConsiderBuyable: 0,
|
||||
ToolWarnBon: 0,
|
||||
ToolWarnBon: 1,
|
||||
Title: 1,
|
||||
GeneralSound: 1,
|
||||
GCNotification: 0,
|
||||
@@ -71,6 +70,7 @@ const ConfigDefault = {
|
||||
TooltipWrink: 1,
|
||||
TooltipLump: 1,
|
||||
TooltipPlots: 1,
|
||||
TooltipPantheon: 1,
|
||||
DragonAuraInfo: 1,
|
||||
TooltipAscendButton: 1,
|
||||
Stats: 1,
|
||||
@@ -101,6 +101,7 @@ const ConfigDefault = {
|
||||
GCTimer: 1,
|
||||
Favicon: 1,
|
||||
WrinklerButtons: 1,
|
||||
HideSectionsButtons: 0,
|
||||
BulkBuyBlock: 0,
|
||||
Header: {
|
||||
BarsColors: 1,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-nested-ternary */
|
||||
/** General functions to format or beautify strings */
|
||||
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
@@ -93,23 +94,26 @@ export function Beautify(num, floats, forced) {
|
||||
* @returns {string} Formatted time
|
||||
*/
|
||||
export function FormatTime(time, longFormat) {
|
||||
let formattedTime = time;
|
||||
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 s = Math.floor(time % 60);
|
||||
if (time < 0) return 'Negative time period';
|
||||
formattedTime = Math.ceil(time);
|
||||
const y = Math.floor(formattedTime / 31557600);
|
||||
const d = Math.floor((formattedTime % 31557600) / 86400);
|
||||
const h = Math.floor((formattedTime % 86400) / 3600);
|
||||
const m = Math.floor((formattedTime % 3600) / 60);
|
||||
const s = Math.floor(formattedTime % 60);
|
||||
let str = '';
|
||||
if (CMOptions.TimeFormat) {
|
||||
if (time > 3155760000) return 'XX:XX:XX:XX:XX';
|
||||
if (formattedTime > 3155760000) return 'XX:XX:XX:XX:XX';
|
||||
str += `${(y < 10 ? '0' : '') + y}:`;
|
||||
str += `${(d < 10 ? '0' : '') + d}:`;
|
||||
str += `${(h < 10 ? '0' : '') + h}:`;
|
||||
str += `${(m < 10 ? '0' : '') + m}:`;
|
||||
str += (s < 10 ? '0' : '') + s;
|
||||
} else {
|
||||
if (time > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||
if (formattedTime > 777600000)
|
||||
return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||
str +=
|
||||
y > 0
|
||||
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, `
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-nested-ternary */
|
||||
import {
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
@@ -30,17 +31,17 @@ export default function UpdateBuildings() {
|
||||
|
||||
if (Game.buyMode === 1) {
|
||||
if (CMOptions.BuildColor === 1) {
|
||||
for (const i of Object.keys(target)) {
|
||||
Object.keys(target).forEach((i) => {
|
||||
l(`productPrice${Game.Objects[i].id}`).style.color =
|
||||
CMOptions.Colors[target[i].color];
|
||||
}
|
||||
});
|
||||
} else {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
l(`productPrice${Game.Objects[i].id}`).style.removeProperty('color');
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (Game.buyMode === -1) {
|
||||
for (const i of Object.keys(CacheObjects1)) {
|
||||
Object.keys(CacheObjects1).forEach((i) => {
|
||||
const o = Game.Objects[i];
|
||||
l(`productPrice${o.id}`).style.color = '';
|
||||
/*
|
||||
@@ -54,14 +55,33 @@ export default function UpdateBuildings() {
|
||||
l(`productPrice${o.id}`).innerHTML = Beautify(
|
||||
BuildingSell(o, o.basePrice, o.amount, o.free, Game.buyBulk, 1),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Build array of pointers, sort by pp, use array index (+2) as the grid row number
|
||||
// (grid rows are 1-based indexing, and row 1 is the bulk buy/sell options)
|
||||
// This regulates sorting of buildings
|
||||
if (Game.buyMode === 1 && CMOptions.SortBuildings) {
|
||||
const arr = Object.keys(target).map((k) => {
|
||||
let arr;
|
||||
if (CMOptions.SortBuildings === 1) {
|
||||
arr = Object.keys(CacheObjects1).map((k) => {
|
||||
const o = CacheObjects1[k];
|
||||
o.name = k;
|
||||
o.id = Game.Objects[k].id;
|
||||
return o;
|
||||
});
|
||||
|
||||
arr.sort(function (a, b) {
|
||||
return Colors.indexOf(a.color) > Colors.indexOf(b.color)
|
||||
? 1
|
||||
: Colors.indexOf(a.color) < Colors.indexOf(b.color)
|
||||
? -1
|
||||
: a.pp < b.pp
|
||||
? -1
|
||||
: 0;
|
||||
});
|
||||
} else if (CMOptions.SortBuildings === 2) {
|
||||
arr = Object.keys(target).map((k) => {
|
||||
const o = target[k];
|
||||
o.name = k;
|
||||
o.id = Game.Objects[k].id;
|
||||
@@ -77,6 +97,7 @@ export default function UpdateBuildings() {
|
||||
? -1
|
||||
: 0;
|
||||
});
|
||||
}
|
||||
|
||||
for (let x = 0; x < arr.length; x++) {
|
||||
Game.Objects[arr[x].name].l.style.gridRow = `${x + 2}/${x + 2}`;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-nested-ternary */
|
||||
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import {
|
||||
@@ -29,10 +30,10 @@ export default function UpdateUpgrades() {
|
||||
let purple = 0;
|
||||
let gray = 0;
|
||||
|
||||
for (const i of Object.keys(Game.UpgradesInStore)) {
|
||||
Object.keys(Game.UpgradesInStore).forEach((i) => {
|
||||
const me = Game.UpgradesInStore[i];
|
||||
let addedColor = false;
|
||||
for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j++) {
|
||||
for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j += 1) {
|
||||
if (
|
||||
l(`upgrade${i}`).childNodes[j].className.indexOf(ColorBackPre) !== -1
|
||||
) {
|
||||
@@ -49,14 +50,14 @@ export default function UpdateUpgrades() {
|
||||
div.className = ColorBackPre + CacheUpgrades[me.name].color;
|
||||
l(`upgrade${i}`).appendChild(div);
|
||||
}
|
||||
if (CacheUpgrades[me.name].color === ColorBlue) blue++;
|
||||
else if (CacheUpgrades[me.name].color === ColorGreen) green++;
|
||||
else if (CacheUpgrades[me.name].color === ColorYellow) yellow++;
|
||||
else if (CacheUpgrades[me.name].color === ColorOrange) orange++;
|
||||
else if (CacheUpgrades[me.name].color === ColorRed) red++;
|
||||
else if (CacheUpgrades[me.name].color === ColorPurple) purple++;
|
||||
else if (CacheUpgrades[me.name].color === ColorGray) gray++;
|
||||
}
|
||||
if (CacheUpgrades[me.name].color === ColorBlue) blue += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColorGreen) green += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColorYellow) yellow += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColorOrange) orange += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColorRed) red += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColorPurple) purple += 1;
|
||||
else if (CacheUpgrades[me.name].color === ColorGray) gray += 1;
|
||||
});
|
||||
|
||||
l('CMUpgradeBarBlue').textContent = blue;
|
||||
l('CMUpgradeBarGreen').textContent = green;
|
||||
@@ -70,7 +71,7 @@ export default function UpdateUpgrades() {
|
||||
const arr = [];
|
||||
// Build array of pointers, sort by pp, set flex positions
|
||||
// This regulates sorting of upgrades
|
||||
for (let x = 0; x < Game.UpgradesInStore.length; x++) {
|
||||
for (let x = 0; x < Game.UpgradesInStore.length; x += 1) {
|
||||
const o = {};
|
||||
o.name = Game.UpgradesInStore[x].name;
|
||||
o.price = Game.UpgradesInStore[x].basePrice;
|
||||
@@ -95,7 +96,7 @@ export default function UpdateUpgrades() {
|
||||
const nameChecker = function (arr2, upgrade) {
|
||||
return arr2.findIndex((e) => e.name === upgrade.name);
|
||||
};
|
||||
for (let x = 0; x < Game.UpgradesInStore.length; x++) {
|
||||
for (let x = 0; x < Game.UpgradesInStore.length; x += 1) {
|
||||
l(`upgrade${x}`).style.order =
|
||||
nameChecker(arr, Game.UpgradesInStore[x]) + 1;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
|
||||
import { UpdateBotBar } from './InfoBars/BottomBar';
|
||||
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
||||
import RefreshMenu from './MenuSections/Refreshmenu';
|
||||
import { UpdateTooltips } from './Tooltips/Tooltip';
|
||||
import UpdateTooltips from './Tooltips/UpdateTooltips';
|
||||
import {
|
||||
CheckWrinklerTooltip,
|
||||
UpdateWrinklerTooltip,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
/** Section: Functions related to the Golden Cookie Timers */
|
||||
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
|
||||
@@ -10,11 +10,11 @@ export default function CalculateGrimoireRefillTime(
|
||||
maxMagic,
|
||||
targetMagic,
|
||||
) {
|
||||
let magic = currentMagic;
|
||||
let count = 0;
|
||||
while (currentMagic < targetMagic) {
|
||||
currentMagic +=
|
||||
Math.max(0.002, (currentMagic / Math.max(maxMagic, 100)) ** 0.5) * 0.002;
|
||||
count++;
|
||||
while (magic < targetMagic) {
|
||||
magic += Math.max(0.002, (magic / Math.max(maxMagic, 100)) ** 0.5) * 0.002;
|
||||
count += 1;
|
||||
}
|
||||
return count / Game.fps;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
* It is called by a click of the 'pop all' button created by CM.Disp.AddMenuStats()
|
||||
*/
|
||||
export default function PopAllNormalWrinklers() {
|
||||
for (const i of Object.keys(Game.wrinklers)) {
|
||||
Object.keys(Game.wrinklers).forEach((i) => {
|
||||
if (Game.wrinklers[i].sucked > 0 && Game.wrinklers[i].type === 0) {
|
||||
Game.wrinklers[i].hp = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { VersionMajor, VersionMinor } from '../../Data/Moddata';
|
||||
import {
|
||||
Beautify,
|
||||
FormatTime,
|
||||
GetTimeColor,
|
||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import GetCPS from '../HelperFunctions/GetCPS';
|
||||
@@ -63,9 +64,9 @@ export function CreateBotBar() {
|
||||
|
||||
l('wrapper').appendChild(BotBar);
|
||||
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
CreateBotBarBuildingColumn(i);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +75,7 @@ export function CreateBotBar() {
|
||||
export function UpdateBotBar() {
|
||||
if (CMOptions.BotBar === 1 && CacheObjects1 && Game.buyMode === 1) {
|
||||
let count = 0;
|
||||
for (const i of Object.keys(CacheObjects1)) {
|
||||
Object.keys(CacheObjects1).forEach((i) => {
|
||||
let target = Game.buyBulk;
|
||||
if (Game.buyMode === 1) {
|
||||
LastTargetBotBar = target;
|
||||
@@ -84,7 +85,7 @@ export function UpdateBotBar() {
|
||||
if (target === 1) target = CacheObjects1;
|
||||
if (target === 10) target = CacheObjects10;
|
||||
if (target === 100) target = CacheObjects100;
|
||||
count++;
|
||||
count += 1;
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[
|
||||
count
|
||||
].childNodes[1].textContent = Game.Objects[i].amount;
|
||||
@@ -94,9 +95,13 @@ export function UpdateBotBar() {
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||
count
|
||||
].className = ColorTextPre + target[i].color;
|
||||
let PPString;
|
||||
if (CMOptions.PPDisplayTime)
|
||||
PPString = FormatTime(Math.round(target[i].pp));
|
||||
else PPString = Beautify(Math.round(target[i].pp), 2);
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[
|
||||
count
|
||||
].textContent = Beautify(target[i].pp, 2);
|
||||
].textContent = PPString;
|
||||
const timeColor = GetTimeColor(
|
||||
(Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) /
|
||||
GetCPS(),
|
||||
@@ -115,6 +120,6 @@ export function UpdateBotBar() {
|
||||
l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[
|
||||
count
|
||||
].textContent = timeColor.text;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +86,12 @@ export function CreateBotBarBuildingColumn(buildingName) {
|
||||
span.className = ColorTextPre + ColorBlue;
|
||||
|
||||
header.appendChild(document.createTextNode(')'));
|
||||
type.lastChild.style.paddingLeft = '8px';
|
||||
bonus.appendChild(document.createElement('td'));
|
||||
bonus.lastChild.style.paddingLeft = '8px';
|
||||
pp.appendChild(document.createElement('td'));
|
||||
pp.lastChild.style.paddingLeft = '8px';
|
||||
time.appendChild(document.createElement('td'));
|
||||
time.lastChild.style.paddingLeft = '2px';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ export function UpdateTimerBar() {
|
||||
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) /
|
||||
Game.fps,
|
||||
);
|
||||
numberOfTimers++;
|
||||
numberOfTimers += 1;
|
||||
} else l('CMTimerBarGC').style.display = 'none';
|
||||
|
||||
// Regulates visibility of Reindeer timer
|
||||
@@ -152,7 +152,7 @@ export function UpdateTimerBar() {
|
||||
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) /
|
||||
Game.fps,
|
||||
);
|
||||
numberOfTimers++;
|
||||
numberOfTimers += 1;
|
||||
} else {
|
||||
l('CMTimerBarRen').style.display = 'none';
|
||||
}
|
||||
@@ -160,7 +160,7 @@ export function UpdateTimerBar() {
|
||||
// On every frame all buff-timers are deleted and re-created
|
||||
const BuffTimerBars = {};
|
||||
l('CMTimerBarBuffTimers').innerHTML = '';
|
||||
for (const i of Object.keys(Game.buffs)) {
|
||||
Object.keys(Game.buffs).forEach((i) => {
|
||||
if (Game.buffs[i]) {
|
||||
const timer = CreateTimer(Game.buffs[i].name, Game.buffs[i].name, [
|
||||
{ id: `${Game.buffs[i].name}Bar` },
|
||||
@@ -187,13 +187,13 @@ export function UpdateTimerBar() {
|
||||
timer.lastChild.children[2].textContent = Math.ceil(
|
||||
Game.buffs[i].time / Game.fps,
|
||||
);
|
||||
numberOfTimers++;
|
||||
numberOfTimers += 1;
|
||||
BuffTimerBars[Game.buffs[i].name] = timer;
|
||||
}
|
||||
}
|
||||
for (const i of Object.keys(BuffTimerBars)) {
|
||||
});
|
||||
Object.keys(BuffTimerBars).forEach((i) => {
|
||||
l('CMTimerBarBuffTimers').appendChild(BuffTimerBars[i]);
|
||||
}
|
||||
});
|
||||
|
||||
if (numberOfTimers !== 0) {
|
||||
l('CMTimerBar').style.height = `${numberOfTimers * 12 + 2}px`;
|
||||
|
||||
38
src/Disp/Initialization/CreateSectionHideButtons.js
Normal file
38
src/Disp/Initialization/CreateSectionHideButtons.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* This function creates two objects at the top of the right column that allowing hiding the upgrade and building section
|
||||
*/
|
||||
export default function CreateSectionHideButtons() {
|
||||
const div = document.createElement('div');
|
||||
div.id = 'CMSectionHidButtons';
|
||||
div.style.textAlign = 'center';
|
||||
const a = document.createElement('a');
|
||||
a.className = 'option';
|
||||
a.onclick = function () {
|
||||
if (l('upgrades').style.display === 'flex') {
|
||||
l('upgrades').style.display = 'none';
|
||||
l('toggleUpgrades').style.display = 'none';
|
||||
l('techUpgrades').style.display = 'none';
|
||||
l('vaultUpgrades').style.display = 'none';
|
||||
} else {
|
||||
l('upgrades').style.display = 'flex';
|
||||
if (l('toggleUpgrades').children.length !== 0)
|
||||
l('toggleUpgrades').style.display = 'block';
|
||||
if (l('techUpgrades').children.length !== 0)
|
||||
l('techUpgrades').style.display = 'block';
|
||||
if (l('vaultUpgrades').children.length !== 0)
|
||||
l('vaultUpgrades').style.display = 'block';
|
||||
}
|
||||
};
|
||||
a.textContent = 'Hide/Show Upgrades';
|
||||
div.appendChild(a);
|
||||
const b = document.createElement('a');
|
||||
b.className = 'option';
|
||||
b.onclick = function () {
|
||||
if (l('products').style.display === 'grid')
|
||||
l('products').style.display = 'none';
|
||||
else l('products').style.display = 'grid';
|
||||
};
|
||||
b.textContent = 'Hide/Show Buildings';
|
||||
div.appendChild(b);
|
||||
l('store').insertBefore(div, l('store').childNodes[2]);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData';
|
||||
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
||||
import { CreateTooltip } from '../Tooltips/Tooltip';
|
||||
|
||||
/**
|
||||
* This function creates two objects at the bottom of the left column that allowing popping of wrinklers
|
||||
@@ -12,6 +13,20 @@ export default function CreateWrinklerButtons() {
|
||||
popAllA.onclick = function () {
|
||||
PopAllNormalWrinklers();
|
||||
};
|
||||
popAllA.onmouseout = function () {
|
||||
Game.tooltip.shouldHide = 1;
|
||||
};
|
||||
popAllA.onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
function () {
|
||||
return CreateTooltip('wb', 'PopAll');
|
||||
},
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
l('sectionLeftExtra').children[0].append(popAllA);
|
||||
const popFattestA = document.createElement('a');
|
||||
popFattestA.id = 'PopFattestWrinklerButton';
|
||||
@@ -21,5 +36,19 @@ export default function CreateWrinklerButtons() {
|
||||
if (CacheWrinklersFattest[1] !== null)
|
||||
Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
||||
};
|
||||
popFattestA.onmouseout = function () {
|
||||
Game.tooltip.shouldHide = 1;
|
||||
};
|
||||
popFattestA.onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
function () {
|
||||
return CreateTooltip('wb', 'PopFattest');
|
||||
},
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
l('sectionLeftExtra').children[0].append(popFattestA);
|
||||
}
|
||||
|
||||
@@ -8,9 +8,6 @@ import { CMOptions } from '../../Config/VariablesAndData';
|
||||
|
||||
import {
|
||||
CacheAverageClicks,
|
||||
CacheCentEgg,
|
||||
CacheLastChoEgg,
|
||||
CacheSeaSpec,
|
||||
CacheWrinklersFattest,
|
||||
CacheWrinklersNormal,
|
||||
CacheWrinklersTotal,
|
||||
@@ -110,136 +107,7 @@ export default function AddMenuStats(title) {
|
||||
}
|
||||
}
|
||||
|
||||
let specDisp = false;
|
||||
const missingHalloweenCookies = [];
|
||||
for (const i of Object.keys(GameData.HalloCookies)) {
|
||||
if (!Game.Has(GameData.HalloCookies[i])) {
|
||||
missingHalloweenCookies.push(GameData.HalloCookies[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
}
|
||||
const missingChristmasCookies = [];
|
||||
for (const i of Object.keys(GameData.ChristCookies)) {
|
||||
if (!Game.Has(GameData.ChristCookies[i])) {
|
||||
missingChristmasCookies.push(GameData.ChristCookies[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
}
|
||||
const missingValentineCookies = [];
|
||||
for (const i of Object.keys(GameData.ValCookies)) {
|
||||
if (!Game.Has(GameData.ValCookies[i])) {
|
||||
missingValentineCookies.push(GameData.ValCookies[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
}
|
||||
const missingNormalEggs = [];
|
||||
for (const i of Object.keys(Game.eggDrops)) {
|
||||
if (!Game.HasUnlocked(Game.eggDrops[i])) {
|
||||
missingNormalEggs.push(Game.eggDrops[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
}
|
||||
const missingRareEggs = [];
|
||||
for (const i of Object.keys(Game.rareEggDrops)) {
|
||||
if (!Game.HasUnlocked(Game.rareEggDrops[i])) {
|
||||
missingRareEggs.push(Game.rareEggDrops[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
}
|
||||
const missingPlantDrops = [];
|
||||
for (const i of Object.keys(GameData.PlantDrops)) {
|
||||
if (!Game.HasUnlocked(GameData.PlantDrops[i])) {
|
||||
missingPlantDrops.push(GameData.PlantDrops[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
}
|
||||
const choEgg =
|
||||
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
||||
const centEgg = Game.Has('Century egg');
|
||||
|
||||
if (Game.season === 'christmas' || specDisp || choEgg || centEgg) {
|
||||
stats.appendChild(CreateElements.StatsHeader('Season Specials', 'Sea'));
|
||||
if (CMOptions.Header.Sea) {
|
||||
if (missingHalloweenCookies.length !== 0)
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
'basic',
|
||||
'Halloween Cookies Left to Buy',
|
||||
CreateElements.StatsMissDisp(missingHalloweenCookies),
|
||||
),
|
||||
);
|
||||
if (missingChristmasCookies.length !== 0)
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
'basic',
|
||||
'Christmas Cookies Left to Buy',
|
||||
CreateElements.StatsMissDisp(missingChristmasCookies),
|
||||
),
|
||||
);
|
||||
if (missingValentineCookies.length !== 0)
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
'basic',
|
||||
'Valentine Cookies Left to Buy',
|
||||
CreateElements.StatsMissDisp(missingValentineCookies),
|
||||
),
|
||||
);
|
||||
if (missingNormalEggs.length !== 0)
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
'basic',
|
||||
'Normal Easter Eggs Left to Unlock',
|
||||
CreateElements.StatsMissDisp(missingNormalEggs),
|
||||
),
|
||||
);
|
||||
if (missingRareEggs.length !== 0)
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
'basic',
|
||||
'Rare Easter Eggs Left to Unlock',
|
||||
CreateElements.StatsMissDisp(missingRareEggs),
|
||||
),
|
||||
);
|
||||
if (missingPlantDrops.length !== 0)
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
'basic',
|
||||
'Rare Plant Drops Left to Unlock',
|
||||
CreateElements.StatsMissDisp(missingPlantDrops),
|
||||
),
|
||||
);
|
||||
|
||||
if (Game.season === 'christmas')
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
'basic',
|
||||
'Reindeer Reward',
|
||||
document.createTextNode(Beautify(CacheSeaSpec)),
|
||||
),
|
||||
);
|
||||
if (choEgg) {
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
'withTooltip',
|
||||
'Chocolate Egg Cookies',
|
||||
document.createTextNode(Beautify(CacheLastChoEgg)),
|
||||
'ChoEggTooltipPlaceholder',
|
||||
),
|
||||
);
|
||||
}
|
||||
if (centEgg) {
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
'basic',
|
||||
'Century Egg Multiplier',
|
||||
document.createTextNode(
|
||||
`${Math.round((CacheCentEgg - 1) * 10000) / 100}%`,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
stats.appendChild(CreateSections.SeasonSection());
|
||||
|
||||
stats.appendChild(CreateElements.StatsHeader('Miscellaneous', 'Misc'));
|
||||
if (CMOptions.Header.Misc) {
|
||||
@@ -266,11 +134,11 @@ export default function AddMenuStats(title) {
|
||||
);
|
||||
if (Game.Has('Fortune cookies')) {
|
||||
const fortunes = [];
|
||||
for (const i of Object.keys(GameData.Fortunes)) {
|
||||
Object.keys(GameData.Fortunes).forEach((i) => {
|
||||
if (!Game.Has(GameData.Fortunes[i])) {
|
||||
fortunes.push(GameData.Fortunes[i]);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (fortunes.length !== 0)
|
||||
stats.appendChild(
|
||||
CreateElements.StatsListing(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { ToggleHeader } from '../../Config/ToggleSetting';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { TooltipText } from '../VariablesAndData';
|
||||
import { SimpleTooltipElements } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function creates a header-object for the stats page
|
||||
@@ -64,7 +64,10 @@ export function StatsListing(type, name, text, placeholder) {
|
||||
Game.tooltip.hide();
|
||||
};
|
||||
tooltip.onmouseover = function () {
|
||||
Game.tooltip.draw(this, escape(TooltipText[placeholder].innerHTML));
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
escape(SimpleTooltipElements[placeholder].innerHTML),
|
||||
);
|
||||
};
|
||||
tooltip.style.cursor = 'default';
|
||||
tooltip.style.display = 'inline-block';
|
||||
@@ -106,12 +109,12 @@ export function StatsMissDisp(theMissDisp) {
|
||||
title.style.textAlign = 'center';
|
||||
title.textContent = 'Missing';
|
||||
missing.appendChild(title);
|
||||
for (const i of Object.keys(theMissDisp)) {
|
||||
Object.keys(theMissDisp).forEach((i) => {
|
||||
const div = document.createElement('div');
|
||||
div.style.textAlign = 'center';
|
||||
div.appendChild(document.createTextNode(theMissDisp[i]));
|
||||
missing.appendChild(div);
|
||||
}
|
||||
});
|
||||
placeholder.appendChild(missing);
|
||||
span.onmouseover = function () {
|
||||
Game.tooltip.draw(this, escape(placeholder.innerHTML));
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
* This function creates the missing upgrades sections for prestige, normal and cookie upgrades
|
||||
*/
|
||||
export function AddMissingUpgrades() {
|
||||
for (const menuSection of l('menu').children) {
|
||||
l('menu').childNodes.forEach((menuSection) => {
|
||||
if (menuSection.children[0]) {
|
||||
if (
|
||||
menuSection.children[0].innerHTML === 'Prestige' &&
|
||||
@@ -82,7 +82,7 @@ export function AddMissingUpgrades() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,7 +99,7 @@ export function crateMissing(me) {
|
||||
if (!Game.prefs.crates) noFrame = 1;
|
||||
if (noFrame) classes += ' noFrame';
|
||||
|
||||
let icon = me.icon;
|
||||
let { icon } = me;
|
||||
if (me.iconFunction) icon = me.iconFunction();
|
||||
const tooltip = `function() {return Game.crateTooltip(Game.UpgradesById[${me.id}], 'stats');}`;
|
||||
return `<div class="${classes}"
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/** Functions to create the individual sections of the Statistics page */
|
||||
|
||||
import * as GameData from '../../Data/Gamedata';
|
||||
import { MaxChainCookieReward } from '../../Cache/Stats/ChainCookies';
|
||||
import {
|
||||
CacheAvgCPSWithChoEgg,
|
||||
CacheCentEgg,
|
||||
CacheChainFrenzyMaxReward,
|
||||
CacheChainFrenzyRequired,
|
||||
CacheChainFrenzyRequiredNext,
|
||||
@@ -30,6 +32,7 @@ import {
|
||||
CacheLuckyWrathRewardFrenzy,
|
||||
CacheNoGoldSwitchCookiesPS,
|
||||
CacheRealCookiesEarned,
|
||||
CacheSeaSpec,
|
||||
CacheWrathCookiesMult,
|
||||
CacheWrinklersTotal,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
@@ -43,7 +46,7 @@ import {
|
||||
import GetCPS from '../HelperFunctions/GetCPS';
|
||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
||||
import { ColorGreen, ColorRed, ColorTextPre } from '../VariablesAndData';
|
||||
import { StatsListing } from './CreateDOMElements';
|
||||
import { StatsListing, StatsHeader, StatsMissDisp } from './CreateDOMElements';
|
||||
|
||||
/**
|
||||
* This function creates the "Lucky" section of the stats page
|
||||
@@ -741,3 +744,245 @@ export function PrestigeSection() {
|
||||
|
||||
return section;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function creates the "Season Specials" section of the stats page
|
||||
* @returns {object} section The object contating the Season Specials section
|
||||
*/
|
||||
export function SeasonSection() {
|
||||
const section = document.createElement('div');
|
||||
section.className = 'CMStatsSeasonSection';
|
||||
|
||||
let specDisp = false;
|
||||
const missingHalloweenCookies = [];
|
||||
Object.keys(GameData.HalloCookies).forEach((i) => {
|
||||
if (!Game.Has(GameData.HalloCookies[i])) {
|
||||
missingHalloweenCookies.push(GameData.HalloCookies[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
});
|
||||
const missingChristmasCookies = [];
|
||||
Object.keys(GameData.ChristCookies).forEach((i) => {
|
||||
if (!Game.Has(GameData.ChristCookies[i])) {
|
||||
missingChristmasCookies.push(GameData.ChristCookies[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
});
|
||||
const missingValentineCookies = [];
|
||||
Object.keys(GameData.ValCookies).forEach((i) => {
|
||||
if (!Game.Has(GameData.ValCookies[i])) {
|
||||
missingValentineCookies.push(GameData.ValCookies[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
});
|
||||
const missingNormalEggs = [];
|
||||
Object.keys(Game.eggDrops).forEach((i) => {
|
||||
if (!Game.HasUnlocked(Game.eggDrops[i])) {
|
||||
missingNormalEggs.push(Game.eggDrops[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
});
|
||||
const missingRareEggs = [];
|
||||
Object.keys(Game.rareEggDrops).forEach((i) => {
|
||||
if (!Game.HasUnlocked(Game.rareEggDrops[i])) {
|
||||
missingRareEggs.push(Game.rareEggDrops[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
});
|
||||
const missingPlantDrops = [];
|
||||
Object.keys(GameData.PlantDrops).forEach((i) => {
|
||||
if (!Game.HasUnlocked(GameData.PlantDrops[i])) {
|
||||
missingPlantDrops.push(GameData.PlantDrops[i]);
|
||||
specDisp = true;
|
||||
}
|
||||
});
|
||||
const choEgg =
|
||||
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg');
|
||||
const centEgg = Game.Has('Century egg');
|
||||
|
||||
if (Game.season === 'christmas' || specDisp || choEgg || centEgg) {
|
||||
section.appendChild(StatsHeader('Season Specials', 'Sea'));
|
||||
if (CMOptions.Header.Sea) {
|
||||
if (missingHalloweenCookies.length !== 0) {
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Halloween cookies left to buy',
|
||||
StatsMissDisp(missingHalloweenCookies),
|
||||
),
|
||||
);
|
||||
let failRateHalloween = 0.95;
|
||||
if (Game.HasAchiev('Spooky cookies')) failRateHalloween = 0.8;
|
||||
if (Game.Has('Starterror')) failRateHalloween *= 0.9;
|
||||
failRateHalloween *= 1 / Game.dropRateMult();
|
||||
if (Game.hasGod) {
|
||||
const godLvl = Game.hasGod('seasons');
|
||||
if (godLvl === 1) failRateHalloween *= 0.9;
|
||||
else if (godLvl === 2) failRateHalloween *= 0.95;
|
||||
else if (godLvl === 3) failRateHalloween *= 0.97;
|
||||
}
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Chance of receiving a cookie from wrinkler/shiny wrinkler',
|
||||
document.createTextNode(
|
||||
`${Beautify((1 - failRateHalloween) * 100)}% / ${Beautify(
|
||||
(1 - failRateHalloween * 0.9) * 100,
|
||||
)}%`,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (missingChristmasCookies.length !== 0) {
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Christmas cookies left to buy',
|
||||
StatsMissDisp(missingChristmasCookies),
|
||||
),
|
||||
);
|
||||
let failRateChristmas = 0.8;
|
||||
if (Game.HasAchiev('Let it snow')) failRateChristmas = 0.6;
|
||||
failRateChristmas *= 1 / Game.dropRateMult();
|
||||
if (Game.Has('Starsnow')) failRateChristmas *= 0.95;
|
||||
if (Game.hasGod) {
|
||||
const godLvl = Game.hasGod('seasons');
|
||||
if (godLvl === 1) failRateChristmas *= 0.9;
|
||||
else if (godLvl === 2) failRateChristmas *= 0.95;
|
||||
else if (godLvl === 3) failRateChristmas *= 0.97;
|
||||
}
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Chance of receiving a cookie from reindeer',
|
||||
document.createTextNode(
|
||||
`${Beautify((1 - failRateChristmas) * 100)}%`,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (missingValentineCookies.length !== 0) {
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Valentine cookies left to buy',
|
||||
StatsMissDisp(missingValentineCookies),
|
||||
),
|
||||
);
|
||||
}
|
||||
const dropRateEgg = function (StartingFailRate) {
|
||||
let failRateEgg = StartingFailRate * (1 / Game.dropRateMult());
|
||||
if (Game.HasAchiev('Hide & seek champion')) failRateEgg *= 0.7;
|
||||
if (Game.Has('Omelette')) failRateEgg *= 0.9;
|
||||
if (Game.Has('Starspawn')) failRateEgg *= 0.9;
|
||||
if (Game.hasGod) {
|
||||
const godLvl = Game.hasGod('seasons');
|
||||
if (godLvl === 1) failRateEgg *= 0.9;
|
||||
else if (godLvl === 2) failRateEgg *= 0.95;
|
||||
else if (godLvl === 3) failRateEgg *= 0.97;
|
||||
}
|
||||
// Calculations courtesy of @svschouw, at https://github.com/Aktanusa/CookieMonster/issues/25
|
||||
const succesRateEgg = 1 - failRateEgg;
|
||||
const obtainedEggs = Game.eggDrops.length - missingNormalEggs.length;
|
||||
const obtainedRareEggs =
|
||||
Game.rareEggDrops.length - missingRareEggs.length;
|
||||
const pNormal1 =
|
||||
succesRateEgg * 0.9 * (1 - obtainedEggs / Game.eggDrops.length);
|
||||
const pRare1 =
|
||||
succesRateEgg *
|
||||
0.1 *
|
||||
(1 - obtainedRareEggs / Game.rareEggDrops.length);
|
||||
const pRedropNormal =
|
||||
succesRateEgg * 0.9 * (obtainedEggs / Game.eggDrops.length);
|
||||
const pRedropRare =
|
||||
succesRateEgg * 0.1 * (obtainedRareEggs / Game.rareEggDrops.length);
|
||||
const pRedrop = pRedropNormal + pRedropRare;
|
||||
const pNormal2 =
|
||||
pRedrop * 0.9 * (1 - obtainedEggs / Game.eggDrops.length);
|
||||
const pRare2 =
|
||||
pRedrop * 0.1 * (1 - obtainedRareEggs / Game.rareEggDrops.length);
|
||||
return [pNormal1 + pNormal2, pRare1 + pRare2];
|
||||
};
|
||||
if (missingNormalEggs.length !== 0) {
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Normal easter eggs left to unlock',
|
||||
StatsMissDisp(missingNormalEggs),
|
||||
),
|
||||
);
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Chance of receiving an egg from wrinkler/golden cookie',
|
||||
document.createTextNode(
|
||||
`${Beautify(dropRateEgg(0.98)[0] * 100)}% / ${Beautify(
|
||||
dropRateEgg(0.9)[0] * 100,
|
||||
)}%`,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (missingRareEggs.length !== 0) {
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Rare easter eggs left to unlock',
|
||||
StatsMissDisp(missingRareEggs),
|
||||
),
|
||||
);
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Chance of receiving a rare egg from wrinkler/golden cookie',
|
||||
document.createTextNode(
|
||||
`${Beautify(dropRateEgg(0.98)[1] * 100)}% / ${Beautify(
|
||||
dropRateEgg(0.9)[1] * 100,
|
||||
)}%`,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (missingPlantDrops.length !== 0) {
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Rare plant drops left to unlock',
|
||||
StatsMissDisp(missingPlantDrops),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (Game.season === 'christmas')
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Reindeer reward',
|
||||
document.createTextNode(Beautify(CacheSeaSpec)),
|
||||
),
|
||||
);
|
||||
if (choEgg) {
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'withTooltip',
|
||||
'Chocolate egg cookies',
|
||||
document.createTextNode(Beautify(CacheLastChoEgg)),
|
||||
'ChoEggTooltipPlaceholder',
|
||||
),
|
||||
);
|
||||
}
|
||||
if (centEgg) {
|
||||
section.appendChild(
|
||||
StatsListing(
|
||||
'basic',
|
||||
'Century egg multiplier',
|
||||
document.createTextNode(
|
||||
`${Math.round((CacheCentEgg - 1) * 10000) / 100}%`,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return section;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import Config from '../../Data/SettingsData';
|
||||
import ConfigDefault from '../../Data/SettingsDefault';
|
||||
import RefreshScale from '../HelperFunctions/RefreshScale';
|
||||
import UpdateColors from '../HelperFunctions/UpdateColors';
|
||||
import PlaySound from '../Notifications/Sound';
|
||||
import { Colors } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -110,6 +111,18 @@ function CreatePrefOption(config) {
|
||||
};
|
||||
volume.appendChild(slider);
|
||||
div.appendChild(volume);
|
||||
const a = document.createElement('a');
|
||||
a.className = 'option';
|
||||
a.onclick = function () {
|
||||
PlaySound(
|
||||
CMOptions[config.replace('Volume', 'SoundURL')],
|
||||
config.replace('Volume', 'Sound'),
|
||||
config,
|
||||
true,
|
||||
);
|
||||
};
|
||||
a.textContent = 'Test sound';
|
||||
div.appendChild(a);
|
||||
return div;
|
||||
}
|
||||
if (Config[config].type === 'url') {
|
||||
@@ -170,6 +183,7 @@ function CreatePrefOption(config) {
|
||||
SaveConfig();
|
||||
Game.UpdateMenu();
|
||||
};
|
||||
// eslint-disable-next-line no-new
|
||||
new JsColor(input, { hash: true, position: 'right', onInput: change });
|
||||
const label = document.createElement('label');
|
||||
label.textContent = Config.Colors.desc[Colors[i]];
|
||||
@@ -216,14 +230,14 @@ export default function AddMenuPref(title) {
|
||||
const frag = document.createDocumentFragment();
|
||||
frag.appendChild(title);
|
||||
|
||||
for (const group of Object.keys(ConfigGroups)) {
|
||||
Object.keys(ConfigGroups).forEach((group) => {
|
||||
const groupObject = CreatePrefHeader(group, ConfigGroups[group]); // (group, display-name of group)
|
||||
frag.appendChild(groupObject);
|
||||
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)) {
|
||||
Object.keys(ConfigGroupsNotification).forEach((subGroup) => {
|
||||
const subGroupObject = CreatePrefHeader(
|
||||
subGroup,
|
||||
ConfigGroupsNotification[subGroup],
|
||||
@@ -232,20 +246,20 @@ export default function AddMenuPref(title) {
|
||||
subGroupObject.style.opacity = '0.5';
|
||||
frag.appendChild(subGroupObject);
|
||||
if (CMOptions.Header[subGroup]) {
|
||||
for (const option in Config) {
|
||||
Object.keys(Config).forEach((option) => {
|
||||
if (Config[option].group === subGroup)
|
||||
frag.appendChild(CreatePrefOption(option));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
for (const option of Object.keys(Config)) {
|
||||
Object.keys(Config).forEach((option) => {
|
||||
if (Config[option].group === group)
|
||||
frag.appendChild(CreatePrefOption(option));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const resDef = document.createElement('div');
|
||||
resDef.className = 'listing';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { isInitializing } from '../../InitSaveLoad/Variables';
|
||||
* @param {string} title The title of the to-be created notifications
|
||||
* @param {string} message The text of the to-be created notifications
|
||||
*/
|
||||
export default function Notification(notifyConfig, title, message) {
|
||||
export default function CreateNotification(notifyConfig, title, message) {
|
||||
// The arguments check makes the sound not play upon initialization of the mod
|
||||
if (
|
||||
CMOptions[notifyConfig] === 1 &&
|
||||
@@ -18,6 +18,7 @@ export default function Notification(notifyConfig, title, message) {
|
||||
isInitializing === false
|
||||
) {
|
||||
const CookieIcon = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
||||
// eslint-disable-next-line no-new
|
||||
new Notification(title, { body: message, badge: CookieIcon });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,13 @@ import { isInitializing } from '../../InitSaveLoad/Variables';
|
||||
* @param {variable} url A variable that gives the url for the sound (e.g., CM.Options.GCSoundURL)
|
||||
* @param {string} sndConfig The setting in CM.Options that is checked before creating the sound
|
||||
* @param {string} volConfig The setting in CM.Options that is checked to determine volume
|
||||
* @param {bool} forced Whether the sound should play regardless of settings, used to test the sound
|
||||
*/
|
||||
export default function PlaySound(url, sndConfig, volConfig) {
|
||||
export default function PlaySound(url, sndConfig, volConfig, forced) {
|
||||
// The arguments check makes the sound not play upon initialization of the mod
|
||||
if (CMOptions[sndConfig] === 1 && isInitializing === false) {
|
||||
if ((CMOptions[sndConfig] === 1 || forced) && isInitializing === false) {
|
||||
// eslint-disable-next-line new-cap
|
||||
const sound = new realAudio(url);
|
||||
const sound = new Audio(url);
|
||||
if (CMOptions.GeneralSound)
|
||||
sound.volume = (CMOptions[volConfig] / 100) * (Game.volume / 100);
|
||||
else sound.volume = CMOptions[volConfig] / 100;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import {
|
||||
ColorTextPre,
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import * as UpdateTooltip from './UpdateTooltips';
|
||||
import UpdateTooltips, * as UpdateTooltip from './UpdateTooltips';
|
||||
import { TooltipCreateTooltipBox } from './CreateTooltip';
|
||||
import {
|
||||
Beautify,
|
||||
GetTimeColor,
|
||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||
import { TooltipName, TooltipType } from '../VariablesAndData';
|
||||
import {
|
||||
SimpleTooltipElements,
|
||||
TooltipName,
|
||||
TooltipType,
|
||||
} from '../VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||
|
||||
@@ -30,38 +34,7 @@ export function CreateSimpleTooltip(placeholder, text, minWidth) {
|
||||
div.textContent = text;
|
||||
desc.appendChild(div);
|
||||
Tooltip.appendChild(desc);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function updates the sections of the tooltips created by CookieMonster
|
||||
*/
|
||||
export function UpdateTooltips() {
|
||||
CopyData();
|
||||
if (l('tooltipAnchor').style.display !== 'none' && l('CMTooltipArea')) {
|
||||
l('CMTooltipArea').innerHTML = '';
|
||||
const tooltipBox = TooltipCreateTooltipBox();
|
||||
l('CMTooltipArea').appendChild(tooltipBox);
|
||||
|
||||
if (TooltipType === 'b') {
|
||||
UpdateTooltip.Building();
|
||||
} else if (TooltipType === 'u') {
|
||||
UpdateTooltip.Upgrade();
|
||||
} else if (TooltipType === 's') {
|
||||
UpdateTooltip.SugarLump();
|
||||
} else if (TooltipType === 'g') {
|
||||
UpdateTooltip.Grimoire();
|
||||
} else if (TooltipType === 'p') {
|
||||
UpdateTooltip.GardenPlots();
|
||||
} else if (TooltipType === 'ha') {
|
||||
UpdateTooltip.HarvestAll();
|
||||
}
|
||||
UpdateTooltip.Warnings();
|
||||
} else if (l('CMTooltipArea') === null) {
|
||||
// Remove warnings if its a basic tooltip
|
||||
if (l('CMDispTooltipWarningParent') !== null) {
|
||||
l('CMDispTooltipWarningParent').remove();
|
||||
}
|
||||
}
|
||||
SimpleTooltipElements[placeholder] = Tooltip;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,9 +114,16 @@ export function CreateTooltip(type, name) {
|
||||
name[0],
|
||||
name[1],
|
||||
)();
|
||||
// Garden plots
|
||||
// Harvest all button in garden
|
||||
else if (type === 'ha')
|
||||
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)(); // Harvest all button in garden
|
||||
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)();
|
||||
else if (type === 'wb') l('tooltip').innerHTML = '';
|
||||
else if (type === 'pag')
|
||||
l('tooltip').innerHTML = Game.Objects.Temple.minigame.godTooltip(name)();
|
||||
else if (type === 'pas')
|
||||
l('tooltip').innerHTML = Game.Objects.Temple.minigame.slotTooltip(
|
||||
name[0],
|
||||
)();
|
||||
|
||||
// Adds area for extra tooltip-sections
|
||||
if (
|
||||
@@ -152,7 +132,10 @@ export function CreateTooltip(type, name) {
|
||||
type === 's' ||
|
||||
type === 'g' ||
|
||||
(type === 'p' && !Game.keys[16]) ||
|
||||
type === 'ha'
|
||||
type === 'ha' ||
|
||||
type === 'wb' ||
|
||||
type === 'pag' ||
|
||||
(type === 'pas' && name[1] !== -1)
|
||||
) {
|
||||
const area = document.createElement('div');
|
||||
area.id = 'CMTooltipArea';
|
||||
|
||||
99
src/Disp/Tooltips/TypesOfTooltips/Building.js
Normal file
99
src/Disp/Tooltips/TypesOfTooltips/Building.js
Normal file
@@ -0,0 +1,99 @@
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
import {
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
CacheObjects100,
|
||||
} from '../../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||
import { SimObjects } from '../../../Sim/VariablesAndData';
|
||||
import {
|
||||
Beautify,
|
||||
FormatTime,
|
||||
GetTimeColor,
|
||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||
import {
|
||||
ColorTextPre,
|
||||
LastTargetTooltipBuilding,
|
||||
TooltipBonusIncome,
|
||||
TooltipName,
|
||||
TooltipPrice,
|
||||
} from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Building tooltips
|
||||
*/
|
||||
export default function Building() {
|
||||
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||
|
||||
let target;
|
||||
if (Game.buyMode === 1) {
|
||||
LastTargetTooltipBuilding = target;
|
||||
} else {
|
||||
target = LastTargetTooltipBuilding;
|
||||
}
|
||||
if (Game.buyBulk === 1) target = CacheObjects1;
|
||||
else if (Game.buyBulk === 10) target = CacheObjects10;
|
||||
else if (Game.buyBulk === 100) target = CacheObjects100;
|
||||
|
||||
TooltipPrice = Game.Objects[TooltipName].bulkPrice;
|
||||
TooltipBonusIncome = target[TooltipName].bonus;
|
||||
|
||||
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
||||
const increase = Math.round(
|
||||
(TooltipBonusIncome / Game.cookiesPs) * 10000,
|
||||
);
|
||||
if (Number.isFinite(increase) && increase !== 0) {
|
||||
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
||||
} else {
|
||||
l('CMTooltipIncome').textContent += ` (<0${
|
||||
CMOptions.ScaleSeparator ? ',' : '.'
|
||||
}01% of income)`;
|
||||
}
|
||||
l('CMTooltipBorder').className = ColorTextPre + target[TooltipName].color;
|
||||
if (CMOptions.PPDisplayTime)
|
||||
l('CMTooltipPP').textContent = FormatTime(target[TooltipName].pp);
|
||||
else l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
||||
l('CMTooltipPP').className = ColorTextPre + target[TooltipName].color;
|
||||
const timeColor = GetTimeColor(
|
||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
);
|
||||
l('CMTooltipTime').textContent = timeColor.text;
|
||||
if (
|
||||
timeColor.text === 'Done!' &&
|
||||
Game.cookies < target[TooltipName].price
|
||||
) {
|
||||
l('CMTooltipTime').textContent = `${timeColor.text} (with Wrink)`;
|
||||
} else l('CMTooltipTime').textContent = timeColor.text;
|
||||
l('CMTooltipTime').className = ColorTextPre + timeColor.color;
|
||||
}
|
||||
|
||||
// Add "production left till next achievement"-bar
|
||||
l('CMTooltipProductionHeader').style.display = 'none';
|
||||
l('CMTooltipTime').style.marginBottom = '0px';
|
||||
for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) {
|
||||
if (
|
||||
!Game.HasAchiev(
|
||||
Game.Objects[TooltipName].productionAchievs[i].achiev.name,
|
||||
)
|
||||
) {
|
||||
const nextProductionAchiev =
|
||||
Game.Objects[TooltipName].productionAchievs[i];
|
||||
l('CMTooltipTime').style.marginBottom = '4px';
|
||||
l('CMTooltipProductionHeader').style.display = '';
|
||||
l('CMTooltipProduction').className = `ProdAchievement${TooltipName}`;
|
||||
l('CMTooltipProduction').textContent = Beautify(
|
||||
nextProductionAchiev.pow - SimObjects[TooltipName].totalCookies,
|
||||
15,
|
||||
);
|
||||
l('CMTooltipProduction').style.color = 'white';
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
55
src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js
Normal file
55
src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js
Normal file
@@ -0,0 +1,55 @@
|
||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import { TooltipName } from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Garden plots tooltips
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
export default function GardenPlots() {
|
||||
const { minigame } = Game.Objects.Farm;
|
||||
if (
|
||||
CMOptions.TooltipPlots &&
|
||||
minigame.plot[TooltipName[1]][TooltipName[0]][0] !== 0
|
||||
) {
|
||||
const mature =
|
||||
minigame.plot[TooltipName[1]][TooltipName[0]][1] >
|
||||
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
||||
.matureBase;
|
||||
const plantName =
|
||||
minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1]
|
||||
.name;
|
||||
l('CMTooltipBorder').appendChild(
|
||||
Create.TooltipCreateHeader('Reward (Current / Maximum)'),
|
||||
);
|
||||
const reward = document.createElement('div');
|
||||
reward.id = 'CMTooltipPlantReward';
|
||||
l('CMTooltipBorder').appendChild(reward);
|
||||
if (plantName === 'Bakeberry') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature
|
||||
? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30))
|
||||
: '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 30)}`;
|
||||
} else if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature
|
||||
? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3))
|
||||
: '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 3)}`;
|
||||
} else if (plantName === 'Queenbeet') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature
|
||||
? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60))
|
||||
: '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 60)}`;
|
||||
} else if (plantName === 'Duketater') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature
|
||||
? Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120))
|
||||
: '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 120)}`;
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
80
src/Disp/Tooltips/TypesOfTooltips/Grimoire.js
Normal file
80
src/Disp/Tooltips/TypesOfTooltips/Grimoire.js
Normal file
@@ -0,0 +1,80 @@
|
||||
import { CacheNoGoldSwitchCookiesPS } from '../../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||
import {
|
||||
Beautify,
|
||||
GetTimeColor,
|
||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
|
||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||
import { ColorTextPre, TooltipName } from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Grimoire tooltips
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
export default function Grimoire() {
|
||||
const { minigame } = Game.Objects['Wizard tower'];
|
||||
const spellCost = minigame.getSpellCost(minigame.spellsById[TooltipName]);
|
||||
|
||||
if (CMOptions.TooltipGrim === 1 && spellCost <= minigame.magicM) {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
|
||||
// Time left till enough magic for spell
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Time Left'));
|
||||
const time = document.createElement('div');
|
||||
time.id = 'CMTooltipTime';
|
||||
tooltipBox.appendChild(time);
|
||||
const timeColor = GetTimeColor(
|
||||
CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, spellCost),
|
||||
);
|
||||
time.textContent = timeColor.text;
|
||||
time.className = ColorTextPre + timeColor.color;
|
||||
|
||||
// Time left untill magic spent is recovered
|
||||
if (spellCost <= minigame.magic) {
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Recover Time'));
|
||||
const recover = document.createElement('div');
|
||||
recover.id = 'CMTooltipRecover';
|
||||
tooltipBox.appendChild(recover);
|
||||
const recoverColor = GetTimeColor(
|
||||
CalculateGrimoireRefillTime(
|
||||
Math.max(0, minigame.magic - spellCost),
|
||||
minigame.magicM,
|
||||
minigame.magic,
|
||||
),
|
||||
);
|
||||
recover.textContent = recoverColor.text;
|
||||
recover.className = ColorTextPre + recoverColor.color;
|
||||
}
|
||||
|
||||
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
|
||||
if (TooltipName === '0') {
|
||||
tooltipBox.appendChild(
|
||||
Create.TooltipCreateHeader('Cookies to be gained/lost'),
|
||||
);
|
||||
const conjure = document.createElement('div');
|
||||
conjure.id = 'x';
|
||||
tooltipBox.appendChild(conjure);
|
||||
const reward = document.createElement('span');
|
||||
reward.style.color = '#33FF00';
|
||||
reward.textContent = Beautify(
|
||||
Math.min(
|
||||
(Game.cookies + GetWrinkConfigBank()) * 0.15,
|
||||
CacheNoGoldSwitchCookiesPS * 60 * 30,
|
||||
),
|
||||
2,
|
||||
);
|
||||
conjure.appendChild(reward);
|
||||
const seperator = document.createElement('span');
|
||||
seperator.textContent = ' / ';
|
||||
conjure.appendChild(seperator);
|
||||
const loss = document.createElement('span');
|
||||
loss.style.color = 'red';
|
||||
loss.textContent = Beautify(CacheNoGoldSwitchCookiesPS * 60 * 15, 2);
|
||||
conjure.appendChild(loss);
|
||||
}
|
||||
|
||||
l('CMTooltipArea').appendChild(tooltipBox);
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
57
src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js
Normal file
57
src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js
Normal file
@@ -0,0 +1,57 @@
|
||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import * as Create from '../CreateTooltip';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Garden Harvest All tooltip
|
||||
* It is called when the Harvest All tooltip is created or refreshed by CM.Disp.UpdateTooltip()
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
export default function HarvestAll() {
|
||||
const { minigame } = Game.Objects.Farm;
|
||||
if (CMOptions.TooltipLump) {
|
||||
l('CMTooltipBorder').appendChild(
|
||||
Create.TooltipCreateHeader('Cookies gained from harvesting:'),
|
||||
);
|
||||
let totalGain = 0;
|
||||
let mortal = 0;
|
||||
if (Game.keys[16] && Game.keys[17]) mortal = 1;
|
||||
for (let y = 0; y < 6; y++) {
|
||||
for (let x = 0; x < 6; x++) {
|
||||
if (minigame.plot[y][x][0] >= 1) {
|
||||
const tile = minigame.plot[y][x];
|
||||
const me = minigame.plantsById[tile[0] - 1];
|
||||
const plantName = me.name;
|
||||
|
||||
let count = true;
|
||||
if (mortal && me.immortal) count = false;
|
||||
if (tile[1] < me.matureBase) count = false;
|
||||
if (count && plantName === 'Bakeberry') {
|
||||
totalGain += Math.min(
|
||||
Game.cookies * 0.03,
|
||||
Game.cookiesPs * 60 * 30,
|
||||
);
|
||||
} else if (
|
||||
(count && plantName === 'Chocoroot') ||
|
||||
plantName === 'White chocoroot'
|
||||
) {
|
||||
totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3);
|
||||
} else if (count && plantName === 'Queenbeet') {
|
||||
totalGain += Math.min(
|
||||
Game.cookies * 0.04,
|
||||
Game.cookiesPs * 60 * 60,
|
||||
);
|
||||
} else if (count && plantName === 'Duketater') {
|
||||
totalGain += Math.min(
|
||||
Game.cookies * 0.08,
|
||||
Game.cookiesPs * 60 * 120,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
l('CMTooltipBorder').appendChild(
|
||||
document.createTextNode(Beautify(totalGain)),
|
||||
);
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
76
src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js
Normal file
76
src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js
Normal file
@@ -0,0 +1,76 @@
|
||||
import { CacheGods } from '../../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||
import { Beautify } from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import { TooltipName, TooltipType } from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Pantheon Gods tooltip
|
||||
* It is called when the Harvest All tooltip is created or refreshed by CM.Disp.UpdateTooltip()
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
export default function PantheonGods() {
|
||||
if (CMOptions.TooltipPantheon === 1) {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
let GodID;
|
||||
if (TooltipType === 'pas') GodID = TooltipName[1];
|
||||
else GodID = TooltipName;
|
||||
|
||||
// Time left till enough magic for spell
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Effect in position 1:'));
|
||||
const cps1 = document.createElement('div');
|
||||
cps1.id = 'CMPantheonTooltipPosition1';
|
||||
if (CacheGods[GodID][0] !== 0) {
|
||||
cps1.textContent = Beautify(CacheGods[GodID][0]);
|
||||
const increase = Math.round(
|
||||
(CacheGods[GodID][0] / Game.cookiesPs) * 10000,
|
||||
);
|
||||
if (Number.isFinite(increase) && increase !== 0) {
|
||||
cps1.textContent += ` (${increase / 100}% of income)`;
|
||||
} else {
|
||||
cps1.textContent += ` (<0${
|
||||
CMOptions.ScaleSeparator ? ',' : '.'
|
||||
}01% of income)`;
|
||||
}
|
||||
} else cps1.textContent = 'No effect to CPS';
|
||||
tooltipBox.appendChild(cps1);
|
||||
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Effect in position 2:'));
|
||||
const cps2 = document.createElement('div');
|
||||
cps2.id = 'CMPantheonTooltipPosition2';
|
||||
if (CacheGods[GodID][1] !== 0) {
|
||||
cps2.textContent = Beautify(CacheGods[GodID][1]);
|
||||
const increase = Math.round(
|
||||
(CacheGods[GodID][1] / Game.cookiesPs) * 10000,
|
||||
);
|
||||
if (Number.isFinite(increase) && increase !== 0) {
|
||||
cps2.textContent += ` (${increase / 100}% of income)`;
|
||||
} else {
|
||||
cps2.textContent += ` (<0${
|
||||
CMOptions.ScaleSeparator ? ',' : '.'
|
||||
}01% of income)`;
|
||||
}
|
||||
} else cps2.textContent = 'No effect to CPS';
|
||||
tooltipBox.appendChild(cps2);
|
||||
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Effect in position 3:'));
|
||||
const cps3 = document.createElement('div');
|
||||
cps3.id = 'CMPantheonTooltipPosition2';
|
||||
if (CacheGods[GodID][2] !== 0) {
|
||||
cps3.textContent = Beautify(CacheGods[GodID][2]);
|
||||
const increase = Math.round(
|
||||
(CacheGods[GodID][2] / Game.cookiesPs) * 10000,
|
||||
);
|
||||
if (Number.isFinite(increase) && increase !== 0) {
|
||||
cps3.textContent += ` (${increase / 100}% of income)`;
|
||||
} else {
|
||||
cps3.textContent += ` (<0${
|
||||
CMOptions.ScaleSeparator ? ',' : '.'
|
||||
}01% of income)`;
|
||||
}
|
||||
} else cps3.textContent = 'No effect to CPS';
|
||||
tooltipBox.appendChild(cps3);
|
||||
|
||||
l('CMTooltipArea').appendChild(tooltipBox);
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
22
src/Disp/Tooltips/TypesOfTooltips/SugarLump.js
Normal file
22
src/Disp/Tooltips/TypesOfTooltips/SugarLump.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||
import GetLumpColor from '../../HelperFunctions/GetLumpColor';
|
||||
import { ColorTextPre } from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
/**
|
||||
* This function adds extra info to the Sugar Lump tooltip
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
export default function SugarLump() {
|
||||
if (CMOptions.TooltipLump === 1) {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Current Sugar Lump'));
|
||||
|
||||
const lumpType = document.createElement('div');
|
||||
lumpType.id = 'CMTooltipTime';
|
||||
tooltipBox.appendChild(lumpType);
|
||||
const lumpColor = GetLumpColor(Game.lumpCurrentType);
|
||||
lumpType.textContent = lumpColor.text;
|
||||
lumpType.className = ColorTextPre + lumpColor.color;
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
114
src/Disp/Tooltips/TypesOfTooltips/Upgrade.js
Normal file
114
src/Disp/Tooltips/TypesOfTooltips/Upgrade.js
Normal file
@@ -0,0 +1,114 @@
|
||||
import {
|
||||
CacheLastChoEgg,
|
||||
CacheUpgrades,
|
||||
} from '../../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||
import {
|
||||
Beautify,
|
||||
FormatTime,
|
||||
GetTimeColor,
|
||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||
import {
|
||||
ColorTextPre,
|
||||
TooltipBonusIncome,
|
||||
TooltipBonusMouse,
|
||||
TooltipName,
|
||||
TooltipPrice,
|
||||
TooltipType,
|
||||
} from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Upgrade tooltips
|
||||
*/
|
||||
export default function Upgrade() {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||
|
||||
TooltipBonusIncome =
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonus;
|
||||
TooltipPrice = Game.Upgrades[
|
||||
Game.UpgradesInStore[TooltipName].name
|
||||
].getPrice();
|
||||
TooltipBonusMouse =
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonusMouse;
|
||||
|
||||
if (CMOptions.TooltipBuildUpgrade === 1) {
|
||||
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
||||
const increase = Math.round((TooltipBonusIncome / Game.cookiesPs) * 10000);
|
||||
// Don't display certain parts of tooltip if not applicable
|
||||
if (
|
||||
l('CMTooltipIncome').textContent === '0' &&
|
||||
(TooltipType === 'b' || TooltipType === 'u')
|
||||
) {
|
||||
l('Bonus IncomeTitle').style.display = 'none';
|
||||
l('CMTooltipIncome').style.display = 'none';
|
||||
l('Payback PeriodTitle').style.display = 'none';
|
||||
l('CMTooltipPP').style.display = 'none';
|
||||
} else {
|
||||
if (Number.isFinite(increase) && increase !== 0) {
|
||||
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
||||
} else {
|
||||
l('CMTooltipIncome').textContent += ` (<0${
|
||||
CMOptions.ScaleSeparator ? ',' : '.'
|
||||
}01% of income)`;
|
||||
}
|
||||
l('CMTooltipBorder').className =
|
||||
ColorTextPre +
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||
// If clicking power upgrade
|
||||
if (TooltipBonusMouse) {
|
||||
l('CMTooltipCookiePerClick').textContent = Beautify(TooltipBonusMouse);
|
||||
l('CMTooltipCookiePerClick').style.display = 'block';
|
||||
l('CMTooltipCookiePerClick').previousSibling.style.display = 'block';
|
||||
}
|
||||
// If only a clicking power upgrade change PP to click-based period
|
||||
if (TooltipBonusIncome === 0 && TooltipBonusMouse) {
|
||||
l('CMTooltipPP').textContent = `${Beautify(
|
||||
TooltipPrice / TooltipBonusMouse,
|
||||
)} Clicks`;
|
||||
l('CMTooltipPP').style.color = 'white';
|
||||
} else {
|
||||
if (CMOptions.PPDisplayTime)
|
||||
l('CMTooltipPP').textContent = FormatTime(
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||
);
|
||||
else
|
||||
l('CMTooltipPP').textContent = Beautify(
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||
2,
|
||||
);
|
||||
l('CMTooltipPP').className =
|
||||
ColorTextPre +
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||
}
|
||||
}
|
||||
const timeColor = GetTimeColor(
|
||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
);
|
||||
l('CMTooltipTime').textContent = timeColor.text;
|
||||
if (
|
||||
timeColor.text === 'Done!' &&
|
||||
Game.cookies < Game.UpgradesInStore[TooltipName].getPrice()
|
||||
) {
|
||||
l('CMTooltipTime').textContent = `${timeColor.text} (with Wrink)`;
|
||||
} else l('CMTooltipTime').textContent = timeColor.text;
|
||||
l('CMTooltipTime').className = ColorTextPre + timeColor.color;
|
||||
|
||||
// Add extra info to Chocolate egg tooltip
|
||||
if (Game.UpgradesInStore[TooltipName].name === 'Chocolate egg') {
|
||||
l('CMTooltipBorder').lastChild.style.marginBottom = '4px';
|
||||
l('CMTooltipBorder').appendChild(
|
||||
Create.TooltipCreateHeader('Cookies to be gained (Currently/Max)'),
|
||||
);
|
||||
const chocolate = document.createElement('div');
|
||||
chocolate.style.color = 'white';
|
||||
chocolate.textContent = `${Beautify(Game.cookies * 0.05)} / ${Beautify(
|
||||
CacheLastChoEgg,
|
||||
)}`;
|
||||
l('CMTooltipBorder').appendChild(chocolate);
|
||||
}
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
144
src/Disp/Tooltips/TypesOfTooltips/Warnings.js
Normal file
144
src/Disp/Tooltips/TypesOfTooltips/Warnings.js
Normal file
@@ -0,0 +1,144 @@
|
||||
import GetCPSBuffMult from '../../../Cache/CPS/GetCPSBuffMult';
|
||||
import { CacheEdifice, CacheLucky } from '../../../Cache/VariablesAndData';
|
||||
import ToggleToolWarnPos from '../../../Config/Toggles/ToggleToolWarnPos';
|
||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||
|
||||
import {
|
||||
Beautify,
|
||||
FormatTime,
|
||||
} from '../../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import GetCPS from '../../HelperFunctions/GetCPS';
|
||||
import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank';
|
||||
import {
|
||||
TooltipBonusIncome,
|
||||
TooltipPrice,
|
||||
TooltipType,
|
||||
} from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
|
||||
/**
|
||||
* This function updates the warnings section of the building and upgrade tooltips
|
||||
*/
|
||||
export default function Warnings() {
|
||||
if (TooltipType === 'b' || TooltipType === 'u') {
|
||||
if (document.getElementById('CMDispTooltipWarningParent') === null) {
|
||||
l('tooltipAnchor').appendChild(Create.TooltipCreateWarningSection());
|
||||
ToggleToolWarnPos();
|
||||
}
|
||||
|
||||
if (CMOptions.ToolWarnPos === 0)
|
||||
l('CMDispTooltipWarningParent').style.right = '0px';
|
||||
else
|
||||
l('CMDispTooltipWarningParent').style.top = `${
|
||||
l('tooltip').offsetHeight
|
||||
}px`;
|
||||
|
||||
l('CMDispTooltipWarningParent').style.width = `${
|
||||
l('tooltip').offsetWidth - 6
|
||||
}px`;
|
||||
|
||||
const amount = Game.cookies + GetWrinkConfigBank() - TooltipPrice;
|
||||
const bonusIncomeUsed = CMOptions.ToolWarnBon ? TooltipBonusIncome : 0;
|
||||
let limitLucky = CacheLucky;
|
||||
if (CMOptions.ToolWarnBon === 1) {
|
||||
let bonusNoFren = TooltipBonusIncome;
|
||||
bonusNoFren /= GetCPSBuffMult();
|
||||
limitLucky += (bonusNoFren * 60 * 15) / 0.15;
|
||||
}
|
||||
|
||||
if (CMOptions.ToolWarnLucky === 1) {
|
||||
if (amount < limitLucky && (TooltipType !== 'b' || Game.buyMode === 1)) {
|
||||
l('CMDispTooltipWarnLucky').style.display = '';
|
||||
l('CMDispTooltipWarnLuckyText').textContent = `${Beautify(
|
||||
limitLucky - amount,
|
||||
)} (${FormatTime(
|
||||
(limitLucky - amount) / (GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnLucky').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnLucky').style.display = 'none';
|
||||
|
||||
if (CMOptions.ToolWarnLuckyFrenzy === 1) {
|
||||
const limitLuckyFrenzy = limitLucky * 7;
|
||||
if (
|
||||
amount < limitLuckyFrenzy &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnLuckyFrenzy').style.display = '';
|
||||
l('CMDispTooltipWarnLuckyFrenzyText').textContent = `${Beautify(
|
||||
limitLuckyFrenzy - amount,
|
||||
)} (${FormatTime(
|
||||
(limitLuckyFrenzy - amount) / (GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none';
|
||||
|
||||
if (CMOptions.ToolWarnConjure === 1) {
|
||||
const limitConjure = limitLucky * 2;
|
||||
if (
|
||||
amount < limitConjure &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnConjure').style.display = '';
|
||||
l('CMDispTooltipWarnConjureText').textContent = `${Beautify(
|
||||
limitConjure - amount,
|
||||
)} (${FormatTime(
|
||||
(limitConjure - amount) / (GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnConjure').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnConjure').style.display = 'none';
|
||||
|
||||
if (CMOptions.ToolWarnConjureFrenzy === 1) {
|
||||
const limitConjureFrenzy = limitLucky * 2 * 7;
|
||||
if (
|
||||
amount < limitConjureFrenzy &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnConjureFrenzy').style.display = '';
|
||||
l('CMDispTooltipWarnConjureFrenzyText').textContent = `${Beautify(
|
||||
limitConjureFrenzy - amount,
|
||||
)} (${FormatTime(
|
||||
(limitConjureFrenzy - amount) / (GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none';
|
||||
|
||||
if (
|
||||
CMOptions.ToolWarnEdifice === 1 &&
|
||||
Game.Objects['Wizard tower'].minigameLoaded
|
||||
) {
|
||||
if (
|
||||
CacheEdifice &&
|
||||
amount < CacheEdifice &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnEdifice').style.display = '';
|
||||
l('CMDispTooltipWarnEdificeText').textContent = `${Beautify(
|
||||
CacheEdifice - amount,
|
||||
)} (${FormatTime(
|
||||
(CacheEdifice - amount) / (GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnEdifice').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnEdifice').style.display = 'none';
|
||||
|
||||
if (CMOptions.ToolWarnUser > 0) {
|
||||
if (
|
||||
amount < CMOptions.ToolWarnUser * GetCPS() &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnUser').style.display = '';
|
||||
// Need to update tooltip text dynamically
|
||||
l(
|
||||
'CMDispTooltipWarnUser',
|
||||
).children[0].textContent = `Purchase of this item will put you under the number of Cookies equal to ${CMOptions.ToolWarnUser} seconds of CPS`;
|
||||
l('CMDispTooltipWarnUserText').textContent = `${Beautify(
|
||||
CMOptions.ToolWarnUser * GetCPS() - amount,
|
||||
)} (${FormatTime(
|
||||
(CMOptions.ToolWarnUser * GetCPS() - amount) /
|
||||
(GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnUser').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnUser').style.display = 'none';
|
||||
} else if (l('CMDispTooltipWarningParent') !== null) {
|
||||
l('CMDispTooltipWarningParent').remove();
|
||||
}
|
||||
}
|
||||
25
src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js
Normal file
25
src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import {
|
||||
CacheWrinklersFattest,
|
||||
CacheWrinklersTotal,
|
||||
} from '../../../Cache/VariablesAndData';
|
||||
import { TooltipName } from '../../VariablesAndData';
|
||||
import * as Create from '../CreateTooltip';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the wrinkler button tooltip
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
export default function WrinklerButton() {
|
||||
l('tooltip').innerHTML = '';
|
||||
l('tooltip').appendChild(Create.TooltipCreateHeader('Reward:'));
|
||||
|
||||
const WrinklerReward = document.createElement('div');
|
||||
WrinklerReward.id = 'CMWrinklerReward';
|
||||
if (TooltipName === 'PopAll') {
|
||||
WrinklerReward.textContent = CacheWrinklersTotal;
|
||||
} else if (TooltipName === 'PopFattest') {
|
||||
WrinklerReward.textContent = CacheWrinklersFattest[0];
|
||||
}
|
||||
|
||||
l('tooltip').appendChild(WrinklerReward);
|
||||
}
|
||||
@@ -1,519 +1,51 @@
|
||||
import GetCPSBuffMult from '../../Cache/CPS/GetCPSBuffMult';
|
||||
import {
|
||||
CacheEdifice,
|
||||
CacheLastChoEgg,
|
||||
CacheLucky,
|
||||
CacheNoGoldSwitchCookiesPS,
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
CacheObjects100,
|
||||
CacheUpgrades,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import ToggleToolWarnPos from '../../Config/Toggles/ToggleToolWarnPos';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||
import {
|
||||
Beautify,
|
||||
FormatTime,
|
||||
GetTimeColor,
|
||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import CalculateGrimoireRefillTime from '../HelperFunctions/CalculateGrimoireRefillTime';
|
||||
import GetCPS from '../HelperFunctions/GetCPS';
|
||||
import GetLumpColor from '../HelperFunctions/GetLumpColor';
|
||||
import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank';
|
||||
import {
|
||||
ColorTextPre,
|
||||
LastTargetTooltipBuilding,
|
||||
TooltipBonusIncome,
|
||||
TooltipBonusMouse,
|
||||
TooltipName,
|
||||
TooltipPrice,
|
||||
TooltipType,
|
||||
} from '../VariablesAndData';
|
||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||
import { TooltipName, TooltipType } from '../VariablesAndData';
|
||||
import * as Create from './CreateTooltip';
|
||||
|
||||
/** Functions that update specific types of tooltips */
|
||||
import Building from './TypesOfTooltips/Building';
|
||||
import GardenPlots from './TypesOfTooltips/GardenPlots';
|
||||
import Grimoire from './TypesOfTooltips/Grimoire';
|
||||
import HarvestAll from './TypesOfTooltips/HarvestAll';
|
||||
import PantheonGods from './TypesOfTooltips/PantheonGods';
|
||||
import SugarLump from './TypesOfTooltips/SugarLump';
|
||||
import Upgrade from './TypesOfTooltips/Upgrade';
|
||||
import Warnings from './TypesOfTooltips/Warnings';
|
||||
import WrinklerButton from './TypesOfTooltips/WrinklerButton';
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Building tooltips
|
||||
* This function updates the sections of the tooltips created by CookieMonster
|
||||
*/
|
||||
export function Building() {
|
||||
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||
|
||||
let target;
|
||||
if (Game.buyMode === 1) {
|
||||
LastTargetTooltipBuilding = target;
|
||||
} else {
|
||||
target = LastTargetTooltipBuilding;
|
||||
}
|
||||
if (Game.buyBulk === 1) target = CacheObjects1;
|
||||
else if (Game.buyBulk === 10) target = CacheObjects10;
|
||||
else if (Game.buyBulk === 100) target = CacheObjects100;
|
||||
|
||||
TooltipPrice = Game.Objects[TooltipName].bulkPrice;
|
||||
TooltipBonusIncome = target[TooltipName].bonus;
|
||||
|
||||
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
||||
const increase = Math.round(
|
||||
(TooltipBonusIncome / Game.cookiesPs) * 10000,
|
||||
);
|
||||
if (Number.isFinite(increase) && increase !== 0) {
|
||||
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
||||
} else {
|
||||
l('CMTooltipIncome').textContent += ` (<0${
|
||||
CMOptions.ScaleSeparator ? ',' : '.'
|
||||
}01% of income)`;
|
||||
}
|
||||
l('CMTooltipBorder').className = ColorTextPre + target[TooltipName].color;
|
||||
l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
||||
l('CMTooltipPP').className = ColorTextPre + target[TooltipName].color;
|
||||
const timeColor = GetTimeColor(
|
||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
);
|
||||
l('CMTooltipTime').textContent = timeColor.text;
|
||||
if (
|
||||
timeColor.text === 'Done!' &&
|
||||
Game.cookies < target[TooltipName].price
|
||||
) {
|
||||
l('CMTooltipTime').textContent = `${timeColor.text} (with Wrink)`;
|
||||
} else l('CMTooltipTime').textContent = timeColor.text;
|
||||
l('CMTooltipTime').className = ColorTextPre + timeColor.color;
|
||||
}
|
||||
|
||||
// Add "production left till next achievement"-bar
|
||||
l('CMTooltipProductionHeader').style.display = 'none';
|
||||
l('CMTooltipTime').style.marginBottom = '0px';
|
||||
for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) {
|
||||
if (
|
||||
!Game.HasAchiev(
|
||||
Game.Objects[TooltipName].productionAchievs[i].achiev.name,
|
||||
)
|
||||
) {
|
||||
const nextProductionAchiev =
|
||||
Game.Objects[TooltipName].productionAchievs[i];
|
||||
l('CMTooltipTime').style.marginBottom = '4px';
|
||||
l('CMTooltipProductionHeader').style.display = '';
|
||||
l('CMTooltipProduction').className = `ProdAchievement${TooltipName}`;
|
||||
l('CMTooltipProduction').textContent = Beautify(
|
||||
nextProductionAchiev.pow - SimObjects[TooltipName].totalCookies,
|
||||
15,
|
||||
);
|
||||
l('CMTooltipProduction').style.color = 'white';
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Upgrade tooltips
|
||||
*/
|
||||
export function Upgrade() {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||
|
||||
TooltipBonusIncome =
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonus;
|
||||
TooltipPrice = Game.Upgrades[
|
||||
Game.UpgradesInStore[TooltipName].name
|
||||
].getPrice();
|
||||
TooltipBonusMouse =
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonusMouse;
|
||||
|
||||
if (CMOptions.TooltipBuildUpgrade === 1) {
|
||||
l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2);
|
||||
const increase = Math.round((TooltipBonusIncome / Game.cookiesPs) * 10000);
|
||||
// Don't display certain parts of tooltip if not applicable
|
||||
if (
|
||||
l('CMTooltipIncome').textContent === '0' &&
|
||||
(TooltipType === 'b' || TooltipType === 'u')
|
||||
) {
|
||||
l('Bonus IncomeTitle').style.display = 'none';
|
||||
l('CMTooltipIncome').style.display = 'none';
|
||||
l('Payback PeriodTitle').style.display = 'none';
|
||||
l('CMTooltipPP').style.display = 'none';
|
||||
} else {
|
||||
if (Number.isFinite(increase) && increase !== 0) {
|
||||
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
||||
} else {
|
||||
l('CMTooltipIncome').textContent += ` (<0${
|
||||
CMOptions.ScaleSeparator ? ',' : '.'
|
||||
}01% of income)`;
|
||||
}
|
||||
l('CMTooltipBorder').className =
|
||||
ColorTextPre +
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||
// If clicking power upgrade
|
||||
if (TooltipBonusMouse) {
|
||||
l('CMTooltipCookiePerClick').textContent = Beautify(TooltipBonusMouse);
|
||||
l('CMTooltipCookiePerClick').style.display = 'block';
|
||||
l('CMTooltipCookiePerClick').previousSibling.style.display = 'block';
|
||||
}
|
||||
// If only a clicking power upgrade change PP to click-based period
|
||||
if (TooltipBonusIncome === 0 && TooltipBonusMouse) {
|
||||
l('CMTooltipPP').textContent = `${Beautify(
|
||||
TooltipPrice / TooltipBonusMouse,
|
||||
)} Clicks`;
|
||||
l('CMTooltipPP').style.color = 'white';
|
||||
} else {
|
||||
l('CMTooltipPP').textContent = Beautify(
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].pp,
|
||||
2,
|
||||
);
|
||||
l('CMTooltipPP').className =
|
||||
ColorTextPre +
|
||||
CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color;
|
||||
}
|
||||
}
|
||||
const timeColor = GetTimeColor(
|
||||
(TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(),
|
||||
);
|
||||
l('CMTooltipTime').textContent = timeColor.text;
|
||||
if (
|
||||
timeColor.text === 'Done!' &&
|
||||
Game.cookies < Game.UpgradesInStore[TooltipName].getPrice()
|
||||
) {
|
||||
l('CMTooltipTime').textContent = `${timeColor.text} (with Wrink)`;
|
||||
} else l('CMTooltipTime').textContent = timeColor.text;
|
||||
l('CMTooltipTime').className = ColorTextPre + timeColor.color;
|
||||
|
||||
// Add extra info to Chocolate egg tooltip
|
||||
if (Game.UpgradesInStore[TooltipName].name === 'Chocolate egg') {
|
||||
l('CMTooltipBorder').lastChild.style.marginBottom = '4px';
|
||||
l('CMTooltipBorder').appendChild(
|
||||
Create.TooltipCreateHeader('Cookies to be gained (Currently/Max)'),
|
||||
);
|
||||
const chocolate = document.createElement('div');
|
||||
chocolate.style.color = 'white';
|
||||
chocolate.textContent = `${Beautify(Game.cookies * 0.05)} / ${Beautify(
|
||||
CacheLastChoEgg,
|
||||
)}`;
|
||||
l('CMTooltipBorder').appendChild(chocolate);
|
||||
}
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Sugar Lump tooltip
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
export function SugarLump() {
|
||||
if (CMOptions.TooltipLump === 1) {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Current Sugar Lump'));
|
||||
|
||||
const lumpType = document.createElement('div');
|
||||
lumpType.id = 'CMTooltipTime';
|
||||
tooltipBox.appendChild(lumpType);
|
||||
const lumpColor = GetLumpColor(Game.lumpCurrentType);
|
||||
lumpType.textContent = lumpColor.text;
|
||||
lumpType.className = ColorTextPre + lumpColor.color;
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Grimoire tooltips
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
export function Grimoire() {
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
const spellCost = minigame.getSpellCost(minigame.spellsById[TooltipName]);
|
||||
|
||||
if (CMOptions.TooltipGrim === 1 && spellCost <= minigame.magicM) {
|
||||
const tooltipBox = l('CMTooltipBorder');
|
||||
|
||||
// Time left till enough magic for spell
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Time Left'));
|
||||
const time = document.createElement('div');
|
||||
time.id = 'CMTooltipTime';
|
||||
tooltipBox.appendChild(time);
|
||||
const timeColor = GetTimeColor(
|
||||
CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, spellCost),
|
||||
);
|
||||
time.textContent = timeColor.text;
|
||||
time.className = ColorTextPre + timeColor.color;
|
||||
|
||||
// Time left untill magic spent is recovered
|
||||
if (spellCost <= minigame.magic) {
|
||||
tooltipBox.appendChild(Create.TooltipCreateHeader('Recover Time'));
|
||||
const recover = document.createElement('div');
|
||||
recover.id = 'CMTooltipRecover';
|
||||
tooltipBox.appendChild(recover);
|
||||
const recoverColor = GetTimeColor(
|
||||
CalculateGrimoireRefillTime(
|
||||
Math.max(0, minigame.magic - spellCost),
|
||||
minigame.magicM,
|
||||
minigame.magic,
|
||||
),
|
||||
);
|
||||
recover.textContent = recoverColor.text;
|
||||
recover.className = ColorTextPre + recoverColor.color;
|
||||
}
|
||||
|
||||
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
|
||||
if (TooltipName === '0') {
|
||||
tooltipBox.appendChild(
|
||||
Create.TooltipCreateHeader('Cookies to be gained/lost'),
|
||||
);
|
||||
const conjure = document.createElement('div');
|
||||
conjure.id = 'x';
|
||||
tooltipBox.appendChild(conjure);
|
||||
const reward = document.createElement('span');
|
||||
reward.style.color = '#33FF00';
|
||||
reward.textContent = Beautify(
|
||||
Math.min(
|
||||
(Game.cookies + GetWrinkConfigBank()) * 0.15,
|
||||
CacheNoGoldSwitchCookiesPS * 60 * 30,
|
||||
),
|
||||
2,
|
||||
);
|
||||
conjure.appendChild(reward);
|
||||
const seperator = document.createElement('span');
|
||||
seperator.textContent = ' / ';
|
||||
conjure.appendChild(seperator);
|
||||
const loss = document.createElement('span');
|
||||
loss.style.color = 'red';
|
||||
loss.textContent = Beautify(CacheNoGoldSwitchCookiesPS * 60 * 15, 2);
|
||||
conjure.appendChild(loss);
|
||||
}
|
||||
|
||||
export default function UpdateTooltips() {
|
||||
CopyData();
|
||||
if (l('tooltipAnchor').style.display !== 'none' && l('CMTooltipArea')) {
|
||||
l('CMTooltipArea').innerHTML = '';
|
||||
const tooltipBox = Create.TooltipCreateTooltipBox();
|
||||
l('CMTooltipArea').appendChild(tooltipBox);
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Garden plots tooltips
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
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)'),
|
||||
);
|
||||
const reward = document.createElement('div');
|
||||
reward.id = 'CMTooltipPlantReward';
|
||||
l('CMTooltipBorder').appendChild(reward);
|
||||
if (plantName === 'Bakeberry') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature
|
||||
? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30))
|
||||
: '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 30)}`;
|
||||
} else if (plantName === 'Chocoroot' || plantName === 'White chocoroot') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature
|
||||
? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3))
|
||||
: '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 3)}`;
|
||||
} else if (plantName === 'Queenbeet') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature
|
||||
? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60))
|
||||
: '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 60)}`;
|
||||
} else if (plantName === 'Duketater') {
|
||||
l('CMTooltipPlantReward').textContent = `${
|
||||
mature
|
||||
? Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120))
|
||||
: '0'
|
||||
} / ${Beautify(Game.cookiesPs * 60 * 120)}`;
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* This function adds extra info to the Garden Harvest All tooltip
|
||||
* It is called when the Harvest All tooltip is created or refreshed by CM.Disp.UpdateTooltip()
|
||||
* It adds to the additional information to l('CMTooltipArea')
|
||||
*/
|
||||
export function HarvestAll() {
|
||||
const minigame = Game.Objects.Farm.minigame;
|
||||
if (CMOptions.TooltipLump) {
|
||||
l('CMTooltipBorder').appendChild(
|
||||
Create.TooltipCreateHeader('Cookies gained from harvesting:'),
|
||||
);
|
||||
let totalGain = 0;
|
||||
let mortal = 0;
|
||||
if (Game.keys[16] && Game.keys[17]) mortal = 1;
|
||||
for (let y = 0; y < 6; y++) {
|
||||
for (let x = 0; x < 6; x++) {
|
||||
if (minigame.plot[y][x][0] >= 1) {
|
||||
const tile = minigame.plot[y][x];
|
||||
const me = minigame.plantsById[tile[0] - 1];
|
||||
const plantName = me.name;
|
||||
|
||||
let count = true;
|
||||
if (mortal && me.immortal) count = false;
|
||||
if (tile[1] < me.matureBase) count = false;
|
||||
if (count && plantName === 'Bakeberry') {
|
||||
totalGain += Math.min(
|
||||
Game.cookies * 0.03,
|
||||
Game.cookiesPs * 60 * 30,
|
||||
);
|
||||
if (TooltipType === 'b') {
|
||||
Building();
|
||||
} else if (TooltipType === 'u') {
|
||||
Upgrade();
|
||||
} else if (TooltipType === 's') {
|
||||
SugarLump();
|
||||
} else if (TooltipType === 'g') {
|
||||
Grimoire();
|
||||
} else if (TooltipType === 'p') {
|
||||
GardenPlots();
|
||||
} else if (TooltipType === 'ha') {
|
||||
HarvestAll();
|
||||
} else if (TooltipType === 'wb') {
|
||||
WrinklerButton();
|
||||
} else if (
|
||||
(count && plantName === 'Chocoroot') ||
|
||||
plantName === 'White chocoroot'
|
||||
TooltipType === 'pag' ||
|
||||
(TooltipType === 'pas' && TooltipName[1] !== -1)
|
||||
) {
|
||||
totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3);
|
||||
} else if (count && plantName === 'Queenbeet') {
|
||||
totalGain += Math.min(
|
||||
Game.cookies * 0.04,
|
||||
Game.cookiesPs * 60 * 60,
|
||||
);
|
||||
} else if (count && plantName === 'Duketater') {
|
||||
totalGain += Math.min(
|
||||
Game.cookies * 0.08,
|
||||
Game.cookiesPs * 60 * 120,
|
||||
);
|
||||
PantheonGods();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
l('CMTooltipBorder').appendChild(
|
||||
document.createTextNode(Beautify(totalGain)),
|
||||
);
|
||||
} else l('CMTooltipArea').style.display = 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* This function updates the warnings section of the building and upgrade tooltips
|
||||
* It is called by CM.Disp.UpdateTooltip()
|
||||
*/
|
||||
export function Warnings() {
|
||||
if (TooltipType === 'b' || TooltipType === 'u') {
|
||||
if (document.getElementById('CMDispTooltipWarningParent') === null) {
|
||||
l('tooltipAnchor').appendChild(Create.TooltipCreateWarningSection());
|
||||
ToggleToolWarnPos();
|
||||
}
|
||||
|
||||
if (CMOptions.ToolWarnPos === 0)
|
||||
l('CMDispTooltipWarningParent').style.right = '0px';
|
||||
else
|
||||
l('CMDispTooltipWarningParent').style.top = `${
|
||||
l('tooltip').offsetHeight
|
||||
}px`;
|
||||
|
||||
l('CMDispTooltipWarningParent').style.width = `${
|
||||
l('tooltip').offsetWidth - 6
|
||||
}px`;
|
||||
|
||||
const amount = Game.cookies + GetWrinkConfigBank() - TooltipPrice;
|
||||
const bonusIncomeUsed = CMOptions.ToolWarnBon ? TooltipBonusIncome : 0;
|
||||
let limitLucky = CacheLucky;
|
||||
if (CMOptions.ToolWarnBon === 1) {
|
||||
let bonusNoFren = TooltipBonusIncome;
|
||||
bonusNoFren /= GetCPSBuffMult();
|
||||
limitLucky += (bonusNoFren * 60 * 15) / 0.15;
|
||||
}
|
||||
|
||||
if (CMOptions.ToolWarnLucky === 1) {
|
||||
if (amount < limitLucky && (TooltipType !== 'b' || Game.buyMode === 1)) {
|
||||
l('CMDispTooltipWarnLucky').style.display = '';
|
||||
l('CMDispTooltipWarnLuckyText').textContent = `${Beautify(
|
||||
limitLucky - amount,
|
||||
)} (${FormatTime(
|
||||
(limitLucky - amount) / (GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnLucky').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnLucky').style.display = 'none';
|
||||
|
||||
if (CMOptions.ToolWarnLuckyFrenzy === 1) {
|
||||
const limitLuckyFrenzy = limitLucky * 7;
|
||||
if (
|
||||
amount < limitLuckyFrenzy &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnLuckyFrenzy').style.display = '';
|
||||
l('CMDispTooltipWarnLuckyFrenzyText').textContent = `${Beautify(
|
||||
limitLuckyFrenzy - amount,
|
||||
)} (${FormatTime(
|
||||
(limitLuckyFrenzy - amount) / (GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none';
|
||||
|
||||
if (CMOptions.ToolWarnConjure === 1) {
|
||||
const limitConjure = limitLucky * 2;
|
||||
if (
|
||||
amount < limitConjure &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnConjure').style.display = '';
|
||||
l('CMDispTooltipWarnConjureText').textContent = `${Beautify(
|
||||
limitConjure - amount,
|
||||
)} (${FormatTime(
|
||||
(limitConjure - amount) / (GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnConjure').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnConjure').style.display = 'none';
|
||||
|
||||
if (CMOptions.ToolWarnConjureFrenzy === 1) {
|
||||
const limitConjureFrenzy = limitLucky * 2 * 7;
|
||||
if (
|
||||
amount < limitConjureFrenzy &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnConjureFrenzy').style.display = '';
|
||||
l('CMDispTooltipWarnConjureFrenzyText').textContent = `${Beautify(
|
||||
limitConjureFrenzy - amount,
|
||||
)} (${FormatTime(
|
||||
(limitConjureFrenzy - amount) / (GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none';
|
||||
|
||||
if (
|
||||
CMOptions.ToolWarnEdifice === 1 &&
|
||||
Game.Objects['Wizard tower'].minigameLoaded
|
||||
) {
|
||||
if (
|
||||
CacheEdifice &&
|
||||
amount < CacheEdifice &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnEdifice').style.display = '';
|
||||
l('CMDispTooltipWarnEdificeText').textContent = `${Beautify(
|
||||
CacheEdifice - amount,
|
||||
)} (${FormatTime(
|
||||
(CacheEdifice - amount) / (GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnEdifice').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnEdifice').style.display = 'none';
|
||||
|
||||
if (CMOptions.ToolWarnUser > 0) {
|
||||
if (
|
||||
amount < CMOptions.ToolWarnUser * GetCPS() &&
|
||||
(TooltipType !== 'b' || Game.buyMode === 1)
|
||||
) {
|
||||
l('CMDispTooltipWarnUser').style.display = '';
|
||||
// Need to update tooltip text dynamically
|
||||
l(
|
||||
'CMDispTooltipWarnUser',
|
||||
).children[0].textContent = `Purchase of this item will put you under the number of Cookies equal to ${CMOptions.ToolWarnUser} seconds of CPS`;
|
||||
l('CMDispTooltipWarnUserText').textContent = `${Beautify(
|
||||
CMOptions.ToolWarnUser * GetCPS() - amount,
|
||||
)} (${FormatTime(
|
||||
(CMOptions.ToolWarnUser * GetCPS() - amount) /
|
||||
(GetCPS() + bonusIncomeUsed),
|
||||
)})`;
|
||||
} else l('CMDispTooltipWarnUser').style.display = 'none';
|
||||
} else l('CMDispTooltipWarnUser').style.display = 'none';
|
||||
} else if (l('CMDispTooltipWarningParent') !== null) {
|
||||
Warnings();
|
||||
} else if (l('CMTooltipArea') === null) {
|
||||
// Remove warnings if its a basic tooltip
|
||||
if (l('CMDispTooltipWarningParent') !== null) {
|
||||
l('CMDispTooltipWarningParent').remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export function CheckWrinklerTooltip() {
|
||||
if (CMOptions.TooltipWrink === 1 && TooltipWrinklerArea === 1) {
|
||||
// Latter is set by CM.Main.AddWrinklerAreaDetect
|
||||
let showingTooltip = false;
|
||||
for (const i of Object.keys(Game.wrinklers)) {
|
||||
Object.keys(Game.wrinklers).forEach((i) => {
|
||||
const me = Game.wrinklers[i];
|
||||
if (me.phase > 0 && me.selected) {
|
||||
showingTooltip = true;
|
||||
@@ -36,11 +36,11 @@ export function CheckWrinklerTooltip() {
|
||||
Game.tooltip.draw(this, escape(placeholder.innerHTML));
|
||||
TooltipWrinkler = i;
|
||||
TooltipWrinklerBeingShown[i] = 1;
|
||||
} else break;
|
||||
}
|
||||
} else {
|
||||
TooltipWrinklerBeingShown[i] = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!showingTooltip) {
|
||||
Game.tooltip.hide();
|
||||
}
|
||||
@@ -54,7 +54,7 @@ export function CheckWrinklerTooltip() {
|
||||
*/
|
||||
export function UpdateWrinklerTooltip() {
|
||||
if (CMOptions.TooltipWrink === 1 && l('CMTooltipWrinkler') !== null) {
|
||||
let sucked = Game.wrinklers[TooltipWrinkler].sucked;
|
||||
let { sucked } = Game.wrinklers[TooltipWrinkler];
|
||||
let toSuck = 1.1;
|
||||
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
||||
if (Game.wrinklers[TooltipWrinkler].type === 1) toSuck *= 3; // Shiny wrinklers
|
||||
|
||||
@@ -80,6 +80,7 @@ export const TooltipText = [
|
||||
'250px',
|
||||
],
|
||||
];
|
||||
export const SimpleTooltipElements = {};
|
||||
|
||||
/**
|
||||
* These are variables used by the functions that create tooltips for wrinklers
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function CheckGardenTick() {
|
||||
) {
|
||||
if (LastGardenNextStep !== 0 && LastGardenNextStep < Date.now()) {
|
||||
Flash(3, 'GardFlash');
|
||||
PlaySound(CMOptions.GardSoundURL, 'GardSound', 'GardVolume');
|
||||
PlaySound(CMOptions.GardSoundURL, 'GardSound', 'GardVolume', false);
|
||||
}
|
||||
LastGardenNextStep = Game.Objects.Farm.minigame.nextStep;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import CreateGCTimer from '../../Disp/GoldenCookieTimers/GoldenCookieTimers';
|
||||
import Flash from '../../Disp/Notifications/Flash';
|
||||
import Notification from '../../Disp/Notifications/Notification';
|
||||
import CreateNotification from '../../Disp/Notifications/Notification';
|
||||
import PlaySound from '../../Disp/Notifications/Sound';
|
||||
import { UpdateFavicon } from '../../Disp/TabTitle/FavIcon';
|
||||
import { GCTimers } from '../../Disp/VariablesAndData';
|
||||
@@ -24,13 +24,13 @@ import {
|
||||
function FindShimmer() {
|
||||
CurrSpawnedGoldenCookieState = 0;
|
||||
CacheGoldenShimmersByID = {};
|
||||
for (const i of Object.keys(Game.shimmers)) {
|
||||
Object.keys(Game.shimmers).forEach((i) => {
|
||||
CacheGoldenShimmersByID[Game.shimmers[i].id] = Game.shimmers[i];
|
||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'golden') {
|
||||
CacheSpawnedGoldenShimmer = Game.shimmers[i];
|
||||
CurrSpawnedGoldenCookieState += 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,42 +39,42 @@ function FindShimmer() {
|
||||
*/
|
||||
export default function CheckGoldenCookie() {
|
||||
FindShimmer();
|
||||
for (const i of Object.keys(GCTimers)) {
|
||||
Object.keys(GCTimers).forEach((i) => {
|
||||
if (typeof CacheGoldenShimmersByID[i] === 'undefined') {
|
||||
GCTimers[i].parentNode.removeChild(GCTimers[i]);
|
||||
delete GCTimers[i];
|
||||
}
|
||||
}
|
||||
});
|
||||
if (LastGoldenCookieState !== Game.shimmerTypes.golden.n) {
|
||||
LastGoldenCookieState = Game.shimmerTypes.golden.n;
|
||||
if (LastGoldenCookieState) {
|
||||
if (LastSpawnedGoldenCookieState < CurrSpawnedGoldenCookieState) {
|
||||
Flash(3, 'GCFlash');
|
||||
PlaySound(CMOptions.GCSoundURL, 'GCSound', 'GCVolume');
|
||||
Notification(
|
||||
PlaySound(CMOptions.GCSoundURL, 'GCSound', 'GCVolume', false);
|
||||
CreateNotification(
|
||||
'GCNotification',
|
||||
'Golden Cookie Spawned',
|
||||
'A Golden Cookie has spawned. Click it now!',
|
||||
);
|
||||
}
|
||||
|
||||
for (const i of Object.keys(Game.shimmers)) {
|
||||
Object.keys(Game.shimmers).forEach((i) => {
|
||||
if (typeof GCTimers[Game.shimmers[i].id] === 'undefined') {
|
||||
CreateGCTimer(Game.shimmers[i]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
UpdateFavicon();
|
||||
LastSpawnedGoldenCookieState = CurrSpawnedGoldenCookieState;
|
||||
if (CurrSpawnedGoldenCookieState === 0) CacheSpawnedGoldenShimmer = 0;
|
||||
} else if (CMOptions.GCTimer === 1 && LastGoldenCookieState) {
|
||||
for (const i of Object.keys(GCTimers)) {
|
||||
Object.keys(GCTimers).forEach((i) => {
|
||||
GCTimers[i].style.opacity = CacheGoldenShimmersByID[i].l.style.opacity;
|
||||
GCTimers[i].style.transform =
|
||||
CacheGoldenShimmersByID[i].l.style.transform;
|
||||
GCTimers[i].textContent = Math.ceil(
|
||||
CacheGoldenShimmersByID[i].life / Game.fps,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import Flash from '../../Disp/Notifications/Flash';
|
||||
import Notification from '../../Disp/Notifications/Notification';
|
||||
import CreateNotification from '../../Disp/Notifications/Notification';
|
||||
import PlaySound from '../../Disp/Notifications/Sound';
|
||||
import { LastMagicBarFull } from '../VariablesAndData';
|
||||
|
||||
@@ -13,13 +13,13 @@ export default function CheckMagicMeter() {
|
||||
Game.Objects['Wizard tower'].minigameLoaded &&
|
||||
CMOptions.GrimoireBar === 1
|
||||
) {
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
const { minigame } = Game.Objects['Wizard tower'];
|
||||
if (minigame.magic < minigame.magicM) LastMagicBarFull = false;
|
||||
else if (!LastMagicBarFull) {
|
||||
LastMagicBarFull = true;
|
||||
Flash(3, 'MagicFlash');
|
||||
PlaySound(CMOptions.MagicSoundURL, 'MagicSound', 'MagicVolume');
|
||||
Notification(
|
||||
PlaySound(CMOptions.MagicSoundURL, 'MagicSound', 'MagicVolume', false);
|
||||
CreateNotification(
|
||||
'MagicNotification',
|
||||
'Magic Meter full',
|
||||
'Your Magic Meter is full. Cast a spell!',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { CacheSeasonPopShimmer } from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import Flash from '../../Disp/Notifications/Flash';
|
||||
import Notification from '../../Disp/Notifications/Notification';
|
||||
import CreateNotification from '../../Disp/Notifications/Notification';
|
||||
import PlaySound from '../../Disp/Notifications/Sound';
|
||||
import { LastSeasonPopupState } from '../VariablesAndData';
|
||||
|
||||
@@ -13,15 +13,14 @@ import { LastSeasonPopupState } from '../VariablesAndData';
|
||||
export default function CheckSeasonPopup() {
|
||||
if (LastSeasonPopupState !== Game.shimmerTypes.reindeer.spawned) {
|
||||
LastSeasonPopupState = Game.shimmerTypes.reindeer.spawned;
|
||||
for (const i of Object.keys(Game.shimmers)) {
|
||||
Object.keys(Game.shimmers).forEach((i) => {
|
||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'reindeer') {
|
||||
CacheSeasonPopShimmer = Game.shimmers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
Flash(3, 'SeaFlash');
|
||||
PlaySound(CMOptions.SeaSoundURL, 'SeaSound', 'SeaVolume');
|
||||
Notification(
|
||||
PlaySound(CMOptions.SeaSoundURL, 'SeaSound', 'SeaVolume', false);
|
||||
CreateNotification(
|
||||
'SeaNotification',
|
||||
'Reindeer sighted!',
|
||||
'A Reindeer has spawned. Click it now!',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import Flash from '../../Disp/Notifications/Flash';
|
||||
import Notification from '../../Disp/Notifications/Notification';
|
||||
import CreateNotification from '../../Disp/Notifications/Notification';
|
||||
import PlaySound from '../../Disp/Notifications/Sound';
|
||||
import { LastTickerFortuneState } from '../VariablesAndData';
|
||||
|
||||
@@ -17,8 +17,13 @@ export default function CheckTickerFortune() {
|
||||
Game.TickerEffect && Game.TickerEffect.type === 'fortune';
|
||||
if (LastTickerFortuneState) {
|
||||
Flash(3, 'FortuneFlash');
|
||||
PlaySound(CMOptions.FortuneSoundURL, 'FortuneSound', 'FortuneVolume');
|
||||
Notification(
|
||||
PlaySound(
|
||||
CMOptions.FortuneSoundURL,
|
||||
'FortuneSound',
|
||||
'FortuneVolume',
|
||||
false,
|
||||
);
|
||||
CreateNotification(
|
||||
'FortuneNotification',
|
||||
'Fortune Cookie found',
|
||||
'A Fortune Cookie has appeared on the Ticker.',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import Flash from '../../Disp/Notifications/Flash';
|
||||
import Notification from '../../Disp/Notifications/Notification';
|
||||
import CreateNotification from '../../Disp/Notifications/Notification';
|
||||
import PlaySound from '../../Disp/Notifications/Sound';
|
||||
import { LastWrinklerCount } from '../VariablesAndData';
|
||||
|
||||
@@ -11,9 +11,9 @@ import { LastWrinklerCount } from '../VariablesAndData';
|
||||
export default function CheckWrinklerCount() {
|
||||
if (Game.elderWrath > 0) {
|
||||
let CurrentWrinklers = 0;
|
||||
for (const i in Game.wrinklers) {
|
||||
if (Game.wrinklers[i].phase === 2) CurrentWrinklers++;
|
||||
}
|
||||
Object.keys(Game.wrinklers).forEach((i) => {
|
||||
if (Game.wrinklers[i].phase === 2) CurrentWrinklers += 1;
|
||||
});
|
||||
if (CurrentWrinklers > LastWrinklerCount) {
|
||||
LastWrinklerCount = CurrentWrinklers;
|
||||
if (
|
||||
@@ -32,25 +32,27 @@ export default function CheckWrinklerCount() {
|
||||
CMOptions.WrinklerMaxSoundURL,
|
||||
'WrinklerMaxSound',
|
||||
'WrinklerMaxVolume',
|
||||
false,
|
||||
);
|
||||
} else {
|
||||
PlaySound(
|
||||
CMOptions.WrinklerSoundURL,
|
||||
'WrinklerSound',
|
||||
'WrinklerVolume',
|
||||
false,
|
||||
);
|
||||
}
|
||||
if (
|
||||
CurrentWrinklers === Game.getWrinklersMax() &&
|
||||
CMOptions.WrinklerMaxNotification
|
||||
) {
|
||||
Notification(
|
||||
CreateNotification(
|
||||
'WrinklerMaxNotification',
|
||||
'Maximum Wrinklers Reached',
|
||||
'You have reached your maximum ammount of wrinklers',
|
||||
);
|
||||
} else {
|
||||
Notification(
|
||||
CreateNotification(
|
||||
'WrinklerNotification',
|
||||
'A Wrinkler appeared',
|
||||
'A new wrinkler has appeared',
|
||||
|
||||
@@ -6,6 +6,7 @@ import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
||||
import CreateUpgradeBar from '../Disp/BuildingsUpgrades/UpgradeBar';
|
||||
import { CreateBotBar } from '../Disp/InfoBars/BottomBar';
|
||||
import { CreateTimerBar } from '../Disp/InfoBars/TimerBar';
|
||||
import CreateSectionHideButtons from '../Disp/Initialization/CreateSectionHideButtons';
|
||||
import CreateWrinklerButtons from '../Disp/Initialization/CreateWrinklerButton';
|
||||
import CreateCssArea from '../Disp/Initialization/CssArea';
|
||||
import UpdateBuildingUpgradeStyle from '../Disp/Initialization/UpdateBuildingUpgradeStyle';
|
||||
@@ -37,14 +38,15 @@ export default function InitializeCookieMonster() {
|
||||
CreateTimerBar();
|
||||
CreateUpgradeBar();
|
||||
CreateWhiteScreen();
|
||||
CreateSectionHideButtons();
|
||||
CreateFavicon();
|
||||
for (const i of Object.keys(TooltipText)) {
|
||||
Object.keys(TooltipText).forEach((i) => {
|
||||
CreateSimpleTooltip(
|
||||
TooltipText[i][0],
|
||||
TooltipText[i][1],
|
||||
TooltipText[i][2],
|
||||
);
|
||||
}
|
||||
});
|
||||
CreateWrinklerButtons();
|
||||
UpdateBuildingUpgradeStyle();
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import LoopCache from '../Cache/CacheLoop';
|
||||
import CacheNoGoldSwitchCPS from '../Cache/CPS/NoGoldSwitchCPS';
|
||||
import CacheSellAllForChoEgg from '../Cache/CPS/SellChoEgg';
|
||||
import CacheDragonCost from '../Cache/Dragon/Dragon';
|
||||
import CachePantheonGods from '../Cache/PantheonGods/CacheGods';
|
||||
import {
|
||||
CacheBuildingsPrices,
|
||||
CacheIncome,
|
||||
@@ -57,6 +58,7 @@ export default function CMLoop() {
|
||||
CacheAllMissingUpgrades();
|
||||
CacheChain();
|
||||
CacheDragonCost();
|
||||
CachePantheonGods();
|
||||
|
||||
CacheSeasonSpec();
|
||||
CacheSellAllForChoEgg();
|
||||
|
||||
@@ -20,7 +20,7 @@ function ReplaceNativeGrimoireDraw() {
|
||||
!HasReplaceNativeGrimoireDraw &&
|
||||
Game.Objects['Wizard tower'].minigameLoaded
|
||||
) {
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
const { minigame } = Game.Objects['Wizard tower'];
|
||||
BackupGrimoireDraw = minigame.draw;
|
||||
Game.Objects['Wizard tower'].minigame.draw = function () {
|
||||
BackupGrimoireDraw();
|
||||
@@ -46,7 +46,7 @@ function ReplaceNativeGrimoireLaunch() {
|
||||
!HasReplaceNativeGrimoireLaunch &&
|
||||
Game.Objects['Wizard tower'].minigameLoaded
|
||||
) {
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
const { minigame } = Game.Objects['Wizard tower'];
|
||||
BackupGrimoireLaunch = minigame.launch;
|
||||
BackupGrimoireLaunchMod = new Function(
|
||||
`return ${minigame.launch
|
||||
|
||||
@@ -6,7 +6,8 @@ import { TooltipGrimoireBackup } from '../VariablesAndData';
|
||||
*/
|
||||
export default function ReplaceTooltipGrimoire() {
|
||||
if (Game.Objects['Wizard tower'].minigameLoaded) {
|
||||
for (const i in Game.Objects['Wizard tower'].minigame.spellsById) {
|
||||
Object.keys(Game.Objects['Wizard tower'].minigame.spellsById).forEach(
|
||||
(i) => {
|
||||
if (l(`grimoireSpell${i}`).onmouseover !== null) {
|
||||
TooltipGrimoireBackup[i] = l(`grimoireSpell${i}`).onmouseover;
|
||||
l(`grimoireSpell${i}`).onmouseover = function () {
|
||||
@@ -21,6 +22,7 @@ export default function ReplaceTooltipGrimoire() {
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { TooltipUpgradeBackup } from '../VariablesAndData';
|
||||
*/
|
||||
export default function ReplaceTooltipUpgrade() {
|
||||
TooltipUpgradeBackup = [];
|
||||
for (const i of Object.keys(Game.UpgradesInStore)) {
|
||||
Object.keys(Game.UpgradesInStore).forEach((i) => {
|
||||
if (l(`upgrade${i}`).onmouseover !== null) {
|
||||
TooltipUpgradeBackup[i] = l(`upgrade${i}`).onmouseover;
|
||||
l(`upgrade${i}`).onmouseover = function () {
|
||||
@@ -26,5 +26,5 @@ export default function ReplaceTooltipUpgrade() {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable no-unused-vars */
|
||||
/** Functions related to replacing tooltips */
|
||||
|
||||
@@ -14,7 +15,7 @@ import ReplaceTooltipGrimoire from './TooltipGrimoire';
|
||||
* This function replaces the original .onmouseover functions of buildings
|
||||
*/
|
||||
function ReplaceTooltipBuild() {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
const me = Game.Objects[i];
|
||||
if (l(`product${me.id}`).onmouseover !== null) {
|
||||
TooltipBuildBackup[i] = l(`product${me.id}`).onmouseover;
|
||||
@@ -30,7 +31,7 @@ function ReplaceTooltipBuild() {
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,6 +87,40 @@ function ReplaceTooltipGarden() {
|
||||
}
|
||||
}
|
||||
|
||||
function ReplaceTooltipPantheon() {
|
||||
if (Game.Objects.Temple.minigameLoaded) {
|
||||
for (let i = 0; i < 11; i += 1) {
|
||||
l(`templeGod${i}`).onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
function () {
|
||||
return CreateTooltip('pag', i);
|
||||
},
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
for (let i = 0; i < 3; i += 1) {
|
||||
l(`templeSlot${i}`).onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
this,
|
||||
function () {
|
||||
return CreateTooltip('pas', [
|
||||
i,
|
||||
Game.Objects.Temple.minigame.slot[i],
|
||||
]);
|
||||
},
|
||||
'this',
|
||||
);
|
||||
Game.tooltip.wobble();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function call all functions that replace Game-tooltips with Cookie Monster enhanced tooltips
|
||||
*/
|
||||
@@ -95,11 +130,13 @@ export default function ReplaceTooltips() {
|
||||
|
||||
// Replace Tooltips of Minigames. Nesting it in LoadMinigames makes sure to replace them even if
|
||||
// they were not loaded initially
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
LoadMinigames = Game.LoadMinigames;
|
||||
Game.LoadMinigames = function () {
|
||||
LoadMinigames();
|
||||
ReplaceTooltipGarden();
|
||||
ReplaceTooltipGrimoire();
|
||||
ReplaceTooltipPantheon();
|
||||
ReplaceNativeGrimoire();
|
||||
};
|
||||
Game.LoadMinigames();
|
||||
|
||||
@@ -15,8 +15,8 @@ export default function AddWrinklerAreaDetect() {
|
||||
l('backgroundLeftCanvas').onmouseout = function () {
|
||||
TooltipWrinklerArea = 0;
|
||||
Game.tooltip.hide();
|
||||
for (const i of Object.keys(Game.wrinklers)) {
|
||||
Object.keys(Game.wrinklers).forEach((i) => {
|
||||
TooltipWrinklerBeingShown[i] = 0;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -31,15 +31,15 @@ export default function CalculateGains() {
|
||||
let mult = 1;
|
||||
// Include minigame effects
|
||||
const effs = {};
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
if (Game.Objects[i].minigameLoaded && Game.Objects[i].minigame.effs) {
|
||||
const myEffs = Game.Objects[i].minigame.effs;
|
||||
for (const ii in myEffs) {
|
||||
Object.keys(myEffs).forEach((ii) => {
|
||||
if (effs[ii]) effs[ii] *= myEffs[ii];
|
||||
else effs[ii] = myEffs[ii];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
SimEffs = effs;
|
||||
|
||||
if (Game.ascensionMode !== 1)
|
||||
@@ -54,7 +54,7 @@ export default function CalculateGains() {
|
||||
if (SimHas('Heralds') && Game.ascensionMode !== 1)
|
||||
mult *= 1 + 0.01 * Game.heralds;
|
||||
|
||||
for (const i of Object.keys(Game.cookieUpgrades)) {
|
||||
Object.keys(Game.cookieUpgrades).forEach((i) => {
|
||||
const me = Game.cookieUpgrades[i];
|
||||
if (SimHas(me.name)) {
|
||||
// Some upgrades have a functio as .power (notably the valentine cookies)
|
||||
@@ -64,7 +64,7 @@ export default function CalculateGains() {
|
||||
mult *= 1 + SimUpgrades[me.name].power(SimUpgrades[me.name]) * 0.01;
|
||||
} else mult *= 1 + me.power * 0.01;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (SimHas('Specialized chocolate chips')) mult *= 1.01;
|
||||
if (SimHas('Designer cocoa beans')) mult *= 1.02;
|
||||
@@ -160,7 +160,7 @@ export default function CalculateGains() {
|
||||
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)) {
|
||||
Object.keys(SimObjects).forEach((i) => {
|
||||
const me = SimObjects[i];
|
||||
let storedCps = me.cps(me);
|
||||
if (Game.ascensionMode !== 1)
|
||||
@@ -171,7 +171,7 @@ export default function CalculateGains() {
|
||||
)
|
||||
storedCps *= 1 + 0.05 * milkProgress * milkMult;
|
||||
SimCookiesPs += me.amount * storedCps;
|
||||
}
|
||||
});
|
||||
|
||||
if (SimHas('"egg"')) SimCookiesPs += 9; // "egg"
|
||||
|
||||
@@ -210,14 +210,14 @@ export default function CalculateGains() {
|
||||
mult *= 1 + SimAuraMult('Radiant Appetite');
|
||||
|
||||
const rawCookiesPs = SimCookiesPs * mult;
|
||||
for (const i of Object.keys(Game.CpsAchievements)) {
|
||||
Object.keys(Game.CpsAchievements).forEach((i) => {
|
||||
if (rawCookiesPs >= Game.CpsAchievements[i].threshold)
|
||||
SimWin(Game.CpsAchievements[i].name);
|
||||
}
|
||||
});
|
||||
|
||||
SimCookiesPsRaw = rawCookiesPs;
|
||||
|
||||
const n = Game.shimmerTypes.golden.n;
|
||||
const { n } = Game.shimmerTypes.golden;
|
||||
const auraMult = SimAuraMult("Dragon's Fortune");
|
||||
for (let i = 0; i < n; i++) {
|
||||
mult *= 1 + auraMult * 1.23;
|
||||
@@ -233,9 +233,9 @@ export default function CalculateGains() {
|
||||
let goldenSwitchMult = 1.5;
|
||||
if (SimHas('Residual luck')) {
|
||||
const upgrades = Game.goldenCookieUpgrades;
|
||||
for (const i of Object.keys(upgrades)) {
|
||||
Object.keys(upgrades).forEach((i) => {
|
||||
if (SimHas(upgrades[i])) goldenSwitchMult += 0.1;
|
||||
}
|
||||
});
|
||||
}
|
||||
mult *= goldenSwitchMult;
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@ import { SimObjects, SimUpgradesOwned } from '../VariablesAndData';
|
||||
*/
|
||||
export default function CheckOtherAchiev() {
|
||||
let grandmas = 0;
|
||||
for (const i of Object.keys(Game.GrandmaSynergies)) {
|
||||
if (SimHas(Game.GrandmaSynergies[i])) grandmas++;
|
||||
}
|
||||
Object.keys(Game.GrandmaSynergies).forEach((i) => {
|
||||
if (SimHas(Game.GrandmaSynergies[i])) grandmas += 1;
|
||||
});
|
||||
if (!SimHasAchiev('Elder') && grandmas >= 7) SimWin('Elder');
|
||||
if (!SimHasAchiev('Veteran') && grandmas >= 14) SimWin('Veteran');
|
||||
|
||||
@@ -21,7 +21,7 @@ export default function CheckOtherAchiev() {
|
||||
let mathematician = 1;
|
||||
let base10 = 1;
|
||||
let minAmount = 100000;
|
||||
for (const i of Object.keys(SimObjects)) {
|
||||
Object.keys(SimObjects).forEach((i) => {
|
||||
buildingsOwned += SimObjects[i].amount;
|
||||
minAmount = Math.min(SimObjects[i].amount, minAmount);
|
||||
if (!SimHasAchiev('Mathematician')) {
|
||||
@@ -38,7 +38,7 @@ export default function CheckOtherAchiev() {
|
||||
)
|
||||
base10 = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (minAmount >= 1) SimWin('One with everything');
|
||||
if (mathematician === 1) SimWin('Mathematician');
|
||||
if (base10 === 1) SimWin('Base 10');
|
||||
@@ -76,23 +76,23 @@ export default function CheckOtherAchiev() {
|
||||
SimWin('The elder scrolls');
|
||||
|
||||
let hasAllHalloCook = true;
|
||||
for (const i of Object.keys(HalloCookies)) {
|
||||
Object.keys(HalloCookies).forEach((i) => {
|
||||
if (!SimHas(HalloCookies[i])) hasAllHalloCook = false;
|
||||
}
|
||||
});
|
||||
if (hasAllHalloCook) SimWin('Spooky cookies');
|
||||
|
||||
let hasAllChristCook = true;
|
||||
for (const i of Object.keys(ChristCookies)) {
|
||||
Object.keys(ChristCookies).forEach((i) => {
|
||||
if (!SimHas(ChristCookies[i])) hasAllChristCook = false;
|
||||
}
|
||||
});
|
||||
if (hasAllChristCook) SimWin('Let it snow');
|
||||
|
||||
if (SimHas('Fortune cookies')) {
|
||||
const list = Game.Tiers.fortune.upgrades;
|
||||
let fortunes = 0;
|
||||
for (const i of Object.keys(list)) {
|
||||
if (SimHas(list[i].name)) fortunes++;
|
||||
}
|
||||
Object.keys(list).forEach((i) => {
|
||||
if (SimHas(list[i].name)) fortunes += 1;
|
||||
});
|
||||
if (fortunes >= list.length) SimWin('O Fortuna');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,20 +12,20 @@ import InitUpgrade from './InitUpgrade';
|
||||
export default function InitData() {
|
||||
// Buildings
|
||||
SimObjects = [];
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
SimObjects[i] = InitialBuildingData(i);
|
||||
}
|
||||
});
|
||||
|
||||
// Upgrades
|
||||
SimUpgrades = [];
|
||||
for (const i of Object.keys(Game.Upgrades)) {
|
||||
Object.keys(Game.Upgrades).forEach((i) => {
|
||||
SimUpgrades[i] = InitUpgrade(i);
|
||||
}
|
||||
});
|
||||
|
||||
// Achievements
|
||||
SimAchievements = [];
|
||||
for (const i of Object.keys(Game.Achievements)) {
|
||||
Object.keys(Game.Achievements).forEach((i) => {
|
||||
SimAchievements[i] = InitAchievement(i);
|
||||
}
|
||||
});
|
||||
CopyData();
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ export default function InitUpgrade(upgradeName) {
|
||||
if (me.name === 'Sugar crystal cookies') {
|
||||
you.power = function () {
|
||||
let n = 5;
|
||||
for (const i in SimObjects) {
|
||||
Object.keys(SimObjects).forEach((i) => {
|
||||
if (SimObjects[i].level >= 10) n += 1;
|
||||
}
|
||||
});
|
||||
return n;
|
||||
};
|
||||
} else {
|
||||
|
||||
@@ -29,9 +29,9 @@ export default function InitialBuildingData(buildingName) {
|
||||
if (SimHas('Nonillion fingers')) add *= 20;
|
||||
let mult = 1;
|
||||
let num = 0;
|
||||
for (const i in SimObjects) {
|
||||
Object.keys(SimObjects).forEach((i) => {
|
||||
if (SimObjects[i].name !== 'Cursor') num += SimObjects[i].amount;
|
||||
}
|
||||
});
|
||||
add *= num;
|
||||
mult *= SimGetTieredCpsMult(it);
|
||||
mult *= Game.magicCpS('Cursor');
|
||||
@@ -49,9 +49,9 @@ export default function InitialBuildingData(buildingName) {
|
||||
} else if (me.name === 'Grandma') {
|
||||
you.cps = function (it) {
|
||||
let mult = 1;
|
||||
for (const i in Game.GrandmaSynergies) {
|
||||
Object.keys(Game.GrandmaSynergies).forEach((i) => {
|
||||
if (SimHas(Game.GrandmaSynergies[i])) mult *= 2;
|
||||
}
|
||||
});
|
||||
if (SimHas('Bingo center/Research facility')) mult *= 4;
|
||||
if (SimHas('Ritual rolling pins')) mult *= 2;
|
||||
if (SimHas('Naughty list')) mult *= 2;
|
||||
@@ -75,9 +75,9 @@ export default function InitialBuildingData(buildingName) {
|
||||
if (SimHas('Elder Pact')) add += SimObjects.Portal.amount * 0.05;
|
||||
|
||||
let num = 0;
|
||||
for (const i in SimObjects) {
|
||||
Object.keys(SimObjects).forEach((i) => {
|
||||
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;
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@ import SimHas from './SimHas';
|
||||
*/
|
||||
export default function SimGetTieredCpsMult(me) {
|
||||
let mult = 1;
|
||||
for (const i in me.tieredUpgrades) {
|
||||
Object.keys(me.tieredUpgrades).forEach((i) => {
|
||||
if (
|
||||
!Game.Tiers[me.tieredUpgrades[i].tier].special &&
|
||||
SimHas(me.tieredUpgrades[i].name)
|
||||
)
|
||||
mult *= 2;
|
||||
}
|
||||
for (const i in me.synergies) {
|
||||
});
|
||||
Object.keys(me.synergies).forEach((i) => {
|
||||
if (SimHas(me.synergies[i].name)) {
|
||||
const syn = me.synergies[i];
|
||||
if (syn.buildingTie1.name === me.name)
|
||||
@@ -21,7 +21,7 @@ export default function SimGetTieredCpsMult(me) {
|
||||
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));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SimObjects } from '../VariablesAndData';
|
||||
import { SimGod1, SimGod2, SimGod3, SimObjects } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function checks for the current God level in the sim data
|
||||
@@ -11,10 +11,14 @@ export default function SimHasGod(what) {
|
||||
SimObjects.Temple.minigame = Game.Objects.Temple.minigame;
|
||||
}
|
||||
const god = SimObjects.Temple.minigame.gods[what];
|
||||
for (let i = 0; i < 3; i++) {
|
||||
if (SimObjects.Temple.minigame.slot[i] === god.id) {
|
||||
return i + 1;
|
||||
if (SimGod1 === god.id) {
|
||||
return 1;
|
||||
}
|
||||
if (SimGod2 === god.id) {
|
||||
return 2;
|
||||
}
|
||||
if (SimGod3 === god.id) {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -8,26 +8,27 @@ import SimHasGod from './SimHasGod';
|
||||
* This function calculates the sell price of a building based on current "sim data"
|
||||
* @param {string} building Name of the building
|
||||
* @param {number} price Current price of building
|
||||
* @returns {number} price The modified building price
|
||||
* @returns {number} ModifiedPrice The modified building price
|
||||
*/
|
||||
export default function SimModifyBuildingPrice(building, price) {
|
||||
if (SimHas('Season savings')) 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;
|
||||
// if (SimHasAura('Fierce Hoarder')) price *= 0.98;
|
||||
price *= 1 - SimAuraMult('Fierce Hoarder') * 0.02;
|
||||
if (Game.hasBuff('Everything must go')) price *= 0.95;
|
||||
if (Game.hasBuff('Crafty pixies')) price *= 0.98;
|
||||
if (Game.hasBuff('Nasty goblins')) price *= 1.02;
|
||||
if (building.fortune && SimHas(building.fortune.name)) price *= 0.93;
|
||||
price *= SimEff('buildingCost');
|
||||
let ModifiedPrice = price;
|
||||
if (SimHas('Season savings')) ModifiedPrice *= 0.99;
|
||||
if (SimHas("Santa's dominion")) ModifiedPrice *= 0.99;
|
||||
if (SimHas('Faberge egg')) ModifiedPrice *= 0.99;
|
||||
if (SimHas('Divine discount')) ModifiedPrice *= 0.99;
|
||||
if (SimHas('Fortune #100')) ModifiedPrice *= 0.99;
|
||||
// if (SimHasAura('Fierce Hoarder')) ModifiedPrice *= 0.98;
|
||||
ModifiedPrice *= 1 - SimAuraMult('Fierce Hoarder') * 0.02;
|
||||
if (Game.hasBuff('Everything must go')) ModifiedPrice *= 0.95;
|
||||
if (Game.hasBuff('Crafty pixies')) ModifiedPrice *= 0.98;
|
||||
if (Game.hasBuff('Nasty goblins')) ModifiedPrice *= 1.02;
|
||||
if (building.fortune && SimHas(building.fortune.name)) ModifiedPrice *= 0.93;
|
||||
ModifiedPrice *= SimEff('buildingCost');
|
||||
if (SimObjects.Temple.minigameLoaded) {
|
||||
const godLvl = SimHasGod('creation');
|
||||
if (godLvl === 1) price *= 0.93;
|
||||
else if (godLvl === 2) price *= 0.95;
|
||||
else if (godLvl === 3) price *= 0.98;
|
||||
if (godLvl === 1) ModifiedPrice *= 0.93;
|
||||
else if (godLvl === 2) ModifiedPrice *= 0.95;
|
||||
else if (godLvl === 3) ModifiedPrice *= 0.98;
|
||||
}
|
||||
return price;
|
||||
return ModifiedPrice;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ import {
|
||||
SimAchievementsOwned,
|
||||
SimDragonAura,
|
||||
SimDragonAura2,
|
||||
SimGod1,
|
||||
SimGod2,
|
||||
SimGod3,
|
||||
SimHeavenlyPower,
|
||||
SimObjects,
|
||||
SimPledges,
|
||||
@@ -34,7 +37,7 @@ export default function CopyData() {
|
||||
SimPrestige = Game.prestige;
|
||||
|
||||
// Buildings
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
const me = Game.Objects[i];
|
||||
let you = SimObjects[i];
|
||||
if (you === undefined) {
|
||||
@@ -49,14 +52,19 @@ export default function CopyData() {
|
||||
you.basePrice = me.basePrice;
|
||||
you.free = me.free;
|
||||
if (me.minigameLoaded) {
|
||||
if (me.name === 'Temple') {
|
||||
SimGod1 = me.minigame.slot[0];
|
||||
SimGod2 = me.minigame.slot[1];
|
||||
SimGod3 = me.minigame.slot[2];
|
||||
}
|
||||
you.minigameLoaded = me.minigameLoaded;
|
||||
you.minigame = me.minigame;
|
||||
}
|
||||
SimObjects[i] = you;
|
||||
}
|
||||
});
|
||||
|
||||
// Upgrades
|
||||
for (const i of Object.keys(Game.Upgrades)) {
|
||||
Object.keys(Game.Upgrades).forEach((i) => {
|
||||
const me = Game.Upgrades[i];
|
||||
let you = SimUpgrades[i];
|
||||
if (you === undefined) {
|
||||
@@ -65,10 +73,10 @@ export default function CopyData() {
|
||||
}
|
||||
you.bought = me.bought;
|
||||
SimUpgrades[i] = you;
|
||||
}
|
||||
});
|
||||
|
||||
// Achievements
|
||||
for (const i of Object.keys(Game.Achievements)) {
|
||||
Object.keys(Game.Achievements).forEach((i) => {
|
||||
const me = Game.Achievements[i];
|
||||
let you = SimAchievements[i];
|
||||
if (you === undefined) {
|
||||
@@ -77,7 +85,7 @@ export default function CopyData() {
|
||||
}
|
||||
you.won = me.won;
|
||||
SimAchievements[i] = you;
|
||||
}
|
||||
});
|
||||
|
||||
// Auras
|
||||
CacheDragonAuras();
|
||||
|
||||
@@ -11,7 +11,7 @@ export default function SimWin(what) {
|
||||
if (SimAchievements[what]) {
|
||||
if (SimAchievements[what].won === 0) {
|
||||
SimAchievements[what].won = 1;
|
||||
if (Game.Achievements[what].pool !== 'shadow') SimAchievementsOwned++;
|
||||
if (Game.Achievements[what].pool !== 'shadow') SimAchievementsOwned += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,15 @@ export default function BuildingGetPrice(
|
||||
free,
|
||||
increase,
|
||||
) {
|
||||
let startingAmount = start;
|
||||
let moni = 0;
|
||||
for (let i = 0; i < increase; i++) {
|
||||
let price = basePrice * Game.priceIncrease ** Math.max(0, start - free);
|
||||
for (let i = 0; i < increase; i += 1) {
|
||||
let price =
|
||||
basePrice * Game.priceIncrease ** Math.max(0, startingAmount - free);
|
||||
price = Game.modifyBuildingPrice(build, price);
|
||||
price = Math.ceil(price);
|
||||
moni += price;
|
||||
start++;
|
||||
startingAmount += 1;
|
||||
}
|
||||
return moni;
|
||||
}
|
||||
|
||||
@@ -33,14 +33,14 @@ export default function BuyBuildingsBonusIncome(building, amount) {
|
||||
if (me.amount >= 700) SimWin('Gotta hand it to you');
|
||||
if (me.amount >= 800) SimWin("The devil's workshop");
|
||||
} else {
|
||||
for (const j in Game.Objects[me.name].tieredAchievs) {
|
||||
Object.keys(Game.Objects[me.name].tieredAchievs).forEach((j) => {
|
||||
if (
|
||||
me.amount >=
|
||||
Game.Tiers[Game.Objects[me.name].tieredAchievs[j].tier].achievUnlock
|
||||
) {
|
||||
SimWin(Game.Objects[me.name].tieredAchievs[j].name);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const lastAchievementsOwned = SimAchievementsOwned;
|
||||
|
||||
@@ -34,9 +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)) {
|
||||
Object.keys(SimObjects).forEach((i) => {
|
||||
num += SimObjects[i].amount;
|
||||
}
|
||||
});
|
||||
num -= SimObjects.Cursor.amount;
|
||||
add *= num;
|
||||
|
||||
@@ -83,10 +83,10 @@ function MouseCps() {
|
||||
}
|
||||
}
|
||||
|
||||
for (const i of Object.keys(Game.buffs)) {
|
||||
Object.keys(Game.buffs).forEach((i) => {
|
||||
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;
|
||||
@@ -132,10 +132,10 @@ export default function BuyUpgradesBonusIncome(upgrade) {
|
||||
}
|
||||
const me = SimUpgrades[upgrade];
|
||||
if (Game.CountsAsUpgradeOwned(Game.Upgrades[upgrade].pool))
|
||||
SimUpgradesOwned++;
|
||||
SimUpgradesOwned += 1;
|
||||
|
||||
if (upgrade === 'Elder Pledge') {
|
||||
SimPledges++;
|
||||
SimPledges += 1;
|
||||
if (SimPledges > 0) SimWin('Elder nap');
|
||||
if (SimPledges >= 5) SimWin('Elder slumber');
|
||||
} else if (upgrade === 'Elder Covenant') {
|
||||
|
||||
34
src/Sim/SimulationEvents/GodChange.js
Normal file
34
src/Sim/SimulationEvents/GodChange.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import CalculateGains from '../Calculations/CalculateGains';
|
||||
import CheckOtherAchiev from '../Calculations/CheckOtherAchiev';
|
||||
import CopyData from '../SimulationData/CopyData';
|
||||
import {
|
||||
SimAchievementsOwned,
|
||||
SimCookiesPs,
|
||||
SimGod1,
|
||||
SimGod2,
|
||||
SimGod3,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This functions calculates the cps and cost of changing a Dragon Aura
|
||||
* It is called by CM.Disp.AddAuraInfo()
|
||||
* @param {number} god The number of the slot to be swapped in
|
||||
* * @param {number slot The slot the god will go to
|
||||
* @returns {number} CM.Sim.cookiesPs - Game.cookiesPs The bonus cps and the price of the change
|
||||
*/
|
||||
export default function CalculateChangeGod(god, slot) {
|
||||
CopyData();
|
||||
if (slot === 0) SimGod1 = god;
|
||||
else if (slot === 1) SimGod2 = god;
|
||||
else if (slot === 2) SimGod3 = god;
|
||||
|
||||
const lastAchievementsOwned = SimAchievementsOwned;
|
||||
CalculateGains();
|
||||
|
||||
CheckOtherAchiev();
|
||||
if (lastAchievementsOwned !== SimAchievementsOwned) {
|
||||
CalculateGains();
|
||||
}
|
||||
return SimCookiesPs - Game.cookiesPs;
|
||||
}
|
||||
@@ -22,21 +22,26 @@ export default function BuildingSell(
|
||||
) {
|
||||
// Calculate money gains from selling buildings
|
||||
// If noSim is set, use Game methods to compute price instead of Sim ones.
|
||||
noSim = typeof noSim === 'undefined' ? 0 : noSim;
|
||||
const noSimRes = typeof noSim === 'undefined' ? 0 : noSim;
|
||||
let toChange = amount;
|
||||
let startingAmount = start;
|
||||
let moni = 0;
|
||||
if (amount === -1) amount = start;
|
||||
if (!amount) amount = Game.buyBulk;
|
||||
for (let i = 0; i < amount; i++) {
|
||||
let price = basePrice * Game.priceIncrease ** Math.max(0, start - free);
|
||||
price = noSim
|
||||
if (amount === -1) toChange = startingAmount;
|
||||
if (!amount) toChange = Game.buyBulk;
|
||||
for (let i = 0; i < toChange; i++) {
|
||||
let price =
|
||||
basePrice * Game.priceIncrease ** Math.max(0, startingAmount - free);
|
||||
price = noSimRes
|
||||
? Game.modifyBuildingPrice(build, price)
|
||||
: SimModifyBuildingPrice(build, price);
|
||||
price = Math.ceil(price);
|
||||
const giveBack = noSim ? build.getSellMultiplier() : SimGetSellMultiplier();
|
||||
const giveBack = noSimRes
|
||||
? build.getSellMultiplier()
|
||||
: SimGetSellMultiplier();
|
||||
price = Math.floor(price * giveBack);
|
||||
if (start > 0) {
|
||||
if (startingAmount > 0) {
|
||||
moni += price;
|
||||
start--;
|
||||
startingAmount -= 1;
|
||||
}
|
||||
}
|
||||
return moni;
|
||||
|
||||
@@ -21,10 +21,10 @@ export default function SellBuildingsForChoEgg() {
|
||||
// Change auras to Earth Shatterer + Reality bending to optimize money made by selling
|
||||
let buildingsToSacrifice = 2;
|
||||
if (SimDragonAura === 5 || SimDragonAura === 18) {
|
||||
--buildingsToSacrifice;
|
||||
buildingsToSacrifice -= 1;
|
||||
}
|
||||
if (SimDragonAura2 === 5 || SimDragonAura2 === 18) {
|
||||
--buildingsToSacrifice;
|
||||
buildingsToSacrifice -= 1;
|
||||
}
|
||||
SimDragonAura = 5;
|
||||
SimDragonAura2 = 18;
|
||||
@@ -32,17 +32,17 @@ export default function SellBuildingsForChoEgg() {
|
||||
// Sacrifice highest buildings for the aura switch
|
||||
for (let i = 0; i < buildingsToSacrifice; ++i) {
|
||||
let highestBuilding = 'Cursor';
|
||||
for (const j in SimObjects) {
|
||||
Object.keys(SimObjects).forEach((j) => {
|
||||
if (SimObjects[j].amount > 0) {
|
||||
highestBuilding = j;
|
||||
}
|
||||
}
|
||||
SimObjects[highestBuilding].amount--;
|
||||
SimBuildingsOwned--;
|
||||
});
|
||||
SimObjects[highestBuilding].amount -= 1;
|
||||
SimBuildingsOwned -= 1;
|
||||
}
|
||||
|
||||
// Get money made by selling all remaining buildings
|
||||
for (const i of Object.keys(SimObjects)) {
|
||||
Object.keys(SimObjects).forEach((i) => {
|
||||
const me = SimObjects[i];
|
||||
sellTotal += BuildingSell(
|
||||
Game.Objects[me.name],
|
||||
@@ -51,7 +51,7 @@ export default function SellBuildingsForChoEgg() {
|
||||
Game.Objects[i].free,
|
||||
me.amount,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return sellTotal;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@ export let SimHeavenlyPower;
|
||||
export let SimPrestige;
|
||||
export let SimDragonAura;
|
||||
export let SimDragonAura2;
|
||||
export let SimGod1;
|
||||
export let SimGod2;
|
||||
export let SimGod3;
|
||||
export let SimDoSims;
|
||||
export let SimEffs;
|
||||
export let SimDateCentury = Game.startDate;
|
||||
|
||||
@@ -9,7 +9,10 @@ module.exports = function (env) {
|
||||
mode: 'production',
|
||||
devtool: env.production ? 'source-map' : 'eval-source-map',
|
||||
entry: {
|
||||
CookieMonster: { import: './src/CookieMonster.js', filename: './CookieMonster.js' },
|
||||
CookieMonster: {
|
||||
import: './src/CookieMonster.js',
|
||||
filename: './CookieMonster.js',
|
||||
},
|
||||
},
|
||||
output: {
|
||||
filename: 'CookieMonster.js',
|
||||
|
||||
Reference in New Issue
Block a user