prettier and remove formulas dir

This commit is contained in:
nickofolas 2022-03-21 14:40:17 -05:00
parent 010a4f1aa3
commit 720e2112c6
3 changed files with 51 additions and 65 deletions

@ -42,11 +42,11 @@ export const calculateEntropy = (player: IPlayer, stacks = 1): IMap<number> => {
bladeburner_stamina_gain_mult: player.bladeburner_stamina_gain_mult, bladeburner_stamina_gain_mult: player.bladeburner_stamina_gain_mult,
bladeburner_analysis_mult: player.bladeburner_analysis_mult, bladeburner_analysis_mult: player.bladeburner_analysis_mult,
bladeburner_success_chance_mult: player.bladeburner_success_chance_mult, bladeburner_success_chance_mult: player.bladeburner_success_chance_mult,
} };
for (const [mult, val] of Object.entries(multipliers)) { for (const [mult, val] of Object.entries(multipliers)) {
multipliers[mult] = val * (CONSTANTS.EntropyEffect ** stacks); multipliers[mult] = val * CONSTANTS.EntropyEffect ** stacks;
} }
return multipliers; return multipliers;
} };

@ -1,28 +1,15 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { import { Typography, Container, Box, Paper, List, ListItemButton, Button } from "@mui/material";
Typography, import { Construction } from "@mui/icons-material";
Container,
Box,
Paper,
List,
ListItemButton,
Button
} from "@mui/material";
import {
Construction
} from "@mui/icons-material";
import { use } from "../../../ui/Context"; import { use } from "../../../ui/Context";
import { Money } from "../../../ui/React/Money"; import { Money } from "../../../ui/React/Money";
import { Augmentations } from "../../../Augmentation/Augmentations"; import { Augmentations } from "../../../Augmentation/Augmentations";
import { AugmentationNames } from "../../../Augmentation/data/AugmentationNames" import { AugmentationNames } from "../../../Augmentation/data/AugmentationNames";
import { Settings } from "../../../Settings/Settings"; import { Settings } from "../../../Settings/Settings";
import { IMap } from "../../../types"; import { IMap } from "../../../types";
import { import { convertTimeMsToTimeElapsedString, formatNumber } from "../../../utils/StringHelperFunctions";
convertTimeMsToTimeElapsedString,
formatNumber
} from "../../../utils/StringHelperFunctions";
import { LocationName } from "../../../Locations/data/LocationNames"; import { LocationName } from "../../../Locations/data/LocationNames";
import { Locations } from "../../../Locations/Locations"; import { Locations } from "../../../Locations/Locations";
import { CONSTANTS } from "../../../Constants"; import { CONSTANTS } from "../../../Constants";
@ -31,24 +18,19 @@ import { IPlayer } from "../../IPlayer";
import { CraftableAugmentation } from "../CraftableAugmentation"; import { CraftableAugmentation } from "../CraftableAugmentation";
const CraftableAugmentations: IMap<CraftableAugmentation> = {} const CraftableAugmentations: IMap<CraftableAugmentation> = {};
const getAvailableAugs = (player: IPlayer): string[] => { const getAvailableAugs = (player: IPlayer): string[] => {
const augs: string[] = []; const augs: string[] = [];
for (const [augName, aug] of Object.entries(Augmentations)) { for (const [augName, aug] of Object.entries(Augmentations)) {
if ( if (augName === AugmentationNames.NeuroFluxGovernor || augName === AugmentationNames.TheRedPill || aug.isSpecial)
augName === AugmentationNames.NeuroFluxGovernor || continue;
augName === AugmentationNames.TheRedPill ||
aug.isSpecial
) continue;
augs.push(augName); augs.push(augName);
} }
return augs.filter( return augs.filter((augmentation: string) => !player.hasAugmentation(augmentation));
(augmentation: string) => !player.hasAugmentation(augmentation) };
);
}
export const GraftingRoot = (): React.ReactElement => { export const GraftingRoot = (): React.ReactElement => {
const player = use.Player(); const player = use.Player();
@ -64,38 +46,36 @@ export const GraftingRoot = (): React.ReactElement => {
return ( return (
<Container disableGutters maxWidth="lg" sx={{ mx: 0 }}> <Container disableGutters maxWidth="lg" sx={{ mx: 0 }}>
<Button onClick={() => router.toLocation(Locations[LocationName.NewTokyoVitaLife])}> <Button onClick={() => router.toLocation(Locations[LocationName.NewTokyoVitaLife])}>Back</Button>
Back
</Button>
<Typography variant="h4">Grafting Laboratory</Typography> <Typography variant="h4">Grafting Laboratory</Typography>
<Typography> <Typography>
You find yourself in a secret laboratory, owned by a mysterious researcher.<br /> You find yourself in a secret laboratory, owned by a mysterious researcher.
The scientist explains that they've been studying Augmentation grafting, the process <br />
of applying Augmentations without requiring a body reset. The scientist explains that they've been studying Augmentation grafting, the process of applying Augmentations
<br /><br /> without requiring a body reset.
Through legally questionable connections, the scientist has access to a vast array of <br />
Augmentation blueprints, even private designs. They offer to build and graft <br />
the Augmentations to you, in exchange for both a hefty sum of money, and being a lab rat. 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.
</Typography> </Typography>
<Box sx={{ my: 3 }}> <Box sx={{ my: 3 }}>
<Typography variant="h5">Craft Augmentations</Typography> <Typography variant="h5">Craft Augmentations</Typography>
<Paper sx={{ my: 1, width: 'fit-content', display: 'grid', gridTemplateColumns: '1fr 3fr' }}> <Paper sx={{ my: 1, width: "fit-content", display: "grid", gridTemplateColumns: "1fr 3fr" }}>
<List sx={{ maxHeight: 400, overflowY: 'scroll', borderRight: `1px solid ${Settings.theme.welllight}` }}> <List sx={{ maxHeight: 400, overflowY: "scroll", borderRight: `1px solid ${Settings.theme.welllight}` }}>
{getAvailableAugs(player).map((k, i) => ( {getAvailableAugs(player).map((k, i) => (
<ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}> <ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}>
<Typography> <Typography>{k}</Typography>
{k}
</Typography>
</ListItemButton> </ListItemButton>
))} ))}
</List> </List>
<Box sx={{ m: 1 }}> <Box sx={{ m: 1 }}>
<Typography variant="h6" sx={{ display: 'flex', alignItems: 'center', flexWrap: 'wrap' }}> <Typography variant="h6" sx={{ display: "flex", alignItems: "center", flexWrap: "wrap" }}>
<Construction sx={{ mr: 1 }} /> {selectedAug} <Construction sx={{ mr: 1 }} /> {selectedAug}
</Typography> </Typography>
<Button <Button
onClick={event => { onClick={(event) => {
if (!event.isTrusted) return; if (!event.isTrusted) return;
const craftableAug = CraftableAugmentations[selectedAug]; const craftableAug = CraftableAugmentations[selectedAug];
player.loseMoney(craftableAug.cost, "augmentations"); player.loseMoney(craftableAug.cost, "augmentations");
@ -103,23 +83,31 @@ export const GraftingRoot = (): React.ReactElement => {
player.startFocusing(); player.startFocusing();
router.toWork(); router.toWork();
}} }}
sx={{ width: '100%' }} sx={{ width: "100%" }}
disabled={player.money < CraftableAugmentations[selectedAug].cost} disabled={player.money < CraftableAugmentations[selectedAug].cost}
> >
Craft Augmentation ( Craft Augmentation (
<Typography color={Settings.theme.money}> <Typography color={Settings.theme.money}>
<Money money={CraftableAugmentations[selectedAug].cost} player={player} /> <Money money={CraftableAugmentations[selectedAug].cost} player={player} />
</Typography>) </Typography>
)
</Button> </Button>
<Typography color={Settings.theme.info}> <Typography color={Settings.theme.info}>
<b>Time to Craft:</b> {convertTimeMsToTimeElapsedString(CraftableAugmentations[selectedAug].time)} <b>Time to Craft:</b> {convertTimeMsToTimeElapsedString(CraftableAugmentations[selectedAug].time)}
</Typography> </Typography>
<Typography sx={{ maxHeight: 305, overflowY: 'scroll' }}> <Typography sx={{ maxHeight: 305, overflowY: "scroll" }}>
{(() => { {(() => {
const aug = Augmentations[selectedAug]; const aug = Augmentations[selectedAug];
const info = typeof aug.info === "string" ? <span>{aug.info}</span> : aug.info const info = typeof aug.info === "string" ? <span>{aug.info}</span> : aug.info;
const tooltip = (<>{info}<br /><br />{aug.stats}</>); const tooltip = (
<>
{info}
<br />
<br />
{aug.stats}
</>
);
return tooltip; return tooltip;
})()} })()}
</Typography> </Typography>
@ -130,26 +118,24 @@ export const GraftingRoot = (): React.ReactElement => {
<Box sx={{ my: 3 }}> <Box sx={{ my: 3 }}>
<Typography variant="h5">Entropy Accumulation</Typography> <Typography variant="h5">Entropy Accumulation</Typography>
<Paper sx={{ my: 1, p: 1, width: 'fit-content' }}> <Paper sx={{ my: 1, p: 1, width: "fit-content" }}>
<Typography> <Typography>
<b>Accumulated Entropy:</b> {player.entropyStacks} <b>Accumulated Entropy:</b> {player.entropyStacks}
<br /> <br />
<b>All multipliers decreased by:</b> {formatNumber((1 - (CONSTANTS.EntropyEffect ** player.entropyStacks)) * 100, 3)}% <b>All multipliers decreased by:</b>{" "}
{" "}(multiplicative) {formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropyStacks) * 100, 3)}% (multiplicative)
</Typography> </Typography>
</Paper> </Paper>
<Typography> <Typography>
When installed on an unconscious individual, Augmentations are scanned by the body When installed on an unconscious individual, Augmentations are scanned by the body on awakening, eliminating
on awakening, eliminating hidden malware. However, grafted Augmentations do not hidden malware. However, grafted Augmentations do not provide this security measure.
provide this security measure. <br />
<br /><br /> <br />
Individuals who tested Augmentation grafting have reported symptoms of an unknown Individuals who tested Augmentation grafting have reported symptoms of an unknown virus, which they've dubbed
virus, which they've dubbed "Entropy". This virus seems to grow more potent with "Entropy". This virus seems to grow more potent with each grafted Augmentation...
each grafted Augmentation...
</Typography> </Typography>
</Box> </Box>
</Container> </Container>
) );
} };