Show cookies from clicking in stats #698
This commit is contained in:
@@ -50,6 +50,14 @@ export class CMAvgQueue {
|
||||
}
|
||||
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 */
|
||||
import { ClickTimes } from '../Disp/VariablesAndData';
|
||||
import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue';
|
||||
import CacheAvgCPS from './CPS/CPS';
|
||||
import CacheDragonAuras from './Dragon/CacheDragonAuras';
|
||||
@@ -15,7 +16,10 @@ import {
|
||||
CacheGoldenAndWrathCookiesMults,
|
||||
CacheStatsCookies,
|
||||
} from './Stats/Stats';
|
||||
import { HeavenlyChipsDiff } from './VariablesAndData';
|
||||
import {
|
||||
CacheAverageCookiesFromClicks,
|
||||
HeavenlyChipsDiff,
|
||||
} from './VariablesAndData';
|
||||
import CacheWrinklers from './Wrinklers/Wrinklers';
|
||||
|
||||
/**
|
||||
@@ -31,6 +35,9 @@ export default function InitCache() {
|
||||
CacheSeasonSpec();
|
||||
InitCookiesDiff();
|
||||
HeavenlyChipsDiff = new CMAvgQueue(5); // Used by CM.Cache.CacheHeavenlyChipsPS()
|
||||
CacheAverageCookiesFromClicks = new CMAvgQueue(
|
||||
ClickTimes[ClickTimes.length - 1] * 20,
|
||||
);
|
||||
CacheHeavenlyChipsPS();
|
||||
CacheAvgCPS();
|
||||
CacheIncome();
|
||||
|
||||
@@ -39,6 +39,7 @@ export let CacheCurrWrinklerCount = 0;
|
||||
export let CacheUpgrades = {};
|
||||
|
||||
export let CacheAverageClicks = {};
|
||||
export let CacheAverageCookiesFromClicks;
|
||||
|
||||
export let CacheMissingUpgrades = {};
|
||||
export let CacheMissingUpgradesPrestige = {};
|
||||
|
||||
Reference in New Issue
Block a user