FIX: singularity faction donation formula (#619)

This commit is contained in:
Aleksei Bezrodnov
2023-06-19 09:55:03 +02:00
committed by GitHub
parent 08e3afd125
commit 78ca279df7
4 changed files with 55 additions and 43 deletions
+3 -6
View File
@@ -10,21 +10,19 @@ import { DonateOption } from "./DonateOption";
import { Info } from "./Info";
import { Option } from "./Option";
import { CONSTANTS } from "../../Constants";
import { currentNodeMults } from "../../BitNode/BitNodeMultipliers";
import { Faction } from "../Faction";
import { Router } from "../../ui/GameRoot";
import { Page } from "../../ui/Router";
import { Player } from "@player";
import { Typography, Button } from "@mui/material";
import { CovenantPurchasesRoot } from "../../PersonObjects/Sleeve/ui/CovenantPurchasesRoot";
import { FactionName, FactionWorkType } from "@enums";
import { GangButton } from "./GangButton";
import { FactionWork } from "../../Work/FactionWork";
import { useRerender } from "../../ui/React/hooks";
import { repNeededToDonate } from "../formulas/donation";
interface IProps {
faction: Faction;
@@ -107,9 +105,8 @@ function MainPage({ faction, rerender, onAugmentations }: IMainProps): React.Rea
// Flags for whether special options (gang, sleeve purchases, donate, etc.)
// should be shown
const favorToDonate = Math.floor(CONSTANTS.BaseFavorToDonate * currentNodeMults.RepToDonateToFaction);
const favorToDonate = repNeededToDonate();
const canDonate = faction.favor >= favorToDonate;
const canPurchaseSleeves = faction.name === FactionName.TheCovenant && Player.bitNodeN === 10;
return (