Merge pull request #4230 from borisflagell/SoA_RepCost

SOA: Fix #3884 Implement unused SoARepMult constant to SoA's augmentations price + linked UI modification
This commit is contained in:
hydroflame 2022-10-12 23:52:14 -04:00 committed by GitHub
commit aa39728f67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 22 deletions

@ -548,13 +548,12 @@ export class Augmentation {
}
} else if (augmentationReference.factions.includes(FactionNames.ShadowsOfAnarchy)) {
const soaAugmentationNames = initSoAAugmentations().map((augmentation) => augmentation.name);
const soaMultiplier = Math.pow(
CONSTANTS.SoACostMult,
soaAugmentationNames.filter((augmentationName) => Player.hasAugmentation(augmentationName)).length,
);
moneyCost = augmentationReference.baseCost * soaMultiplier;
const soaAugCount = soaAugmentationNames.filter((augmentationName) =>
Player.hasAugmentation(augmentationName),
).length;
moneyCost = augmentationReference.baseCost * Math.pow(CONSTANTS.SoACostMult, soaAugCount);
if (soaAugmentationNames.find((augmentationName) => augmentationName === augmentationReference.name)) {
repCost = augmentationReference.baseRepRequirement * soaMultiplier;
repCost = augmentationReference.baseRepRequirement * Math.pow(CONSTANTS.SoARepMult, soaAugCount);
}
} else {
moneyCost =

@ -14,6 +14,7 @@ import { Reputation } from "../../ui/React/Reputation";
import { FactionNames } from "../data/FactionNames";
import { Faction } from "../Faction";
import { getFactionAugmentationsFiltered, hasAugmentationPrereqs, purchaseAugmentation } from "../FactionHelpers";
import { CONSTANTS } from "../../Constants";
type IProps = {
faction: Faction;
@ -130,11 +131,45 @@ export function AugmentationsPage(props: IProps): React.ReactElement {
const multiplierComponent =
props.faction.name !== FactionNames.ShadowsOfAnarchy ? (
<Typography>
<b>Price multiplier:</b> x {numeralWrapper.formatReallyBigNumber(getGenericAugmentationPriceMultiplier())}
</Typography>
<Tooltip
title={
<Typography>
The price of every Augmentation increases for every queued Augmentation and it is reset when you install
them.
</Typography>
}
>
<Typography>
<b>Price multiplier:</b> x {numeralWrapper.formatReallyBigNumber(getGenericAugmentationPriceMultiplier())}
</Typography>
</Tooltip>
) : (
<></>
<Tooltip
title={
<Typography>
This price multiplier increases for each {FactionNames.ShadowsOfAnarchy} augmentation already purchased. The
multiplier is NOT reset when installing augmentations.
</Typography>
}
>
<Typography>
<b>Price multiplier:</b> x{" "}
{numeralWrapper.formatReallyBigNumber(
Math.pow(
CONSTANTS.SoACostMult,
augs.filter((augmentationName) => Player.hasAugmentation(augmentationName)).length,
),
)}
<br />
<b>Reputation multiplier:</b> x{" "}
{numeralWrapper.formatReallyBigNumber(
Math.pow(
CONSTANTS.SoARepMult,
augs.filter((augmentationName) => Player.hasAugmentation(augmentationName)).length,
),
)}
</Typography>
</Tooltip>
);
return (
@ -156,20 +191,10 @@ export function AugmentationsPage(props: IProps): React.ReactElement {
my: 1,
}}
>
<Tooltip
title={
<Typography>
The price of every Augmentation increases for every queued Augmentation and it is reset when you
install them.
</Typography>
}
>
{multiplierComponent}
</Tooltip>
<>{multiplierComponent}</>
<Typography>
<b>Reputation:</b> <Reputation reputation={props.faction.playerReputation} />
</Typography>
<Typography>
<br />
<b>Favor:</b> <Favor favor={Math.floor(props.faction.favor)} />
</Typography>
</Box>