Merge pull request #649 from DanielNoord/fix/hotfix

Hotfix 1
This commit is contained in:
Daniël van Noord
2021-03-14 16:12:30 +01:00
committed by GitHub
5 changed files with 84 additions and 12 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

@@ -1,5 +1,6 @@
import SimHas from '../ReplacedGameFunctions/SimHas'; import SimHas from '../ReplacedGameFunctions/SimHas';
import SimHasGod from '../ReplacedGameFunctions/SimHasGod'; import SimHasGod from '../ReplacedGameFunctions/SimHasGod';
import { SimObjects } from '../VariablesAndData';
/** /**
* This function constructs an object with the static properties of an upgrade * This function constructs an object with the static properties of an upgrade
@@ -12,6 +13,15 @@ export default function InitUpgrade(upgradeName) {
// Some upgrades have a function for .power (notably the valentine cookies) // Some upgrades have a function for .power (notably the valentine cookies)
you.power = me.power; you.power = me.power;
if (typeof (me.power) === 'function') { if (typeof (me.power) === 'function') {
if (me.name === 'Sugar crystal cookies') {
me.power = function () {
let n = 5;
for (const i in SimObjects) {
if (SimObjects[i].level >= 10) n += 1;
}
return n;
};
}
me.power = function () { me.power = function () {
let pow = 2; let pow = 2;
if (SimHas('Starlove')) pow = 3; if (SimHas('Starlove')) pow = 3;

View File

@@ -1,4 +1,8 @@
import SimAuraMult from '../ReplacedGameFunctions/SimAuraMult';
import SimEff from '../ReplacedGameFunctions/SimEff';
import SimGetTieredCpsMult from '../ReplacedGameFunctions/SimGetTieredCpsMult'; import SimGetTieredCpsMult from '../ReplacedGameFunctions/SimGetTieredCpsMult';
import SimHas from '../ReplacedGameFunctions/SimHas';
import { SimObjects } from '../VariablesAndData';
/** /**
* This function constructs an object with the static properties of a building, * This function constructs an object with the static properties of a building,
@@ -10,15 +14,73 @@ import SimGetTieredCpsMult from '../ReplacedGameFunctions/SimGetTieredCpsMult';
export default function InitialBuildingData(buildingName) { export default function InitialBuildingData(buildingName) {
const me = Game.Objects[buildingName]; const me = Game.Objects[buildingName];
const you = {}; const you = {};
you.cps = function (it) { if (me.name === 'Cursor') {
let mult = 1; you.cps = function (it) {
mult *= SimGetTieredCpsMult(it); let add = 0;
mult *= Game.magicCpS(it.name); if (SimHas('Thousand fingers')) add += 0.1;
if (typeof it.baseCps === 'function') { if (SimHas('Million fingers')) add *= 5;
return it.baseCps(it) * mult; if (SimHas('Billion fingers')) add *= 10;
} if (SimHas('Trillion fingers')) add *= 20;
return it.baseCPS * mult; if (SimHas('Quadrillion fingers')) add *= 20;
}; if (SimHas('Quintillion fingers')) add *= 20;
if (SimHas('Sextillion fingers')) add *= 20;
if (SimHas('Septillion fingers')) add *= 20;
if (SimHas('Octillion fingers')) add *= 20;
if (SimHas('Nonillion fingers')) add *= 20;
let mult = 1;
let num = 0;
for (const i in SimObjects) { if (SimObjects[i].name !== 'Cursor') num += SimObjects[i].amount; }
add *= num;
mult *= SimGetTieredCpsMult(it);
mult *= Game.magicCpS('Cursor');
mult *= SimEff('cursorCps');
return Game.ComputeCps(0.1, SimHas('Reinforced index finger') + SimHas('Carpal tunnel prevention cream') + SimHas('Ambidextrous'), add) * mult;
};
} else if (me.name === 'Grandma') {
you.cps = function (it) {
let mult = 1;
for (const i in Game.GrandmaSynergies) {
if (SimHas(Game.GrandmaSynergies[i])) mult *= 2;
}
if (SimHas('Bingo center/Research facility')) mult *= 4;
if (SimHas('Ritual rolling pins')) mult *= 2;
if (SimHas('Naughty list')) mult *= 2;
if (SimHas('Elderwort biscuits')) mult *= 1.02;
mult *= SimEff('grandmaCps');
if (SimHas('Cat ladies')) {
for (let i = 0; i < Game.UpgradesByPool.kitten.length; i++) {
if (SimHas(Game.UpgradesByPool.kitten[i].name)) mult *= 1.29;
}
}
mult *= SimGetTieredCpsMult(it);
let add = 0;
if (SimHas('One mind')) add += SimObjects.Grandma.amount * 0.02;
if (SimHas('Communal brainsweep')) add += SimObjects.Grandma.amount * 0.02;
if (SimHas('Elder Pact')) add += SimObjects.Portal.amount * 0.05;
let num = 0;
for (const i in SimObjects) { if (SimObjects[i].name !== 'Grandma') num += SimObjects[i].amount; }
// if (Game.hasAura('Elder Battalion')) mult*=1+0.01*num;
mult *= 1 + SimAuraMult('Elder Battalion') * 0.01 * num;
mult *= Game.magicCpS(me.name);
return (me.baseCps + add) * mult;
};
} else {
you.cps = function (it) {
let mult = 1;
mult *= SimGetTieredCpsMult(it);
mult *= Game.magicCpS(it.name);
return it.baseCPS * mult;
};
}
// Below is needed for above eval, specifically for the GetTieredCpsMult function // Below is needed for above eval, specifically for the GetTieredCpsMult function
you.baseCps = me.baseCps; you.baseCps = me.baseCps;
you.name = me.name; you.name = me.name;