Merge pull request #2454 from zeddrak/patch-1

Apply bitnode multiplier before capping at 1 in calculatePercentMoneyHacked in hacking.ts
This commit is contained in:
hydroflame 2022-01-08 14:33:41 -05:00 committed by GitHub
commit f52fc9fa7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -49,7 +49,7 @@ export function calculatePercentMoneyHacked(server: Server, player: IPlayer): nu
const difficultyMult = (100 - server.hackDifficulty) / 100; const difficultyMult = (100 - server.hackDifficulty) / 100;
const skillMult = (player.hacking - (server.requiredHackingSkill - 1)) / player.hacking; const skillMult = (player.hacking - (server.requiredHackingSkill - 1)) / player.hacking;
const percentMoneyHacked = (difficultyMult * skillMult * player.hacking_money_mult) / balanceFactor; const percentMoneyHacked = (difficultyMult * skillMult * player.hacking_money_mult * BitNodeMultipliers.ScriptHackMoney) / balanceFactor;
if (percentMoneyHacked < 0) { if (percentMoneyHacked < 0) {
return 0; return 0;
} }
@ -57,7 +57,7 @@ export function calculatePercentMoneyHacked(server: Server, player: IPlayer): nu
return 1; return 1;
} }
return percentMoneyHacked * BitNodeMultipliers.ScriptHackMoney; return percentMoneyHacked;
} }
/** /**