Merge pull request #604 from DanielNoord/feature/changelog
Final update for 2.031.4
This commit is contained in:
66
.eslintrc.js
66
.eslintrc.js
@@ -1,26 +1,50 @@
|
||||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true,
|
||||
},
|
||||
"globals": {
|
||||
"module": "readonly",
|
||||
"Game": "writable",
|
||||
"l": "readonly",
|
||||
"b64_to_utf8": "readonly",
|
||||
"utf8_to_b64": "readonly",
|
||||
"Beautify": "writable",
|
||||
"realAudio": "readonly",
|
||||
"JSColor": "readonly",
|
||||
"jscolor": "readonly",
|
||||
"BeautifyAll": "readonly",
|
||||
"CM": "writable",
|
||||
"unsafeWindow": "readonly",
|
||||
globals: {
|
||||
module: 'readonly',
|
||||
Game: 'writable',
|
||||
l: 'readonly',
|
||||
b64_to_utf8: 'readonly',
|
||||
utf8_to_b64: 'readonly',
|
||||
Beautify: 'writable',
|
||||
realAudio: 'readonly',
|
||||
JSColor: 'readonly',
|
||||
jscolor: 'readonly',
|
||||
BeautifyAll: 'readonly',
|
||||
CM: 'writable',
|
||||
unsafeWindow: 'readonly',
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 12
|
||||
extends: 'airbnb-base',
|
||||
parserOptions: {
|
||||
ecmaVersion: 12,
|
||||
},
|
||||
rules: {
|
||||
indent: ['error', 'tab'],
|
||||
'no-tabs': 'off',
|
||||
'max-len': 'off',
|
||||
'no-param-reassign': 'off',
|
||||
'no-plusplus': 'off',
|
||||
'no-new-func': 'off',
|
||||
'no-eval': 'off',
|
||||
'no-restricted-properties': 'off',
|
||||
'no-restricted-syntax': 'off',
|
||||
'no-mixed-operators': 'off',
|
||||
'prefer-destructuring': 'off',
|
||||
'func-names': 'off',
|
||||
'no-use-before-define': 'off',
|
||||
'no-console': 'off',
|
||||
'no-nested-ternary': 'off',
|
||||
'object-shorthand': 'off',
|
||||
'no-else-return': 'off',
|
||||
'prefer-arrow-callback': 'off',
|
||||
'no-new': 'off',
|
||||
'no-alert': 'off',
|
||||
'new-cap': 'off',
|
||||
'no-restricted-globals': 'off',
|
||||
'no-template-curly-in-string': 'off',
|
||||
radix: 'off',
|
||||
},
|
||||
"rules": {
|
||||
}
|
||||
};
|
||||
|
||||
4
.github/workflows/CI.yml
vendored
4
.github/workflows/CI.yml
vendored
@@ -6,7 +6,9 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run ESLint
|
||||
run: npx eslint src
|
||||
run: |
|
||||
npm install
|
||||
npx eslint src
|
||||
Check_main_file:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
File diff suppressed because one or more lines are too long
1415
package-lock.json
generated
1415
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -39,6 +39,8 @@
|
||||
"homepage": "https://github.com/Aktanusa/CookieMonster#readme",
|
||||
"devDependencies": {
|
||||
"eslint": "^7.19.0",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"terser": "^5.6.0-beta"
|
||||
},
|
||||
"ccrepo": {
|
||||
|
||||
206
src/Cache.js
206
src/Cache.js
@@ -1,8 +1,8 @@
|
||||
/*********
|
||||
/**
|
||||
* Cache *
|
||||
*********/
|
||||
*/
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: General Cache related functions */
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ CM.Cache.InitCache = function() {
|
||||
CM.Cache.CacheSeaSpec();
|
||||
CM.Cache.InitCookiesDiff();
|
||||
CM.Cache.HeavenlyChipsDiff = new CMAvgQueue(5); // Used by CM.Cache.CacheHeavenlyChipsPS()
|
||||
CM.Cache.CacheHeavenlyChipsPS
|
||||
CM.Cache.CacheHeavenlyChipsPS();
|
||||
CM.Cache.CacheAvgCPS();
|
||||
CM.Cache.CacheIncome();
|
||||
CM.Cache.CacheBuildingsPrices();
|
||||
@@ -41,12 +41,11 @@ CM.Cache.LoopCache = function() {
|
||||
CM.Cache.CacheAvgCPS();
|
||||
CM.Cache.CacheHeavenlyChipsPS();
|
||||
|
||||
let cookiesToNext = Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1) - (Game.cookiesEarned + Game.cookiesReset);
|
||||
const cookiesToNext = Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1) - (Game.cookiesEarned + Game.cookiesReset);
|
||||
CM.Cache.TimeTillNextPrestige = CM.Disp.FormatTime(cookiesToNext / CM.Disp.GetCPS());
|
||||
};
|
||||
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Helper functions */
|
||||
|
||||
/**
|
||||
@@ -85,7 +84,7 @@ class CMAvgQueue {
|
||||
}
|
||||
}
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to Dragon Auras */
|
||||
|
||||
/**
|
||||
@@ -100,7 +99,7 @@ CM.Cache.CacheDragonAuras = function() {
|
||||
CM.Cache.dragonAura2 = Game.dragonAura2;
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to Wrinklers */
|
||||
|
||||
/**
|
||||
@@ -118,11 +117,11 @@ CM.Cache.CacheWrinklers = function() {
|
||||
let sucked = Game.wrinklers[i].sucked;
|
||||
let toSuck = 1.1;
|
||||
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
||||
if (Game.wrinklers[i].type==1) toSuck *= 3; // Shiny wrinklers
|
||||
if (Game.wrinklers[i].type === 1) toSuck *= 3; // Shiny wrinklers
|
||||
sucked *= toSuck;
|
||||
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
|
||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||
let godLvl = Game.hasGod('scorn');
|
||||
const godLvl = Game.hasGod('scorn');
|
||||
if (godLvl === 1) sucked *= 1.15;
|
||||
else if (godLvl === 2) sucked *= 1.1;
|
||||
else if (godLvl === 3) sucked *= 1.05;
|
||||
@@ -135,7 +134,7 @@ CM.Cache.CacheWrinklers = function() {
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to Caching stats */
|
||||
|
||||
/**
|
||||
@@ -155,7 +154,7 @@ CM.Cache.CacheWrinklers = function() {
|
||||
CM.Cache.CacheStats = function () {
|
||||
CM.Cache.Lucky = (CM.Cache.NoGoldSwitchCookiesPS * 900) / 0.15;
|
||||
CM.Cache.Lucky *= CM.Cache.DragonsFortuneMultAdjustment;
|
||||
let cpsBuffMult = CM.Cache.getCPSBuffMult();
|
||||
const cpsBuffMult = CM.Cache.getCPSBuffMult();
|
||||
if (cpsBuffMult > 0) CM.Cache.Lucky /= cpsBuffMult;
|
||||
else CM.Cache.Lucky = 0;
|
||||
CM.Cache.LuckyReward = CM.Cache.GoldenCookiesMult * (CM.Cache.Lucky * 0.15) + 13;
|
||||
@@ -169,14 +168,14 @@ CM.Cache.CacheStats = function() {
|
||||
CM.Cache.Edifice = 0;
|
||||
let max = 0;
|
||||
let n = 0;
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
if (Game.Objects[i].amount > max) max = Game.Objects[i].amount;
|
||||
if (Game.Objects[i].amount > 0) n++;
|
||||
}
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
if ((Game.Objects[i].amount < max || n === 1) &&
|
||||
Game.Objects[i].amount < 400 &&
|
||||
Game.Objects[i].price * 2 > CM.Cache.Edifice) {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
if ((Game.Objects[i].amount < max || n === 1)
|
||||
&& Game.Objects[i].amount < 400
|
||||
&& Game.Objects[i].price * 2 > CM.Cache.Edifice) {
|
||||
CM.Cache.Edifice = Game.Objects[i].price * 2;
|
||||
CM.Cache.EdificeBuilding = i;
|
||||
}
|
||||
@@ -240,10 +239,9 @@ CM.Cache.MaxChainCookieReward = function(digit, maxPayout, mult) {
|
||||
let nextRequired = 0;
|
||||
let chain = 1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10);
|
||||
while (nextMoni < maxPayout) {
|
||||
moni = Math.max(digit, Math.min(Math.floor(1 / 9 * Math.pow(10, chain) * digit * mult), maxPayout * mult));
|
||||
// TODO: Calculate Cookies or cps needed for next level of chain. See issue #29
|
||||
nextMoni = Math.max(digit, Math.min(Math.floor(1 / 9 * Math.pow(10, chain + 1) * digit * mult), maxPayout * mult));
|
||||
nextRequired = Math.floor(1 / 9 * Math.pow(10, chain + 1) * digit * mult);
|
||||
moni = Math.max(digit, Math.min(Math.floor(1 / 9 * 10 ** chain * digit * mult), maxPayout * mult));
|
||||
nextMoni = Math.max(digit, Math.min(Math.floor(1 / 9 * 10 ** (chain + 1) * digit * mult), maxPayout * mult));
|
||||
nextRequired = Math.floor(1 / 9 * 10 ** (chain + 1) * digit * mult);
|
||||
totalFromChain += moni;
|
||||
chain++;
|
||||
}
|
||||
@@ -269,7 +267,7 @@ CM.Cache.MaxChainCookieReward = function(digit, maxPayout, mult) {
|
||||
CM.Cache.CacheChain = function () {
|
||||
let maxPayout = CM.Cache.NoGoldSwitchCookiesPS * 60 * 60 * 6 * CM.Cache.DragonsFortuneMultAdjustment;
|
||||
// Removes effect of Frenzy etc.
|
||||
let cpsBuffMult = CM.Cache.getCPSBuffMult();
|
||||
const cpsBuffMult = CM.Cache.getCPSBuffMult();
|
||||
if (cpsBuffMult > 0) maxPayout /= cpsBuffMult;
|
||||
else maxPayout = 0;
|
||||
|
||||
@@ -298,23 +296,23 @@ CM.Cache.CacheChain = function() {
|
||||
* @global {string} CM.Cache.MissingUpgradesPrestige String containig the HTML to create the "crates" for missing prestige upgrades
|
||||
*/
|
||||
CM.Cache.CacheMissingUpgrades = function () {
|
||||
CM.Cache.MissingUpgrades = "";
|
||||
CM.Cache.MissingUpgradesCookies = "";
|
||||
CM.Cache.MissingUpgradesPrestige = "";
|
||||
let list = [];
|
||||
CM.Cache.MissingUpgrades = '';
|
||||
CM.Cache.MissingUpgradesCookies = '';
|
||||
CM.Cache.MissingUpgradesPrestige = '';
|
||||
const list = [];
|
||||
// sort the upgrades
|
||||
for (let i of Object.keys(Game.Upgrades)) {
|
||||
for (const i of Object.keys(Game.Upgrades)) {
|
||||
list.push(Game.Upgrades[i]);
|
||||
}
|
||||
let sortMap = function(a, b) {
|
||||
const sortMap = function (a, b) {
|
||||
if (a.order > b.order) return 1;
|
||||
else if (a.order < b.order) return -1;
|
||||
else return 0;
|
||||
return 0;
|
||||
};
|
||||
list.sort(sortMap);
|
||||
|
||||
for (let i of Object.keys(list)) {
|
||||
let me = list[i];
|
||||
for (const i of Object.keys(list)) {
|
||||
const me = list[i];
|
||||
|
||||
if (me.bought === 0) {
|
||||
let str = '';
|
||||
@@ -322,7 +320,7 @@ CM.Cache.CacheMissingUpgrades = function() {
|
||||
str += CM.Disp.crateMissing(me);
|
||||
if (me.pool === 'prestige') CM.Cache.MissingUpgradesPrestige += str;
|
||||
else if (me.pool === 'cookie') CM.Cache.MissingUpgradesCookies += str;
|
||||
else if (me.pool != 'toggle' && me.pool != 'unused' && me.pool != 'debug') CM.Cache.MissingUpgrades += str;
|
||||
else if (me.pool !== 'toggle' && me.pool !== 'unused' && me.pool !== 'debug') CM.Cache.MissingUpgrades += str;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -349,16 +347,16 @@ CM.Cache.CacheSeaSpec = function() {
|
||||
*/
|
||||
CM.Cache.CacheHeavenlyChipsPS = function () {
|
||||
CM.Cache.HCPerSecond = 0; // Mainly there to not throw errors during initialization
|
||||
let currDate = Math.floor(Date.now() / 1000);
|
||||
const currDate = Math.floor(Date.now() / 1000);
|
||||
// Only calculate every new second
|
||||
if ((Game.T / Game.fps) % 1 === 0) {
|
||||
let chipsOwned = Game.HowMuchPrestige(Game.cookiesReset);
|
||||
let ascendNowToOwn = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||
let ascendNowToGet = ascendNowToOwn - Math.floor(chipsOwned);
|
||||
const chipsOwned = Game.HowMuchPrestige(Game.cookiesReset);
|
||||
const ascendNowToOwn = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||
const ascendNowToGet = ascendNowToOwn - Math.floor(chipsOwned);
|
||||
|
||||
// Add recent gains to AvgQueue's
|
||||
let timeDiff = currDate - CM.Cache.lastHeavenlyCheck;
|
||||
let heavenlyChipsDiffAvg = Math.max(0, (ascendNowToGet - CM.Cache.lastHeavenlyChips)) / timeDiff;
|
||||
const timeDiff = currDate - CM.Cache.lastHeavenlyCheck;
|
||||
const heavenlyChipsDiffAvg = Math.max(0, (ascendNowToGet - CM.Cache.lastHeavenlyChips)) / timeDiff;
|
||||
for (let i = 0; i < timeDiff; i++) {
|
||||
CM.Cache.HeavenlyChipsDiff.addLatest(heavenlyChipsDiffAvg);
|
||||
}
|
||||
@@ -370,9 +368,9 @@ CM.Cache.CacheHeavenlyChipsPS = function() {
|
||||
// Get average gain over period of 5 seconds
|
||||
CM.Cache.HCPerSecond = CM.Cache.HeavenlyChipsDiff.calcAverage(5);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to caching CPS */
|
||||
|
||||
/**
|
||||
@@ -396,7 +394,7 @@ CM.Cache.InitCookiesDiff = function() {
|
||||
* @global {number} CM.Cache.AvgCPSChoEgg Average cookies from combination of normal CPS and average Chocolate Cookie CPS
|
||||
*/
|
||||
CM.Cache.CacheAvgCPS = function () {
|
||||
let currDate = Math.floor(Date.now() / 1000);
|
||||
const currDate = Math.floor(Date.now() / 1000);
|
||||
// Only calculate every new second
|
||||
if ((Game.T / Game.fps) % 1 === 0) {
|
||||
let choEggTotal = Game.cookies + CM.Cache.SellForChoEgg;
|
||||
@@ -405,12 +403,12 @@ CM.Cache.CacheAvgCPS = function() {
|
||||
choEggTotal *= 0.05;
|
||||
|
||||
// Add recent gains to AvgQueue's
|
||||
let timeDiff = currDate - CM.Cache.lastCPSCheck;
|
||||
let bankDiffAvg = Math.max(0, (Game.cookies - CM.Cache.lastCookies)) / timeDiff;
|
||||
let wrinkDiffAvg = Math.max(0, (CM.Cache.WrinklersTotal - CM.Cache.lastWrinkCookies)) / timeDiff;
|
||||
let wrinkFattestDiffAvg = Math.max(0, (CM.Cache.WrinklersFattest[0] - CM.Cache.lastWrinkFattestCookies)) / timeDiff;
|
||||
let choEggDiffAvg = Math.max(0,(choEggTotal - CM.Cache.lastChoEgg)) / timeDiff;
|
||||
let clicksDiffAvg = (Game.cookieClicks - CM.Cache.lastClicks) / timeDiff;
|
||||
const timeDiff = currDate - CM.Cache.lastCPSCheck;
|
||||
const bankDiffAvg = Math.max(0, (Game.cookies - CM.Cache.lastCookies)) / timeDiff;
|
||||
const wrinkDiffAvg = Math.max(0, (CM.Cache.WrinklersTotal - CM.Cache.lastWrinkCookies)) / timeDiff;
|
||||
const wrinkFattestDiffAvg = Math.max(0, (CM.Cache.WrinklersFattest[0] - CM.Cache.lastWrinkFattestCookies)) / timeDiff;
|
||||
const choEggDiffAvg = Math.max(0, (choEggTotal - CM.Cache.lastChoEgg)) / timeDiff;
|
||||
const clicksDiffAvg = (Game.cookieClicks - CM.Cache.lastClicks) / timeDiff;
|
||||
for (let i = 0; i < timeDiff; i++) {
|
||||
CM.Cache.CookiesDiff.addLatest(bankDiffAvg);
|
||||
CM.Cache.WrinkDiff.addLatest(wrinkDiffAvg);
|
||||
@@ -428,7 +426,7 @@ CM.Cache.CacheAvgCPS = function() {
|
||||
CM.Cache.lastClicks = Game.cookieClicks;
|
||||
|
||||
// Get average gain over period of cpsLength seconds
|
||||
let cpsLength = CM.Disp.cookieTimes[CM.Options.AvgCPSHist];
|
||||
const cpsLength = CM.Disp.cookieTimes[CM.Options.AvgCPSHist];
|
||||
CM.Cache.AverageGainBank = CM.Cache.CookiesDiff.calcAverage(cpsLength);
|
||||
CM.Cache.AverageGainWrink = CM.Cache.WrinkDiff.calcAverage(cpsLength);
|
||||
CM.Cache.AverageGainWrinkFattest = CM.Cache.WrinkFattestDiff.calcAverage(cpsLength);
|
||||
@@ -437,12 +435,11 @@ CM.Cache.CacheAvgCPS = function() {
|
||||
if (CM.Options.CalcWrink === 1) CM.Cache.AvgCPS += CM.Cache.AverageGainWrink;
|
||||
if (CM.Options.CalcWrink === 2) CM.Cache.AvgCPS += CM.Cache.AverageGainWrinkFattest;
|
||||
|
||||
let choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'));
|
||||
const choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'));
|
||||
|
||||
if (choEgg || CM.Options.CalcWrink === 0) {
|
||||
CM.Cache.AvgCPSWithChoEgg = CM.Cache.AverageGainBank + CM.Cache.AverageGainWrink + (choEgg ? CM.Cache.AverageGainChoEgg : 0);
|
||||
}
|
||||
else CM.Cache.AvgCPSWithChoEgg = CM.Cache.AvgCPS;
|
||||
} else CM.Cache.AvgCPSWithChoEgg = CM.Cache.AvgCPS;
|
||||
|
||||
CM.Cache.AverageClicks = CM.Cache.ClicksDiff.calcAverage(CM.Disp.clickTimes[CM.Options.AvgClicksHist]);
|
||||
}
|
||||
@@ -457,10 +454,10 @@ CM.Cache.CacheSellForChoEgg = function() {
|
||||
let sellTotal = 0;
|
||||
// Compute cookies earned by selling stock market goods
|
||||
if (Game.Objects.Bank.minigameLoaded) {
|
||||
let marketGoods = Game.Objects.Bank.minigame.goods;
|
||||
const marketGoods = Game.Objects.Bank.minigame.goods;
|
||||
let goodsVal = 0;
|
||||
for (let i of Object.keys(marketGoods)) {
|
||||
let marketGood = marketGoods[i];
|
||||
for (const i of Object.keys(marketGoods)) {
|
||||
const marketGood = marketGoods[i];
|
||||
goodsVal += marketGood.stock * marketGood.val;
|
||||
}
|
||||
sellTotal += goodsVal * Game.cookiesPsRawHighest;
|
||||
@@ -479,12 +476,12 @@ CM.Cache.CacheSellForChoEgg = function() {
|
||||
CM.Cache.CacheCurrWrinklerCPS = function () {
|
||||
CM.Cache.CurrWrinklerCPSMult = 0;
|
||||
let count = 0;
|
||||
for (let i in Game.wrinklers) {
|
||||
for (const i in Game.wrinklers) {
|
||||
if (Game.wrinklers[i].phase === 2) count++;
|
||||
}
|
||||
let godMult = 1;
|
||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||
let godLvl = Game.hasGod('scorn');
|
||||
const godLvl = Game.hasGod('scorn');
|
||||
if (godLvl === 1) godMult *= 1.15;
|
||||
else if (godLvl === 2) godMult *= 1.1;
|
||||
else if (godLvl === 3) godMult *= 1.05;
|
||||
@@ -500,8 +497,8 @@ CM.Cache.CacheCurrWrinklerCPS = function() {
|
||||
*/
|
||||
CM.Cache.getCPSBuffMult = function () {
|
||||
let mult = 1;
|
||||
for (let i of Object.keys(Game.buffs)) {
|
||||
if (typeof Game.buffs[i].multCpS != 'undefined') mult *= Game.buffs[i].multCpS;
|
||||
for (const i of Object.keys(Game.buffs)) {
|
||||
if (typeof Game.buffs[i].multCpS !== 'undefined') mult *= Game.buffs[i].multCpS;
|
||||
}
|
||||
return mult;
|
||||
};
|
||||
@@ -514,11 +511,10 @@ CM.Cache.getCPSBuffMult = function() {
|
||||
CM.Cache.NoGoldSwitchCPS = function () {
|
||||
if (Game.Has('Golden switch [off]')) {
|
||||
CM.Cache.NoGoldSwitchCookiesPS = CM.Sim.NoGoldSwitchCPS();
|
||||
}
|
||||
else CM.Cache.NoGoldSwitchCookiesPS = Game.cookiesPs;
|
||||
} else CM.Cache.NoGoldSwitchCookiesPS = Game.cookiesPs;
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to "Specials" (Dragon and Santa) */
|
||||
|
||||
/**
|
||||
@@ -528,47 +524,44 @@ CM.Cache.NoGoldSwitchCPS = function() {
|
||||
* @global {string} CM.Cache.CostDragonUpgrade The Beautified cost of the next upgrade
|
||||
*/
|
||||
CM.Cache.CacheDragonCost = function () {
|
||||
if (CM.Cache.lastDragonLevel != Game.dragonLevel || CM.Sim.DoSims) {
|
||||
if (Game.dragonLevel < 25 && Game.dragonLevels[Game.dragonLevel].buy.toString().includes("sacrifice")) {
|
||||
if (CM.Cache.lastDragonLevel !== Game.dragonLevel || CM.Sim.DoSims) {
|
||||
if (Game.dragonLevel < 25 && Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')) {
|
||||
let target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];
|
||||
let amount = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];
|
||||
if (target != "i") {
|
||||
target = target.replaceAll("'", "");
|
||||
const amount = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];
|
||||
if (target !== 'i') {
|
||||
target = target.replaceAll("'", '');
|
||||
if (Game.Objects[target].amount < amount) {
|
||||
CM.Cache.CostDragonUpgrade = "Not enough buildings to sell";
|
||||
}
|
||||
else {
|
||||
CM.Cache.CostDragonUpgrade = 'Not enough buildings to sell';
|
||||
} else {
|
||||
let cost = 0;
|
||||
CM.Sim.CopyData();
|
||||
for (let i = 0; i < amount; i++) {
|
||||
let price = CM.Sim.Objects[target].basePrice * Math.pow(Game.priceIncrease, Math.max(0, CM.Sim.Objects[target].amount - 1 - CM.Sim.Objects[target].free));
|
||||
let price = CM.Sim.Objects[target].basePrice * Game.priceIncrease ** Math.max(0, CM.Sim.Objects[target].amount - 1 - CM.Sim.Objects[target].free);
|
||||
price = Game.modifyBuildingPrice(CM.Sim.Objects[target], price);
|
||||
price = Math.ceil(price);
|
||||
cost += price;
|
||||
CM.Sim.Objects[target].amount--;
|
||||
}
|
||||
CM.Cache.CostDragonUpgrade = "Cost to rebuy: " + CM.Disp.Beautify(cost);
|
||||
CM.Cache.CostDragonUpgrade = `Cost to rebuy: ${CM.Disp.Beautify(cost)}`;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
let cost = 0;
|
||||
CM.Sim.CopyData();
|
||||
for (let j of Object.keys(Game.Objects)) {
|
||||
for (const j of Object.keys(Game.Objects)) {
|
||||
target = j;
|
||||
if (Game.Objects[target].amount < amount) {
|
||||
CM.Cache.CostDragonUpgrade = "Not enough buildings to sell";
|
||||
CM.Cache.CostDragonUpgrade = 'Not enough buildings to sell';
|
||||
break;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
for (let i = 0; i < amount; i++) {
|
||||
let price = CM.Sim.Objects[target].basePrice * Math.pow(Game.priceIncrease, Math.max(0, CM.Sim.Objects[target].amount - 1 - CM.Sim.Objects[target].free));
|
||||
let price = CM.Sim.Objects[target].basePrice * Game.priceIncrease ** Math.max(0, CM.Sim.Objects[target].amount - 1 - CM.Sim.Objects[target].free);
|
||||
price = Game.modifyBuildingPrice(CM.Sim.Objects[target], price);
|
||||
price = Math.ceil(price);
|
||||
cost += price;
|
||||
CM.Sim.Objects[target].amount--;
|
||||
}
|
||||
}
|
||||
CM.Cache.CostDragonUpgrade = "Cost to rebuy: " + CM.Disp.Beautify(cost);
|
||||
CM.Cache.CostDragonUpgrade = `Cost to rebuy: ${CM.Disp.Beautify(cost)}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -576,7 +569,7 @@ CM.Cache.CacheDragonCost = function() {
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to caching income */
|
||||
|
||||
/**
|
||||
@@ -601,14 +594,14 @@ CM.Cache.CacheIncome = function() {
|
||||
*/
|
||||
CM.Cache.CacheBuildingIncome = function (amount, target) {
|
||||
CM.Cache[target] = [];
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
CM.Cache[target][i] = {};
|
||||
CM.Cache[target][i].bonus = CM.Sim.BuyBuildingsBonusIncome(i, amount);
|
||||
if (amount != 1) {
|
||||
if (amount !== 1) {
|
||||
CM.Cache.DoRemakeBuildPrices = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This functions starts the calculation/simulation of the bonus income of upgrades
|
||||
@@ -616,15 +609,15 @@ CM.Cache.CacheBuildingIncome = function(amount, target) {
|
||||
*/
|
||||
CM.Cache.CacheUpgradeIncome = function () {
|
||||
CM.Cache.Upgrades = [];
|
||||
for (let i of Object.keys(Game.Upgrades)) {
|
||||
let bonusIncome = CM.Sim.BuyUpgradesBonusIncome(i);
|
||||
for (const i of Object.keys(Game.Upgrades)) {
|
||||
const bonusIncome = CM.Sim.BuyUpgradesBonusIncome(i);
|
||||
CM.Cache.Upgrades[i] = {};
|
||||
if (bonusIncome[0]) CM.Cache.Upgrades[i].bonus = bonusIncome[0];
|
||||
if (bonusIncome[1]) CM.Cache.Upgrades[i].bonusMouse = bonusIncome[1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to caching prices */
|
||||
|
||||
/**
|
||||
@@ -632,14 +625,14 @@ CM.Cache.CacheUpgradeIncome = function() {
|
||||
* It is called by CM.Main.Loop() and CM.Cache.InitCache()
|
||||
*/
|
||||
CM.Cache.CacheBuildingsPrices = function () {
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
CM.Cache.Objects1[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 1);
|
||||
CM.Cache.Objects10[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 10);
|
||||
CM.Cache.Objects100[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 100);
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to caching PP */
|
||||
|
||||
/**
|
||||
@@ -671,13 +664,13 @@ CM.Cache.ColourOfPP = function(me, price) {
|
||||
|
||||
// Colour based on price in terms of CPS
|
||||
if (Number(CM.Options.PPSecondsLowerLimit) !== 0) {
|
||||
if (price / CM.Disp.GetCPS() < Number(CM.Options.PPSecondsLowerLimit)) color = CM.Disp.colorBlue
|
||||
if (price / CM.Disp.GetCPS() < Number(CM.Options.PPSecondsLowerLimit)) color = CM.Disp.colorBlue;
|
||||
}
|
||||
// Colour based on being able to purchase
|
||||
if (CM.Options.PPOnlyConsiderBuyable) {
|
||||
if (price - Game.cookies > 0) color = CM.Disp.colorRed;
|
||||
}
|
||||
return color
|
||||
return color;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -688,11 +681,11 @@ CM.Cache.CacheBuildingsPP = function() {
|
||||
CM.Cache.min = Infinity;
|
||||
CM.Cache.max = 1;
|
||||
CM.Cache.ArrayOfPPs = [];
|
||||
if (typeof CM.Options.PPExcludeTop === "undefined") CM.Options.PPExcludeTop = 0; // Otherwise breaks during initialization
|
||||
if (typeof CM.Options.PPExcludeTop === 'undefined') CM.Options.PPExcludeTop = 0; // Otherwise breaks during initialization
|
||||
|
||||
// Calculate PP and colors when compared to purchase of optimal building in single-purchase mode
|
||||
if (CM.Options.ColorPPBulkMode === 0) {
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
for (const i of Object.keys(CM.Cache.Objects1)) {
|
||||
if (Game.cookiesPs) {
|
||||
CM.Cache.Objects1[i].pp = (Math.max(Game.Objects[i].getPrice() - (Game.cookies + CM.Disp.GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Objects[i].getPrice() / CM.Cache.Objects1[i].bonus);
|
||||
} else CM.Cache.Objects1[i].pp = (Game.Objects[i].getPrice() / CM.Cache.Objects1[i].bonus);
|
||||
@@ -705,13 +698,13 @@ CM.Cache.CacheBuildingsPP = function() {
|
||||
if (CM.Cache.ArrayOfPPs.length === 1) {
|
||||
break;
|
||||
}
|
||||
CM.Cache.ArrayOfPPs.shift()
|
||||
CM.Cache.ArrayOfPPs.shift();
|
||||
}
|
||||
}
|
||||
CM.Cache.min = CM.Cache.ArrayOfPPs[CM.Options.PPExcludeTop][0];
|
||||
CM.Cache.max = CM.Cache.ArrayOfPPs[CM.Cache.ArrayOfPPs.length - 1][0];
|
||||
CM.Cache.mid = ((CM.Cache.max - CM.Cache.min) / 2) + CM.Cache.min;
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
for (const i of Object.keys(CM.Cache.Objects1)) {
|
||||
CM.Cache.Objects1[i].color = CM.Cache.ColourOfPP(CM.Cache.Objects1[i], Game.Objects[i].getPrice());
|
||||
// Colour based on excluding certain top-buildings
|
||||
for (let j = 0; j < CM.Options.PPExcludeTop; j++) {
|
||||
@@ -721,15 +714,14 @@ CM.Cache.CacheBuildingsPP = function() {
|
||||
// Calculate PP of bulk-buy modes
|
||||
CM.Cache.CacheBuildingsBulkPP('Objects10');
|
||||
CM.Cache.CacheBuildingsBulkPP('Objects100');
|
||||
}
|
||||
} else {
|
||||
// Calculate PP and colors when compared to purchase of selected bulk mode
|
||||
else {
|
||||
let target = `Objects${Game.buyBulk}`
|
||||
for (let i of Object.keys(CM.Cache[target])) {
|
||||
const target = `Objects${Game.buyBulk}`;
|
||||
for (const i of Object.keys(CM.Cache[target])) {
|
||||
if (Game.cookiesPs) {
|
||||
CM.Cache[target][i].pp = (Math.max(Game.Objects[i].bulkPrice - (Game.cookies + CM.Disp.GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Objects[i].bulkPrice / CM.Cache[target][i].bonus);
|
||||
} else CM.Cache[target][i].pp = (Game.Objects[i].bulkPrice / CM.Cache[target][i].bonus);
|
||||
CM.Cache.ArrayOfPPs.push([CM.Cache[target][i].pp, Game.Objects[i].bulkPrice])
|
||||
CM.Cache.ArrayOfPPs.push([CM.Cache[target][i].pp, Game.Objects[i].bulkPrice]);
|
||||
}
|
||||
// Set CM.Cache.min to best non-excluded buidliung
|
||||
CM.Cache.ArrayOfPPs.sort((a, b) => a[0] - b[0]);
|
||||
@@ -738,14 +730,14 @@ CM.Cache.CacheBuildingsPP = function() {
|
||||
if (CM.Cache.ArrayOfPPs.length === 1) {
|
||||
break;
|
||||
}
|
||||
CM.Cache.ArrayOfPPs.shift()
|
||||
CM.Cache.ArrayOfPPs.shift();
|
||||
}
|
||||
}
|
||||
CM.Cache.min = CM.Cache.ArrayOfPPs[CM.Options.PPExcludeTop][0];
|
||||
CM.Cache.max = CM.Cache.ArrayOfPPs[CM.Cache.ArrayOfPPs.length - 1][0];
|
||||
CM.Cache.mid = ((CM.Cache.max - CM.Cache.min) / 2) + CM.Cache.min;
|
||||
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
for (const i of Object.keys(CM.Cache.Objects1)) {
|
||||
CM.Cache[target][i].color = CM.Cache.ColourOfPP(CM.Cache[target][i], Game.Objects[i].bulkPrice);
|
||||
// Colour based on excluding certain top-buildings
|
||||
for (let j = 0; j < CM.Options.PPExcludeTop; j++) {
|
||||
@@ -761,7 +753,7 @@ CM.Cache.CacheBuildingsPP = function() {
|
||||
* It is called by CM.Cache.CacheBuildingsPP()
|
||||
*/
|
||||
CM.Cache.CacheBuildingsBulkPP = function (target) {
|
||||
for (let i of Object.keys(CM.Cache[target])) {
|
||||
for (const i of Object.keys(CM.Cache[target])) {
|
||||
if (Game.cookiesPs) {
|
||||
CM.Cache[target][i].pp = (Math.max(CM.Cache[target][i].price - (Game.cookies + CM.Disp.GetWrinkConfigBank()), 0) / Game.cookiesPs) + (CM.Cache[target][i].price / CM.Cache[target][i].bonus);
|
||||
} else CM.Cache[target][i].pp = (CM.Cache[target][i].price / CM.Cache[target][i].bonus);
|
||||
@@ -775,17 +767,17 @@ CM.Cache.CacheBuildingsBulkPP = function(target) {
|
||||
* It is called by CM.Cache.CachePP()
|
||||
*/
|
||||
CM.Cache.CacheUpgradePP = function () {
|
||||
for (let i of Object.keys(CM.Cache.Upgrades)) {
|
||||
for (const i of Object.keys(CM.Cache.Upgrades)) {
|
||||
if (Game.cookiesPs) {
|
||||
CM.Cache.Upgrades[i].pp = (Math.max(Game.Upgrades[i].getPrice() - (Game.cookies + CM.Disp.GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Upgrades[i].getPrice() / CM.Cache.Upgrades[i].bonus);
|
||||
} else CM.Cache.Upgrades[i].pp = (Game.Upgrades[i].getPrice() / CM.Cache.Upgrades[i].bonus);
|
||||
if (isNaN(CM.Cache.Upgrades[i].pp)) CM.Cache.Upgrades[i].pp = Infinity;
|
||||
if (Number.isNaN(CM.Cache.Upgrades[i].pp)) CM.Cache.Upgrades[i].pp = Infinity;
|
||||
|
||||
CM.Cache.Upgrades[i].color = CM.Cache.ColourOfPP(CM.Cache.Upgrades[i], Game.Upgrades[i].getPrice());
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Cached variables */
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**********
|
||||
/**
|
||||
* Config *
|
||||
**********/
|
||||
*/
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to saving, loading and restoring configs */
|
||||
|
||||
/**
|
||||
@@ -12,11 +12,11 @@
|
||||
* CM.ToggleConfigVolume() and changes in options with type "url", "color" or "numscale"
|
||||
*/
|
||||
CM.Config.SaveConfig = function () {
|
||||
let saveString = b64_to_utf8(unescape(localStorage.getItem('CookieClickerGame')).split('!END!')[0]);
|
||||
let CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
|
||||
if (CookieMonsterSave != null) {
|
||||
let newSaveString = saveString.replace(CookieMonsterSave[0], "CookieMonster:" + CM.save());
|
||||
localStorage.setItem('CookieClickerGame', escape(utf8_to_b64(newSaveString)+'!END!'));
|
||||
const saveString = b64_to_utf8(unescape(localStorage.getItem('CookieClickerGame')).split('!END!')[0]);
|
||||
const CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
|
||||
if (CookieMonsterSave !== null) {
|
||||
const newSaveString = saveString.replace(CookieMonsterSave[0], `CookieMonster:${CM.save()}`);
|
||||
localStorage.setItem('CookieClickerGame', escape(`${utf8_to_b64(newSaveString)}!END!`));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -26,44 +26,38 @@ CM.Config.SaveConfig = function() {
|
||||
*/
|
||||
CM.Config.LoadConfig = function (settings) {
|
||||
// This removes cookies left from earlier versions of CookieMonster
|
||||
if (typeof localStorage.CMConfig != "undefined") {
|
||||
if (typeof localStorage.CMConfig !== 'undefined') {
|
||||
delete localStorage.CMConfig;
|
||||
}
|
||||
if (settings != null) {
|
||||
if (settings !== undefined) {
|
||||
CM.Options = settings;
|
||||
|
||||
// Check values
|
||||
let mod = false;
|
||||
for (let i in CM.Data.ConfigDefault) {
|
||||
for (const i in CM.Data.ConfigDefault) {
|
||||
if (typeof CM.Options[i] === 'undefined') {
|
||||
mod = true;
|
||||
CM.Options[i] = CM.Data.ConfigDefault[i];
|
||||
}
|
||||
else if (i != 'Header' && i != 'Colors') {
|
||||
} else if (i !== 'Header' && i !== 'Colors') {
|
||||
if (i.indexOf('SoundURL') === -1) {
|
||||
if (!(CM.Options[i] > -1 && CM.Options[i] < CM.Data.Config[i].label.length)) {
|
||||
mod = true;
|
||||
CM.Options[i] = CM.Data.ConfigDefault[i];
|
||||
}
|
||||
}
|
||||
else { // Sound URLs
|
||||
if (typeof CM.Options[i] != 'string') {
|
||||
} else if (typeof CM.Options[i] !== 'string') { // Sound URLs
|
||||
mod = true;
|
||||
CM.Options[i] = CM.Data.ConfigDefault[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (i === 'Header') {
|
||||
for (let j in CM.Data.ConfigDefault.Header) {
|
||||
} else if (i === 'Header') {
|
||||
for (const j in CM.Data.ConfigDefault.Header) {
|
||||
if (typeof CM.Options[i][j] === 'undefined' || !(CM.Options[i][j] > -1 && CM.Options[i][j] < 2)) {
|
||||
mod = true;
|
||||
CM.Options[i][j] = CM.Data.ConfigDefault[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // Colors
|
||||
for (let j in CM.Data.ConfigDefault.Colors) {
|
||||
if (typeof CM.Options[i][j] === 'undefined' || typeof CM.Options[i][j] != 'string') {
|
||||
} else { // Colors
|
||||
for (const j in CM.Data.ConfigDefault.Colors) {
|
||||
if (typeof CM.Options[i][j] === 'undefined' || typeof CM.Options[i][j] !== 'string') {
|
||||
mod = true;
|
||||
CM.Options[i][j] = CM.Data.ConfigDefault[i][j];
|
||||
}
|
||||
@@ -72,13 +66,12 @@ CM.Config.LoadConfig = function(settings) {
|
||||
}
|
||||
if (mod) CM.Config.SaveConfig();
|
||||
CM.Main.Loop(); // Do loop once
|
||||
for (let i in CM.Data.ConfigDefault) {
|
||||
if (i != 'Header' && typeof CM.Data.Config[i].func !== 'undefined') {
|
||||
for (const i in CM.Data.ConfigDefault) {
|
||||
if (i !== 'Header' && typeof CM.Data.Config[i].func !== 'undefined') {
|
||||
CM.Data.Config[i].func();
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // Default values
|
||||
} else { // Default values
|
||||
CM.Config.RestoreDefault();
|
||||
}
|
||||
};
|
||||
@@ -93,7 +86,7 @@ CM.Config.RestoreDefault = function() {
|
||||
Game.UpdateMenu();
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to toggling or changing configs */
|
||||
|
||||
/**
|
||||
@@ -107,8 +100,7 @@ CM.Config.ToggleConfig = function(config) {
|
||||
if (CM.Options[config] === CM.Data.Config[config].label.length) {
|
||||
CM.Options[config] = 0;
|
||||
if (CM.Data.Config[config].toggle) l(CM.Config.ConfigPrefix + config).className = 'option off';
|
||||
}
|
||||
else l(CM.Config.ConfigPrefix + config).className = 'option';
|
||||
} else l(CM.Config.ConfigPrefix + config).className = 'option';
|
||||
|
||||
if (typeof CM.Data.Config[config].func !== 'undefined') {
|
||||
CM.Data.Config[config].func();
|
||||
@@ -124,9 +116,9 @@ CM.Config.ToggleConfig = function(config) {
|
||||
* @param {string} config The name of the option
|
||||
*/
|
||||
CM.Config.ToggleConfigVolume = function (config) {
|
||||
if (l("slider" + config) != null) {
|
||||
l("slider" + config + "right").innerHTML = l("slider" + config).value + "%";
|
||||
CM.Options[config] = Math.round(l("slider" + config).value);
|
||||
if (l(`slider${config}`) !== null) {
|
||||
l(`slider${config}right`).innerHTML = `${l(`slider${config}`).value}%`;
|
||||
CM.Options[config] = Math.round(l(`slider${config}`).value);
|
||||
}
|
||||
CM.Config.SaveConfig();
|
||||
};
|
||||
@@ -142,7 +134,7 @@ CM.Config.ToggleHeader = function(config) {
|
||||
CM.Config.SaveConfig();
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to notifications */
|
||||
|
||||
/**
|
||||
@@ -154,7 +146,7 @@ CM.Config.ToggleHeader = function(config) {
|
||||
CM.Config.CheckNotificationPermissions = function (ToggleOnOff) {
|
||||
if (ToggleOnOff === 1) {
|
||||
// Check if browser support Promise version of Notification Permissions
|
||||
let checkNotificationPromise = function () {
|
||||
const checkNotificationPromise = function () {
|
||||
try {
|
||||
Notification.requestPermission().then();
|
||||
} catch (e) {
|
||||
@@ -165,20 +157,16 @@ CM.Config.CheckNotificationPermissions = function(ToggleOnOff) {
|
||||
|
||||
// Check if the browser supports notifications and which type
|
||||
if (!('Notification' in window)) {
|
||||
console.log("This browser does not support notifications.");
|
||||
}
|
||||
else {
|
||||
if(checkNotificationPromise()) {
|
||||
console.log('This browser does not support notifications.');
|
||||
} else if (checkNotificationPromise()) {
|
||||
Notification.requestPermission().then();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Notification.requestPermission();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Variables used in Config functions */
|
||||
|
||||
/**
|
||||
|
||||
475
src/Data.js
475
src/Data.js
@@ -1,8 +1,8 @@
|
||||
/********
|
||||
/**
|
||||
* Data *
|
||||
********/
|
||||
*/
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Data used in the stats page to show not yet purchased updates. See CM.Disp.CreateStatsMissDisp() */
|
||||
|
||||
CM.Data.Fortunes = [
|
||||
@@ -28,41 +28,41 @@ CM.Data.Fortunes = [
|
||||
'Fortune #101',
|
||||
'Fortune #102',
|
||||
'Fortune #103',
|
||||
'Fortune #104'
|
||||
'Fortune #104',
|
||||
];
|
||||
CM.Data.HalloCookies = ['Skull cookies', 'Ghost cookies', 'Bat cookies', 'Slime cookies', 'Pumpkin cookies', 'Eyeball cookies', 'Spider cookies'];
|
||||
CM.Data.ChristCookies = ['Christmas tree biscuits', 'Snowflake biscuits', 'Snowman biscuits', 'Holly biscuits', 'Candy cane biscuits', 'Bell biscuits', 'Present biscuits'];
|
||||
CM.Data.ValCookies = ['Pure heart biscuits', 'Ardent heart biscuits', 'Sour heart biscuits', 'Weeping heart biscuits', 'Golden heart biscuits', 'Eternal heart biscuits', 'Prism heart biscuits'];
|
||||
CM.Data.PlantDrops = ['Elderwort biscuits', 'Bakeberry cookies', 'Duketater cookies', 'Green yeast digestives', 'Wheat slims', 'Fern tea', 'Ichor syrup'];
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: All possible effects plants and other items can have with an explanation */
|
||||
|
||||
CM.Data.Effects = {
|
||||
buildingCost: "Building prices",
|
||||
click: "Cookies per click",
|
||||
cps: "Total CPS",
|
||||
cursorCps: "Cursor CPS",
|
||||
goldenCookieDur: "Golden cookie duration",
|
||||
goldenCookieEffDur: "Golden cookie effect duration",
|
||||
goldenCookieFreq: "Golden cookie frequency",
|
||||
goldenCookieGain: "Golden cookie gains",
|
||||
grandmaCps: "Grandma CPS",
|
||||
itemDrops: "Random item drop chance",
|
||||
milk: "Effect from milk",
|
||||
reindeerDur: "Reindeer duration",
|
||||
reindeerFreq: "Reindeer frequency",
|
||||
reindeerGain: "Reindeer gains",
|
||||
upgradeCost: "Upgrade prices",
|
||||
wrathCookieDur: "Wrath cookie duration",
|
||||
wrathCookieEffDur: "Wrath cookie effect duration",
|
||||
wrathCookieFreq: "Wrath cookie frequency",
|
||||
wrathCookieGain: "Wrath cookie gains",
|
||||
wrinklerEat: "Wrinkler ",
|
||||
wrinklerSpawn: "Wrinkler spawn frequency"
|
||||
buildingCost: 'Building prices',
|
||||
click: 'Cookies per click',
|
||||
cps: 'Total CPS',
|
||||
cursorCps: 'Cursor CPS',
|
||||
goldenCookieDur: 'Golden cookie duration',
|
||||
goldenCookieEffDur: 'Golden cookie effect duration',
|
||||
goldenCookieFreq: 'Golden cookie frequency',
|
||||
goldenCookieGain: 'Golden cookie gains',
|
||||
grandmaCps: 'Grandma CPS',
|
||||
itemDrops: 'Random item drop chance',
|
||||
milk: 'Effect from milk',
|
||||
reindeerDur: 'Reindeer duration',
|
||||
reindeerFreq: 'Reindeer frequency',
|
||||
reindeerGain: 'Reindeer gains',
|
||||
upgradeCost: 'Upgrade prices',
|
||||
wrathCookieDur: 'Wrath cookie duration',
|
||||
wrathCookieEffDur: 'Wrath cookie effect duration',
|
||||
wrathCookieFreq: 'Wrath cookie frequency',
|
||||
wrathCookieGain: 'Wrath cookie gains',
|
||||
wrinklerEat: 'Wrinkler ',
|
||||
wrinklerSpawn: 'Wrinkler spawn frequency',
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Data for the various scales used by CookieMonster */
|
||||
|
||||
CM.Data.metric = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
||||
@@ -79,31 +79,31 @@ CM.Data.shortScaleAbbreviated = ['', 'K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp',
|
||||
'UNo', 'DNo', 'TNo', 'QaNo', 'QiNo', 'SxNo', 'SpNo', 'ONo', 'NNo', 'Ct',
|
||||
'UCt'];
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Two array's containing all Config groups and their to-be displayed title */
|
||||
|
||||
CM.Data.ConfigGroups = {
|
||||
BarsColors: "Bars/Colors",
|
||||
Calculation: "Calculation",
|
||||
Notification: "Notification",
|
||||
Tooltip: "Tooltips and additional insights",
|
||||
Statistics: "Statistics",
|
||||
Notation: "Notation",
|
||||
Miscellaneous: "Miscellaneous"
|
||||
BarsColors: 'Bars/Colors',
|
||||
Calculation: 'Calculation',
|
||||
Notification: 'Notification',
|
||||
Tooltip: 'Tooltips and additional insights',
|
||||
Statistics: 'Statistics',
|
||||
Notation: 'Notation',
|
||||
Miscellaneous: 'Miscellaneous',
|
||||
};
|
||||
|
||||
CM.Data.ConfigGroupsNotification = {
|
||||
NotificationGeneral: "General Notifications",
|
||||
NotificationGC: "Golden Cookie",
|
||||
NotificationFC: "Fortune Cookie",
|
||||
NotificationSea: "Season Special",
|
||||
NotificationGard: "Garden Tick",
|
||||
NotificationMagi: "Full Magic Bar",
|
||||
NotificationWrink: "Wrinkler",
|
||||
NotificationWrinkMax: "Maximum Wrinklers",
|
||||
NotificationGeneral: 'General Notifications',
|
||||
NotificationGC: 'Golden Cookie',
|
||||
NotificationFC: 'Fortune Cookie',
|
||||
NotificationSea: 'Season Special',
|
||||
NotificationGard: 'Garden Tick',
|
||||
NotificationMagi: 'Full Magic Bar',
|
||||
NotificationWrink: 'Wrinkler',
|
||||
NotificationWrinkMax: 'Maximum Wrinklers',
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: An array (CM.Data.Config) containing all Config options and an array of default settings */
|
||||
|
||||
/**
|
||||
@@ -117,16 +117,36 @@ CM.Data.ConfigGroupsNotification = {
|
||||
* @item {function} func A function to be called when the option is toggled
|
||||
*/
|
||||
// Barscolors
|
||||
CM.Data.Config.BotBar = {type: 'bool', group: 'BarsColors', label: ['Bottom Bar OFF', 'Bottom Bar ON'], desc: 'Building Information', toggle: true, func: function() {CM.Disp.ToggleBotBar();}};
|
||||
CM.Data.Config.TimerBar = {type: 'bool', group: 'BarsColors', label: ['Timer Bar OFF', 'Timer Bar ON'], desc: 'Timers of Golden Cookie, Season Popup, Frenzy (Normal, Clot, Elder), Click Frenzy', toggle: true, func: function() {CM.Disp.ToggleTimerBar();}};
|
||||
CM.Data.Config.TimerBarPos = {type: 'bool', group: 'BarsColors', label: ['Timer Bar Position (Top Left)', 'Timer Bar Position (Bottom)'], desc: 'Placement of the Timer Bar', toggle: false, func: function() {CM.Disp.ToggleTimerBarPos();}};
|
||||
CM.Data.Config.TimerBarOverlay = {type: 'bool', group: 'BarsColors', label: ['Timer Bar Overlay OFF', 'Timer Bar Overlay Only Seconds', 'Timer Bar Overlay Full'], desc: 'Overlay on timers displaying seconds and/or percentage left', toggle: true};
|
||||
CM.Data.Config.SortBuildings = {type: 'bool', group: 'BarsColors', label: ['Sort Buildings: Default', 'Sort Buildings: PP'], desc: 'Sort the display of buildings in either default order or by PP', toggle: false, func: function () { CM.Disp.UpdateBuildings();}};
|
||||
CM.Data.Config.SortUpgrades = {type: 'bool', group: 'BarsColors', label: ['Sort Upgrades: Default', 'Sort Upgrades: PP'], desc: 'Sort the display of upgrades in either default order or by PP', toggle: false, func: function () { CM.Disp.UpdateUpgrades();}};
|
||||
CM.Data.Config.BuildColor = {type: 'bool', group: 'BarsColors', label: ['Building Colors OFF', 'Building Colors ON'], desc: 'Color code buildings', toggle: true, func: function() {CM.Disp.UpdateBuildings();}};
|
||||
CM.Data.Config.BulkBuildColor = {type: 'bool', group: 'BarsColors', label: ['Bulk Building Colors (Single Building Color)', 'Bulk Building Colors (Calculated Bulk Color)'], desc: 'Color code bulk buildings based on single buildings color or calculated bulk value color', toggle: false, func: function() {CM.Disp.UpdateBuildings();}};
|
||||
CM.Data.Config.UpBarColor = {type: 'bool', group: 'BarsColors', label: ['Upgrade Colors/Bar OFF', 'Upgrade Colors with Bar ON', 'Upgrade Colors without Bar ON'], desc: 'Color code upgrades and optionally add a counter bar', toggle: false, func: function() {CM.Disp.ToggleUpgradeBarAndColor();}};
|
||||
CM.Data.Config.Colors = { type: 'color', group: 'BarsColors',
|
||||
CM.Data.Config.BotBar = {
|
||||
type: 'bool', group: 'BarsColors', label: ['Bottom Bar OFF', 'Bottom Bar ON'], desc: 'Building Information', toggle: true, func: function () { CM.Disp.ToggleBotBar(); },
|
||||
};
|
||||
CM.Data.Config.TimerBar = {
|
||||
type: 'bool', group: 'BarsColors', label: ['Timer Bar OFF', 'Timer Bar ON'], desc: 'Timers of Golden Cookie, Season Popup, Frenzy (Normal, Clot, Elder), Click Frenzy', toggle: true, func: function () { CM.Disp.ToggleTimerBar(); },
|
||||
};
|
||||
CM.Data.Config.TimerBarPos = {
|
||||
type: 'bool', group: 'BarsColors', label: ['Timer Bar Position (Top Left)', 'Timer Bar Position (Bottom)'], desc: 'Placement of the Timer Bar', toggle: false, func: function () { CM.Disp.ToggleTimerBarPos(); },
|
||||
};
|
||||
CM.Data.Config.TimerBarOverlay = {
|
||||
type: 'bool', group: 'BarsColors', label: ['Timer Bar Overlay OFF', 'Timer Bar Overlay Only Seconds', 'Timer Bar Overlay Full'], desc: 'Overlay on timers displaying seconds and/or percentage left', toggle: true,
|
||||
};
|
||||
CM.Data.Config.SortBuildings = {
|
||||
type: 'bool', group: 'BarsColors', label: ['Sort Buildings: Default', 'Sort Buildings: PP'], desc: 'Sort the display of buildings in either default order or by PP', toggle: false, func: function () { CM.Disp.UpdateBuildings(); },
|
||||
};
|
||||
CM.Data.Config.SortUpgrades = {
|
||||
type: 'bool', group: 'BarsColors', label: ['Sort Upgrades: Default', 'Sort Upgrades: PP'], desc: 'Sort the display of upgrades in either default order or by PP', toggle: false, func: function () { CM.Disp.UpdateUpgrades(); },
|
||||
};
|
||||
CM.Data.Config.BuildColor = {
|
||||
type: 'bool', group: 'BarsColors', label: ['Building Colors OFF', 'Building Colors ON'], desc: 'Color code buildings', toggle: true, func: function () { CM.Disp.UpdateBuildings(); },
|
||||
};
|
||||
CM.Data.Config.BulkBuildColor = {
|
||||
type: 'bool', group: 'BarsColors', label: ['Bulk Building Colors (Single Building Color)', 'Bulk Building Colors (Calculated Bulk Color)'], desc: 'Color code bulk buildings based on single buildings color or calculated bulk value color', toggle: false, func: function () { CM.Disp.UpdateBuildings(); },
|
||||
};
|
||||
CM.Data.Config.UpBarColor = {
|
||||
type: 'bool', group: 'BarsColors', label: ['Upgrade Colors/Bar OFF', 'Upgrade Colors with Bar ON', 'Upgrade Colors without Bar ON'], desc: 'Color code upgrades and optionally add a counter bar', toggle: false, func: function () { CM.Disp.ToggleUpgradeBarAndColor(); },
|
||||
};
|
||||
CM.Data.Config.Colors = {
|
||||
type: 'color',
|
||||
group: 'BarsColors',
|
||||
desc: {
|
||||
Blue: 'Color Blue. Used to show better than best PP building, for Click Frenzy bar, and for various labels',
|
||||
Green: 'Color Green. Used to show best PP building, for Blood Frenzy bar, and for various labels',
|
||||
@@ -136,121 +156,274 @@ CM.Data.Config.Colors = { type: 'color', group: 'BarsColors',
|
||||
Purple: 'Color Purple. Used to show worse than worst PP building, for Next Cookie bar, and for various labels',
|
||||
Gray: 'Color Gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar',
|
||||
Pink: 'Color Pink. Used for Dragonflight bar',
|
||||
Brown: 'Color Brown. Used for Dragon Harvest bar'
|
||||
Brown: 'Color Brown. Used for Dragon Harvest bar',
|
||||
},
|
||||
func: function() {CM.Disp.UpdateColors();}
|
||||
func: function () { CM.Disp.UpdateColors(); },
|
||||
};
|
||||
CM.Data.Config.UpgradeBarFixedPos = {
|
||||
type: 'bool', group: 'BarsColors', label: ['Upgrade Bar Fixed Position OFF', 'Upgrade Bar Fixed Position ON'], desc: 'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling', toggle: true, func: function () { CM.Disp.ToggleUpgradeBarFixedPos(); },
|
||||
};
|
||||
CM.Data.Config.UpgradeBarFixedPos = {type: 'bool', group: 'BarsColors', label: ['Upgrade Bar Fixed Position OFF', 'Upgrade Bar Fixed Position ON'], desc: 'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling', toggle: true, func: function() {CM.Disp.ToggleUpgradeBarFixedPos();}};
|
||||
|
||||
// Calculation
|
||||
CM.Data.Config.CalcWrink = {type: 'bool', group: 'Calculation', label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON', 'Calculate with Single Fattest Wrinkler ON'], desc: 'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) Wrinklers', toggle: true};
|
||||
CM.Data.Config.CPSMode = {type: 'bool', group: 'Calculation', label: ['Current Cookies Per Second', 'Average Cookies Per Second'], desc: 'Calculate times using current Cookies Per Second or average Cookies Per Second', toggle: false};
|
||||
CM.Data.Config.AvgCPSHist = {type: 'bool', group: 'Calculation', label: ['Average CPS for past 10s', 'Average CPS for past 15s', 'Average CPS for past 30s', 'Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'], desc: 'How much time average Cookies Per Second should consider', toggle: false};
|
||||
CM.Data.Config.AvgClicksHist = {type: 'bool', group: 'Calculation', label: ['Average Cookie Clicks for past 1s', 'Average Cookie Clicks for past 5s', 'Average Cookie Clicks for past 10s', 'Average Cookie Clicks for past 15s', 'Average Cookie Clicks for past 30s'], desc: 'How much time average Cookie Clicks should consider', toggle: false};
|
||||
CM.Data.Config.ColorPPBulkMode = {type: 'bool', group: 'Calculation', label: ['Color of PP (Compared to Single)', 'Color of PP (Compared to Bulk)'], desc: 'Color PP-values based on comparison with single purchase or with selected bulk-buy mode', toggle: false, func: function () {CM.Cache.CachePP();}};
|
||||
CM.Data.Config.PPExcludeTop = {type: 'bool', group: 'Calculation', label: ["Don't Ignore Any", 'Ignore 1st Best', 'Ignore 1st and 2nd Best', 'Ignore 1st, 2nd and 3rd Best'], desc: 'Makes CookieMonster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values', toggle: true};
|
||||
CM.Data.Config.PPSecondsLowerLimit = {type: 'numscale', group: 'Calculation', label: 'Lower limit for PP (in seconds): ', desc: 'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option', min: 0, max: Infinity};
|
||||
CM.Data.Config.PPOnlyConsiderBuyable = {type: 'bool', group: 'Calculation', label: ["Don't Ignore Non-Buyable", 'Ignore Non-Buyable'], desc: "Makes CookieMonster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'", toggle: true};
|
||||
CM.Data.Config.ToolWarnBon = {type: 'bool', group: 'Calculation', label: ['Calculate Tooltip Warning With Bonus CPS OFF', 'Calculate Tooltip Warning With Bonus CPS ON'], desc: 'Calculate the warning with or without the bonus CPS you get from buying', toggle: true};
|
||||
CM.Data.Config.CalcWrink = {
|
||||
type: 'bool', group: 'Calculation', label: ['Calculate with Wrinklers OFF', 'Calculate with Wrinklers ON', 'Calculate with Single Fattest Wrinkler ON'], desc: 'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) Wrinklers', toggle: true,
|
||||
};
|
||||
CM.Data.Config.CPSMode = {
|
||||
type: 'bool', group: 'Calculation', label: ['Current Cookies Per Second', 'Average Cookies Per Second'], desc: 'Calculate times using current Cookies Per Second or average Cookies Per Second', toggle: false,
|
||||
};
|
||||
CM.Data.Config.AvgCPSHist = {
|
||||
type: 'bool', group: 'Calculation', label: ['Average CPS for past 10s', 'Average CPS for past 15s', 'Average CPS for past 30s', 'Average CPS for past 1m', 'Average CPS for past 5m', 'Average CPS for past 10m', 'Average CPS for past 15m', 'Average CPS for past 30m'], desc: 'How much time average Cookies Per Second should consider', toggle: false,
|
||||
};
|
||||
CM.Data.Config.AvgClicksHist = {
|
||||
type: 'bool', group: 'Calculation', label: ['Average Cookie Clicks for past 1s', 'Average Cookie Clicks for past 5s', 'Average Cookie Clicks for past 10s', 'Average Cookie Clicks for past 15s', 'Average Cookie Clicks for past 30s'], desc: 'How much time average Cookie Clicks should consider', toggle: false,
|
||||
};
|
||||
CM.Data.Config.ColorPPBulkMode = {
|
||||
type: 'bool', group: 'Calculation', label: ['Color of PP (Compared to Single)', 'Color of PP (Compared to Bulk)'], desc: 'Color PP-values based on comparison with single purchase or with selected bulk-buy mode', toggle: false, func: function () { CM.Cache.CachePP(); },
|
||||
};
|
||||
CM.Data.Config.PPExcludeTop = {
|
||||
type: 'bool', group: 'Calculation', label: ["Don't Ignore Any", 'Ignore 1st Best', 'Ignore 1st and 2nd Best', 'Ignore 1st, 2nd and 3rd Best'], desc: 'Makes CookieMonster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values', toggle: true,
|
||||
};
|
||||
CM.Data.Config.PPSecondsLowerLimit = {
|
||||
type: 'numscale', group: 'Calculation', label: 'Lower limit for PP (in seconds): ', desc: 'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option', min: 0, max: Infinity,
|
||||
};
|
||||
CM.Data.Config.PPOnlyConsiderBuyable = {
|
||||
type: 'bool', group: 'Calculation', label: ["Don't Ignore Non-Buyable", 'Ignore Non-Buyable'], desc: "Makes CookieMonster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'", toggle: true,
|
||||
};
|
||||
CM.Data.Config.ToolWarnBon = {
|
||||
type: 'bool', group: 'Calculation', label: ['Calculate Tooltip Warning With Bonus CPS OFF', 'Calculate Tooltip Warning With Bonus CPS ON'], desc: 'Calculate the warning with or without the bonus CPS you get from buying', toggle: true,
|
||||
};
|
||||
|
||||
// Notification
|
||||
CM.Data.Config.Title = {type: 'bool', group: 'NotificationGeneral', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns; "!" means that Golden Cookie/Reindeer can spawn', toggle: true};
|
||||
CM.Data.Config.GeneralSound = {type: 'bool', group: 'NotificationGeneral', label: ['Consider Game Volume Setting OFF', 'Consider Game Volume Setting ON'], desc: 'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down', toggle: true};
|
||||
CM.Data.Config.GCNotification = {type: 'bool', group: 'NotificationGC', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when Golden Cookie spawns', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.GCNotification);}};
|
||||
CM.Data.Config.GCFlash = {type: 'bool', group: 'NotificationGC', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Golden Cookie', toggle: true};
|
||||
CM.Data.Config.GCSound = {type: 'bool', group: 'NotificationGC', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Golden Cookie', toggle: true};
|
||||
CM.Data.Config.GCVolume = {type: 'vol', group: 'NotificationGC', label: [], desc: 'Volume'};
|
||||
CM.Data.Config.Title = {
|
||||
type: 'bool', group: 'NotificationGeneral', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns; "!" means that Golden Cookie/Reindeer can spawn', toggle: true,
|
||||
};
|
||||
CM.Data.Config.GeneralSound = {
|
||||
type: 'bool', group: 'NotificationGeneral', label: ['Consider Game Volume Setting OFF', 'Consider Game Volume Setting ON'], desc: 'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down', toggle: true,
|
||||
};
|
||||
CM.Data.Config.GCNotification = {
|
||||
type: 'bool', group: 'NotificationGC', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when Golden Cookie spawns', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.GCNotification); },
|
||||
};
|
||||
CM.Data.Config.GCFlash = {
|
||||
type: 'bool', group: 'NotificationGC', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Golden Cookie', toggle: true,
|
||||
};
|
||||
CM.Data.Config.GCSound = {
|
||||
type: 'bool', group: 'NotificationGC', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Golden Cookie', toggle: true,
|
||||
};
|
||||
CM.Data.Config.GCVolume = {
|
||||
type: 'vol', group: 'NotificationGC', label: [], desc: 'Volume',
|
||||
};
|
||||
for (let i = 0; i < 101; i++) {
|
||||
CM.Data.Config.GCVolume.label[i] = i + '%';
|
||||
CM.Data.Config.GCVolume.label[i] = `${i}%`;
|
||||
}
|
||||
CM.Data.Config.GCSoundURL = {type: 'url', group: 'NotificationGC', label: 'Sound URL:', desc: 'URL of the sound to be played when a Golden Cookie spawns'};
|
||||
CM.Data.Config.FortuneNotification = {type: 'bool', group: 'NotificationFC', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when Fortune Cookie is on the Ticker', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.FortuneNotification);}};
|
||||
CM.Data.Config.FortuneFlash = {type: 'bool', group: 'NotificationFC', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Fortune Cookie', toggle: true};
|
||||
CM.Data.Config.FortuneSound = {type: 'bool', group: 'NotificationFC', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Fortune Cookie', toggle: true};
|
||||
CM.Data.Config.FortuneVolume = {type: 'vol', group: 'NotificationFC', label: [], desc: 'Volume'};
|
||||
CM.Data.Config.GCSoundURL = {
|
||||
type: 'url', group: 'NotificationGC', label: 'Sound URL:', desc: 'URL of the sound to be played when a Golden Cookie spawns',
|
||||
};
|
||||
CM.Data.Config.FortuneNotification = {
|
||||
type: 'bool', group: 'NotificationFC', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when Fortune Cookie is on the Ticker', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.FortuneNotification); },
|
||||
};
|
||||
CM.Data.Config.FortuneFlash = {
|
||||
type: 'bool', group: 'NotificationFC', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Fortune Cookie', toggle: true,
|
||||
};
|
||||
CM.Data.Config.FortuneSound = {
|
||||
type: 'bool', group: 'NotificationFC', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Fortune Cookie', toggle: true,
|
||||
};
|
||||
CM.Data.Config.FortuneVolume = {
|
||||
type: 'vol', group: 'NotificationFC', label: [], desc: 'Volume',
|
||||
};
|
||||
for (let i = 0; i < 101; i++) {
|
||||
CM.Data.Config.FortuneVolume.label[i] = i + '%';
|
||||
CM.Data.Config.FortuneVolume.label[i] = `${i}%`;
|
||||
}
|
||||
CM.Data.Config.FortuneSoundURL = {type: 'url', group: 'NotificationFC', label: 'Sound URL:', desc: 'URL of the sound to be played when the Ticker has a Fortune Cookie'};
|
||||
CM.Data.Config.SeaNotification = {type: 'bool', group: 'NotificationSea', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification on Season Popup', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.SeaNotification);}};
|
||||
CM.Data.Config.SeaFlash = {type: 'bool', group: 'NotificationSea', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Season Popup', toggle: true};
|
||||
CM.Data.Config.SeaSound = {type: 'bool', group: 'NotificationSea', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Season Popup', toggle: true};
|
||||
CM.Data.Config.SeaVolume = {type: 'vol', group: 'NotificationSea', label: [], desc: 'Volume'};
|
||||
CM.Data.Config.FortuneSoundURL = {
|
||||
type: 'url', group: 'NotificationFC', label: 'Sound URL:', desc: 'URL of the sound to be played when the Ticker has a Fortune Cookie',
|
||||
};
|
||||
CM.Data.Config.SeaNotification = {
|
||||
type: 'bool', group: 'NotificationSea', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification on Season Popup', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.SeaNotification); },
|
||||
};
|
||||
CM.Data.Config.SeaFlash = {
|
||||
type: 'bool', group: 'NotificationSea', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen on Season Popup', toggle: true,
|
||||
};
|
||||
CM.Data.Config.SeaSound = {
|
||||
type: 'bool', group: 'NotificationSea', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Season Popup', toggle: true,
|
||||
};
|
||||
CM.Data.Config.SeaVolume = {
|
||||
type: 'vol', group: 'NotificationSea', label: [], desc: 'Volume',
|
||||
};
|
||||
for (let i = 0; i < 101; i++) {
|
||||
CM.Data.Config.SeaVolume.label[i] = i + '%';
|
||||
CM.Data.Config.SeaVolume.label[i] = `${i}%`;
|
||||
}
|
||||
CM.Data.Config.SeaSoundURL = {type: 'url', group: 'NotificationSea', label: 'Sound URL:', desc: 'URL of the sound to be played when a Season Special spawns'};
|
||||
CM.Data.Config.GardFlash = {type: 'bool', group: 'NotificationGard', label: ['Garden Tick Flash OFF', 'Flash ON'], desc: 'Flash screen on Garden Tick', toggle: true};
|
||||
CM.Data.Config.GardSound = {type: 'bool', group: 'NotificationGard', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Garden Tick', toggle: true};
|
||||
CM.Data.Config.GardVolume = {type: 'vol', group: 'NotificationGard', label: [], desc: 'Volume'};
|
||||
CM.Data.Config.SeaSoundURL = {
|
||||
type: 'url', group: 'NotificationSea', label: 'Sound URL:', desc: 'URL of the sound to be played when a Season Special spawns',
|
||||
};
|
||||
CM.Data.Config.GardFlash = {
|
||||
type: 'bool', group: 'NotificationGard', label: ['Garden Tick Flash OFF', 'Flash ON'], desc: 'Flash screen on Garden Tick', toggle: true,
|
||||
};
|
||||
CM.Data.Config.GardSound = {
|
||||
type: 'bool', group: 'NotificationGard', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound on Garden Tick', toggle: true,
|
||||
};
|
||||
CM.Data.Config.GardVolume = {
|
||||
type: 'vol', group: 'NotificationGard', label: [], desc: 'Volume',
|
||||
};
|
||||
for (let i = 0; i < 101; i++) {
|
||||
CM.Data.Config.GardVolume.label[i] = i + '%';
|
||||
CM.Data.Config.GardVolume.label[i] = `${i}%`;
|
||||
}
|
||||
CM.Data.Config.GardSoundURL = {type: 'url', group: 'NotificationGard', label: 'Garden Tick Sound URL:', desc: 'URL of the sound to be played when the garden ticks'};
|
||||
CM.Data.Config.MagicNotification = {type: 'bool', group: 'NotificationMagi', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when magic reaches maximum', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.MagicNotification);}};
|
||||
CM.Data.Config.MagicFlash = {type: 'bool', group: 'NotificationMagi', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when magic reaches maximum', toggle: true};
|
||||
CM.Data.Config.MagicSound = {type: 'bool', group: 'NotificationMagi', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when magic reaches maximum', toggle: true};
|
||||
CM.Data.Config.MagicVolume = {type: 'vol', group: 'NotificationMagi', label: [], desc: 'Volume'};
|
||||
CM.Data.Config.GardSoundURL = {
|
||||
type: 'url', group: 'NotificationGard', label: 'Garden Tick Sound URL:', desc: 'URL of the sound to be played when the garden ticks',
|
||||
};
|
||||
CM.Data.Config.MagicNotification = {
|
||||
type: 'bool', group: 'NotificationMagi', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when magic reaches maximum', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.MagicNotification); },
|
||||
};
|
||||
CM.Data.Config.MagicFlash = {
|
||||
type: 'bool', group: 'NotificationMagi', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when magic reaches maximum', toggle: true,
|
||||
};
|
||||
CM.Data.Config.MagicSound = {
|
||||
type: 'bool', group: 'NotificationMagi', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when magic reaches maximum', toggle: true,
|
||||
};
|
||||
CM.Data.Config.MagicVolume = {
|
||||
type: 'vol', group: 'NotificationMagi', label: [], desc: 'Volume',
|
||||
};
|
||||
for (let i = 0; i < 101; i++) {
|
||||
CM.Data.Config.MagicVolume.label[i] = i + '%';
|
||||
CM.Data.Config.MagicVolume.label[i] = `${i}%`;
|
||||
}
|
||||
CM.Data.Config.MagicSoundURL = {type: 'url', group: 'NotificationMagi', label: 'Sound URL:', desc: 'URL of the sound to be played when magic reaches maxium'};
|
||||
CM.Data.Config.WrinklerNotification = {type: 'bool', group: 'NotificationWrink', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when a Wrinkler appears', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.WrinklerNotification);}};
|
||||
CM.Data.Config.WrinklerFlash = {type: 'bool', group: 'NotificationWrink', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when a Wrinkler appears', toggle: true};
|
||||
CM.Data.Config.WrinklerSound = {type: 'bool', group: 'NotificationWrink', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when a Wrinkler appears', toggle: true};
|
||||
CM.Data.Config.WrinklerVolume = {type: 'vol', group: 'NotificationWrink', label: [], desc: 'Volume'};
|
||||
CM.Data.Config.MagicSoundURL = {
|
||||
type: 'url', group: 'NotificationMagi', label: 'Sound URL:', desc: 'URL of the sound to be played when magic reaches maxium',
|
||||
};
|
||||
CM.Data.Config.WrinklerNotification = {
|
||||
type: 'bool', group: 'NotificationWrink', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when a Wrinkler appears', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.WrinklerNotification); },
|
||||
};
|
||||
CM.Data.Config.WrinklerFlash = {
|
||||
type: 'bool', group: 'NotificationWrink', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when a Wrinkler appears', toggle: true,
|
||||
};
|
||||
CM.Data.Config.WrinklerSound = {
|
||||
type: 'bool', group: 'NotificationWrink', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when a Wrinkler appears', toggle: true,
|
||||
};
|
||||
CM.Data.Config.WrinklerVolume = {
|
||||
type: 'vol', group: 'NotificationWrink', label: [], desc: 'Volume',
|
||||
};
|
||||
for (let i = 0; i < 101; i++) {
|
||||
CM.Data.Config.WrinklerVolume.label[i] = i + '%';
|
||||
CM.Data.Config.WrinklerVolume.label[i] = `${i}%`;
|
||||
}
|
||||
CM.Data.Config.WrinklerSoundURL = {type: 'url', group: 'NotificationWrink', label: 'Sound URL:', desc: 'URL of the sound to be played when a Wrinkler appears'};
|
||||
CM.Data.Config.WrinklerMaxNotification = {type: 'bool', group: 'NotificationWrinkMax', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when the maximum amount of Wrinklers has appeared', toggle: true, func: function () {CM.Config.CheckNotificationPermissions(CM.Options.WrinklerMaxNotification);}};
|
||||
CM.Data.Config.WrinklerMaxFlash = {type: 'bool', group: 'NotificationWrinkMax', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when the maximum amount of Wrinklers has appeared', toggle: true};
|
||||
CM.Data.Config.WrinklerMaxSound = {type: 'bool', group: 'NotificationWrinkMax', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when the maximum amount of Wrinklers has appeared', toggle: true};
|
||||
CM.Data.Config.WrinklerMaxVolume = {type: 'vol', group: 'NotificationWrinkMax', label: [], desc: 'Volume'};
|
||||
CM.Data.Config.WrinklerSoundURL = {
|
||||
type: 'url', group: 'NotificationWrink', label: 'Sound URL:', desc: 'URL of the sound to be played when a Wrinkler appears',
|
||||
};
|
||||
CM.Data.Config.WrinklerMaxNotification = {
|
||||
type: 'bool', group: 'NotificationWrinkMax', label: ['Notification OFF', 'Notification ON'], desc: 'Create a notification when the maximum amount of Wrinklers has appeared', toggle: true, func: function () { CM.Config.CheckNotificationPermissions(CM.Options.WrinklerMaxNotification); },
|
||||
};
|
||||
CM.Data.Config.WrinklerMaxFlash = {
|
||||
type: 'bool', group: 'NotificationWrinkMax', label: ['Flash OFF', 'Flash ON'], desc: 'Flash screen when the maximum amount of Wrinklers has appeared', toggle: true,
|
||||
};
|
||||
CM.Data.Config.WrinklerMaxSound = {
|
||||
type: 'bool', group: 'NotificationWrinkMax', label: ['Sound OFF', 'Sound ON'], desc: 'Play a sound when the maximum amount of Wrinklers has appeared', toggle: true,
|
||||
};
|
||||
CM.Data.Config.WrinklerMaxVolume = {
|
||||
type: 'vol', group: 'NotificationWrinkMax', label: [], desc: 'Volume',
|
||||
};
|
||||
for (let i = 0; i < 101; i++) {
|
||||
CM.Data.Config.WrinklerMaxVolume.label[i] = i + '%';
|
||||
CM.Data.Config.WrinklerMaxVolume.label[i] = `${i}%`;
|
||||
}
|
||||
CM.Data.Config.WrinklerMaxSoundURL = {type: 'url', group: 'NotificationWrinkMax', label: 'Sound URL:', desc: 'URL of the sound to be played when the maximum amount of Wrinklers has appeared'};
|
||||
CM.Data.Config.WrinklerMaxSoundURL = {
|
||||
type: 'url', group: 'NotificationWrinkMax', label: 'Sound URL:', desc: 'URL of the sound to be played when the maximum amount of Wrinklers has appeared',
|
||||
};
|
||||
|
||||
// Tooltip
|
||||
CM.Data.Config.TooltipBuildUpgrade = {type: 'bool', group: 'Tooltip', label: ['Building/Upgrade Tooltip Information OFF', 'Building/Upgrade Tooltip Information ON'], desc: 'Extra information in Building/Upgrade tooltips', toggle: true};
|
||||
CM.Data.Config.TooltipAmor = {type: 'bool', group: 'Tooltip', label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true};
|
||||
CM.Data.Config.ToolWarnLucky = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Warning OFF', 'Tooltip Lucky Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards', toggle: true};
|
||||
CM.Data.Config.ToolWarnLuckyFrenzy = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Frenzy Warning OFF', 'Tooltip Lucky Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards', toggle: true};
|
||||
CM.Data.Config.ToolWarnConjure = {type: 'bool', group: 'Tooltip', label: ['Tooltip Conjure Warning OFF', 'Tooltip Conjure Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards', toggle: true};
|
||||
CM.Data.Config.ToolWarnConjureFrenzy = {type: 'bool', group: 'Tooltip', label: ['Tooltip Conjure Frenzy Warning OFF', 'Tooltip Conjure Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active', toggle: true};
|
||||
CM.Data.Config.ToolWarnEdifice = {type: 'bool', group: 'Tooltip', label: ['Tooltip Edifice Warning OFF', 'Tooltip Edifice Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building', toggle: true};
|
||||
CM.Data.Config.ToolWarnUser = {type: 'numscale', group: 'Tooltip', label: 'Tooltip Warning At x times CPS: ', desc: 'Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether', min: 0, max: Infinity};
|
||||
CM.Data.Config.ToolWarnPos = {type: 'bool', group: 'Tooltip', label: ['Tooltip Warning Position (Left)', 'Tooltip Warning Position (Bottom)'], desc: 'Placement of the warning boxes', toggle: false, func: function() {CM.Disp.ToggleToolWarnPos();}};
|
||||
CM.Data.Config.TooltipGrim = {type: 'bool', group: 'Tooltip', label: ['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'], desc: 'Extra information in tooltip for grimoire', toggle: true};
|
||||
CM.Data.Config.TooltipWrink = {type: 'bool', group: 'Tooltip', label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true};
|
||||
CM.Data.Config.TooltipLump = {type: 'bool', group: 'Tooltip', label: ['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'], desc: 'Shows the current Sugar Lump type in Sugar lump tooltip.', toggle: true};
|
||||
CM.Data.Config.TooltipPlots = {type: 'bool', group: 'Tooltip', label: ['Garden Plots Tooltip OFF', 'Garden Plots Tooltip ON'], desc: 'Shows a tooltip for plants that have a cookie reward.', toggle: true};
|
||||
CM.Data.Config.DragonAuraInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'], desc: 'Shows information about changes in CPS and costs in the dragon aura interface.', toggle: true};
|
||||
CM.Data.Config.TooltipAscendButton = {type: 'bool', group: 'Tooltip', label: ['Show Extra Info Ascend Tooltip OFF', 'Show Extra Info Ascend Tooltip ON'], desc: 'Shows additional info in the ascend tooltip', toggle: true};
|
||||
CM.Data.Config.TooltipBuildUpgrade = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Building/Upgrade Tooltip Information OFF', 'Building/Upgrade Tooltip Information ON'], desc: 'Extra information in Building/Upgrade tooltips', toggle: true,
|
||||
};
|
||||
CM.Data.Config.TooltipAmor = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true,
|
||||
};
|
||||
CM.Data.Config.ToolWarnLucky = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Warning OFF', 'Tooltip Lucky Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards', toggle: true,
|
||||
};
|
||||
CM.Data.Config.ToolWarnLuckyFrenzy = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Frenzy Warning OFF', 'Tooltip Lucky Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards', toggle: true,
|
||||
};
|
||||
CM.Data.Config.ToolWarnConjure = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Tooltip Conjure Warning OFF', 'Tooltip Conjure Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards', toggle: true,
|
||||
};
|
||||
CM.Data.Config.ToolWarnConjureFrenzy = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Tooltip Conjure Frenzy Warning OFF', 'Tooltip Conjure Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active', toggle: true,
|
||||
};
|
||||
CM.Data.Config.ToolWarnEdifice = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Tooltip Edifice Warning OFF', 'Tooltip Edifice Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building', toggle: true,
|
||||
};
|
||||
CM.Data.Config.ToolWarnUser = {
|
||||
type: 'numscale', group: 'Tooltip', label: 'Tooltip Warning At x times CPS: ', desc: 'Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether', min: 0, max: Infinity,
|
||||
};
|
||||
CM.Data.Config.ToolWarnPos = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Tooltip Warning Position (Left)', 'Tooltip Warning Position (Bottom)'], desc: 'Placement of the warning boxes', toggle: false, func: function () { CM.Disp.ToggleToolWarnPos(); },
|
||||
};
|
||||
CM.Data.Config.TooltipGrim = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'], desc: 'Extra information in tooltip for grimoire', toggle: true,
|
||||
};
|
||||
CM.Data.Config.TooltipWrink = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true,
|
||||
};
|
||||
CM.Data.Config.TooltipLump = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'], desc: 'Shows the current Sugar Lump type in Sugar lump tooltip.', toggle: true,
|
||||
};
|
||||
CM.Data.Config.TooltipPlots = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Garden Plots Tooltip OFF', 'Garden Plots Tooltip ON'], desc: 'Shows a tooltip for plants that have a cookie reward.', toggle: true,
|
||||
};
|
||||
CM.Data.Config.DragonAuraInfo = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'], desc: 'Shows information about changes in CPS and costs in the dragon aura interface.', toggle: true,
|
||||
};
|
||||
CM.Data.Config.TooltipAscendButton = {
|
||||
type: 'bool', group: 'Tooltip', label: ['Show Extra Info Ascend Tooltip OFF', 'Show Extra Info Ascend Tooltip ON'], desc: 'Shows additional info in the ascend tooltip', toggle: true,
|
||||
};
|
||||
|
||||
// Statistics
|
||||
CM.Data.Config.Stats = {type: 'bool', group: 'Statistics', label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!', toggle: true};
|
||||
CM.Data.Config.MissingUpgrades = {type: 'bool', group: 'Statistics', label: ['Missing Upgrades OFF', 'Missing Upgrades ON'], desc: 'Shows Missing upgrades in Stats Menu. This feature can be laggy for users with a low amount of unlocked achievements.', toggle: true};
|
||||
CM.Data.Config.UpStats = {type: 'bool', group: 'Statistics', label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false};
|
||||
CM.Data.Config.TimeFormat = {type: 'bool', group: 'Statistics', label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false};
|
||||
CM.Data.Config.DetailedTime = {type: 'bool', group: 'Statistics', label: ['Detailed Time OFF', 'Detailed Time ON'], desc: 'Change how time is displayed in certain statistics and tooltips', toggle: true, func: function() {CM.Disp.ToggleDetailedTime();}};
|
||||
CM.Data.Config.GrimoireBar = {type: 'bool', group: 'Statistics', label: ['Grimoire Magic Meter Timer OFF', 'Grimoire Magic Meter Timer ON'], desc: 'A timer on how long before the Grimoire magic meter is full', toggle: true};
|
||||
CM.Data.Config.HeavenlyChipsTarget = {type: 'numscale', group: 'Statistics', label: 'Heavenly Chips Target: ', desc: 'Use this to set a Heavenly Chips target that will be counted towards in the "prestige" statsistics sections', min: 1, max: Infinity};
|
||||
CM.Data.Config.ShowMissedGC = {type: 'bool', group: 'Statistics', label: ['Missed GC OFF', 'Missed GC ON'], desc: 'Show a stat in the statistics screen that counts how many Golden Cookies you have missed', toggle: true};
|
||||
CM.Data.Config.Stats = {
|
||||
type: 'bool', group: 'Statistics', label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!', toggle: true,
|
||||
};
|
||||
CM.Data.Config.MissingUpgrades = {
|
||||
type: 'bool', group: 'Statistics', label: ['Missing Upgrades OFF', 'Missing Upgrades ON'], desc: 'Shows Missing upgrades in Stats Menu. This feature can be laggy for users with a low amount of unlocked achievements.', toggle: true,
|
||||
};
|
||||
CM.Data.Config.UpStats = {
|
||||
type: 'bool', group: 'Statistics', label: ['Statistics Update Rate (Default)', 'Statistics Update Rate (1s)'], desc: 'Default Game rate is once every 5 seconds', toggle: false,
|
||||
};
|
||||
CM.Data.Config.TimeFormat = {
|
||||
type: 'bool', group: 'Statistics', label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false,
|
||||
};
|
||||
CM.Data.Config.DetailedTime = {
|
||||
type: 'bool', group: 'Statistics', label: ['Detailed Time OFF', 'Detailed Time ON'], desc: 'Change how time is displayed in certain statistics and tooltips', toggle: true, func: function () { CM.Disp.ToggleDetailedTime(); },
|
||||
};
|
||||
CM.Data.Config.GrimoireBar = {
|
||||
type: 'bool', group: 'Statistics', label: ['Grimoire Magic Meter Timer OFF', 'Grimoire Magic Meter Timer ON'], desc: 'A timer on how long before the Grimoire magic meter is full', toggle: true,
|
||||
};
|
||||
CM.Data.Config.HeavenlyChipsTarget = {
|
||||
type: 'numscale', group: 'Statistics', label: 'Heavenly Chips Target: ', desc: 'Use this to set a Heavenly Chips target that will be counted towards in the "prestige" statsistics sections', min: 1, max: Infinity,
|
||||
};
|
||||
CM.Data.Config.ShowMissedGC = {
|
||||
type: 'bool', group: 'Statistics', label: ['Missed GC OFF', 'Missed GC ON'], desc: 'Show a stat in the statistics screen that counts how many Golden Cookies you have missed', toggle: true,
|
||||
};
|
||||
|
||||
// Notation
|
||||
CM.Data.Config.Scale = {type: 'bool', group: 'Notation', label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Short Scale (Abbreviated)', 'Scientific Notation', 'Engineering Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}};
|
||||
CM.Data.Config.ScaleDecimals = {type: 'bool', group: 'Notation', label: ['1 decimals', '2 decimals', '3 decimals'], desc: 'Set the number of decimals used when applicable', toggle: false, func: function() {CM.Disp.RefreshScale();}};
|
||||
CM.Data.Config.ScaleSeparator = {type: 'bool', group: 'Notation', label: ['. for decimals (Standard)', '. for thousands'], desc: 'Set the separator used for decimals and thousands', toggle: false, func: function() {CM.Disp.RefreshScale();}};
|
||||
CM.Data.Config.ScaleCutoff = {type: 'numscale', group: 'Notation', label: 'Notation Cut-off Point: ', desc: 'The number from which CookieMonster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations', min: 1, max: 999999999};
|
||||
CM.Data.Config.Scale = {
|
||||
type: 'bool', group: 'Notation', label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Short Scale (Abbreviated)', 'Scientific Notation', 'Engineering Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function () { CM.Disp.RefreshScale(); },
|
||||
};
|
||||
CM.Data.Config.ScaleDecimals = {
|
||||
type: 'bool', group: 'Notation', label: ['1 decimals', '2 decimals', '3 decimals'], desc: 'Set the number of decimals used when applicable', toggle: false, func: function () { CM.Disp.RefreshScale(); },
|
||||
};
|
||||
CM.Data.Config.ScaleSeparator = {
|
||||
type: 'bool', group: 'Notation', label: ['. for decimals (Standard)', '. for thousands'], desc: 'Set the separator used for decimals and thousands', toggle: false, func: function () { CM.Disp.RefreshScale(); },
|
||||
};
|
||||
CM.Data.Config.ScaleCutoff = {
|
||||
type: 'numscale', group: 'Notation', label: 'Notation Cut-off Point: ', desc: 'The number from which CookieMonster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations', min: 1, max: 999999999,
|
||||
};
|
||||
|
||||
// Miscellaneous
|
||||
CM.Data.Config.GCTimer = {type: 'bool', group: 'Miscellaneous', label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', toggle: true, func: function() {CM.Disp.ToggleGCTimer();}};
|
||||
CM.Data.Config.Favicon = {type: 'bool', group: 'Miscellaneous', label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}};
|
||||
CM.Data.Config.WrinklerButtons = {type: 'bool', group: 'Miscellaneous', label: ['Extra Buttons OFF', 'Extra Buttons ON'], desc: 'Show buttons for popping wrinklers at bottom of cookie section', toggle: true, func: function() {CM.Disp.UpdateWrinklerButtons();}};
|
||||
CM.Data.Config.BulkBuyBlock = {type: 'bool', group: 'Miscellaneous', label: ['Block Bulk Buying OFF', 'Block Bulk Buying ON'], desc: "Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.", toggle: true};
|
||||
|
||||
CM.Data.Config.GCTimer = {
|
||||
type: 'bool', group: 'Miscellaneous', label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', toggle: true, func: function () { CM.Disp.ToggleGCTimer(); },
|
||||
};
|
||||
CM.Data.Config.Favicon = {
|
||||
type: 'bool', group: 'Miscellaneous', label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function () { CM.Disp.UpdateFavicon(); },
|
||||
};
|
||||
CM.Data.Config.WrinklerButtons = {
|
||||
type: 'bool', group: 'Miscellaneous', label: ['Extra Buttons OFF', 'Extra Buttons ON'], desc: 'Show buttons for popping wrinklers at bottom of cookie section', toggle: true, func: function () { CM.Disp.UpdateWrinklerButtons(); },
|
||||
};
|
||||
CM.Data.Config.BulkBuyBlock = {
|
||||
type: 'bool', group: 'Miscellaneous', label: ['Block Bulk Buying OFF', 'Block Bulk Buying ON'], desc: "Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.", toggle: true,
|
||||
};
|
||||
|
||||
/**
|
||||
* This array describes all default settings
|
||||
@@ -337,14 +510,18 @@ CM.Data.ConfigDefault = {
|
||||
ScaleDecimals: 2,
|
||||
ScaleSeparator: 0,
|
||||
ScaleCutoff: 999999,
|
||||
Colors: {Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3', Pink: '#ff1493', Brown: '#8b4513'},
|
||||
Colors: {
|
||||
Blue: '#4bb8f0', Green: '#00ff00', Yellow: '#ffff00', Orange: '#ff7f00', Red: '#ff0000', Purple: '#ff00ff', Gray: '#b3b3b3', Pink: '#ff1493', Brown: '#8b4513',
|
||||
},
|
||||
SortBuildings: 0,
|
||||
SortUpgrades: 0,
|
||||
GCTimer: 1,
|
||||
Favicon: 1,
|
||||
WrinklerButtons: 1,
|
||||
BulkBuyBlock: 0,
|
||||
Header: {BarsColors: 1, Calculation: 1, Notification: 1, NotificationGeneral: 1, NotificationGC: 1, NotificationFC: 1, NotificationSea: 1, NotificationGard: 1, NotificationMagi: 1, NotificationWrink: 1, NotificationWrinkMax: 1, Tooltip: 1, Statistics: 1, Notation: 1, Miscellaneous: 1, Lucky: 1, Chain: 1, Spells: 1, Garden: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1, InfoTab: 1},
|
||||
Header: {
|
||||
BarsColors: 1, Calculation: 1, Notification: 1, NotificationGeneral: 1, NotificationGC: 1, NotificationFC: 1, NotificationSea: 1, NotificationGard: 1, NotificationMagi: 1, NotificationWrink: 1, NotificationWrinkMax: 1, Tooltip: 1, Statistics: 1, Notation: 1, Miscellaneous: 1, Lucky: 1, Chain: 1, Spells: 1, Garden: 1, Prestige: 1, Wrink: 1, Sea: 1, Misc: 1, InfoTab: 1,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -355,11 +532,13 @@ CM.Data.ModDescription = `<div class="listing">
|
||||
<a href="https://github.com/Aktanusa/CookieMonster" target="blank">Cookie Monster</a>
|
||||
offers a wide range of tools and statistics to enhance your game experience.
|
||||
It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.</br>
|
||||
Progess on new updates and all previous release notes can be found on the GitHub page linked above!
|
||||
Progess on new updates and all previous release notes can be found on the GitHub page linked above!</br>
|
||||
Please also report any bugs you may find over there!</br>
|
||||
</div>
|
||||
`
|
||||
`;
|
||||
CM.Data.LatestReleaseNotes = `<div class="listing">
|
||||
<b>The latest update (v 2.031.4) has introduced the following features:</b></br
|
||||
<b>The latest update (v 2.031.4) has introduced the following features:</b></br>
|
||||
- Added a changelog to the info tab and notification indicating a new version</br>
|
||||
- Warnings in tooltips are now based on the income after buying the upgrade</br>
|
||||
- A new warning and stat for Conjure Baked Goods in combination with Frenzy has been added</br>
|
||||
- User can now set a custom tooltip warning ("x times cps") in the settings</br>
|
||||
@@ -368,6 +547,7 @@ CM.Data.LatestReleaseNotes = `<div class="listing">
|
||||
- The Ascend button can now display additional info (this can be turned off in the settings) </br>
|
||||
- The statistics page now displays the Heavenly Chips per second</br>
|
||||
- The statistics page now displays the CPS needed for the next level in Chain Cookies</br>
|
||||
- The statistics page now displays the cookies needed for optimal rewards for garden plants</br>
|
||||
- You can now set a Heavenly Chips target in the settings which will be counted down to in the statistics page</br>
|
||||
- The color picker in the settings has been updated to its latest version</br>
|
||||
- The overlay of seconds/percentage of timers is now toggle able and more readable</br>
|
||||
@@ -387,5 +567,6 @@ CM.Data.LatestReleaseNotes = `<div class="listing">
|
||||
- Fixed the integration with mods that provide additional content, they should now no longer break CookieMonster</br>
|
||||
- The Timer bar will now disappear correctly when the Golden Switch has been activated</br>
|
||||
- Fixed errors in the calculation of the Chain Cookies and Wrinkler stats</br>
|
||||
- Fixed buy warnings showing incorrectly</br>
|
||||
</div>
|
||||
`
|
||||
`;
|
||||
|
||||
1543
src/Disp.js
1543
src/Disp.js
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
||||
/**********
|
||||
/**
|
||||
* Footer *
|
||||
**********/
|
||||
*/
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to base game modding API */
|
||||
|
||||
/**
|
||||
@@ -12,16 +12,16 @@
|
||||
* It starts the further initialization of CookieMonster and registers hooks
|
||||
*/
|
||||
CM.init = function () {
|
||||
CM.Footer.isInitzializing = true
|
||||
CM.Footer.isInitzializing = true;
|
||||
let proceed = true;
|
||||
if (Game.version != CM.VersionMajor) {
|
||||
proceed = confirm('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' is meant for Game version ' + CM.VersionMajor + '. Loading a different version may cause errors. Do you still want to load Cookie Monster?');
|
||||
if (Game.version !== Number(CM.VersionMajor)) {
|
||||
proceed = confirm(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} is meant for Game version ${CM.VersionMajor}. Loading a different version may cause errors. Do you still want to load Cookie Monster?`);
|
||||
}
|
||||
if (proceed) {
|
||||
CM.Main.DelayInit();
|
||||
Game.registerHook('draw', CM.Disp.Draw);
|
||||
Game.registerHook('logic', CM.Main.Loop);
|
||||
CM.Footer.isInitzializing = false
|
||||
CM.Footer.isInitzializing = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ CM.init = function() {
|
||||
CM.save = function () {
|
||||
return JSON.stringify({
|
||||
settings: CM.Options,
|
||||
version: CM.VersionMajor + '.' + CM.VersionMinor,
|
||||
version: `${CM.VersionMajor}.${CM.VersionMinor}`,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -42,15 +42,15 @@ CM.save = function() {
|
||||
* "do stuff with the string data you saved previously"
|
||||
*/
|
||||
CM.load = function (str) {
|
||||
let save = JSON.parse(str);
|
||||
const save = JSON.parse(str);
|
||||
CM.Config.LoadConfig(save.settings);
|
||||
if (save.version !== CM.VersionMajor + '.' + CM.VersionMinor) {
|
||||
if (save.version !== `${CM.VersionMajor}.${CM.VersionMinor}`) {
|
||||
if (Game.prefs.popups) Game.Popup('A new version of Cookie Monster has been loaded, check out the release notes in the info tab!');
|
||||
else Game.Notify('A new version of Cookie Monster has been loaded, check out the release notes in the info tab!', '', '', 0, 1);
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to the initialization of CookieMonster */
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ CM.Footer.AddJscolor = function() {
|
||||
*/
|
||||
if (typeof CM.Footer.isInitzializing === 'undefined') {
|
||||
CM.Footer.AddJscolor();
|
||||
let delay = setInterval(function() {
|
||||
const delay = setInterval(function () {
|
||||
if (typeof jscolor !== 'undefined') {
|
||||
jscolor.init();
|
||||
Game.registerMod('CookieMonster', CM);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/* eslint-disable no-redeclare */
|
||||
/* eslint-disable no-unused-vars */
|
||||
/**********
|
||||
/**
|
||||
* Header *
|
||||
**********/
|
||||
*/
|
||||
|
||||
const CM = {
|
||||
Backup: {},
|
||||
|
||||
121
src/Main.js
121
src/Main.js
@@ -1,8 +1,8 @@
|
||||
/********
|
||||
/**
|
||||
* Main *
|
||||
********/
|
||||
*/
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to the main and initialization loop */
|
||||
|
||||
/**
|
||||
@@ -10,13 +10,13 @@
|
||||
* CM.init registers it to the "logic" hook provided by the modding api
|
||||
*/
|
||||
CM.Main.Loop = function () {
|
||||
if (CM.Disp.lastAscendState != Game.OnAscend) {
|
||||
if (CM.Disp.lastAscendState !== Game.OnAscend) {
|
||||
CM.Disp.lastAscendState = Game.OnAscend;
|
||||
CM.Disp.UpdateAscendState();
|
||||
}
|
||||
if (!Game.OnAscend && Game.AscendTimer === 0) {
|
||||
// Check if any other mods have been loaded
|
||||
if (CM.Main.LastModCount != Object.keys(Game.mods).length) {
|
||||
if (CM.Main.LastModCount !== Object.keys(Game.mods).length) {
|
||||
CM.Sim.CreateSimFunctions();
|
||||
CM.Sim.InitData();
|
||||
CM.Cache.InitCache();
|
||||
@@ -41,12 +41,11 @@ CM.Main.Loop = function() {
|
||||
}
|
||||
|
||||
// Check for aura change to recalculate buildings prices
|
||||
let hasBuildAura = Game.auraMult('Fierce Hoarder') > 0;
|
||||
const hasBuildAura = Game.auraMult('Fierce Hoarder') > 0;
|
||||
if (!CM.Cache.HadBuildAura && hasBuildAura) {
|
||||
CM.Cache.HadBuildAura = true;
|
||||
CM.Cache.DoRemakeBuildPrices = 1;
|
||||
}
|
||||
else if (CM.Cache.HadBuildAura && !hasBuildAura) {
|
||||
} else if (CM.Cache.HadBuildAura && !hasBuildAura) {
|
||||
CM.Cache.HadBuildAura = false;
|
||||
CM.Cache.DoRemakeBuildPrices = 1;
|
||||
}
|
||||
@@ -80,7 +79,7 @@ CM.Main.DelayInit = function() {
|
||||
CM.Cache.InitCache();
|
||||
|
||||
// Stored to check if we need to re-initiliaze data
|
||||
CM.Main.LastModCount = Object.keys(Game.mods).length
|
||||
CM.Main.LastModCount = Object.keys(Game.mods).length;
|
||||
|
||||
// Creating visual elements
|
||||
CM.Disp.CreateCssArea();
|
||||
@@ -89,7 +88,7 @@ CM.Main.DelayInit = function() {
|
||||
CM.Disp.CreateUpgradeBar();
|
||||
CM.Disp.CreateWhiteScreen();
|
||||
CM.Disp.CreateFavicon();
|
||||
for (let i of Object.keys(CM.Disp.TooltipText)) {
|
||||
for (const i of Object.keys(CM.Disp.TooltipText)) {
|
||||
CM.Disp.CreateSimpleTooltip(CM.Disp.TooltipText[i][0], CM.Disp.TooltipText[i][1], CM.Disp.TooltipText[i][2]);
|
||||
}
|
||||
CM.Disp.CreateWrinklerButtons();
|
||||
@@ -105,14 +104,13 @@ CM.Main.DelayInit = function() {
|
||||
CM.Config.LoadConfig(); // Must be after all things are created!
|
||||
CM.Disp.lastAscendState = Game.OnAscend;
|
||||
|
||||
if (Game.prefs.popups) Game.Popup('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!');
|
||||
else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!', '', '', 1, 1);
|
||||
if (Game.prefs.popups) Game.Popup(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} loaded!`);
|
||||
else Game.Notify(`Cookie Monster version ${CM.VersionMajor}.${CM.VersionMinor} loaded!`, '', '', 1, 1);
|
||||
|
||||
Game.Win('Third-party');
|
||||
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to replacing stuff */
|
||||
|
||||
/**
|
||||
@@ -124,7 +122,8 @@ CM.Main.ReplaceNative = function() {
|
||||
Beautify = CM.Disp.Beautify;
|
||||
|
||||
CM.Backup.CalculateGains = Game.CalculateGains;
|
||||
eval('CM.Backup.CalculateGainsMod = ' + Game.CalculateGains.toString().split('ages\');').join('ages\');CM.Sim.DateAges = Date.now();').split('if (Game.Has(\'Century').join('CM.Sim.DateCentury = Date.now();if (Game.Has(\'Century'));
|
||||
eval(`CM.Backup.CalculateGainsMod = ${Game.CalculateGains.toString().split('ages\');').join('ages\');CM.Sim.DateAges = Date.now();').split('if (Game.Has(\'Century')
|
||||
.join('CM.Sim.DateCentury = Date.now();if (Game.Has(\'Century')}`);
|
||||
Game.CalculateGains = function () {
|
||||
CM.Backup.CalculateGainsMod();
|
||||
CM.Sim.DoSims = 1;
|
||||
@@ -132,13 +131,13 @@ CM.Main.ReplaceNative = function() {
|
||||
|
||||
CM.Backup.tooltip = {};
|
||||
CM.Backup.tooltip.draw = Game.tooltip.draw;
|
||||
eval('CM.Backup.tooltip.drawMod = ' + Game.tooltip.draw.toString().split('this').join('Game.tooltip'));
|
||||
eval(`CM.Backup.tooltip.drawMod = ${Game.tooltip.draw.toString().split('this').join('Game.tooltip')}`);
|
||||
Game.tooltip.draw = function (from, text, origin) {
|
||||
CM.Backup.tooltip.drawMod(from, text, origin);
|
||||
};
|
||||
|
||||
CM.Backup.tooltip.update = Game.tooltip.update;
|
||||
eval('CM.Backup.tooltip.updateMod = ' + Game.tooltip.update.toString().split('this.').join('Game.tooltip.'));
|
||||
eval(`CM.Backup.tooltip.updateMod = ${Game.tooltip.update.toString().split('this.').join('Game.tooltip.')}`);
|
||||
Game.tooltip.update = function () {
|
||||
CM.Backup.tooltip.updateMod();
|
||||
CM.Disp.UpdateTooltipLocation();
|
||||
@@ -206,7 +205,7 @@ CM.Main.ReplaceNative = function() {
|
||||
|
||||
CM.Backup.sayTime = Game.sayTime;
|
||||
CM.Disp.sayTime = function (time, detail) {
|
||||
if (isNaN(time) || time <= 0) return CM.Backup.sayTime(time, detail);
|
||||
if (Number.isNaN(time) || time <= 0) return CM.Backup.sayTime(time, detail);
|
||||
else return CM.Disp.FormatTime(time / Game.fps, 1);
|
||||
};
|
||||
|
||||
@@ -241,9 +240,9 @@ CM.Main.ReplaceNativeGrimoire = function() {
|
||||
*/
|
||||
CM.Main.ReplaceNativeGrimoireLaunch = function () {
|
||||
if (!CM.Main.HasReplaceNativeGrimoireLaunch && Game.Objects['Wizard tower'].minigameLoaded) {
|
||||
let minigame = Game.Objects['Wizard tower'].minigame;
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
CM.Backup.GrimoireLaunch = minigame.launch;
|
||||
eval('CM.Backup.GrimoireLaunchMod = ' + minigame.launch.toString().split('=this').join('= Game.Objects[\'Wizard tower\'].minigame'));
|
||||
eval(`CM.Backup.GrimoireLaunchMod = ${minigame.launch.toString().split('=this').join('= Game.Objects[\'Wizard tower\'].minigame')}`);
|
||||
Game.Objects['Wizard tower'].minigame.launch = function () {
|
||||
CM.Backup.GrimoireLaunchMod();
|
||||
CM.Main.ReplaceTooltipGrimoire();
|
||||
@@ -260,19 +259,19 @@ CM.Main.ReplaceNativeGrimoireLaunch = function() {
|
||||
*/
|
||||
CM.Main.ReplaceNativeGrimoireDraw = function () {
|
||||
if (!CM.Main.HasReplaceNativeGrimoireDraw && Game.Objects['Wizard tower'].minigameLoaded) {
|
||||
let minigame = Game.Objects['Wizard tower'].minigame;
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
CM.Backup.GrimoireDraw = minigame.draw;
|
||||
Game.Objects['Wizard tower'].minigame.draw = function () {
|
||||
CM.Backup.GrimoireDraw();
|
||||
if (CM.Options.GrimoireBar === 1 && minigame.magic < minigame.magicM) {
|
||||
minigame.magicBarTextL.innerHTML += ' (' + CM.Disp.FormatTime(CM.Disp.CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, minigame.magicM)) + ')';
|
||||
minigame.magicBarTextL.innerHTML += ` (${CM.Disp.FormatTime(CM.Disp.CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, minigame.magicM))})`;
|
||||
}
|
||||
};
|
||||
CM.Main.HasReplaceNativeGrimoireDraw = true;
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to first initizalition of CM */
|
||||
|
||||
/**
|
||||
@@ -295,7 +294,7 @@ CM.Main.ReplaceTooltips = function() {
|
||||
Game.LoadMinigames();
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to replacing tooltips */
|
||||
|
||||
/**
|
||||
@@ -305,11 +304,11 @@ CM.Main.ReplaceTooltips = function() {
|
||||
*/
|
||||
CM.Main.ReplaceTooltipBuild = function () {
|
||||
CM.Main.TooltipBuildBackup = [];
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
let me = Game.Objects[i];
|
||||
if (l('product' + me.id).onmouseover != null) {
|
||||
CM.Main.TooltipBuildBackup[i] = l('product' + me.id).onmouseover;
|
||||
eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}');
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
const me = Game.Objects[i];
|
||||
if (l(`product${me.id}`).onmouseover !== null) {
|
||||
CM.Main.TooltipBuildBackup[i] = l(`product${me.id}`).onmouseover;
|
||||
eval(`l('product' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip('b', '${i}');}, 'store'); Game.tooltip.wobble();}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -334,10 +333,10 @@ CM.Main.ReplaceTooltipLump = function() {
|
||||
CM.Main.ReplaceTooltipGrimoire = function () {
|
||||
if (Game.Objects['Wizard tower'].minigameLoaded) {
|
||||
CM.Main.TooltipGrimoireBackup = [];
|
||||
for (let i in Game.Objects['Wizard tower'].minigame.spellsById) {
|
||||
if (l('grimoireSpell' + i).onmouseover != null) {
|
||||
CM.Main.TooltipGrimoireBackup[i] = l('grimoireSpell' + i).onmouseover;
|
||||
eval('l(\'grimoireSpell\' + i).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'g\', \'' + i + '\');}, \'this\'); Game.tooltip.wobble();}');
|
||||
for (const i in Game.Objects['Wizard tower'].minigame.spellsById) {
|
||||
if (l(`grimoireSpell${i}`).onmouseover !== null) {
|
||||
CM.Main.TooltipGrimoireBackup[i] = l(`grimoireSpell${i}`).onmouseover;
|
||||
eval(`l('grimoireSpell' + i).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip('g', '${i}');}, 'this'); Game.tooltip.wobble();}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,13 +351,13 @@ CM.Main.ReplaceTooltipGarden = function() {
|
||||
if (Game.Objects.Farm.minigameLoaded) {
|
||||
l('gardenTool-1').onmouseover = function () { Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function () { return CM.Disp.Tooltip('ha', 'HarvestAllButton'); }, 'this'); Game.tooltip.wobble(); };
|
||||
Array.from(l('gardenPlot').children).forEach((child) => {
|
||||
let coords = child.id.slice(-3,);
|
||||
const coords = child.id.slice(-3);
|
||||
child.onmouseover = function () { Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function () { return CM.Disp.Tooltip('p', [`${coords[0]}`, `${coords[2]}`]); }, 'this'); Game.tooltip.wobble(); };
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to checking for changes in Minigames/GC's/Ticker */
|
||||
|
||||
/**
|
||||
@@ -369,7 +368,7 @@ CM.Main.ReplaceTooltipGarden = function() {
|
||||
CM.Main.FindShimmer = function () {
|
||||
CM.Main.currSpawnedGoldenCookieState = 0;
|
||||
CM.Cache.goldenShimmersByID = {};
|
||||
for (let i of Object.keys(Game.shimmers)) {
|
||||
for (const i of Object.keys(Game.shimmers)) {
|
||||
CM.Cache.goldenShimmersByID[Game.shimmers[i].id] = Game.shimmers[i];
|
||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'golden') {
|
||||
CM.Cache.spawnedGoldenShimmer = Game.shimmers[i];
|
||||
@@ -384,23 +383,23 @@ CM.Main.FindShimmer = function() {
|
||||
*/
|
||||
CM.Main.CheckGoldenCookie = function () {
|
||||
CM.Main.FindShimmer();
|
||||
for (let i of Object.keys(CM.Disp.GCTimers)) {
|
||||
if (typeof CM.Cache.goldenShimmersByID[i] === "undefined") {
|
||||
for (const i of Object.keys(CM.Disp.GCTimers)) {
|
||||
if (typeof CM.Cache.goldenShimmersByID[i] === 'undefined') {
|
||||
CM.Disp.GCTimers[i].parentNode.removeChild(CM.Disp.GCTimers[i]);
|
||||
delete CM.Disp.GCTimers[i];
|
||||
}
|
||||
}
|
||||
if (CM.Main.lastGoldenCookieState != Game.shimmerTypes.golden.n) {
|
||||
if (CM.Main.lastGoldenCookieState !== Game.shimmerTypes.golden.n) {
|
||||
CM.Main.lastGoldenCookieState = Game.shimmerTypes.golden.n;
|
||||
if (CM.Main.lastGoldenCookieState) {
|
||||
if (CM.Main.lastSpawnedGoldenCookieState < CM.Main.currSpawnedGoldenCookieState) {
|
||||
CM.Disp.Flash(3, 'GCFlash');
|
||||
CM.Disp.PlaySound(CM.Options.GCSoundURL, 'GCSound', 'GCVolume');
|
||||
CM.Disp.Notification('GCNotification', "Golden Cookie Spawned", "A Golden Cookie has spawned. Click it now!");
|
||||
CM.Disp.Notification('GCNotification', 'Golden Cookie Spawned', 'A Golden Cookie has spawned. Click it now!');
|
||||
}
|
||||
|
||||
for (let i of Object.keys(Game.shimmers)) {
|
||||
if (typeof CM.Disp.GCTimers[Game.shimmers[i].id] === "undefined") {
|
||||
for (const i of Object.keys(Game.shimmers)) {
|
||||
if (typeof CM.Disp.GCTimers[Game.shimmers[i].id] === 'undefined') {
|
||||
CM.Disp.CreateGCTimer(Game.shimmers[i]);
|
||||
}
|
||||
}
|
||||
@@ -408,9 +407,8 @@ CM.Main.CheckGoldenCookie = function() {
|
||||
CM.Disp.UpdateFavicon();
|
||||
CM.Main.lastSpawnedGoldenCookieState = CM.Main.currSpawnedGoldenCookieState;
|
||||
if (CM.Main.currSpawnedGoldenCookieState === 0) CM.Cache.spawnedGoldenShimmer = 0;
|
||||
}
|
||||
else if (CM.Options.GCTimer === 1 && CM.Main.lastGoldenCookieState) {
|
||||
for (let i of Object.keys(CM.Disp.GCTimers)) {
|
||||
} else if (CM.Options.GCTimer === 1 && CM.Main.lastGoldenCookieState) {
|
||||
for (const i of Object.keys(CM.Disp.GCTimers)) {
|
||||
CM.Disp.GCTimers[i].style.opacity = CM.Cache.goldenShimmersByID[i].l.style.opacity;
|
||||
CM.Disp.GCTimers[i].style.transform = CM.Cache.goldenShimmersByID[i].l.style.transform;
|
||||
CM.Disp.GCTimers[i].textContent = Math.ceil(CM.Cache.goldenShimmersByID[i].life / Game.fps);
|
||||
@@ -423,9 +421,9 @@ CM.Main.CheckGoldenCookie = function() {
|
||||
* It is called by CM.Main.Loop
|
||||
*/
|
||||
CM.Main.CheckSeasonPopup = function () {
|
||||
if (CM.Main.lastSeasonPopupState != Game.shimmerTypes.reindeer.spawned) {
|
||||
if (CM.Main.lastSeasonPopupState !== Game.shimmerTypes.reindeer.spawned) {
|
||||
CM.Main.lastSeasonPopupState = Game.shimmerTypes.reindeer.spawned;
|
||||
for (let i of Object.keys(Game.shimmers)) {
|
||||
for (const i of Object.keys(Game.shimmers)) {
|
||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'reindeer') {
|
||||
CM.Cache.seasonPopShimmer = Game.shimmers[i];
|
||||
break;
|
||||
@@ -433,7 +431,7 @@ CM.Main.CheckSeasonPopup = function() {
|
||||
}
|
||||
CM.Disp.Flash(3, 'SeaFlash');
|
||||
CM.Disp.PlaySound(CM.Options.SeaSoundURL, 'SeaSound', 'SeaVolume');
|
||||
CM.Disp.Notification('SeaNotification',"Reindeer sighted!", "A Reindeer has spawned. Click it now!");
|
||||
CM.Disp.Notification('SeaNotification', 'Reindeer sighted!', 'A Reindeer has spawned. Click it now!');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -442,12 +440,12 @@ CM.Main.CheckSeasonPopup = function() {
|
||||
* It is called by CM.Main.Loop
|
||||
*/
|
||||
CM.Main.CheckTickerFortune = function () {
|
||||
if (CM.Main.lastTickerFortuneState != (Game.TickerEffect && Game.TickerEffect.type === 'fortune')) {
|
||||
if (CM.Main.lastTickerFortuneState !== (Game.TickerEffect && Game.TickerEffect.type === 'fortune')) {
|
||||
CM.Main.lastTickerFortuneState = (Game.TickerEffect && Game.TickerEffect.type === 'fortune');
|
||||
if (CM.Main.lastTickerFortuneState) {
|
||||
CM.Disp.Flash(3, 'FortuneFlash');
|
||||
CM.Disp.PlaySound(CM.Options.FortuneSoundURL, 'FortuneSound', 'FortuneVolume');
|
||||
CM.Disp.Notification('FortuneNotification', "Fortune Cookie found", "A Fortune Cookie has appeared on the Ticker.");
|
||||
CM.Disp.Notification('FortuneNotification', 'Fortune Cookie found', 'A Fortune Cookie has appeared on the Ticker.');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -457,8 +455,8 @@ CM.Main.CheckTickerFortune = function() {
|
||||
* It is called by CM.Main.Loop
|
||||
*/
|
||||
CM.Main.CheckGardenTick = function () {
|
||||
if (Game.Objects.Farm.minigameLoaded && CM.Main.lastGardenNextStep != Game.Objects.Farm.minigame.nextStep) {
|
||||
if (CM.Main.lastGardenNextStep != 0 && CM.Main.lastGardenNextStep < Date.now()) {
|
||||
if (Game.Objects.Farm.minigameLoaded && CM.Main.lastGardenNextStep !== Game.Objects.Farm.minigame.nextStep) {
|
||||
if (CM.Main.lastGardenNextStep !== 0 && CM.Main.lastGardenNextStep < Date.now()) {
|
||||
CM.Disp.Flash(3, 'GardFlash');
|
||||
CM.Disp.PlaySound(CM.Options.GardSoundURL, 'GardSound', 'GardVolume');
|
||||
}
|
||||
@@ -472,13 +470,13 @@ CM.Main.CheckGardenTick = function() {
|
||||
*/
|
||||
CM.Main.CheckMagicMeter = function () {
|
||||
if (Game.Objects['Wizard tower'].minigameLoaded && CM.Options.GrimoireBar === 1) {
|
||||
let minigame = Game.Objects['Wizard tower'].minigame;
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
if (minigame.magic < minigame.magicM) CM.Main.lastMagicBarFull = false;
|
||||
else if (!CM.Main.lastMagicBarFull) {
|
||||
CM.Main.lastMagicBarFull = true;
|
||||
CM.Disp.Flash(3, 'MagicFlash');
|
||||
CM.Disp.PlaySound(CM.Options.MagicSoundURL, 'MagicSound', 'MagicVolume');
|
||||
CM.Disp.Notification('MagicNotification', "Magic Meter full", "Your Magic Meter is full. Cast a spell!");
|
||||
CM.Disp.Notification('MagicNotification', 'Magic Meter full', 'Your Magic Meter is full. Cast a spell!');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -490,7 +488,7 @@ CM.Main.CheckMagicMeter = function() {
|
||||
CM.Main.CheckWrinklerCount = function () {
|
||||
if (Game.elderWrath > 0) {
|
||||
let CurrentWrinklers = 0;
|
||||
for (let i in Game.wrinklers) {
|
||||
for (const i in Game.wrinklers) {
|
||||
if (Game.wrinklers[i].phase === 2) CurrentWrinklers++;
|
||||
}
|
||||
if (CurrentWrinklers > CM.Main.lastWrinklerCount) {
|
||||
@@ -506,9 +504,9 @@ CM.Main.CheckWrinklerCount = function() {
|
||||
CM.Disp.PlaySound(CM.Options.WrinklerSoundURL, 'WrinklerSound', 'WrinklerVolume');
|
||||
}
|
||||
if (CurrentWrinklers === Game.getWrinklersMax() && CM.Options.WrinklerMaxNotification) {
|
||||
CM.Disp.Notification('WrinklerMaxNotification', "Maximum Wrinklers Reached", "You have reached your maximum ammount of wrinklers");
|
||||
CM.Disp.Notification('WrinklerMaxNotification', 'Maximum Wrinklers Reached', 'You have reached your maximum ammount of wrinklers');
|
||||
} else {
|
||||
CM.Disp.Notification('WrinklerNotification', "A Wrinkler appeared", "A new wrinkler has appeared");
|
||||
CM.Disp.Notification('WrinklerNotification', 'A Wrinkler appeared', 'A new wrinkler has appeared');
|
||||
}
|
||||
} else {
|
||||
CM.Main.lastWrinklerCount = CurrentWrinklers;
|
||||
@@ -526,13 +524,13 @@ CM.Main.AddWrinklerAreaDetect = function() {
|
||||
l('backgroundLeftCanvas').onmouseout = function () {
|
||||
CM.Disp.TooltipWrinklerArea = 0;
|
||||
Game.tooltip.hide();
|
||||
for (let i of Object.keys(Game.wrinklers)) {
|
||||
for (const i of Object.keys(Game.wrinklers)) {
|
||||
CM.Disp.TooltipWrinklerBeingShown[i] = 0;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to the mouse */
|
||||
|
||||
/**
|
||||
@@ -542,12 +540,11 @@ CM.Main.AddWrinklerAreaDetect = function() {
|
||||
*/
|
||||
CM.Main.FixMouseY = function (target) {
|
||||
if (CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 0) {
|
||||
let timerBarHeight = parseInt(CM.Disp.TimerBar.style.height);
|
||||
const timerBarHeight = parseInt(CM.Disp.TimerBar.style.height);
|
||||
Game.mouseY -= timerBarHeight;
|
||||
target();
|
||||
Game.mouseY += timerBarHeight;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
target();
|
||||
}
|
||||
};
|
||||
|
||||
261
src/Sim.js
261
src/Sim.js
@@ -1,8 +1,8 @@
|
||||
/*******
|
||||
/**
|
||||
* Sim *
|
||||
*******/
|
||||
*/
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions to calculate building buy and sell prices */
|
||||
|
||||
/**
|
||||
@@ -19,7 +19,7 @@
|
||||
CM.Sim.BuildingGetPrice = function (build, basePrice, start, free, increase) {
|
||||
let moni = 0;
|
||||
for (let i = 0; i < increase; i++) {
|
||||
let price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free));
|
||||
let price = basePrice * Game.priceIncrease ** Math.max(0, start - free);
|
||||
price = Game.modifyBuildingPrice(build, price);
|
||||
price = Math.ceil(price);
|
||||
moni += price;
|
||||
@@ -49,7 +49,7 @@ CM.Sim.modifyBuildingPrice = function(building, price) {
|
||||
if (building.fortune && CM.Sim.Has(building.fortune.name)) price *= 0.93;
|
||||
price *= CM.Sim.eff('buildingCost');
|
||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||
let godLvl = CM.Sim.hasGod('creation');
|
||||
const godLvl = CM.Sim.hasGod('creation');
|
||||
if (godLvl === 1) price *= 0.93;
|
||||
else if (godLvl === 2) price *= 0.95;
|
||||
else if (godLvl === 3) price *= 0.98;
|
||||
@@ -83,15 +83,15 @@ CM.Sim.getSellMultiplier = function() {
|
||||
CM.Sim.BuildingSell = function (build, basePrice, start, free, amount, noSim) {
|
||||
// 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;
|
||||
noSim = typeof noSim === 'undefined' ? 0 : noSim;
|
||||
let moni = 0;
|
||||
if (amount === -1) amount = start;
|
||||
if (!amount) amount = Game.buyBulk;
|
||||
for (let i = 0; i < amount; i++) {
|
||||
let price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free));
|
||||
let price = basePrice * Game.priceIncrease ** Math.max(0, start - free);
|
||||
price = noSim ? Game.modifyBuildingPrice(build, price) : CM.Sim.modifyBuildingPrice(build, price);
|
||||
price = Math.ceil(price);
|
||||
let giveBack = noSim ? build.getSellMultiplier() : CM.Sim.getSellMultiplier();
|
||||
const giveBack = noSim ? build.getSellMultiplier() : CM.Sim.getSellMultiplier();
|
||||
price = Math.floor(price * giveBack);
|
||||
if (start > 0) {
|
||||
moni += price;
|
||||
@@ -101,7 +101,7 @@ CM.Sim.BuildingSell = function(build, basePrice, start, free, amount, noSim) {
|
||||
return moni;
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to making functions that check against sim data rather than game data */
|
||||
|
||||
/**
|
||||
@@ -115,37 +115,37 @@ CM.Sim.BuildingSell = function(build, basePrice, start, free, amount, noSim) {
|
||||
*/
|
||||
CM.Sim.ReplaceFunction = function (funcToBeReplaced) {
|
||||
return funcToBeReplaced.toString()
|
||||
.split("Game.Upgrades[") // Include '[' to not replace Game.UpgradesByPool
|
||||
.join("CM.Sim.Upgrades[")
|
||||
.split("Game.Achievements")
|
||||
.join("CM.Sim.Achievements")
|
||||
.split("Game.Has")
|
||||
.join("CM.Sim.Has")
|
||||
.split("Game.dragonAura]")
|
||||
.join("CM.Sim.dragonAura]")
|
||||
.split("Game.dragonAura2]")
|
||||
.join("CM.Sim.dragonAura2]")
|
||||
.split("Game.auraMult")
|
||||
.join("CM.Sim.auraMult")
|
||||
.split("Game.hasGod")
|
||||
.join("CM.Sim.hasGod")
|
||||
.split("M.gods[what]") // Replaces code in the Pantheon minigame
|
||||
.join("CM.Sim.Objects.Temple.minigame.gods[what]")
|
||||
.split("M.slot[i]") // Replaces code in the Pantheon minigame
|
||||
.join("CM.Sim.Objects.Temple.minigame.slot[i]")
|
||||
.split("Game.effs") // Replaces code in the Pantheon minigame
|
||||
.join("CM.Sim.effs")
|
||||
.split("Game.Objects")
|
||||
.join("CM.Sim.Objects")
|
||||
.split("Game.GetTieredCpsMult") // Replace in .cps of building objects
|
||||
.join("CM.Sim.GetTieredCpsMult")
|
||||
.split('Game.Upgrades[') // Include '[' to not replace Game.UpgradesByPool
|
||||
.join('CM.Sim.Upgrades[')
|
||||
.split('Game.Achievements')
|
||||
.join('CM.Sim.Achievements')
|
||||
.split('Game.Has')
|
||||
.join('CM.Sim.Has')
|
||||
.split('Game.dragonAura]')
|
||||
.join('CM.Sim.dragonAura]')
|
||||
.split('Game.dragonAura2]')
|
||||
.join('CM.Sim.dragonAura2]')
|
||||
.split('Game.auraMult')
|
||||
.join('CM.Sim.auraMult')
|
||||
.split('Game.hasGod')
|
||||
.join('CM.Sim.hasGod')
|
||||
.split('M.gods[what]') // Replaces code in the Pantheon minigame
|
||||
.join('CM.Sim.Objects.Temple.minigame.gods[what]')
|
||||
.split('M.slot[i]') // Replaces code in the Pantheon minigame
|
||||
.join('CM.Sim.Objects.Temple.minigame.slot[i]')
|
||||
.split('Game.effs') // Replaces code in the Pantheon minigame
|
||||
.join('CM.Sim.effs')
|
||||
.split('Game.Objects')
|
||||
.join('CM.Sim.Objects')
|
||||
.split('Game.GetTieredCpsMult') // Replace in .cps of building objects
|
||||
.join('CM.Sim.GetTieredCpsMult')
|
||||
.split('Game.eff') // Replace in .cps of building objects
|
||||
.join('CM.Sim.eff');
|
||||
// .split('syn.buildingTie1.amount')
|
||||
// .join('CM.Sim.Objects[syn.buildingTie1.name].amount')
|
||||
// .split('syn.buildingTie2.amount')
|
||||
// .join('CM.Sim.Objects[syn.buildingTie2.name].amount')
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This functions creates all functions by CM.Sim to check CM.Sim. data instead of Game. data
|
||||
@@ -163,7 +163,7 @@ CM.Sim.CreateSimFunctions = function() {
|
||||
CM.Sim.auraMult = new Function(`return ${CM.Sim.ReplaceFunction(Game.auraMult)}`)();
|
||||
CM.Sim.eff = new Function(`return ${CM.Sim.ReplaceFunction(Game.eff)}`)();
|
||||
CM.Sim.GetTieredCpsMult = new Function(`return ${CM.Sim.ReplaceFunction(Game.GetTieredCpsMult)}`)();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This function "wins" an achievement in the current sim data
|
||||
@@ -175,12 +175,12 @@ CM.Sim.Win = function(what) {
|
||||
if (CM.Sim.Achievements[what]) {
|
||||
if (CM.Sim.Achievements[what].won === 0) {
|
||||
CM.Sim.Achievements[what].won = 1;
|
||||
if (Game.Achievements[what].pool != 'shadow') CM.Sim.AchievementsOwned++;
|
||||
if (Game.Achievements[what].pool !== 'shadow') CM.Sim.AchievementsOwned++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions used to create static objects of Buildings, Upgrades and Achievements */
|
||||
|
||||
/**
|
||||
@@ -194,8 +194,8 @@ CM.Sim.Win = function(what) {
|
||||
* @returns {Object} you The static object
|
||||
*/
|
||||
CM.Sim.InitialBuildingData = function (buildingName) {
|
||||
let me = Game.Objects[buildingName];
|
||||
let you = {};
|
||||
const me = Game.Objects[buildingName];
|
||||
const you = {};
|
||||
you.cps = new Function(`return ${CM.Sim.ReplaceFunction(me.cps)}`)();
|
||||
// Below is needed for above eval, specifically for the GetTieredCpsMult function
|
||||
you.baseCps = me.baseCps;
|
||||
@@ -204,9 +204,9 @@ CM.Sim.InitialBuildingData = function(buildingName) {
|
||||
you.synergies = me.synergies;
|
||||
you.fortune = me.fortune;
|
||||
you.grandma = me.grandma;
|
||||
you.baseCPS = me.baseCps
|
||||
you.id = me.id
|
||||
you.vanilla = me.vanilla
|
||||
you.baseCPS = me.baseCps;
|
||||
you.id = me.id;
|
||||
you.vanilla = me.vanilla;
|
||||
return you;
|
||||
};
|
||||
|
||||
@@ -217,8 +217,8 @@ CM.Sim.InitialBuildingData = function(buildingName) {
|
||||
* @returns {Object} you The static object
|
||||
*/
|
||||
CM.Sim.InitUpgrade = function (upgradeName) {
|
||||
let me = Game.Upgrades[upgradeName];
|
||||
let you = {};
|
||||
const me = Game.Upgrades[upgradeName];
|
||||
const you = {};
|
||||
// Some upgrades have a function for .power (notably the valentine cookies)
|
||||
you.power = me.power;
|
||||
if (typeof (me.power) === 'function') {
|
||||
@@ -236,13 +236,12 @@ CM.Sim.InitUpgrade = function(upgradeName) {
|
||||
* @returns {Object} you The static object
|
||||
*/
|
||||
CM.Sim.InitAchievement = function (achievementName) {
|
||||
let me = Game.Achievements[achievementName];
|
||||
let you = {};
|
||||
const me = Game.Achievements[achievementName];
|
||||
const you = {};
|
||||
you.name = me.name;
|
||||
return you;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This function creates static objects for Buildings, Upgrades and Achievements
|
||||
* It is called by CM.Main.DelayInit()
|
||||
@@ -250,25 +249,25 @@ CM.Sim.InitAchievement = function(achievementName) {
|
||||
CM.Sim.InitData = function () {
|
||||
// Buildings
|
||||
CM.Sim.Objects = [];
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
CM.Sim.Objects[i] = CM.Sim.InitialBuildingData(i);
|
||||
}
|
||||
|
||||
// Upgrades
|
||||
CM.Sim.Upgrades = [];
|
||||
for (let i of Object.keys(Game.Upgrades)) {
|
||||
for (const i of Object.keys(Game.Upgrades)) {
|
||||
CM.Sim.Upgrades[i] = CM.Sim.InitUpgrade(i);
|
||||
}
|
||||
|
||||
// Achievements
|
||||
CM.Sim.Achievements = [];
|
||||
for (let i of Object.keys(Game.Achievements)) {
|
||||
for (const i of Object.keys(Game.Achievements)) {
|
||||
CM.Sim.Achievements[i] = CM.Sim.InitAchievement(i);
|
||||
}
|
||||
CM.Sim.CopyData();
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to creating a new iteration of "sim data" */
|
||||
|
||||
/**
|
||||
@@ -284,11 +283,12 @@ CM.Sim.CopyData = function() {
|
||||
CM.Sim.prestige = Game.prestige;
|
||||
|
||||
// Buildings
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
let me = Game.Objects[i];
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
const me = Game.Objects[i];
|
||||
let you = CM.Sim.Objects[i];
|
||||
if (you === undefined) { // New building!
|
||||
you = CM.Sim.Objects[i] = CM.Sim.InitialBuildingData(i);
|
||||
CM.Sim.Objects[i] = CM.Sim.InitialBuildingData(i);
|
||||
you = CM.Sim.Objects[i];
|
||||
CM.Disp.CreateBotBarBuildingColumn(i); // Add new building to the bottom bar
|
||||
}
|
||||
you.amount = me.amount;
|
||||
@@ -300,21 +300,23 @@ CM.Sim.CopyData = function() {
|
||||
}
|
||||
|
||||
// Upgrades
|
||||
for (let i of Object.keys(Game.Upgrades)) {
|
||||
let me = Game.Upgrades[i];
|
||||
for (const i of Object.keys(Game.Upgrades)) {
|
||||
const me = Game.Upgrades[i];
|
||||
let you = CM.Sim.Upgrades[i];
|
||||
if (you === undefined) {
|
||||
you = CM.Sim.Upgrades[i] = CM.Sim.InitUpgrade(i);
|
||||
CM.Sim.Upgrades[i] = CM.Sim.InitUpgrade(i);
|
||||
you = CM.Sim.Upgrades[i];
|
||||
}
|
||||
you.bought = me.bought;
|
||||
}
|
||||
|
||||
// Achievements
|
||||
for (let i of Object.keys(Game.Achievements)) {
|
||||
let me = Game.Achievements[i];
|
||||
for (const i of Object.keys(Game.Achievements)) {
|
||||
const me = Game.Achievements[i];
|
||||
let you = CM.Sim.Achievements[i];
|
||||
if (you === undefined) {
|
||||
you = CM.Sim.Achievements[i] = CM.Sim.InitAchievement(i);
|
||||
CM.Sim.Achievements[i] = CM.Sim.InitAchievement(i);
|
||||
you = CM.Sim.Achievements[i];
|
||||
}
|
||||
you.won = me.won;
|
||||
}
|
||||
@@ -325,7 +327,7 @@ CM.Sim.CopyData = function() {
|
||||
CM.Sim.dragonAura2 = CM.Cache.dragonAura2;
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to checking the CPS of the current sim data */
|
||||
|
||||
/**
|
||||
@@ -338,11 +340,11 @@ CM.Sim.CalculateGains = function() {
|
||||
CM.Sim.cookiesPs = 0;
|
||||
let mult = 1;
|
||||
// Include minigame effects
|
||||
let effs = {};
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
const effs = {};
|
||||
for (const i of Object.keys(Game.Objects)) {
|
||||
if (Game.Objects[i].minigameLoaded && Game.Objects[i].minigame.effs) {
|
||||
let myEffs = Game.Objects[i].minigame.effs;
|
||||
for (let ii in myEffs) {
|
||||
const myEffs = Game.Objects[i].minigame.effs;
|
||||
for (const ii in myEffs) {
|
||||
if (effs[ii]) effs[ii] *= myEffs[ii];
|
||||
else effs[ii] = myEffs[ii];
|
||||
}
|
||||
@@ -350,14 +352,14 @@ CM.Sim.CalculateGains = function() {
|
||||
}
|
||||
CM.Sim.effs = effs;
|
||||
|
||||
if (Game.ascensionMode != 1) mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * CM.Sim.GetHeavenlyMultiplier();
|
||||
if (Game.ascensionMode !== 1) mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * CM.Sim.GetHeavenlyMultiplier();
|
||||
|
||||
mult *= CM.Sim.eff('cps');
|
||||
|
||||
if (CM.Sim.Has('Heralds') && Game.ascensionMode != 1) mult *= 1 + 0.01 * Game.heralds;
|
||||
if (CM.Sim.Has('Heralds') && Game.ascensionMode !== 1) mult *= 1 + 0.01 * Game.heralds;
|
||||
|
||||
for (let i of Object.keys(Game.cookieUpgrades)) {
|
||||
let me = Game.cookieUpgrades[i];
|
||||
for (const i of Object.keys(Game.cookieUpgrades)) {
|
||||
const me = Game.cookieUpgrades[i];
|
||||
if (CM.Sim.Has(me.name)) {
|
||||
// Some upgrades have a functio as .power (notably the valentine cookies)
|
||||
// CM.Sim.InitialBuildingData has changed to use CM.Sim.Has instead of Game.Has etc.
|
||||
@@ -416,13 +418,13 @@ CM.Sim.CalculateGains = function() {
|
||||
|
||||
if (CM.Sim.Has('Santa\'s legacy')) mult *= 1 + (Game.santaLevel + 1) * 0.03;
|
||||
|
||||
let milkProgress = CM.Sim.AchievementsOwned / 25;
|
||||
const milkProgress = CM.Sim.AchievementsOwned / 25;
|
||||
let milkMult = 1;
|
||||
if (CM.Sim.Has('Santa\'s milk and cookies')) milkMult *= 1.05;
|
||||
// if (CM.Sim.hasAura('Breath of Milk')) milkMult *= 1.05;
|
||||
milkMult *= 1 + CM.Sim.auraMult('Breath of Milk') * 0.05;
|
||||
if (CM.Sim.hasGod) {
|
||||
let godLvl = CM.Sim.hasGod('mother');
|
||||
const godLvl = CM.Sim.hasGod('mother');
|
||||
if (godLvl === 1) milkMult *= 1.1;
|
||||
else if (godLvl === 2) milkMult *= 1.05;
|
||||
else if (godLvl === 3) milkMult *= 1.03;
|
||||
@@ -447,11 +449,11 @@ CM.Sim.CalculateGains = function() {
|
||||
if (CM.Sim.Has('Kitten angels')) catMult *= (1 + milkProgress * 0.1 * milkMult);
|
||||
if (CM.Sim.Has('Fortune #103')) catMult *= (1 + milkProgress * 0.05 * milkMult);
|
||||
|
||||
for (let i of Object.keys(CM.Sim.Objects)) {
|
||||
let me = CM.Sim.Objects[i];
|
||||
for (const i of Object.keys(CM.Sim.Objects)) {
|
||||
const me = CM.Sim.Objects[i];
|
||||
let storedCps = me.cps(me);
|
||||
if (Game.ascensionMode != 1) storedCps *= (1 + me.level * 0.01) * buildMult;
|
||||
if (me.name === "Grandma" && CM.Sim.Has('Milkhelp® lactose intolerance relief tablets')) storedCps *= 1 + 0.05 * milkProgress * milkMult;
|
||||
if (Game.ascensionMode !== 1) storedCps *= (1 + me.level * 0.01) * buildMult;
|
||||
if (me.name === 'Grandma' && CM.Sim.Has('Milkhelp® lactose intolerance relief tablets')) storedCps *= 1 + 0.05 * milkProgress * milkMult;
|
||||
CM.Sim.cookiesPs += me.amount * storedCps;
|
||||
}
|
||||
|
||||
@@ -477,7 +479,7 @@ CM.Sim.CalculateGains = function() {
|
||||
let day = Math.floor((CM.Sim.DateCentury - Game.startDate) / 1000 / 10) * 10 / 60 / 60 / 24;
|
||||
day = Math.min(day, 100);
|
||||
// Sets a Cache value to be displayed in the Stats page, could be moved...
|
||||
CM.Cache.CentEgg = 1 + (1 - Math.pow(1 - day / 100, 3)) * 0.1;
|
||||
CM.Cache.CentEgg = 1 + (1 - (1 - day / 100) ** 3) * 0.1;
|
||||
eggMult *= CM.Cache.CentEgg;
|
||||
}
|
||||
mult *= eggMult;
|
||||
@@ -487,20 +489,20 @@ CM.Sim.CalculateGains = function() {
|
||||
// if (CM.Sim.hasAura('Radiant Appetite')) mult *= 2;
|
||||
mult *= 1 + CM.Sim.auraMult('Radiant Appetite');
|
||||
|
||||
let rawCookiesPs = CM.Sim.cookiesPs * mult;
|
||||
for (let i of Object.keys(Game.CpsAchievements)) {
|
||||
const rawCookiesPs = CM.Sim.cookiesPs * mult;
|
||||
for (const i of Object.keys(Game.CpsAchievements)) {
|
||||
if (rawCookiesPs >= Game.CpsAchievements[i].threshold) CM.Sim.Win(Game.CpsAchievements[i].name);
|
||||
}
|
||||
|
||||
CM.Sim.cookiesPsRaw = rawCookiesPs;
|
||||
|
||||
let n = Game.shimmerTypes.golden.n;
|
||||
let auraMult = CM.Sim.auraMult('Dragon\'s Fortune');
|
||||
const n = Game.shimmerTypes.golden.n;
|
||||
const auraMult = CM.Sim.auraMult('Dragon\'s Fortune');
|
||||
for (let i = 0; i < n; i++) {
|
||||
mult *= 1 + auraMult * 1.23;
|
||||
}
|
||||
|
||||
let name = Game.bakeryName.toLowerCase();
|
||||
const name = Game.bakeryName.toLowerCase();
|
||||
if (name === 'orteil') mult *= 0.99;
|
||||
else if (name === 'ortiel') mult *= 0.98;
|
||||
|
||||
@@ -509,8 +511,8 @@ CM.Sim.CalculateGains = function() {
|
||||
if (CM.Sim.Has('Golden switch [off]')) {
|
||||
let goldenSwitchMult = 1.5;
|
||||
if (CM.Sim.Has('Residual luck')) {
|
||||
let upgrades = Game.goldenCookieUpgrades;
|
||||
for (let i of Object.keys(upgrades)) {
|
||||
const upgrades = Game.goldenCookieUpgrades;
|
||||
for (const i of Object.keys(upgrades)) {
|
||||
if (CM.Sim.Has(upgrades[i])) goldenSwitchMult += 0.1;
|
||||
}
|
||||
}
|
||||
@@ -541,7 +543,7 @@ CM.Sim.CalculateGains = function() {
|
||||
*/
|
||||
CM.Sim.CheckOtherAchiev = function () {
|
||||
let grandmas = 0;
|
||||
for (let i of Object.keys(Game.GrandmaSynergies)) {
|
||||
for (const i of Object.keys(Game.GrandmaSynergies)) {
|
||||
if (CM.Sim.Has(Game.GrandmaSynergies[i])) grandmas++;
|
||||
}
|
||||
if (!CM.Sim.HasAchiev('Elder') && grandmas >= 7) CM.Sim.Win('Elder');
|
||||
@@ -551,11 +553,11 @@ CM.Sim.CheckOtherAchiev = function() {
|
||||
let mathematician = 1;
|
||||
let base10 = 1;
|
||||
let minAmount = 100000;
|
||||
for (let i of Object.keys(CM.Sim.Objects)) {
|
||||
for (const i of Object.keys(CM.Sim.Objects)) {
|
||||
buildingsOwned += CM.Sim.Objects[i].amount;
|
||||
minAmount = Math.min(CM.Sim.Objects[i].amount, minAmount);
|
||||
if (!CM.Sim.HasAchiev('Mathematician')) {
|
||||
if (CM.Sim.Objects[i].amount < Math.min(128, Math.pow(2, (Game.ObjectsById.length - Game.Objects[i].id) - 1))) mathematician = 0;
|
||||
if (CM.Sim.Objects[i].amount < Math.min(128, 2 ** ((Game.ObjectsById.length - Game.Objects[i].id) - 1))) mathematician = 0;
|
||||
}
|
||||
if (!CM.Sim.HasAchiev('Base 10')) {
|
||||
if (CM.Sim.Objects[i].amount < (Game.ObjectsById.length - Game.Objects[i].id) * 10) base10 = 0;
|
||||
@@ -596,21 +598,21 @@ CM.Sim.CheckOtherAchiev = function() {
|
||||
if (CM.Sim.Objects.Cursor.amount + CM.Sim.Objects.Grandma.amount >= 777) CM.Sim.Win('The elder scrolls');
|
||||
|
||||
let hasAllHalloCook = true;
|
||||
for (let i of Object.keys(CM.Data.HalloCookies)) {
|
||||
for (const i of Object.keys(CM.Data.HalloCookies)) {
|
||||
if (!CM.Sim.Has(CM.Data.HalloCookies[i])) hasAllHalloCook = false;
|
||||
}
|
||||
if (hasAllHalloCook) CM.Sim.Win('Spooky cookies');
|
||||
|
||||
let hasAllChristCook = true;
|
||||
for (let i of Object.keys(CM.Data.ChristCookies)) {
|
||||
for (const i of Object.keys(CM.Data.ChristCookies)) {
|
||||
if (!CM.Sim.Has(CM.Data.ChristCookies[i])) hasAllChristCook = false;
|
||||
}
|
||||
if (hasAllChristCook) CM.Sim.Win('Let it snow');
|
||||
|
||||
if (CM.Sim.Has('Fortune cookies')) {
|
||||
let list = Game.Tiers.fortune.upgrades;
|
||||
const list = Game.Tiers.fortune.upgrades;
|
||||
let fortunes = 0;
|
||||
for (let i of Object.keys(list)) {
|
||||
for (const i of Object.keys(list)) {
|
||||
if (CM.Sim.Has(list[i].name)) fortunes++;
|
||||
}
|
||||
if (fortunes >= list.length) CM.Sim.Win('O Fortuna');
|
||||
@@ -628,7 +630,7 @@ CM.Sim.NoGoldSwitchCPS = function() {
|
||||
return CM.Sim.cookiesPs;
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to calculating Bonus Income */
|
||||
|
||||
/**
|
||||
@@ -640,7 +642,7 @@ CM.Sim.NoGoldSwitchCPS = function() {
|
||||
*/
|
||||
CM.Sim.BuyBuildingsBonusIncome = function (building, amount) {
|
||||
CM.Sim.CopyData();
|
||||
let me = CM.Sim.Objects[building];
|
||||
const me = CM.Sim.Objects[building];
|
||||
me.amount += amount;
|
||||
|
||||
if (building === 'Cursor') {
|
||||
@@ -655,21 +657,21 @@ CM.Sim.BuyBuildingsBonusIncome = function(building, amount) {
|
||||
if (me.amount >= 600) CM.Sim.Win('With her finger and her thumb');
|
||||
if (me.amount >= 700) CM.Sim.Win('Gotta hand it to you');
|
||||
if (me.amount >= 800) CM.Sim.Win('The devil\'s workshop');
|
||||
}
|
||||
else {
|
||||
for (let j in Game.Objects[me.name].tieredAchievs) {
|
||||
if (me.amount >= Game.Tiers[Game.Objects[me.name].tieredAchievs[j].tier].achievUnlock)
|
||||
} else {
|
||||
for (const j in Game.Objects[me.name].tieredAchievs) {
|
||||
if (me.amount >= Game.Tiers[Game.Objects[me.name].tieredAchievs[j].tier].achievUnlock) {
|
||||
CM.Sim.Win(Game.Objects[me.name].tieredAchievs[j].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
||||
const lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
||||
|
||||
CM.Sim.CalculateGains();
|
||||
|
||||
CM.Sim.CheckOtherAchiev();
|
||||
|
||||
if (lastAchievementsOwned != CM.Sim.AchievementsOwned) {
|
||||
if (lastAchievementsOwned !== CM.Sim.AchievementsOwned) {
|
||||
CM.Sim.CalculateGains();
|
||||
}
|
||||
|
||||
@@ -683,9 +685,9 @@ CM.Sim.BuyBuildingsBonusIncome = function(building, amount) {
|
||||
* @returns {[{number, number}]} The bonus income of the upgrade and the difference in MouseCPS
|
||||
*/
|
||||
CM.Sim.BuyUpgradesBonusIncome = function (upgrade) {
|
||||
if (Game.Upgrades[upgrade].pool === 'toggle' || (Game.Upgrades[upgrade].bought === 0 && Game.Upgrades[upgrade].unlocked && Game.Upgrades[upgrade].pool != 'prestige')) {
|
||||
if (Game.Upgrades[upgrade].pool === 'toggle' || (Game.Upgrades[upgrade].bought === 0 && Game.Upgrades[upgrade].unlocked && Game.Upgrades[upgrade].pool !== 'prestige')) {
|
||||
CM.Sim.CopyData();
|
||||
let me = CM.Sim.Upgrades[upgrade];
|
||||
const me = CM.Sim.Upgrades[upgrade];
|
||||
me.bought = 1;
|
||||
if (Game.CountsAsUpgradeOwned(Game.Upgrades[upgrade].pool)) CM.Sim.UpgradesOwned++;
|
||||
|
||||
@@ -693,28 +695,25 @@ CM.Sim.BuyUpgradesBonusIncome = function(upgrade) {
|
||||
CM.Sim.pledges++;
|
||||
if (CM.Sim.pledges > 0) CM.Sim.Win('Elder nap');
|
||||
if (CM.Sim.pledges >= 5) CM.Sim.Win('Elder slumber');
|
||||
}
|
||||
else if (upgrade === 'Elder Covenant') {
|
||||
} else if (upgrade === 'Elder Covenant') {
|
||||
CM.Sim.Win('Elder calm');
|
||||
}
|
||||
else if (upgrade === 'Prism heart biscuits') {
|
||||
} else if (upgrade === 'Prism heart biscuits') {
|
||||
CM.Sim.Win('Lovely cookies');
|
||||
}
|
||||
else if (upgrade === 'Heavenly key') {
|
||||
} else if (upgrade === 'Heavenly key') {
|
||||
CM.Sim.Win('Wholesome');
|
||||
}
|
||||
|
||||
let lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
||||
const lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
||||
|
||||
CM.Sim.CalculateGains();
|
||||
|
||||
CM.Sim.CheckOtherAchiev();
|
||||
|
||||
if (lastAchievementsOwned != CM.Sim.AchievementsOwned) {
|
||||
if (lastAchievementsOwned !== CM.Sim.AchievementsOwned) {
|
||||
CM.Sim.CalculateGains();
|
||||
}
|
||||
|
||||
let diffMouseCPS = CM.Sim.mouseCps() - Game.computedMouseCps;
|
||||
const diffMouseCPS = CM.Sim.mouseCps() - Game.computedMouseCps;
|
||||
if (diffMouseCPS) {
|
||||
return [CM.Sim.cookiesPs - Game.cookiesPs, diffMouseCPS];
|
||||
}
|
||||
@@ -724,7 +723,6 @@ CM.Sim.BuyUpgradesBonusIncome = function(upgrade) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This function calculates the cookies per click
|
||||
* It is called by CM.Sim.BuyUpgradesBonusIncome() when an upgrades has no bonus-income (and is thus a clicking-upgrade)
|
||||
@@ -743,9 +741,9 @@ CM.Sim.mouseCps = function() {
|
||||
if (CM.Sim.Has('Octillion fingers')) add *= 20;
|
||||
if (CM.Sim.Has('Nonillion fingers')) add *= 20;
|
||||
let num = 0;
|
||||
for (let i of Object.keys(CM.Sim.Objects)) {num += CM.Sim.Objects[i].amount;}
|
||||
for (const i of Object.keys(CM.Sim.Objects)) { num += CM.Sim.Objects[i].amount; }
|
||||
num -= CM.Sim.Objects.Cursor.amount;
|
||||
add = add * num;
|
||||
add *= num;
|
||||
|
||||
// Can use CM.Sim.cookiesPs as function is always called after CM.Sim.CalculateGains()
|
||||
if (CM.Sim.Has('Plastic mouse')) add += CM.Sim.cookiesPs * 0.01;
|
||||
@@ -777,15 +775,15 @@ CM.Sim.mouseCps = function() {
|
||||
mult *= CM.Sim.eff('click');
|
||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||
if (CM.Sim.hasGod) {
|
||||
let godLvl = CM.Sim.hasGod('labor');
|
||||
const godLvl = CM.Sim.hasGod('labor');
|
||||
if (godLvl === 1) mult *= 1.15;
|
||||
else if (godLvl === 2) mult *= 1.1;
|
||||
else if (godLvl === 3) mult *= 1.05;
|
||||
}
|
||||
}
|
||||
|
||||
for (let i of Object.keys(Game.buffs)) {
|
||||
if (typeof Game.buffs[i].multClick != 'undefined') mult *= Game.buffs[i].multClick;
|
||||
for (const i of Object.keys(Game.buffs)) {
|
||||
if (typeof Game.buffs[i].multClick !== 'undefined') mult *= Game.buffs[i].multClick;
|
||||
}
|
||||
|
||||
// if (CM.Sim.auraMult('Dragon Cursor')) mult*=1.05;
|
||||
@@ -801,8 +799,7 @@ CM.Sim.mouseCps = function() {
|
||||
return out;
|
||||
};
|
||||
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to calculating the effect of changing Dragon Aura */
|
||||
|
||||
/**
|
||||
@@ -815,19 +812,19 @@ CM.Sim.CalculateChangeAura = function(aura) {
|
||||
CM.Sim.CopyData();
|
||||
|
||||
// Check if aura being changed is first or second aura
|
||||
let auraToBeChanged = l('promptContent').children[0].innerHTML.includes("secondary");
|
||||
const auraToBeChanged = l('promptContent').children[0].innerHTML.includes('secondary');
|
||||
if (auraToBeChanged) CM.Sim.dragonAura2 = aura;
|
||||
else CM.Sim.dragonAura = aura;
|
||||
|
||||
// Sell highest building but only if aura is different
|
||||
let price = 0;
|
||||
if (CM.Sim.dragonAura != CM.Cache.dragonAura || CM.Sim.dragonAura2 != CM.Cache.dragonAura2) {
|
||||
for (let i = Game.ObjectsById.length; i > -1, --i;) {
|
||||
if (CM.Sim.dragonAura !== CM.Cache.dragonAura || CM.Sim.dragonAura2 !== CM.Cache.dragonAura2) {
|
||||
for (let i = Game.ObjectsById.length; i > -1; --i) {
|
||||
if (Game.ObjectsById[i].amount > 0) {
|
||||
let highestBuilding = CM.Sim.Objects[Game.ObjectsById[i].name].name;
|
||||
const highestBuilding = CM.Sim.Objects[Game.ObjectsById[i].name].name;
|
||||
CM.Sim.Objects[highestBuilding].amount -= 1;
|
||||
CM.Sim.buildingsOwned -= 1;
|
||||
price = CM.Sim.Objects[highestBuilding].basePrice * Math.pow(Game.priceIncrease, Math.max(0, CM.Sim.Objects[highestBuilding].amount - 1 -CM.Sim.Objects[highestBuilding].free));
|
||||
price = CM.Sim.Objects[highestBuilding].basePrice * Game.priceIncrease ** Math.max(0, CM.Sim.Objects[highestBuilding].amount - 1 - CM.Sim.Objects[highestBuilding].free);
|
||||
price = Game.modifyBuildingPrice(CM.Sim.Objects[highestBuilding], price);
|
||||
price = Math.ceil(price);
|
||||
break;
|
||||
@@ -835,17 +832,17 @@ CM.Sim.CalculateChangeAura = function(aura) {
|
||||
}
|
||||
}
|
||||
|
||||
let lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
||||
const lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
||||
CM.Sim.CalculateGains();
|
||||
|
||||
CM.Sim.CheckOtherAchiev();
|
||||
if (lastAchievementsOwned != CM.Sim.AchievementsOwned) {
|
||||
if (lastAchievementsOwned !== CM.Sim.AchievementsOwned) {
|
||||
CM.Sim.CalculateGains();
|
||||
}
|
||||
return [CM.Sim.cookiesPs - Game.cookiesPs, price];
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to calculating the reset bonus */
|
||||
|
||||
/**
|
||||
@@ -900,17 +897,17 @@ CM.Sim.ResetBonus = function(newHeavenlyChips) {
|
||||
|
||||
CM.Sim.prestige = newHeavenlyChips;
|
||||
|
||||
let lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
||||
const lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
||||
|
||||
CM.Sim.CalculateGains();
|
||||
|
||||
CM.Sim.CheckOtherAchiev();
|
||||
|
||||
if (lastAchievementsOwned != CM.Sim.AchievementsOwned) {
|
||||
if (lastAchievementsOwned !== CM.Sim.AchievementsOwned) {
|
||||
CM.Sim.CalculateGains();
|
||||
}
|
||||
|
||||
let ResetCPS = CM.Sim.cookiesPs - curCPS;
|
||||
const ResetCPS = CM.Sim.cookiesPs - curCPS;
|
||||
|
||||
// Reset Pretige level after calculation as it is used in CM.Sim.CalculateGains() so can't be local
|
||||
CM.Sim.prestige = Game.prestige;
|
||||
@@ -918,7 +915,7 @@ CM.Sim.ResetBonus = function(newHeavenlyChips) {
|
||||
return ResetCPS;
|
||||
};
|
||||
|
||||
/********
|
||||
/**
|
||||
* Section: Functions related to selling builings before buying the chocolate egg */
|
||||
|
||||
/**
|
||||
@@ -945,7 +942,7 @@ CM.Sim.SellBuildingsForChoEgg = function() {
|
||||
// Sacrifice highest buildings for the aura switch
|
||||
for (let i = 0; i < buildingsToSacrifice; ++i) {
|
||||
let highestBuilding = 0;
|
||||
for (let j in CM.Sim.Objects) {
|
||||
for (const j in CM.Sim.Objects) {
|
||||
if (CM.Sim.Objects[j].amount > 0) {
|
||||
highestBuilding = CM.Sim.Objects[j];
|
||||
}
|
||||
@@ -955,8 +952,8 @@ CM.Sim.SellBuildingsForChoEgg = function() {
|
||||
}
|
||||
|
||||
// Get money made by selling all remaining buildings
|
||||
for (let i of Object.keys(CM.Sim.Objects)) {
|
||||
let me = CM.Sim.Objects[i];
|
||||
for (const i of Object.keys(CM.Sim.Objects)) {
|
||||
const me = CM.Sim.Objects[i];
|
||||
sellTotal += CM.Sim.BuildingSell(Game.Objects[me.name], Game.Objects[i].basePrice, me.amount, Game.Objects[i].free, me.amount);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user