Skip to content

Commit ca5d9ba

Browse files
authored
Merge pull request #748 from Aktanusa/dev
Master to version 2.031.7
2 parents f7c4e23 + cba8eb7 commit ca5d9ba

File tree

106 files changed

+3199
-1887
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3199
-1887
lines changed

.eslintignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,26 @@ module.exports = {
99
b64_to_utf8: 'readonly',
1010
utf8_to_b64: 'readonly',
1111
BeautifyAll: 'readonly',
12+
PlaySound: 'readonly',
1213
},
1314
extends: ['airbnb-base', 'plugin:prettier/recommended'],
1415
parserOptions: {
1516
ecmaVersion: 12,
1617
},
18+
ignorePatterns: ['*CookieMonster*.js', 'dist/*', 'node_modules/*'],
1719
rules: {
1820
'import/no-mutable-exports': 'off',
1921
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
20-
'no-new-func': 'off',
2122
'func-names': 'off',
22-
'no-console': 'off',
23-
'no-alert': 'off',
24-
'no-restricted-globals': 'off',
2523
'prefer-destructuring': ['error', { object: true, array: false }],
24+
'max-len': [
25+
1,
26+
{
27+
code: 100,
28+
ignoreComments: true,
29+
ignoreStrings: true,
30+
ignoreTemplateLiterals: true,
31+
},
32+
],
2633
},
2734
};

.prettierrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"singleQuote": true,
3-
"trailingComma": "all",
4-
"printWidth": 80
3+
"trailingComma": "all"
54
}

CookieMonster.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/CookieMonster.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/CookieMonster.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1430 additions & 443 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cookiemonster-mod",
3-
"version": "2.031.6",
3+
"version": "2.031.7",
44
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
55
"main": "CookieMonster.js",
66
"keywords": [

src/Cache/CPS/AverageQueue.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-unused-vars */
21
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
32
import {
43
ChoEggDiff,
@@ -50,16 +49,24 @@ export class CMAvgQueue {
5049
}
5150
return ret / time;
5251
}
52+
53+
calcSum(timePeriod) {
54+
let time = timePeriod;
55+
if (time > this.maxLength) time = this.maxLength;
56+
if (time > this.queue.length) time = this.queue.length;
57+
if (time === 0) return 0;
58+
return this.queue.slice(-time).reduce((a, b) => a + b, 0);
59+
}
5360
}
5461

5562
/**
5663
* This functions caches creates the CMAvgQueue used by CM.Cache.CacheAvgCPS() to calculate CPS
5764
* Called by CM.Cache.InitCache()
5865
*/
5966
export function InitCookiesDiff() {
60-
CookiesDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
61-
WrinkDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
62-
WrinkFattestDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
63-
ChoEggDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]);
64-
ClicksDiff = new CMAvgQueue(ClickTimes[ClickTimes.length - 1]);
67+
CookiesDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
68+
WrinkDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
69+
WrinkFattestDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
70+
ChoEggDiff = new CMAvgQueue(CookieTimes[CookieTimes.length - 1]); // eslint-disable-line no-unused-vars
71+
ClicksDiff = new CMAvgQueue(ClickTimes[ClickTimes.length - 1]); // eslint-disable-line no-unused-vars
6572
}

src/Cache/CPS/CPS.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-unused-vars */
2-
31
import { CMOptions } from '../../Config/VariablesAndData';
42
import { ClickTimes, CookieTimes } from '../../Disp/VariablesAndData';
53
import {
@@ -41,7 +39,7 @@ export default function CacheAvgCPS() {
4139
if ((Game.T / Game.fps) % 1 === 0) {
4240
let choEggTotal = Game.cookies + CacheSellForChoEgg;
4341
if (Game.cpsSucked > 0) choEggTotal += CacheWrinklersTotal;
44-
CacheRealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal);
42+
CacheRealCookiesEarned = Math.max(Game.cookiesEarned, choEggTotal); // eslint-disable-line no-unused-vars
4543
choEggTotal *= 0.05;
4644

4745
// Add recent gains to AvgQueue's
@@ -89,8 +87,9 @@ export default function CacheAvgCPS() {
8987
CacheAverageGainBank +
9088
CacheAverageGainWrink +
9189
(choEgg ? CacheAverageGainChoEgg : 0);
92-
} else CacheAvgCPSWithChoEgg = CacheAverageCPS;
90+
} else CacheAvgCPSWithChoEgg = CacheAverageCPS; // eslint-disable-line no-unused-vars
9391

92+
// eslint-disable-next-line no-unused-vars
9493
CacheAverageClicks = ClicksDiff.calcAverage(
9594
ClickTimes[CMOptions.AvgClicksHist],
9695
);

0 commit comments

Comments
 (0)