Fix break upon 0 wrinklers #715

This commit is contained in:
Daniël van Noord
2021-03-22 08:20:52 +01:00
parent 1653c18c55
commit 68c8cc9d54
9 changed files with 24 additions and 32 deletions

View File

@@ -11,8 +11,6 @@ import {
SimAchievementsOwned,
SimCookiesPs,
SimCookiesPsRaw,
SimDateAges,
SimDateCentury,
SimEffs,
SimHeavenlyPower,
SimObjects,
@@ -94,15 +92,13 @@ export default function CalculateGains() {
godLvl = SimHasGod('ages');
if (godLvl === 1)
mult *=
1 + 0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 3)) * Math.PI * 2);
1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 3)) * Math.PI * 2);
else if (godLvl === 2)
mult *=
1 +
0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 12)) * Math.PI * 2);
1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 12)) * Math.PI * 2);
else if (godLvl === 3)
mult *=
1 +
0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 24)) * Math.PI * 2);
1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 24)) * Math.PI * 2);
godLvl = SimHasGod('decadence');
if (godLvl === 1) buildMult *= 0.93;
@@ -193,7 +189,7 @@ export default function CalculateGains() {
if (SimHas('Century egg')) {
// The boost increases a little every day, with diminishing returns up to +10% on the 100th day
let day =
(Math.floor((SimDateCentury - Game.startDate) / 1000 / 10) * 10) /
(Math.floor((Date.now() - Game.startDate) / 1000 / 10) * 10) /
60 /
60 /
24;