Changes according to Eslint

This commit is contained in:
Daniël van Noord
2021-03-16 09:32:50 +01:00
parent 26d8e75935
commit a65af049b6
63 changed files with 314 additions and 295 deletions

View File

@@ -6,14 +6,14 @@ import SimHas from './SimHas';
*/
export default function SimGetTieredCpsMult(me) {
let mult = 1;
for (const i in me.tieredUpgrades) {
Object.keys(me.tieredUpgrades).forEach((i) => {
if (
!Game.Tiers[me.tieredUpgrades[i].tier].special &&
SimHas(me.tieredUpgrades[i].name)
)
mult *= 2;
}
for (const i in me.synergies) {
});
Object.keys(me.synergies).forEach((i) => {
if (SimHas(me.synergies[i].name)) {
const syn = me.synergies[i];
if (syn.buildingTie1.name === me.name)
@@ -21,7 +21,7 @@ export default function SimGetTieredCpsMult(me) {
else if (syn.buildingTie2.name === me.name)
mult *= 1 + 0.001 * syn.buildingTie1.amount;
}
}
});
if (me.fortune && SimHas(me.fortune.name)) mult *= 1.07;
if (me.grandma && SimHas(me.grandma.name))
mult *= 1 + SimObjects.Grandma.amount * 0.01 * (1 / (me.id - 1));

View File

@@ -8,26 +8,27 @@ import SimHasGod from './SimHasGod';
* This function calculates the sell price of a building based on current "sim data"
* @param {string} building Name of the building
* @param {number} price Current price of building
* @returns {number} price The modified building price
* @returns {number} ModifiedPrice The modified building price
*/
export default function SimModifyBuildingPrice(building, price) {
if (SimHas('Season savings')) price *= 0.99;
if (SimHas("Santa's dominion")) price *= 0.99;
if (SimHas('Faberge egg')) price *= 0.99;
if (SimHas('Divine discount')) price *= 0.99;
if (SimHas('Fortune #100')) price *= 0.99;
// if (SimHasAura('Fierce Hoarder')) price *= 0.98;
price *= 1 - SimAuraMult('Fierce Hoarder') * 0.02;
if (Game.hasBuff('Everything must go')) price *= 0.95;
if (Game.hasBuff('Crafty pixies')) price *= 0.98;
if (Game.hasBuff('Nasty goblins')) price *= 1.02;
if (building.fortune && SimHas(building.fortune.name)) price *= 0.93;
price *= SimEff('buildingCost');
let ModifiedPrice = price;
if (SimHas('Season savings')) ModifiedPrice *= 0.99;
if (SimHas("Santa's dominion")) ModifiedPrice *= 0.99;
if (SimHas('Faberge egg')) ModifiedPrice *= 0.99;
if (SimHas('Divine discount')) ModifiedPrice *= 0.99;
if (SimHas('Fortune #100')) ModifiedPrice *= 0.99;
// if (SimHasAura('Fierce Hoarder')) ModifiedPrice *= 0.98;
ModifiedPrice *= 1 - SimAuraMult('Fierce Hoarder') * 0.02;
if (Game.hasBuff('Everything must go')) ModifiedPrice *= 0.95;
if (Game.hasBuff('Crafty pixies')) ModifiedPrice *= 0.98;
if (Game.hasBuff('Nasty goblins')) ModifiedPrice *= 1.02;
if (building.fortune && SimHas(building.fortune.name)) ModifiedPrice *= 0.93;
ModifiedPrice *= SimEff('buildingCost');
if (SimObjects.Temple.minigameLoaded) {
const godLvl = SimHasGod('creation');
if (godLvl === 1) price *= 0.93;
else if (godLvl === 2) price *= 0.95;
else if (godLvl === 3) price *= 0.98;
if (godLvl === 1) ModifiedPrice *= 0.93;
else if (godLvl === 2) ModifiedPrice *= 0.95;
else if (godLvl === 3) ModifiedPrice *= 0.98;
}
return price;
return ModifiedPrice;
}