Added a few formulas to calculate work gains

This commit is contained in:
Olivier Gagnon
2022-08-17 14:32:52 -04:00
parent 3217f53717
commit a8bef50ef5
29 changed files with 391 additions and 48 deletions
+2 -17
View File
@@ -9,6 +9,7 @@ import { CrimeType } from "../utils/WorkType";
import { Work, WorkType } from "./Work";
import { newWorkStats, scaleWorkStats, WorkStats } from "./WorkStats";
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
import { calculateCrimeWorkStats } from "./formulas/Crime";
enum newCrimeType {
SHOPLIFT = "SHOPLIFT",
@@ -90,23 +91,7 @@ export class CrimeWork extends Work {
}
earnings(): WorkStats {
const crime = this.getCrime();
const gains = scaleWorkStats(
newWorkStats({
money: crime.money,
hackExp: crime.hacking_exp * 2,
strExp: crime.strength_exp * 2,
defExp: crime.defense_exp * 2,
dexExp: crime.dexterity_exp * 2,
agiExp: crime.agility_exp * 2,
chaExp: crime.charisma_exp * 2,
intExp: crime.intelligence_exp * 2,
}),
BitNodeMultipliers.CrimeExpGain,
false,
);
gains.money *= BitNodeMultipliers.CrimeMoney;
return gains;
return calculateCrimeWorkStats(this.getCrime());
}
commit(player: IPlayer): void {