Crime gains now properly affected by player mults

This commit is contained in:
Mughur 2022-09-23 15:17:48 +03:00
parent b8f8246294
commit 33b304bff5
2 changed files with 9 additions and 8 deletions

@ -108,7 +108,7 @@ export class CrimeWork extends Work {
let karma = crime.karma; let karma = crime.karma;
const success = determineCrimeSuccess(player, crime.type); const success = determineCrimeSuccess(player, crime.type);
if (success) { if (success) {
player.gainMoney(gains.money * player.mults.crime_money, "crime"); player.gainMoney(gains.money, "crime");
player.numPeopleKilled += crime.kills; player.numPeopleKilled += crime.kills;
player.gainIntelligenceExp(gains.intExp); player.gainIntelligenceExp(gains.intExp);
} else { } else {

@ -1,17 +1,18 @@
import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
import { Crime } from "src/Crime/Crime"; import { Crime } from "src/Crime/Crime";
import { newWorkStats, scaleWorkStats, WorkStats } from "../WorkStats"; import { newWorkStats, scaleWorkStats, WorkStats } from "../WorkStats";
import { Player } from "../../Player";
export const calculateCrimeWorkStats = (crime: Crime): WorkStats => { export const calculateCrimeWorkStats = (crime: Crime): WorkStats => {
const gains = scaleWorkStats( const gains = scaleWorkStats(
newWorkStats({ newWorkStats({
money: crime.money, money: crime.money * Player.mults.crime_money,
hackExp: crime.hacking_exp * 2, hackExp: crime.hacking_exp * 2 * Player.mults.hacking_exp,
strExp: crime.strength_exp * 2, strExp: crime.strength_exp * 2 * Player.mults.strength_exp,
defExp: crime.defense_exp * 2, defExp: crime.defense_exp * 2 * Player.mults.defense_exp,
dexExp: crime.dexterity_exp * 2, dexExp: crime.dexterity_exp * 2 * Player.mults.dexterity_exp,
agiExp: crime.agility_exp * 2, agiExp: crime.agility_exp * 2 * Player.mults.agility_exp,
chaExp: crime.charisma_exp * 2, chaExp: crime.charisma_exp * 2 * Player.mults.charisma_exp,
intExp: crime.intelligence_exp * 2, intExp: crime.intelligence_exp * 2,
}), }),
BitNodeMultipliers.CrimeExpGain, BitNodeMultipliers.CrimeExpGain,