From b744997c72ddcbf1cd552a7895d42dbc953b4013 Mon Sep 17 00:00:00 2001 From: danielyxie Date: Wed, 15 May 2019 00:15:07 -0700 Subject: [PATCH] Finished refactoring augmentations page UI to use react --- css/augmentations.scss | 12 +- ...tionHelpers.js => AugmentationHelpers.jsx} | 282 ++--------- .../ui/InstalledAugmentations.tsx | 6 +- .../InstalledAugmentationsAndSourceFiles.tsx | 59 ++- src/Augmentation/ui/ListConfiguration.tsx | 34 ++ src/Augmentation/ui/OwnedSourceFiles.tsx | 31 +- src/Augmentation/ui/PlayerMultipliers.tsx | 96 ++++ .../ui/PurchasedAugmentations.tsx | 4 +- src/Augmentation/ui/Root.tsx | 25 +- src/BitNode/BitNode.ts | 453 +++++++++--------- src/engine.jsx | 14 +- src/ui/React/Accordion.tsx | 12 +- src/ui/React/AugmentationAccordion.tsx | 6 +- src/ui/React/SourceFileAccordion.tsx | 35 ++ 14 files changed, 561 insertions(+), 508 deletions(-) rename src/Augmentation/{AugmentationHelpers.js => AugmentationHelpers.jsx} (89%) create mode 100644 src/Augmentation/ui/PlayerMultipliers.tsx create mode 100644 src/ui/React/SourceFileAccordion.tsx diff --git a/css/augmentations.scss b/css/augmentations.scss index eb7fd3722..36b39a4e2 100644 --- a/css/augmentations.scss +++ b/css/augmentations.scss @@ -10,6 +10,13 @@ padding-top: 10px; } +#augmentations-content { + > p { + font-size: $defaultFontSize * 0.875; + width: 70%; + } +} + .augmentations-list { button, div { @@ -18,10 +25,7 @@ } button { - padding: 2px 5px; + padding: 4px; } - div { - padding: 6px; - } } diff --git a/src/Augmentation/AugmentationHelpers.js b/src/Augmentation/AugmentationHelpers.jsx similarity index 89% rename from src/Augmentation/AugmentationHelpers.js rename to src/Augmentation/AugmentationHelpers.jsx index 9c6809344..fa4d57f6f 100644 --- a/src/Augmentation/AugmentationHelpers.js +++ b/src/Augmentation/AugmentationHelpers.jsx @@ -1,32 +1,39 @@ -import { Augmentation } from "./Augmentation"; -import { Augmentations } from "./Augmentations"; -import { PlayerOwnedAugmentation } from "./PlayerOwnedAugmentation"; -import { AugmentationNames } from "./data/AugmentationNames"; +import { Augmentation } from "./Augmentation"; +import { Augmentations } from "./Augmentations"; +import { PlayerOwnedAugmentation } from "./PlayerOwnedAugmentation"; +import { AugmentationNames } from "./data/AugmentationNames"; -import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; -import { CONSTANTS } from "../Constants"; -import { Factions, - factionExists } from "../Faction/Factions"; -import { addWorkerScript } from "../NetscriptWorker"; -import { Player } from "../Player"; -import { prestigeAugmentation } from "../Prestige"; -import { saveObject } from "../SaveObject"; -import { RunningScript } from "../Script/RunningScript"; -import { Script } from "../Script/Script"; -import { Server } from "../Server/Server"; -import { OwnedAugmentationsOrderSetting } from "../Settings/SettingEnums"; -import { Settings } from "../Settings/Settings"; +import { AugmentationsRoot } from "./ui/Root"; -import { dialogBoxCreate } from "../../utils/DialogBox"; -import { createAccordionElement } from "../../utils/uiHelpers/createAccordionElement"; -import { Reviver, Generic_toJSON, - Generic_fromJSON } from "../../utils/JSONReviver"; -import { formatNumber } from "../../utils/StringHelperFunctions"; -import { clearObject } from "../../utils/helpers/clearObject"; -import { createElement } from "../../utils/uiHelpers/createElement"; -import { isString } from "../../utils/helpers/isString"; -import { removeChildrenFromElement } from "../../utils/uiHelpers/removeChildrenFromElement"; +import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; +import { CONSTANTS } from "../Constants"; +import { Factions, factionExists } from "../Faction/Factions"; +import { addWorkerScript } from "../NetscriptWorker"; +import { Player } from "../Player"; +import { prestigeAugmentation } from "../Prestige"; +import { saveObject } from "../SaveObject"; +import { RunningScript } from "../Script/RunningScript"; +import { Script } from "../Script/Script"; +import { Server } from "../Server/Server"; +import { OwnedAugmentationsOrderSetting } from "../Settings/SettingEnums"; +import { Settings } from "../Settings/Settings"; +import { Page, routing } from "../ui/navigationTracking"; +import { dialogBoxCreate } from "../../utils/DialogBox"; +import { createAccordionElement } from "../../utils/uiHelpers/createAccordionElement"; +import { + Reviver, + Generic_toJSON, + Generic_fromJSON +} from "../../utils/JSONReviver"; +import { formatNumber } from "../../utils/StringHelperFunctions"; +import { clearObject } from "../../utils/helpers/clearObject"; +import { createElement } from "../../utils/uiHelpers/createElement"; +import { isString } from "../../utils/helpers/isString"; +import { removeChildrenFromElement } from "../../utils/uiHelpers/removeChildrenFromElement"; + +import React from "react"; +import ReactDOM from "react-dom"; function AddToAugmentations(aug) { var name = aug.name; @@ -2092,211 +2099,17 @@ function augmentationExists(name) { return Augmentations.hasOwnProperty(name); } -function displayAugmentationsContent(contentEl) { - removeChildrenFromElement(contentEl); - contentEl.appendChild(createElement("h1", { - innerText:"Purchased Augmentations", - })); +export function displayAugmentationsContent(contentEl) { + if (!routing.isOn(Page.Augmentations)) { return; } + if (!(contentEl instanceof HTMLElement)) { return; } - contentEl.appendChild(createElement("pre", { - width:"70%", whiteSpace:"pre-wrap", display:"block", - innerText:"Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to install them.\n" + - "WARNING: Installing your Augmentations resets most of your progress, including:\n\n" + - "Stats/Skill levels and Experience\n" + - "Money\n" + - "Scripts on every computer but your home computer\n" + - "Purchased servers\n" + - "Hacknet Nodes\n" + - "Faction/Company reputation\n" + - "Stocks\n" + - "Installing Augmentations lets you start over with the perks and benefits granted by all " + - "of the Augmentations you have ever installed. Also, you will keep any scripts and RAM/Core upgrades " + - "on your home computer (but you will lose all programs besides NUKE.exe)." - })); - - //Install Augmentations button - contentEl.appendChild(createElement("a", { - class:"a-link-button", innerText:"Install Augmentations", - tooltip:"'I never asked for this'", - clickListener:()=>{ - installAugmentations(); - return false; - } - })); - - //Backup button - contentEl.appendChild(createElement("a", { - class:"a-link-button flashing-button", innerText:"Backup Save (Export)", - tooltip:"It's always a good idea to backup/export your save!", - clickListener:()=>{ - saveObject.exportGame(); - return false; - } - })); - - //Purchased/queued augmentations list - var queuedAugmentationsList = createElement("ul", {class:"augmentations-list"}); - - for (var i = 0; i < Player.queuedAugmentations.length; ++i) { - var augName = Player.queuedAugmentations[i].name; - var aug = Augmentations[augName]; - - var displayName = augName; - if (augName === AugmentationNames.NeuroFluxGovernor) { - displayName += " - Level " + (Player.queuedAugmentations[i].level); - } - - var accordion = createAccordionElement({hdrText:displayName, panelText:aug.info}); - queuedAugmentationsList.appendChild(accordion[0]); - } - contentEl.appendChild(queuedAugmentationsList); - - //Installed augmentations list - contentEl.appendChild(createElement("h1", { - innerText:"Installed Augmentations", marginTop:"8px", - })); - contentEl.appendChild(createElement("p", { - width:"70%", whiteSpace:"pre-wrap", - innerText:"List of all Augmentations (including Source Files) that have been " + - "installed. You have gained the effects of these Augmentations." - })); - - var augmentationsList = createElement("ul", {class:"augmentations-list"}); - - //Expand/Collapse All buttons - contentEl.appendChild(createElement("a", { - class:"a-link-button", fontSize:"14px", innerText:"Expand All", display:"inline-block", - clickListener:()=>{ - var allHeaders = augmentationsList.getElementsByClassName("accordion-header"); - for (var i = 0; i < allHeaders.length; ++i) { - if (!allHeaders[i].classList.contains("active")) {allHeaders[i].click();} - } - } - })); - contentEl.appendChild(createElement("a", { - class:"a-link-button", fontSize:"14px", innerText:"Collapse All", display:"inline-block", - clickListener:()=>{ - var allHeaders = augmentationsList.getElementsByClassName("accordion-header"); - for (var i = 0; i < allHeaders.length; ++i) { - if (allHeaders[i].classList.contains("active")) {allHeaders[i].click();} - } - } - })); - - //Sort Buttons - const sortInOrderButton = createElement("a", { - class:"a-link-button", fontSize:"14px", innerText:"Sort in Order", - tooltip:"Sorts the Augmentations alphabetically and Source Files in numerical order (1, 2, 3,...)", - clickListener:()=>{ - removeChildrenFromElement(augmentationsList); - - //Create a copy of Player's Source Files and augs array and sort them - var sourceFiles = Player.sourceFiles.slice(); - var augs = Player.augmentations.slice(); - sourceFiles.sort((sf1, sf2)=>{ - return sf1.n - sf2.n; - }); - augs.sort((aug1, aug2)=>{ - return aug1.name <= aug2.name ? -1 : 1; - }); - displaySourceFiles(augmentationsList, sourceFiles); - displayAugmentations(augmentationsList, augs); - - Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.Alphabetically; - } - }); - contentEl.appendChild(sortInOrderButton); - - const sortByAcquirementTimeButton = createElement("a", { - class:"a-link-button", fontSize:"14px", innerText:"Sort by Acquirement Time", - tooltip:"Sorts the Augmentations and Source Files based on when you acquired them (same as default)", - clickListener:()=>{ - removeChildrenFromElement(augmentationsList); - displaySourceFiles(augmentationsList, Player.sourceFiles); - displayAugmentations(augmentationsList, Player.augmentations); - - Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.AcquirementTime; - } - }); - contentEl.appendChild(sortByAcquirementTimeButton); - - if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) { - sortInOrderButton.click(); - } else { - sortByAcquirementTimeButton.click(); - } - contentEl.appendChild(augmentationsList); - - // Display multiplier information at the bottom - contentEl.appendChild(createElement("p", { - display: "block", - innerHTML: - `

Total Multipliers:
` + - 'Hacking Chance multiplier: ' + formatNumber(Player.hacking_chance_mult * 100, 2) + '%
' + - 'Hacking Speed multiplier: ' + formatNumber(Player.hacking_speed_mult * 100, 2) + '%
' + - 'Hacking Money multiplier: ' + formatNumber(Player.hacking_money_mult * 100, 2) + '%
' + - 'Hacking Growth multiplier: ' + formatNumber(Player.hacking_grow_mult * 100, 2) + '%

' + - 'Hacking Level multiplier: ' + formatNumber(Player.hacking_mult * 100, 2) + '%
' + - 'Hacking Experience multiplier: ' + formatNumber(Player.hacking_exp_mult * 100, 2) + '%

' + - 'Strength Level multiplier: ' + formatNumber(Player.strength_mult * 100, 2) + '%
' + - 'Strength Experience multiplier: ' + formatNumber(Player.strength_exp_mult * 100, 2) + '%

' + - 'Defense Level multiplier: ' + formatNumber(Player.defense_mult * 100, 2) + '%
' + - 'Defense Experience multiplier: ' + formatNumber(Player.defense_exp_mult * 100, 2) + '%

' + - 'Dexterity Level multiplier: ' + formatNumber(Player.dexterity_mult * 100, 2) + '%
' + - 'Dexterity Experience multiplier: ' + formatNumber(Player.dexterity_exp_mult * 100, 2) + '%

' + - 'Agility Level multiplier: ' + formatNumber(Player.agility_mult * 100, 2) + '%
' + - 'Agility Experience multiplier: ' + formatNumber(Player.agility_exp_mult * 100, 2) + '%

' + - 'Charisma Level multiplier: ' + formatNumber(Player.charisma_mult * 100, 2) + '%
' + - 'Charisma Experience multiplier: ' + formatNumber(Player.charisma_exp_mult * 100, 2) + '%

' + - 'Hacknet Node production multiplier: ' + formatNumber(Player.hacknet_node_money_mult * 100, 2) + '%
' + - 'Hacknet Node purchase cost multiplier: ' + formatNumber(Player.hacknet_node_purchase_cost_mult * 100, 2) + '%
' + - 'Hacknet Node RAM upgrade cost multiplier: ' + formatNumber(Player.hacknet_node_ram_cost_mult * 100, 2) + '%
' + - 'Hacknet Node Core purchase cost multiplier: ' + formatNumber(Player.hacknet_node_core_cost_mult * 100, 2) + '%
' + - 'Hacknet Node level upgrade cost multiplier: ' + formatNumber(Player.hacknet_node_level_cost_mult * 100, 2) + '%

' + - 'Company reputation gain multiplier: ' + formatNumber(Player.company_rep_mult * 100, 2) + '%
' + - 'Faction reputation gain multiplier: ' + formatNumber(Player.faction_rep_mult * 100, 2) + '%
' + - 'Salary multiplier: ' + formatNumber(Player.work_money_mult * 100, 2) + '%
' + - 'Crime success multiplier: ' + formatNumber(Player.crime_success_mult * 100, 2) + '%
' + - 'Crime money multiplier: ' + formatNumber(Player.crime_money_mult * 100, 2) + '%


', - })) -} - -//Creates the accordion elements to display Augmentations -// @listElement - List DOM element to append accordion elements to -// @augs - Array of Augmentation objects -function displayAugmentations(listElement, augs) { - for (var i = 0; i < augs.length; ++i) { - var augName = augs[i].name; - var aug = Augmentations[augName]; - - var displayName = augName; - if (augName === AugmentationNames.NeuroFluxGovernor) { - displayName += " - Level " + (augs[i].level); - } - var accordion = createAccordionElement({hdrText:displayName, panelText:aug.info}); - listElement.appendChild(accordion[0]); - } -} - -//Creates the accordion elements to display Source Files -// @listElement - List DOM element to append accordion elements to -// @sourceFiles - Array of Source File objects -function displaySourceFiles(listElement, sourceFiles) { - for (var i = 0; i < sourceFiles.length; ++i) { - var srcFileKey = "SourceFile" + sourceFiles[i].n; - var sourceFileObject = SourceFiles[srcFileKey]; - if (sourceFileObject == null) { - console.log("ERROR: Invalid source file number: " + sourceFiles[i].n); - continue; - } - const maxLevel = sourceFiles[i].n == 12 ? "∞" : "3"; - var accordion = createAccordionElement({ - hdrText:sourceFileObject.name + "
" + "Level " + (sourceFiles[i].lvl) + " / "+maxLevel, - panelText:sourceFileObject.info - }); - - listElement.appendChild(accordion[0]); - } + ReactDOM.render( + , + contentEl + ); } export function isRepeatableAug(aug) { @@ -2307,6 +2120,9 @@ export function isRepeatableAug(aug) { return false; } -export {installAugmentations, - initAugmentations, applyAugmentation, augmentationExists, - displayAugmentationsContent}; +export { + installAugmentations, + initAugmentations, + applyAugmentation, + augmentationExists, +}; diff --git a/src/Augmentation/ui/InstalledAugmentations.tsx b/src/Augmentation/ui/InstalledAugmentations.tsx index 84d8cb2ea..076046cac 100644 --- a/src/Augmentation/ui/InstalledAugmentations.tsx +++ b/src/Augmentation/ui/InstalledAugmentations.tsx @@ -30,11 +30,13 @@ export function InstalledAugmentations(): React.ReactElement { } return ( - +
  • + +
  • ) }); return ( -
      {augs}
    + <>{augs} ) } diff --git a/src/Augmentation/ui/InstalledAugmentationsAndSourceFiles.tsx b/src/Augmentation/ui/InstalledAugmentationsAndSourceFiles.tsx index 39bac22e6..7246ed6a8 100644 --- a/src/Augmentation/ui/InstalledAugmentationsAndSourceFiles.tsx +++ b/src/Augmentation/ui/InstalledAugmentationsAndSourceFiles.tsx @@ -7,18 +7,22 @@ */ import * as React from "react"; +import { InstalledAugmentations } from "./InstalledAugmentations"; +import { ListConfiguration } from "./ListConfiguration"; +import { OwnedSourceFiles } from "./OwnedSourceFiles"; + import { Settings } from "../../Settings/Settings"; import { OwnedAugmentationsOrderSetting } from "../../Settings/SettingEnums"; -type IProps = { - -} +type IProps = {} type IState = { rerenderFlag: boolean; } export class InstalledAugmentationsAndSourceFiles extends React.Component { + listRef: React.RefObject; + constructor(props: IProps) { super(props); @@ -26,8 +30,44 @@ export class InstalledAugmentationsAndSourceFiles extends React.Component + +
      + + +
    + ) } } diff --git a/src/Augmentation/ui/ListConfiguration.tsx b/src/Augmentation/ui/ListConfiguration.tsx index ef1368b8f..555766388 100644 --- a/src/Augmentation/ui/ListConfiguration.tsx +++ b/src/Augmentation/ui/ListConfiguration.tsx @@ -3,3 +3,37 @@ * Source-Files are displayed in the Augmentations UI */ import * as React from "react"; + +import { StdButton } from "../../ui/React/StdButton"; + +type IProps = { + collapseAllButtonsFn: () => void; + expandAllButtonsFn: () => void; + sortByAcquirementTimeFn: () => void; + sortInOrderFn: () => void; +} + +export function ListConfiguration(props: IProps): React.ReactElement { + return ( + <> + + + + + + ) +} diff --git a/src/Augmentation/ui/OwnedSourceFiles.tsx b/src/Augmentation/ui/OwnedSourceFiles.tsx index 24107bcdf..99012b4a7 100644 --- a/src/Augmentation/ui/OwnedSourceFiles.tsx +++ b/src/Augmentation/ui/OwnedSourceFiles.tsx @@ -5,36 +5,37 @@ import * as React from "react"; import { Player } from "../../Player"; -import { Augmentations } from "../../Augmentation/Augmentations"; -import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { Settings } from "../../Settings/Settings"; import { OwnedAugmentationsOrderSetting } from "../../Settings/SettingEnums"; +import { SourceFiles } from "../../SourceFile/SourceFiles"; -import { AugmentationAccordion } from "../../ui/React/AugmentationAccordion"; +import { SourceFileAccordion } from "../../ui/React/SourceFileAccordion"; export function OwnedSourceFiles(): React.ReactElement { - const sourceAugs = Player.augmentations.slice(); + const sourceSfs = Player.sourceFiles.slice(); if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) { - sourceAugs.sort((aug1, aug2) => { - return aug1.name <= aug2.name ? -1 : 1; + sourceSfs.sort((sf1, sf2) => { + return sf1.n - sf2.n; }); } - const augs = sourceAugs.map((e) => { - const aug = Augmentations[e.name]; - - let level = null; - if (e.name === AugmentationNames.NeuroFluxGovernor) { - level = e.level; + const sfs = sourceSfs.map((e) => { + const srcFileKey = "SourceFile" + e.n; + const sfObj = SourceFiles[srcFileKey]; + if (sfObj == null) { + console.error(`Invalid source file number: ${e.n}`); + return null; } return ( - +
  • + +
  • ) }); return ( -
      {augs}
    - ) + <>{sfs} + ); } diff --git a/src/Augmentation/ui/PlayerMultipliers.tsx b/src/Augmentation/ui/PlayerMultipliers.tsx new file mode 100644 index 000000000..f263558de --- /dev/null +++ b/src/Augmentation/ui/PlayerMultipliers.tsx @@ -0,0 +1,96 @@ +/** + * React component for displaying the player's multipliers on the Augmentation UI page + */ +import * as React from "react"; + +import { Player } from "../../Player"; +import { numeralWrapper } from "../../ui/numeralFormat"; + +export function PlayerMultipliers(): React.ReactElement { + return ( + <> +

    Total Multipliers:

    + +
    +            {'Hacking Chance multiplier: ' + numeralWrapper.formatPercentage(Player.hacking_chance_mult)}
    +        
    +
    +            {'Hacking Speed multiplier:  ' + numeralWrapper.formatPercentage(Player.hacking_speed_mult)}
    +        
    +
    +            {'Hacking Money multiplier:  ' + numeralWrapper.formatPercentage(Player.hacking_money_mult)}
    +        
    +
    +            {'Hacking Growth multiplier: ' + numeralWrapper.formatPercentage(Player.hacking_grow_mult)}
    +        

    +
    +            {'Hacking Level multiplier:      ' + numeralWrapper.formatPercentage(Player.hacking_mult)}
    +        
    +
    +            {'Hacking Experience multiplier: ' + numeralWrapper.formatPercentage(Player.hacking_exp_mult)}
    +        
    +
    +
    +            {'Strength Level multiplier:      ' + numeralWrapper.formatPercentage(Player.strength_mult)}
    +        
    +
    +            {'Strength Experience multiplier: ' + numeralWrapper.formatPercentage(Player.strength_exp_mult)}
    +        
    +
    +
    +            {'Defense Level multiplier:      ' + numeralWrapper.formatPercentage(Player.defense_mult)}
    +        
    +
    +            {'Defense Experience multiplier: ' + numeralWrapper.formatPercentage(Player.defense_exp_mult)}
    +        

    +
    +            {'Dexterity Level multiplier:      ' + numeralWrapper.formatPercentage(Player.dexterity_mult)}
    +        
    +
    +            {'Dexterity Experience multiplier: ' + numeralWrapper.formatPercentage(Player.dexterity_exp_mult)}
    +        

    +
    +            {'Agility Level multiplier:      ' + numeralWrapper.formatPercentage(Player.agility_mult)}
    +        
    +
    +            {'Agility Experience multiplier: ' + numeralWrapper.formatPercentage(Player.agility_exp_mult)}
    +        

    +
    +            {'Charisma Level multiplier:      ' + numeralWrapper.formatPercentage(Player.charisma_mult)}
    +        
    +
    +            {'Charisma Experience multiplier: ' + numeralWrapper.formatPercentage(Player.charisma_exp_mult)}
    +        

    +
    +            {'Hacknet Node production multiplier:         ' + numeralWrapper.formatPercentage(Player.hacknet_node_money_mult)}
    +        
    +
    +            {'Hacknet Node purchase cost multiplier:      ' + numeralWrapper.formatPercentage(Player.hacknet_node_purchase_cost_mult)}
    +        
    +
    +            {'Hacknet Node RAM upgrade cost multiplier:   ' + numeralWrapper.formatPercentage(Player.hacknet_node_ram_cost_mult)}
    +        
    +
    +            {'Hacknet Node Core purchase cost multiplier: ' + numeralWrapper.formatPercentage(Player.hacknet_node_core_cost_mult)}
    +        
    +
    +            {'Hacknet Node level upgrade cost multiplier: ' + numeralWrapper.formatPercentage(Player.hacknet_node_level_cost_mult)}
    +        

    +
    +            {'Company reputation gain multiplier: ' + numeralWrapper.formatPercentage(Player.company_rep_mult)}
    +        
    +
    +            {'Faction reputation gain multiplier: ' + numeralWrapper.formatPercentage(Player.faction_rep_mult)}
    +        
    +
    +            {'Salary multiplier: ' + numeralWrapper.formatPercentage(Player.work_money_mult)}
    +        

    +
    +            {'Crime success multiplier: ' + numeralWrapper.formatPercentage(Player.crime_success_mult)}
    +        
    +
    +            {'Crime money multiplier: ' + numeralWrapper.formatPercentage(Player.crime_money_mult)}
    +        
    + + ) +} diff --git a/src/Augmentation/ui/PurchasedAugmentations.tsx b/src/Augmentation/ui/PurchasedAugmentations.tsx index bd966dfe5..3bc54d837 100644 --- a/src/Augmentation/ui/PurchasedAugmentations.tsx +++ b/src/Augmentation/ui/PurchasedAugmentations.tsx @@ -20,7 +20,9 @@ export function PurchasedAugmentations(): React.ReactElement { } augs.push( - +
  • + +
  • ) } diff --git a/src/Augmentation/ui/Root.tsx b/src/Augmentation/ui/Root.tsx index 565267f31..10e733556 100644 --- a/src/Augmentation/ui/Root.tsx +++ b/src/Augmentation/ui/Root.tsx @@ -4,9 +4,11 @@ */ import * as React from "react"; -import { Augmentations } from "../../Augmentation/Augmentations"; -import { Player } from "../../Player"; +import { InstalledAugmentationsAndSourceFiles } from "./InstalledAugmentationsAndSourceFiles"; +import { PlayerMultipliers } from "./PlayerMultipliers"; +import { PurchasedAugmentations } from "./PurchasedAugmentations"; +import { Player } from "../../Player"; import { StdButton } from "../../ui/React/StdButton"; type IProps = { @@ -25,7 +27,7 @@ export class AugmentationsRoot extends React.Component { render() { return ( -
    +

    Purchased Augmentations

    Below is a list of all Augmentations you have purchased but not @@ -34,14 +36,14 @@ export class AugmentationsRoot extends React.Component {

    WARNING: Installing your Augmentations resets most of your progress, including: -

    +


    - Stats/Skill levels and Experience

    - Money

    - Scripts on every computer but your home computer

    - Purchased servers

    - Hacknet Nodes

    - Faction/Company reputation

    -

    - Stocks

    +

    - Stocks


    Installing Augmentations lets you start over with the perks and benefits granted by all of the Augmentations you have ever @@ -62,10 +64,19 @@ export class AugmentationsRoot extends React.Component { text="Backup Save (Export)" tooltip="It's always a good idea to backup/export your save!" /> + -

      +

      Installed Augmentations

      +

      + { + `List of all Augmentations ${Player.sourceFiles.length > 0 ? "and Source Files " : ""} ` + + `that have been installed. You have gained the effects of these.` + } +

      + -
    +

    +
    ) } diff --git a/src/BitNode/BitNode.ts b/src/BitNode/BitNode.ts index a4803866a..7f443c14a 100644 --- a/src/BitNode/BitNode.ts +++ b/src/BitNode/BitNode.ts @@ -25,235 +25,232 @@ class BitNode { } -export let BitNodes: IMap = {}; +export const BitNodes: IMap = {}; -export function initBitNodes() { - BitNodes = {}; - BitNodes["BitNode1"] = new BitNode(1, "Source Genesis", "The original BitNode", - "The first BitNode created by the Enders to imprison the minds of humans. It became " + - "the prototype and testing-grounds for all of the BitNodes that followed.

    " + - "This is the first BitNode that you play through. It has no special " + - "modifications or mechanics.

    " + - "Destroying this BitNode will give you Source-File 1, or if you already have " + - "this Source-File it will upgrade its level up to a maximum of 3. This Source-File " + - "lets the player start with 32GB of RAM on his/her home computer when entering a " + - "new BitNode, and also increases all of the player's multipliers by:

    " + - "Level 1: 16%
    " + - "Level 2: 24%
    " + - "Level 3: 28%"); - BitNodes["BitNode2"] = new BitNode(2, "Rise of the Underworld", "From the shadows, they rose", //Gangs - "From the shadows, they rose.

    Organized crime groups quickly filled the void of power " + - "left behind from the collapse of Western government in the 2050s. As society and civlization broke down, " + - "people quickly succumbed to the innate human impulse of evil and savagery. The organized crime " + - "factions quickly rose to the top of the modern world.

    " + - "In this BitNode:

    " + - "Your hacking level is reduced by 20%
    " + - "The growth rate and maximum amount of money available on servers are significantly decreased
    " + - "The amount of money gained from crimes and Infiltration is tripled
    " + - "Certain Factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead, " + - "NiteSec, The Black Hand) give the player the ability to form and manage their own gangs. These gangs " + - "will earn the player money and reputation with the corresponding Faction
    " + - "Every Augmentation in the game will be available through the Factions listed above
    " + - "For every Faction NOT listed above, reputation gains are halved
    " + - "You will no longer gain passive reputation with Factions

    " + - "Destroying this BitNode will give you Source-File 2, or if you already have this Source-File it will " + - "upgrade its level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes " + - "once your karma decreases to a certain value. " + - "It also increases the player's crime success rate, crime money, and charisma multipliers by:

    " + - "Level 1: 24%
    " + - "Level 2: 36%
    " + - "Level 3: 42%"); - BitNodes["BitNode3"] = new BitNode(3, "Corporatocracy", "The Price of Civilization", - "Our greatest illusion is that a healthy society can revolve around a " + - "single-minded pursuit of wealth.

    " + - "Sometime in the early 21st century economic and political globalization turned " + - "the world into a corporatocracy, and it never looked back. Now, the privileged " + - "elite will happily bankrupt their own countrymen, decimate their own community, " + - "and evict their neighbors from houses in their desperate bid to increase their wealth.

    " + - "In this BitNode you can create and manage your own corporation. Running a successful corporation " + - "has the potential of generating massive profits. All other forms of income are reduced by 75%. Furthermore:

    " + - "The price and reputation cost of all Augmentations is tripled
    " + - "The starting and maximum amount of money on servers is reduced by 75%
    " + - "Server growth rate is reduced by 80%
    " + - "You now only need 75 favour with a faction in order to donate to it, rather than 150

    " + - "Destroying this BitNode will give you Source-File 3, or if you already have this Source-File it will " + - "upgrade its level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although " + - "some BitNodes will disable this mechanic). This Source-File also increases your charisma and company salary multipliers by:
    " + - "Level 1: 8%
    " + - "Level 2: 12%
    " + - "Level 3: 14%"); - BitNodes["BitNode4"] = new BitNode(4, "The Singularity", "The Man and the Machine", - "The Singularity has arrived. The human race is gone, replaced " + - "by artificially superintelligent beings that are more machine than man.

    " + - "In this BitNode, progressing is significantly harder. Experience gain rates " + - "for all stats are reduced. Most methods of earning money will now give significantly less.

    " + - "In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions. " + - "These functions allow you to control most aspects of the game through scripts, including working for factions/companies, " + - "purchasing/installing Augmentations, and creating programs.

    " + - "Destroying this BitNode will give you Source-File 4, or if you already have this Source-File it will " + - "upgrade its level up to a maximum of 3. This Source-File lets you access and use the Singularity " + - "Functions in other BitNodes. Each level of this Source-File will open up more Singularity Functions " + - "that you can use."); - BitNodes["BitNode5"] = new BitNode(5, "Artificial Intelligence", "Posthuman", - "They said it couldn't be done. They said the human brain, " + - "along with its consciousness and intelligence, couldn't be replicated. They said the complexity " + - "of the brain results from unpredictable, nonlinear interactions that couldn't be modeled " + - "by 1's and 0's. They were wrong.

    " + - "In this BitNode:

    " + - "The base security level of servers is doubled
    " + - "The starting money on servers is halved, but the maximum money remains the same
    " + - "Most methods of earning money now give significantly less
    " + - "Infiltration gives 50% more reputation and money
    " + - "Corporations have 50% lower valuations and are therefore less profitable
    " + - "Augmentations are more expensive
    " + - "Hacking experience gain rates are reduced

    " + - "Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will " + - "upgrade its level up to a maximum of 3. This Source-File grants you a special new stat called Intelligence. " + - "Intelligence is unique because it is permanent and persistent (it never gets reset back to 1). However " + - "gaining Intelligence experience is much slower than other stats, and it is also hidden (you won't know " + - "when you gain experience and how much). Higher Intelligence levels will boost your production for many actions " + - "in the game.

    " + - "In addition, this Source-File will unlock the getBitNodeMultipliers() Netscript function, " + - "and will also raise all of your hacking-related multipliers by:

    " + - "Level 1: 8%
    " + - "Level 2: 12%
    " + - "Level 3: 14%"); - BitNodes["BitNode6"] = new BitNode(6, "Bladeburners", "Like Tears in Rain", - "In the middle of the 21st century, OmniTek Incorporated began designing and manufacturing advanced synthetic " + - "androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth generation " + - "of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was " + - "the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent " + - "than the humans that had created them.

    " + - "In this BitNode you will be able to access the Bladeburner Division at the NSA, which provides a new mechanic " + - "for progression. Furthermore:

    " + - "Hacking and Hacknet Nodes will be less profitable
    " + - "Your hacking level is reduced by 65%
    " + - "Hacking experience gain from scripts is reduced by 75%
    " + - "Corporations have 80% lower valuations and are therefore less profitable
    " + - "Working for companies is 50% less profitable
    " + - "Crimes and Infiltration are 25% less profitable

    " + - "Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade " + - "its level up to a maximum of 3. This Source-File allows you to access the NSA's Bladeburner Division in other " + - "BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat stats by:

    " + - "Level 1: 8%
    " + - "Level 2: 12%
    " + - "Level 3: 14%"); - BitNodes["BitNode7"] = new BitNode(7, "Bladeburners 2079", "More human than humans", - "In the middle of the 21st century, you were doing cutting-edge work at OmniTek Incorporated as part of the AI design team " + - "for advanced synthetic androids, or Synthoids for short. You helped achieve a major technological " + - "breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing a hyperintelligent AI. " + - "Many argue that this was the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, " + - "and more intelligent than the humans that had created them.

    " + - "In this BitNode you will be able to access the Bladeburner API, which allows you to access Bladeburner " + - "functionality through Netscript. Furthermore:

    " + - "The rank you gain from Bladeburner contracts/operations is reduced by 40%
    " + - "Bladeburner skills cost twice as many skill points
    " + - "Augmentations are 3x more expensive
    " + - "Hacking and Hacknet Nodes will be significantly less profitable
    " + - "Your hacking level is reduced by 65%
    " + - "Hacking experience gain from scripts is reduced by 75%
    " + - "Corporations have 80% lower valuations and are therefore less profitable
    " + - "Working for companies is 50% less profitable
    " + - "Crimes and Infiltration are 25% less profitable

    " + - "Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade " + - "its level up to a maximum of 3. This Source-File allows you to access the Bladeburner Netscript API in other " + - "BitNodes. In addition, this Source-File will increase all of your Bladeburner multipliers by:

    " + - "Level 1: 8%
    " + - "Level 2: 12%
    " + - "Level 3: 14%"); - BitNodes["BitNode8"] = new BitNode(8, "Ghost of Wall Street", "Money never sleeps", - "You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.

    " + - "In this BitNode:

    " + - "You start with $250 million
    " + - "The only way to earn money is by trading on the stock market
    " + - "You start with a WSE membership and access to the TIX API
    " + - "You are able to short stocks and place different types of orders (limit/stop)
    " + - "You can immediately donate to factions to gain reputation

    " + - "Destroying this BitNode will give you Source-File 8, or if you already have this Source-File it will " + - "upgrade its level up to a maximum of 3. This Source-File grants the following benefits:

    " + - "Level 1: Permanent access to WSE and TIX API
    " + - "Level 2: Ability to short stocks in other BitNodes
    " + - "Level 3: Ability to use limit/stop orders in other BitNodes

    " + - "This Source-File also increases your hacking growth multipliers by: " + - "
    Level 1: 12%
    Level 2: 18%
    Level 3: 21%"); - BitNodes["BitNode9"] = new BitNode(9, "Hacktocracy", "Hacknet Unleashed", - "When Fulcrum Technologies released their open-source Linux distro Chapeau, it quickly " + - "became the OS of choice for the underground hacking community. Chapeau became especially notorious for " + - "powering the Hacknet, a global, decentralized network used for nefarious purposes. Fulcrum quickly " + - "abandoned the project and dissociated themselves from it.

    " + - "This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate " + - "hashes, which can be spent on a variety of different upgrades.

    " + - "In this BitNode:

    " + - "Your stats are significantly decreased
    " + - "You cannnot purchase additional servers
    " + - "Hacking is significantly less profitable

    " + - "Destroying this BitNode will give you Source-File 9, or if you already have this Source-File it will " + - "upgrade its level up to a maximum of 3. This Source-File grants the following benefits:

    " + - "Level 1: Permanently unlocks the Hacknet Server in other BitNodes
    " + - "Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode
    " + - "Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode

    " + - "(Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT " + - "when installing Augmentations)"); - BitNodes["BitNode10"] = new BitNode(10, "Digital Carbon", "Your body is not who you are", - "In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people " + - "to digitize their consciousness. Their consciousness could then be transferred into Synthoids " + - "or other bodies by trasmitting the digitized data. Human bodies became nothing more than 'sleeves' for the " + - "human consciousness. Mankind had finally achieved immortality - at least for those that could afford it.

    " + - "This BitNode unlocks Sleeve technology. Sleeve technology allows you to:

    " + - "1. Re-sleeve: Purchase and transfer your consciousness into a new body
    " + - "2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks synchronously

    " + - "In this BitNode:

    " + - "Your stats are significantly decreased
    " + - "All methods of gaining money are half as profitable (except Stock Market)
    " + - "Purchased servers are more expensive, have less max RAM, and a lower maximum limit
    " + - "Augmentations are 5x as expensive and require twice as much reputation

    " + - "Destroying this BitNode will give you Source-File 10, or if you already have this Source-File it will " + - "upgrade its level up to a maximum of 3. This Source-File unlocks Sleeve technology in other BitNodes. " + - "Each level of this Source-File also grants you a Duplicate Sleeve"); - BitNodes["BitNode11"] = new BitNode(11, "The Big Crash", "Okay. Sell it all.", - "The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around the world. It was this period " + - "of disorder that eventually lead to the governmental reformation of many global superpowers, most notably " + - "the USA and China. But just as the world was slowly beginning to recover from these dark times, financial catastrophe hit.

    " + - "In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of this chaos and confusion, hackers " + - "were able to steal billions of dollars from the world's largest electronic banks, prompting an international banking crisis as " + - "governments were unable to bail out insolvent banks. Now, the world is slowly crumbling in the middle of the biggest economic crisis of all time.

    " + - "In this BitNode:

    " + - "Your hacking stat and experience gain are halved
    " + - "The starting and maximum amount of money available on servers is significantly decreased
    " + - "The growth rate of servers is significantly reduced
    " + - "Weakening a server is twice as effective
    " + - "Company wages are decreased by 50%
    " + - "Corporation valuations are 99% lower and are therefore significantly less profitable
    " + - "Hacknet Node production is significantly decreased
    " + - "Crime and Infiltration are more lucrative
    " + - "Augmentations are twice as expensive

    " + - "Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will " + - "upgrade its level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH " + - "the player's salary and reputation gain rate at that company by 1% per favor (rather than just the reputation gain). " + - "This Source-File also increases the player's company salary and reputation gain multipliers by:

    " + - "Level 1: 32%
    " + - "Level 2: 48%
    " + - "Level 3: 56%"); - BitNodes["BitNode12"] = new BitNode(12, "The Recursion", "Repeat.", - "To iterate is human, to recurse divine.

    " + - "Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give your Souce-File 12, or " + - "if you already have this Source-File it will upgrade its level. There is no maximum level for Source-File 12. Each level " + - "of Source-File 12 will increase all of your multipliers by 1%. This effect is multiplicative with itself. " + - "In other words, level N of this Source-File will result in a multiplier of 1.01^N (or 0.99^N for multipliers that decrease)"); - //Books: Frontera, Shiner - BitNodes["BitNode13"] = new BitNode(13, "fOS", "COMING SOON"); //Unlocks the new game mode and the rest of the BitNodes - BitNodes["BitNode14"] = new BitNode(14, "", "COMING SOON"); - BitNodes["BitNode15"] = new BitNode(15, "", "COMING SOON"); - BitNodes["BitNode16"] = new BitNode(16, "", "COMING SOON"); - BitNodes["BitNode17"] = new BitNode(17, "", "COMING SOON"); - BitNodes["BitNode18"] = new BitNode(18, "", "COMING SOON"); - BitNodes["BitNode19"] = new BitNode(19, "", "COMING SOON"); - BitNodes["BitNode20"] = new BitNode(20, "", "COMING SOON"); - BitNodes["BitNode21"] = new BitNode(21, "", "COMING SOON"); - BitNodes["BitNode22"] = new BitNode(22, "", "COMING SOON"); - BitNodes["BitNode23"] = new BitNode(23, "", "COMING SOON"); - BitNodes["BitNode24"] = new BitNode(24, "", "COMING SOON"); -} +BitNodes["BitNode1"] = new BitNode(1, "Source Genesis", "The original BitNode", + "The first BitNode created by the Enders to imprison the minds of humans. It became " + + "the prototype and testing-grounds for all of the BitNodes that followed.

    " + + "This is the first BitNode that you play through. It has no special " + + "modifications or mechanics.

    " + + "Destroying this BitNode will give you Source-File 1, or if you already have " + + "this Source-File it will upgrade its level up to a maximum of 3. This Source-File " + + "lets the player start with 32GB of RAM on his/her home computer when entering a " + + "new BitNode, and also increases all of the player's multipliers by:

    " + + "Level 1: 16%
    " + + "Level 2: 24%
    " + + "Level 3: 28%"); +BitNodes["BitNode2"] = new BitNode(2, "Rise of the Underworld", "From the shadows, they rose", //Gangs + "From the shadows, they rose.

    Organized crime groups quickly filled the void of power " + + "left behind from the collapse of Western government in the 2050s. As society and civlization broke down, " + + "people quickly succumbed to the innate human impulse of evil and savagery. The organized crime " + + "factions quickly rose to the top of the modern world.

    " + + "In this BitNode:

    " + + "Your hacking level is reduced by 20%
    " + + "The growth rate and maximum amount of money available on servers are significantly decreased
    " + + "The amount of money gained from crimes and Infiltration is tripled
    " + + "Certain Factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead, " + + "NiteSec, The Black Hand) give the player the ability to form and manage their own gangs. These gangs " + + "will earn the player money and reputation with the corresponding Faction
    " + + "Every Augmentation in the game will be available through the Factions listed above
    " + + "For every Faction NOT listed above, reputation gains are halved
    " + + "You will no longer gain passive reputation with Factions

    " + + "Destroying this BitNode will give you Source-File 2, or if you already have this Source-File it will " + + "upgrade its level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes " + + "once your karma decreases to a certain value. " + + "It also increases the player's crime success rate, crime money, and charisma multipliers by:

    " + + "Level 1: 24%
    " + + "Level 2: 36%
    " + + "Level 3: 42%"); +BitNodes["BitNode3"] = new BitNode(3, "Corporatocracy", "The Price of Civilization", + "Our greatest illusion is that a healthy society can revolve around a " + + "single-minded pursuit of wealth.

    " + + "Sometime in the early 21st century economic and political globalization turned " + + "the world into a corporatocracy, and it never looked back. Now, the privileged " + + "elite will happily bankrupt their own countrymen, decimate their own community, " + + "and evict their neighbors from houses in their desperate bid to increase their wealth.

    " + + "In this BitNode you can create and manage your own corporation. Running a successful corporation " + + "has the potential of generating massive profits. All other forms of income are reduced by 75%. Furthermore:

    " + + "The price and reputation cost of all Augmentations is tripled
    " + + "The starting and maximum amount of money on servers is reduced by 75%
    " + + "Server growth rate is reduced by 80%
    " + + "You now only need 75 favour with a faction in order to donate to it, rather than 150

    " + + "Destroying this BitNode will give you Source-File 3, or if you already have this Source-File it will " + + "upgrade its level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although " + + "some BitNodes will disable this mechanic). This Source-File also increases your charisma and company salary multipliers by:
    " + + "Level 1: 8%
    " + + "Level 2: 12%
    " + + "Level 3: 14%"); +BitNodes["BitNode4"] = new BitNode(4, "The Singularity", "The Man and the Machine", + "The Singularity has arrived. The human race is gone, replaced " + + "by artificially superintelligent beings that are more machine than man.

    " + + "In this BitNode, progressing is significantly harder. Experience gain rates " + + "for all stats are reduced. Most methods of earning money will now give significantly less.

    " + + "In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions. " + + "These functions allow you to control most aspects of the game through scripts, including working for factions/companies, " + + "purchasing/installing Augmentations, and creating programs.

    " + + "Destroying this BitNode will give you Source-File 4, or if you already have this Source-File it will " + + "upgrade its level up to a maximum of 3. This Source-File lets you access and use the Singularity " + + "Functions in other BitNodes. Each level of this Source-File will open up more Singularity Functions " + + "that you can use."); +BitNodes["BitNode5"] = new BitNode(5, "Artificial Intelligence", "Posthuman", + "They said it couldn't be done. They said the human brain, " + + "along with its consciousness and intelligence, couldn't be replicated. They said the complexity " + + "of the brain results from unpredictable, nonlinear interactions that couldn't be modeled " + + "by 1's and 0's. They were wrong.

    " + + "In this BitNode:

    " + + "The base security level of servers is doubled
    " + + "The starting money on servers is halved, but the maximum money remains the same
    " + + "Most methods of earning money now give significantly less
    " + + "Infiltration gives 50% more reputation and money
    " + + "Corporations have 50% lower valuations and are therefore less profitable
    " + + "Augmentations are more expensive
    " + + "Hacking experience gain rates are reduced

    " + + "Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will " + + "upgrade its level up to a maximum of 3. This Source-File grants you a special new stat called Intelligence. " + + "Intelligence is unique because it is permanent and persistent (it never gets reset back to 1). However " + + "gaining Intelligence experience is much slower than other stats, and it is also hidden (you won't know " + + "when you gain experience and how much). Higher Intelligence levels will boost your production for many actions " + + "in the game.

    " + + "In addition, this Source-File will unlock the getBitNodeMultipliers() Netscript function, " + + "and will also raise all of your hacking-related multipliers by:

    " + + "Level 1: 8%
    " + + "Level 2: 12%
    " + + "Level 3: 14%"); +BitNodes["BitNode6"] = new BitNode(6, "Bladeburners", "Like Tears in Rain", + "In the middle of the 21st century, OmniTek Incorporated began designing and manufacturing advanced synthetic " + + "androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth generation " + + "of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was " + + "the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent " + + "than the humans that had created them.

    " + + "In this BitNode you will be able to access the Bladeburner Division at the NSA, which provides a new mechanic " + + "for progression. Furthermore:

    " + + "Hacking and Hacknet Nodes will be less profitable
    " + + "Your hacking level is reduced by 65%
    " + + "Hacking experience gain from scripts is reduced by 75%
    " + + "Corporations have 80% lower valuations and are therefore less profitable
    " + + "Working for companies is 50% less profitable
    " + + "Crimes and Infiltration are 25% less profitable

    " + + "Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade " + + "its level up to a maximum of 3. This Source-File allows you to access the NSA's Bladeburner Division in other " + + "BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat stats by:

    " + + "Level 1: 8%
    " + + "Level 2: 12%
    " + + "Level 3: 14%"); +BitNodes["BitNode7"] = new BitNode(7, "Bladeburners 2079", "More human than humans", + "In the middle of the 21st century, you were doing cutting-edge work at OmniTek Incorporated as part of the AI design team " + + "for advanced synthetic androids, or Synthoids for short. You helped achieve a major technological " + + "breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing a hyperintelligent AI. " + + "Many argue that this was the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, " + + "and more intelligent than the humans that had created them.

    " + + "In this BitNode you will be able to access the Bladeburner API, which allows you to access Bladeburner " + + "functionality through Netscript. Furthermore:

    " + + "The rank you gain from Bladeburner contracts/operations is reduced by 40%
    " + + "Bladeburner skills cost twice as many skill points
    " + + "Augmentations are 3x more expensive
    " + + "Hacking and Hacknet Nodes will be significantly less profitable
    " + + "Your hacking level is reduced by 65%
    " + + "Hacking experience gain from scripts is reduced by 75%
    " + + "Corporations have 80% lower valuations and are therefore less profitable
    " + + "Working for companies is 50% less profitable
    " + + "Crimes and Infiltration are 25% less profitable

    " + + "Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade " + + "its level up to a maximum of 3. This Source-File allows you to access the Bladeburner Netscript API in other " + + "BitNodes. In addition, this Source-File will increase all of your Bladeburner multipliers by:

    " + + "Level 1: 8%
    " + + "Level 2: 12%
    " + + "Level 3: 14%"); +BitNodes["BitNode8"] = new BitNode(8, "Ghost of Wall Street", "Money never sleeps", + "You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.

    " + + "In this BitNode:

    " + + "You start with $250 million
    " + + "The only way to earn money is by trading on the stock market
    " + + "You start with a WSE membership and access to the TIX API
    " + + "You are able to short stocks and place different types of orders (limit/stop)
    " + + "You can immediately donate to factions to gain reputation

    " + + "Destroying this BitNode will give you Source-File 8, or if you already have this Source-File it will " + + "upgrade its level up to a maximum of 3. This Source-File grants the following benefits:

    " + + "Level 1: Permanent access to WSE and TIX API
    " + + "Level 2: Ability to short stocks in other BitNodes
    " + + "Level 3: Ability to use limit/stop orders in other BitNodes

    " + + "This Source-File also increases your hacking growth multipliers by: " + + "
    Level 1: 12%
    Level 2: 18%
    Level 3: 21%"); +BitNodes["BitNode9"] = new BitNode(9, "Hacktocracy", "Hacknet Unleashed", + "When Fulcrum Technologies released their open-source Linux distro Chapeau, it quickly " + + "became the OS of choice for the underground hacking community. Chapeau became especially notorious for " + + "powering the Hacknet, a global, decentralized network used for nefarious purposes. Fulcrum quickly " + + "abandoned the project and dissociated themselves from it.

    " + + "This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate " + + "hashes, which can be spent on a variety of different upgrades.

    " + + "In this BitNode:

    " + + "Your stats are significantly decreased
    " + + "You cannnot purchase additional servers
    " + + "Hacking is significantly less profitable

    " + + "Destroying this BitNode will give you Source-File 9, or if you already have this Source-File it will " + + "upgrade its level up to a maximum of 3. This Source-File grants the following benefits:

    " + + "Level 1: Permanently unlocks the Hacknet Server in other BitNodes
    " + + "Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode
    " + + "Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode

    " + + "(Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT " + + "when installing Augmentations)"); +BitNodes["BitNode10"] = new BitNode(10, "Digital Carbon", "Your body is not who you are", + "In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people " + + "to digitize their consciousness. Their consciousness could then be transferred into Synthoids " + + "or other bodies by trasmitting the digitized data. Human bodies became nothing more than 'sleeves' for the " + + "human consciousness. Mankind had finally achieved immortality - at least for those that could afford it.

    " + + "This BitNode unlocks Sleeve technology. Sleeve technology allows you to:

    " + + "1. Re-sleeve: Purchase and transfer your consciousness into a new body
    " + + "2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks synchronously

    " + + "In this BitNode:

    " + + "Your stats are significantly decreased
    " + + "All methods of gaining money are half as profitable (except Stock Market)
    " + + "Purchased servers are more expensive, have less max RAM, and a lower maximum limit
    " + + "Augmentations are 5x as expensive and require twice as much reputation

    " + + "Destroying this BitNode will give you Source-File 10, or if you already have this Source-File it will " + + "upgrade its level up to a maximum of 3. This Source-File unlocks Sleeve technology in other BitNodes. " + + "Each level of this Source-File also grants you a Duplicate Sleeve"); +BitNodes["BitNode11"] = new BitNode(11, "The Big Crash", "Okay. Sell it all.", + "The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around the world. It was this period " + + "of disorder that eventually lead to the governmental reformation of many global superpowers, most notably " + + "the USA and China. But just as the world was slowly beginning to recover from these dark times, financial catastrophe hit.

    " + + "In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of this chaos and confusion, hackers " + + "were able to steal billions of dollars from the world's largest electronic banks, prompting an international banking crisis as " + + "governments were unable to bail out insolvent banks. Now, the world is slowly crumbling in the middle of the biggest economic crisis of all time.

    " + + "In this BitNode:

    " + + "Your hacking stat and experience gain are halved
    " + + "The starting and maximum amount of money available on servers is significantly decreased
    " + + "The growth rate of servers is significantly reduced
    " + + "Weakening a server is twice as effective
    " + + "Company wages are decreased by 50%
    " + + "Corporation valuations are 99% lower and are therefore significantly less profitable
    " + + "Hacknet Node production is significantly decreased
    " + + "Crime and Infiltration are more lucrative
    " + + "Augmentations are twice as expensive

    " + + "Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will " + + "upgrade its level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH " + + "the player's salary and reputation gain rate at that company by 1% per favor (rather than just the reputation gain). " + + "This Source-File also increases the player's company salary and reputation gain multipliers by:

    " + + "Level 1: 32%
    " + + "Level 2: 48%
    " + + "Level 3: 56%"); +BitNodes["BitNode12"] = new BitNode(12, "The Recursion", "Repeat.", + "To iterate is human, to recurse divine.

    " + + "Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give your Souce-File 12, or " + + "if you already have this Source-File it will upgrade its level. There is no maximum level for Source-File 12. Each level " + + "of Source-File 12 will increase all of your multipliers by 1%. This effect is multiplicative with itself. " + + "In other words, level N of this Source-File will result in a multiplier of 1.01^N (or 0.99^N for multipliers that decrease)"); +// Books: Frontera, Shiner +BitNodes["BitNode13"] = new BitNode(13, "fOS", "COMING SOON"); //Unlocks the new game mode and the rest of the BitNodes +BitNodes["BitNode14"] = new BitNode(14, "", "COMING SOON"); +BitNodes["BitNode15"] = new BitNode(15, "", "COMING SOON"); +BitNodes["BitNode16"] = new BitNode(16, "", "COMING SOON"); +BitNodes["BitNode17"] = new BitNode(17, "", "COMING SOON"); +BitNodes["BitNode18"] = new BitNode(18, "", "COMING SOON"); +BitNodes["BitNode19"] = new BitNode(19, "", "COMING SOON"); +BitNodes["BitNode20"] = new BitNode(20, "", "COMING SOON"); +BitNodes["BitNode21"] = new BitNode(21, "", "COMING SOON"); +BitNodes["BitNode22"] = new BitNode(22, "", "COMING SOON"); +BitNodes["BitNode23"] = new BitNode(23, "", "COMING SOON"); +BitNodes["BitNode24"] = new BitNode(24, "", "COMING SOON"); export function initBitNodeMultipliers(p: IPlayer) { if (p.bitNodeN == null) { diff --git a/src/engine.jsx b/src/engine.jsx index 488c21eb6..57f397c8d 100644 --- a/src/engine.jsx +++ b/src/engine.jsx @@ -15,7 +15,6 @@ import { import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; import { BitNodes, - initBitNodes, initBitNodeMultipliers } from "./BitNode/BitNode"; import { Bladeburner } from "./Bladeburner"; @@ -310,8 +309,8 @@ const Engine = { loadAugmentationsContent: function() { Engine.hideAllContent(); Engine.Display.augmentationsContent.style.display = "block"; - displayAugmentationsContent(Engine.Display.augmentationsContent); routing.navigateTo(Page.Augmentations); + displayAugmentationsContent(Engine.Display.augmentationsContent); MainMenuLinks.Augmentations.classList.add("active"); }, @@ -488,13 +487,20 @@ const Engine = { Engine.Display.activeScriptsContent.style.display = "none"; clearHacknetNodesUI(); Engine.Display.createProgramContent.style.display = "none"; + Engine.Display.factionsContent.style.display = "none"; - ReactDOM.unmountComponentAtNode(Engine.Display.factionContent); + Engine.Display.factionContent.style.display = "none"; + ReactDOM.unmountComponentAtNode(Engine.Display.factionContent); + Engine.Display.augmentationsContent.style.display = "none"; + ReactDOM.unmountComponentAtNode(Engine.Display.augmentationsContent); + Engine.Display.tutorialContent.style.display = "none"; + Engine.Display.locationContent.style.display = "none"; ReactDOM.unmountComponentAtNode(Engine.Display.locationContent); + Engine.Display.workInProgressContent.style.display = "none"; Engine.Display.redPillContent.style.display = "none"; Engine.Display.cinematicTextContent.style.display = "none"; @@ -1038,7 +1044,6 @@ const Engine = { // Load game from save or create new game if (loadGame(saveString)) { - initBitNodes(); initBitNodeMultipliers(Player); Engine.setDisplayElements(); // Sets variables for important DOM elements Engine.init(); // Initialize buttons, work, etc. @@ -1160,7 +1165,6 @@ const Engine = { } else { // No save found, start new game console.log("Initializing new game"); - initBitNodes(); initBitNodeMultipliers(Player); initSpecialServerIps(); Engine.setDisplayElements(); // Sets variables for important DOM elements diff --git a/src/ui/React/Accordion.tsx b/src/ui/React/Accordion.tsx index b7d382fe5..5833f29f7 100644 --- a/src/ui/React/Accordion.tsx +++ b/src/ui/React/Accordion.tsx @@ -45,12 +45,12 @@ export class Accordion extends React.Component { render() { return ( -
    - - -
    + <> + + + ) } } diff --git a/src/ui/React/AugmentationAccordion.tsx b/src/ui/React/AugmentationAccordion.tsx index 430a9800c..98b95f8f1 100644 --- a/src/ui/React/AugmentationAccordion.tsx +++ b/src/ui/React/AugmentationAccordion.tsx @@ -2,7 +2,7 @@ * React Component for displaying a single Augmentation as an accordion. * * The header of the accordion contains the Augmentation's name (and level, if - * applicable), and the accordion's panel contains the Augmentation's level. + * applicable), and the accordion's panel contains the Augmentation's description. */ import * as React from "react"; @@ -26,8 +26,8 @@ export function AugmentationAccordion(props: IProps): React.ReactElement { return ( {displayName}

    } - panelContent={

    {props.aug.info}

    } + headerContent={<>{displayName}} + panelContent={

    } /> ) } diff --git a/src/ui/React/SourceFileAccordion.tsx b/src/ui/React/SourceFileAccordion.tsx new file mode 100644 index 000000000..2f5172e36 --- /dev/null +++ b/src/ui/React/SourceFileAccordion.tsx @@ -0,0 +1,35 @@ +/** + * React Component for displaying a single Source-File as an accordion. + * + * The header of the accordion contains the Source-Files's name and level, + * and the accordion's panel contains the Source-File's description. + */ +import * as React from "react"; + +import { Accordion } from "./Accordion"; + +import { SourceFile } from "../../SourceFile/SourceFile"; + +type IProps = { + level: number, + sf: SourceFile, +} + +export function SourceFileAccordion(props: IProps): React.ReactElement { + const maxLevel = props.sf.n === 3 ? "∞" : "3"; + + return ( + + {props.sf.name} +
    + {`Level ${props.level} / ${maxLevel}`} + + } + panelContent={ +

    + } + /> + ) +}