Make Stanek hacknet cost percentage better.

This commit is contained in:
Olivier Gagnon 2022-04-01 16:59:23 -04:00
parent b86ff7d405
commit e3e6b449d4
2 changed files with 6 additions and 2 deletions

@ -61,7 +61,7 @@ export function Effect(tpe: FragmentType): string {
return "+x% hacknet production";
}
case FragmentType.HacknetCost: {
return "x% cheaper hacknet cost";
return "-x% cheaper hacknet cost";
}
case FragmentType.Rep: {
return "+x% reputation from factions and companies";

@ -54,8 +54,12 @@ export function FragmentInspector(props: IProps): React.ReactElement {
if ([FragmentType.Booster, FragmentType.None, FragmentType.Delete].includes(f.type)) {
charge = "N/A";
effect = `${f.power}x adjacent fragment power`;
} else {
} else if (Effect(f.type).includes("+x%")) {
effect = Effect(f.type).replace(/-*x%/, numeralWrapper.formatPercentage(props.gift.effect(props.fragment) - 1));
} else if (Effect(f.type).includes("-x%")) {
const effectAmt = props.gift.effect(props.fragment);
const perc = numeralWrapper.formatPercentage(1 - 1 / effectAmt);
effect = Effect(f.type).replace(/-x%/, perc);
}
return (