mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-08 16:47:49 +02:00
IPVGO: Improve favor gain from wins to balance around the rep value of favor (#2131)
This commit is contained in:
committed by
GitHub
parent
2b8c008be1
commit
4749acdd4f
@@ -1,6 +1,6 @@
|
||||
import { AugmentationName, FactionName, FactionDiscovery } from "@enums";
|
||||
import { FactionInfo, FactionInfos } from "./FactionInfo";
|
||||
import { MaxFavor, calculateFavorAfterResetting } from "./formulas/favor";
|
||||
import { MaxFavor, addRepToFavor } from "./formulas/favor";
|
||||
import { clampNumber } from "../utils/helpers/clampNumber";
|
||||
|
||||
export class Faction {
|
||||
@@ -76,7 +76,7 @@ export class Faction {
|
||||
|
||||
prestigeAugmentation(): void {
|
||||
// Gain favor
|
||||
this.setFavor(calculateFavorAfterResetting(this.favor, this.playerReputation));
|
||||
this.setFavor(addRepToFavor(this.favor, this.playerReputation));
|
||||
// Reset reputation and flags
|
||||
this.playerReputation = 0;
|
||||
this.alreadyInvited = false;
|
||||
|
||||
@@ -19,6 +19,6 @@ export function repToFavor(r: number): number {
|
||||
return clampNumber(Math.log1p(r / 25000) / log1point02, 0, MaxFavor);
|
||||
}
|
||||
|
||||
export function calculateFavorAfterResetting(favor: number, playerReputation: number) {
|
||||
export function addRepToFavor(favor: number, playerReputation: number) {
|
||||
return repToFavor(favorToRep(favor) + playerReputation);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import Tooltip from "@mui/material/Tooltip";
|
||||
import Box from "@mui/material/Box";
|
||||
import InfoIcon from "@mui/icons-material/Info";
|
||||
import { useCycleRerender } from "../../ui/React/hooks";
|
||||
import { calculateFavorAfterResetting } from "../formulas/favor";
|
||||
import { addRepToFavor } from "../formulas/favor";
|
||||
import { knowAboutBitverse } from "../../BitNode/BitNodeUtils";
|
||||
|
||||
interface IProps {
|
||||
@@ -74,8 +74,7 @@ export function Info(props: IProps): React.ReactElement {
|
||||
title={
|
||||
<>
|
||||
<Typography>
|
||||
You will have{" "}
|
||||
<Favor favor={calculateFavorAfterResetting(props.faction.favor, props.faction.playerReputation)} />{" "}
|
||||
You will have <Favor favor={addRepToFavor(props.faction.favor, props.faction.playerReputation)} />{" "}
|
||||
faction favor after installing an Augmentation.
|
||||
</Typography>
|
||||
<MathJax>{"\\(\\huge{r = \\text{total faction reputation}}\\)"}</MathJax>
|
||||
|
||||
Reference in New Issue
Block a user