MISC: Refactor favor code (#1321)

This commit is contained in:
catloversg
2024-05-29 02:04:16 +07:00
committed by GitHub
parent b8d3109158
commit c2a56a6150
14 changed files with 117 additions and 68 deletions
+4 -3
View File
@@ -24,6 +24,7 @@ import { companyNameAsLocationName } from "../../Company/utils";
import { JobSummary } from "../../Company/ui/JobSummary";
import { StatsTable } from "../../ui/React/StatsTable";
import { JobListings } from "../../Company/ui/JobListings";
import { calculateFavorAfterResetting } from "../../Faction/formulas/favor";
interface IProps {
companyName: CompanyName;
@@ -98,7 +99,6 @@ export function CompanyLocation(props: IProps): React.ReactElement {
}
const isEmployedHere = currentPosition != null;
const favorGain = company.getFavorGain();
return (
<>
@@ -120,8 +120,9 @@ export function CompanyLocation(props: IProps): React.ReactElement {
key="repLabel"
title={
<>
You will have <Favor favor={company.favor + favorGain} /> company favor upon resetting after
installing Augmentations
You will have{" "}
<Favor favor={calculateFavorAfterResetting(company.favor, company.playerReputation)} /> company
favor upon resetting after installing Augmentations
</>
}
>