Complete overhaul of code structure and relevant files (#639)

This commit is contained in:
Daniël van Noord
2021-03-14 00:41:14 +01:00
committed by GitHub
parent bb34bce9a5
commit 1bffb58782
163 changed files with 7369 additions and 10882 deletions

View File

@@ -0,0 +1,30 @@
import SimHas from '../ReplacedGameFunctions/SimHas';
import SimHasGod from '../ReplacedGameFunctions/SimHasGod';
/**
* This function constructs an object with the static properties of an upgrade
* @param {string} upgradeName Name of the Upgrade
* @returns {Object} you The static object
*/
export default function InitUpgrade(upgradeName) {
const me = Game.Upgrades[upgradeName];
const you = {};
// Some upgrades have a function for .power (notably the valentine cookies)
you.power = me.power;
if (typeof (me.power) === 'function') {
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;
return you;
}