Fixed high number of ESLint errors
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||
import {
|
||||
ChoEggDiff,
|
||||
@@ -65,9 +64,9 @@ export class CMAvgQueue {
|
||||
* Called by CM.Cache.InitCache()
|
||||
*/
|
||||
export function InitCookiesDiff() {
|
||||
CookiesDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||
WrinkDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||
WrinkFattestDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||
ChoEggDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
|
||||
ClicksDiff = new CMAvgQueue(ClickTimes[ClickTimes.length - 1]);
|
||||
CookiesDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
||||
WrinkDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
||||
WrinkFattestDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
||||
ChoEggDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
|
||||
ClicksDiff = new CMAvgQueue(ClickTimes[ClickTimes.length - 1]); // eslint-disable-line no-unused-vars
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
|
||||
import {
|
||||
@@ -41,7 +39,7 @@ export default function CacheAvgCPS() {
|
||||
if ((Game.T / Game.fps) % 1 === 0) {
|
||||
let choEggTotal = Game.cookies + CacheSellForChoEgg;
|
||||
if (Game.cpsSucked > 0) choEggTotal += CacheWrinklersTotal;
|
||||
CacheRealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal);
|
||||
CacheRealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal); // eslint-disable-line no-unused-vars
|
||||
choEggTotal *= 0.05;
|
||||
|
||||
// Add recent gains to AvgQueue's
|
||||
@@ -89,8 +87,9 @@ export default function CacheAvgCPS() {
|
||||
CacheAverageGainBank +
|
||||
CacheAverageGainWrink +
|
||||
(choEgg ? CacheAverageGainChoEgg : 0);
|
||||
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
|
||||
} else CacheAvgCPSWithChoEgg = CacheAverageCPS; // eslint-disable-line no-unused-vars
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
CacheAverageClicks = ClicksDiff.calcAverage(
|
||||
ClickTimes[CMOptions.AvgClicksHist],
|
||||
);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||
import {
|
||||
CacheCurrWrinklerCount,
|
||||
@@ -23,8 +22,8 @@ export default function CacheCurrWrinklerCPS() {
|
||||
else if (godLvl === 2) godMult *= 1.1;
|
||||
else if (godLvl === 3) godMult *= 1.05;
|
||||
}
|
||||
CacheCurrWrinklerCount = count;
|
||||
CacheCurrWrinklerCPSMult =
|
||||
CacheCurrWrinklerCount = count; // eslint-disable-line no-unused-vars
|
||||
CacheCurrWrinklerCPSMult = // eslint-disable-line no-unused-vars
|
||||
count *
|
||||
(count * 0.05 * 1.1) *
|
||||
(Game.Has('Sacrilegious corruption') * 0.05 + 1) *
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import CalcNoGoldSwitchCPS from '../../Sim/Calculations/NoGoldenSwitchCalc';
|
||||
import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData';
|
||||
|
||||
@@ -10,5 +9,5 @@ import { CacheNoGoldSwitchCookiesPS } from '../VariablesAndData';
|
||||
export default function CacheNoGoldSwitchCPS() {
|
||||
if (Game.Has('Golden switch [off]')) {
|
||||
CacheNoGoldSwitchCookiesPS = CalcNoGoldSwitchCPS();
|
||||
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs;
|
||||
} else CacheNoGoldSwitchCookiesPS = Game.cookiesPs; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import SellBuildingsForChoEgg from '../../Sim/SimulationEvents/SellBuildingForChoEgg';
|
||||
import { CacheSellForChoEgg } from '../VariablesAndData';
|
||||
|
||||
@@ -21,5 +20,5 @@ export default function CacheSellAllForChoEgg() {
|
||||
}
|
||||
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)
|
||||
sellTotal += SellBuildingsForChoEgg();
|
||||
CacheSellForChoEgg = sellTotal;
|
||||
CacheSellForChoEgg = sellTotal; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { ClickTimes } from '../Disp/VariablesAndData';
|
||||
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
|
||||
import CacheAvgCPS from './CPS/CPS';
|
||||
@@ -34,8 +33,9 @@ export default function InitCache() {
|
||||
CacheAllMissingUpgrades();
|
||||
CacheSeasonSpec();
|
||||
InitCookiesDiff();
|
||||
HeavenlyChipsDiff = new CMAvgQueue(5); // Used by CM.Cache.CacheHeavenlyChipsPS()
|
||||
CacheAverageCookiesFromClicks = new CMAvgQueue(
|
||||
/** Used by CM.Cache.CacheHeavenlyChipsPS() */
|
||||
HeavenlyChipsDiff = new CMAvgQueue(5); // eslint-disable-line no-unused-vars
|
||||
CacheAverageCookiesFromClicks = new CMAvgQueue( // eslint-disable-line no-unused-vars
|
||||
ClickTimes[ClickTimes.length - 1] * 20,
|
||||
);
|
||||
CacheHeavenlyChipsPS();
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { FormatTime } from '../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
||||
import GetCPS from '../Disp/HelperFunctions/GetCPS';
|
||||
import CacheAvgCPS from './CPS/CPS';
|
||||
@@ -27,5 +26,5 @@ export default function LoopCache() {
|
||||
1,
|
||||
) -
|
||||
(Game.cookiesEarned + Game.cookiesReset);
|
||||
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS());
|
||||
CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS()); // eslint-disable-line no-unused-vars
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { CacheDragonAura, CacheDragonAura2 } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This functions caches the currently selected Dragon Auras
|
||||
*/
|
||||
export default function CacheDragonAuras() {
|
||||
CacheDragonAura = Game.dragonAura;
|
||||
CacheDragonAura2 = Game.dragonAura2;
|
||||
CacheDragonAura = Game.dragonAura; // eslint-disable-line no-unused-vars
|
||||
CacheDragonAura2 = Game.dragonAura2; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
/** Functions related to the Dragon */
|
||||
|
||||
import { Beautify } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
||||
@@ -6,8 +5,6 @@ import CopyData from '../../Sim/SimulationData/CopyData';
|
||||
import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData';
|
||||
import {
|
||||
CacheCostDragonUpgrade,
|
||||
CacheDragonAura,
|
||||
CacheDragonAura2,
|
||||
CacheLastDragonLevel,
|
||||
} from '../VariablesAndData';
|
||||
|
||||
@@ -70,7 +67,7 @@ export default function CacheDragonCost() {
|
||||
cost += price;
|
||||
SimObjects[target].amount -= 1;
|
||||
}
|
||||
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
||||
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`; // eslint-disable-line no-unused-vars
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import GetWrinkConfigBank from '../../Disp/HelperFunctions/GetWrinkConfigBank';
|
||||
import { ColourGray } from '../../Disp/VariablesAndData';
|
||||
@@ -20,16 +18,17 @@ import ColourOfPP from './ColourOfPP';
|
||||
function CacheColour(target, amount) {
|
||||
Object.keys(target).forEach((i) => {
|
||||
if (CMOptions.PPRigidelMode && amount === 1) {
|
||||
target[i].color = ColourGray;
|
||||
target[i].color = ColourGray; // eslint-disable-line no-param-reassign
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
target[i].color = ColourOfPP(
|
||||
target[i],
|
||||
Game.Objects[i].getSumPrice(amount),
|
||||
);
|
||||
// Colour based on excluding certain top-buildings
|
||||
for (let j = 0; j < CMOptions.PPExcludeTop; j++) {
|
||||
if (target[i].pp === CachePPArray[j][0]) target[i].color = ColourGray;
|
||||
if (target[i].pp === CachePPArray[j][0]) target[i].color = ColourGray; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -38,11 +37,11 @@ function CachePP(target, amount) {
|
||||
Object.keys(target).forEach((i) => {
|
||||
const price = Game.Objects[i].getSumPrice(amount);
|
||||
if (Game.cookiesPs) {
|
||||
target[i].pp =
|
||||
target[i].pp = // eslint-disable-line no-param-reassign
|
||||
Math.max(price - (Game.cookies + GetWrinkConfigBank()), 0) /
|
||||
Game.cookiesPs +
|
||||
price / target[i].bonus;
|
||||
} else target[i].pp = price / target[i].bonus;
|
||||
} else target[i].pp = price / target[i].bonus; // eslint-disable-line no-param-reassign
|
||||
if (!(CMOptions.PPRigidelMode && amount === 1))
|
||||
CachePPArray.push([target[i].pp, amount]);
|
||||
});
|
||||
@@ -73,7 +72,7 @@ export default function CacheBuildingsPP() {
|
||||
}
|
||||
}
|
||||
}
|
||||
CacheMinPP = CachePPArray[CMOptions.PPExcludeTop][indexOfMin];
|
||||
CacheMinPP = CachePPArray[CMOptions.PPExcludeTop][indexOfMin]; // eslint-disable-line no-unused-vars
|
||||
|
||||
CacheColour(CacheObjects1, 1);
|
||||
CacheColour(CacheObjects10, 10);
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
/** Section: Functions related to caching income */
|
||||
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import GetCPS from '../../Disp/HelperFunctions/GetCPS';
|
||||
import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding';
|
||||
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
|
||||
import BuyUpgradesBonusIncome from '../../Sim/SimulationEvents/BuyUpgrades';
|
||||
import {
|
||||
CacheAverageCPS,
|
||||
CacheAverageGainBank,
|
||||
CacheAverageGainWrink,
|
||||
CacheAverageGainWrinkFattest,
|
||||
@@ -30,7 +27,7 @@ function CacheBuildingIncome(amount) {
|
||||
result[i] = {};
|
||||
result[i].bonus = BuyBuildingsBonusIncome(i, amount);
|
||||
if (amount !== 1) {
|
||||
CacheDoRemakeBuildPrices = 1;
|
||||
CacheDoRemakeBuildPrices = 1; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
});
|
||||
return result;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import GetCPSBuffMult from '../CPS/GetCPSBuffMult';
|
||||
import {
|
||||
CacheChainFrenzyMaxReward,
|
||||
@@ -89,8 +88,8 @@ export function CacheChain() {
|
||||
maxPayout,
|
||||
CacheGoldenCookiesMult,
|
||||
);
|
||||
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||
CacheChainRequiredNext =
|
||||
CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult; // eslint-disable-line no-unused-vars
|
||||
CacheChainRequiredNext = // eslint-disable-line no-unused-vars
|
||||
CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment;
|
||||
|
||||
CacheChainWrathMaxReward = MaxChainCookieReward(
|
||||
@@ -98,9 +97,9 @@ export function CacheChain() {
|
||||
maxPayout,
|
||||
CacheWrathCookiesMult,
|
||||
);
|
||||
CacheChainWrathRequired =
|
||||
CacheChainWrathRequired = // eslint-disable-line no-unused-vars
|
||||
(CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||
CacheChainWrathRequiredNext =
|
||||
CacheChainWrathRequiredNext = // eslint-disable-line no-unused-vars
|
||||
CacheChainWrathMaxReward[2] /
|
||||
60 /
|
||||
60 /
|
||||
@@ -112,9 +111,9 @@ export function CacheChain() {
|
||||
maxPayout * 7,
|
||||
CacheGoldenCookiesMult,
|
||||
);
|
||||
CacheChainFrenzyRequired =
|
||||
CacheChainFrenzyRequired = // eslint-disable-line no-unused-vars
|
||||
(CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult;
|
||||
CacheChainFrenzyRequiredNext =
|
||||
CacheChainFrenzyRequiredNext = // eslint-disable-line no-unused-vars
|
||||
CacheChainFrenzyMaxReward[2] /
|
||||
60 /
|
||||
60 /
|
||||
@@ -126,9 +125,9 @@ export function CacheChain() {
|
||||
maxPayout * 7,
|
||||
CacheWrathCookiesMult,
|
||||
);
|
||||
CacheChainFrenzyWrathRequired =
|
||||
CacheChainFrenzyWrathRequired = // eslint-disable-line no-unused-vars
|
||||
(CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult;
|
||||
CacheChainFrenzyWrathRequiredNext =
|
||||
CacheChainFrenzyWrathRequiredNext = // eslint-disable-line no-unused-vars
|
||||
CacheChainFrenzyWrathMaxReward[2] /
|
||||
60 /
|
||||
60 /
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import {
|
||||
CacheHCPerSecond,
|
||||
CacheLastHeavenlyCheck,
|
||||
@@ -34,6 +33,6 @@ export default function CacheHeavenlyChipsPS() {
|
||||
CacheLastHeavenlyChips = ascendNowToGet;
|
||||
|
||||
// Get average gain over period of 5 seconds
|
||||
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5);
|
||||
CacheHCPerSecond = HeavenlyChipsDiff.calcAverage(5); // eslint-disable-line no-unused-vars
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { crateMissing } from '../../Disp/MenuSections/Statistics/CreateMissingUpgrades';
|
||||
import {
|
||||
CacheMissingUpgrades,
|
||||
@@ -36,6 +35,7 @@ export default function CacheAllMissingUpgrades() {
|
||||
let str = '';
|
||||
|
||||
str += crateMissing(me);
|
||||
/* eslint-disable no-unused-vars */
|
||||
if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str;
|
||||
else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str;
|
||||
else if (
|
||||
@@ -44,6 +44,7 @@ export default function CacheAllMissingUpgrades() {
|
||||
me.pool !== 'debug'
|
||||
)
|
||||
CacheMissingUpgrades += str;
|
||||
/* eslint-enable no-unused-vars */
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { CacheSeaSpec } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -12,6 +11,6 @@ export default function CacheSeasonSpec() {
|
||||
if (Game.hasBuff('Elder frenzy')) val *= 0.5;
|
||||
if (Game.hasBuff('Frenzy')) val *= 0.75;
|
||||
CacheSeaSpec = Math.max(25, val);
|
||||
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2;
|
||||
if (Game.Has('Ho ho ho-flavored frosting')) CacheSeaSpec *= 2; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
/** Functions related to Caching stats */
|
||||
|
||||
import SimHas from '../../Sim/ReplacedGameFunctions/SimHas';
|
||||
@@ -29,15 +28,15 @@ export function CacheStatsCookies() {
|
||||
const cpsBuffMult = GetCPSBuffMult();
|
||||
if (cpsBuffMult > 0) CacheLucky /= cpsBuffMult;
|
||||
else CacheLucky = 0;
|
||||
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13;
|
||||
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13;
|
||||
CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13; // eslint-disable-line no-unused-vars
|
||||
CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13; // eslint-disable-line no-unused-vars
|
||||
CacheLuckyFrenzy = CacheLucky * 7;
|
||||
CacheLuckyRewardFrenzy =
|
||||
CacheLuckyRewardFrenzy = // eslint-disable-line no-unused-vars
|
||||
CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||
CacheLuckyWrathRewardFrenzy =
|
||||
CacheLuckyWrathRewardFrenzy = // eslint-disable-line no-unused-vars
|
||||
CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13;
|
||||
CacheConjure = CacheLucky * 2;
|
||||
CacheConjureReward = CacheConjure * 0.15;
|
||||
CacheConjureReward = CacheConjure * 0.15; // eslint-disable-line no-unused-vars
|
||||
|
||||
CacheEdifice = 0;
|
||||
let max = 0;
|
||||
@@ -53,7 +52,7 @@ export function CacheStatsCookies() {
|
||||
Game.Objects[i].price * 2 > CacheEdifice
|
||||
) {
|
||||
CacheEdifice = Game.Objects[i].price * 2;
|
||||
CacheEdificeBuilding = i;
|
||||
CacheEdificeBuilding = i; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
/** Caches data related to Wrinklers */
|
||||
|
||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||
@@ -32,9 +31,9 @@ export default function CacheWrinklers() {
|
||||
else if (godLvl === 2) sucked *= 1.1;
|
||||
else if (godLvl === 3) sucked *= 1.05;
|
||||
}
|
||||
CacheWrinklersTotal += sucked;
|
||||
CacheWrinklersTotal += sucked; // eslint-disable-line no-unused-vars
|
||||
if (Game.wrinklers[i].type === 0) {
|
||||
CacheWrinklersNormal += sucked;
|
||||
CacheWrinklersNormal += sucked; // eslint-disable-line no-unused-vars
|
||||
if (sucked > CacheWrinklersFattest[0])
|
||||
CacheWrinklersFattest = [sucked, i];
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ function CheckNotificationPermissions(ToggleOnOff) {
|
||||
|
||||
// Check if the browser supports notifications and which type
|
||||
if (!('Notification' in window)) {
|
||||
console.log('This browser does not support notifications.');
|
||||
console.log('This browser does not support notifications.'); // eslint-disable-line no-console
|
||||
} else if (checkNotificationPromise()) {
|
||||
Notification.requestPermission().then();
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-return-assign */
|
||||
import { CacheGoldenShimmersByID } from '../../Cache/VariablesAndData';
|
||||
import { GCTimers } from '../../Disp/VariablesAndData';
|
||||
import { CMOptions } from '../VariablesAndData';
|
||||
@@ -15,6 +14,7 @@ export default function ToggleGCTimer() {
|
||||
GCTimers[i].style.top = CacheGoldenShimmersByID[i].l.style.top;
|
||||
});
|
||||
} else {
|
||||
// eslint-disable-next-line no-return-assign
|
||||
Object.keys(GCTimers).forEach((i) => (GCTimers[i].style.display = 'none'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
/* eslint-disable prefer-const */
|
||||
|
||||
export let CMOptions = {};
|
||||
export let CMOptions = {}; // eslint-disable-line prefer-const
|
||||
export const ConfigPrefix = 'CMConfig';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import init from './InitSaveLoad/init';
|
||||
import load from './InitSaveLoad/load';
|
||||
import save from './InitSaveLoad/save';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import CheckNotificationPermissions from '../Config/CheckNotificationPermissions';
|
||||
import { ToggleTimerBar, ToggleTimerBarPos } from '../Config/SpecificToggles';
|
||||
import ToggleBotBar from '../Config/Toggles/ToggleBotBar';
|
||||
@@ -72,7 +71,7 @@ const Config = {
|
||||
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers',
|
||||
true,
|
||||
function () {
|
||||
SimDoSims = true;
|
||||
SimDoSims = true; // eslint-disable-line no-unused-vars
|
||||
},
|
||||
),
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-nested-ternary */
|
||||
/** General functions to format or beautify strings */
|
||||
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
@@ -78,6 +77,7 @@ export function Beautify(num, floats, forced) {
|
||||
}
|
||||
}
|
||||
if (answer === '') {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(
|
||||
`Could not beautify number with Cookie Monster Beautify: ${num}`,
|
||||
);
|
||||
@@ -86,7 +86,7 @@ export function Beautify(num, floats, forced) {
|
||||
if (CMOptions.ScaleSeparator) answer = answer.replace('.', ',');
|
||||
return answer;
|
||||
}
|
||||
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`);
|
||||
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`); // eslint-disable-line no-console
|
||||
return BackupFunctions.Beautify(num, floats);
|
||||
}
|
||||
|
||||
@@ -119,15 +119,15 @@ export function FormatTime(time, longFormat) {
|
||||
return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||
str +=
|
||||
y > 0
|
||||
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, `
|
||||
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary
|
||||
: '';
|
||||
str +=
|
||||
d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : '';
|
||||
d > 0 ? `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, ` : ''; // eslint-disable-line no-nested-ternary
|
||||
if (str.length > 0 || h > 0)
|
||||
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `;
|
||||
str += `${h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h')}, `; // eslint-disable-line no-nested-ternary
|
||||
if (str.length > 0 || m > 0)
|
||||
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `;
|
||||
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
|
||||
str += `${m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm')}, `; // eslint-disable-line no-nested-ternary
|
||||
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's'); // eslint-disable-line no-nested-ternary
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-nested-ternary */
|
||||
import {
|
||||
CacheObjects1,
|
||||
CacheObjects10,
|
||||
@@ -72,10 +71,10 @@ export default function UpdateBuildings() {
|
||||
});
|
||||
|
||||
arr.sort(function (a, b) {
|
||||
return ColoursOrdering.indexOf(a.color) >
|
||||
return ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
||||
ColoursOrdering.indexOf(b.color)
|
||||
? 1
|
||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color)
|
||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||
? -1
|
||||
: a.pp < b.pp
|
||||
? -1
|
||||
@@ -90,10 +89,10 @@ export default function UpdateBuildings() {
|
||||
});
|
||||
|
||||
arr.sort(function (a, b) {
|
||||
return ColoursOrdering.indexOf(a.color) >
|
||||
return ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
||||
ColoursOrdering.indexOf(b.color)
|
||||
? 1
|
||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color)
|
||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||
? -1
|
||||
: a.pp < b.pp
|
||||
? -1
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-nested-ternary */
|
||||
import { CacheUpgrades } from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import {
|
||||
@@ -81,9 +80,9 @@ export default function UpdateUpgrades() {
|
||||
|
||||
if (CMOptions.SortUpgrades) {
|
||||
arr.sort(function (a, b) {
|
||||
return ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color)
|
||||
return ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||
? 1
|
||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color)
|
||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||
? -1
|
||||
: a.pp < b.pp
|
||||
? -1
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
/** Section: Functions related to the Golden Cookie Timers */
|
||||
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
@@ -28,14 +27,14 @@ export default function CreateGCTimer(cookie) {
|
||||
cookie.pop();
|
||||
};
|
||||
GCTimer.onmouseover = function () {
|
||||
cookie.l.style.filter =
|
||||
cookie.l.style.filter = // eslint-disable-line no-param-reassign
|
||||
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
||||
cookie.l.style.webkitFilter =
|
||||
cookie.l.style.webkitFilter = // eslint-disable-line no-param-reassign
|
||||
'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))';
|
||||
};
|
||||
GCTimer.onmouseout = function () {
|
||||
cookie.l.style.filter = '';
|
||||
cookie.l.style.webkitFilter = '';
|
||||
cookie.l.style.filter = ''; // eslint-disable-line no-param-reassign
|
||||
cookie.l.style.webkitFilter = ''; // eslint-disable-line no-param-reassign
|
||||
};
|
||||
|
||||
GCTimers[cookie.id] = GCTimer;
|
||||
|
||||
@@ -218,7 +218,6 @@ export default function CreatePrefOption(config) {
|
||||
input.min = Config[config].min;
|
||||
input.max = Config[config].max;
|
||||
input.oninput = function () {
|
||||
if (this.value > this.max) console.log('TEST');
|
||||
CMOptions[config] = this.value;
|
||||
SaveConfig();
|
||||
RefreshScale();
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import { CMOptions } from '../../../Config/VariablesAndData';
|
||||
|
||||
function CrateTooltipLockedAchievements(me) {
|
||||
@@ -58,9 +57,11 @@ export default function AddMissingAchievements() {
|
||||
if (!achievsCrate.className.includes('enabled')) {
|
||||
const id = achievsCrate.onclick.toString().match(/(?<=\[).*(?=\])/g)[0];
|
||||
const { icon } = Game.AchievementsById[id];
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
achievsCrate.style.backgroundPosition = `${-icon[0] * 48}px ${
|
||||
-icon[1] * 48
|
||||
}px`;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
achievsCrate.onmouseover = function () {
|
||||
if (!Game.mouseDown) {
|
||||
Game.setOnCrate(this);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import {
|
||||
ColourTextPre,
|
||||
@@ -163,7 +162,7 @@ export function TooltipCreateCalculationSection(tooltip) {
|
||||
tooltip.appendChild(income);
|
||||
|
||||
tooltip.appendChild(TooltipCreateHeader('Bonus Cookies per Click'));
|
||||
tooltip.lastChild.style.display = 'none';
|
||||
tooltip.lastChild.style.display = 'none'; // eslint-disable-line no-param-reassign
|
||||
const click = document.createElement('div');
|
||||
click.style.marginBottom = '4px';
|
||||
click.style.color = 'white';
|
||||
@@ -186,7 +185,8 @@ export function TooltipCreateCalculationSection(tooltip) {
|
||||
tooltip.appendChild(
|
||||
TooltipCreateHeader('Production left till next achievement'),
|
||||
);
|
||||
tooltip.lastChild.id = 'CMTooltipProductionHeader'; // Assign a id in order to hid when no achiev's are left
|
||||
// Assign a id in order to hide when no achiev's are left
|
||||
tooltip.lastChild.id = 'CMTooltipProductionHeader'; // eslint-disable-line no-param-reassign
|
||||
const production = document.createElement('div');
|
||||
production.id = 'CMTooltipProduction';
|
||||
tooltip.appendChild(production);
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import UpdateTooltips, * as UpdateTooltip from './UpdateTooltips';
|
||||
import { TooltipCreateTooltipBox } from './CreateTooltip';
|
||||
import UpdateTooltips from './UpdateTooltips';
|
||||
import {
|
||||
Beautify,
|
||||
GetTimeColour,
|
||||
} from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||
import {
|
||||
SimpleTooltipElements,
|
||||
TooltipName,
|
||||
@@ -143,8 +140,8 @@ export function CreateTooltip(type, name) {
|
||||
}
|
||||
|
||||
// Sets global variables used by CM.Disp.UpdateTooltip()
|
||||
TooltipType = type;
|
||||
TooltipName = name;
|
||||
TooltipType = type; // eslint-disable-line no-unused-vars
|
||||
TooltipName = name; // eslint-disable-line no-unused-vars
|
||||
|
||||
UpdateTooltips();
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable prefer-const */
|
||||
/**
|
||||
* Section: Variables used in Disp functions */
|
||||
|
||||
@@ -91,15 +90,15 @@ export const SimpleTooltipElements = {};
|
||||
* These are variables used by the functions that create tooltips for wrinklers
|
||||
* See CM.Disp.CheckWrinklerTooltip(), CM.Disp.UpdateWrinklerTooltip() and CM.Main.AddWrinklerAreaDetect()
|
||||
*/
|
||||
export let TooltipWrinklerArea = 0;
|
||||
export let TooltipWrinkler = -1;
|
||||
export let TooltipWrinklerArea = 0; // eslint-disable-line prefer-const
|
||||
export let TooltipWrinkler = -1; // eslint-disable-line prefer-const
|
||||
|
||||
/**
|
||||
* This array is used to store whether a Wrinkler tooltip is being shown or not
|
||||
* [i] = 1 means tooltip is being shown, [i] = 0 means hidden
|
||||
* It is used by CM.Disp.CheckWrinklerTooltip() and CM.Main.AddWrinklerAreaDetect()
|
||||
*/
|
||||
export let TooltipWrinklerBeingShown = [];
|
||||
export let TooltipWrinklerBeingShown = []; // eslint-disable-line prefer-const
|
||||
|
||||
export let CMLastAscendState;
|
||||
export let CMSayTime;
|
||||
@@ -107,9 +106,9 @@ export let CMSayTime;
|
||||
/**
|
||||
* These are variables used to create various displays when the game is loaded on the "sell all" screen
|
||||
*/
|
||||
export let LastTargetBotBar = 1;
|
||||
export let LastTargetBuildings = 1;
|
||||
export let LastTargetTooltipBuilding = 1;
|
||||
export let LastTargetBotBar = 1; // eslint-disable-line prefer-const
|
||||
export let LastTargetBuildings = 1; // eslint-disable-line prefer-const
|
||||
export let LastTargetTooltipBuilding = 1; // eslint-disable-line prefer-const
|
||||
|
||||
/**
|
||||
* These arrays are used in the stats page to show
|
||||
@@ -133,12 +132,12 @@ export const BuffColours = {
|
||||
/**
|
||||
* This array is used to track GC timers
|
||||
*/
|
||||
export let GCTimers = {};
|
||||
export let GCTimers = {}; // eslint-disable-line prefer-const
|
||||
|
||||
/**
|
||||
* Used to store the number of cookies to be displayed in the tab-title
|
||||
*/
|
||||
export let Title = '';
|
||||
export let Title = ''; // eslint-disable-line prefer-const
|
||||
|
||||
export let TooltipPrice;
|
||||
export let TooltipBonusIncome;
|
||||
@@ -152,4 +151,4 @@ export let LastNumberOfTimers;
|
||||
/**
|
||||
* This stores the names of settings shown in the favourites section
|
||||
*/
|
||||
export let FavouriteSettings = [];
|
||||
export let FavouriteSettings = []; // eslint-disable-line prefer-const
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable prefer-const */
|
||||
/** Variable that shows if Cookie Moonster is initzializing */
|
||||
export let isInitializing = false;
|
||||
export let isInitializing = false; // eslint-disable-line prefer-const
|
||||
export let test;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
||||
import CMDrawHook from '../Disp/DrawHook';
|
||||
import CMClickHook from '../Main/ClickHook';
|
||||
@@ -16,6 +15,7 @@ export default function init() {
|
||||
isInitializing = true;
|
||||
let proceed = true;
|
||||
if (Game.version !== Number(VersionMajor)) {
|
||||
// eslint-disable-next-line no-restricted-globals, no-alert
|
||||
proceed = confirm(
|
||||
`Cookie Monster version ${VersionMajor}.${VersionMinor} is meant for Game version ${VersionMajor}. Loading a different version may cause errors. Do you still want to load Cookie Monster?`,
|
||||
);
|
||||
@@ -25,6 +25,6 @@ export default function init() {
|
||||
Game.registerHook('draw', CMDrawHook);
|
||||
Game.registerHook('logic', CMLoopHook);
|
||||
Game.registerHook('click', CMClickHook);
|
||||
isInitializing = false;
|
||||
isInitializing = false; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { LoadConfig } from '../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
||||
import { FavouriteSettings } from '../Disp/VariablesAndData';
|
||||
@@ -13,7 +12,7 @@ export default function load(str) {
|
||||
InitData();
|
||||
// The if-statement is a failsafe for old saves
|
||||
if (typeof save.favouriteSettings !== 'undefined')
|
||||
FavouriteSettings = save.favouriteSettings;
|
||||
FavouriteSettings = save.favouriteSettings; // eslint-disable-line no-unused-vars
|
||||
LoadConfig(save.settings);
|
||||
if (save.version !== `${VersionMajor}.${VersionMinor}`) {
|
||||
if (Game.prefs.popups)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import {
|
||||
CacheSpawnedGoldenShimmer,
|
||||
CacheGoldenShimmersByID,
|
||||
@@ -66,7 +65,7 @@ export default function CheckGoldenCookie() {
|
||||
}
|
||||
UpdateFavicon();
|
||||
LastSpawnedGoldenCookieState = CurrSpawnedGoldenCookieState;
|
||||
if (CurrSpawnedGoldenCookieState === 0) CacheSpawnedGoldenShimmer = 0;
|
||||
if (CurrSpawnedGoldenCookieState === 0) CacheSpawnedGoldenShimmer = 0; // eslint-disable-line no-unused-vars
|
||||
} else if (CMOptions.GCTimer === 1 && LastGoldenCookieState) {
|
||||
Object.keys(GCTimers).forEach((i) => {
|
||||
GCTimers[i].style.opacity = CacheGoldenShimmersByID[i].l.style.opacity;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { CacheSeasonPopShimmer } from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import Flash from '../../Disp/Notifications/Flash';
|
||||
@@ -15,7 +14,7 @@ export default function CheckSeasonPopup() {
|
||||
LastSeasonPopupState = Game.shimmerTypes.reindeer.spawned;
|
||||
Object.keys(Game.shimmers).forEach((i) => {
|
||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'reindeer') {
|
||||
CacheSeasonPopShimmer = Game.shimmers[i];
|
||||
CacheSeasonPopShimmer = Game.shimmers[i]; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
});
|
||||
Flash(3, 'SeaFlash', false);
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import InitCache from '../Cache/CacheInit';
|
||||
import { CacheStatsCookies } from '../Cache/Stats/Stats';
|
||||
import { LoadConfig } from '../Config/SaveLoadReload/SaveLoadReloadSettings';
|
||||
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
||||
import CreateUpgradeBar from '../Disp/BuildingsUpgrades/UpgradeBar';
|
||||
import UpdateColours from '../Disp/HelperFunctions/UpdateColours';
|
||||
import { CreateBotBar } from '../Disp/InfoBars/BottomBar';
|
||||
import { CreateTimerBar } from '../Disp/InfoBars/TimerBar';
|
||||
import CreateSectionHideButtons from '../Disp/Initialization/CreateSectionHideButtons';
|
||||
@@ -31,7 +29,7 @@ export default function InitializeCookieMonster() {
|
||||
InitCache();
|
||||
|
||||
// Stored to check if we need to re-initiliaze data
|
||||
LastModCount = Object.keys(Game.mods).length;
|
||||
LastModCount = Object.keys(Game.mods).length; // eslint-disable-line no-unused-vars
|
||||
|
||||
// Creating visual elements
|
||||
CreateCssArea();
|
||||
@@ -60,7 +58,7 @@ export default function InitializeCookieMonster() {
|
||||
Game.CalculateGains();
|
||||
|
||||
LoadConfig();
|
||||
CMLastAscendState = Game.OnAscend;
|
||||
CMLastAscendState = Game.OnAscend; // eslint-disable-line no-unused-vars
|
||||
|
||||
if (Game.prefs.popups)
|
||||
Game.Popup(
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import InitCache from '../Cache/CacheInit';
|
||||
import LoopCache from '../Cache/CacheLoop';
|
||||
import CacheNoGoldSwitchCPS from '../Cache/CPS/NoGoldSwitchCPS';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import { FormatTime } from '../../Disp/BeautifyAndFormatting/BeautifyFormatting';
|
||||
|
||||
@@ -47,8 +46,8 @@ function ReplaceNativeGrimoireLaunch() {
|
||||
Game.Objects['Wizard tower'].minigameLoaded
|
||||
) {
|
||||
const { minigame } = Game.Objects['Wizard tower'];
|
||||
BackupGrimoireLaunch = minigame.launch;
|
||||
BackupGrimoireLaunchMod = new Function(
|
||||
BackupGrimoireLaunch = minigame.launch; // eslint-disable-line no-unused-vars
|
||||
BackupGrimoireLaunchMod = new Function( // eslint-disable-line no-new-func
|
||||
`return ${minigame.launch
|
||||
.toString()
|
||||
.split('=this')
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable no-unused-vars */
|
||||
/** Functions related to replacing tooltips */
|
||||
|
||||
import { CreateTooltip } from '../../Disp/Tooltips/Tooltip';
|
||||
@@ -39,7 +37,7 @@ function ReplaceTooltipBuild() {
|
||||
*/
|
||||
function ReplaceTooltipLump() {
|
||||
if (Game.canLumps()) {
|
||||
TooltipLumpBackup = l('lumps').onmouseover;
|
||||
TooltipLumpBackup = l('lumps').onmouseover; // eslint-disable-line no-unused-vars
|
||||
l('lumps').onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
@@ -72,6 +70,7 @@ function ReplaceTooltipGarden() {
|
||||
};
|
||||
Array.from(l('gardenPlot').children).forEach((child) => {
|
||||
const coords = child.id.slice(-3);
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
child.onmouseover = function () {
|
||||
Game.tooltip.dynamic = 1;
|
||||
Game.tooltip.draw(
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import jscolor from '@eastdesire/jscolor';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import {
|
||||
@@ -32,14 +31,14 @@ export default function ReplaceNative() {
|
||||
BackupFunctions.CalculateGains = Game.CalculateGains;
|
||||
Game.CalculateGains = function () {
|
||||
BackupFunctions.CalculateGains();
|
||||
SimDoSims = 1;
|
||||
CycliusDateAtBeginLoop = Date.now();
|
||||
CenturyDateAtBeginLoop = Date.now();
|
||||
SimDoSims = 1; // eslint-disable-line no-unused-vars
|
||||
CycliusDateAtBeginLoop = Date.now(); // eslint-disable-line no-unused-vars
|
||||
CenturyDateAtBeginLoop = Date.now(); // eslint-disable-line no-unused-vars
|
||||
};
|
||||
|
||||
BackupFunctions.tooltip = {};
|
||||
BackupFunctions.tooltip.draw = Game.tooltip.draw;
|
||||
BackupFunctions.tooltip.drawMod = new Function(
|
||||
BackupFunctions.tooltip.drawMod = new Function( // eslint-disable-line no-new-func
|
||||
`return ${Game.tooltip.draw.toString().split('this').join('Game.tooltip')}`,
|
||||
)();
|
||||
Game.tooltip.draw = function (from, text, origin) {
|
||||
@@ -47,7 +46,7 @@ export default function ReplaceNative() {
|
||||
};
|
||||
|
||||
BackupFunctions.tooltip.update = Game.tooltip.update;
|
||||
BackupFunctions.tooltip.updateMod = new Function(
|
||||
BackupFunctions.tooltip.updateMod = new Function( // eslint-disable-line no-new-func
|
||||
`return ${Game.tooltip.update
|
||||
.toString()
|
||||
.split('this.')
|
||||
@@ -132,6 +131,7 @@ export default function ReplaceNative() {
|
||||
};
|
||||
|
||||
BackupFunctions.sayTime = Game.sayTime;
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
CMSayTime = function (time, detail) {
|
||||
if (Number.isNaN(time) || time <= 0)
|
||||
return BackupFunctions.sayTime(time, detail);
|
||||
@@ -145,6 +145,7 @@ export default function ReplaceNative() {
|
||||
// Update tab title
|
||||
let title = 'Cookie Clicker';
|
||||
if (Game.season === 'fools') title = 'Cookie Baker';
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
Title = `${Game.OnAscend ? 'Ascending! ' : ''}${CMBeautify(Game.cookies)} ${
|
||||
Game.cookies === 1 ? 'cookie' : 'cookies'
|
||||
} - ${title}`;
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
/* eslint-disable prefer-const */
|
||||
|
||||
export let LastModCount;
|
||||
export let TooltipBuildBackup = [];
|
||||
export let TooltipBuildBackup = []; // eslint-disable-line prefer-const
|
||||
export let TooltipLumpBackup;
|
||||
export let TooltipGrimoireBackup = [];
|
||||
export let TooltipUpgradeBackup = [];
|
||||
export let TooltipGrimoireBackup = []; // eslint-disable-line prefer-const
|
||||
export let TooltipUpgradeBackup = []; // eslint-disable-line prefer-const
|
||||
export let BackupGrimoireLaunch;
|
||||
export let BackupGrimoireLaunchMod;
|
||||
export let BackupGrimoireDraw;
|
||||
export let HasReplaceNativeGrimoireLaunch;
|
||||
export let HasReplaceNativeGrimoireDraw;
|
||||
export let LoadMinigames;
|
||||
export let BackupFunctions = {};
|
||||
export let BackupFunctions = {}; // eslint-disable-line prefer-const
|
||||
|
||||
export let LastSeasonPopupState;
|
||||
export let LastTickerFortuneState;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import {
|
||||
TooltipWrinklerArea,
|
||||
TooltipWrinklerBeingShown,
|
||||
@@ -13,7 +12,7 @@ export default function AddWrinklerAreaDetect() {
|
||||
TooltipWrinklerArea = 1;
|
||||
};
|
||||
l('backgroundLeftCanvas').onmouseout = function () {
|
||||
TooltipWrinklerArea = 0;
|
||||
TooltipWrinklerArea = 0; // eslint-disable-line no-unused-vars
|
||||
Game.tooltip.hide();
|
||||
Object.keys(Game.wrinklers).forEach((i) => {
|
||||
TooltipWrinklerBeingShown[i] = 0;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import GetCPSBuffMult from '../../Cache/CPS/GetCPSBuffMult';
|
||||
import { CacheCentEgg } from '../../Cache/VariablesAndData';
|
||||
import {
|
||||
@@ -42,7 +41,7 @@ export default function CalculateGains() {
|
||||
});
|
||||
}
|
||||
});
|
||||
SimEffs = effs;
|
||||
SimEffs = effs; // eslint-disable-line no-unused-vars
|
||||
|
||||
if (Game.ascensionMode !== 1)
|
||||
mult +=
|
||||
@@ -227,7 +226,7 @@ export default function CalculateGains() {
|
||||
SimWin(Game.CpsAchievements[i].name);
|
||||
});
|
||||
|
||||
SimCookiesPsRaw = rawCookiesPs;
|
||||
SimCookiesPsRaw = rawCookiesPs; // eslint-disable-line no-unused-vars
|
||||
|
||||
const { n } = Game.shimmerTypes.golden;
|
||||
const auraMult = SimAuraMult("Dragon's Fortune");
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import CacheDragonAuras from '../../Cache/Dragon/CacheDragonAuras';
|
||||
import {
|
||||
CacheDragonAura,
|
||||
@@ -30,11 +29,11 @@ import {
|
||||
*/
|
||||
export default function CopyData() {
|
||||
// Other variables
|
||||
SimUpgradesOwned = Game.UpgradesOwned;
|
||||
SimPledges = Game.pledges;
|
||||
SimAchievementsOwned = Game.AchievementsOwned;
|
||||
SimHeavenlyPower = Game.heavenlyPower;
|
||||
SimPrestige = Game.prestige;
|
||||
SimUpgradesOwned = Game.UpgradesOwned; // eslint-disable-line no-unused-vars
|
||||
SimPledges = Game.pledges; // eslint-disable-line no-unused-vars
|
||||
SimAchievementsOwned = Game.AchievementsOwned; // eslint-disable-line no-unused-vars
|
||||
SimHeavenlyPower = Game.heavenlyPower; // eslint-disable-line no-unused-vars
|
||||
SimPrestige = Game.prestige; // eslint-disable-line no-unused-vars
|
||||
|
||||
// Buildings
|
||||
Object.keys(Game.Objects).forEach((i) => {
|
||||
@@ -53,9 +52,9 @@ export default function CopyData() {
|
||||
you.free = me.free;
|
||||
if (me.minigameLoaded) {
|
||||
if (me.name === 'Temple') {
|
||||
SimGod1 = me.minigame.slot[0];
|
||||
SimGod2 = me.minigame.slot[1];
|
||||
SimGod3 = me.minigame.slot[2];
|
||||
SimGod1 = me.minigame.slot[0]; // eslint-disable-line no-unused-vars
|
||||
SimGod2 = me.minigame.slot[1]; // eslint-disable-line no-unused-vars
|
||||
SimGod3 = me.minigame.slot[2]; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
you.minigameLoaded = me.minigameLoaded;
|
||||
you.minigame = me.minigame;
|
||||
@@ -89,6 +88,6 @@ export default function CopyData() {
|
||||
|
||||
// Auras
|
||||
CacheDragonAuras();
|
||||
SimDragonAura = CacheDragonAura;
|
||||
SimDragonAura2 = CacheDragonAura2;
|
||||
SimDragonAura = CacheDragonAura; // eslint-disable-line no-unused-vars
|
||||
SimDragonAura2 = CacheDragonAura2; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { SimAchievements, SimAchievementsOwned } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
@@ -11,7 +10,7 @@ export default function SimWin(what) {
|
||||
if (SimAchievements[what]) {
|
||||
if (SimAchievements[what].won === 0) {
|
||||
SimAchievements[what].won = 1;
|
||||
if (Game.Achievements[what].pool !== 'shadow') SimAchievementsOwned += 1;
|
||||
if (Game.Achievements[what].pool !== 'shadow') SimAchievementsOwned += 1; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import {
|
||||
CacheDragonAura,
|
||||
CacheDragonAura2,
|
||||
@@ -41,7 +40,7 @@ export default function CalculateChangeAura(aura) {
|
||||
if (Game.ObjectsById[i].amount > 0) {
|
||||
const highestBuilding = SimObjects[Game.ObjectsById[i].name].name;
|
||||
SimObjects[highestBuilding].amount -= 1;
|
||||
SimBuildingsOwned -= 1;
|
||||
SimBuildingsOwned -= 1; // eslint-disable-line no-unused-vars
|
||||
price =
|
||||
SimObjects[highestBuilding].basePrice *
|
||||
Game.priceIncrease **
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import CalculateGains from '../Calculations/CalculateGains';
|
||||
import CheckOtherAchiev from '../Calculations/CheckOtherAchiev';
|
||||
import SimAuraMult from '../ReplacedGameFunctions/SimAuraMult';
|
||||
@@ -130,9 +129,8 @@ export default function BuyUpgradesBonusIncome(upgrade) {
|
||||
} else {
|
||||
SimUpgrades[upgrade].bought = (SimUpgrades[upgrade].bought + 1) % 2;
|
||||
}
|
||||
const me = SimUpgrades[upgrade];
|
||||
if (Game.CountsAsUpgradeOwned(Game.Upgrades[upgrade].pool))
|
||||
SimUpgradesOwned += 1;
|
||||
SimUpgradesOwned += 1; // eslint-disable-line no-unused-vars
|
||||
|
||||
if (upgrade === 'Elder Pledge') {
|
||||
SimPledges += 1;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import CalculateGains from '../Calculations/CalculateGains';
|
||||
import CheckOtherAchiev from '../Calculations/CheckOtherAchiev';
|
||||
import CopyData from '../SimulationData/CopyData';
|
||||
@@ -19,9 +18,11 @@ import {
|
||||
*/
|
||||
export default function CalculateChangeGod(god, slot) {
|
||||
CopyData();
|
||||
/* eslint-disable no-unused-vars */
|
||||
if (slot === 0) SimGod1 = god;
|
||||
else if (slot === 1) SimGod2 = god;
|
||||
else if (slot === 2) SimGod3 = god;
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
||||
const lastAchievementsOwned = SimAchievementsOwned;
|
||||
CalculateGains();
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { CacheRealCookiesEarned } from '../../Cache/VariablesAndData';
|
||||
import CalculateGains from '../Calculations/CalculateGains';
|
||||
import CheckOtherAchiev from '../Calculations/CheckOtherAchiev';
|
||||
@@ -96,7 +95,7 @@ export default function ResetBonus(newHeavenlyChips) {
|
||||
const ResetCPS = SimCookiesPs - curCPS;
|
||||
|
||||
// Reset Pretige level after calculation as it is used in CM.Sim.CalculateGains() so can't be local
|
||||
SimPrestige = Game.prestige;
|
||||
SimPrestige = Game.prestige; // eslint-disable-line no-unused-vars
|
||||
|
||||
return ResetCPS;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import CopyData from '../SimulationData/CopyData';
|
||||
import {
|
||||
SimBuildingsOwned,
|
||||
@@ -38,7 +37,7 @@ export default function SellBuildingsForChoEgg() {
|
||||
}
|
||||
});
|
||||
SimObjects[highestBuilding].amount -= 1;
|
||||
SimBuildingsOwned -= 1;
|
||||
SimBuildingsOwned -= 1; // eslint-disable-line no-unused-vars
|
||||
}
|
||||
|
||||
// Get money made by selling all remaining buildings
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/* eslint-disable prefer-const */
|
||||
/** All variables used by simulation functions */
|
||||
|
||||
export let SimObjects = [];
|
||||
export let SimUpgrades = [];
|
||||
export let SimAchievements = [];
|
||||
export let SimObjects = []; // eslint-disable-line prefer-const
|
||||
export let SimUpgrades = []; // eslint-disable-line prefer-const
|
||||
export let SimAchievements = []; // eslint-disable-line prefer-const
|
||||
export let SimBuildingsOwned;
|
||||
export let SimUpgradesOwned;
|
||||
export let SimPledges;
|
||||
|
||||
Reference in New Issue
Block a user