Added prettier (#661)
* Added prettier * Added prettier * Added prettier
This commit is contained in:
@@ -4,8 +4,16 @@ import { SimDragonAura, SimDragonAura2 } from '../VariablesAndData';
|
||||
* This functions creates functions similarly to Game.auraMult but checks Sim Data instead of Game Data
|
||||
*/
|
||||
export default function SimAuraMult(what) {
|
||||
let n = 0;
|
||||
if (Game.dragonAuras[SimDragonAura].name === what || Game.dragonAuras[SimDragonAura2].name === what) n = 1;
|
||||
if (Game.dragonAuras[SimDragonAura].name === 'Reality Bending' || Game.dragonAuras[SimDragonAura2].name === 'Reality Bending') n += 0.1;
|
||||
return n;
|
||||
let n = 0;
|
||||
if (
|
||||
Game.dragonAuras[SimDragonAura].name === what ||
|
||||
Game.dragonAuras[SimDragonAura2].name === what
|
||||
)
|
||||
n = 1;
|
||||
if (
|
||||
Game.dragonAuras[SimDragonAura].name === 'Reality Bending' ||
|
||||
Game.dragonAuras[SimDragonAura2].name === 'Reality Bending'
|
||||
)
|
||||
n += 0.1;
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ import { SimEffs } from '../VariablesAndData';
|
||||
* This functions creates functions similarly to Game.Eff but checks Sim Data instead of Game Data
|
||||
*/
|
||||
export default function SimEff(name, def) {
|
||||
if (typeof SimEffs[name] === 'undefined') {
|
||||
return (typeof def === 'undefined' ? 1 : def);
|
||||
} return SimEffs[name];
|
||||
if (typeof SimEffs[name] === 'undefined') {
|
||||
return typeof def === 'undefined' ? 1 : def;
|
||||
}
|
||||
return SimEffs[name];
|
||||
}
|
||||
|
||||
@@ -6,22 +6,22 @@ import SimHasGod from './SimHasGod';
|
||||
* This functions creates functions similarly to Game.GetHeavenlyMultiplier but checks Sim Data instead of Game Data
|
||||
*/
|
||||
export default function SimGetHeavenlyMultiplier() {
|
||||
let heavenlyMult = 0;
|
||||
if (SimHas('Heavenly chip secret')) heavenlyMult += 0.05;
|
||||
if (SimHas('Heavenly cookie stand')) heavenlyMult += 0.20;
|
||||
if (SimHas('Heavenly bakery')) heavenlyMult += 0.25;
|
||||
if (SimHas('Heavenly confectionery')) heavenlyMult += 0.25;
|
||||
if (SimHas('Heavenly key')) heavenlyMult += 0.25;
|
||||
// if (SimHasAura('Dragon God')) heavenlyMult*=1.05;
|
||||
heavenlyMult *= 1 + SimAuraMult('Dragon God') * 0.05;
|
||||
if (SimHas('Lucky digit')) heavenlyMult *= 1.01;
|
||||
if (SimHas('Lucky number')) heavenlyMult *= 1.01;
|
||||
if (SimHas('Lucky payout')) heavenlyMult *= 1.01;
|
||||
if (Game.hasGod) {
|
||||
const godLvl = SimHasGod('creation');
|
||||
if (godLvl === 1) heavenlyMult *= 0.7;
|
||||
else if (godLvl === 2) heavenlyMult *= 0.8;
|
||||
else if (godLvl === 3) heavenlyMult *= 0.9;
|
||||
}
|
||||
return heavenlyMult;
|
||||
let heavenlyMult = 0;
|
||||
if (SimHas('Heavenly chip secret')) heavenlyMult += 0.05;
|
||||
if (SimHas('Heavenly cookie stand')) heavenlyMult += 0.2;
|
||||
if (SimHas('Heavenly bakery')) heavenlyMult += 0.25;
|
||||
if (SimHas('Heavenly confectionery')) heavenlyMult += 0.25;
|
||||
if (SimHas('Heavenly key')) heavenlyMult += 0.25;
|
||||
// if (SimHasAura('Dragon God')) heavenlyMult*=1.05;
|
||||
heavenlyMult *= 1 + SimAuraMult('Dragon God') * 0.05;
|
||||
if (SimHas('Lucky digit')) heavenlyMult *= 1.01;
|
||||
if (SimHas('Lucky number')) heavenlyMult *= 1.01;
|
||||
if (SimHas('Lucky payout')) heavenlyMult *= 1.01;
|
||||
if (Game.hasGod) {
|
||||
const godLvl = SimHasGod('creation');
|
||||
if (godLvl === 1) heavenlyMult *= 0.7;
|
||||
else if (godLvl === 2) heavenlyMult *= 0.8;
|
||||
else if (godLvl === 3) heavenlyMult *= 0.9;
|
||||
}
|
||||
return heavenlyMult;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import SimAuraMult from './SimAuraMult';
|
||||
* @returns {number} giveBack The multiplier
|
||||
*/
|
||||
export default function SimGetSellMultiplier() {
|
||||
let giveBack = 0.25;
|
||||
giveBack *= 1 + SimAuraMult('Earth Shatterer');
|
||||
return giveBack;
|
||||
let giveBack = 0.25;
|
||||
giveBack *= 1 + SimAuraMult('Earth Shatterer');
|
||||
return giveBack;
|
||||
}
|
||||
|
||||
@@ -5,28 +5,43 @@ import SimHas from './SimHas';
|
||||
* This functions creates functions similarly to Game.GetTieredCpsMult but checks Sim Data instead of Game Data
|
||||
*/
|
||||
export default function SimGetTieredCpsMult(me) {
|
||||
let mult = 1;
|
||||
for (const i in me.tieredUpgrades) {
|
||||
if (!Game.Tiers[me.tieredUpgrades[i].tier].special && SimHas(me.tieredUpgrades[i].name)) mult *= 2;
|
||||
}
|
||||
for (const i in me.synergies) {
|
||||
if (SimHas(me.synergies[i].name)) {
|
||||
const syn = me.synergies[i];
|
||||
if (syn.buildingTie1.name === me.name) mult *= (1 + 0.05 * syn.buildingTie2.amount);
|
||||
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)));
|
||||
if (typeof me.tieredUpgrades.misfortune === 'object') {
|
||||
if (me.vanilla === 1 && SimHas(me.tieredUpgrades.misfortune.name)) {
|
||||
switch (Game.elderWrath) {
|
||||
default: mult *= 1; break;
|
||||
case 1: mult *= 1.02; break;
|
||||
case 2: mult *= 1.04; break;
|
||||
case 3: mult *= 1.06; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return mult;
|
||||
let mult = 1;
|
||||
for (const i in me.tieredUpgrades) {
|
||||
if (
|
||||
!Game.Tiers[me.tieredUpgrades[i].tier].special &&
|
||||
SimHas(me.tieredUpgrades[i].name)
|
||||
)
|
||||
mult *= 2;
|
||||
}
|
||||
for (const i in me.synergies) {
|
||||
if (SimHas(me.synergies[i].name)) {
|
||||
const syn = me.synergies[i];
|
||||
if (syn.buildingTie1.name === me.name)
|
||||
mult *= 1 + 0.05 * syn.buildingTie2.amount;
|
||||
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));
|
||||
if (typeof me.tieredUpgrades.misfortune === 'object') {
|
||||
if (me.vanilla === 1 && SimHas(me.tieredUpgrades.misfortune.name)) {
|
||||
switch (Game.elderWrath) {
|
||||
default:
|
||||
mult *= 1;
|
||||
break;
|
||||
case 1:
|
||||
mult *= 1.02;
|
||||
break;
|
||||
case 2:
|
||||
mult *= 1.04;
|
||||
break;
|
||||
case 3:
|
||||
mult *= 1.06;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return mult;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,11 @@ import { SimUpgrades } from '../VariablesAndData';
|
||||
* This functions creates functions similarly to Game.Has but checks Sim Data instead of Game Data
|
||||
*/
|
||||
export default function SimHas(what) {
|
||||
const it = SimUpgrades[what];
|
||||
if (Game.ascensionMode === 1 && (it.pool === 'prestige' || it.tier === 'fortune')) return 0;
|
||||
return (it ? it.bought : 0);
|
||||
const it = SimUpgrades[what];
|
||||
if (
|
||||
Game.ascensionMode === 1 &&
|
||||
(it.pool === 'prestige' || it.tier === 'fortune')
|
||||
)
|
||||
return 0;
|
||||
return it ? it.bought : 0;
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ import { SimAchievements } from '../VariablesAndData';
|
||||
* This functions creates functions similarly to Game.HasAchiev but checks Sim Data instead of Game Data
|
||||
*/
|
||||
export default function SimHasAchiev(what) {
|
||||
return (SimAchievements[what] ? SimAchievements[what].won : 0);
|
||||
return SimAchievements[what] ? SimAchievements[what].won : 0;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@ import { SimDragonAura, SimDragonAura2 } from '../VariablesAndData';
|
||||
* This functions creates functions similarly to Game.hasAura but checks Sim Data instead of Game Data
|
||||
*/
|
||||
export default function SimHasAura(what) {
|
||||
if (Game.dragonAuras[SimDragonAura].name === what || Game.dragonAuras[SimDragonAura2].name === what) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (
|
||||
Game.dragonAuras[SimDragonAura].name === what ||
|
||||
Game.dragonAuras[SimDragonAura2].name === what
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -6,16 +6,16 @@ import { SimObjects } from '../VariablesAndData';
|
||||
* @param {string} what Name of the achievement
|
||||
*/
|
||||
export default function SimHasGod(what) {
|
||||
if (Game.hasGod) {
|
||||
if (SimObjects.Temple.minigame === undefined) {
|
||||
SimObjects.Temple.minigame = Game.Objects.Temple.minigame;
|
||||
}
|
||||
const god = SimObjects.Temple.minigame.gods[what];
|
||||
for (let i = 0; i < 3; i++) {
|
||||
if (SimObjects.Temple.minigame.slot[i] === god.id) {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
if (Game.hasGod) {
|
||||
if (SimObjects.Temple.minigame === undefined) {
|
||||
SimObjects.Temple.minigame = Game.Objects.Temple.minigame;
|
||||
}
|
||||
const god = SimObjects.Temple.minigame.gods[what];
|
||||
for (let i = 0; i < 3; i++) {
|
||||
if (SimObjects.Temple.minigame.slot[i] === god.id) {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -11,23 +11,23 @@ import SimHasGod from './SimHasGod';
|
||||
* @returns {number} price 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');
|
||||
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;
|
||||
}
|
||||
return 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');
|
||||
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;
|
||||
}
|
||||
return price;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user