BUGFIX: Passive faction reputation gain applies Player.mults.faction_rep twice (#2125)

This commit is contained in:
catloversg
2025-05-09 15:52:48 +07:00
committed by GitHub
parent db810dd938
commit 7f8760d01a
2 changed files with 23 additions and 8 deletions

View File

@@ -132,16 +132,27 @@ export function purchaseAugmentation(faction: Faction, augmentation: Augmentatio
} }
export function processPassiveFactionRepGain(numCycles: number): void { export function processPassiveFactionRepGain(numCycles: number): void {
if (Player.bitNodeN === 2) return; // Passive gain is disabled in some BitNodes (e.g., BN2).
if (currentNodeMults.FactionPassiveRepGain === 0) {
return;
}
for (const name of getRecordKeys(Factions)) { for (const name of getRecordKeys(Factions)) {
if (isFactionWork(Player.currentWork) && name === Player.currentWork.factionName) continue; if (isFactionWork(Player.currentWork) && name === Player.currentWork.factionName) {
continue;
}
const faction = Factions[name]; const faction = Factions[name];
if (!faction.isMember) continue; if (!faction.isMember) {
// No passive rep for special factions continue;
}
// No passive rep for special factions.
const info = faction.getInfo(); const info = faction.getInfo();
if (!info.offersWork()) continue; if (info.special) {
continue;
}
// No passive rep for gangs. // No passive rep for gangs.
if (Player.getGangName() === name) continue; if (Player.getGangName() === name) {
continue;
}
// 0 favor = 1%/s // 0 favor = 1%/s
// 50 favor = 6%/s // 50 favor = 6%/s
// 100 favor = 11%/s // 100 favor = 11%/s
@@ -152,7 +163,11 @@ export function processPassiveFactionRepGain(numCycles: number): void {
const fRep = getFactionFieldWorkRepGain(Player, faction.favor); const fRep = getFactionFieldWorkRepGain(Player, faction.favor);
const rate = Math.max(hRep * favorMult, sRep * favorMult, fRep * favorMult, 1 / 120); const rate = Math.max(hRep * favorMult, sRep * favorMult, fRep * favorMult, 1 / 120);
faction.playerReputation += rate * numCycles * Player.mults.faction_rep * currentNodeMults.FactionPassiveRepGain; /**
* Do not apply Player.mults.faction_rep here. That multiplier was applied in getHackingWorkRepGain and similar
* functions.
*/
faction.playerReputation += rate * numCycles * currentNodeMults.FactionPassiveRepGain;
} }
} }

View File

@@ -46,7 +46,7 @@ function DefaultAssignment(): React.ReactElement {
Perform work/carry out assignments for your faction to help further its cause! By doing so, you will earn Perform work/carry out assignments for your faction to help further its cause! By doing so, you will earn
reputation for your faction. You will also gain reputation passively over time, although at a very slow reputation for your faction. You will also gain reputation passively over time, although at a very slow
rate.  rate. 
{knowAboutBitverse() && <>Note that the passive reputation gain is disabled in BitNode 2. </>} {knowAboutBitverse() && <>Note that the passive reputation gain is disabled in some BitNodes. </>}
Earning reputation will allow you to purchase augmentations through this faction, which are powerful upgrades that Earning reputation will allow you to purchase augmentations through this faction, which are powerful upgrades that
enhance your abilities. enhance your abilities.
</Typography> </Typography>