INFILTRATION: Corrected ns formula for infiltration rewards

In commit 
7c5097ee83d9e2d185960a9c96739a78981bd600 the author extracted the functionality for infiltration rewards into a NS function and made it accessible via formulas.

The exposed function does however not use the same input parameters as the Victory screen after infiltration since he uses the difficulty and not the starting difficulty.

Difficulty is clamped to [0;3], so the formulas api showed for high difficulty servers a vastly lower result.
This commit is contained in:
Florian Schöffl 2022-08-29 02:35:39 +02:00 committed by GitHub
parent 3ee55b2918
commit 282dc28c8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -38,9 +38,9 @@ export function NetscriptInfiltration(): InternalAPI<IInfiltration> {
return { return {
location: JSON.parse(JSON.stringify(location)), location: JSON.parse(JSON.stringify(location)),
reward: { reward: {
tradeRep: calculateTradeInformationRepReward(player, reward, maxLevel, difficulty), tradeRep: calculateTradeInformationRepReward(player, reward, maxLevel, startingSecurityLevel),
sellCash: calculateSellInformationCashReward(player, reward, maxLevel, difficulty), sellCash: calculateSellInformationCashReward(player, reward, maxLevel, startingSecurityLevel),
SoARep: calculateInfiltratorsRepReward(player, Factions[FactionNames.ShadowsOfAnarchy], difficulty), SoARep: calculateInfiltratorsRepReward(player, Factions[FactionNames.ShadowsOfAnarchy], startingSecurityLevel),
}, },
difficulty: difficulty, difficulty: difficulty,
}; };