mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
GANG: Fix wrong wanted gain rate (#1415)
This commit is contained in:
parent
eff834bfe9
commit
337fa4e274
@ -154,9 +154,11 @@ export class Gang {
|
||||
const newWanted = oldWanted + wantedLevelGainPerCycle * numCycles;
|
||||
// Allows recovery when wanted / respect ratio is too high
|
||||
this.wanted = newWanted * (1 - justice * 0.001);
|
||||
this.wantedGainRate -= newWanted - this.wanted;
|
||||
this.wantedGainRate = (this.wanted - oldWanted) / numCycles;
|
||||
// Prevent overflow
|
||||
if (this.wanted < 1 || (wantedLevelGainPerCycle <= 0 && this.wanted > oldWanted)) this.wanted = 1;
|
||||
if (this.wanted < 1 || (wantedLevelGainPerCycle <= 0 && this.wanted > oldWanted)) {
|
||||
this.wanted = 1;
|
||||
}
|
||||
}
|
||||
Player.gainMoney(moneyGainPerCycle * numCycles, "gang");
|
||||
}
|
||||
|
@ -27,6 +27,21 @@ export function GangStats(): React.ReactElement {
|
||||
} else {
|
||||
territoryStr = formatNumberNoSuffix(territoryMult, 2);
|
||||
}
|
||||
const hasEnoughBonusTime = gang.storedCycles > GangConstants.maxCyclesToProcess;
|
||||
const bonusCyclesInOneSecond = 5 * GangConstants.maxCyclesToProcess;
|
||||
const respectGainRateInBonusTime = hasEnoughBonusTime
|
||||
? `[Effective Gain: ${formatRespect(gang.respectGainRate * bonusCyclesInOneSecond)} / sec]`
|
||||
: "";
|
||||
const wantedGainRateInBonusTime = hasEnoughBonusTime
|
||||
? `[Effective Gain: ${formatWanted(gang.wantedGainRate * bonusCyclesInOneSecond)} / sec]`
|
||||
: "";
|
||||
const moneyGainRateInBonusTime = hasEnoughBonusTime ? (
|
||||
<>
|
||||
[Effective Gain: <MoneyRate money={gang.moneyGainRate * bonusCyclesInOneSecond} />]
|
||||
</>
|
||||
) : (
|
||||
""
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -42,9 +57,7 @@ export function GangStats(): React.ReactElement {
|
||||
>
|
||||
<Typography>
|
||||
Respect: {formatRespect(gang.respect)} ({formatRespect(5 * gang.respectGainRate)} / sec){" "}
|
||||
{gang.storedCycles > 2 * GangConstants.maxCyclesToProcess
|
||||
? `[Effective Gain: ${formatRespect(5 * gang.respectGainRate * GangConstants.maxCyclesToProcess)} / sec]`
|
||||
: ""}
|
||||
{respectGainRateInBonusTime}
|
||||
</Typography>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
@ -60,9 +73,7 @@ export function GangStats(): React.ReactElement {
|
||||
>
|
||||
<Typography>
|
||||
Wanted Level: {formatWanted(gang.wanted)} ({formatWanted(5 * gang.wantedGainRate)} / sec){" "}
|
||||
{gang.storedCycles > 2 * GangConstants.maxCyclesToProcess
|
||||
? `[Effective Gain: ${formatWanted(5 * gang.wantedGainRate * GangConstants.maxCyclesToProcess)} / sec]`
|
||||
: ""}
|
||||
{wantedGainRateInBonusTime}
|
||||
</Typography>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
@ -76,14 +87,7 @@ export function GangStats(): React.ReactElement {
|
||||
</Box>
|
||||
|
||||
<Typography>
|
||||
Money gain rate: <MoneyRate money={5 * gang.moneyGainRate} />{" "}
|
||||
{gang.storedCycles > 2 * GangConstants.maxCyclesToProcess ? "[Effective Gain:" : ""}{" "}
|
||||
{gang.storedCycles > 2 * GangConstants.maxCyclesToProcess ? (
|
||||
<MoneyRate money={5 * gang.moneyGainRate * GangConstants.maxCyclesToProcess} />
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{gang.storedCycles > 2 * GangConstants.maxCyclesToProcess ? "]" : ""}
|
||||
Money gain rate: <MoneyRate money={5 * gang.moneyGainRate} /> {moneyGainRateInBonusTime}
|
||||
</Typography>
|
||||
|
||||
<Box display="flex">
|
||||
|
Loading…
Reference in New Issue
Block a user