mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
prettier and remove formulas dir
This commit is contained in:
parent
010a4f1aa3
commit
720e2112c6
@ -42,11 +42,11 @@ export const calculateEntropy = (player: IPlayer, stacks = 1): IMap<number> => {
|
||||
bladeburner_stamina_gain_mult: player.bladeburner_stamina_gain_mult,
|
||||
bladeburner_analysis_mult: player.bladeburner_analysis_mult,
|
||||
bladeburner_success_chance_mult: player.bladeburner_success_chance_mult,
|
||||
}
|
||||
};
|
||||
|
||||
for (const [mult, val] of Object.entries(multipliers)) {
|
||||
multipliers[mult] = val * (CONSTANTS.EntropyEffect ** stacks);
|
||||
multipliers[mult] = val * CONSTANTS.EntropyEffect ** stacks;
|
||||
}
|
||||
|
||||
return multipliers;
|
||||
}
|
||||
};
|
||||
|
@ -1,28 +1,15 @@
|
||||
import React, { useState } from "react";
|
||||
|
||||
import {
|
||||
Typography,
|
||||
Container,
|
||||
Box,
|
||||
Paper,
|
||||
List,
|
||||
ListItemButton,
|
||||
Button
|
||||
} from "@mui/material";
|
||||
import {
|
||||
Construction
|
||||
} from "@mui/icons-material";
|
||||
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 { Augmentations } from "../../../Augmentation/Augmentations";
|
||||
import { AugmentationNames } from "../../../Augmentation/data/AugmentationNames"
|
||||
import { AugmentationNames } from "../../../Augmentation/data/AugmentationNames";
|
||||
import { Settings } from "../../../Settings/Settings";
|
||||
import { IMap } from "../../../types";
|
||||
import {
|
||||
convertTimeMsToTimeElapsedString,
|
||||
formatNumber
|
||||
} from "../../../utils/StringHelperFunctions";
|
||||
import { convertTimeMsToTimeElapsedString, formatNumber } from "../../../utils/StringHelperFunctions";
|
||||
import { LocationName } from "../../../Locations/data/LocationNames";
|
||||
import { Locations } from "../../../Locations/Locations";
|
||||
import { CONSTANTS } from "../../../Constants";
|
||||
@ -31,24 +18,19 @@ import { IPlayer } from "../../IPlayer";
|
||||
|
||||
import { CraftableAugmentation } from "../CraftableAugmentation";
|
||||
|
||||
const CraftableAugmentations: IMap<CraftableAugmentation> = {}
|
||||
const CraftableAugmentations: IMap<CraftableAugmentation> = {};
|
||||
|
||||
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;
|
||||
if (augName === AugmentationNames.NeuroFluxGovernor || augName === AugmentationNames.TheRedPill || aug.isSpecial)
|
||||
continue;
|
||||
augs.push(augName);
|
||||
}
|
||||
|
||||
return augs.filter(
|
||||
(augmentation: string) => !player.hasAugmentation(augmentation)
|
||||
);
|
||||
}
|
||||
return augs.filter((augmentation: string) => !player.hasAugmentation(augmentation));
|
||||
};
|
||||
|
||||
export const GraftingRoot = (): React.ReactElement => {
|
||||
const player = use.Player();
|
||||
@ -64,38 +46,36 @@ export const GraftingRoot = (): React.ReactElement => {
|
||||
|
||||
return (
|
||||
<Container disableGutters maxWidth="lg" sx={{ mx: 0 }}>
|
||||
<Button onClick={() => router.toLocation(Locations[LocationName.NewTokyoVitaLife])}>
|
||||
Back
|
||||
</Button>
|
||||
<Button onClick={() => router.toLocation(Locations[LocationName.NewTokyoVitaLife])}>Back</Button>
|
||||
<Typography variant="h4">Grafting Laboratory</Typography>
|
||||
<Typography>
|
||||
You find yourself in a secret laboratory, owned by a mysterious researcher.<br />
|
||||
The scientist explains that they've been studying Augmentation grafting, the process
|
||||
of applying Augmentations without requiring a body reset.
|
||||
<br /><br />
|
||||
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.
|
||||
You find yourself in a secret laboratory, owned by a mysterious researcher.
|
||||
<br />
|
||||
The scientist explains that they've been studying Augmentation grafting, the process of applying Augmentations
|
||||
without requiring a body reset.
|
||||
<br />
|
||||
<br />
|
||||
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>
|
||||
|
||||
<Box sx={{ my: 3 }}>
|
||||
<Typography variant="h5">Craft Augmentations</Typography>
|
||||
<Paper sx={{ my: 1, width: 'fit-content', display: 'grid', gridTemplateColumns: '1fr 3fr' }}>
|
||||
<List sx={{ maxHeight: 400, overflowY: 'scroll', borderRight: `1px solid ${Settings.theme.welllight}` }}>
|
||||
<Paper sx={{ my: 1, width: "fit-content", display: "grid", gridTemplateColumns: "1fr 3fr" }}>
|
||||
<List sx={{ maxHeight: 400, overflowY: "scroll", borderRight: `1px solid ${Settings.theme.welllight}` }}>
|
||||
{getAvailableAugs(player).map((k, i) => (
|
||||
<ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}>
|
||||
<Typography>
|
||||
{k}
|
||||
</Typography>
|
||||
<Typography>{k}</Typography>
|
||||
</ListItemButton>
|
||||
))}
|
||||
</List>
|
||||
<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}
|
||||
</Typography>
|
||||
<Button
|
||||
onClick={event => {
|
||||
onClick={(event) => {
|
||||
if (!event.isTrusted) return;
|
||||
const craftableAug = CraftableAugmentations[selectedAug];
|
||||
player.loseMoney(craftableAug.cost, "augmentations");
|
||||
@ -103,23 +83,31 @@ export const GraftingRoot = (): React.ReactElement => {
|
||||
player.startFocusing();
|
||||
router.toWork();
|
||||
}}
|
||||
sx={{ width: '100%' }}
|
||||
sx={{ width: "100%" }}
|
||||
disabled={player.money < CraftableAugmentations[selectedAug].cost}
|
||||
>
|
||||
Craft Augmentation (
|
||||
<Typography color={Settings.theme.money}>
|
||||
<Money money={CraftableAugmentations[selectedAug].cost} player={player} />
|
||||
</Typography>)
|
||||
</Typography>
|
||||
)
|
||||
</Button>
|
||||
<Typography color={Settings.theme.info}>
|
||||
<b>Time to Craft:</b> {convertTimeMsToTimeElapsedString(CraftableAugmentations[selectedAug].time)}
|
||||
</Typography>
|
||||
<Typography sx={{ maxHeight: 305, overflowY: 'scroll' }}>
|
||||
<Typography sx={{ maxHeight: 305, overflowY: "scroll" }}>
|
||||
{(() => {
|
||||
const aug = Augmentations[selectedAug];
|
||||
|
||||
const info = typeof aug.info === "string" ? <span>{aug.info}</span> : aug.info
|
||||
const tooltip = (<>{info}<br /><br />{aug.stats}</>);
|
||||
const info = typeof aug.info === "string" ? <span>{aug.info}</span> : aug.info;
|
||||
const tooltip = (
|
||||
<>
|
||||
{info}
|
||||
<br />
|
||||
<br />
|
||||
{aug.stats}
|
||||
</>
|
||||
);
|
||||
return tooltip;
|
||||
})()}
|
||||
</Typography>
|
||||
@ -130,26 +118,24 @@ export const GraftingRoot = (): React.ReactElement => {
|
||||
<Box sx={{ my: 3 }}>
|
||||
<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>
|
||||
<b>Accumulated Entropy:</b> {player.entropyStacks}
|
||||
<br />
|
||||
<b>All multipliers decreased by:</b> {formatNumber((1 - (CONSTANTS.EntropyEffect ** player.entropyStacks)) * 100, 3)}%
|
||||
{" "}(multiplicative)
|
||||
<b>All multipliers decreased by:</b>{" "}
|
||||
{formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropyStacks) * 100, 3)}% (multiplicative)
|
||||
</Typography>
|
||||
</Paper>
|
||||
|
||||
<Typography>
|
||||
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.
|
||||
<br /><br />
|
||||
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...
|
||||
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.
|
||||
<br />
|
||||
<br />
|
||||
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...
|
||||
</Typography>
|
||||
|
||||
</Box>
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user