Initial fix for #707
This commit is contained in:
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
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-unused-vars */
|
||||||
import InitCache from '../Cache/CacheInit';
|
import InitCache from '../Cache/CacheInit';
|
||||||
import LoopCache from '../Cache/CacheLoop';
|
import LoopCache from '../Cache/CacheLoop';
|
||||||
import CacheNoGoldSwitchCPS from '../Cache/CPS/NoGoldSwitchCPS';
|
import CacheNoGoldSwitchCPS from '../Cache/CPS/NoGoldSwitchCPS';
|
||||||
@@ -29,13 +30,14 @@ import CheckMagicMeter from './CheckStates/Grimoire';
|
|||||||
import CheckSeasonPopup from './CheckStates/Season';
|
import CheckSeasonPopup from './CheckStates/Season';
|
||||||
import CheckTickerFortune from './CheckStates/Ticker';
|
import CheckTickerFortune from './CheckStates/Ticker';
|
||||||
import CheckWrinklerCount from './CheckStates/Wrinkler';
|
import CheckWrinklerCount from './CheckStates/Wrinkler';
|
||||||
import { LastModCount } from './VariablesAndData';
|
import { DateAtBeginLoop, LastModCount } from './VariablesAndData';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main loop of Cookie Monster
|
* Main loop of Cookie Monster
|
||||||
* CM.init registers it to the "logic" hook provided by the modding api
|
* CM.init registers it to the "logic" hook provided by the modding api
|
||||||
*/
|
*/
|
||||||
export default function CMLoopHook() {
|
export default function CMLoopHook() {
|
||||||
|
DateAtBeginLoop = Date.now();
|
||||||
if (LastAscendState !== Game.OnAscend) {
|
if (LastAscendState !== Game.OnAscend) {
|
||||||
LastAscendState = Game.OnAscend;
|
LastAscendState = Game.OnAscend;
|
||||||
UpdateAscendState();
|
UpdateAscendState();
|
||||||
|
|||||||
@@ -21,3 +21,8 @@ export let LastSpawnedGoldenCookieState;
|
|||||||
export let LastMagicBarFull;
|
export let LastMagicBarFull;
|
||||||
export let CurrSpawnedGoldenCookieState;
|
export let CurrSpawnedGoldenCookieState;
|
||||||
export let LastWrinklerCount;
|
export let LastWrinklerCount;
|
||||||
|
|
||||||
|
/** Stores the date at the beginning of a Main loop
|
||||||
|
* Calculations depending on time (God Cyclius) will all use same time
|
||||||
|
*/
|
||||||
|
export let DateAtBeginLoop;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import GetCPSBuffMult from '../../Cache/CPS/GetCPSBuffMult';
|
import GetCPSBuffMult from '../../Cache/CPS/GetCPSBuffMult';
|
||||||
import { CacheCentEgg } from '../../Cache/VariablesAndData';
|
import { CacheCentEgg } from '../../Cache/VariablesAndData';
|
||||||
|
import { DateAtBeginLoop } from '../../Main/VariablesAndData';
|
||||||
import SimAuraMult from '../ReplacedGameFunctions/SimAuraMult';
|
import SimAuraMult from '../ReplacedGameFunctions/SimAuraMult';
|
||||||
import SimEff from '../ReplacedGameFunctions/SimEff';
|
import SimEff from '../ReplacedGameFunctions/SimEff';
|
||||||
import SimGetHeavenlyMultiplier from '../ReplacedGameFunctions/SimGetHeavenlyMultiplier';
|
import SimGetHeavenlyMultiplier from '../ReplacedGameFunctions/SimGetHeavenlyMultiplier';
|
||||||
@@ -92,13 +93,18 @@ export default function CalculateGains() {
|
|||||||
godLvl = SimHasGod('ages');
|
godLvl = SimHasGod('ages');
|
||||||
if (godLvl === 1)
|
if (godLvl === 1)
|
||||||
mult *=
|
mult *=
|
||||||
1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 3)) * Math.PI * 2);
|
1 +
|
||||||
|
0.15 * Math.sin((DateAtBeginLoop / 1000 / (60 * 60 * 3)) * Math.PI * 2);
|
||||||
else if (godLvl === 2)
|
else if (godLvl === 2)
|
||||||
mult *=
|
mult *=
|
||||||
1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 12)) * Math.PI * 2);
|
1 +
|
||||||
|
0.15 *
|
||||||
|
Math.sin((DateAtBeginLoop / 1000 / (60 * 60 * 12)) * Math.PI * 2);
|
||||||
else if (godLvl === 3)
|
else if (godLvl === 3)
|
||||||
mult *=
|
mult *=
|
||||||
1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 24)) * Math.PI * 2);
|
1 +
|
||||||
|
0.15 *
|
||||||
|
Math.sin((DateAtBeginLoop / 1000 / (60 * 60 * 24)) * Math.PI * 2);
|
||||||
|
|
||||||
godLvl = SimHasGod('decadence');
|
godLvl = SimHasGod('decadence');
|
||||||
if (godLvl === 1) buildMult *= 0.93;
|
if (godLvl === 1) buildMult *= 0.93;
|
||||||
@@ -189,7 +195,7 @@ export default function CalculateGains() {
|
|||||||
if (SimHas('Century egg')) {
|
if (SimHas('Century egg')) {
|
||||||
// The boost increases a little every day, with diminishing returns up to +10% on the 100th day
|
// The boost increases a little every day, with diminishing returns up to +10% on the 100th day
|
||||||
let day =
|
let day =
|
||||||
(Math.floor((Date.now() - Game.startDate) / 1000 / 10) * 10) /
|
(Math.floor((DateAtBeginLoop - Game.startDate) / 1000 / 10) * 10) /
|
||||||
60 /
|
60 /
|
||||||
60 /
|
60 /
|
||||||
24;
|
24;
|
||||||
|
|||||||
Reference in New Issue
Block a user