INFIL: Add stat requirements; Add market consequences for spamming infiltration (#2210)

The primary parts are changing the way stats affect infiltration difficulty, to make rewards more intuitive and balanced, and adding a "market demand" mechanism, which kicks in when doing lots of infils quickly. With current parameters, market demand shouldn't affect manual play at all, and won't affect most auto-infil terribly (it depends how they're implemented).

This was a complex change, see PR #2210 for the full context
This commit is contained in:
Michael Ficocelli
2025-07-20 14:01:47 -04:00
committed by GitHub
parent fdafa191ac
commit dd128842af
19 changed files with 311 additions and 124 deletions
+11 -3
View File
@@ -40,6 +40,9 @@ export function NetscriptInfiltration(): InternalAPI<NetscriptInfiltation> {
}
const startingSecurityLevel = location.infiltrationData.startingSecurityLevel;
const difficulty = calculateDifficulty(startingSecurityLevel);
// This is supposed to calculate the constant reward, without market demand.
// We simulate this by using a time far in the future.
const timestamp = Date.now() + 1e20;
const reward = calculateReward(startingSecurityLevel);
const maxLevel = location.infiltrationData.maxClearanceLevel;
return {
@@ -48,9 +51,14 @@ export function NetscriptInfiltration(): InternalAPI<NetscriptInfiltation> {
name: location.name,
},
reward: {
tradeRep: calculateTradeInformationRepReward(reward, maxLevel, startingSecurityLevel),
sellCash: calculateSellInformationCashReward(reward, maxLevel, startingSecurityLevel),
SoARep: calculateInfiltratorsRepReward(Factions[FactionName.ShadowsOfAnarchy], startingSecurityLevel),
tradeRep: calculateTradeInformationRepReward(reward, maxLevel, startingSecurityLevel, timestamp),
sellCash: calculateSellInformationCashReward(reward, maxLevel, startingSecurityLevel, timestamp),
SoARep: calculateInfiltratorsRepReward(
Factions[FactionName.ShadowsOfAnarchy],
maxLevel,
startingSecurityLevel,
timestamp,
),
},
difficulty: difficulty,
maxClearanceLevel: location.infiltrationData.maxClearanceLevel,