Merge pull request #719 from Aktanusa/master

Push fixes to pages
This commit is contained in:
Daniël van Noord
2021-03-22 08:28:47 +01:00
committed by GitHub
9 changed files with 24 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

@@ -24,8 +24,8 @@ import {
* @param {amount} amount Amount to be bought * @param {amount} amount Amount to be bought
* @parem {string} target The target Cache object ("Objects1", "Objects10" or "Objects100") * @parem {string} target The target Cache object ("Objects1", "Objects10" or "Objects100")
*/ */
function CacheBuildingIncome(amount, target) { function CacheBuildingIncome(amount) {
const result = []; const result = {};
Object.keys(Game.Objects).forEach((i) => { Object.keys(Game.Objects).forEach((i) => {
result[i] = {}; result[i] = {};
result[i].bonus = BuyBuildingsBonusIncome(i, amount); result[i].bonus = BuyBuildingsBonusIncome(i, amount);

View File

@@ -23,16 +23,17 @@ export default function GetCPS() {
(CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05)) (CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05))
); );
} }
if ( if (CacheWrinklersFattest[1] !== null)
CMOptions.CalcWrink === 2 && if (
Game.wrinklers[CacheWrinklersFattest[1]].type === 1 CMOptions.CalcWrink === 2 &&
) { Game.wrinklers[CacheWrinklersFattest[1]].type === 1
return ( ) {
Game.cookiesPs * return (
((CacheCurrWrinklerCPSMult * 3) / CacheCurrWrinklerCount + Game.cookiesPs *
(1 - CacheCurrWrinklerCount * 0.05)) ((CacheCurrWrinklerCPSMult * 3) / CacheCurrWrinklerCount +
); (1 - CacheCurrWrinklerCount * 0.05))
} );
}
return ( return (
Game.cookiesPs * Game.cookiesPs *
(CacheCurrWrinklerCPSMult / CacheCurrWrinklerCount + (CacheCurrWrinklerCPSMult / CacheCurrWrinklerCount +

View File

@@ -11,11 +11,7 @@ import UpdateTitle from '../../Disp/TabTitle/TabTitle';
import ReplaceAscendTooltip from '../../Disp/Tooltips/AscendButton'; import ReplaceAscendTooltip from '../../Disp/Tooltips/AscendButton';
import UpdateTooltipLocation from '../../Disp/Tooltips/PositionLocation'; import UpdateTooltipLocation from '../../Disp/Tooltips/PositionLocation';
import { CMSayTime, Title } from '../../Disp/VariablesAndData'; import { CMSayTime, Title } from '../../Disp/VariablesAndData';
import { import { SimDoSims } from '../../Sim/VariablesAndData';
SimDateAges,
SimDateCentury,
SimDoSims,
} from '../../Sim/VariablesAndData';
import ReplaceTooltipUpgrade from '../ReplaceGameElements/TooltipUpgrades'; import ReplaceTooltipUpgrade from '../ReplaceGameElements/TooltipUpgrades';
import { BackupFunctions } from '../VariablesAndData'; import { BackupFunctions } from '../VariablesAndData';
import FixMouseY from './FixMouse'; import FixMouseY from './FixMouse';
@@ -33,8 +29,6 @@ export default function ReplaceNative() {
Game.CalculateGains = function () { Game.CalculateGains = function () {
BackupFunctions.CalculateGains(); BackupFunctions.CalculateGains();
SimDoSims = 1; SimDoSims = 1;
SimDateAges = Date.now();
SimDateCentury = Date.now();
}; };
BackupFunctions.tooltip = {}; BackupFunctions.tooltip = {};

View File

@@ -11,8 +11,6 @@ import {
SimAchievementsOwned, SimAchievementsOwned,
SimCookiesPs, SimCookiesPs,
SimCookiesPsRaw, SimCookiesPsRaw,
SimDateAges,
SimDateCentury,
SimEffs, SimEffs,
SimHeavenlyPower, SimHeavenlyPower,
SimObjects, SimObjects,
@@ -94,15 +92,13 @@ export default function CalculateGains() {
godLvl = SimHasGod('ages'); godLvl = SimHasGod('ages');
if (godLvl === 1) if (godLvl === 1)
mult *= 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) else if (godLvl === 2)
mult *= mult *=
1 + 1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 12)) * Math.PI * 2);
0.15 * Math.sin((SimDateAges / 1000 / (60 * 60 * 12)) * Math.PI * 2);
else if (godLvl === 3) else if (godLvl === 3)
mult *= mult *=
1 + 1 + 0.15 * Math.sin((Date.now() / 1000 / (60 * 60 * 24)) * Math.PI * 2);
0.15 * Math.sin((SimDateAges / 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;
@@ -193,7 +189,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((SimDateCentury - Game.startDate) / 1000 / 10) * 10) / (Math.floor((Date.now() - Game.startDate) / 1000 / 10) * 10) /
60 / 60 /
60 / 60 /
24; 24;

View File

@@ -17,7 +17,5 @@ export let SimGod2;
export let SimGod3; export let SimGod3;
export let SimDoSims; export let SimDoSims;
export let SimEffs; export let SimEffs;
export let SimDateCentury = Game.startDate;
export let SimDateAges = Game.startDate;
export let SimCookiesPs; export let SimCookiesPs;
export let SimCookiesPsRaw; export let SimCookiesPsRaw;

View File

@@ -1,13 +1,12 @@
/** We know this is not how Webpack should be used, but we are slowly transferring our code.
* For now this is how at least start to create a structure that allows us to transfer towards
* more modular code. Any help is highly appreciated.
*/
const path = require('path'); const path = require('path');
module.exports = function (env) { module.exports = function (env) {
return { return {
mode: 'production', mode: 'production',
devtool: env.production ? 'source-map' : 'eval-source-map', devtool: env.production ? 'source-map' : 'eval-source-map',
optimization: {
minimize: !!env.production,
},
entry: { entry: {
CookieMonster: { CookieMonster: {
import: './src/CookieMonster.js', import: './src/CookieMonster.js',