mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-08 00:27:47 +02:00
MISC: Add formulas API for calculating share power and move UI of sharing RAM (#2126)
This commit is contained in:
@@ -22,7 +22,6 @@ import { GangButton } from "./GangButton";
|
||||
import { FactionWork } from "../../Work/FactionWork";
|
||||
import { useCycleRerender } from "../../ui/React/hooks";
|
||||
import { repNeededToDonate } from "../formulas/donation";
|
||||
import { ShareOption } from "./ShareOption";
|
||||
|
||||
type FactionRootProps = {
|
||||
faction: Faction;
|
||||
@@ -132,7 +131,6 @@ function MainPage({ faction, rerender, onAugmentations }: IMainProps): React.Rea
|
||||
{!isPlayersGang && factionInfo.offersWork() && (
|
||||
<DonateOption faction={faction} rerender={rerender} favorToDonate={favorToDonate} disabled={!canDonate} />
|
||||
)}
|
||||
{!isPlayersGang && factionInfo.offersWork() && <ShareOption rerender={rerender} />}
|
||||
<Option buttonText={"Purchase Augmentations"} infoText={augmentationsInfo} onClick={onAugmentations} />
|
||||
{canPurchaseSleeves && (
|
||||
<>
|
||||
|
||||
@@ -16,6 +16,7 @@ import { Requirement } from "../../ui/Components/Requirement";
|
||||
import { Faction } from "../Faction";
|
||||
import { getFactionAugmentationsFiltered, joinFaction } from "../FactionHelpers";
|
||||
import { Factions } from "../Factions";
|
||||
import { ShareOption } from "./ShareOption";
|
||||
|
||||
export const InvitationsSeen = new Set<FactionName>();
|
||||
|
||||
@@ -290,6 +291,12 @@ export function FactionsRoot(): React.ReactElement {
|
||||
</Box>
|
||||
</span>
|
||||
</Box>
|
||||
<div style={{ margin: "15px 0" }}>
|
||||
<Typography variant="h5" color="primary">
|
||||
Share RAM
|
||||
</Typography>
|
||||
<ShareOption rerender={rerender} />
|
||||
</div>
|
||||
<span className="factions-rumors">
|
||||
{rumoredFactions.length > 0 && (
|
||||
<>
|
||||
|
||||
@@ -55,9 +55,10 @@ export function ShareOption({ rerender }: { rerender: () => void }): React.React
|
||||
return (
|
||||
<Paper sx={{ my: 1, p: 1 }}>
|
||||
<Typography>
|
||||
You can share free RAM of your home computer with your faction to get a bonus multiplier for reputation gain.
|
||||
Each time you share your free RAM, you get a boost for {ShareBonusTime / 1000} seconds. You can share free RAM
|
||||
of other servers that you have admin rights by using ns.share() API.
|
||||
You can share free RAM of your home computer with your factions to get a bonus multiplier for reputation gain.
|
||||
Each time you share your free RAM, you get a boost for {ShareBonusTime / 1000} seconds. After that, you lose the
|
||||
boost and get back your shared RAM. You can share free RAM of other servers that you have admin rights on by
|
||||
using the ns.share() API.
|
||||
<br />
|
||||
Free RAM on home computer: {formatRam(home.maxRam - home.ramUsed)}.
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user