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
@@ -11,8 +11,9 @@
|
||||
"Orteil"
|
||||
],
|
||||
"scripts": {
|
||||
"copy-file": "cp dist/CookieMonster.js CookieMonster.js",
|
||||
"eslint_src": "eslint src",
|
||||
"build": "run-s eslint_src pack_prod remove_comment",
|
||||
"build": "run-s eslint_src pack_prod remove_comment copy-file",
|
||||
"build_test": "run-s pack_dev",
|
||||
"pack_prod": "webpack --env production",
|
||||
"pack_dev": "webpack",
|
||||
|
||||
@@ -16,6 +16,9 @@ import {
|
||||
* @global {[{number}, {number}]} CM.Cache.WrinklersFattest A list containing the cookies and the id of the fattest non-shiny wrinkler
|
||||
*/
|
||||
export default function CacheWrinklers() {
|
||||
CacheWrinklersTotal = 0;
|
||||
CacheWrinklersNormal = 0;
|
||||
CacheWrinklersFattest = [0, null];
|
||||
for (let i = 0; i < Game.wrinklers.length; i++) {
|
||||
let sucked = Game.wrinklers[i].sucked;
|
||||
let toSuck = 1.1;
|
||||
|
||||
@@ -74,13 +74,15 @@ export function Beautify(num, floats, forced) {
|
||||
}
|
||||
}
|
||||
if (answer === '') {
|
||||
console.log(`Could not beautify number with CM.Disp.Beautify: ${num}`);
|
||||
console.log(
|
||||
`Could not beautify number with Cookie Monster Beautify: ${num}`,
|
||||
);
|
||||
answer = BackupFunctions.Beautify(num, floats);
|
||||
}
|
||||
if (CMOptions.ScaleSeparator) answer = answer.replace('.', ',');
|
||||
return answer;
|
||||
}
|
||||
console.log(`Could not beautify number with CM.Disp.Beautify: ${num}`);
|
||||
console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`);
|
||||
return BackupFunctions.Beautify(num, floats);
|
||||
}
|
||||
|
||||
|
||||
@@ -591,18 +591,20 @@ export function PrestigeSection() {
|
||||
),
|
||||
);
|
||||
|
||||
const neededCook =
|
||||
const neededCook = Math.max(
|
||||
0,
|
||||
Game.HowManyCookiesReset(possiblePresMax + 1) -
|
||||
(CacheRealCookiesEarned +
|
||||
Game.cookiesReset +
|
||||
CacheWrinklersTotal +
|
||||
((
|
||||
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')
|
||||
(CacheRealCookiesEarned +
|
||||
Game.cookiesReset +
|
||||
CacheWrinklersTotal +
|
||||
((
|
||||
Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')
|
||||
? CacheLastChoEgg
|
||||
: 0
|
||||
)
|
||||
? CacheLastChoEgg
|
||||
: 0
|
||||
)
|
||||
? CacheLastChoEgg
|
||||
: 0));
|
||||
: 0)),
|
||||
);
|
||||
const cookiesNextFrag = document.createDocumentFragment();
|
||||
cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook)));
|
||||
const cookiesNextSmall = document.createElement('small');
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
CacheHCPerSecond,
|
||||
CacheLastHeavenlyChips,
|
||||
CacheTimeTillNextPrestige,
|
||||
} from '../../Cache/VariablesAndData';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
@@ -11,15 +12,15 @@ import { Beautify } from '../BeautifyAndFormatting/BeautifyFormatting';
|
||||
* @returns {object} div An object containing the stylized header
|
||||
*/
|
||||
export default function ReplaceAscendTooltip() {
|
||||
const ascendNowToGet =
|
||||
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) -
|
||||
Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
|
||||
const cookiesToNext =
|
||||
const cookiesToNext = Math.max(
|
||||
0,
|
||||
Game.HowManyCookiesReset(
|
||||
Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) +
|
||||
1,
|
||||
) -
|
||||
(Game.cookiesEarned + Game.cookiesReset);
|
||||
(Game.cookiesEarned + Game.cookiesReset),
|
||||
);
|
||||
|
||||
const startDate = Game.sayTime(
|
||||
((Date.now() - Game.startDate) / 1000) * Game.fps,
|
||||
-1,
|
||||
@@ -35,17 +36,18 @@ export default function ReplaceAscendTooltip() {
|
||||
)}</b>.<br>(CpS +${Beautify(Game.prestige)}%)`;
|
||||
str += '<div class="line"></div>';
|
||||
}
|
||||
if (ascendNowToGet < 1) str += 'Ascending now would grant you no prestige.';
|
||||
else if (ascendNowToGet < 2)
|
||||
if (CacheLastHeavenlyChips < 1)
|
||||
str += 'Ascending now would grant you no prestige.';
|
||||
else if (CacheLastHeavenlyChips < 2)
|
||||
str +=
|
||||
'Ascending now would grant you<br><b>1 prestige level</b> (+1% CpS)<br>and <b>1 heavenly chip</b> to spend.';
|
||||
else
|
||||
str += `Ascending now would grant you<br><b>${Beautify(
|
||||
ascendNowToGet,
|
||||
CacheLastHeavenlyChips,
|
||||
)} prestige levels</b> (+${Beautify(
|
||||
ascendNowToGet,
|
||||
CacheLastHeavenlyChips,
|
||||
)}% CpS)<br>and <b>${Beautify(
|
||||
ascendNowToGet,
|
||||
CacheLastHeavenlyChips,
|
||||
)} heavenly chips</b> to spend.`;
|
||||
str += '<div class="line"></div>';
|
||||
str += `You need <b>${Beautify(
|
||||
|
||||
@@ -62,6 +62,10 @@ export function Building() {
|
||||
);
|
||||
if (Number.isFinite(increase) && increase !== 0) {
|
||||
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
||||
} else {
|
||||
l('CMTooltipIncome').textContent += ` (<0${
|
||||
CMOptions.ScaleSeparator ? ',' : '.'
|
||||
}01% of income)`;
|
||||
}
|
||||
l('CMTooltipBorder').className = ColorTextPre + target[TooltipName].color;
|
||||
l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2);
|
||||
@@ -134,6 +138,10 @@ export function Upgrade() {
|
||||
} else {
|
||||
if (Number.isFinite(increase) && increase !== 0) {
|
||||
l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`;
|
||||
} else {
|
||||
l('CMTooltipIncome').textContent += ` (<0${
|
||||
CMOptions.ScaleSeparator ? ',' : '.'
|
||||
}01% of income)`;
|
||||
}
|
||||
l('CMTooltipBorder').className =
|
||||
ColorTextPre +
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import Flash from '../../Disp/Notifications/Flash';
|
||||
import Notification from '../../Disp/Notifications/Notification';
|
||||
import PlaySound from '../../Disp/Notifications/Sound';
|
||||
@@ -16,7 +17,7 @@ export default function CheckTickerFortune() {
|
||||
Game.TickerEffect && Game.TickerEffect.type === 'fortune';
|
||||
if (LastTickerFortuneState) {
|
||||
Flash(3, 'FortuneFlash');
|
||||
PlaySound(CM.Options.FortuneSoundURL, 'FortuneSound', 'FortuneVolume');
|
||||
PlaySound(CMOptions.FortuneSoundURL, 'FortuneSound', 'FortuneVolume');
|
||||
Notification(
|
||||
'FortuneNotification',
|
||||
'Fortune Cookie found',
|
||||
|
||||
@@ -12,27 +12,28 @@ export default function InitUpgrade(upgradeName) {
|
||||
const you = {};
|
||||
// Some upgrades have a function for .power (notably the valentine cookies)
|
||||
you.power = me.power;
|
||||
if (typeof me.power === 'function') {
|
||||
if (typeof you.power === 'function') {
|
||||
if (me.name === 'Sugar crystal cookies') {
|
||||
me.power = function () {
|
||||
you.power = function () {
|
||||
let n = 5;
|
||||
for (const i in SimObjects) {
|
||||
if (SimObjects[i].level >= 10) n += 1;
|
||||
}
|
||||
return n;
|
||||
};
|
||||
} else {
|
||||
you.power = function () {
|
||||
let pow = 2;
|
||||
if (SimHas('Starlove')) pow = 3;
|
||||
if (Game.hasGod) {
|
||||
const godLvl = SimHasGod('seasons');
|
||||
if (godLvl === 1) pow *= 1.3;
|
||||
else if (godLvl === 2) pow *= 1.2;
|
||||
else if (godLvl === 3) pow *= 1.1;
|
||||
}
|
||||
return pow;
|
||||
};
|
||||
}
|
||||
me.power = function () {
|
||||
let pow = 2;
|
||||
if (SimHas('Starlove')) pow = 3;
|
||||
if (Game.hasGod) {
|
||||
const godLvl = SimHasGod('seasons');
|
||||
if (godLvl === 1) pow *= 1.3;
|
||||
else if (godLvl === 2) pow *= 1.2;
|
||||
else if (godLvl === 3) pow *= 1.1;
|
||||
}
|
||||
return pow;
|
||||
};
|
||||
}
|
||||
you.pool = me.pool;
|
||||
you.name = me.name;
|
||||
|
||||
Reference in New Issue
Block a user