TYPESAFETY: Strict internal typing for AugmentationName (#608)

This commit is contained in:
Snarling
2023-06-16 17:52:42 -04:00
committed by GitHub
parent 12b5c00d14
commit a4b826683e
70 changed files with 2649 additions and 3221 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers";
import { currentNodeMults } from "./BitNode/BitNodeMultipliers";
import { Person as IPerson } from "@nsdefs";
import { calculateIntelligenceBonus } from "./PersonObjects/formulas/intelligence";
import { Server as IServer } from "@nsdefs";
@@ -32,7 +32,7 @@ export function calculateHackingExpGain(server: IServer, person: IPerson): numbe
const diffFactor = 0.3;
let expGain = baseExpGain;
expGain += baseDifficulty * diffFactor;
return expGain * person.mults.hacking_exp * BitNodeMultipliers.HackExpGain;
return expGain * person.mults.hacking_exp * currentNodeMults.HackExpGain;
}
/**
@@ -49,7 +49,7 @@ export function calculatePercentMoneyHacked(server: IServer, person: IPerson): n
const difficultyMult = (100 - hackDifficulty) / 100;
const skillMult = (person.skills.hacking - (requiredHackingSkill - 1)) / person.skills.hacking;
const percentMoneyHacked =
(difficultyMult * skillMult * person.mults.hacking_money * BitNodeMultipliers.ScriptHackMoney) / balanceFactor;
(difficultyMult * skillMult * person.mults.hacking_money * currentNodeMults.ScriptHackMoney) / balanceFactor;
return Math.min(1, Math.max(percentMoneyHacked, 0));
}