Merge pull request #743 from DanielNoord/clickscps
Show cookies from clicks in stats
This commit is contained in:
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js
vendored
2
dist/CookieMonster.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
1873
package-lock.json
generated
1873
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -50,6 +50,14 @@ export class CMAvgQueue {
|
|||||||
}
|
}
|
||||||
return ret / time;
|
return ret / time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
calcSum(timePeriod) {
|
||||||
|
let time = timePeriod;
|
||||||
|
if (time > this.maxLength) time = this.maxLength;
|
||||||
|
if (time > this.queue.length) time = this.queue.length;
|
||||||
|
if (time === 0) return 0;
|
||||||
|
return this.queue.slice(-time).reduce((a, b) => a + b, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
|
import { ClickTimes } from '../Disp/VariablesAndData';
|
||||||
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
|
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
|
||||||
import CacheAvgCPS from './CPS/CPS';
|
import CacheAvgCPS from './CPS/CPS';
|
||||||
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
||||||
@@ -15,7 +16,10 @@ import {
|
|||||||
CacheGoldenAndWrathCookiesMults,
|
CacheGoldenAndWrathCookiesMults,
|
||||||
CacheStatsCookies,
|
CacheStatsCookies,
|
||||||
} from './Stats/Stats';
|
} from './Stats/Stats';
|
||||||
import { HeavenlyChipsDiff } from './VariablesAndData';
|
import {
|
||||||
|
CacheAverageCookiesFromClicks,
|
||||||
|
HeavenlyChipsDiff,
|
||||||
|
} from './VariablesAndData';
|
||||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,6 +35,9 @@ export default function InitCache() {
|
|||||||
CacheSeasonSpec();
|
CacheSeasonSpec();
|
||||||
InitCookiesDiff();
|
InitCookiesDiff();
|
||||||
HeavenlyChipsDiff = new CMAvgQueue(5); // Used by CM.Cache.CacheHeavenlyChipsPS()
|
HeavenlyChipsDiff = new CMAvgQueue(5); // Used by CM.Cache.CacheHeavenlyChipsPS()
|
||||||
|
CacheAverageCookiesFromClicks = new CMAvgQueue(
|
||||||
|
ClickTimes[ClickTimes.length - 1] * 20,
|
||||||
|
);
|
||||||
CacheHeavenlyChipsPS();
|
CacheHeavenlyChipsPS();
|
||||||
CacheAvgCPS();
|
CacheAvgCPS();
|
||||||
CacheIncome();
|
CacheIncome();
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export let CacheCurrWrinklerCount = 0;
|
|||||||
export let CacheUpgrades = {};
|
export let CacheUpgrades = {};
|
||||||
|
|
||||||
export let CacheAverageClicks = {};
|
export let CacheAverageClicks = {};
|
||||||
|
export let CacheAverageCookiesFromClicks;
|
||||||
|
|
||||||
export let CacheMissingUpgrades = {};
|
export let CacheMissingUpgrades = {};
|
||||||
export let CacheMissingUpgradesPrestige = {};
|
export let CacheMissingUpgradesPrestige = {};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import ConfigDefault from '../../Data/SettingsDefault';
|
|||||||
import ConfigData from '../../Data/SettingsData';
|
import ConfigData from '../../Data/SettingsData';
|
||||||
import { CMOptions } from '../VariablesAndData';
|
import { CMOptions } from '../VariablesAndData';
|
||||||
import save from '../../InitSaveLoad/save';
|
import save from '../../InitSaveLoad/save';
|
||||||
import CMLoop from '../../Main/Loop';
|
import CMLoopHook from '../../Main/LoopHook';
|
||||||
import UpdateColours from '../../Disp/HelperFunctions/UpdateColours';
|
import UpdateColours from '../../Disp/HelperFunctions/UpdateColours';
|
||||||
|
|
||||||
/** Functions related to saving, loading and restoring all settings */
|
/** Functions related to saving, loading and restoring all settings */
|
||||||
@@ -68,7 +68,7 @@ export function LoadConfig(settings) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (mod) SaveConfig();
|
if (mod) SaveConfig();
|
||||||
CMLoop(); // Do loop once
|
CMLoopHook(); // Do loop once
|
||||||
Object.keys(ConfigDefault).forEach((i) => {
|
Object.keys(ConfigDefault).forEach((i) => {
|
||||||
if (i !== 'Header' && typeof ConfigData[i].func !== 'undefined') {
|
if (i !== 'Header' && typeof ConfigData[i].func !== 'undefined') {
|
||||||
ConfigData[i].func();
|
ConfigData[i].func();
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { CMOptions } from '../../../Config/VariablesAndData';
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
CacheAverageClicks,
|
CacheAverageClicks,
|
||||||
|
CacheAverageCookiesFromClicks,
|
||||||
CacheWrinklersFattest,
|
CacheWrinklersFattest,
|
||||||
CacheWrinklersNormal,
|
CacheWrinklersNormal,
|
||||||
CacheWrinklersTotal,
|
CacheWrinklersTotal,
|
||||||
@@ -114,7 +115,7 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
`Average Cookies Per Second (Past ${
|
`Average cookies per second (past ${
|
||||||
CookieTimes[CMOptions.AvgCPSHist] < 60
|
CookieTimes[CMOptions.AvgCPSHist] < 60
|
||||||
? `${CookieTimes[CMOptions.AvgCPSHist]} seconds`
|
? `${CookieTimes[CMOptions.AvgCPSHist]} seconds`
|
||||||
: CookieTimes[CMOptions.AvgCPSHist] / 60 +
|
: CookieTimes[CMOptions.AvgCPSHist] / 60 +
|
||||||
@@ -126,12 +127,27 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
`Average Cookie Clicks Per Second (Past ${
|
`Average cookie clicks per second (past ${
|
||||||
ClickTimes[CMOptions.AvgClicksHist]
|
ClickTimes[CMOptions.AvgClicksHist]
|
||||||
}${CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'})`,
|
}${CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'})`,
|
||||||
document.createTextNode(Beautify(CacheAverageClicks, 1)),
|
document.createTextNode(Beautify(CacheAverageClicks, 1)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
stats.appendChild(
|
||||||
|
CreateElements.StatsListing(
|
||||||
|
'basic',
|
||||||
|
`Cookies from clicking (past ${ClickTimes[CMOptions.AvgClicksHist]}${
|
||||||
|
CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'
|
||||||
|
})`,
|
||||||
|
document.createTextNode(
|
||||||
|
Beautify(
|
||||||
|
CacheAverageCookiesFromClicks.calcSum(
|
||||||
|
CacheAverageClicks * ClickTimes[CMOptions.AvgClicksHist],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
if (Game.Has('Fortune cookies')) {
|
if (Game.Has('Fortune cookies')) {
|
||||||
const fortunes = [];
|
const fortunes = [];
|
||||||
Object.keys(GameData.Fortunes).forEach((i) => {
|
Object.keys(GameData.Fortunes).forEach((i) => {
|
||||||
@@ -152,7 +168,7 @@ export default function AddMenuStats(title) {
|
|||||||
stats.appendChild(
|
stats.appendChild(
|
||||||
CreateElements.StatsListing(
|
CreateElements.StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Missed Golden Cookies',
|
'Missed golden cookies',
|
||||||
document.createTextNode(Beautify(Game.missedGoldenClicks)),
|
document.createTextNode(Beautify(Game.missedGoldenClicks)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export function LuckySection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Lucky!" Cookies Required',
|
'"Lucky!" cookies required',
|
||||||
luckyReqFrag,
|
luckyReqFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -113,7 +113,7 @@ export function LuckySection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Lucky!" Cookies Required (Frenzy)',
|
'"Lucky!" cookies required (frenzy)',
|
||||||
luckyReqFrenFrag,
|
luckyReqFrenFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -130,7 +130,7 @@ export function LuckySection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
`"Lucky!" Reward (MAX)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
`"Lucky!" reward (max)${luckySplit ? ' (golden / wrath)' : ''}`,
|
||||||
luckyRewardMaxSpan,
|
luckyRewardMaxSpan,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -145,7 +145,7 @@ export function LuckySection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
`"Lucky!" Reward (MAX) (Frenzy)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
`"Lucky!" reward (max) (frenzy)${luckySplit ? ' (golden / wrath)' : ''}`,
|
||||||
luckyRewardFrenzyMaxSpan,
|
luckyRewardFrenzyMaxSpan,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -165,7 +165,7 @@ export function LuckySection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
`"Lucky!" Reward (CUR)${luckySplit ? ' (Golden / Wrath)' : ''}`,
|
`"Lucky!" reward (cur)${luckySplit ? ' (golden / wrath)' : ''}`,
|
||||||
luckyCurSpan,
|
luckyCurSpan,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -211,7 +211,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Cookies Required',
|
'"Chain" cookies required',
|
||||||
chainReqFrag,
|
chainReqFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -242,7 +242,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Cookies Required (Wrath)',
|
'"Chain" cookies required (Wrath)',
|
||||||
chainWrathReqFrag,
|
chainWrathReqFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -273,7 +273,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Cookies Required (Frenzy)',
|
'"Chain" cookies required (Frenzy)',
|
||||||
chainReqFrenFrag,
|
chainReqFrenFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -305,7 +305,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Cookies Required (Frenzy) (Wrath)',
|
'"Chain" cookies required (frenzy) (Wrath)',
|
||||||
chainWrathReqFrenFrag,
|
chainWrathReqFrenFrag,
|
||||||
goldCookTooltip,
|
goldCookTooltip,
|
||||||
),
|
),
|
||||||
@@ -314,7 +314,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Reward (MAX) (Golden / Wrath)',
|
'"Chain" reward (max) (golden / wrath)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainMaxReward[0])} / ${Beautify(
|
`${Beautify(CacheChainMaxReward[0])} / ${Beautify(
|
||||||
CacheChainWrathMaxReward[0],
|
CacheChainWrathMaxReward[0],
|
||||||
@@ -327,7 +327,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Reward (MAX) (Frenzy) (Golden / Wrath)',
|
'"Chain" reward (max) (frenzy) (golden / wrath)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainFrenzyMaxReward[0])} / ${Beautify(
|
`${Beautify(CacheChainFrenzyMaxReward[0])} / ${Beautify(
|
||||||
CacheChainFrenzyMaxReward[0],
|
CacheChainFrenzyMaxReward[0],
|
||||||
@@ -354,7 +354,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Chain" Reward (CUR) (Golden / Wrath)',
|
'"Chain" reward (cur) (golden / wrath)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(chainCur)} / ${Beautify(chainCurWrath)}`,
|
`${Beautify(chainCur)} / ${Beautify(chainCurWrath)}`,
|
||||||
),
|
),
|
||||||
@@ -365,7 +365,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'CPS Needed For Next Level (G / W)',
|
'CPS needed for next level (g / w)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainRequiredNext)} / ${Beautify(
|
`${Beautify(CacheChainRequiredNext)} / ${Beautify(
|
||||||
CacheChainWrathRequiredNext,
|
CacheChainWrathRequiredNext,
|
||||||
@@ -377,7 +377,7 @@ export function ChainSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'CPS Needed For Next Level (Frenzy) (G / W)',
|
'CPS needed for next level (frenzy) (g / w)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheChainFrenzyRequiredNext)} / ${Beautify(
|
`${Beautify(CacheChainFrenzyRequiredNext)} / ${Beautify(
|
||||||
CacheChainFrenzyWrathRequiredNext,
|
CacheChainFrenzyWrathRequiredNext,
|
||||||
@@ -422,7 +422,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Conjure Baked Goods" Cookies Required',
|
'"Conjure Baked Goods" cookies required',
|
||||||
conjureReqFrag,
|
conjureReqFrag,
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -430,7 +430,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Conjure Baked Goods" Reward (MAX)',
|
'"Conjure Baked Goods" reward (max)',
|
||||||
document.createTextNode(Beautify(CacheConjureReward)),
|
document.createTextNode(Beautify(CacheConjureReward)),
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -465,7 +465,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Conjure Baked Goods" Cookies Required (Frenzy)',
|
'"Conjure Baked Goods" cookies required (frenzy)',
|
||||||
conjureFrenzyReqFrag,
|
conjureFrenzyReqFrag,
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -473,7 +473,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Conjure Baked Goods" Reward (MAX) (Frenzy)',
|
'"Conjure Baked Goods" reward (max) (frenzy)',
|
||||||
document.createTextNode(Beautify(CacheConjureReward * 7)),
|
document.createTextNode(Beautify(CacheConjureReward * 7)),
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -481,7 +481,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Conjure Baked Goods" Reward (CUR)',
|
'"Conjure Baked Goods" reward (cur)',
|
||||||
document.createTextNode(Beautify(conjureFrenzyCur)),
|
document.createTextNode(Beautify(conjureFrenzyCur)),
|
||||||
'GoldCookTooltipPlaceholder',
|
'GoldCookTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -490,7 +490,7 @@ export function SpellsSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'"Spontaneous Edifice" Cookies Required (most expensive building)',
|
'"Spontaneous Edifice" cookies required (most expensive building)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(CacheEdifice)} (${CacheEdificeBuilding})`,
|
`${Beautify(CacheEdifice)} (${CacheEdificeBuilding})`,
|
||||||
),
|
),
|
||||||
@@ -603,7 +603,7 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'Prestige Level (CUR / MAX)',
|
'Prestige level (cur / max)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(Game.prestige)} / ${Beautify(possiblePresMax)}`,
|
`${Beautify(Game.prestige)} / ${Beautify(possiblePresMax)}`,
|
||||||
),
|
),
|
||||||
@@ -636,7 +636,7 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'Cookies To Next Level',
|
'Cookies to next level',
|
||||||
cookiesNextFrag,
|
cookiesNextFrag,
|
||||||
'NextPrestTooltipPlaceholder',
|
'NextPrestTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
@@ -645,7 +645,7 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'Heavenly Chips (CUR / MAX)',
|
'Heavenly chips (cur / max)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
`${Beautify(Game.heavenlyChips)} / ${Beautify(
|
`${Beautify(Game.heavenlyChips)} / ${Beautify(
|
||||||
possiblePresMax - Game.prestige + Game.heavenlyChips,
|
possiblePresMax - Game.prestige + Game.heavenlyChips,
|
||||||
@@ -658,7 +658,7 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Heavenly Chips Per Second (last 5 seconds)',
|
'Heavenly chips per second (last 5 seconds)',
|
||||||
document.createTextNode(Beautify(CacheHCPerSecond, 2)),
|
document.createTextNode(Beautify(CacheHCPerSecond, 2)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -672,14 +672,14 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Heavenly Chips To Target Set In Settings (CUR)',
|
'Heavenly chips to target set in settings (cur)',
|
||||||
document.createTextNode(Beautify(CookiesTillTarget)),
|
document.createTextNode(Beautify(CookiesTillTarget)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'basic',
|
'basic',
|
||||||
'Time To Target (CUR, Current 5 Second Average)',
|
'Time till target (cur, current 5 second average)',
|
||||||
document.createTextNode(
|
document.createTextNode(
|
||||||
FormatTime(CookiesTillTarget / CacheHCPerSecond),
|
FormatTime(CookiesTillTarget / CacheHCPerSecond),
|
||||||
),
|
),
|
||||||
@@ -700,7 +700,7 @@ export function PrestigeSection() {
|
|||||||
section.appendChild(
|
section.appendChild(
|
||||||
StatsListing(
|
StatsListing(
|
||||||
'withTooltip',
|
'withTooltip',
|
||||||
'Reset Bonus Income',
|
'Reset bonus income',
|
||||||
resetFrag,
|
resetFrag,
|
||||||
'ResetTooltipPlaceholder',
|
'ResetTooltipPlaceholder',
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export default function ReplaceAscendTooltip() {
|
|||||||
)} more cookies</b> for the next level.<br>`;
|
)} more cookies</b> for the next level.<br>`;
|
||||||
str += `${
|
str += `${
|
||||||
CMOptions.TooltipAscendButton
|
CMOptions.TooltipAscendButton
|
||||||
? `<div class='line'></div>It takes ${CacheTimeTillNextPrestige} to reach the next level and you are making ${Beautify(
|
? `<div class='line'></div>It takes ${CacheTimeTillNextPrestige} to reach the next level and you were making ${Beautify(
|
||||||
CacheHCPerSecond,
|
CacheHCPerSecond,
|
||||||
2,
|
2,
|
||||||
)} chips on average in the last 5 seconds.<br>`
|
)} chips on average in the last 5 seconds.<br>`
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
import { VersionMajor, VersionMinor } from '../Data/Moddata';
|
||||||
import Draw from '../Disp/Draw';
|
import Draw from '../Disp/Draw';
|
||||||
|
import CMClickHook from '../Main/ClickHook';
|
||||||
import InitializeCookieMonster from '../Main/Initialization';
|
import InitializeCookieMonster from '../Main/Initialization';
|
||||||
import CMLoop from '../Main/Loop';
|
import CMLoopHook from '../Main/LoopHook';
|
||||||
import { isInitializing } from './Variables';
|
import { isInitializing } from './Variables';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -22,7 +23,8 @@ export default function init() {
|
|||||||
if (proceed) {
|
if (proceed) {
|
||||||
InitializeCookieMonster();
|
InitializeCookieMonster();
|
||||||
Game.registerHook('draw', Draw);
|
Game.registerHook('draw', Draw);
|
||||||
Game.registerHook('logic', CMLoop);
|
Game.registerHook('logic', CMLoopHook);
|
||||||
|
Game.registerHook('click', CMClickHook);
|
||||||
isInitializing = false;
|
isInitializing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
6
src/Main/ClickHook.js
Normal file
6
src/Main/ClickHook.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { CacheAverageCookiesFromClicks } from '../Cache/VariablesAndData';
|
||||||
|
|
||||||
|
export default function CMClickHook() {
|
||||||
|
// Add cookies from click to array that stores average
|
||||||
|
CacheAverageCookiesFromClicks.addLatest(Game.computedMouseCps);
|
||||||
|
}
|
||||||
@@ -35,7 +35,7 @@ import { LastModCount } from './VariablesAndData';
|
|||||||
* Main loop of Cookie Monster
|
* Main loop of Cookie Monster
|
||||||
* CM.init registers it to the "logic" hook provided by the modding api
|
* CM.init registers it to the "logic" hook provided by the modding api
|
||||||
*/
|
*/
|
||||||
export default function CMLoop() {
|
export default function CMLoopHook() {
|
||||||
if (LastAscendState !== Game.OnAscend) {
|
if (LastAscendState !== Game.OnAscend) {
|
||||||
LastAscendState = Game.OnAscend;
|
LastAscendState = Game.OnAscend;
|
||||||
UpdateAscendState();
|
UpdateAscendState();
|
||||||
Reference in New Issue
Block a user