import React, { useState } from "react"; import { Typography, Container, Box, Paper, List, ListItemButton, Button } from "@mui/material"; import { Construction } from "@mui/icons-material"; import { use } from "../../../ui/Context"; import { Money } from "../../../ui/React/Money"; import { ConfirmationModal } from "../../../ui/React/ConfirmationModal"; import { Augmentations } from "../../../Augmentation/Augmentations"; import { AugmentationNames } from "../../../Augmentation/data/AugmentationNames"; import { Settings } from "../../../Settings/Settings"; import { IMap } from "../../../types"; import { convertTimeMsToTimeElapsedString, formatNumber } from "../../../utils/StringHelperFunctions"; import { LocationName } from "../../../Locations/data/LocationNames"; import { Locations } from "../../../Locations/Locations"; import { CONSTANTS } from "../../../Constants"; import { IPlayer } from "../../IPlayer"; import { CraftableAugmentation } from "../CraftableAugmentation"; const CraftableAugmentations: IMap = {}; const getAvailableAugs = (player: IPlayer): string[] => { const augs: string[] = []; for (const [augName, aug] of Object.entries(Augmentations)) { if (augName === AugmentationNames.NeuroFluxGovernor || augName === AugmentationNames.TheRedPill || aug.isSpecial) continue; augs.push(augName); } return augs.filter((augmentation: string) => !player.hasAugmentation(augmentation)); }; export const GraftingRoot = (): React.ReactElement => { const player = use.Player(); const router = use.Router(); for (const aug of Object.values(Augmentations)) { const name = aug.name; const craftableAug = new CraftableAugmentation(aug); CraftableAugmentations[name] = craftableAug; } const [selectedAug, setSelectedAug] = useState(getAvailableAugs(player)[0]); const [craftOpen, setCraftOpen] = useState(false); return ( Grafting Laboratory You find yourself in a secret laboratory, owned by a mysterious researcher.
The scientist explains that they've been studying Augmentation grafting, the process of applying Augmentations without requiring a body reset.

Through legally questionable connections, the scientist has access to a vast array of Augmentation blueprints, even private designs. They offer to build and graft the Augmentations to you, in exchange for both a hefty sum of money, and being a lab rat.
Craft Augmentations {getAvailableAugs(player).map((k, i) => ( setSelectedAug(k)} selected={selectedAug === k}> {k} ))} {selectedAug} setCraftOpen(false)} onConfirm={() => { const craftableAug = CraftableAugmentations[selectedAug]; player.loseMoney(craftableAug.cost, "augmentations"); player.startCraftAugmentationWork(selectedAug, craftableAug.time); player.startFocusing(); router.toWork(); }} confirmationText={ <> Cancelling crafting will not save crafting progress, and the money you spend will not be returned.

Additionally, grafting an Augmentation will increase the potency of the Entropy virus. } /> Time to Craft: {convertTimeMsToTimeElapsedString(CraftableAugmentations[selectedAug].time)} {(() => { const aug = Augmentations[selectedAug]; const info = typeof aug.info === "string" ? {aug.info} : aug.info; const tooltip = ( <> {info}

{aug.stats} ); return tooltip; })()}
Entropy Accumulation Accumulated Entropy: {player.entropyStacks}
All multipliers decreased by:{" "} {formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropyStacks) * 100, 3)}% (multiplicative)
When installed on an unconscious individual, Augmentations are scanned by the body on awakening, eliminating hidden malware. However, grafted Augmentations do not provide this security measure.

Individuals who tested Augmentation grafting have reported symptoms of an unknown virus, which they've dubbed "Entropy". This virus seems to grow more potent with each grafted Augmentation...
); };