Merge pull request #673 from Aktanusa/master

Push fixes to GH Pages
This commit is contained in:
Daniël van Noord
2021-03-15 09:03:25 +01:00
committed by GitHub
8 changed files with 52 additions and 36 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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;

View File

@@ -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');

View File

@@ -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(

View File

@@ -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 +

View File

@@ -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;