From 4c422347d421c4eabebecec9066a4e46271f47df Mon Sep 17 00:00:00 2001 From: nickofolas Date: Sat, 19 Mar 2022 13:59:34 -0500 Subject: [PATCH] Polish entropy - Also adds DevMenu entry --- src/DevMenu.tsx | 2 + src/DevMenu/ui/Entropy.tsx | 50 +++++++++++++++++++ .../Grafting/ui/GraftingRoot.tsx | 34 +++++++++---- .../Player/PlayerObjectAugmentationMethods.ts | 4 ++ 4 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 src/DevMenu/ui/Entropy.tsx diff --git a/src/DevMenu.tsx b/src/DevMenu.tsx index 62300a430..2c9611941 100644 --- a/src/DevMenu.tsx +++ b/src/DevMenu.tsx @@ -23,6 +23,7 @@ import { Sleeves } from "./DevMenu/ui/Sleeves"; import { Stanek } from "./DevMenu/ui/Stanek"; import { TimeSkip } from "./DevMenu/ui/TimeSkip"; import { Achievements } from "./DevMenu/ui/Achievements"; +import { Entropy } from "./DevMenu/ui/Entropy"; import Typography from "@mui/material/Typography"; import { Exploit } from "./Exploits/Exploit"; @@ -63,6 +64,7 @@ export function DevMenuRoot(props: IProps): React.ReactElement { + ); } diff --git a/src/DevMenu/ui/Entropy.tsx b/src/DevMenu/ui/Entropy.tsx new file mode 100644 index 000000000..93c63df71 --- /dev/null +++ b/src/DevMenu/ui/Entropy.tsx @@ -0,0 +1,50 @@ +import React from "react"; + +import Accordion from "@mui/material/Accordion"; +import AccordionSummary from "@mui/material/AccordionSummary"; +import AccordionDetails from "@mui/material/AccordionDetails"; +import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; + +import Typography from "@mui/material/Typography"; +import { IPlayer } from "../../PersonObjects/IPlayer"; +import { Adjuster } from "./Adjuster"; +import { IEngine } from "../../IEngine"; + +// Update as additional BitNodes get implemented + +interface IProps { + player: IPlayer; + engine: IEngine; +} + +export function Entropy(props: IProps): React.ReactElement { + return ( + + }> + Entropy + + + { + props.player.entropyStacks += num; + props.player.applyEntropy(props.player.entropyStacks); + }} + subtract={num => { + props.player.entropyStacks -= num; + props.player.applyEntropy(props.player.entropyStacks); + }} + tons={() => { + props.player.entropyStacks += 1e12; + props.player.applyEntropy(props.player.entropyStacks); + }} + reset={() => { + props.player.entropyStacks = 0; + props.player.applyEntropy(props.player.entropyStacks); + }} + /> + + + ); +} diff --git a/src/PersonObjects/Grafting/ui/GraftingRoot.tsx b/src/PersonObjects/Grafting/ui/GraftingRoot.tsx index 91c84e7b7..531dffa70 100644 --- a/src/PersonObjects/Grafting/ui/GraftingRoot.tsx +++ b/src/PersonObjects/Grafting/ui/GraftingRoot.tsx @@ -19,9 +19,13 @@ import { Augmentations } from "../../../Augmentation/Augmentations"; import { AugmentationNames } from "../../../Augmentation/data/AugmentationNames" import { Settings } from "../../../Settings/Settings"; import { IMap } from "../../../types"; -import { convertTimeMsToTimeElapsedString } from "../../../utils/StringHelperFunctions"; +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"; @@ -73,12 +77,8 @@ export const GraftingRoot = (): React.ReactElement => { Illum velit takimata et aliquyam takimata labore vel dolor dolores duo amet lorem elitr facer invidunt. - + Craft Augmentations - - here goes a list with available augmentations with a purchase button (with price shown) to the side of it
- getAvailableAugs function to the rescue -
{getAvailableAugs(player).map((k, i) => ( @@ -126,12 +126,28 @@ export const GraftingRoot = (): React.ReactElement => {
- + Entropy Accumulation + + + + Accumulated Entropy: {player.entropyStacks} +
+ All multipliers decreased by: {formatNumber((1 - (CONSTANTS.EntropyEffect ** player.entropyStacks)) * 100, 3)}% +
+
+ - probably some info about the cumulative negative effects here
- {player.entropyStacks} accumulated entropy + Augmenting causes signficant physical and psychological changes to the affected + individual, and the best way for the body to deal with these effects is to undergo + a full shutdown process. +

+ Grafting Augmentations to a semi-conscious host is extremely experimental and dangerous. +

+ Scientists don't fully understand the consequences, but some have hypothesized that there's + a buildup of unknown irregularities that impair the user...
+
diff --git a/src/PersonObjects/Player/PlayerObjectAugmentationMethods.ts b/src/PersonObjects/Player/PlayerObjectAugmentationMethods.ts index ed68a0251..9de4cdb03 100644 --- a/src/PersonObjects/Player/PlayerObjectAugmentationMethods.ts +++ b/src/PersonObjects/Player/PlayerObjectAugmentationMethods.ts @@ -28,6 +28,10 @@ export function hasAugmentation(this: IPlayer, aug: string | Augmentation, insta } export function applyEntropy(this: IPlayer, stacks = 1): void { + // Re-apply all multipliers + this.reapplyAllAugmentations(); + this.reapplyAllSourceFiles(); + const newMultipliers = calculateEntropy(this, stacks); for (const [mult, val] of Object.entries(newMultipliers)) { this.setMult(mult, val);