mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 04:05:46 +01:00
1 line
4.6 MiB
1 line
4.6 MiB
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/Player.ts","webpack:///./src/ui/numeralFormat.ts","webpack:///./src/BitNode/BitNodeMultipliers.ts","webpack:///./src/Augmentation/data/AugmentationNames.ts","webpack:///./src/Constants.ts","webpack:///./src/Settings/Settings.ts","webpack:///./src/Locations/data/LocationNames.ts","webpack:///./src/Netscript/RamCostGenerator.ts","webpack:///./src/ui/React/DialogBox.tsx","webpack:///./src/ui/React/Money.tsx","webpack:///./src/Augmentation/Augmentations.ts","webpack:///./src/utils/JSONReviver.ts","webpack:///./src/Server/AllServers.ts","webpack:///./src/utils/StringHelperFunctions.ts","webpack:///./src/Locations/data/CityNames.ts","webpack:///./src/ui/Router.ts","webpack:///./src/Faction/Factions.ts","webpack:///./src/ui/Context.ts","webpack:///./src/Company/data/companypositionnames.ts","webpack:///./src/utils/helpers/getRandomInt.ts","webpack:///./src/Corporation/data/Constants.ts","webpack:///./src/Hacknet/data/Constants.ts","webpack:///./src/Augmentation/Augmentation.tsx","webpack:///./src/Bladeburner/data/ActionTypes.ts","webpack:///./src/ui/React/Modal.tsx","webpack:///./src/ui/React/Table.tsx","webpack:///./src/InteractiveTutorial.ts","webpack:///./src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx","webpack:///./src/Server/Server.ts","webpack:///./src/Corporation/ui/Context.ts","webpack:///./src/Corporation/IndustryData.tsx","webpack:///./src/Corporation/EmployeePositions.ts","webpack:///./src/Locations/LocationTypeEnum.ts","webpack:///./src/Hacknet/HacknetHelpers.tsx","webpack:///./src/Bladeburner/data/Constants.ts","webpack:///./src/Literature/data/LiteratureNames.ts","webpack:///./src/Programs/Programs.ts","webpack:///./src/Company/Companies.ts","webpack:///./src/Corporation/Actions.ts","webpack:///./src/Gang/AllGangs.ts","webpack:///./src/StockMarket/data/PositionTypes.ts","webpack:///./src/CotMG/FragmentType.ts","webpack:///./src/PersonObjects/Sleeve/SleeveTaskTypesEnum.ts","webpack:///./src/SourceFile/SourceFileFlags.ts","webpack:///./src/Terminal/DirectoryHelpers.ts","webpack:///./src/Crime/Crimes.ts","webpack:///./src/Casino/utils.ts","webpack:///./src/Terminal.ts","webpack:///./src/Hacknet/HacknetServer.ts","webpack:///./src/Company/CompanyPositions.ts","webpack:///./src/StockMarket/data/StockSymbols.ts","webpack:///./src/Script/isScriptFilename.ts","webpack:///./src/Hacking.ts","webpack:///./src/StockMarket/StockMarket.tsx","webpack:///./src/ui/GameRoot.tsx","webpack:///./src/utils/helpers/keyCodes.ts","webpack:///./src/Server/data/SpecialServers.ts","webpack:///./src/SaveObject.tsx","webpack:///./src/NetscriptEvaluator.ts","webpack:///./src/ui/React/MoneyRate.tsx","webpack:///./src/CodingContracts.ts","webpack:///./src/StockMarket/data/OrderTypes.ts","webpack:///./src/ui/React/Reputation.tsx","webpack:///./src/Exploits/Exploit.ts","webpack:///./src/CotMG/Helper.tsx","webpack:///./src/Faction/FactionHelpers.tsx","webpack:///./src/Corporation/data/BaseResearchTree.ts","webpack:///./src/utils/EventEmitter.ts","webpack:///./src/Server/ServerHelpers.ts","webpack:///./src/Bladeburner/data/SkillNames.ts","webpack:///./src/utils/helpers/isString.ts","webpack:///./src/DevMenu/ui/Adjuster.tsx","webpack:///./src/Bladeburner/BlackOperation.ts","webpack:///./src/Gang/ui/Context.ts","webpack:///./src/Corporation/ui/MoneyCost.tsx","webpack:///./src/Netscript/killWorkerScript.ts","webpack:///./src/ui/React/Snackbar.tsx","webpack:///./src/StockMarket/Stock.ts","webpack:///./src/Locations/Cities.ts","webpack:///./src/Augmentation/AugmentationHelpers.tsx","webpack:///./src/ui/React/StatsTable.tsx","webpack:///./src/Alias.ts","webpack:///./src/Literature/Literature.ts","webpack:///./src/Themes/ui/Theme.tsx","webpack:///./src/ui/React/CopyableText.tsx","webpack:///./src/PersonObjects/formulas/skill.ts","webpack:///./src/Gang/data/upgrades.ts","webpack:///./src/ui/React/LogBoxManager.tsx","webpack:///./src/Netscript/WorkerScripts.ts","webpack:///./src/Corporation/MaterialSizes.ts","webpack:///./src/Hacknet/formulas/HacknetServers.ts","webpack:///./src/Faction/FactionWorkTypeEnum.ts","webpack:///./src/utils/helpers/createProgressBarText.ts","webpack:///./src/NetscriptWorker.ts","webpack:///./src/Corporation/Material.ts","webpack:///./src/Gang/formulas/formulas.ts","webpack:///./src/ui/React/OptionSwitch.tsx","webpack:///./src/Faction/Faction.ts","webpack:///./src/Settings/SettingEnums.ts","webpack:///./src/Hacknet/formulas/HacknetNodes.ts","webpack:///./src/Casino/Game.tsx","webpack:///./src/CotMG/data/Shapes.ts","webpack:///./src/Infiltration/ui/KeyHandler.tsx","webpack:///./src/Infiltration/ui/GameTimer.tsx","webpack:///./src/Infiltration/ui/Difficulty.ts","webpack:///./src/Hacknet/HacknetNode.ts","webpack:///./src/Server/ServerPurchases.ts","webpack:///./src/TextFile.ts","webpack:///./src/Bladeburner/Skills.ts","webpack:///./src/Gang/GangMemberUpgrades.ts","webpack:///./src/StockMarket/StockMarketHelpers.ts","webpack:///./src/PersonObjects/Person.ts","webpack:///./src/BitNode/BitNode.tsx","webpack:///./src/Script/ScriptHelpers.ts","webpack:///./src/ui/React/Hashes.tsx","webpack:///./src/Bladeburner/Bladeburner.tsx","webpack:///./src/Company/Company.ts","webpack:///./src/Corporation/Warehouse.ts","webpack:///./src/Gang/GangMemberTasks.ts","webpack:///./src/Hacknet/HashUpgrades.ts","webpack:///./src/CotMG/Fragment.ts","webpack:///./src/PersonObjects/formulas/reputation.ts","webpack:///./src/StockMarket/BuyingAndSelling.tsx","webpack:///./src/Terminal/ITerminal.tsx","webpack:///./src/Bladeburner/Skill.ts","webpack:///./src/hash/hash.ts","webpack:///./src/Locations/Locations.ts","webpack:///./src/Script/Script.ts","webpack:///./src/utils/helpers/arrayToString.ts","webpack:///./src/Bladeburner/GeneralActions.tsx","webpack:///./src/Casino/CardDeck/Card.ts","webpack:///./src/Bladeburner/ActionIdentifier.ts","webpack:///./src/SourceFile/SourceFile.ts","webpack:///./src/Infiltration/utils.ts","webpack:///./src/MathJaxWrapper.tsx","webpack:///./src/utils/helpers/exceptionAlert.ts","webpack:///./src/Message/MessageHelpers.ts","webpack:///./src/Netscript/WorkerScript.ts","webpack:///./src/Bladeburner/BlackOperations.tsx","webpack:///./src/Crime/Crime.ts","webpack:///./src/ui/React/ConfirmationModal.tsx","webpack:///./src/PersonObjects/formulas/intelligence.ts","webpack:///./src/Corporation/ResearchMap.ts","webpack:///./src/DarkWeb/DarkWebItems.ts","webpack:///./src/StockMarket/StockMarketCosts.ts","webpack:///./src/Locations/ui/ApplyToJobButton.tsx","webpack:///./src/Netscript/WorkerScriptStartStopEventEmitter.ts","webpack:///./src/Electron.tsx","webpack:///./src/Achievements/Achievements.ts","webpack:///./src/Corporation/data/CorporationUnlockUpgrades.ts","webpack:///./src/RedPill.tsx","webpack:///./src/utils/helpers/addOffset.ts","webpack:///./src/Script/RamCalculationErrorCodes.ts","webpack:///./src/DarkWeb/DarkWebItem.ts","webpack:///./src/Augmentation/PlayerOwnedAugmentation.ts","webpack:///./src/utils/IPAddress.ts","webpack:///./src/utils/helpers/compareArrays.ts","webpack:///./src/Corporation/IndustryUpgrades.ts","webpack:///./src/ui/React/Favor.tsx","webpack:///./src/Gang/data/Constants.ts","webpack:///./src/PersonObjects/Sleeve/Sleeve.ts","webpack:///./src/Terminal/TerminalEvents.ts","webpack:///./src/Message/Message.ts","webpack:///./src/StockMarket/OrderProcessing.tsx","webpack:///./src/Themes/Themes.ts","webpack:///./src/Prestige.ts","webpack:///./src/db.tsx","webpack:///./src/ExportBonus.tsx","webpack:///./src/Bladeburner/Operation.ts","webpack:///./src/Gang/ui/GangMemberStats.tsx","webpack:///./src/Server/data/servers.ts","webpack:///./src/Company/CompanyPosition.ts","webpack:///./src/SourceFile/SourceFiles.tsx","webpack:///./src/Script/RunningScript.ts","webpack:///./src/Bladeburner/ui/StartButton.tsx","webpack:///./src/ui/React/CharacterOverview.tsx","webpack:///./src/Casino/RNG.ts","webpack:///./src/utils/helpers/formatTime.ts","webpack:///./src/Corporation/data/CorporationUpgrades.ts","webpack:///./src/Hacknet/HashManager.ts","webpack:///./src/CodingContractGenerator.ts","webpack:///./src/ui/InteractiveTutorial/ITutorialEvents.ts","webpack:///./src/Crime/CrimeHelpers.ts","webpack:///./src/Corporation/OfficeSpace.ts","webpack:///./src/utils/Validator.ts","webpack:///./src/utils/MoneySourceTracker.ts","webpack:///./src/Themes/Styles.ts","webpack:///./src/ui/React/AlertManager.tsx","webpack:///./src/Hospital/Hospital.ts","webpack:///./src/ui/React/PromptManager.tsx","webpack:///./src/Corporation/Product.ts","webpack:///./src/Programs/ui/ProgramsRoot.tsx","webpack:///./src/Faction/ui/FactionsRoot.tsx","webpack:///./src/ui/React/RecoveryRoot.tsx","webpack:///./src/Corporation/Corporation.tsx","webpack:///./src/ui/React/HashRate.tsx","webpack:///./src/Bladeburner/City.ts","webpack:///./src/PersonObjects/Player/PlayerObjectGangMethods.ts","webpack:///./src/Locations/City.ts","webpack:///./src/ui/React/StatsProgressBar.tsx","webpack:///./src/Faction/ui/Option.tsx","webpack:///./src/StockMarket/ui/StockTickersConfig.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectServerMethods.ts","webpack:///./src/Bladeburner/Action.tsx","webpack:///./src/ui/React/WorldMap.tsx","webpack:///./src/Bladeburner/ui/SuccessChance.tsx","webpack:///./src/ui/React/StaticModal.tsx","webpack:///./src/ui/React/CorruptableText.tsx","webpack:///./src/DarkWeb/DarkWeb.tsx","webpack:///./src/Faction/formulas/favor.ts","webpack:///./src/Hacking/netscriptCanHack.ts","webpack:///./src/ui/React/ReputationRate.tsx","webpack:///./src/Terminal/Parser.ts","webpack:///./src/PersonObjects/Sleeve/SleeveCovenantPurchases.tsx","webpack:///./src/Script/RamCalculations.ts","webpack:///./src/utils/helpers/roundToTwo.ts","webpack:///./src/NetworkShare/Share.tsx","webpack:///./src/Gang/Gang.ts","webpack:///./src/Netscript/Pid.ts","webpack:///./src/NetscriptFunctions.ts","webpack:///./src/StockMarket/PlayerInfluencing.ts","webpack:///./src/Programs/ProgramHelpers.ts","webpack:///./src/Company/GetJobRequirementText.ts","webpack:///./src/Terminal/HelpText.ts","webpack:///./src/ui/React/CinematicText.tsx","webpack:///./src/utils/ErrorHelper.ts","webpack:///./src/utils/helpers/getRandomByte.ts","webpack:///./src/Bladeburner/data/Growths.ts","webpack:///./src/Locations/createCityMap.ts","webpack:///./src/Casino/CardDeck/Hand.ts","webpack:///./src/StockMarket/ui/StockTickerTxButton.tsx","webpack:///./src/Server/BaseServer.ts","webpack:///./src/ui/React/CodingContractModal.tsx","webpack:///./src/BitNode/ui/BitFlumeModal.tsx","webpack:///./src/PersonObjects/Player/PlayerObject.ts","webpack:///./src/Faction/FactionInfo.tsx","webpack:///./src/Faction/ui/InvitationModal.tsx","webpack:///./src/Literature/LiteratureHelpers.ts","webpack:///./src/Gang/GangMemberTask.ts","webpack:///./src/SourceFile/PlayerOwnedSourceFile.ts","webpack:///./src/Netscript/RecentScripts.ts","webpack:///./src/ThirdParty/JSInterpreter.js","webpack:///./src/Server/formulas/grow.ts","webpack:///./src/PersonObjects/Sleeve/SleeveHelpers.ts","webpack:///./src/CotMG/StaneksGiftEvents.ts","webpack:///./src/Terminal/commands/download.ts","webpack:///./src/ui/React/AugmentationAccordion.tsx","webpack:///./src/Bladeburner/data/Icons.tsx","webpack:///./src/Bladeburner/ui/ActionLevel.tsx","webpack:///./src/Bladeburner/ui/Autolevel.tsx","webpack:///./src/Bladeburner/ui/TeamSizeButton.tsx","webpack:///./src/Infiltration/ui/BlinkingCursor.tsx","webpack:///./src/PersonObjects/Resleeving/Resleeving.ts","webpack:///./src/ui/React/DeleteGameButton.tsx","webpack:///./src/ui/React/SoftResetButton.tsx","webpack:///./src/Themes/ui/ThemeEditorButton.tsx","webpack:///./src/Themes/ui/ThemeCollaborate.tsx","webpack:///./src/Themes/ui/StyleEditorButton.tsx","webpack:///./src/Locations/ui/TravelAgencyRoot.tsx","webpack:///./src/ScriptEditor/ui/ScriptEditorRoot.tsx","webpack:///./src/NetscriptJSEvaluator.ts","webpack:///./src/NetscriptFunctions/Flags.ts","webpack:///./src/NetscriptFunctions/toNative.ts","webpack:///./src/ui/React/TablePaginationActionsAll.tsx","webpack:///./src/CotMG/ui/Cell.tsx","webpack:///./src/Script/RunningScriptHelpers.ts","webpack:///./src/Terminal/commands/common/editor.ts","webpack:///./src/PersonObjects/Player/PlayerObjectBladeburnerMethods.ts","webpack:///./src/Bladeburner/Contract.ts","webpack:///./src/Bladeburner/data/Help.ts","webpack:///./src/PersonObjects/Player/PlayerObjectCorporationMethods.ts","webpack:///./src/Corporation/ResearchTree.ts","webpack:///./src/StockMarket/StockMarketConstants.ts","webpack:///./src/Company/GetNextCompanyPosition.ts","webpack:///./src/engine.tsx","webpack:///./src/Themes/data/index.ts","webpack:///./src/ui/LoadingScreen.tsx","webpack:///./src/utils/helpers/isValidNumber.ts","webpack:///./src/StockMarket/Order.ts","webpack:///./src/CotMG/StaneksGift.ts","webpack:///./src/CotMG/ActiveFragment.ts","webpack:///./src/Locations/Location.ts","webpack:///./src/ui/React/ServerDropdown.tsx","webpack:///./src/Casino/Blackjack.tsx","webpack:///./src/Casino/CardDeck/ReactCard.tsx","webpack:///./src/Milestones/Milestones.ts","webpack:///./src/Faction/formulas/donation.ts","webpack:///./src/StockMarket/data/TickerHeaderFormatData.ts","webpack:///./src/Achievements/AchievementEntry.tsx","webpack:///./src/ThirdParty/colorUtils.ts","webpack:///./src/PersonObjects/formulas/work.ts","webpack:///./src/Themes/data/default/index.ts","webpack:///./src/Themes/data/default-lite/index.ts","webpack:///./src/Themes/data/monokai-ish/index.ts","webpack:///./src/Themes/data/warmer/index.ts","webpack:///./src/Themes/data/dark-plus/index.ts","webpack:///./src/Themes/data/mayukai-dark/index.ts","webpack:///./src/Themes/data/purple/index.ts","webpack:///./src/Themes/data/smooth-green/index.ts","webpack:///./src/Themes/data/dracula/index.ts","webpack:///./src/Themes/data/dark-blue/index.ts","webpack:///./src/Themes/data/discord-like/index.ts","webpack:///./src/Themes/data/one-dark/index.ts","webpack:///./src/Themes/data/muted-gold-blue/index.ts","webpack:///./src/Themes/data/light/index.ts","webpack:///./src/Themes/data/default/screenshot.png","webpack:///./src/Themes/data/default-lite/screenshot.png","webpack:///./src/Themes/data/monokai-ish/screenshot.png","webpack:///./src/Themes/data/warmer/screenshot.png","webpack:///./src/Themes/data/dark-plus/screenshot.png","webpack:///./src/Themes/data/mayukai-dark/screenshot.png","webpack:///./src/Themes/data/purple/screenshot.png","webpack:///./src/Themes/data/smooth-green/screenshot.png","webpack:///./src/Themes/data/dracula/screenshot.png","webpack:///./src/Themes/data/dark-blue/screenshot.png","webpack:///./src/Themes/data/discord-like/screenshot.png","webpack:///./src/Themes/data/one-dark/screenshot.png","webpack:///./src/Themes/data/muted-gold-blue/screenshot.png","webpack:///./src/Themes/data/light/screenshot.png","webpack:///./src/Terminal/Terminal.ts","webpack:///./src/data/codingcontracttypes.ts","webpack:///./src/utils/helpers/createRandomString.ts","webpack:///./src/Programs/Program.ts","webpack:///./src/Programs/data/ProgramsMetadata.ts","webpack:///./src/utils/helpers/isValidIPAddress.ts","webpack:///./src/PersonObjects/Player/PlayerObjectAugmentationMethods.ts","webpack:///./src/utils/helpers/getTimestamp.ts","webpack:///./src/NetworkShare/formulas/share.tsx","webpack:///./src/Corporation/CorporationState.ts","webpack:///./src/Literature/Literatures.ts","webpack:///./src/Gang/data/tasks.ts","webpack:///./src/Gang/GangMember.ts","webpack:///./src/Gang/GangMemberUpgrade.ts","webpack:///./src/Gang/data/power.ts","webpack:///./src/Company/data/CompaniesMetadata.ts","webpack:///./src/Corporation/Research.ts","webpack:///./src/Corporation/data/ResearchMetadata.ts","webpack:///./src/Hacknet/HashUpgrade.ts","webpack:///./src/Hacknet/data/HashUpgradesMetadata.tsx","webpack:///./src/Netscript/Environment.ts","webpack:///./src/utils/helpers/isPowerOfTwo.ts","webpack:///./src/StockMarket/data/InitStockMetadata.ts","webpack:///./src/NetscriptFunctions/Gang.ts","webpack:///./src/NetscriptFunctions/Sleeve.ts","webpack:///./src/NetscriptFunctions/Extra.ts","webpack:///./src/NetscriptFunctions/Hacknet.ts","webpack:///./src/NetscriptFunctions/Stanek.ts","webpack:///./src/CotMG/formulas/effect.ts","webpack:///./src/CotMG/data/Constants.ts","webpack:///./src/NetscriptFunctions/UserInterface.ts","webpack:///./src/NetscriptFunctions/Bladeburner.ts","webpack:///./src/NetscriptFunctions/CodingContract.ts","webpack:///./src/utils/helpers/is2DArray.ts","webpack:///./src/NetscriptFunctions/Corporation.ts","webpack:///./src/Corporation/Industry.ts","webpack:///./src/utils/calculateEffectWithFactors.ts","webpack:///./src/Corporation/Employee.ts","webpack:///./src/Corporation/ProductRatingWeights.ts","webpack:///./src/NetscriptFunctions/Formulas.ts","webpack:///./src/NetscriptFunctions/StockMarket.ts","webpack:///./src/NetscriptFunctions/Singularity.ts","webpack:///./src/Company/data/CompanyPositionsMetadata.ts","webpack:///./src/utils/v1APIBreak.ts","webpack:///./src/Locations/data/LocationsMetadata.ts","webpack:///./src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx","webpack:///./src/ui/React/Overview.tsx","webpack:///./src/Sidebar/ui/SidebarRoot.tsx","webpack:///./src/Augmentation/ui/AugmentationsRoot.tsx","webpack:///./src/Augmentation/ui/InstalledAugmentations.tsx","webpack:///./src/Augmentation/ui/PlayerMultipliers.tsx","webpack:///./src/Augmentation/ui/PurchasedAugmentations.tsx","webpack:///./src/Augmentation/ui/SourceFiles.tsx","webpack:///./src/Augmentation/ui/SourceFileMinus1.tsx","webpack:///./src/Augmentation/ui/OwnedSourceFiles.tsx","webpack:///./src/ui/React/SourceFileAccordion.tsx","webpack:///./src/DevMenu.tsx","webpack:///./src/DevMenu/ui/General.tsx","webpack:///./src/DevMenu/ui/Stats.tsx","webpack:///./src/DevMenu/ui/Factions.tsx","webpack:///./src/DevMenu/ui/Augmentations.tsx","webpack:///./src/DevMenu/ui/SourceFiles.tsx","webpack:///./src/DevMenu/ui/Programs.tsx","webpack:///./src/DevMenu/ui/Servers.tsx","webpack:///./src/DevMenu/ui/Companies.tsx","webpack:///./src/DevMenu/ui/Bladeburner.tsx","webpack:///./src/DevMenu/ui/Gang.tsx","webpack:///./src/DevMenu/ui/Corporation.tsx","webpack:///./src/DevMenu/ui/CodingContracts.tsx","webpack:///./src/DevMenu/ui/StockMarket.tsx","webpack:///./src/DevMenu/ui/Sleeves.tsx","webpack:///./src/DevMenu/ui/Stanek.tsx","webpack:///./src/DevMenu/ui/TimeSkip.tsx","webpack:///./src/DevMenu/ui/Achievements.tsx","webpack:///./src/Bladeburner/ui/BladeburnerRoot.tsx","webpack:///./src/Bladeburner/ui/Stats.tsx","webpack:///./src/Bladeburner/ui/TravelModal.tsx","webpack:///./src/Bladeburner/ui/Console.tsx","webpack:///./src/Bladeburner/ui/AllPages.tsx","webpack:///./src/Bladeburner/ui/GeneralActionPage.tsx","webpack:///./src/Bladeburner/ui/GeneralActionList.tsx","webpack:///./src/Bladeburner/ui/GeneralActionElem.tsx","webpack:///./src/Bladeburner/data/GeneralActions.tsx","webpack:///./src/Bladeburner/ui/ContractPage.tsx","webpack:///./src/Bladeburner/ui/ContractList.tsx","webpack:///./src/Bladeburner/ui/ContractElem.tsx","webpack:///./src/Bladeburner/data/Contracts.tsx","webpack:///./src/Bladeburner/ui/StealthIcon.tsx","webpack:///./src/Bladeburner/ui/KillIcon.tsx","webpack:///./src/Bladeburner/ui/OperationPage.tsx","webpack:///./src/Bladeburner/ui/OperationList.tsx","webpack:///./src/Bladeburner/ui/OperationElem.tsx","webpack:///./src/Bladeburner/ui/TeamSizeModal.tsx","webpack:///./src/Bladeburner/data/Operations.tsx","webpack:///./src/Bladeburner/ui/BlackOpPage.tsx","webpack:///./src/Bladeburner/ui/BlackOpList.tsx","webpack:///./src/Bladeburner/ui/BlackOpElem.tsx","webpack:///./src/Bladeburner/data/BlackOperations.tsx","webpack:///./src/Bladeburner/ui/SkillPage.tsx","webpack:///./src/Bladeburner/ui/SkillList.tsx","webpack:///./src/Bladeburner/ui/SkillElem.tsx","webpack:///./src/Gang/ui/GangRoot.tsx","webpack:///./src/Gang/ui/ManagementSubpage.tsx","webpack:///./src/Gang/ui/GangStats.tsx","webpack:///./src/Gang/ui/BonusTime.tsx","webpack:///./src/Gang/ui/GangMemberList.tsx","webpack:///./src/Gang/ui/GangMemberCard.tsx","webpack:///./src/Gang/ui/GangMemberCardContent.tsx","webpack:///./src/ui/React/KillScriptsModal.tsx","webpack:///./src/Gang/ui/TaskSelector.tsx","webpack:///./src/Gang/ui/TaskDescription.tsx","webpack:///./src/Gang/ui/AscensionModal.tsx","webpack:///./src/Gang/ui/RecruitButton.tsx","webpack:///./src/Gang/ui/RecruitModal.tsx","webpack:///./src/Gang/ui/TerritorySubpage.tsx","webpack:///./src/Gang/ui/EquipmentsSubpage.tsx","webpack:///./src/Corporation/ui/CorporationRoot.tsx","webpack:///./src/Corporation/ui/MainPanel.tsx","webpack:///./src/Corporation/ui/CityTabs.tsx","webpack:///./src/Corporation/ui/Industry.tsx","webpack:///./src/Corporation/ui/IndustryOffice.tsx","webpack:///./src/Corporation/ui/UpgradeOfficeSizeModal.tsx","webpack:///./src/Corporation/ui/ThrowPartyModal.tsx","webpack:///./src/Corporation/ui/IndustryOverview.tsx","webpack:///./src/Corporation/ui/MakeProductModal.tsx","webpack:///./src/Corporation/ui/ResearchModal.tsx","webpack:///./src/Corporation/ui/IndustryWarehouse.tsx","webpack:///./src/Corporation/ui/SmartSupplyModal.tsx","webpack:///./src/Corporation/ui/ProductElem.tsx","webpack:///./src/Corporation/ui/DiscontinueProductModal.tsx","webpack:///./src/Corporation/ui/LimitProductProductionModal.tsx","webpack:///./src/Corporation/ui/SellProductModal.tsx","webpack:///./src/Corporation/ui/ProductMarketTaModal.tsx","webpack:///./src/Corporation/ui/MaterialElem.tsx","webpack:///./src/Corporation/ui/ExportModal.tsx","webpack:///./src/Corporation/ui/MaterialMarketTaModal.tsx","webpack:///./src/Corporation/ui/SellMaterialModal.tsx","webpack:///./src/Corporation/ui/PurchaseMaterialModal.tsx","webpack:///./src/Corporation/ui/Helpers.tsx","webpack:///./src/Corporation/ui/IndustryProductEquation.tsx","webpack:///./src/Corporation/ui/ExpandNewCity.tsx","webpack:///./src/Corporation/ui/ExpandIndustryTab.tsx","webpack:///./src/Corporation/ui/Overview.tsx","webpack:///./src/Corporation/ui/LevelableUpgrade.tsx","webpack:///./src/Corporation/ui/UnlockUpgrade.tsx","webpack:///./src/Corporation/ui/BribeFactionModal.tsx","webpack:///./src/Corporation/ui/SellSharesModal.tsx","webpack:///./src/Corporation/ui/BuybackSharesModal.tsx","webpack:///./src/Corporation/ui/IssueDividendsModal.tsx","webpack:///./src/Corporation/ui/IssueNewSharesModal.tsx","webpack:///./src/Corporation/ui/FindInvestorsModal.tsx","webpack:///./src/Corporation/ui/GoPublicModal.tsx","webpack:///./src/Infiltration/ui/InfiltrationRoot.tsx","webpack:///./src/Infiltration/ui/Intro.tsx","webpack:///./src/Infiltration/ui/Game.tsx","webpack:///./src/Infiltration/ui/Countdown.tsx","webpack:///./src/Infiltration/ui/BracketGame.tsx","webpack:///./src/Infiltration/ui/SlashGame.tsx","webpack:///./src/Infiltration/ui/BackwardGame.tsx","webpack:///./src/Infiltration/ui/BribeGame.tsx","webpack:///./src/Infiltration/ui/CheatCodeGame.tsx","webpack:///./src/Infiltration/ui/Cyberpunk2077Game.tsx","webpack:///./src/Infiltration/ui/MinesweeperGame.tsx","webpack:///./src/Infiltration/ui/WireCuttingGame.tsx","webpack:///./src/Infiltration/ui/Victory.tsx","webpack:///./src/PersonObjects/Resleeving/ui/ResleeveRoot.tsx","webpack:///./src/PersonObjects/Resleeving/Resleeve.ts","webpack:///./src/PersonObjects/Resleeving/ui/ResleeveElem.tsx","webpack:///./src/ui/WorkInProgressRoot.tsx","webpack:///./src/ui/React/GameOptionsRoot.tsx","webpack:///./src/Diagnostic/FileDiagnosticModal.tsx","webpack:///./src/Themes/ui/ThemeEditorModal.tsx","webpack:///./src/Themes/ui/StyleEditorModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveElem.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveAugmentationsModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TravelModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/StatsElement.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreStatsModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreEarningsModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TaskSelector.tsx","webpack:///./src/PersonObjects/Sleeve/ui/FAQModal.tsx","webpack:///./src/Hacknet/ui/HacknetRoot.tsx","webpack:///./src/Hacknet/ui/GeneralInfo.tsx","webpack:///./src/Hacknet/ui/HacknetNodeElem.tsx","webpack:///./src/Hacknet/ui/HacknetServerElem.tsx","webpack:///./src/Hacknet/ui/HashUpgradeModal.tsx","webpack:///./src/Hacknet/ui/HacknetUpgradeElem.tsx","webpack:///./src/Hacknet/ui/MultiplierButtons.tsx","webpack:///./src/Hacknet/ui/PlayerInfo.tsx","webpack:///./src/Hacknet/ui/PurchaseButton.tsx","webpack:///./src/Locations/ui/GenericLocation.tsx","webpack:///./src/Locations/ui/CompanyLocation.tsx","webpack:///./src/Company/ui/QuitJobModal.tsx","webpack:///./src/Locations/ui/GymLocation.tsx","webpack:///./src/Locations/ui/HospitalLocation.tsx","webpack:///./src/Locations/ui/SlumsLocation.tsx","webpack:///./src/Locations/ui/SpecialLocation.tsx","webpack:///./src/Corporation/ui/CreateCorporationModal.tsx","webpack:///./src/utils/helpers/N00dles.ts","webpack:///./src/Locations/ui/TechVendorLocation.tsx","webpack:///./src/Locations/ui/RamButton.tsx","webpack:///./src/Locations/ui/TorButton.tsx","webpack:///./src/Locations/LocationsHelpers.tsx","webpack:///./src/Locations/ui/CoresButton.tsx","webpack:///./src/Locations/ui/PurchaseServerModal.tsx","webpack:///./src/Locations/ui/TravelConfirmationModal.tsx","webpack:///./src/Locations/ui/UniversityLocation.tsx","webpack:///./src/Locations/ui/CasinoLocation.tsx","webpack:///./src/Casino/CardDeck/Deck.ts","webpack:///./src/Casino/CoinFlip.tsx","webpack:///./src/Casino/Roulette.tsx","webpack:///./src/Casino/SlotMachine.tsx","webpack:///./src/Locations/ui/City.tsx","webpack:///./src/ScriptEditor/ui/OptionsModal.tsx","webpack:///./src/ScriptEditor/ui/themes.ts","webpack:///./src/ScriptEditor/NetscriptDefinitions.d.ts","webpack:///./src/Milestones/ui/MilestonesRoot.tsx","webpack:///./src/Terminal/ui/TerminalRoot.tsx","webpack:///./src/Terminal/ui/TerminalInput.tsx","webpack:///./src/Terminal/determineAllPossibilitiesForTabCompletion.ts","webpack:///./src/Terminal/DirectoryServerHelpers.ts","webpack:///./src/Script/ScriptUrl.ts","webpack:///./src/Terminal/tabCompletion.ts","webpack:///./src/Tutorial/ui/TutorialRoot.tsx","webpack:///./src/ui/ActiveScripts/ActiveScriptsRoot.tsx","webpack:///./src/ui/ActiveScripts/ActiveScriptsPage.tsx","webpack:///./src/ui/ActiveScripts/ScriptProduction.tsx","webpack:///./src/ui/ActiveScripts/ServerAccordions.tsx","webpack:///./src/ui/ActiveScripts/ServerAccordion.tsx","webpack:///./src/ui/ActiveScripts/ServerAccordionContent.tsx","webpack:///./src/ui/ActiveScripts/WorkerScriptAccordion.tsx","webpack:///./src/ui/ActiveScripts/RecentScriptsPage.tsx","webpack:///./src/ui/ActiveScripts/RecentScriptAccordion.tsx","webpack:///./src/Faction/ui/FactionRoot.tsx","webpack:///./src/Faction/ui/AugmentationsPage.tsx","webpack:///./src/Faction/ui/PurchaseableAugmentation.tsx","webpack:///./src/Faction/ui/PurchaseAugmentationModal.tsx","webpack:///./src/ui/React/Augmentation.tsx","webpack:///./src/Faction/ui/DonateOption.tsx","webpack:///./src/Faction/ui/Info.tsx","webpack:///./src/Faction/ui/CreateGangModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantSleeveMemoryUpgrade.tsx","webpack:///./src/ui/CharacterStats.tsx","webpack:///./src/StockMarket/ui/StockMarketRoot.tsx","webpack:///./src/StockMarket/ui/InfoAndPurchases.tsx","webpack:///./src/StockMarket/ui/StockTickers.tsx","webpack:///./src/StockMarket/ui/StockTicker.tsx","webpack:///./src/StockMarket/ui/StockTickerHeaderText.tsx","webpack:///./src/StockMarket/ui/StockTickerOrderList.tsx","webpack:///./src/StockMarket/ui/StockTickerOrder.tsx","webpack:///./src/StockMarket/ui/StockTickerPositionText.tsx","webpack:///./src/StockMarket/ui/PlaceOrderModal.tsx","webpack:///./src/BitNode/ui/BitverseRoot.tsx","webpack:///./src/BitNode/ui/PortalModal.tsx","webpack:///./src/ui/React/CinematicLine.tsx","webpack:///./src/CotMG/ui/StaneksGiftRoot.tsx","webpack:///./src/CotMG/ui/MainBoard.tsx","webpack:///./src/CotMG/ui/FragmentInspector.tsx","webpack:///./src/CotMG/ui/FragmentSelector.tsx","webpack:///./src/CotMG/ui/FragmentPreview.tsx","webpack:///./src/Bladeburner/ui/BladeburnerCinematic.tsx","webpack:///./src/Exploits/Unclickable.tsx","webpack:///./src/Achievements/AchievementsRoot.tsx","webpack:///./src/Achievements/AchievementList.tsx","webpack:///./src/Achievements/AchievementIcon.tsx","webpack:///./src/ui/ErrorBoundary.tsx","webpack:///./src/Themes/ui/ThemeBrowser.tsx","webpack:///./src/Themes/ui/ThemeEntry.tsx","webpack:///./src/ui/React/ImportSaveRoot.tsx","webpack:///./src/ui/React/BypassWrapper.tsx","webpack:///./src/NetscriptPort.ts","webpack:///./src/utils/helpers/clearObject.ts","webpack:///./src/SourceFile/applySourceFile.ts","webpack:///./src/Exploits/applyExploits.ts","webpack:///./src/Terminal/commands/alias.ts","webpack:///./src/Terminal/commands/analyze.ts","webpack:///./src/Terminal/commands/backdoor.ts","webpack:///./src/Terminal/commands/buy.ts","webpack:///./src/Terminal/commands/cat.ts","webpack:///./src/Terminal/commands/cd.ts","webpack:///./src/Terminal/commands/check.ts","webpack:///./src/Terminal/commands/connect.ts","webpack:///./src/Terminal/commands/cp.ts","webpack:///./src/Terminal/commands/expr.ts","webpack:///./src/Terminal/commands/free.ts","webpack:///./src/Terminal/commands/grow.ts","webpack:///./src/Terminal/commands/hack.ts","webpack:///./src/Terminal/commands/help.ts","webpack:///./src/Terminal/commands/history.ts","webpack:///./src/Terminal/commands/home.ts","webpack:///./src/Terminal/commands/hostname.ts","webpack:///./src/Terminal/commands/kill.ts","webpack:///./src/Terminal/commands/killall.ts","webpack:///./src/Terminal/commands/ls.tsx","webpack:///./src/Terminal/commands/lscpu.ts","webpack:///./src/Terminal/commands/mem.ts","webpack:///./src/Terminal/commands/mv.ts","webpack:///./src/Terminal/commands/nano.ts","webpack:///./src/ScriptEditor/CursorPositions.ts","webpack:///./src/Terminal/commands/ps.ts","webpack:///./src/Terminal/commands/rm.ts","webpack:///./src/Terminal/commands/run.ts","webpack:///./src/Terminal/commands/runScript.ts","webpack:///./src/Terminal/commands/runProgram.ts","webpack:///./src/Terminal/commands/scan.ts","webpack:///./src/Terminal/commands/scananalyze.ts","webpack:///./src/Terminal/commands/scp.ts","webpack:///./src/Terminal/commands/sudov.ts","webpack:///./src/Terminal/commands/tail.ts","webpack:///./src/Terminal/commands/top.ts","webpack:///./src/Terminal/commands/unalias.ts","webpack:///./src/Terminal/commands/vim.ts","webpack:///./src/Terminal/commands/weaken.ts","webpack:///./src/Terminal/commands/wget.ts","webpack:///./src/Exploits/loops.ts","webpack:///./src/UncaughtPromiseHandler.ts","webpack:///./src/index.tsx"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","0","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","Player","PlayerObject","loadPlayer","saveString","JSON","parse","Reviver","money","parseFloat","exploits","sanitizeExploits","extraFormats","extraNotations","gigaMultiplier","numeralWrapper","constructor","this","defaultLocale","updateLocale","numeral","locale","console","warn","format","Math","abs","answer","formatBigNumber","formatReallyBigNumber","decimalPlaces","Infinity","repeat","str","formatHp","formatMoney","formatSkill","formatExp","formatHashes","formatReputation","formatFavor","formatSecurity","toFixed","formatRAM","Settings","UseIEC60027_2","formatPercentage","formatter","formatServerSecurity","formatRespect","formatWanted","formatMultiplier","formatSleeveShock","formatSleeveSynchro","formatSleeveMemory","formatPopulation","formatStamina","formatShares","formatInfiltrationSecurity","formatThreads","formatStaneksGiftHeat","formatStaneksGiftCharge","formatStaneksGiftPower","parseMoney","numeralValue","parsed","isNaN","NaN","max","BitNodeMultipliers","HackingLevelMultiplier","StrengthLevelMultiplier","DefenseLevelMultiplier","DexterityLevelMultiplier","AgilityLevelMultiplier","CharismaLevelMultiplier","ServerGrowthRate","ServerMaxMoney","ServerStartingMoney","ServerStartingSecurity","ServerWeakenRate","HomeComputerRamCost","PurchasedServerCost","PurchasedServerSoftcap","PurchasedServerLimit","PurchasedServerMaxRam","CompanyWorkMoney","CrimeMoney","HacknetNodeMoney","ManualHackMoney","ScriptHackMoney","ScriptHackMoneyGain","CodingContractMoney","ClassGymExpGain","CompanyWorkExpGain","CrimeExpGain","FactionWorkExpGain","HackExpGain","FactionPassiveRepGain","FactionWorkRepGain","RepToDonateToFaction","AugmentationMoneyCost","AugmentationRepCost","InfiltrationMoney","InfiltrationRep","FourSigmaMarketDataCost","FourSigmaMarketDataApiCost","CorporationValuation","CorporationSoftCap","BladeburnerRank","BladeburnerSkillCost","GangSoftcap","DaedalusAugsRequirement","StaneksGiftPowerMultiplier","StaneksGiftExtraSize","WorldDaemonDifficulty","AugmentationNames","Targeting1","Targeting2","Targeting3","SyntheticHeart","SynfibrilMuscle","CombatRib1","CombatRib2","CombatRib3","NanofiberWeave","SubdermalArmor","WiredReflexes","GrapheneBoneLacings","BionicSpine","GrapheneBionicSpine","BionicLegs","GrapheneBionicLegs","SpeechProcessor","TITN41Injection","EnhancedSocialInteractionImplant","BitWire","ArtificialBioNeuralNetwork","ArtificialSynapticPotentiation","EnhancedMyelinSheathing","SynapticEnhancement","NeuralRetentionEnhancement","DataJack","ENM","ENMCore","ENMCoreV2","ENMCoreV3","ENMAnalyzeEngine","ENMDMA","Neuralstimulator","NeuralAccelerator","CranialSignalProcessorsG1","CranialSignalProcessorsG2","CranialSignalProcessorsG3","CranialSignalProcessorsG4","CranialSignalProcessorsG5","NeuronalDensification","NeuroreceptorManager","NuoptimalInjectorImplant","SpeechEnhancement","FocusWire","PCDNI","PCDNIOptimizer","PCDNINeuralNetwork","PCMatrix","ADRPheromone1","ADRPheromone2","ShadowsSimulacrum","HacknetNodeCPUUpload","HacknetNodeCacheUpload","HacknetNodeNICUpload","HacknetNodeKernelDNI","HacknetNodeCoreDNI","NeuroFluxGovernor","Neurotrainer1","Neurotrainer2","Neurotrainer3","Hypersight","LuminCloaking1","LuminCloaking2","HemoRecirculator","SmartSonar","PowerRecirculator","QLink","TheRedPill","SPTN97","HiveMind","CordiARCReactor","SmartJaw","Neotra","Xanipher","nextSENS","OmniTekInfoLoad","PhotosyntheticCells","Neurolink","TheBlackHand","UnstableCircadianModulator","CRTX42AA","Neuregen","CashRoot","NutriGen","INFRARet","DermaForce","GrapheneBrachiBlades","GrapheneBionicArms","BrachiBlades","BionicArms","SNA","HydroflameLeftArm","EsperEyewear","EMS4Recombination","OrionShoulder","HyperionV1","HyperionV2","GolemSerum","VangelisVirus","VangelisVirus3","INTERLINKED","BladeRunner","BladeArmor","BladeArmorPowerCells","BladeArmorEnergyShielding","BladeArmorUnibeam","BladeArmorOmnibeam","BladeArmorIPU","BladesSimulacrum","StaneksGift1","StaneksGift2","StaneksGift3","CONSTANTS","VersionString","VersionNumber","_idleSpeed","MaxSkillLevel","MilliPerCycle","CorpFactionRepRequirement","BaseCostFor1GBOfRamHome","BaseCostFor1GBOfRamServer","TravelCost","BaseFavorToDonate","DonateMoneyToRepDivisor","FactionReputationToFavorBase","FactionReputationToFavorMult","CompanyReputationToFavorBase","CompanyReputationToFavorMult","NeuroFluxGovernorLevelMult","NumNetscriptPorts","HomeComputerMaxRam","ServerBaseGrowthRate","ServerMaxGrowthRate","ServerFortifyAmount","ServerWeakenAmount","MultipleAugMultiplier","TorRouterCost","WSEAccountCost","TIXAPICost","MarketData4SCost","MarketDataTixApi4SCost","StockMarketCommission","HospitalCostPerHp","IntelligenceCrimeWeight","IntelligenceInfiltrationWeight","IntelligenceCrimeBaseExpGain","IntelligenceProgramBaseExpGain","IntelligenceTerminalHackBaseExpGain","IntelligenceSingFnBaseExpGain","IntelligenceClassBaseExpGain","MillisecondsPer20Hours","GameCyclesPer20Hours","MillisecondsPer10Hours","GameCyclesPer10Hours","MillisecondsPer8Hours","GameCyclesPer8Hours","MillisecondsPer4Hours","GameCyclesPer4Hours","MillisecondsPer2Hours","GameCyclesPer2Hours","MillisecondsPerHour","GameCyclesPerHour","MillisecondsPerHalfHour","GameCyclesPerHalfHour","MillisecondsPerQuarterHour","GameCyclesPerQuarterHour","MillisecondsPerFiveMinutes","GameCyclesPerFiveMinutes","BaseFocusBonus","FactionWorkHacking","FactionWorkField","FactionWorkSecurity","WorkTypeCompany","WorkTypeCompanyPartTime","WorkTypeFaction","WorkTypeCreateProgram","WorkTypeStudyClass","WorkTypeCrime","ClassStudyComputerScience","ClassDataStructures","ClassNetworks","ClassAlgorithms","ClassManagement","ClassLeadership","ClassGymStrength","ClassGymDefense","ClassGymDexterity","ClassGymAgility","ClassDataStructuresBaseCost","ClassNetworksBaseCost","ClassAlgorithmsBaseCost","ClassManagementBaseCost","ClassLeadershipBaseCost","ClassGymBaseCost","ClassStudyComputerScienceBaseExp","ClassDataStructuresBaseExp","ClassNetworksBaseExp","ClassAlgorithmsBaseExp","ClassManagementBaseExp","ClassLeadershipBaseExp","CrimeShoplift","CrimeRobStore","CrimeMug","CrimeLarceny","CrimeDrugs","CrimeBondForgery","CrimeTraffickArms","CrimeHomicide","CrimeGrandTheftAuto","CrimeKidnap","CrimeAssassination","CrimeHeist","CodingContractBaseFactionRepGain","CodingContractBaseCompanyRepGain","CodingContractBaseMoneyGain","TotalNumBitNodes","LatestUpdate","defaultSettings","ActiveScriptsServerPageSize","ActiveScriptsScriptPageSize","AutosaveInterval","CodeInstructionRunTime","DisableASCIIArt","DisableHotkeys","DisableTextEffects","DisableOverviewProgressBars","EnableBashHotkeys","TimestampsFormat","Locale","MaxLogCapacity","MaxPortCapacity","MaxTerminalCapacity","SaveGameOnFileSave","SuppressBuyAugmentationConfirmation","SuppressFactionInvites","SuppressMessages","SuppressTravelConfirmation","SuppressBladeburnerPopup","SuppressTIXPopup","SuppressSavedGameToast","ExcludeRunningScriptsFromSave","IsSidebarOpened","theme","defaultTheme","styles","defaultStyles","overview","x","y","opened","OwnedAugmentationsOrder","OwnedAugmentationsOrderSetting","AcquirementTime","PurchaseAugmentationsOrder","PurchaseAugmentationsOrderSetting","Default","MonacoTheme","MonacoInsertSpaces","MonacoFontSize","MonacoVim","MonacoWordWrap","init","assign","load","save","LocationName","RamCostConstants","ScriptBaseRamCost","ScriptDomRamCost","ScriptCorporationRamCost","ScriptHackRamCost","ScriptHackAnalyzeRamCost","ScriptGrowRamCost","ScriptGrowthAnalyzeRamCost","ScriptWeakenRamCost","ScriptWeakenAnalyzeRamCost","ScriptScanRamCost","ScriptPortProgramRamCost","ScriptRunRamCost","ScriptExecRamCost","ScriptSpawnRamCost","ScriptScpRamCost","ScriptKillRamCost","ScriptHasRootAccessRamCost","ScriptGetHostnameRamCost","ScriptGetHackingLevelRamCost","ScriptGetMultipliersRamCost","ScriptGetServerRamCost","ScriptGetServerMaxRam","ScriptGetServerUsedRam","ScriptFileExistsRamCost","ScriptIsRunningRamCost","ScriptHacknetNodesRamCost","ScriptHNUpgLevelRamCost","ScriptHNUpgRamRamCost","ScriptHNUpgCoreRamCost","ScriptGetStockRamCost","ScriptBuySellStockRamCost","ScriptGetPurchaseServerRamCost","ScriptPurchaseServerRamCost","ScriptGetPurchasedServerLimit","ScriptGetPurchasedServerMaxRam","ScriptRoundRamCost","ScriptReadWriteRamCost","ScriptArbScriptRamCost","ScriptGetScriptRamCost","ScriptGetRunningScriptRamCost","ScriptGetHackTimeRamCost","ScriptGetFavorToDonate","ScriptCodingContractBaseRamCost","ScriptSleeveBaseRamCost","ScriptGetOwnedSourceFiles","ScriptSingularityFn1RamCost","ScriptSingularityFn2RamCost","ScriptSingularityFn3RamCost","ScriptGangApiBaseRamCost","ScriptBladeburnerApiBaseRamCost","ScriptStanekCharge","ScriptStanekFragmentDefinitions","ScriptStanekPlacedFragments","ScriptStanekClear","ScriptStanekCanPlace","ScriptStanekPlace","ScriptStanekFragmentAt","ScriptStanekDeleteAt","SF4Cost","cost","player","bitNodeN","sf4","sourceFileLvl","RamCosts","hacknet","numNodes","purchaseNode","getPurchaseNodeCost","getNodeStats","upgradeLevel","upgradeRam","upgradeCore","upgradeCache","getLevelUpgradeCost","getRamUpgradeCost","getCoreUpgradeCost","getCacheUpgradeCost","numHashes","hashCost","spendHashes","sprintf","vsprintf","scan","hack","hackAnalyzeThreads","hackAnalyze","hackAnalyzeSecurity","hackAnalyzeChance","sleep","share","getSharePower","grow","growthAnalyze","growthAnalyzeSecurity","weaken","weakenAnalyze","print","printf","tprint","clearLog","disableLog","enableLog","isLogEnabled","getScriptLogs","nuke","brutessh","ftpcrack","relaysmtp","httpworm","sqlinject","run","exec","spawn","kill","killall","exit","scp","ls","ps","hasRootAccess","getIp","getHostname","getHackingLevel","getHackingMultipliers","getHacknetMultipliers","getBitNodeMultipliers","getServer","getServerMoneyAvailable","getServerSecurityLevel","getServerBaseSecurityLevel","getServerMinSecurityLevel","getServerRequiredHackingLevel","getServerMaxMoney","getServerGrowth","getServerNumPortsRequired","getServerRam","getServerMaxRam","getServerUsedRam","serverExists","fileExists","isRunning","stock","getSymbols","getPrice","getAskPrice","getBidPrice","getPosition","getMaxShares","getPurchaseCost","getSaleGain","buy","sell","short","sellShort","placeOrder","cancelOrder","getOrders","getVolatility","getForecast","purchase4SMarketData","purchase4SMarketDataTixApi","getPurchasedServerLimit","getPurchasedServerMaxRam","getPurchasedServerCost","purchaseServer","deleteServer","getPurchasedServers","write","tryWritePort","read","peek","clear","writePort","readPort","getPortHandle","rm","scriptRunning","scriptKill","getScriptName","getScriptRam","getHackTime","getGrowTime","getWeakenTime","getScriptIncome","getScriptExpGain","getRunningScript","nFormat","getTimeSinceLastAug","prompt","wget","getFavorToDonate","getPlayer","mv","getOwnedSourceFiles","universityCourse","gymWorkout","travelToCity","goToLocation","purchaseTor","purchaseProgram","getCurrentServer","connect","manualHack","installBackdoor","getStats","getCharacterInformation","hospitalize","isBusy","stopAction","upgradeHomeRam","upgradeHomeCores","getUpgradeHomeRamCost","getUpgradeHomeCoresCost","workForCompany","applyToCompany","getCompanyRep","getCompanyFavor","getCompanyFavorGain","checkFactionInvitations","joinFaction","workForFaction","getFactionRep","getFactionFavor","getFactionFavorGain","donateToFaction","createProgram","commitCrime","getCrimeChance","getCrimeStats","getOwnedAugmentations","getAugmentationsFromFaction","getAugmentationCost","getAugmentationPrereq","getAugmentationPrice","getAugmentationRepReq","getAugmentationStats","purchaseAugmentation","softReset","installAugmentations","isFocused","setFocus","gang","createGang","inGang","getMemberNames","getGangInformation","getOtherGangInformation","getMemberInformation","canRecruitMember","recruitMember","getTaskNames","getTaskStats","setMemberTask","getEquipmentNames","getEquipmentCost","getEquipmentType","getEquipmentStats","purchaseEquipment","ascendMember","getAscensionResult","setTerritoryWarfare","getChanceToWinClash","getBonusTime","bladeburner","getContractNames","getOperationNames","getBlackOpNames","getBlackOpRank","getGeneralActionNames","getSkillNames","startAction","stopBladeburnerAction","getCurrentAction","getActionTime","getActionEstimatedSuccessChance","getActionRepGain","getActionCountRemaining","getActionMaxLevel","getActionCurrentLevel","getActionAutolevel","setActionAutolevel","setActionLevel","getRank","getSkillPoints","getSkillLevel","getSkillUpgradeCost","upgradeSkill","getTeamSize","setTeamSize","getCityEstimatedPopulation","getCityCommunities","getCityChaos","getCity","switchCity","getStamina","joinBladeburnerFaction","joinBladeburnerDivision","codingcontract","attempt","getContractType","getData","getDescription","getNumTriesRemaining","sleeve","getNumSleeves","setToShockRecovery","setToSynchronize","setToCommitCrime","setToUniversityCourse","travel","setToCompanyWork","setToFactionWork","setToGymWorkout","getSleeveStats","getTask","getInformation","getSleeveAugmentations","getSleevePurchasableAugs","purchaseSleeveAug","stanek","charge","fragmentDefinitions","activeFragments","canPlace","place","remove","ui","getTheme","setTheme","resetTheme","getStyles","setStyles","resetStyles","getGameInfo","heart","break","getRamCost","args","curr","currType","dialogBoxCreate","txt","AlertEvents","emit","component","sx","dangerouslySetInnerHTML","__html","useStyles","makeStyles","createStyles","unbuyable","color","palette","action","disabled","colors","Money","props","classes","undefined","Error","canAfford","className","Augmentations","ctor","constructors","fromJSON","obj","validationData","validateObject","Generic_toJSON","ctorName","keys","index","Generic_fromJSON","AllServers","GetServer","server","isValidIPAddress","hostname","GetServerByHostname","ipserver","ip","GetServerByIP","GetAllServers","servers","DeleteServer","serverkey","ipExists","createUniqueRandomIp","createRandomIp","AddToAllServers","initForeignServers","homeComputer","networkLayers","propertiesToPatternMatch","toNumber","getRandomInt","min","metadata","serverMetadata","serverParams","numOpenPortsRequired","organizationName","maxRamExponent","maxRam","pow","prop","Server","filename","literature","messages","SpecialServers","WorldDaemon","requiredHackingSkill","networkLayer","linkNetworkLayers","network1","selectServer","server1","server2","serversOnNetwork","getRandomArrayItem","arr","floor","random","prestigeAllServers","member","loadAllServers","saveAllServers","excludeRunningScripts","TempAllServers","stringify","runningScripts","runningScriptObj","logs","convertTimeMsToTimeElapsedString","time","showMilli","totalSeconds","days","secondPerHours","secTruncDays","hours","secondPerMinute","secTruncHours","minutes","secTruncMinutes","milliTruncSec","res","longestCommonStart","strings","containsAllStrings","A","concat","sort","a1","a2","L","a","charAt","b","toUpperCase","substring","every","isString","formatNumber","num","numFractionDigits","toLocaleString","maximumFractionDigits","minimumFractionDigits","generateRandomString","chars","cyrb53","seed","h1","h2","ch","charCodeAt","imul","toString","CityName","Page","Factions","loadFactions","faction","getInfo","err","error","factionExists","initFactions","FactionInfos","resetFaction","Faction","newFactionObject","factionName","favor","AddToFactions","Context","React","createContext","Router","use","useContext","SoftwareCompanyPositions","ITCompanyPositions","SecurityEngineerCompanyPositions","NetworkEngineerCompanyPositions","BusinessCompanyPositions","SecurityCompanyPositions","AgentCompanyPositions","MiscCompanyPositions","SoftwareConsultantCompanyPositions","BusinessConsultantCompanyPositions","PartTimeCompanyPositions","lower","upper","AllCorporationStates","CorporationConstants","INITIALSHARES","SHARESPERPRICEUPDATE","IssueNewSharesCooldown","SellSharesCooldown","CyclesPerMarketCycle","CyclesPerIndustryStateCycle","SecsPerMarketCycle","Cities","WarehouseInitialCost","WarehouseInitialSize","WarehouseUpgradeBaseCost","OfficeInitialCost","OfficeInitialSize","OfficeUpgradeBaseCost","BribeThreshold","BribeToRepRatio","ProductProductionCostRatio","DividendMaxPercentage","EmployeeSalaryMultiplier","CyclesPerEmployeeRaise","EmployeeRaiseAmount","BaseMaxProducts","AllMaterials","FundingRoundShares","FundingRoundMultiplier","HacknetNodeConstants","MoneyGainPerLevel","BaseCost","LevelBaseCost","RamBaseCost","CoreBaseCost","PurchaseNextMult","UpgradeLevelMult","UpgradeRamMult","UpgradeCoreMult","MaxLevel","MaxRam","MaxCores","PurchaseMultipliers","x1","x5","x10","MAX","HacknetServerConstants","HashesPerLevel","CacheBaseCost","PurchaseMult","UpgradeCacheMult","MaxServers","MaxCache","Augmentation","params","info","moneyCost","repCost","prereqs","baseRepRequirement","baseCost","startingCost","isSpecial","level","hacking_mult","mults","strength_mult","defense_mult","dexterity_mult","agility_mult","charisma_mult","hacking_exp_mult","strength_exp_mult","defense_exp_mult","dexterity_exp_mult","agility_exp_mult","charisma_exp_mult","hacking_chance_mult","hacking_speed_mult","hacking_money_mult","hacking_grow_mult","company_rep_mult","faction_rep_mult","crime_money_mult","crime_success_mult","work_money_mult","hacknet_node_money_mult","hacknet_node_purchase_cost_mult","hacknet_node_ram_cost_mult","hacknet_node_core_cost_mult","hacknet_node_level_cost_mult","bladeburner_max_stamina_mult","bladeburner_stamina_gain_mult","bladeburner_analysis_mult","bladeburner_success_chance_mult","stats","programs","startingMoney","f","decimals","desc","join","generateStatsDescription","addToFactions","factionList","augmentations","addToAllFactions","fac","facObj","special","toJSON","ActionTypes","Idle","Contract","Operation","BlackOp","BlackOperation","Training","Recruitment","FieldAnalysis","Diplomacy","modal","display","alignItems","justifyContent","paper","backgroundColor","background","default","border","primary","main","boxShadow","dark","padding","maxWidth","maxHeight","overflow","scrollbarWidth","Modal","disableRestoreFocus","disableScrollLock","disableEnforceFocus","disableAutoFocus","open","onClose","closeAfterTransition","in","children","root","borderBottom","small","width","TableCell","Table","iTutorialSteps","ITutorial","currStep","Start","stepIsDone","GoToCharacterPage","CharacterPage","CharacterGoToTerminalPage","TerminalIntro","TerminalHelp","TerminalLs","TerminalScan","TerminalScanAnalyze1","TerminalScanAnalyze2","TerminalConnect","TerminalAnalyze","TerminalNuke","TerminalManualHack","TerminalHackingMechanics","TerminalGoHome","TerminalCreateScript","TerminalTypeScript","TerminalFree","TerminalRunScript","TerminalGoToActiveScriptsPage","ActiveScriptsPage","ActiveScriptsToTerminal","TerminalTailScript","GoToHacknetNodesPage","HacknetNodesIntroduction","HacknetNodesGoToWorldPage","WorldDescription","TutorialPageInfo","End","iTutorialStart","iTutorialNextStep","iTutorialEnd","ITutorialEvents","iTutorialPrevStep","getHomeComputer","LiteratureNames","HackersStartingHandbook","t_homeComp","safetlyCreateUniqueServer","adminRights","isConnectedTo","purchasedByPlayer","currentServer","Home","Programs","NukeProgram","prestigeAugmentation","numPeopleKilled","hacking","strength","defense","dexterity","agility","charisma","hacking_exp","strength_exp","defense_exp","dexterity_exp","agility_exp","charisma_exp","city","Sector12","location","TravelAgency","companyName","jobs","purchasedServers","factions","factionInvitations","queuedAugmentations","resleeves","numSleeves","SourceFileFlags","sleevesFromCovenant","sleeves","Sleeve","shock","synchronize","shockRecovery","isWorking","currentWorkFactionName","currentWorkFactionDescription","createProgramName","crimeType","workHackExpGainRate","workStrExpGainRate","workDefExpGainRate","workDexExpGainRate","workAgiExpGainRate","workChaExpGainRate","workRepGainRate","workMoneyGainRate","workHackExpGained","workStrExpGained","workDefExpGained","workDexExpGained","workAgiExpGained","workChaExpGained","workRepGained","workMoneyGained","timeWorked","lastUpdate","Date","getTime","playtimeSinceLastAug","scriptProdSinceLastAug","moneySourceA","reset","hacknetNodes","hashManager","prestige","reapplyAllAugmentations","hp","max_hp","prestigeSourceFile","karma","sync","resetGangs","hasWseAccount","hasTixApiAccess","has4SData","has4SDataTixApi","corporation","moneySourceB","playtimeSinceLastBitnode","receiveInvite","includes","calculateSkill","exp","mult","calculateSkillF","calculateSkillProgress","calculateSkillProgressF","updateSkillLevels","intelligence","intelligence_exp","ratio","round","resetMultipliers","hasProgram","programName","home","toLowerCase","setMoney","gainMoney","source","recordMoneySource","loseMoney","amt","MoneySourceTracker","record","gainHackingExp","gainStrengthExp","gainDefenseExp","gainDexterityExp","gainAgilityExp","gainCharismaExp","gainIntelligenceExp","queryStatFromString","tempStr","resetWorkStatus","generalType","group","workType","factionWorkType","singularityStopWork","workMoneyLossRate","timeWorkedCreateProgram","processWorkEarnings","numCycles","focusBonus","hasAugmentation","focus","hackExpGain","strExpGain","defExpGain","dexExpGain","agiExpGain","chaExpGain","moneyGain","startWork","getWorkHackExpGain","getWorkStrExpGain","getWorkDefExpGain","getWorkDexExpGain","getWorkAgiExpGain","getWorkChaExpGain","getWorkRepGain","getWorkMoneyGain","timeNeededToCompleteWork","process","router","toFaction","createProgramWork","toTerminal","takeClass","toCity","toLocation","Locations","Slums","workPartTime","work","cancelationPenalty","find","specialName","backdoorInstalled","overMax","comp","Companies","influenceStockThroughCompanyWork","finishWork","cancelled","sing","penaltyString","playerReputation","content","reputation","startWorkPartTime","finishWorkPartTime","startFocusing","stopFocusing","startFactionWork","favorMult","startFactionHackWork","getHackingWorkRepGain","startFactionFieldWork","getFactionFieldWorkRepGain","startFactionSecurityWork","getFactionSecurityWorkRepGain","finishFactionWork","bn11Mult","company","companyPositionName","companyPosition","CompanyPositions","baseSalary","salaryMultiplier","hackingExpGain","expMultiplier","strengthExpGain","defenseExpGain","dexterityExpGain","agilityExpGain","charismaExpGain","jobPerformance","calculateJobPerformance","startCreateProgramWork","reqLevel","createProgramReqLvl","programFile","startsWith","endsWith","split","percComplete","Number","reqLvl","skillMult","getIntelligenceBonus","finishCreateProgramWork","incompleteName","startClass","costMult","expMult","workCostMult","workExpMult","earnings","calculateClassEarnings","finishClass","startCrime","hackExp","strExp","defExp","dexExp","agiExp","chaExp","workerscript","committingCrimeThruSingFn","singFnCrimeWorkerScript","toWork","finishCrime","determineCrimeSuccess","crime","Crimes","type","kills","ws","disableLogs","ALL","scriptRef","log","takeDamage","regenerateHp","getHospitalizationCost","SnackbarEvents","applyForJob","entryPosType","currCompany","currPositionName","Company","pos","isQualified","reqText","getJobRequirementText","hasPosition","newPos","getNextCompanyPositionHelper","nextPos","getNextCompanyPosition","currentPositionName","currentPosition","isSoftwareJob","isITJob","isBusinessJob","isSecurityEngineerJob","isNetworkEngineerJob","isSecurityJob","isAgentJob","isSoftwareConsultantJob","isBusinessConsultantJob","isPartTimeJob","quitJob","hasJob","Boolean","applyForSoftwareJob","posNames","applyForSoftwareConsultantJob","applyForItJob","applyForSecurityEngineerJob","applyForNetworkEngineerJob","applyForBusinessJob","applyForBusinessConsultantJob","applyForSecurityJob","applyForAgentJob","applyForEmployeeJob","position","applyForPartTimeEmployeeJob","applyForWaiterJob","applyForPartTimeWaiterJob","offset","jobStatReqOffset","reqHacking","requiredHacking","reqStrength","requiredStrength","reqDefense","requiredDefense","reqDexterity","requiredDexterity","reqAgility","reqCharisma","requiredCharisma","requiredReputation","augName","aug","owned","applyAugmentation","reapplyAllSourceFiles","sourceFiles","srcFileKey","SourceFiles","applySourceFile","applyExploit","checkForFactionInvitations","invitedFactions","numAugmentations","allCompanies","allPositions","values","checkMegacorpRequirements","repNeeded","illuminatiFac","isBanned","isMember","alreadyInvited","daedalusFac","covenantFac","ecorpFac","AevumECorp","megacorpFac","Sector12MegaCorp","bachmanandassociatesFac","AevumBachmanAndAssociates","bladeindustriesFac","Sector12BladeIndustries","nwoFac","VolhavenNWO","clarkeincorporatedFac","AevumClarkeIncorporated","omnitekincorporatedFac","VolhavenOmniTekIncorporated","foursigmaFac","Sector12FourSigma","kuaigonginternationalFac","ChongqingKuaiGongInternational","fulcrumsecrettechonologiesFac","fulcrumSecretServer","FulcrumSecretTechnologies","AevumFulcrumTechnologies","bitrunnersFac","bitrunnersServer","BitRunnersServer","theblackhandFac","blackhandServer","TheBlackHandServer","nitesecFac","nitesecServer","NiteSecServer","chongqingFac","Chongqing","sector12Fac","newtokyoFac","NewTokyo","aevumFac","Aevum","ishimaFac","Ishima","volhavenFac","Volhaven","speakersforthedeadFac","Sector12CIA","Sector12NSA","thedarkarmyFac","thesyndicateFac","silhouetteFac","tetradsFac","slumsnakesFac","netburnersFac","totalHacknetRam","totalHacknetCores","totalHacknetLevels","v","hserver","HacknetServer","cores","ram","tiandihuiFac","cybersecFac","cybersecServer","CyberSecServer","setBitNodeNumber","queueAugmentation","PlayerOwnedAugmentation","gainCodingContractReward","reward","difficulty","CodingContractRewardType","FactionReputation","FactionReputationAll","repGain","totalGain","specialFactions","filter","gainPerFaction","facName","CompanyReputation","to","gotoLocation","canAccessResleeving","giveExploit","exploit","giveAchievement","achievementId","achievement","achievements","map","ID","unlockedOn","Name","weight","calculateIntelligenceBonus","getCasinoWinnings","casino","getMult","setMult","canAccessCotMG","sf","lvl","BaseServer","super","createRandomString","moneyAvailable","moneyMax","hackDifficulty","baseDifficulty","minDifficulty","serverGrowth","capDifficulty","changeMinimumSecurity","perc","changeMaximumMoney","aboveCap","fortify","Corporation","Division","useCorporation","useDivision","Industries","Energy","Utilities","Agriculture","Fishing","Mining","Food","Tobacco","Chemical","Pharmaceutical","Computer","Robotics","Software","Healthcare","RealEstate","IndustryStartingCosts","IndustryDescriptions","corp","IndustryResearchTrees","getBaseResearchTreeCopy","getProductIndustryResearchTreeCopy","resetIndustryResearchTrees","EmployeePositions","Operations","Engineer","Business","Management","RandD","Unassigned","LocationType","hasHacknetServers","purchaseHacknet","numOwned","getCostOfNextHacknetServer","createHacknetServer","updateHashManagerCapacity","getCostOfNextHacknetNode","node","HacknetNode","hasMaxNumberHacknetServers","calculateNodeCost","calculateServerCost","getMaxNumberLevelUpgrades","nodeObj","maxLevel","calculateLevelUpgradeCost","levelsToMax","getMaxNumberRamUpgrades","calculateRamUpgradeCost","log2","getMaxNumberCoreUpgrades","calculateCoreUpgradeCost","getMaxNumberCacheUpgrades","calculateCacheUpgradeCost","cache","purchaseLevelUpgrade","levels","sanitizedLevels","isServer","purchaseRamUpgrade","purchaseCoreUpgrade","purchaseCacheUpgrade","processHacknetEarnings","HashManager","hashes","updateHashRate","h","wastedHashes","storeHashes","upgrade","HashUpgrades","multiplier","processAllHacknetServerEarnings","total","processSingleHacknetNodeEarnings","processAllHacknetNodeEarnings","totalEarnings","nodes","updateCapacity","hashCapacity","purchaseHashUpgrade","upgName","upgTarget","upg","refundUpgrade","funds","target","e","division","divisions","sciResearch","qty","changeRank","skillPoints","generateRandomContract","BladeburnerConstants","CityNames","CyclesPerSecond","StaminaGainPerSecond","BaseStaminaLoss","MaxStaminaToGainFactor","DifficultyToTimeFactor","DiffMultExponentialFactor","DiffMultLinearFactor","EffAgiLinearFactor","EffDexLinearFactor","EffAgiExponentialFactor","EffDexExponentialFactor","BaseRecruitmentTimeNeeded","PopulationThreshold","PopulationExponent","ChaosThreshold","BaseStatGain","BaseIntGain","ActionCountGrowthPeriod","RankToFactionRepFactor","RankNeededForFaction","ContractSuccessesPerLevel","OperationSuccessesPerLevel","RanksPerSkillPoint","ContractBaseMoneyGain","HrcHpGain","HrcStaminaGain","CorporationManagementHandbook","HistoryOfSynthoids","AGreenTomorrow","AlphaOmega","SimulatedReality","BeyondMan","BrighterThanTheSun","DemocracyIsDead","Sector12Crime","ManAndMachine","SecretSocieties","TheFailedFrontier","CodedIntelligence","SyntheticMuscles","TensionsInTechRace","CostOfImmortality","TheHiddenWorld","TheNewGod","NewTriads","TheSecretWar","programsMetadata","Program","initCompanies","oldCompanies","companiesMetadata","forEach","loadCompanies","NewIndustry","industry","Industry","NewCity","offices","OfficeSpace","loc","size","UnlockUpgrade","unlock","LevelUpgrade","priceMult","upgrades","IssueDividends","percent","dividendPercentage","SellMaterial","mat","price","replace","temp","bCost","eval","sCost","q","tempQty","sllman","SellProduct","product","all","cities","tempCity","SetSmartSupply","warehouse","smartSupply","smartSupplyEnabled","SetSmartSupplyUseLeftovers","material","useLeftover","smartSupplyUseLeftovers","BuyMaterial","AssignJob","employee","job","UpgradeOfficeSize","office","initialPriceMult","ThrowParty","costPerEmployee","totalCost","employees","throwParty","PurchaseWarehouse","warehouses","Warehouse","UpgradeWarehouse","sizeUpgradeCost","updateSize","BuyCoffee","IndustryUpgrades","HireAdVert","MakeProduct","productName","designInvest","marketingInvest","Product","createCity","designCost","advCost","products","Research","researchName","researchTree","getAllNodes","research","ResearchMap","researched","ExportMaterial","divisionName","cityName","sanitizedAmt","exportObj","ind","CancelExportMaterial","LimitProductProduction","prdman","SetMaterialMarketTA1","on","marketTa1","SetMaterialMarketTA2","marketTa2","SetProductMarketTA1","SetProductMarketTA2","AllGangs","power","territory","Tetrads","NiteSec","loadAllGangs","PositionTypes","FragmentType","Effect","tpe","HackingChance","HackingSpeed","HackingMoney","HackingGrow","Hacking","Strength","Defense","Dexterity","Agility","Charisma","HacknetMoney","HacknetCost","Rep","WorkMoney","Crime","Bladeburner","SleeveTaskType","Array","updateSourceFileFlags","removeLeadingSlash","removeTrailingSlash","isValidFilename","match","isValidDirectoryName","isValidDirectoryPath","path","t_path","dirs","dir","isValidFilePath","fnSeparator","lastIndexOf","fn","getFirstParentDirectory","getAllParentDirectories","lastSlash","getDestinationFilepath","destination","cwd","dstDir","evaluateDirectoryPath","fileName","getFileName","isInRootDirectory","currPath","reconstructedPath","pop","evaluateFilePath","areFilesEqual","f0","f1","areImportsEquals","Shoplift","dexterity_success_weight","agility_success_weight","RobStore","hacking_success_weight","Mug","strength_success_weight","defense_success_weight","Larceny","DealDrugs","charisma_success_weight","BondForgery","TraffickArms","Homicide","GrandTheftAuto","Kidnap","Assassination","Heist","trusted","event","isTrusted","Terminal","TTerminal","updateHashCapacity","seconds","onlineTimeSeconds","hashRate","totalHashesGenerated","prodMult","cpuCores","runScript","script","updateRamUsed","calculateHashGainRate","ramUsed","companyPositionMetadata","CompanyPosition","StockSymbols","IshimaStormTechnologies","NewTokyoDefComm","VolhavenHeliosLabs","NewTokyoVitaLife","Sector12IcarusMicrosystems","Sector12UniversalEnergy","AevumAeroCorp","VolhavenOmniaCybersystems","ChongqingSolarisSpaceSystems","NewTokyoGlobalPharmaceuticals","IshimaNovaMedical","AevumWatchdogSecurity","VolhavenLexoCorp","AevumRhoConstruction","Sector12AlphaEnterprises","VolhavenSysCoreSecurities","VolhavenCompuTek","AevumNetLinkTechnologies","IshimaOmegaSoftware","Sector12FoodNStuff","Sector12JoesGuns","validScriptExtensions","isScriptFilename","some","ext","calculateHackingChance","difficultyMult","chance","calculateHackingExpGain","expGain","calculatePercentMoneyHacked","percentMoneyHacked","calculateHackingTime","skillFactor","calculateGrowTime","calculateWeakenTime","StockMarket","Orders","storedCycles","ticksUntilCycle","SymbolToStockMap","shares","workerScript","Stock","order","Order","symbol","orders","stk","processOrderRefs","stockMarket","symbolToStockMap","processOrders","stockOrders","stockSymbol","orderTxt","loadStockMarket","deleteStockMarket","initStockMarket","InitStockMetadata","TicksPerCycle","initSymbolToStockMap","cyclesPerStockUpdate","processStockPrices","timeNow","flipForecastForecast","stockMarketCycle","av","chc","otlkMag","cap","changePrice","OrderTypes","LimitBuy","Short","LimitSell","Long","StopBuy","StopSell","otlkMagChange","cycleForecast","cycleForecastForecast","shareTxUntilMovement","shareTxForMovement","initStockMarketFnForReact","eventEmitterForUiReset","EventEmitter","htmlLocation","margin","spacing","flexGrow","minHeight","boxSizing","page","allowRouting","toActiveScripts","toAugmentations","toBitVerse","toBladeburner","toStats","toCorporation","toCreateProgram","toDevMenu","toFactions","toGameOptions","toGang","toHacknetNodes","toInfiltration","toJob","toMilestones","toResleeves","toScriptEditor","toSleeves","toStockMarket","toTravel","toTutorial","toBladeburnerCinematic","toStaneksGift","toAchievements","toThemeBrowser","toImportSave","GameRoot","engine","terminal","files","vim","setEditorOptions","useState","setPage","RecoveryMode","Recovery","Work","determineStartPage","setRerender","setFaction","flume","setFlume","quick","setQuick","setLocation","Infiltration","Location","Job","cinematicText","setCinematicText","errorBoundaryKey","setErrorBoundaryKey","sidebarOpened","setSideBarOpened","importString","setImportString","importAutomatic","setImportAutomatic","ImportSave","allowRoutingCalls","setAllowRoutingCalls","rerender","old","killAllScripts","saveObject","saveGame","setTimeout","reload","useEffect","subscribe","ActiveScripts","Stats","CreateProgram","DevMenu","Options","Gang","Hacknet","Milestones","Resleeves","options","ScriptEditor","Sleeves","Tutorial","City","Travel","calculateAchievements","BitVerse","BladeburnerCinematic","StaneksGift","Achievements","ThemeBrowser","base64save","automatic","_functions","fnName","_wrap","func","scrollTo","mainPage","withSidebar","withPopups","bypassGame","enter","enterBitNode","staneksGift","workerScripts","reactivateTutorial","buyStockLong","buyStock","buyStockShort","shortStock","eventEmitterForReset","sellStockLong","sellStock","sellStockShort","export","onExport","exportGame","forceKill","exportGameFn","installAugmentationsFn","Provider","killScripts","flexDirection","onToggled","isOpened","KEY","CTRL","DOWNARROW","ENTER","ESC","TAB","UPARROW","B","C","D","E","F","G","H","I","J","K","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","TheDarkArmyServer","DaedalusServer","DarkWeb","BitburnerSaveObject","getSaveString","PlayerSave","AllServersSave","CompaniesSave","FactionsSave","AliasesSave","Aliases","GlobalAliasesSave","GlobalAliases","MessagesSave","Messages","StockMarketSave","SettingsSave","VersionSave","LastExportBonus","ExportBonus","StaneksGiftSave","AllGangsSave","btoa","unescape","encodeURIComponent","emitToastEvent","savedOn","lastSave","Promise","resolve","reject","then","saveData","playerIdentifier","identifier","getSaveFileName","pushGameSaved","catch","isRecovery","epochTime","now","bn","download","importGame","base64Save","getImportStringFromFile","file","reader","FileReader","promise","onload","readAsText","newSave","parsedSave","atob","trim","base64","importedPlayer","playerData","totalPlaytime","reduce","current","bitNode","bitNodeLevel","loadGame","navigator","userAgent","indexOf","setInterval","decodeURIComponent","escape","saveObj","loadStaneksGift","loadAliases","loadGlobalAliases","loadMessages","initMessages","ver","anyPlayer","positionName","companyPositions","changes","convert","code","change","scripts","v1APIBreak","nf","revenue","expenses","lastCycleRevenue","lastCycleExpenses","thisCycleRevenue","thisCycleExpenses","augmentation","evaluateVersionCompatibility","href","resets","createNewUpdateText","whiteSpace","paddingLeft","lineHeight","Blob","msSaveOrOpenBlob","document","createElement","url","URL","createObjectURL","body","appendChild","click","removeChild","revokeObjectURL","netscriptDelay","delayReject","delay","env","stopFlag","makeRuntimeRejectMsg","msg","scriptUrl","dependencies","RegExp","resolveNetscriptRequestedThreads","functionName","requestedThreads","threads","requestedThreadsAsInt","isScriptErrorMessage","MoneyRate","CodingContractType","gen","solver","diff","numTries","generate","CodingContractTypes","md","codingContractTypesMetadata","CodingContractResult","CodingContract","getDifficulty","getMaxNumTries","getType","isSolution","solution","Cancelled","onAttempt","val","Success","Failure","CodingContractEvent","rep","Reputation","Exploit","names","Bypass","EditSaveFile","PrototypeTampering","TimeCompression","Unclickable","UndocumentedFunctionCall","RealityAlteration","N00dles","YoureNotMeantToAccessThis","ExploitName","Set","inviteToFaction","InvitationEvent","factionInfo","enemy","enemies","hasAugmentationPrereqs","hasPrereqs","prereqAug","augmentationPriceMult","queuedAugmentation","getNextNeurofluxLevel","nextLevel","currLevel","processPassiveFactionRepGain","offersWork","getGangName","hRep","sRep","fRep","rate","makeNode","Node","text","createBaseResearchTreeNodes","rootNode","autoBrew","autoParty","autoDrugs","bulkPurchasing","cph4","drones","dronesAssembly","dronesTransport","goJuice","hrRecruitment","hrTraining","joywire","marketta1","marketta2","overclock","scAssemblers","stimu","addChild","baseResearchTree","ResearchTree","setRoot","upgradeFulcrum","upgradeCapacity1","upgradeCapacity2","upgradeDashboard","uuidv4","uuid","subscribers","sub","numCycleForGrowth","growth","ajdGrowthRate","serverGrowthPercentage","coreBonus","processSingleServerGrowth","calculateServerGrowth","oldMoneyAvailable","isValidNumber","usedCycles","ceil","prestigeHomeComputer","homeComp","hasBitflume","BitFlume","updateRamUsage","getServerOnNetwork","isBackdoorInstalled","SkillNames","BladesIntuition","Cloak","Marksman","WeaponProficiency","ShortCircuit","DigitalObserver","Tracer","Overclock","Reaper","EvasiveSystem","Datamancer","CybersEdge","HandsOfMidas","Hyperdrive","String","Adjuster","setValue","label","placeholder","add","subtract","tons","onChange","InputProps","startAdornment","title","onClick","style","transform","endAdornment","count","getActionTimePenalty","getChaosCompetencePenalty","getChaosDifficultyBonus","useGang","MoneyCost","killWorkerScript","rerenderUi","WorkerScript","stopAndCleanUpWorkerScript","RunningScript","killWorkerScriptByPid","pid","compareArrays","atExit","clearTimeout","killNetscriptDelay","runningScript","rs","ramUsage","delete","AddRecentScript","WorkerScriptStartStopEventEmitter","removeWorkerScript","snackbar","zIndex","logBoxBaseZIndex","alignSelf","SnackbarProvider","dense","maxSnack","anchorOrigin","horizontal","vertical","autoHideDuration","containerRoot","Snackbar","enqueueSnackbar","closeSnackbar","useSnackbar","variant","duration","id","severity","k","defaultConstructorParams","initPrice","marketCap","spreadPerc","range","divisor","lastPrice","playerShares","playerAvgPx","playerShortShares","playerAvgShortPx","otlkMagForecast","getAbsoluteForecast","totalSharesUnrounded","totalShares","maxShares","changeForecastForecast","newff","newPrice","changeAmt","increaseChance","getForecastIncreaseChance","influenceForecast","influenceForecastForecast","AddToAugmentations","initAugmentations","clearObject","randomBonuses","bonuses","description","randomNumber","WHRNG","step","getRandomBonus","UnstableCircadianModulatorParams","augmentationExists","RedPill","FTPCrackProgram","RelaySMTPProgram","BruteSSHProgram","DeepscanV1","AutoLink","resetAugmentation","newAugObject","reapply","augObj","ownedAug","augmentationList","nfgIndex","isRepeatableAug","StatsTable","rows","wide","MuiTable","row","elem","align","noWrap","printAliases","parseAliasDeclaration","dec","global","matches","addGlobalAlias","addAlias","getAlias","getGlobalAlias","removeAlias","substituteAliases","origCommand","commandArray","somethingSubstituted","depth","alias","Literature","ThemeEvents","refreshTheme","createTheme","combat","cha","int","backgroundprimary","backgroundsecondary","button","successlight","success","successdark","white","black","light","primarylight","primarydark","secondary","secondarylight","secondarydark","errorlight","errordark","infolight","infodark","warning","warninglight","warningdark","well","typography","fontFamily","textTransform","components","MuiInputBase","styleOverrides","input","userSelect","MuiInput","borderBottomColor","underline","MuiInputLabel","MuiButtonGroup","marginRight","MuiButton","borderRadius","MuiSelect","icon","defaultProps","MuiTextField","MuiTypography","MuiMenu","list","MuiMenuItem","MuiAccordionSummary","MuiAccordionDetails","MuiIconButton","MuiTooltip","tooltip","fontSize","disableInteractive","MuiSlider","valueLabel","MuiDrawer","paperAnchorDockedLeft","borderRight","welllight","MuiDivider","MuiFormControlLabel","MuiSwitch","switchBase","track","MuiPaper","MuiTablePagination","select","selectLabel","displayedRows","MuiTab","textColorPrimary","MuiAlert","standardSuccess","standardError","standardWarning","standardInfo","TTheme","injectFirst","CopyableText","setOpen","copyText","setSelectionRange","execCommand","calculateExp","skill","currentSkill","nextSkill","baseExperience","nextExperience","progress","currentExperience","remainingExperience","experience","UpgradeType","gangMemberUpgradesMetadata","def","upgType","Weapon","dex","agi","Armor","Vehicle","Rootkit","layerCounter","LogBoxEvents","LogBoxClearEvents","LogBoxManager","LogWindow","close","visibility","overflowY","overflowX","draggableRef","useRef","rootRef","setScript","container","minimized","setMinimized","updateLayer","full","maxLength","clearInterval","addEventListener","onResize","removeEventListener","debounce","isOnScreen","resetPosition","bounds","getBoundingClientRect","right","bottom","left","innerWidth","top","outerWidth","state","setState","handle","onDrag","clientX","clientY","innerHeight","ref","flexFlow","onMouseDown","cursor","has","findRunningScript","startWorkerScript","overflowWrap","height","line","Map","MaterialSizes","Water","Plants","Metal","Hardware","Chemicals","Drugs","Robots","AICores","startingLevel","extraLevels","totalMultiplier","startingRam","numUpgrades","currentRam","startingCores","currentCores","startingCache","currentCache","FactionWorkType","createProgressBarText","derived","totalTicks","bars","dashes","NetscriptPorts","NetscriptPort","prestigeWorkerScripts","port","startNetscript1Script","codeWithImports","codeLineOffset","running","importProcessingRes","ast","ecmaVersion","allowReserved","sourceType","generatedCode","hasImports","walksimple","ImportDeclaration","scriptName","getScript","scriptAst","specifiers","namespace","local","fnNames","fnDeclarations","FunctionDeclaration","fnsToImport","lineOffset","linesRemoved","processNetscript1Imports","interpreterInitialization","scope","NetscriptFunctions","entry","tempWrapper","fnArgs","pseudoToNative","cb","setProperty","createAsyncFunction","createNativeFunction","nativeToPseudo","interpreter","Interpreter","runInterpreter","more","errorMessage","parent","createAndAddWorkerScript","oneRamUsage","getRamUsageFromRunningScript","roundToTwo","arrayToString","generateNextPid","set","runningFn","wrap","propName","finally","vars","executeJSScript","SyntaxError","message","stack","startNetscript2Script","w","onlineExpGained","onlineMoneyMade","errorTextArray","errorMsg","updateOnlineScriptTimes","onlineRunningTime","loadAllRunningScripts","skipScriptLoad","markUpdated","scriptCalculateOfflineProduction","runScriptFromScript","caller","scriptname","isArray","arg","ramAvailable","hasAdminRights","Material","getMarkupLimit","qlt","mku","dmd","dmdR","cmp","cmpR","processMarket","priceChange","compChange","dmdChange","calculateWantedPenalty","respect","wantedLevel","calculateRespectGain","task","baseRespect","statWeight","hackWeight","strWeight","defWeight","dexWeight","agiWeight","chaWeight","territoryMult","territoryPenalty","respectMult","calculateWantedLevelGain","baseWanted","wanted","calc","calculateMoneyGain","baseMoney","calculateAscensionPointsGain","calculateAscensionMult","points","OptionSwitch","checked","control","gainFavor","getFavorGain","totalRep","favorToRep","repToFavor","calculateMoneyGainRate","startingCore","sanitizedCores","coreBaseCost","win","reachedLimit","reached","Game","_","Shapes","KeyHandler","press","onKeyDown","TimerProgress","withStyles","bar","transition","LinearProgress","GameTimer","setV","intervalId","onExpire","millis","item","xs","interpolate","settings","out","lerpD","lerp","Trivial","Normal","Hard","Impossible","updateMoneyGainRate","gain","moneyGainRatePerSecond","totalMoneyGenerated","minMax","getPurchaseServerCost","sanitizedRam","isPowerOfTwo","sign","getPurchaseServerMaxRam","getPurchaseServerLimit","clz32","newServ","purchaseRamForHomeComputer","TextFile","append","show","getTextFile","textFiles","createTextFile","Skills","Skill","costInc","successChanceAll","successChanceStealth","successChanceKill","successChanceOperation","successChanceContract","maxLvl","actionTime","effStr","effDef","effDex","effAgi","successChanceEstimate","stamina","GangMemberUpgrades","GangMemberUpgrade","getBuyTransactionCost","posType","getSellTransactionGain","processTransactionForecastMovement","firstShares","remainingShares","numIterations","forecastChange","forecastForecastChange","calculateBuyMaxAmount","isLong","remainingMoney","currPrice","createTaskTracker","Person","calculateStat","getFactionHackingWorkRepGain","updateStatLevels","BitNode","number","BitNodes","initBitNodeMultipliers","sf12Lvl","inc","timePassed","confidence","dataMap","serv","timesGrown","host","offlineRunningTime","offlineExpGained","timesWeakened","findRunningScriptByPid","Hashes","ActionIdentifier","general","contracts","ops","blackops","events","updateSkillMultipliers","calculateMaxStamina","maxStamina","getCurrentCity","calculateStaminaPenalty","canAttemptBlackOp","actionId","getActionObject","reqdRank","rank","nm","BlackOperations","isAvailable","actionTimeCurrent","actionTimeToComplete","resetAction","exceptionAlert","comms","testBlackOp","getRecruitmentTime","skillName","skills","executeConsoleCommands","commands","consoleHistory","arrayOfCommands","executeConsoleCommand","postToConsole","saveToLogs","consoleLogs","getTimestamp","clearConsole","bladeburnerFac","storeCycles","getActionIdFromTypeAndName","convertedType","convertedName","operations","executeStartConsoleCommand","GeneralActions","executeSkillConsoleCommand","skillNames","multKeys","skillMultipliers","currentLevel","pointCost","calculateCost","executeLogConsoleCommand","flag","logging","executeHelpConsoleCommand","ConsoleHelpText","helpList","helpText","executeAutomateConsoleCommand","variable","highLow","automateActionHigh","automateActionLow","automateThreshHigh","automateThreshLow","automateEnabled","parseCommandArguments","command","start","endQuote","substr","triggerMigration","sourceCityName","destCityName","destCity","sourceCity","rand","percentage","triggerPotentialMigration","randomEvent","chaos","gainActionStats","successMult","unweightedGain","unweightedIntGain","weights","getDiplomacyEffectiveness","getRecruitmentSuccessChance","teamSize","effCharisma","effCha","charismaFactor","resetSkillMultipliers","effHack","effInt","multiplierNames","multiplierName","getMultiplier","multiplierValue","completeOperation","teamCount","losses","teamLost","improvePopulationEstimateByPercentage","changePopulationByPercentage","changeEstEqually","nonZero","changeChaosByCount","changeChaosByPercentage","changePopulationByCount","estChange","estOffset","completeContract","improvePopulationEstimateByCount","completeAction","isOperation","difficultyMultiplier","rewardMultiplier","rewardFac","successes","setMaxLevel","rankGain","addOffset","failures","loss","damage","rankLoss","hpLoss","hpLost","calculateHospitalizationCost","numHosp","moneyLost","logLossText","autoLevel","teamLossMax","staminaGain","staminaBonus","eff","successChance","contract","growthF","Growths","operation","maxRank","favorBonus","rankNeededForSp","totalSkillPoints","gainedSkillPoints","processAction","actionTimeOverflow","calculateStaminaGainPerSecond","effAgility","maxStaminaBonus","oldMax","difficultyFac","decays","isStealth","isKill","op","randomEventCounter","getTypeAndNameFromActionId","types","getContractNamesNetscriptFn","getOperationNamesNetscriptFn","getBlackOpNamesNetscriptFn","getGeneralActionNamesNetscriptFn","getSkillNamesNetscriptFn","startActionNetscriptFn","errorLogText","canRunOp","getActionTimeNetscriptFn","actionObj","getActionEstimatedSuccessChanceNetscriptFn","getEstSuccessChance","recChance","getActionCountRemainingNetscriptFn","getSkillLevelNetscriptFn","getSkillUpgradeCostNetscriptFn","upgradeSkillNetscriptFn","getTeamSizeNetscriptFn","setTeamSizeNetscriptFn","sanitizedSize","joinBladeburnerFactionNetscriptFn","DefaultConstructorParams","isPlayerEmployed","isMegacorp","hasAgentPositions","hasBusinessConsultantPositions","hasBusinessPositions","hasEmployeePositions","hasITPositions","hasSecurityPositions","hasSoftwareConsultantPositions","hasSoftwarePositions","hasWaiterPositions","materials","unlockUpgrades","updateMaterialSizeUsed","sizeUsed","matName","getStorageMultiplier","GangMemberTasks","gangMemberTasksMetadata","GangMemberTask","isHacking","isCombat","HashUpgradesMetadata","HashUpgrade","Fragments","Fragment","shape","limit","fullAt","rotation","sy","mx","my","qx","qy","neighboors","candidates","coord","cells","candidate","cell","copy","FragmentById","fragment","Booster","NoneFragment","None","DeleteFragment","Delete","CalculateShareMult","opts","suppressDialog","totalPrice","origTotal","newTotal","rerenderFn","resultTxt","gains","netProfit","origCost","profit","Output","formatTime","RawOutput","raw","Link","TTimer","timeLeft","hash","__COMMIT_HASH__","constructLocation","asciiArt","LocationsMetadata","addLocation","globalModuleSequenceNumber","Script","otherScripts","moduleSequenceNumber","saveScript","formatCode","dependent","dependents","dependentScript","calculateRamUsage","ramUsageEntries","entries","imports","vals","actionNames","actionName","Action","Suit","Card","suit","formatValue","isRedSuit","Hearts","Diamonds","getStringRepresentation","SourceFile","bitnodeKey","bitnode","getArrow","MathJaxWrapper","version","src","lineNumber","sendMessage","forced","recvd","showMessage","serverHostname","other","addMessageToServer","checkForMessagesToSend","redPillFlag","jumper0","MessageFilenames","Jumper0","jumper1","Jumper1","jumper2","Jumper2","jumper3","Jumper3","jumper4","Jumper4","cybersecTest","CyberSecTest","nitesecTest","NiteSecTest","bitrunnersTest","BitRunnersTest","redpill","redpillOwned","flightName","Flight","AddToAllMessages","Message","nsFuncsGenerator","sanitizedPid","found","Environment","getScriptOnServer","shouldLog","commit","div","successRate","ConfirmationModal","confirmationText","onConfirm","additionalButton","researchMetadata","DarkWebItems","DarkWebItem","HTTPWormProgram","SQLInjectProgram","ServerProfiler","DeepscanV2","AutolinkProgram","FormulasProgram","Formulas","getStockMarket4SDataCost","getStockMarket4STixApiCost","ApplyToJobButton","getJobRequirementTooltip","initElectron","normalizeFileName","getFiles","deleteFile","removeFile","saveFile","Buffer","from","overwritten","writeToScriptFile","initWebserver","funcs","typesFn","toast","appNotifier","initAppNotifier","triggerSave","triggerGameExport","triggerScriptsExport","exportScripts","getSaveData","getSaveInfo","async","getImportDataFromString","pushSaveData","appSaveFns","initSaveFunctions","bridge","electronBridge","receive","send","initElectronBridge","pushGameReady","playtime","game","pushImportResult","wasImported","pushDisableRestore","achievementData","bitNodeFinishedState","wd","hasAccessToSF","knowsAboutBitverse","CYBERSEC","Icon","Condition","NITESEC","THE_BLACK_HAND","BITRUNNERS","DAEDALUS","THE_COVENANT","ILLUMINATI","Visible","MONEY_1Q","MONEY_M1B","Secret","INSTALL_1","INSTALL_100","QUEUE_40","HACKING_100000","COMBAT_3000","NEUROFLUX_255","NS2","FROZE","RUNNING_SCRIPTS_1000","DRAIN_SERVER","MAX_RAM","MAX_CORES","SCRIPTS_30","KARMA_1000000","STOCK_1q","DISCOUNT","SCRIPT_32GB","FIRST_HACKNET_NODE","MAX_HACKNET_NODE","HACKNET_NODE_10M","REPUTATION_10M","DONATION","TRAVEL","WORKOUT","TOR","hasTorRouter","HOSPITALIZED","hospitalization","GANG","FULL_GANG","members","GangConstants","MaximumGangMembers","GANG_TERRITORY","GANG_MEMBER_POWER","CORPORATION","CORPORATION_BRIBE","CORPORATION_PROD_1000","CORPORATION_EMPLOYEE_3000","CORPORATION_REAL_ESTATE","Description","INTELLIGENCE_255","BLADEBURNER_DIVISION","BLADEBURNER_OVERCLOCK","BLADEBURNER_UNSPENT_100000","FIRST_HACKNET_SERVER","AdditionalUnlock","ALL_HACKNET_SERVER","MAX_HACKNET_SERVER","hs","HACKNET_SERVER_1B","MAX_CACHE","capacity","SLEEVE_8","INDECISIVE","FAST_BN","CHALLENGE_BN1","CHALLENGE_BN2","CHALLENGE_BN3","CHALLENGE_BN6","CHALLENGE_BN7","CHALLENGE_BN8","CHALLENGE_BN9","hacknet_expenses","CHALLENGE_BN10","CHALLENGE_BN12","BYPASS","PROTOTYPETAMPERING","UNCLICKABLE","UNDOCUMENTEDFUNCTIONCALL","TIMECOMPRESSION","REALITYALTERATION","N00DLES","EDITSAVEFILE","UNACHIEVABLE","CHALLENGE_BN13","DEVMENU","playerAchievements","missingAchievements","flatMap","CorporationUnlockUpgrades","setRedPillFlag","destroyedBitNode","newBitNode","bitNodeNumber","sourceFileKey","sourceFile","alreadyOwned","ownedSourceFile","playerSrcFile","PlayerOwnedSourceFile","giveSourceFile","midpoint","RamCalculationErrorCode","program","getRandomByte","Favor","GangRespectToReputationRatio","CyclesPerTerritoryAndPowerUpdate","AscensionMultiplierRatio","Names","crimeKey","currentTask","finishTask","resetTaskStatus","gainRatesForTask","currentTaskLocation","currentTaskMaxTime","retValue","currentTaskTime","successGainRates","keysForIteration","gainExperience","fromOtherSleeve","multFac","pHackExp","pStrExp","pDefExp","pDexExp","pAgiExp","pChaExp","earningsForPlayer","earningsForTask","earningsForSleeves","getMemoryUpgradeCost","memory","currCost","currMemory","getRepGain","Field","Security","installAugmentation","cyclesUsed","Class","Gym","updateTaskGainRates","Synchro","gymStatType","takeUniversityCourse","universityName","AevumSummitUniversity","Sector12RothmanUniversity","VolhavenZBInstituteOfTechnology","newCity","tryBuyAugmentation","AevumCrushFitnessGym","AevumSnapFitnessGym","Sector12IronGym","Sector12PowerhouseGym","VolhavenMilleniumFitnessGym","baseGymExp","totalExpMultiplier","getTrainingMult","sanitizedStat","totalExpMult","getStudyMult","upgradeMemory","sanitizedWorkType","offerHackingWork","offerFieldWork","offerSecurityWork","workoutAtGym","gymName","stat","TerminalEvents","TerminalClearEvents","orderType","refs","orderBook","executeOrder","isBuy","predefined","getPredefinedThemes","maintainMembership","keep","finishAction","penalty","hack_asc_points","str_asc_points","def_asc_points","dex_asc_points","agi_asc_points","cha_asc_points","resetPidCounter","ProgramsSeen","InvitationsSeen","setMaxRam","getDB","indexedDB","indexedDbRequest","onupgradeneeded","createObjectStore","onerror","ev","onsuccess","db","transaction","objectStore","request","put","deleteGame","canGetBonus","setLastExportBonus","unixTime","getTeamSuccessBonus","inst","getActionTypeSkillSuccessBonus","generateTableRow","cellNone","GangMemberStats","asc","earnedRespect","hack_mult","str_mult","def_mult","dex_mult","agi_mult","cha_mult","mb","hack_exp","str_exp","def_exp","dex_exp","agi_exp","cha_exp","AevumGalacticCybersystems","Sector12DeltaOne","AevumPolice","NewTokyoNoodleBar","nextPosition","repMultiplier","reqdHacking","reqdStrength","reqdDefense","reqdDexterity","requiredAgility","reqdAgility","reqdCharisma","reqdReputation","hackingEffectiveness","strengthEffectiveness","defenseEffectiveness","dexterityEffectiveness","agilityEffectiveness","charismaEffectiveness","hackRatio","strRatio","defRatio","dexRatio","agiRatio","chaRatio","reputationGain","logEntry","logUpd","displayLog","recordHack","moneyGained","recordGrow","recordWeaken","StartButton","Intelligence","colSpan","WorkInProgressOverview","onClickFocus","header","workCell","workHeader","pt","pb","workSubtitles","mt","details","innerText","textAlign","CharacterOverview","killOpen","setKillOpen","useTheme","hackingProgress","strengthProgress","defenseProgress","dexterityProgress","agilityProgress","charismaProgress","borderTop","flex","aria-label","BadRNG","s1","s2","s3","fmt","CorporationUpgrades","getUpgrade","getUpgradeCost","getCost","newCap","problemType","getRandomProblemType","getRandomReward","randServer","getRandomServer","contractFn","getRandomFilename","addContract","generateRandomContractOnHome","generateContract","problemTypes","rewardType","factionsThatAllowHacking","sanitizeRewardType","numFactions","randFaction","allJobs","randIndex","findCrime","roughName","atCapacity","marketCycles","hasResearch","emp","hireRandomEmployee","maxEne","maxHap","maxMor","perfMult","hasAutobrew","hasAutoparty","salaryPaid","mor","hap","ene","calculateEmployeeProductivity","employeeProd","prod","calculateProductivity","getElementById","cre","sal","Employee","creativity","efficiency","salary","assignEmployeeToJob","unassignEmployeeFromJob","setEmployeeToJob","amount","unassignedCount","jobCount","validator","paramValidator","sanitizedSource","AlertManager","alerts","setAlerts","sha256","getMessageHash","oldhp","PromptEvent","PromptManager","setPrompt","paddingTop","createCityMap","demand","competition","markup","quality","per","performance","dur","durability","rel","reliability","aes","aesthetics","fea","features","siz","reqMats","req","createProduct","empWorkMult","fin","prog","finishProduct","progrMult","engrRatio","mgmtRatio","rndRatio","opsRatio","busRatio","totalMult","sciFac","calculateRating","advMult","busmgtgRatio","isFinite","awareness","popularity","reqMat","ProductRatingWeights","rat","Quality","Performance","Durability","Reliability","Aesthetics","Features","ProgramsRoot","getAvailableCreatePrograms","FactionsRoot","disableGutters","ml","openFaction","acceptInvitation","ActivateRecoveryMode","RecoveryRoot","errorData","resetError","issueUrl","newIssueUrl","startIcon","onTriggered","px","multiline","fullWidth","CorporationState","numUnlockUpgrades","fill","upgradeMultipliers","addFunds","getState","gameCycles","shareSaleCooldown","issueNewSharesCooldown","cycleProfit","retainedEarnings","getDividends","updateSharePrice","nextState","dividendsPerShare","dividends","numShares","determineValuation","public","getTargetSharePrice","targetPrice","sharePrice","immediatelyUpdateSharePrice","calculateShareSale","sharesTracker","sharesUntilUpdate","shareSalesUntilPriceUpdate","sharesSold","maxIterations","convertCooldownToString","cd","upgN","dividendTaxPercentage","basePrice","upgradeAmt","getProductionMultiplier","getDreamSenseGain","getAdvertisingMultiplier","getEmployeeCreMultiplier","getEmployeeChaMultiplier","getEmployeeIntMultiplier","getEmployeeEffMultiplier","getSalesMultiplier","getScientificResearchMultiplier","getStarterGuide","hasHandbook","handbookFn","showLiterature","HashRate","popEst","canAccessGang","getGangFaction","hasGangWith","startGang","locations","StatsProgressBar","remaining","StatsProgressOverviewCell","characterOverviewStyles","paddingBottom","Option","buttonText","infoText","TickerDisplayMode","DisplayModeButton","tickerDisplayMode","Portfolio","changeDisplayMode","StockTickersConfig","changeWatchlistFilter","sum","EPSILON","decay","getSuccessChance","baseTime","skillFac","effDexterity","statFac","est","clamp","real","low","high","competence","playerStatLvl","effMultiplier","getSuccessesNeededForNextLevel","baseSuccessesPerLevel","currentCity","onTravel","WorldMap","SuccessChance","estimatedSuccessChance","StaticModal","char","CorruptableText","setContent","counter","timers","letter","randFrom","randomize","timerId","checkIfConnectedToDarkweb","listAllDarkwebItems","printRaw","buyDarkwebItem","itemName","programsRef","existingPartialExeIndex","findIndex","buyAllDarkwebItems","itemsToBuy","baseCheck","netscriptCanHack","initialCheck","netscriptCanGrow","netscriptCanWeaken","ReputationRate","isNumber","ParseCommands","allCommands","flat","ParseCommand","inQuote","prevChar","escaped","MaxSleevesFromCovenant","BaseCostPerSleeve","specialReferenceIF","specialReferenceFOR","specialReferenceWHILE","memCheckGlobalKey","parseOnlyRamCalculate","dependencyMap","completedParses","parseQueue","parseCode","moduleName","parseOnlyCalculateDeps","additionalModules","initialModule","nextModule","URLImportError","ImportError","detailedCosts","unresolvedRefs","resolvedRefs","prefix","ident","dep","applyFuncRam","loadedFns","refDetail","fnRam","checkInfiniteLoop","missingAwaitLine","walk","WhileStatement","st","walkDeeper","nodeHasTrueTest","test","hasAwait","AwaitExpression","currentModule","globalKey","internalToExternal","addRef","external","objectPrototypeProperties","getOwnPropertyNames","commonVisitors","Identifier","DoWhileStatement","ForStatement","update","IfStatement","consequent","alternate","MemberExpression","importModuleName","spec","imported","codeCopy","decimal","sharePower","StartSharing","CSM","isHackingGang","respectGainRate","wantedGainRate","moneyGainRate","storedTerritoryAndPowerCycles","territoryClashChance","territoryWarfareEngaged","notifyMemberDeath","getPower","getTerritory","cycles","processGains","processExperienceGains","processTerritoryAndPowerGains","moneyGains","respectGains","wantedLevelGains","justice","recordEarnedRespect","oldWanted","newWanted","gangName","calculatePower","gainRoll","multiplicativeGain","powerMult","PowerMultiplier","additiveGain","gangs","g","others","thisGang","otherGang","thisPwr","thisChance","calculateTerritoryGain","winGang","loseGang","powerBonus","territoryGain","clash","won","baseDeathChance","modifiedDeathChance","killMember","getRespectNeededToRecruitMember","GangMember","getWantedPenalty","memberTotal","totalRespect","lostRespect","ascend","getDiscount","discount","getAllTaskNames","taskName","pidCounter","tempCounter","MAX_SAFE_INTEGER","updateDynamicRam","ramCost","dynamicLoadedFns","dynamicRamUsage","safeGetServer","callingFnName","makeRuntimeErrorMsg","scriptArgs","getRunningScriptByPid","getCannotFindRunningScriptErrorMessage","failOnHacknetServer","callingFn","errstack","userstack","stackline","dependency","parseChromeStackline","lineMatch","funcMatch","chromeCall","parseFirefoxStackline","lio","firefoxCall","rejectMsg","manual","hackingTime","canHack","hackChance","expGainedOnSuccess","expGainedOnFailure","percentHacked","maxThreadNeeded","moneyDrained","influenceStockThroughServerHack","argsToString","toNative","helper","string","funcName","argName","boolean","checkSingularityAccess","getValidPort","iport","NetscriptGang","NetscriptSleeve","extra","NetscriptExtra","NetscriptHacknet","NetscriptStanek","NetscriptBladeburner","NetscriptCodingContract","NetscriptCorporation","formulas","NetscriptFormulas","singularity","NetscriptSingularity","stockmarket","NetscriptStockMarket","NetscriptUserInterface","hackAmount","asleep","growTime","moneyBefore","moneyAfter","logGrowPercent","influenceStockThroughServerGrow","weakenTime","end","tprintf","possibleLogs","tail","arguments","openPortCount","sshPortOpen","ftpPortOpen","smtpPortOpen","httpPortOpen","sqlPortOpen","scriptServer","spawnDelay","killByPid","scriptsRunning","hostname1","hostname2","destServer","currServ","txtFile","newFile","sourceScript","oldScript","newScript","grep","allFiles","processes","speed","production","purchaseCost","coreCost","levelCost","aname","aram","hostnameStr","tryWrite","clearPort","status","suc","offlineMoneyMade","tFormat","milliseconds","milliPrecision","alert","$","writeToTextFile","fail","tor","hasCorporation","source_is_txt","dest_is_txt","source_file","dest_file","flags","Flags","fromEntries","getFunctionNames","functionNames","moneyHacked","orgName","percTotalMoneyHacked","moneyGrown","percTotalMoneyGrown","performanceMult","cyclesOfWork","compName","tooltiptext","reqRep","TerminalHelpText","TemplatedHelpTexts","HelpTexts","analyze","backdoor","cat","check","cls","cp","expr","free","help","history","lscpu","mem","nano","sudov","unalias","CinematicText","setI","done","setDone","lines","onDone","newI","auto","GameEnv","Platform","getErrorForDisplay","errorInfo","isElectron","Production","toDisplay","language","cookiesEnabled","cookieEnabled","doNotTrack","indexedDb","platform","Steam","Browser","environment","getErrorMetadata","Development","componentStack","Tracking","Retirement","Investigation","Raid","initValue","Hand","cards","addCards","removeByIndex","StockTickerTxButton","getContract","contractName","removeContract","ret","CodingContractModal","setProps","setAnswer","contractType","tries","autoFocus","keyCode","preventDefault","BitFlumeEvent","BitFlumeModal","terminalCommandHistory","generalMethods","augmentationMethods","canAccessBladeburner","bladeburnerMethods","inBladeburner","startBladeburner","canAccessCorporation","corporationMethods","startCorporation","gangMethods","serverMethods","FactionInfo","offerHackingMission","augmentationRepRequirementMult","Illuminati","Daedalus","ECorp","MegaCorp","NWO","BitRunners","Silhouette","Netburners","CyberSec","Bladeburners","InvitationModal","litObj","Literatures","recentScripts","unshift","timestamp","opt_initFunc","sourceCode","sourceCodeLineOffset","acorn","PARSE_OPTIONS","initFunc_","paused_","polyfills_","functionCounter_","stepFunctions_","stepMatch","methodName","createScope","stripLocations_","State","stateStack","nodeConstructor","READONLY_DESCRIPTOR","configurable","writable","NONENUMERABLE_DESCRIPTOR","READONLY_NONENUMERABLE_DESCRIPTOR","VARIABLE_DESCRIPTOR","STEP_ERROR","SCOPE_REFERENCE","VALUE_IN_DESCRIPTOR","toStringCycles_","getErrorLineNumber","getErrorLineNumberMessage","appendCode","populateScope_","initGlobalScope","OBJECT_PROTO","FUNCTION_PROTO","initFunction","initObject","proto","OBJECT","initArray","initString","initBoolean","initNumber","initDate","initRegExp","initError","initMath","initJSON","thisInterpreter","EvalError","parseInt","strFunctions","decodeURI","encodeURI","wrapper","nativeFunc","throwException","URI_ERROR","FUNCTION","ARRAY","ARRAY_PROTO","REGEXP","REGEXP_PROTO","DATE","DATE_PROTO","identifierRegexp","var_args","calledWithNew","newFunc","createObjectProto","argsStr","SYNTAX_ERROR","parentScope","boxThis","isObject","getScope","strict","box","getPrototype","thisArg","func_","funcThis_","arguments_","arrayPseudoToNative","TYPE_ERROR","doneExec_","setNativeFunctionPrototype","valueOf","throwIfNullUndefined","properties","arrayNativeToPseudo","descriptor","preventExtensions","getOwnPropertyDescriptor","setter","hasValue","pseudoDescriptor","propertyIsEnumerable","newArray","first","legalArrayLength","RANGE_ERROR","class","reverse","howmany","opt_begin","opt_end","opt_separator","iLength","getProperty","hasProperty","element","isa","jLength","searchElement","opt_fromIndex","STRING","fromCharCode","functions","compareString","locales","localeCompare","separator","jsList","regexp","search","newSubstr","BOOLEAN","NUMBER","numConsts","fractionDigits","toExponential","ERROR","digits","precision","toPrecision","radix","Function","UTC","pattern","rgx","populateRegExp","lastIndex","opt_message","newError","createObject","createErrorSubclass","EVAL_ERROR","REFERENCE_ERROR","myMath","mathConsts","numFunctions","myJSON","nativeObj","child","legalArrayIndex","Value","strs","pseudoRegexp","nativeRegexp","ignoreCase","createFunction","opt_constructor","illegalConstructor","asyncFunc","pseudoDate","pseudoObj","opt_cycles","pseudo","native","nativeArray","pseudoArray","lineNum","isGetter","TypeError","opt_descriptor","ReferenceError","defObj","firstNode","expression","createSpecialScope","opt_scope","getValueFromScope","prevNode","setValueToScope","nodeClass","isConstructor","getValue","Completion","NORMAL","BREAK","CONTINUE","RETURN","THROW","errorClass","lineNumErrorMsg","unwind","lineNumberMsg","cv","labels","isLoop","isSwitch","realError","errorTable","RangeError","URIError","createGetter_","funcThis","doneCallee_","doneArgs_","createSetter_","elements","n_","array_","doneLeft_","doneRight_","leftReference_","doneGetter_","leftValue_","leftValue","doneSetter_","setterValue_","rightValue","directEval_","funcNode","paramName","paramValue","argsList","evalNode","argsWithCallback","done_","throwValue","mode_","test_","doneInit_","doneObject_","variable_","object_","visited_","name_","gotPropName","props_","doneVariable_","doneProperty_","properties_","kinds","switchValue_","defaultCase_","index_","switchCase","matched_","tested_","doneBlock_","doneHandler_","doneFinalizer_","leftSide_","changeValue","returnValue","declarations","declarationNode","init_","doneBody_","numServerGrowthCycles","adjGrowthRate","numServerGrowthCyclesAdjusted","findSleevePurchasableAugs","ownedAugNames","availableAugs","isAvailableForSleeve","StaneksGiftEvents","matchEnding","zip","JSZip","zipFiles","fileNames","fileContents","zipFn","generateAsync","FileSaver","saveAs","AugmentationAccordion","displayName","Paper","unmountOnExit","stealthIcon","xmlns","viewBox","killIcon","ActionLevel","isActive","canIncrease","canDecrease","Autolevel","TeamSizeButton","BlinkingCursor","setOn","purchaseResleeve","augKey","generateResleeves","Resleeve","baseNumAugs","numAugs","augKeys","randKey","randAug","DeleteGameButton","modalOpened","setModalOpened","SoftResetButton","noConfirmation","ThemeEditorButton","themeEditorOpen","setThemeEditorOpen","ThemeCollaborate","StyleEditorButton","styleEditorOpen","setStyleEditorOpen","TravelAgencyRoot","setDestination","startTravel","symbolsLoaded","symbols","SetupTextEditor","populate","exclude","OpenScript","lastPosition","model","openScripts","currentScript","Root","editorRef","monacoRef","vimStatusRef","vimEditor","setVimEditor","editor","setEditor","setRAM","ramEntries","setRamEntries","updatingRam","setUpdatingRam","decorations","setDecorations","optionsOpen","setOptionsOpen","setOptions","insertSpaces","wordWrap","ramInfoOpen","setRamInfoOpen","dimensions","setDimensions","regenerateModel","createModel","debouncedHandleResize","updateRAM","keydown","ctrlKey","metaKey","stopPropagation","require","initVimMode","VimMode","Vim","defineEx","dispose","debouncedSetRAM","useMemo","newCode","entriesDisp","scriptToSave","textFile","onTabClick","curIndex","isDisposed","setModel","setPosition","revealLineInCenter","onTabClose","closingScript","savedScriptIndex","savedScriptCode","serverScriptIndex","indexOffset","getServerCode","openScript","serverScript","editorHeight","onDragEnd","items","startIndex","endIndex","removed","reorder","droppableId","direction","provided","snapshot","innerRef","droppableProps","isDraggingOver","iconButtonStyle","minWidth","borderColor","draggableId","disableInteractiveElementBlocking","draggableProps","dragHandleProps","flexShrink","serverScriptCode","dirty","onTabUpdate","beforeMount","monaco","languages","registerCompletionItemProvider","provideCompletionItems","suggestions","kind","CompletionItemKind","insertText","insertTextRules","CompletionItemInsertTextRule","InsertAsSnippet","getLanguages","loader","tokenizer","token","libSource","typescript","javascriptDefaults","addExtraLib","typescriptDefaults","loadThemes","onMount","Position","loading","defaultLanguage","defaultValue","newArr","tempScript","awaitWarning","newDecorations","deltaDecorations","startLineNumber","startColumn","endLineNumber","endColumn","isWholeLine","glyphMarginClassName","glyphMarginHoverMessage","infLoop","glyphMargin","mr","getAction","makeScriptBlob","compile","shouldCompile","uurls","_getScriptUrls","loadedModule","isDependencyOutOfDate","scriptModuleSequenceNumber","depScript","seen","urlStack","ranges","importNodes","ExportNamedDeclaration","ExportAllDeclaration","transformedCode","matchingScripts","importedScript","urls","blob","ScriptUrl","vargs","numDashes","libarg","argv","defaultInterpreter","TablePaginationActionsAll","rowsPerPage","onPageChange","Cell","cellProps","onMouseEnter","newNs2Template","detectSimpleScriptGlob","globString","globDatabase","parsedGlob","glob","preGlob","postGlob","globError","globMatches","globAgainst","parseSimpleScriptGlob","commonEditor","scriptEditorRouteOptions","filesToLoadOrCreate","globSearch","isEmpty","filepath","getFilepath","fileIsNs2","isNs2","CursorPositions","saveCursor","column","automate","stop","corpName","additionalShares","warehouseApi","OfficeApi","createTreantMarkup","childrenArray","htmlClass","HTMLclass","innerHTML","findNode","setParent","chart","nodeStructure","queue","getMultiplierHelper","getProductProductionMultiplier","currPos","nextPosName","Engine","_lastUpdate","updateGame","expForOtherSleeves","decrementAllCounters","checkCounters","Counters","autoSaveCounter","updateSkillLevelsCounter","updateDisplays","updateDisplaysLong","updateActiveScriptsDisplay","createProgramNotifications","augmentationsNotifications","passiveFactionGrowth","mechanicProcess","contractGeneration","achievementsCounter","counterName","adjustedCycles","startExploits","setupUncaughtPromiseHandler","timeOffline","numCyclesOffline","offlineReputation","offlineHackingIncome","offlineProductionFromHacknetNodes","hacknetProdInfo","timeOfflineString","_thisUpdate","requestAnimationFrame","LoadingScreen","setShow","loaded","setLoaded","reason","doLoad","typ","invalidArgs","baseSize","StanekConstants","BaseSize","af","avgCharge","numCharge","cotmg","inBonus","updateMults","effect","fragmentAt","boost","neighboor","CalculateEffect","rootX","rootY","newFrag","ActiveFragment","aFrag","fragments","collide","findFragment","worldX","worldY","clearCharge","thisFragment","otherFragment","dx","dy","Void","infiltrationData","techVendorMaxRam","techVendorMinRam","ServerType","All","Foreign","Owned","Purchased","ServerDropdown","isValidServer","purchased","serverType","purchase","canPurchase","DECK_COUNT","Result","Blackjack","bet","canStartGame","playerHand","deck","safeDrawCard","dealerHand","gameInProgress","Pending","getTrueHandValue","finishGame","Tie","PlayerWonByBlackjack","DealerWon","hand","handValues","getHandValue","valuesUnder21","isHandBusted","newHand","newDealerHand","PlayerWon","dealerHandValue","playerHandValue","betInput","wager","wagerInvalid","wagerInvalidHelperText","startGame","Deck","render","playerHandValues","getHandDisplayValues","dealerHandValues","wagerOnChange","helperText","playerHit","playerStay","startOnClick","elevation","card","prev","hidden","fontWeight","red","ReactCard","Clubs","Spades","allFactionAugs","factionAugs","factionAug","repFromDonation","TickerHeaderFormatData","longestName","longestSymbol","AchievementEntry","cssFiltersUnlocked","cssFiltersLocked","isUnlocked","mainColor","achievedOn","flexWrap","unlocked","colorFilters","Color","hueRotate","angle","PI","sin","cos","multiply","grayscale","sepia","saturate","matrix","newR","newG","newB","brightness","linear","contrast","slope","intercept","invert","hsl","Solver","targetHSL","reusedColor","solve","solveNarrow","solveWide","css","best","initial","spsa","A1","iters","bestLoss","deltas","highArgs","lowArgs","ck","lossDiff","ak","fix","idx","filters","colorHSL","getFiltersFromHex","hex","rgb","hexToRgb","gameCPS","Theme","credit","screenshot","img1","reference","outputHistory","startHack","startGrow","startWeaken","startBackdoor","startAnalyze","finishHack","oldSec","newSec","finishGrow","finishWeaken","finishBackdoor","finishAnalyze","isHacknet","org","hackingSkill","security","hackingChance","numPort","getProgressText","getFile","getLitFile","lit","currDir","setcwd","contractOpen","executeScanAnalyzeCommand","visited","depthQueue","newS","titleDashes","connectToServer","executeCommands","commandHistory","commandHistoryIndex","executeCommand","n00dlesServ","commandName","scananalyze","removeBracketsFromArrayString","strCpy","removeQuotesFromString","convert2DArrayToString","ans","len","nums","ways","padStart","spiral","u","col","playerAns","reach","intervals","numIntervals","interval","sanitizedResult","sanitizedAns","ansArr","ipInAns","maxCur","maxSoFar","hold1","MIN_SAFE_INTEGER","hold2","release1","release2","prices","hold","rele","cur","createTriangleRecurse","numLevels","createTriangle","triangle","dp","numRows","numColumns","currentRow","gridString","grid","obstacleGrid","roll","dfs","pair","playerAnsArray","resultInAnswer","numDigits","digitsArray","sanitizedPlayerAnsArr","evaluated","multed","htmlID","requireHackingLevel","targetServer","numAugReq","ipaddress","byteRange","installed","formattedHours","getHours","formattedMinutes","getMinutes","formattedSeconds","getSeconds","getMonth","getDate","assignToTask","unassignFromTask","difficultyPerCycles","getGainedAscensionPoints","canAscend","getCurrentAscensionMults","getAscensionMultsAfterAscend","getAscensionResults","postAscend","preAscend","applyUpgrade","respectToDeduct","buyUpgrade","createDescription","AllSoftwarePositions","AllITPositions","AllNetworkEngineerPositions","SecurityEngineerPositions","AllTechnologyPositions","AllBusinessPositions","AllAgentPositions","AllSecurityPositions","AllSoftwareConsultantPositions","AllBusinessConsultantPositions","SoftwarePositionsUpToHeadOfEngineering","SoftwarePositionsUpToLeadDeveloper","BusinessPositionsUpToOperationsManager","WaiterOnly","EmployeeOnly","PartTimeWaiterOnly","PartTimeEmployeeOnly","OperationsManagerOnly","CEOOnly","Sector12CarmichaelSecurity","advertisingMult","employeeChaMult","employeeCreMult","employeeEffMult","employeeIntMult","productionMult","productProductionMult","salesMult","sciResearchMult","storageMult","effectText","costPerLevel","hasTargetServer","lookup","checkGangApiAccess","getGangMember","wantedLevelGainRate","wantedPenalty","cpy","hack_asc_mult","str_asc_mult","def_asc_mult","dex_asc_mult","agi_asc_mult","cha_asc_mult","respectGain","wantedLevelGain","recruited","tasks","memberName","getGangTask","equipName","equipment","typecheck","engage","playerPower","checkSleeveAPIAccess","checkSleeveNumber","sleeveNumber","asleeveNumber","aCrimeRoughName","crimeRoughName","auniversityName","aclassName","acityName","acompanyName","afactionName","aworkType","agymName","astat","sl","jobTitle","maxHp","agilityExp","charismaExp","companyRep","crimeMoney","crimeSuccess","defenseExp","dexterityExp","factionRep","hackingExp","strengthExp","workMoney","workHackExpGain","workStrExpGain","workDefExpGain","workDexExpGain","workAgiExpGain","workChaExpGain","workMoneyGain","workRepGain","augs","purchasableAugs","aaugName","bypass","doc","completely_unused_field","real_document","alterReality","recur","getHacknetNode","hi","maxNumNodes","hasUpgraded","timeOnline","totalProduction","getHashUpgrades","getHashUpgradeLevel","checkStanekAPIAccess","arootX","arootY","arotation","afragmentId","fragmentId","RAMBonus","newTheme","currentTheme","errors","newStyles","currentStyles","checkBladeburnerAccess","skipjoined","apiDenied","bladeburnerDenied","checkBladeburnerCity","getBladeburnerActionObject","getCodingContract","returnReward","is2DArray","answerComponents","creward","getCorporation","getDivision","getOffice","getWarehouse","getMaterial","materialName","getProduct","getEmployee","employeeName","checkAccess","api","getSafeDivision","getPurchaseWarehouseCost","getUpgradeWarehouseCost","adivisionName","hasWarehouse","amaterialName","prd","sll","aproductName","pCost","cityData","developmentProgress","purchaseWarehouse","upgradeWarehouse","sellMaterial","aamt","aprice","sellProduct","aall","discontinueProduct","setSmartSupply","aenabled","enabled","setSmartSupplyUseLeftovers","buyMaterial","makeProduct","adesignInvest","amarketingInvest","exportMaterial","asourceDivision","asourceCity","atargetDivision","atargetCity","sourceDivision","targetDivision","targetCity","cancelExportMaterial","setMaterialMarketTA1","aon","setMaterialMarketTA2","setProductMarketTA1","setProductMarketTA2","getHireAdVertCost","getHireAdVertCount","getResearchCost","aresearchName","hasResearched","setAutoJobAssignment","ajob","aamount","getOfficeSizeUpgradeCost","asize","assignJob","aemployeeName","hireEmployee","upgradeOfficeSize","acostPerEmployee","buyCoffee","hireAdVert","minEne","minHap","expandIndustry","aindustryName","industryName","expandCity","unlockUpgrade","aupgradeName","upgradeName","levelUpgrade","issueDividends","apercent","issuedShares","createCorporation","acorporationName","selfFund","corporationName","hasUnlockUpgrade","getUnlockUpgradeCost","getUpgradeLevel","getUpgradeLevelCost","getExpandIndustryCost","getExpandCityCost","getInvestmentOffer","fundingRound","percShares","acceptInvestmentOffer","funding","investShares","goPublic","anumShares","initialSharePrice","bribe","aamountCash","aamountShares","amountCash","amountShares","reFac","robFac","aiFac","advFac","prodMats","hwFac","makesProducts","getProductDescriptionText","getMaximumNumberProducts","additional","hasMaximumNumberProducts","calculateProductionFactors","multSum","cityMult","updateWarehouseSizeUsed","prodName","newInd","employeeSalary","officeLoc","processMaterialMarket","processProductMarket","popularityGain","awarenessGain","MAX_VALUE","processMaterials","processProducts","wh","foo","imp","buyAmt","maxAmt","smartBuy","smartSupplyStore","worseAmt","totalSize","freeSpace","maxProd","getOfficeProductivity","totalMatSize","tmp","reqMatName","normQty","producableFrac","reqMatQtyNeeded","fooProd","fooI","businessFactor","getBusinessFactor","advertisingFactor","getAdvertisingFactors","marketFactor","getMarketFactor","markupLimit","numerator","sqrtNumerator","sqrtDenominator","denominator","sqrt","optimalPrice","marketTa2Price","maxSell","sellAmt","totalExp","expI","amtStr","expIndustry","expWarehouse","engrProd","mgmtProd","opProd","mgmtFactor","processProduct","totalProfit","forProduct","netStorageSize","sCostString","businessProd","calculateEffectWithFactors","awarenessFac","popularityFac","ratioFac","updateResearchTree","expFac","linearFac","morale","happiness","energy","det","trainingEff","effCre","effEff","prodBase","checkFormulasAccess","hackPercent","growPercent","hackTime","levelUpgradeCost","ramUpgradeCost","coreUpgradeCost","extraCores","hacknetNodeCost","constants","hacknetServers","hashGainRate","HScalculateHashGainRate","HScalculateLevelUpgradeCost","HScalculateRamUpgradeCost","HScalculateCoreUpgradeCost","cacheUpgradeCost","extraCache","HScalculateCacheUpgradeCost","hashUpgradeCost","hacknetServerCost","HScalculateServerCost","ascensionPointsGain","ascensionMultiplier","checkTixApiAccess","getStockFromSymbol","sanitizedPosType","orderPos","ltype","lpos","stockMarketOrders","forecast","getAugmentation","getFaction","getCompany","runAfterReset","cbScript","facname","locationName","wasFocusing","cityname","darkweb","baseserver","installTime","afocus","jobTitles","wasFocused","field","hackAvailable","fdWkAvailable","scWkAvailable","repNeededToDonate","detect","hasChanges","orig","fl","backups","maxClearanceLevel","startingSecurityLevel","TechVendor","University","AevumCasino","Casino","Special","Sector12CityHall","Hospital","WorldStockExchange","ChongqingChurchOfTheMachineGod","IshimaGlitch","textfield","InteractiveTutorialRoot","contents","canNext","square","overviewContainer","visibilityToggle","collapse","Overview","setX","setY","CurrentIcon","KeyboardArrowUpIcon","KeyboardArrowDownIcon","LeftIcon","SchoolIcon","EqualizerIcon","fakeDrag","triggerMouseEvent","eventType","clickEvent","createEvent","initEvent","dispatchEvent","Loading","onStop","defaultPosition","onDoubleClick","openedMixin","transitions","easing","sharp","enteringScreen","closedMixin","leavingScreen","breakpoints","up","Drawer","styled","shouldForwardProp","active","borderLeft","listitem","SidebarRoot","hackingOpen","setHackingOpen","characterOpen","setCharacterOpen","worldOpen","setWorldOpen","helpOpen","setHelpOpen","flashTerminal","flashStats","flashActiveScripts","flashHacknet","flashCity","flashTutorial","augmentationCount","invitationsCount","programCount","canCreateProgram","canOpenFactions","canOpenAugmentations","canOpenSleeves","canCorporation","canGang","canJob","canStockMarket","canBladeburner","canStaneksGift","clickTerminal","clickScriptEditor","clickStats","clickActiveScripts","clickCreateProgram","clickFactions","clickAugmentations","clickHacknet","clickCity","clickTravel","clickJob","clickBladeburner","clickGang","clickTutorial","handleShortcuts","altKey","anchor","timeout","clsx","badgeContent","AugmentationsRoot","installOpen","setInstallOpen","InstalledAugmentations","sourceAugs","Alphabetically","aug1","aug2","Improvements","BN5Stat","base","MultiplierTable","PlayerMultipliers","augP","calculateAugmentedStats","BladeburnerMults","PurchasedAugmentations","SourceFileMinus1","OwnedSourceFiles","sourceSfs","sf1","sf2","sfObj","SourceFileAccordion","DevMenuRoot","General","setError","addMoney","TransitionProps","expandIcon","bigNumber","modifyExp","modifier","modifyKarma","resetExperience","modifyFactionRep","AllFaction","modifyFactionFavor","labelId","arial-label","setAugmentation","validSFN","setSF","sfN","sfLvl","setAllSF","setProgram","AllPrograms","Servers","setServer","setCompany","modifyCompanyRep","AllCompanies","modifyCompanyFavor","modifyBladeburnerRank","modify","modifyBladeburnerCycles","modifyGangCycles","modifyCorporationCycles","CodingContracts","setCodingcontract","cc","stockPrice","setStockPrice","setStockSymbol","processStocks","inputSymbols","SM","stocks","sleeveSetStoredCycles","Stanek","modCycles","modCharge","TimeSkip","timeskip","playerAchievement","setPlayerAchievements","achieved","grantAchievement","removeAchievement","BladeburnerRoot","gridTemplateColumns","travelOpen","setTravelOpen","inFaction","wordBreak","gap","TravelModal","nopadding","preformatted","Line","Console","setCommand","consoleInput","consoleHistoryIndex","setConsoleHistoryIndex","Logs","tabIndex","inputRef","prevCommand","currentTarget","spellCheck","scrollHook","scrollTop","scrollHeight","AllPages","tab","GeneralActionPage","GeneralActionList","actions","GeneralActionElem","computedActionTimeCurrent","actionData","ContractPage","ContractList","ContractElem","Contracts","StealthIcon","KillIcon","OperationPage","OperationList","OperationElem","TeamSizeModal","BlackOpPage","BlackOpList","blackopName","blackop","BlackOpElem","hasReqdRank","SkillPage","valid","onUpgrade","SkillList","SkillElem","canLevel","GangRoot","ManagementSubpage","GangStats","territoryStr","BonusTime","CyclerPerSecond","bonusMillis","GangMemberList","setFilter","ascendOnly","setAscendOnly","onRecruit","newValue","GangMemberCard","GangMemberCardContent","ascendOpen","setAscendOpen","borderRightWidth","onAscend","borderLeftWidth","onTaskChange","KillScriptsModal","TaskSelector","setCurrentTask","TaskDescription","AscensionModal","RecruitButton","RecruitModal","setName","recruit","onKeyUp","TerritorySubpage","gangNames","formatTerritory","OtherGangTerritory","clashVictoryChance","NextReveal","PurchasedUpgrade","UpgradeButton","GangMemberUpgradePanel","currentCategory","setCurrentCategory","filterUpgrades","weaponUpgrades","armorUpgrades","vehicleUpgrades","rootkitUpgrades","augUpgrades","categories","EquipmentsSubpage","CorporationRoot","setDivisionName","canExpand","industryType","MainPanel","CityTabs","setCity","cityStateSetter","countEmployee","SwitchButton","manualMode","switchMode","ManualManagement","setEmployee","employeePositionSelectorInitialValue","employeePositions","positionNames","AutoAssignJob","numJob","numUnassigned","AutoManagement","vechain","totalMorale","totalHappiness","totalEnergy","totalSalary","avgMorale","avgHappiness","avgEnergy","IndustryOffice","upgradeOfficeSizeOpen","setUpgradeOfficeSizeOpen","throwPartyOpen","setThrowPartyOpen","employeeManualAssignMode","setEmployeeManualAssignMode","UpgradeSizeButton","upgradeSize","UpgradeOfficeSizeModal","upgradeCost","upgradeCost15","maxMult","maxNum","multIncrease","upgradeCostMax","ThrowPartyModal","setCost","canParty","EffectText","MakeProductButton","makeOpen","setMakeOpen","hasMaxProducts","createProductButtonText","Text","researchOpen","setResearchOpen","advertisingInfo","advertisingFactors","totalAdvertisingFac","convertEffectFacToGraphic","Upgrades","IndustryOverview","MakeProductModal","allCities","design","setDesign","marketing","setMarketing","createProductPopupText","Upgrade","wrapInTooltip","ele","but","ResearchModal","WarehouseRoot","smartSupplyOpen","setSmartSupplyOpen","canAffordUpgrade","stateText","mats","isRelevantMaterial","breakdownItems","breakdown","previous","IndustryWarehouse","EmptyWarehouse","Leftover","setChecked","SmartSupplyModal","ProductElem","sellOpen","setSellOpen","limitOpen","setLimitOpen","discontinueOpen","setDiscontinueOpen","marketTaOpen","setMarketTaOpen","nfB","hasUpgradeDashboard","sellButtonText","limitProductionButtonText","DiscontinueProductModal","LimitProductProductionModal","setLimit","limitProductProduction","SellProductModal","iQty","setQty","setPx","initialPrice","MarketTA2","ProductMarketTaModal","MaterialElem","purchaseMaterialOpen","setPurchaseMaterialOpen","exportOpen","setExportOpen","sellMaterialOpen","setSellMaterialOpen","materialMarketTaOpen","setMaterialMarketTaOpen","tutorial","purchaseButtonText","ExportModal","setIndustry","setAmt","removeExport","currentDivision","possibleCities","newCost","setNewCost","MaterialMarketTaModal","SellMaterialModal","setPrice","BulkPurchaseText","parsedAmt","matSize","BulkPurchase","setBuyAmt","bulkPurchase","PurchaseMaterialModal","purchaseMaterial","IndustryProductEquation","reqs","reqAmt","ExpandNewCity","ExpandIndustryTab","possibleIndustries","newIndustry","multRows","appendMult","DividendsStats","PublicButtons","PrivateButtons","BribeButton","findInvestorsopen","setFindInvestorsopen","goPublicopen","setGoPublicopen","fundingAvailable","findInvestorsTooltip","upgradeData","sellSharesOpen","setSellSharesOpen","buybackSharesOpen","setBuybackSharesOpen","issueNewSharesOpen","setIssueNewSharesOpen","issueDividendsOpen","setIssueDividendsOpen","sellSharesOnCd","sellSharesTooltip","issueNewSharesOnCd","issueNewSharesTooltip","canBribe","totalDividends","storedTime","LevelableUpgrade","UU","BribeFactionModal","setStock","selectedFaction","setSelectedFaction","getRepText","SellSharesModal","setShares","ProfitIndicator","stockSaleResults","newSharePrice","newSharesUntilUpdate","BuybackSharesModal","buybackPrice","CostIndicator","IssueDividendsModal","setPercent","canIssue","maxNewSharesUnrounded","maxNewShares","newShares","IssueNewSharesModal","issueNewShares","privateShares","FindInvestorsModal","GoPublicModal","calcRawDiff","startingDifficulty","InfiltrationRoot","setStart","calcDifficulty","calcReward","StartingDifficulty","Difficulty","Reward","cancel","arrowPart","arrow","Intro","Stage","minigames","SlashGame","BracketGame","BackwardGame","BribeGame","CheatCodeGame","Cyberpunk2077Game","MinesweeperGame","WireCuttingGame","setLevel","stage","setStage","Countdown","results","setResults","gameIds","setGameIds","lastGames","nextGameId","ids","setupNextGame","pushResult","next","stageComponent","onFinish","Minigame","MiniGame","onSuccess","Sell","onFailure","automated","Progress","difficulties","timer","setRight","generateLeftSide","getChar","phase","setPhase","words","makeAnswer","guess","setGuess","nextGuess","choices","positive","option","negative","array","shuffleArray","makeChoices","setIndex","newIndex","arrows","generateCode","puzzle","randChar","generatePuzzle","generateAnswer","setPos","move","mines","minefield","generateEmptyField","generateMinefield","memoryPhase","setMemoryPhase","fieldEquals","wiresmin","wiresmax","rules","colorNames","blue","wires","numWires","wireColors","generateWires","cutWires","setCutWires","questions","numQuestions","questionGenerators","randomPositionQuestion","randomColorQuestion","generateQuestion","question","wire","wireNum","shouldCut","wiresToBeCut","shouldBeCut","cutColor","Victory","quitInfiltration","levelBonus","SortOption","Cost","AverageCombatStats","AverageAllStats","TotalNumAugmentations","getAverage","SortFunctions","ResleeveRoot","setSort","sortFunction","opt","resleeve","totalAugmentationCost","ResleeveElem","setAug","currentAug","CYCLES_PER_SEC","WorkInProgressRoot","unfocus","stopText","numBars","progressBar","GameOptionsRoot","importInput","execTime","setExecTime","logSize","setLogSize","portSize","setPortSize","terminalSize","setTerminalSize","autosaveInterval","setAutosaveInterval","timestampFormat","setTimestampFormat","setLocale","diagnosticOpen","setDiagnosticOpen","importSaveOpen","setImportSaveOpen","importData","setImportData","gutterBottom","sm","valueLabelDisplay","marks","method","alt","File","FileList","ii","ex","confirmedImportGame","ServerAccordion","FileDiagnosticModal","ColorEditor","onColorChange","defaultColor","hideTextfield","deferred","newColor","disableAlpha","ThemeEditorModal","customTheme","setCustomTheme","setTemplateTheme","py","placement","maxRows","importedTheme","FontFamilyField","refreshId","errorText","setErrorText","setFontFamily","LineHeightField","setLineHeight","StyleEditorModal","setRefreshId","customStyle","setCustomStyle","persistToSettings","endIcon","SleeveRoot","FAQOpen","setFAQOpen","SleeveElem","statsOpen","setStatsOpen","earningsOpen","setEarningsOpen","augmentationsOpen","setAugmentationsOpen","abc","setABC","doing","SleeveAugmentationsModal","StatsElement","MoreStatsModal","MoreEarningsModal","universitySelectorOptions","gymSelectorOptions","possibleJobs","forbiddenCompanies","otherSleeve","possibleFactions","forbiddenFactions","second","facInfo","universities","gyms","Synchronize","canDo","getABC","s0","setS0","setS1","setS2","validActions","detailsF","details2","detail","FAQModal","HacknetRoot","purchaseMultiplier","setPurchaseMultiplier","purchaseMultiplierOnClicks","onClicks","GeneralInfo","HacknetNodeElem","purchaseMult","upgradeLevelButton","upgradeRAMButton","upgradeCoresButton","increase","upgradeLevelCost","upgradeRamCost","upgradeCoreCost","HacknetServerElem","upgradeRamButton","upgradeCacheButton","upgradeCacheCost","HashUpgradeModal","serversMap","HacknetUpgradeElem","selectedServer","setSelectedServer","MultiplierButton","MultiplierButtons","buttons","btnProps","PlayerInfo","hasServers","PurchaseButton","GenericLocation","locContent","locName","getLocationSpecificContent","serverMeta","CompanyLocation","quitOpen","setQuitOpen","isEmployedHere","favorGain","onQuit","QuitJobModal","GymLocation","train","HospitalLocation","btnStyle","getHealed","currHp","SlumsLocation","shopliftChance","robStoreChance","mugChance","larcenyChance","drugsChance","bondChance","armsChance","homicideChance","gtaChance","kidnapChance","assassinateChance","heistChance","SpecialLocation","handleBladeburner","new","worldHeader","HTMLElement","handleResleeving","CreateCorporation","handleCotMG","renderBladeburner","renderCotMG","CreateCorporationModal","canSelfFund","n00dlePower","ServerButton","TechVendorLocation","purchaseServerButtons","RamButton","TorButton","purchaseTorRouter","CoresButton","maxCores","PurchaseServerModal","setHostname","tryToPurchaseServer","TravelConfirmationModal","UniversityLocation","take","dataStructuresCost","networksCost","algorithmsCost","managementCost","leadershipCost","GameType","CasinoLocation","setGame","Coin","Slots","Roulette","numDecks","shuffle","drawCard","CoinFlip","investment","setInvestment","setResult","setStatus","playLock","setPlayLock","play","correct","redNumbers","strategies","Red","payout","Black","Odd","Even","High","Low","Third1","Third2","Third3","Single","rng","canPlay","setCanPlay","setN","lock","setLock","strategy","playerWin","isRed","currentNumber","getPayout","payLines","SlotMachine","locks","setLocks","stoppedOne","getPaylineData","payline","point","countSequence","checkWinnings","getTable","LocationLetter","ASCIICity","locationLettersRegex","letterMap","lineElems","elems","startI","endI","locationI","ListCity","locationButtons","LocationCity","OptionsModal","setInsertSpaces","setFontSize","setWordWrap","setVim","defineTheme","inherit","foreground","fontStyle","MilestonesRoot","milestones","highestMilestone","milestone","ActionTimer","paragraph","TerminalRoot","setKey","doScroll","hook","scrollIntoView","debounced","maxWait","unsubscribe","scrollId","TerminalInput","terminalInput","postUpdateValue","setPostUpdateValue","possibilities","setPossibilities","saveValue","postUpdate","modifyInput","mod","inputLength","selectionStart","inputText","delStart","moveTextCursor","keyDown","autoComplete","semiColonIndex","allPos","determineAllPossibilitiesForTabCompletion","tabCompletion","selectionEnd","parentDirPath","evaledParentDirPath","addAllCodingContracts","cct","addAllLitFiles","addAllPrograms","addAllScripts","processFilepath","addAllTextFiles","addAllDirectories","subdirs","getSubdirectories","t_parentDirPath","convertParentPath","isCommand","cmd","t_cmd","autocomplete","runArgs","permissive","flagFunc","pos2","txts","schema","scriptAutocomplete","addAllMessages","t_dir","processFile","subdir","allPossibilities","oldValue","longestStartSubstr","TutorialRoot","confirmResetOpen","setConfirmResetOpen","ActiveScriptsRoot","setTab","ScriptProduction","prodRateSinceLastAug","ServerAccordions","setRowsPerPage","serverToScriptMap","filtered","rowsPerPageOptions","newPage","onRowsPerPageChange","ActionsComponent","paddedName","barOptions","headerTxt","ServerAccordionContent","disablePadding","noborder","WorkerScriptAccordion","killScript","onlineMps","onlineEps","RecentScriptsPage","recentScript","RecentScriptAccordion","GangNames","MainPage","onAugmentations","sleevesOpen","setSleevesOpen","gangOpen","setGangOpen","isPlayersGang","favorToDonate","canDonate","canPurchaseSleeves","startHackingContracts","startFieldWork","startSecurityWork","FactionRoot","purchasingAugs","setPurchasingAugs","routeToMainPage","AugmentationsPage","getAugs","switchSortOrder","newOrder","augName1","augName2","getAugsSortedByCost","getAugsSortedByReputation","Purchasable","canBuy","hasReq","hasRep","cantBuy","getAugsSortedByPurchasable","getAugsSorted","purchasable","purchaseableAugmentation","augListElems","ownedElem","Requirements","PurchaseableAugmentation","hasCost","btnTxt","PurchaseAugmentationModal","DonateOption","donateAmt","setDonateAmt","Status","noformat","Info","CreateGangModal","CovenantPurchasesRoot","setUpdate","purchaseDisabled","upgradePanels","CovenantSleeveMemoryUpgrade","maxMemory","purchaseBtnDisabled","purchaseBtnContent","LastEmployer","LastJob","Employers","bn5Stat","CurrentBitNode","MoneyModal","convertMoneySourceTrackerToString","parts","infiltration","CharacterStats","moneyOpen","setMoneyOpen","timeRows","StockMarketRoot","Purchase4SMarketDataTixApiAccessButton","PurchaseWseAccountButton","PurchaseTixApiAccessButton","Purchase4SMarketDataButton","InfoAndPurchases","StockTickers","setTickerDisplayMode","AllStocks","watchlistSymbols","setWatchlistSymbols","tickers","stockMarketProp","rerenderAllTickers","sanitizedWatchlist","SelectorOrderType","StockTicker","setOrderType","Market","tickerOpen","setTicketOpen","modalProps","setModalProps","placeText","getQuantity","hasOrderAccess","Limit","Stop","getBuyTransactionCostContent","getSellTransactionCostContent","playerMoney","localesWithLongPriceFormat","StockTickerHeaderText","stockPriceFormat","spacesAllottedForStockPrice","spacesAfterStockName","spacesBeforePrice","hdrText","plusOrMinus","StockTickerOrderList","StockTickerOrder","posTxt","LongPosition","percentageGains","ShortPosition","StockTickerPositionText","PlaceOrderModal","level0","level1","level2","level3","BitNodePortal","portalOpen","setPortalOpen","cssClass","BitverseRoot","destroyed","destroySequence","setDestroySequence","nextSourceFileFlags","PortalModal","bitNodeKey","maxSourceFileLevel","newLevel","CinematicLine","setLength","ms","newLength","advance","StaneksGiftRoot","gift","zeros","MainBoard","calculateGrid","newgrid","setGrid","ghostGrid","setGhostGrid","setRotation","selectedFragment","setSelectedFragment","moveGhost","clickAt","deleteAt","randomColor","doRotate","selectFragment","FragmentInspector","setC","FragmentOption","colorAt","FragmentSelector","FragmentPreview","getComputedStyle","Element","AchievementsRoot","AchievementList","cssPrimary","cssSecondary","secret","unavailable","locked","pr","defaultExpanded","AchievementIcon","imgLoaded","setImgLoaded","onLoad","ErrorBoundary","Component","hasError","componentDidCatch","previousScrollY","modalOpen","setModalOpen","modalImageSrc","setModalImageSrc","predefinedThemes","themes","templateTheme","onActivated","scrollY","previousColors","onImageClick","handleZoom","ThemeEntry","subheader","image","ComparisonIcon","isBetter","initialAutosave","ImportSaveRoot","currentData","setCurrentData","importModalOpen","setImportModalOpen","headback","setHeadback","dataBeingImported","dataCurrentlyInGame","fetchData","BypassWrapper","empty","srcFile","sourceFileObject","incMult","decMult","normalServer","relative_filename","evaledDir","t_dst","dst","srcExt","tRes","sRes","sanitizedExpr","used","avail","usedPercent","numArgs","incorrectUsage","newPath","allPrograms","allScripts","allTextFiles","allContracts","allMessages","folders","handleFn","dest","parsedFn","firstParentDir","msgOrLit","ClickableScriptRow","scriptLinksWrap","scriptLink","textDecorationLine","paddingRight","rowSplit","rowItem","onScriptLinkClick","postSegments","segments","linked","filesPerRow","groups","numThreads","verboseEntries","t_dest","sourcePath","destFile","destPath","positions","getCursor","re","matching","rsObj","delTarget","executableName","runContract","runProgram","commandArgs","threadFlag","tailFlag","toLocaleLowerCase","hasRoot","maxHostname","maxIP","args2","headers","currRunningScripts","numSpacesScript","spacesScript","numSpacesPid","spacesPid","numSpacesThread","spacesThread","tampering","last","minute","timeCompression","ReactDOM","globalThis","onbeforeunload"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAg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k5E,GACLl5E,KAAKylG,MAAMnnD,IAAK1qB,GAAMA,EAAE70B,SACxBiB,KAAKizC,KACLjzC,KAAK0vD,MACL1vD,KAAK0lG,QAKJ,SAASe,EAAavtB,GAC3B,IAAK,MAAMwtB,KAAYnB,EACrB,GAAImB,EAASxtB,KAAOA,EAAI,OAAOwtB,EAEjC,OAAO,MAGT,WACE,MAAMxU,GAAI,EACJ5sB,GAAI,EACVigC,EAAUvpG,KACR,IAAIwpG,EACF,EACArT,IAAOltB,EACPjV,IAAaO,QACb,EACA,IAGJg1C,EAAUvpG,KACR,IAAIwpG,EACF,EACArT,IAAO3sB,EACPxV,IAAaO,QACb,EACA,IAGJg1C,EAAUvpG,KACR,IAAIwpG,EACF,EACArT,IAAOjtB,EACPlV,IAAaI,aACb,IACA,IAIJm1C,EAAUvpG,KACR,IAAIwpG,EACF,EACArT,IAAO3tB,EACPxU,IAAaK,aACb,EACA,IAGJk1C,EAAUvpG,KACR,IAAIwpG,EACF,EACArT,IAAO1tB,EACPzU,IAAaM,YACb,GACA,IAGJi1C,EAAUvpG,KACR,IAAIwpG,EACF,GACArT,IAAOjtB,EACPlV,IAAaQ,SACb,EACA,IAGJ+0C,EAAUvpG,KACR,IAAIwpG,EACF,GACArT,IAAOx+D,EACPq8B,IAAaS,QACb,EACA,IAGJ80C,EAAUvpG,KACR,IAAIwpG,EACF,GACArT,IAAOx+D,EACPq8B,IAAaU,UACb,EACA,IAGJ60C,EAAUvpG,KACR,IAAIwpG,EACF,GACArT,IAAOltB,EACPjV,IAAaW,QACb,EACA,IAGJ40C,EAAUvpG,KACR,IAAIwpG,EACF,GACArT,IAAOltB,EACPjV,IAAaY,SACb,EACA,IAGJ20C,EAAUvpG,KACR,IAAIwpG,EACF,GACArT,IAAO3tB,EACPxU,IAAaa,aACb,EACA,IAGJ00C,EAAUvpG,KACR,IAAIwpG,EACF,GACArT,IAAOttB,EACP7U,IAAac,YACb,EACA,IAGJy0C,EAAUvpG,KACR,IAAIwpG,EAC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,IACA,OAAMA,YACN,OAAMA,qBACN,IACA,OAAMA,WACN,OAAMA,iBACN,KAKM+nC,EAA4B,CACvC3mD,MAAO,CACL,oCACA,IACA,4FACA,uGACA,yHACA,kGACA,IACA,gCACA,IACA,mHACA,yHACA,4CACA,IACA,gCACA,IACA,6DACA,IACA,eACA,IACA,2HACA,4HACA,IACA,mCACA,IACA,8GACA,IACA,uHACA,uCACA,IACA,uDACA,KAEF4mD,QAAS,CACP,iBACA,IACA,0GACA,mHACA,kHACA,gCACA,KAEFC,SAAU,CACR,kBACA,IACA,6FACA,IACA,+BACA,KAEFrkH,IAAK,CACH,iCACA,IACA,yEACA,IACA,oHACA,oDACA,IACA,+FACA,IACA,wGACA,KAEFskH,IAAK,CACH,oBACA,IACA,6EACA,IACA,iBACA,IACA,kBACA,IACA,sBACA,KAEFvW,GAAI,CACF,kBACA,IACA,yGACA,iFACA,IACA,yBACA,IACA,eACA,IACA,aACA,KAEFwW,MAAO,CACL,uCACA,IACA,+HACA,uDACA,kIACA,IACA,oCACA,IACA,gGACA,IACA,sCACA,KAEFljH,MAAO,CACL,eACA,IACA,mIACA,uIACA,KAEFmjH,IAAK,CACH,aACA,IACA,mIACA,yIACA,KAEFrhH,QAAS,CACP,4BACA,IACA,6GACA,sIACA,iEACA,KAEFshH,GAAI,CAAC,wBAAyB,IAAK,wEAAyE,KAC5G58D,SAAU,CACR,qCACA,IACA,mFACA,IACA,4GACA,IACA,kDACA,IACA,0CACA,IACA,0CACA,KAEF68D,KAAM,CACJ,wCACA,IACA,oFACA,IACA,oBACA,IACA,WACA,IACA,wBACA,IACA,qFACA,KAEFC,KAAM,CACJ,cACA,IACA,gIACA,gCACA,KAEFtoH,KAAM,CACJ,cACA,IACA,6GACA,2CACA,KAEFR,KAAM,CACJ,cACA,IACA,uHACA,KAEF+oH,KAAM,CACJ,wBACA,IACA,yHACA,0HACA,mEACA,IACA,iBACA,IACA,wBACA,KAEFC,QAAS,CACP,sBACA,IACA,6GACA,KAEFh7F,KAAM,CACJ,cAAe,IAAK,sGAAuG,KAE7Hvb,SAAU,CAAC,kBAAmB,IAAK,4CAA6C,KAChF3Q,KAAM,CACJ,mDACA,IACA,4EACA,IACA,6EACA,4EACA,iFACA,4DACA,IACA,uCACA,IACA,qEACA,IACA,wCACA,IACA,qFACA,KAEFC,QAAS,CACP,iBACA,IACA,4CACA,2HACA,uHACA,2EACA,KAEFG,GAAI,CACF,mCACA,IACA,iIACA,sDACA,IACA,8FACA,IACA,yHACA,IACA,YACA,IACA,wEACA,IACA,wBACA,IACA,iEACA,IACA,sBACA,IACA,uFACA,IACA,iCACA,KAEF+mH,MAAO,CAAC,eAAgB,IAAK,wDAAyD,KAEtFC,IAAK,CACH,4CACA,IACA,6HACA,2HACA,gFACA,IACA,qBACA,IACA,2BACA,IACA,4HACA,iFACA,KAEFriH,GAAI,CACF,yBACA,IACA,6FACA,6FACA,kCACA,IACA,kFACA,kBACA,aACA,IACA,qEACA,IACA,oCACA,KAEFsiH,KAAMd,EAAgC,QACtClmH,GAAI,CAAC,YAAa,IAAK,4DAA6D,KACpFyD,GAAI,CACF,mBACA,IACA,6GACA,IACA,kDACA,KAEFjE,IAAK,CACH,sDACA,IACA,gDACA,IACA,sHACA,2GACA,gEACA,2DACA,2FACA,IACA,kHACA,iFACA,KAEF5B,KAAM,CACJ,cACA,IACA,6HACA,2CACA,KAEF,eAAgB,CACd,mCACA,IACA,kGACA,wGACA,4EACA,IACA,uGACA,qGACA,0BACA,IACA,iHACA,yGACA,UACA,IACA,2GACA,sEACA,KAEFkC,IAAK,CACH,4CACA,IACA,8EACA,2GACA,oCACA,2FACA,IACA,6BACA,IACA,wCACA,KAEFmnH,MAAO,CAAC,eAAgB,IAAK,oEAAqE,KAElGjF,KAAM,CACJ,sCACA,IACA,oHACA,uHACA,oEACA,IACA,8BACA,IACA,gFACA,IACA,+BACA,KAEFz5C,IAAK,CACH,aACA,IACA,yGACA,+BACA,KAEF2+C,QAAS,CACP,8BACA,IACA,mFACA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0DACA,IACA,wBACA,4BACA,yCACA,uDACA,IACA,8BACA,aACA,oBACA,qBACA,+CACA,YACA,IACA,OACA,IACA,aACA,KACA,sBACA,iBACA,MACA,IAIA,oDACA,8CACA,gCACA,kEACA,YACA,wBACA,4BACA,yCACA,SACA,oBACA,4CACA,OACA,IACA,IACA,MAIA,uDACA,8CACA,sBACA,0DACA,IACA,yCACA,wBACA,mDACA,4BACA,mCACA,mBACA,gBACA,IACA,yCACA,qEACA,yBACA,uBACA,qBACA,oBACA,2BACA,+BACA,uDACA,iCACA,8FACA,IACA,8BACA,oBACA,+DACA,wEACA,4CACA,eACA,IACA,0BACA,OACA,IACA,qBACA,gBACA,IACA,MAIA,gDACA,8CACA,gCACA,8DACA,eACA,wBACA,4BACA,yCACA,sBACA,SACA,oBACA,mDACA,OACA,IACA,YACA,IACA,MAIA,mDACA,8CACA,0CACA,kEACA,4DACA,gCACA,wBACA,WACA,oCACA,kBACA,kEACA,IACA,kBACA,IACA,yBACA,mDACA,IACA,gBACA,IACA,MAIA,wDACA,8CACA,0CACA,yGACA,kEACA,+BACA,wBACA,WACA,mCACA,eACA,kEACA,IACA,kBACA,IACA,wBACA,mDACA,IACA,gBACA,IACA,MAIA,iDACA,8CACA,+BACA,6DACA,wBACA,4BACA,+DACA,kCACA,iDACA,eACA,IACA,IACA,gBACA,IACA,MAEA,gBACA,oCACA,8CAEA,wCACA,2BACA,IAEA,0CACA,mBACA,kDACA,4CACA,sBACA,yBACA,sBACA,aACA,IACA,IACA,uBACA,IACA,eACA,KACA,QAEA,2DACA,8CACA,eACA,gBACA,0CACA,wFACA,IACA,wBACA,IACA,MACA,KAQJqwF,EAAYzwF,UAAUsxI,WAAa,SAAUzhD,GAC3C,IACIuiD,EADAN,EAAkB1tI,KAGtBguI,EAAU,SAAUhwI,GAElB,OADAA,EAAQw3E,OAAOx3E,GACX0vI,EAAgBmB,iBAElB7uI,KAAK9E,KAAO8C,EACLgC,MAGAhC,GAGXgC,KAAK8xI,OAAS9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AS93B,GAEfu6K,EAAgB,CACpB,aACA,WACA,eACA,QACA,WACA,uBACA,mBACA,MACA,sBACA,uBACA,aACA,yBACA,8BACA,aACA,iBACA,UACA,YACA,YACA,YACA,QACA,SACA,WACA,wBACA,gBACA,gBACA,aACA,aACA,cACA,YAEIC,EAAgB,CACpB,aACA,WACA,eACA,QACA,WACA,uBACA,mBACA,MACA,sBACA,uBACA,aACA,yBACA,iBACA,YACA,YACA,YACA,QACA,SACA,WACA,wBACA,gBACA,gBACA,aACA,UACA,eAEIC,EAAgB,CACpB,QACA,WACA,uBACA,mBACA,MACA,sBACA,uBACA,aACA,yBACA,8BACA,YACA,YACA,YACA,QACA,SACA,WACA,wBACA,gBACA,UACA,cACA,eAGF,OAAQ/kI,EAAK7I,eACX,IAAK,UACL,IAAK,oBACL,IAAK,mBACH,OAAK0tI,EAAc1uI,SAASnL,EAAI1gC,OAIhCod,EAAO00B,qBAAqBpR,GACxBiO,GACFvxB,EAAOs0B,gBACP1Y,IAAOqc,UACEykI,IACT18J,EAAOu0B,eACP3Y,IAAOiX,cAET+qB,EAAahlB,IAAI,iBAAkB,IAAO,+CAA8CtV,EAAI1gC,UACrF,IAZLg7D,EAAahlB,IAAI,iBAAkB,IAAO,YAAWtV,EAAI1gC,mDAClD,GAYX,IAAK,QACL,IAAK,YACL,IAAK,aACH,OAAKw6K,EAAc3uI,SAASnL,EAAI1gC,OAIhCod,EAAO40B,sBAAsBtR,GACzBiO,GACFvxB,EAAOs0B,gBACP1Y,IAAOqc,UACEykI,IACT18J,EAAOu0B,eACP3Y,IAAOiX,cAET+qB,EAAahlB,IAAI,iBAAkB,IAAO,4CAA2CtV,EAAI1gC,UAClF,IAZLg7D,EAAahlB,IAAI,iBAAkB,IAAO,YAAWtV,EAAI1gC,gDAClD,GAYX,IAAK,WACL,IAAK,eACL,IAAK,gBACH,OAAKy6K,EAAc5uI,SAASnL,EAAI1gC,OAIhCod,EAAO80B,yBAAyBxR,GAC5BiO,GACFvxB,EAAO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AAC,IAAD,CAAW03B,OAAQonG,EAAOrnG,SAAUzlE,EAAM0sK,YAC1C,kBAAC,IAAD,CAAM/mG,MAAI,EAACC,GAAI,IACb,kBAAC,IAAD,CAAYla,QAAQ,MAApB,oBACA,kBAAC,IAAD,CAAYsZ,UAdlB,SAA+B59B,GAE7B,GADAA,EAAM+zE,iBACY,cAAd/zE,EAAMp2D,IAAqB,OAC/B,MAAMw8L,EAAYF,EAAQlmI,EAAMp2D,IAAIy1B,cAC/BrzB,EAAOswC,WAAW8pJ,GACdp6L,IAAWo6L,EAAWxtK,EAAMwsK,YAChCe,EAASC,GAFqBxtK,EAAM0sK,aAUPA,UAAW1sK,EAAM0sK,aAEjD,kBAAC,IAAD,CAAM/mG,MAAI,EAACC,GAAI,GACb,kBAAC,IAAD,CAAY7c,MAAO,CAAEC,UAAW,eAAiB51E,IAEnD,kBAAC,IAAD,CAAMuyF,MAAI,EAACC,GAAI,GACb,kBAAC,IAAD,KACG0nG,EACD,kBAAC,IAAD,SAkBV,MAAMF,EAAQ,CACZ,YACA,SACA,MACA,cACA,QACA,SACA,YACA,SACA,MACA,OACA,SACA,OACA,UACA,WACA,OACA,YACA,UACA,SACA,MACA,MACA,OACA,QACA,YACA,UACA,KACA,SACA,SACA,YACA,QACA,YACA,UACA,UACA,WACA,WACA,YACA,SACA,OACA,MACA,aACA,aACA,YACA,OACA,SACA,WACA,QACA,aACA,SACA,UACA,cACA,UACA,OACA,MACA,WACA,SACA,cACA,MACA,aACA,WACA,OACA,MACA,UACA,QACA,WACA,UACA,aACA,QACA,UACA,MACA,OACA,SACA,WACA,WACA,UACA,QACA,cACA,cACA,YACA,SACA,OACA,SACA,QACA,WACA,WACA,WACA,OACA,SACA,WACA,YACA,OACA,OACA,YACA,YACA,OACA,QACA,UACA,YACA,WACA,aACA,YACA,OACA,WACA,WACA,SACA,MACA,WACA,UACA,SACA,gBACA,OACA,QACA,UACA,QACA,QACA,UACA,YACA,QACA,YACA,UACA,QACA,SACA,SACA,QACA,UACA,cACA,QACA,aACA,MACA,UACA,OACA,WACA,WACA,UACA,SACA,aACA,YACA,SACA,SACA,SACA,OACA,WACA,QACA,OACA,WACA,SACA,SACA,WACA,SACA,UACA,QACA,SACA,QACA,UACA,UACA,UACA,UACA,aACA,WACA,QACA,SACA,MACA,WACA,SACA,aACA,UACA,MACA,OACA,SACA,UACA,OACA,OACA,UACA,SACA,aACA,SACA,SACA,SACA,SACA,SACA,WACA,SACA,YACA,QACA,QACA,YACA,WACA,oBACA,WACA,OACA,UACA,cACA,UACA,SACA,UACA,gBACA,OACA,SACA,QACA,MACA,WACA,WACA,WACA,cACA,SACA,UACA,QACA,eACA,WACA,OACA,OACA,SACA,MACA,OACA,iBACA,WACA,UACA,UACA,UACA,iBACA,QACA,MACA,YACA,UACA,SACA,OACA,SACA,UACA,WACA,YACA,cACA,MACA,OACA,MACA,MACA,Q,6BCtTF,gGAcA,MAAMP,EAKF,CACF3mG,QAAS,CAAE4mG,MAAO,KAAOjwI,KAAM,GAC/BspC,OAAQ,CAAE2mG,MAAO,IAAMjwI,KAAM,GAC7BupC,KAAM,CAAE0mG,MAAO,IAAMjwI,KAAM,GAC3BwpC,WAAY,CAAEymG,MAAO,KAAMjwI,KAAM,KAG5B,SAASouI,EAAUjrK,GACxB,MAAM4vB,EAAyB,CAAEk9I,MAAO,EAAGjwI,KAAM,GACjDgpC,YAAYgnG,EAAc7sK,EAAM4vB,WAAYA,GAC5C,MAAMk9I,EAAQl9I,EAAWk9I,OAClBW,GAAWn9H,mBAmDpB,SAAqB1gB,GACnB,MAAM69I,EAAU,GAChBA,EAAQ/+L,KAAKg/L,EAASx6L,KAAKixB,MAAMjxB,KAAKkxB,SAAWspK,EAASt/L,UAC1D,IAAK,IAAIF,EAAI,EAAGA,EAAI0hD,EAAWiN,KAAM3uD,IAAK,CACxC,MAAMy/L,EAASC,EAAS16L,KAAKixB,MAAMjxB,KAAKkxB,SAAWwpK,EAASx/L,SACxDq/L,EAAQ3xJ,SAAS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,EAAW,YAClBN,aAAc/tL,IAAgByB,MAAhB,cAGhB,6BACA,kBAACosL,EAAD,CACEnkM,KAAK,eACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,aAClBN,aAAc/tL,IAAgByB,MAAhB,eAEhB,kBAACosL,EAAD,CACEnkM,KAAK,UACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,QAClBN,aAAc/tL,IAAgByB,MAAhB,UAEhB,kBAACosL,EAAD,CACEnkM,KAAK,cACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,YAClBN,aAAc/tL,IAAgByB,MAAhB,cAGhB,6BACA,kBAACosL,EAAD,CACEnkM,KAAK,aACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,WAClBN,aAAc/tL,IAAgByB,MAAhB,aAEhB,kBAACosL,EAAD,CACEnkM,KAAK,QACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,MAClBN,aAAc/tL,IAAgByB,MAAhB,QAEhB,kBAACosL,EAAD,CACEnkM,KAAK,YACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,UAClBN,aAAc/tL,IAAgByB,MAAhB,YAGhB,6BACA,kBAACosL,EAAD,CACEnkM,KAAK,iBACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,eAClBN,aAAc/tL,IAAgByB,MAAhB,iBAEhB,kBAACosL,EAAD,CACEnkM,KAAK,YACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,UAClBN,aAAc/tL,IAAgByB,MAAhB,YAEhB,kBAACosL,EAAD,CACEnkM,KAAK,gBACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,cAClBN,aAAc/tL,IAAgByB,MAAhB,gBAGhB,6BACA,kBAACosL,EAAD,CACEnkM,KAAK,eACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,aAClBN,aAAc/tL,IAAgByB,MAAhB,eAEhB,kBAACosL,EAAD,CACEnkM,KAAK,UACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,QAClBN,aAAc/tL,IAAgByB,MAAhB,UAEhB,kBAACosL,EAAD,CACEnkM,KAAK,cACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,YAClBN,aAAc/tL,IAAgByB,MAAhB,cAGhB,6BACA,kBAACosL,EAAD,CACEnkM,KAAK,YACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,UAClBN,aAAc/tL,IAAgByB,MAAhB,YAEhB,kBAACosL,EAAD,CACEnkM,KAAK,OACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,KAClBN,aAAc/tL,IAAgByB,MAAhB,OAEhB,kBAACosL,EAAD,CACEnkM,KAAK,WACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,SAClBN,aAAc/tL,IAAgByB,MAAhB,WAGhB,6BACA,kBAACosL,EAAD,CACEnkM,KAAK,YACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,UAClBN,aAAc/tL,IAAgByB,MAAhB,YAEhB,kBAACosL,EAAD,CACEnkM,KAAK,OACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,KAClBN,aAAc/tL,IAAgByB,MAAhB,OAEhB,kBAACosL,EAAD,CACEnkM,KAAK,QACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,MAClBN,aAAc/tL,IAAgByB,MAAhB,QAEhB,kBAACosL,EAAD,CACEnkM,KAAK,QACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,MAClBN,aAAc/tL,IAAgByB,MAAhB,QAEhB,kBAACosL,EAAD,CACEnkM,KAAK,oBACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,kBAClBN,aAAc/tL,IAAgByB,MAAhB,oBAEhB,kBAACosL,EAAD,CACEnkM,KAAK,sBACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,oBAClBN,aAAc/tL,IAAgByB,MAAhB,sBAEhB,kBAACosL,EAAD,CACEnkM,KAAK,SACLokM,cAAeA,EACf30K,MAAOk1K,EAAW,OAClBN,aAAc/tL,IAAgByB,MAAhB,SAGhB,6BACA,kBAACosL,EAAD,CACEnkM,KAAK,KACLok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,UAAUR,GAIwBr6B,SAASqmC,KAAKz6B,WAAW,aACvEnyC,OAAO+pN,eAAiB,WACtB,MAAO","file":"main.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([1392,1]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import { PlayerObject } from \"./PersonObjects/Player/PlayerObject\";\nimport { sanitizeExploits } from \"./Exploits/Exploit\";\n\nimport { Reviver } from \"./utils/JSONReviver\";\n\nexport let Player = new PlayerObject();\n\nexport function loadPlayer(saveString: string): void {\n Player = JSON.parse(saveString, Reviver);\n Player.money = parseFloat(Player.money as any);\n Player.exploits = sanitizeExploits(Player.exploits);\n}\n","import numeral from \"numeral\";\nimport \"numeral/locales/bg\";\nimport \"numeral/locales/cs\";\nimport \"numeral/locales/da-dk\";\nimport \"numeral/locales/de\";\nimport \"numeral/locales/en-au\";\nimport \"numeral/locales/en-gb\";\nimport \"numeral/locales/es\";\nimport \"numeral/locales/fr\";\nimport \"numeral/locales/hu\";\nimport \"numeral/locales/it\";\nimport \"numeral/locales/lv\";\nimport \"numeral/locales/no\";\nimport \"numeral/locales/pl\";\nimport \"numeral/locales/ru\";\n\nimport { Settings } from \"../Settings/Settings\";\n\n/* eslint-disable class-methods-use-this */\n\nconst extraFormats = [1e15, 1e18, 1e21, 1e24, 1e27, 1e30];\nconst extraNotations = [\"q\", \"Q\", \"s\", \"S\", \"o\", \"n\"];\nconst gigaMultiplier = { standard: 1e9, iec60027_2: 2 ** 30 };\n\nclass NumeralFormatter {\n // Default Locale\n defaultLocale = \"en\";\n\n constructor() {\n this.defaultLocale = \"en\";\n }\n\n updateLocale(l: string): boolean {\n if (numeral.locale(l) == null) {\n console.warn(`Invalid locale for numeral: ${l}`);\n\n numeral.locale(this.defaultLocale);\n return false;\n }\n return true;\n }\n\n format(n: number, format: string): string {\n // numeraljs doesnt properly format numbers that are too big or too small\n if (Math.abs(n) < 1e-6) {\n n = 0;\n }\n const answer = numeral(n).format(format);\n if (answer === \"NaN\") {\n return `${n}`;\n }\n return answer;\n }\n\n formatBigNumber(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n // TODO: leverage numeral.js to do it. This function also implies you can\n // use this format in some text field but you can't. ( \"1t\" will parse but\n // \"1s\" will not)\n formatReallyBigNumber(n: number, decimalPlaces = 3): string {\n if (n === Infinity) return \"∞\";\n for (let i = 0; i < extraFormats.length; i++) {\n if (extraFormats[i] < n && n <= extraFormats[i] * 1000) {\n return this.format(n / extraFormats[i], \"0.\" + \"0\".repeat(decimalPlaces)) + extraNotations[i];\n }\n }\n if (Math.abs(n) < 1000) {\n return this.format(n, \"0.\" + \"0\".repeat(decimalPlaces));\n }\n const str = this.format(n, \"0.\" + \"0\".repeat(decimalPlaces) + \"a\");\n if (str === \"NaNt\") return this.format(n, \"0.\" + \" \".repeat(decimalPlaces) + \"e+0\");\n return str;\n }\n\n formatHp(n: number): string {\n if (n < 1e6) {\n return this.format(n, \"0,0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatMoney(n: number): string {\n return \"$\" + this.formatReallyBigNumber(n);\n }\n\n formatSkill(n: number): string {\n if (n < 1e15) {\n return this.format(n, \"0,0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatExp(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatHashes(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatReputation(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatFavor(n: number): string {\n return this.format(n, \"0,0\");\n }\n\n formatSecurity(n: number): string {\n return n.toFixed(3);\n }\n\n formatRAM(n: number): string {\n if(Settings.UseIEC60027_2)\n {\n return this.format(n * gigaMultiplier.iec60027_2, \"0.00ib\");\n }\n return this.format(n * gigaMultiplier.standard, \"0.00b\");\n }\n\n formatPercentage(n: number, decimalPlaces = 2): string {\n const formatter: string = \"0.\" + \"0\".repeat(decimalPlaces) + \"%\";\n return this.format(n, formatter);\n }\n\n formatServerSecurity(n: number): string {\n return this.format(n, \"0,0.000\");\n }\n\n formatRespect(n: number): string {\n return this.formatReallyBigNumber(n, 5);\n }\n\n formatWanted(n: number): string {\n return this.formatReallyBigNumber(n, 5);\n }\n\n formatMultiplier(n: number): string {\n return this.format(n, \"0,0.00\");\n }\n\n formatSleeveShock(n: number): string {\n return this.format(n, \"0,0.000\");\n }\n\n formatSleeveSynchro(n: number): string {\n return this.format(n, \"0,0.000\");\n }\n\n formatSleeveMemory(n: number): string {\n return this.format(n, \"0\");\n }\n\n formatPopulation(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n formatStamina(n: number): string {\n return this.format(n, \"0.0\");\n }\n\n formatShares(n: number): string {\n if (n < 1000) {\n return this.format(n, \"0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatInfiltrationSecurity(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatThreads(n: number): string {\n return this.format(n, \"0,0\");\n }\n\n formatStaneksGiftHeat(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n formatStaneksGiftCharge(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n formatStaneksGiftPower(n: number): string {\n return this.format(n, \"0.00\");\n }\n\n parseMoney(s: string): number {\n // numeral library does not handle formats like 1e10 well (returns 110),\n // so if both return a valid number, return the biggest one\n const numeralValue = numeral(s).value();\n const parsed = parseFloat(s);\n if (isNaN(parsed) && numeralValue === null) {\n return NaN;\n } else if (isNaN(parsed)) {\n return numeralValue;\n } else if (numeralValue === null) {\n return parsed;\n } else {\n return Math.max(numeralValue, parsed);\n }\n }\n}\n\nexport const numeralWrapper = new NumeralFormatter();\n","/**\n * Bitnode multipliers influence the difficulty of different aspects of the game.\n * Each Bitnode has a different theme/strategy to achieving the end goal, so these multipliers will can help drive the\n * player toward the intended strategy. Unless they really want to play the long, slow game of waiting...\n */\ninterface IBitNodeMultipliers {\n /**\n * Influences how quickly the player's agility level (not exp) scales\n */\n AgilityLevelMultiplier: number;\n\n /**\n * Influences the base cost to purchase an augmentation.\n */\n AugmentationMoneyCost: number;\n\n /**\n * Influences the base rep the player must have with a faction to purchase an augmentation.\n */\n AugmentationRepCost: number;\n\n /**\n * Influences how quickly the player can gain rank within Bladeburner.\n */\n BladeburnerRank: number;\n\n /**\n * Influences the cost of skill levels from Bladeburner.\n */\n BladeburnerSkillCost: number;\n\n /**\n * Influences how quickly the player's charisma level (not exp) scales\n */\n CharismaLevelMultiplier: number;\n\n /**\n * Influences the experience gained for each ability when a player completes a class.\n */\n ClassGymExpGain: number;\n\n /**\n * Influences the amount of money gained from completing Coding Contracts\n **/\n CodingContractMoney: number;\n\n /**\n * Influences the experience gained for each ability when the player completes working their job.\n */\n CompanyWorkExpGain: number;\n\n /**\n * Influences how much money the player earns when completing working their job.\n */\n CompanyWorkMoney: number;\n\n /**\n * Influences the valuation of corporations created by the player.\n */\n CorporationValuation: number;\n\n /**\n * Influences the base experience gained for each ability when the player commits a crime.\n */\n CrimeExpGain: number;\n\n /**\n * Influences the base money gained when the player commits a crime.\n */\n CrimeMoney: number;\n\n /**\n * Influences how many Augmentations you need in order to get invited to the Daedalus faction\n */\n DaedalusAugsRequirement: number;\n\n /**\n * Influences how quickly the player's defense level (not exp) scales\n */\n DefenseLevelMultiplier: number;\n\n /**\n * Influences how quickly the player's dexterity level (not exp) scales\n */\n DexterityLevelMultiplier: number;\n\n /**\n * Influences how much rep the player gains in each faction simply by being a member.\n */\n FactionPassiveRepGain: number;\n\n /**\n * Influences the experience gained for each ability when the player completes work for a Faction.\n */\n FactionWorkExpGain: number;\n\n /**\n * Influences how much rep the player gains when performing work for a faction.\n */\n FactionWorkRepGain: number;\n\n /**\n * Influences how much it costs to unlock the stock market's 4S Market Data API\n */\n FourSigmaMarketDataApiCost: number;\n\n /**\n * Influences how much it costs to unlock the stock market's 4S Market Data (NOT API)\n */\n FourSigmaMarketDataCost: number;\n\n /**\n * Reduces gangs earning.\n */\n GangSoftcap: number;\n\n /**\n * Influences the experienced gained when hacking a server.\n */\n HackExpGain: number;\n\n /**\n * Influences how quickly the player's hacking level (not experience) scales\n */\n HackingLevelMultiplier: number;\n\n /**\n * Influences how much money is produced by Hacknet Nodes.\n * Influeces the hash rate of Hacknet Servers (unlocked in BitNode-9)\n */\n HacknetNodeMoney: number;\n\n /**\n * Influences how much money it costs to upgrade your home computer's RAM\n */\n HomeComputerRamCost: number;\n\n /**\n * Influences how much money is gained when the player infiltrates a company.\n */\n InfiltrationMoney: number;\n\n /**\n * Influences how much rep the player can gain from factions when selling stolen documents and secrets\n */\n InfiltrationRep: number;\n\n /**\n * Influences how much money can be stolen from a server when the player performs a hack against it through\n * the Terminal.\n */\n ManualHackMoney: number;\n\n /**\n * Influence how much it costs to purchase a server\n */\n PurchasedServerCost: number;\n\n /**\n * Influence how much it costs to purchase a server\n */\n PurchasedServerSoftcap: number;\n\n /**\n * Influences the maximum number of purchased servers you can have\n */\n PurchasedServerLimit: number;\n\n /**\n * Influences the maximum allowed RAM for a purchased server\n */\n PurchasedServerMaxRam: number;\n /**\n * Influences the minimum favor the player must have with a faction before they can donate to gain rep.\n */\n RepToDonateToFaction: number;\n\n /**\n * Influences how much money can be stolen from a server when a script performs a hack against it.\n */\n ScriptHackMoney: number;\n\n /**\n * The amount of money actually gained when script hack a server. This is\n * different than the above because you can reduce the amount of money but\n * not gain that same amount.\n */\n ScriptHackMoneyGain: number;\n\n /**\n * Influences the growth percentage per cycle against a server.\n */\n ServerGrowthRate: number;\n\n /**\n * Influences the maxmimum money that a server can grow to.\n */\n ServerMaxMoney: number;\n\n /**\n * Influences the initial money that a server starts with.\n */\n ServerStartingMoney: number;\n\n /**\n * Influences the initial security level (hackDifficulty) of a server.\n */\n ServerStartingSecurity: number;\n\n /**\n * Influences the weaken amount per invocation against a server.\n */\n ServerWeakenRate: number;\n\n /**\n * Influences how quickly the player's strength level (not exp) scales\n */\n StrengthLevelMultiplier: number;\n\n /**\n * Influences the power of the gift.\n */\n StaneksGiftPowerMultiplier: number;\n\n /**\n * Influences the size of the gift.\n */\n StaneksGiftExtraSize: number;\n\n /**\n * Influences the hacking skill required to backdoor the world daemon.\n */\n WorldDaemonDifficulty: number;\n\n // Index signature\n [key: string]: number;\n}\n\n/**\n * The multipliers that are influenced by current Bitnode progression.\n */\n// tslint:disable-next-line:variable-name\nexport const BitNodeMultipliers: IBitNodeMultipliers = {\n HackingLevelMultiplier: 1,\n StrengthLevelMultiplier: 1,\n DefenseLevelMultiplier: 1,\n DexterityLevelMultiplier: 1,\n AgilityLevelMultiplier: 1,\n CharismaLevelMultiplier: 1,\n\n ServerGrowthRate: 1,\n ServerMaxMoney: 1,\n ServerStartingMoney: 1,\n ServerStartingSecurity: 1,\n ServerWeakenRate: 1,\n\n HomeComputerRamCost: 1,\n\n PurchasedServerCost: 1,\n PurchasedServerSoftcap: 1,\n PurchasedServerLimit: 1,\n PurchasedServerMaxRam: 1,\n\n CompanyWorkMoney: 1,\n CrimeMoney: 1,\n HacknetNodeMoney: 1,\n ManualHackMoney: 1,\n ScriptHackMoney: 1,\n ScriptHackMoneyGain: 1,\n CodingContractMoney: 1,\n\n ClassGymExpGain: 1,\n CompanyWorkExpGain: 1,\n CrimeExpGain: 1,\n FactionWorkExpGain: 1,\n HackExpGain: 1,\n\n FactionPassiveRepGain: 1,\n FactionWorkRepGain: 1,\n RepToDonateToFaction: 1,\n\n AugmentationMoneyCost: 1,\n AugmentationRepCost: 1,\n\n InfiltrationMoney: 1,\n InfiltrationRep: 1,\n\n FourSigmaMarketDataCost: 1,\n FourSigmaMarketDataApiCost: 1,\n\n CorporationValuation: 1,\n CorporationSoftCap: 1,\n\n BladeburnerRank: 1,\n BladeburnerSkillCost: 1,\n\n GangSoftcap: 1,\n\n DaedalusAugsRequirement: 1,\n\n StaneksGiftPowerMultiplier: 1,\n StaneksGiftExtraSize: 0,\n\n WorldDaemonDifficulty: 1,\n};\n","export const AugmentationNames: {\n Targeting1: string;\n Targeting2: string;\n Targeting3: string;\n SyntheticHeart: string;\n SynfibrilMuscle: string;\n CombatRib1: string;\n CombatRib2: string;\n CombatRib3: string;\n NanofiberWeave: string;\n SubdermalArmor: string;\n WiredReflexes: string;\n GrapheneBoneLacings: string;\n BionicSpine: string;\n GrapheneBionicSpine: string;\n BionicLegs: string;\n GrapheneBionicLegs: string;\n SpeechProcessor: string;\n TITN41Injection: string;\n EnhancedSocialInteractionImplant: string;\n BitWire: string;\n ArtificialBioNeuralNetwork: string;\n ArtificialSynapticPotentiation: string;\n EnhancedMyelinSheathing: string;\n SynapticEnhancement: string;\n NeuralRetentionEnhancement: string;\n DataJack: string;\n ENM: string;\n ENMCore: string;\n ENMCoreV2: string;\n ENMCoreV3: string;\n ENMAnalyzeEngine: string;\n ENMDMA: string;\n Neuralstimulator: string;\n NeuralAccelerator: string;\n CranialSignalProcessorsG1: string;\n CranialSignalProcessorsG2: string;\n CranialSignalProcessorsG3: string;\n CranialSignalProcessorsG4: string;\n CranialSignalProcessorsG5: string;\n NeuronalDensification: string;\n NeuroreceptorManager: string;\n NuoptimalInjectorImplant: string;\n SpeechEnhancement: string;\n FocusWire: string;\n PCDNI: string;\n PCDNIOptimizer: string;\n PCDNINeuralNetwork: string;\n PCMatrix: string;\n ADRPheromone1: string;\n ADRPheromone2: string;\n ShadowsSimulacrum: string;\n HacknetNodeCPUUpload: string;\n HacknetNodeCacheUpload: string;\n HacknetNodeNICUpload: string;\n HacknetNodeKernelDNI: string;\n HacknetNodeCoreDNI: string;\n NeuroFluxGovernor: string;\n Neurotrainer1: string;\n Neurotrainer2: string;\n Neurotrainer3: string;\n Hypersight: string;\n LuminCloaking1: string;\n LuminCloaking2: string;\n HemoRecirculator: string;\n SmartSonar: string;\n PowerRecirculator: string;\n QLink: string;\n TheRedPill: string;\n SPTN97: string;\n HiveMind: string;\n CordiARCReactor: string;\n SmartJaw: string;\n Neotra: string;\n Xanipher: string;\n nextSENS: string;\n OmniTekInfoLoad: string;\n PhotosyntheticCells: string;\n Neurolink: string;\n TheBlackHand: string;\n UnstableCircadianModulator: string;\n CRTX42AA: string;\n Neuregen: string;\n CashRoot: string;\n NutriGen: string;\n INFRARet: string;\n DermaForce: string;\n GrapheneBrachiBlades: string;\n GrapheneBionicArms: string;\n BrachiBlades: string;\n BionicArms: string;\n SNA: string;\n HydroflameLeftArm: string;\n EsperEyewear: string;\n EMS4Recombination: string;\n OrionShoulder: string;\n HyperionV1: string;\n HyperionV2: string;\n GolemSerum: string;\n VangelisVirus: string;\n VangelisVirus3: string;\n INTERLINKED: string;\n BladeRunner: string;\n BladeArmor: string;\n BladeArmorPowerCells: string;\n BladeArmorEnergyShielding: string;\n BladeArmorUnibeam: string;\n BladeArmorOmnibeam: string;\n BladeArmorIPU: string;\n BladesSimulacrum: string;\n StaneksGift1: string;\n StaneksGift2: string;\n StaneksGift3: string;\n} = {\n Targeting1: \"Augmented Targeting I\",\n Targeting2: \"Augmented Targeting II\",\n Targeting3: \"Augmented Targeting III\",\n SyntheticHeart: \"Synthetic Heart\",\n SynfibrilMuscle: \"Synfibril Muscle\",\n CombatRib1: \"Combat Rib I\",\n CombatRib2: \"Combat Rib II\",\n CombatRib3: \"Combat Rib III\",\n NanofiberWeave: \"Nanofiber Weave\",\n SubdermalArmor: \"NEMEAN Subdermal Weave\",\n WiredReflexes: \"Wired Reflexes\",\n GrapheneBoneLacings: \"Graphene Bone Lacings\",\n BionicSpine: \"Bionic Spine\",\n GrapheneBionicSpine: \"Graphene Bionic Spine Upgrade\",\n BionicLegs: \"Bionic Legs\",\n GrapheneBionicLegs: \"Graphene Bionic Legs Upgrade\",\n SpeechProcessor: \"Speech Processor Implant\",\n TITN41Injection: \"TITN-41 Gene-Modification Injection\",\n EnhancedSocialInteractionImplant: \"Enhanced Social Interaction Implant\",\n BitWire: \"BitWire\",\n ArtificialBioNeuralNetwork: \"Artificial Bio-neural Network Implant\",\n ArtificialSynapticPotentiation: \"Artificial Synaptic Potentiation\",\n EnhancedMyelinSheathing: \"Enhanced Myelin Sheathing\",\n SynapticEnhancement: \"Synaptic Enhancement Implant\",\n NeuralRetentionEnhancement: \"Neural-Retention Enhancement\",\n DataJack: \"DataJack\",\n ENM: \"Embedded Netburner Module\",\n ENMCore: \"Embedded Netburner Module Core Implant\",\n ENMCoreV2: \"Embedded Netburner Module Core V2 Upgrade\",\n ENMCoreV3: \"Embedded Netburner Module Core V3 Upgrade\",\n ENMAnalyzeEngine: \"Embedded Netburner Module Analyze Engine\",\n ENMDMA: \"Embedded Netburner Module Direct Memory Access Upgrade\",\n Neuralstimulator: \"Neuralstimulator\",\n NeuralAccelerator: \"Neural Accelerator\",\n CranialSignalProcessorsG1: \"Cranial Signal Processors - Gen I\",\n CranialSignalProcessorsG2: \"Cranial Signal Processors - Gen II\",\n CranialSignalProcessorsG3: \"Cranial Signal Processors - Gen III\",\n CranialSignalProcessorsG4: \"Cranial Signal Processors - Gen IV\",\n CranialSignalProcessorsG5: \"Cranial Signal Processors - Gen V\",\n NeuronalDensification: \"Neuronal Densification\",\n NeuroreceptorManager: \"Neuroreceptor Management Implant\",\n NuoptimalInjectorImplant: \"Nuoptimal Nootropic Injector Implant\",\n SpeechEnhancement: \"Speech Enhancement\",\n FocusWire: \"FocusWire\",\n PCDNI: \"PC Direct-Neural Interface\",\n PCDNIOptimizer: \"PC Direct-Neural Interface Optimization Submodule\",\n PCDNINeuralNetwork: \"PC Direct-Neural Interface NeuroNet Injector\",\n PCMatrix: \"PCMatrix\",\n ADRPheromone1: \"ADR-V1 Pheromone Gene\",\n ADRPheromone2: \"ADR-V2 Pheromone Gene\",\n ShadowsSimulacrum: \"The Shadow's Simulacrum\",\n HacknetNodeCPUUpload: \"Hacknet Node CPU Architecture Neural-Upload\",\n HacknetNodeCacheUpload: \"Hacknet Node Cache Architecture Neural-Upload\",\n HacknetNodeNICUpload: \"Hacknet Node NIC Architecture Neural-Upload\",\n HacknetNodeKernelDNI: \"Hacknet Node Kernel Direct-Neural Interface\",\n HacknetNodeCoreDNI: \"Hacknet Node Core Direct-Neural Interface\",\n NeuroFluxGovernor: \"NeuroFlux Governor\",\n Neurotrainer1: \"Neurotrainer I\",\n Neurotrainer2: \"Neurotrainer II\",\n Neurotrainer3: \"Neurotrainer III\",\n Hypersight: \"HyperSight Corneal Implant\",\n LuminCloaking1: \"LuminCloaking-V1 Skin Implant\",\n LuminCloaking2: \"LuminCloaking-V2 Skin Implant\",\n HemoRecirculator: \"HemoRecirculator\",\n SmartSonar: \"SmartSonar Implant\",\n PowerRecirculator: \"Power Recirculation Core\",\n QLink: \"QLink\",\n TheRedPill: \"The Red Pill\",\n SPTN97: \"SPTN-97 Gene Modification\",\n HiveMind: \"ECorp HVMind Implant\",\n CordiARCReactor: \"CordiARC Fusion Reactor\",\n SmartJaw: \"SmartJaw\",\n Neotra: \"Neotra\",\n Xanipher: \"Xanipher\",\n nextSENS: \"nextSENS Gene Modification\",\n OmniTekInfoLoad: \"OmniTek InfoLoad\",\n PhotosyntheticCells: \"Photosynthetic Cells\",\n Neurolink: \"BitRunners Neurolink\",\n TheBlackHand: \"The Black Hand\",\n UnstableCircadianModulator: \"Unstable Circadian Modulator\",\n CRTX42AA: \"CRTX42-AA Gene Modification\",\n Neuregen: \"Neuregen Gene Modification\",\n CashRoot: \"CashRoot Starter Kit\",\n NutriGen: \"NutriGen Implant\",\n INFRARet: \"INFRARET Enhancement\",\n DermaForce: \"DermaForce Particle Barrier\",\n GrapheneBrachiBlades: \"Graphene BrachiBlades Upgrade\",\n GrapheneBionicArms: \"Graphene Bionic Arms Upgrade\",\n BrachiBlades: \"BrachiBlades\",\n BionicArms: \"Bionic Arms\",\n SNA: \"Social Negotiation Assistant (S.N.A)\",\n HydroflameLeftArm: \"Hydroflame Left Arm\",\n EsperEyewear: \"EsperTech Bladeburner Eyewear\",\n EMS4Recombination: \"EMS-4 Recombination\",\n OrionShoulder: \"ORION-MKIV Shoulder\",\n HyperionV1: \"Hyperion Plasma Cannon V1\",\n HyperionV2: \"Hyperion Plasma Cannon V2\",\n GolemSerum: \"GOLEM Serum\",\n VangelisVirus: \"Vangelis Virus\",\n VangelisVirus3: \"Vangelis Virus 3.0\",\n INTERLINKED: \"I.N.T.E.R.L.I.N.K.E.D\",\n BladeRunner: \"Blade's Runners\",\n BladeArmor: \"BLADE-51b Tesla Armor\",\n BladeArmorPowerCells: \"BLADE-51b Tesla Armor: Power Cells Upgrade\",\n BladeArmorEnergyShielding: \"BLADE-51b Tesla Armor: Energy Shielding Upgrade\",\n BladeArmorUnibeam: \"BLADE-51b Tesla Armor: Unibeam Upgrade\",\n BladeArmorOmnibeam: \"BLADE-51b Tesla Armor: Omnibeam Upgrade\",\n BladeArmorIPU: \"BLADE-51b Tesla Armor: IPU Upgrade\",\n BladesSimulacrum: \"The Blade's Simulacrum\",\n\n StaneksGift1: \"Stanek's Gift - Genesis\",\n StaneksGift2: \"Stanek's Gift - Awakening\",\n StaneksGift3: \"Stanek's Gift - Serenity\",\n\n //Wasteland Augs\n //PepBoy: \"P.E.P-Boy\", Plasma Energy Projection System\n //PepBoyForceField Generates plasma force fields\n //PepBoyBlasts Generate high density plasma concussive blasts\n //PepBoyDataStorage STore more data on pep boy,\n};\n","/**\n * Generic Game Constants\n *\n * Constants for specific mechanics or features will NOT be here.\n */\nexport const CONSTANTS: {\n VersionString: string;\n VersionNumber: number;\n _idleSpeed: number;\n MaxSkillLevel: number;\n MilliPerCycle: number;\n CorpFactionRepRequirement: number;\n BaseFocusBonus: number;\n BaseCostFor1GBOfRamHome: number;\n BaseCostFor1GBOfRamServer: number;\n TravelCost: number;\n BaseFavorToDonate: number;\n DonateMoneyToRepDivisor: number;\n FactionReputationToFavorBase: number;\n FactionReputationToFavorMult: number;\n CompanyReputationToFavorBase: number;\n CompanyReputationToFavorMult: number;\n NeuroFluxGovernorLevelMult: number;\n NumNetscriptPorts: number;\n HomeComputerMaxRam: number;\n ServerBaseGrowthRate: number;\n ServerMaxGrowthRate: number;\n ServerFortifyAmount: number;\n ServerWeakenAmount: number;\n PurchasedServerLimit: number;\n PurchasedServerMaxRam: number;\n MultipleAugMultiplier: number;\n TorRouterCost: number;\n WSEAccountCost: number;\n TIXAPICost: number;\n MarketData4SCost: number;\n MarketDataTixApi4SCost: number;\n StockMarketCommission: number;\n HospitalCostPerHp: number;\n IntelligenceCrimeWeight: number;\n IntelligenceInfiltrationWeight: number;\n IntelligenceCrimeBaseExpGain: number;\n IntelligenceProgramBaseExpGain: number;\n IntelligenceTerminalHackBaseExpGain: number;\n IntelligenceSingFnBaseExpGain: number;\n IntelligenceClassBaseExpGain: number;\n MillisecondsPer20Hours: number;\n GameCyclesPer20Hours: number;\n MillisecondsPer10Hours: number;\n GameCyclesPer10Hours: number;\n MillisecondsPer8Hours: number;\n GameCyclesPer8Hours: number;\n MillisecondsPer4Hours: number;\n GameCyclesPer4Hours: number;\n MillisecondsPer2Hours: number;\n GameCyclesPer2Hours: number;\n MillisecondsPerHour: number;\n GameCyclesPerHour: number;\n MillisecondsPerHalfHour: number;\n GameCyclesPerHalfHour: number;\n MillisecondsPerQuarterHour: number;\n GameCyclesPerQuarterHour: number;\n MillisecondsPerFiveMinutes: number;\n GameCyclesPerFiveMinutes: number;\n FactionWorkHacking: string;\n FactionWorkField: string;\n FactionWorkSecurity: string;\n WorkTypeCompany: string;\n WorkTypeCompanyPartTime: string;\n WorkTypeFaction: string;\n WorkTypeCreateProgram: string;\n WorkTypeStudyClass: string;\n WorkTypeCrime: string;\n ClassStudyComputerScience: string;\n ClassDataStructures: string;\n ClassNetworks: string;\n ClassAlgorithms: string;\n ClassManagement: string;\n ClassLeadership: string;\n ClassGymStrength: string;\n ClassGymDefense: string;\n ClassGymDexterity: string;\n ClassGymAgility: string;\n ClassDataStructuresBaseCost: number;\n ClassNetworksBaseCost: number;\n ClassAlgorithmsBaseCost: number;\n ClassManagementBaseCost: number;\n ClassLeadershipBaseCost: number;\n ClassGymBaseCost: number;\n ClassStudyComputerScienceBaseExp: number;\n ClassDataStructuresBaseExp: number;\n ClassNetworksBaseExp: number;\n ClassAlgorithmsBaseExp: number;\n ClassManagementBaseExp: number;\n ClassLeadershipBaseExp: number;\n CrimeShoplift: string;\n CrimeRobStore: string;\n CrimeMug: string;\n CrimeLarceny: string;\n CrimeDrugs: string;\n CrimeBondForgery: string;\n CrimeTraffickArms: string;\n CrimeHomicide: string;\n CrimeGrandTheftAuto: string;\n CrimeKidnap: string;\n CrimeAssassination: string;\n CrimeHeist: string;\n CodingContractBaseFactionRepGain: number;\n CodingContractBaseCompanyRepGain: number;\n CodingContractBaseMoneyGain: number;\n TotalNumBitNodes: number;\n LatestUpdate: string;\n} = {\n VersionString: \"1.4.0\",\n VersionNumber: 10,\n\n // Speed (in ms) at which the main loop is updated\n _idleSpeed: 200,\n\n /** Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience\n * and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then\n * the player will have this level assuming no multipliers. Multipliers can cause skills to go above this.\n */\n MaxSkillLevel: 975,\n\n // Milliseconds per game cycle\n MilliPerCycle: 200,\n\n // How much reputation is needed to join a megacorporation's faction\n CorpFactionRepRequirement: 200e3,\n\n // Base RAM costs\n BaseCostFor1GBOfRamHome: 32000,\n BaseCostFor1GBOfRamServer: 55000, //1 GB of RAM\n\n // Cost to travel to another city\n TravelCost: 200e3,\n\n // Faction and Company favor-related things\n BaseFavorToDonate: 150,\n DonateMoneyToRepDivisor: 1e6,\n FactionReputationToFavorBase: 500,\n FactionReputationToFavorMult: 1.02,\n CompanyReputationToFavorBase: 500,\n CompanyReputationToFavorMult: 1.02,\n\n // NeuroFlux Governor Augmentation cost multiplier\n NeuroFluxGovernorLevelMult: 1.14,\n\n NumNetscriptPorts: 20,\n\n // Server-related constants\n HomeComputerMaxRam: 1073741824, // 2 ^ 30\n ServerBaseGrowthRate: 1.03, // Unadjusted Growth rate\n ServerMaxGrowthRate: 1.0035, // Maximum possible growth rate (max rate accounting for server security)\n ServerFortifyAmount: 0.002, // Amount by which server's security increases when its hacked/grown\n ServerWeakenAmount: 0.05, // Amount by which server's security decreases when weakened\n\n PurchasedServerLimit: 25,\n PurchasedServerMaxRam: 1048576, // 2^20\n\n // Augmentation Constants\n MultipleAugMultiplier: 1.9,\n\n // TOR Router\n TorRouterCost: 200e3,\n\n // Stock market\n WSEAccountCost: 200e6,\n TIXAPICost: 5e9,\n MarketData4SCost: 1e9,\n MarketDataTixApi4SCost: 25e9,\n StockMarketCommission: 100e3,\n\n // Hospital/Health\n HospitalCostPerHp: 100e3,\n\n // Intelligence-related constants\n IntelligenceCrimeWeight: 0.025, // Weight for how much int affects crime success rates\n IntelligenceInfiltrationWeight: 0.1, // Weight for how much int affects infiltration success rates\n IntelligenceCrimeBaseExpGain: 0.05,\n IntelligenceProgramBaseExpGain: 0.1, // Program required hack level divided by this to determine int exp gain\n IntelligenceTerminalHackBaseExpGain: 200, // Hacking exp divided by this to determine int exp gain\n IntelligenceSingFnBaseExpGain: 1.5,\n IntelligenceClassBaseExpGain: 0.01,\n\n // Time-related constants\n MillisecondsPer20Hours: 72000000,\n GameCyclesPer20Hours: 72000000 / 200,\n\n MillisecondsPer10Hours: 36000000,\n GameCyclesPer10Hours: 36000000 / 200,\n\n MillisecondsPer8Hours: 28800000,\n GameCyclesPer8Hours: 28800000 / 200,\n\n MillisecondsPer4Hours: 14400000,\n GameCyclesPer4Hours: 14400000 / 200,\n\n MillisecondsPer2Hours: 7200000,\n GameCyclesPer2Hours: 7200000 / 200,\n\n MillisecondsPerHour: 3600000,\n GameCyclesPerHour: 3600000 / 200,\n\n MillisecondsPerHalfHour: 1800000,\n GameCyclesPerHalfHour: 1800000 / 200,\n\n MillisecondsPerQuarterHour: 900000,\n GameCyclesPerQuarterHour: 900000 / 200,\n\n MillisecondsPerFiveMinutes: 300000,\n GameCyclesPerFiveMinutes: 300000 / 200,\n\n // Player Work & Action\n BaseFocusBonus: 0.8,\n FactionWorkHacking: \"Faction Hacking Work\",\n FactionWorkField: \"Faction Field Work\",\n FactionWorkSecurity: \"Faction Security Work\",\n\n WorkTypeCompany: \"Working for Company\",\n WorkTypeCompanyPartTime: \"Working for Company part-time\",\n WorkTypeFaction: \"Working for Faction\",\n WorkTypeCreateProgram: \"Working on Create a Program\",\n WorkTypeStudyClass: \"Studying or Taking a class at university\",\n WorkTypeCrime: \"Committing a crime\",\n\n ClassStudyComputerScience: \"studying Computer Science\",\n ClassDataStructures: \"taking a Data Structures course\",\n ClassNetworks: \"taking a Networks course\",\n ClassAlgorithms: \"taking an Algorithms course\",\n ClassManagement: \"taking a Management course\",\n ClassLeadership: \"taking a Leadership course\",\n ClassGymStrength: \"training your strength at a gym\",\n ClassGymDefense: \"training your defense at a gym\",\n ClassGymDexterity: \"training your dexterity at a gym\",\n ClassGymAgility: \"training your agility at a gym\",\n\n ClassDataStructuresBaseCost: 40,\n ClassNetworksBaseCost: 80,\n ClassAlgorithmsBaseCost: 320,\n ClassManagementBaseCost: 160,\n ClassLeadershipBaseCost: 320,\n ClassGymBaseCost: 120,\n\n ClassStudyComputerScienceBaseExp: 0.5,\n ClassDataStructuresBaseExp: 1,\n ClassNetworksBaseExp: 2,\n ClassAlgorithmsBaseExp: 4,\n ClassManagementBaseExp: 2,\n ClassLeadershipBaseExp: 4,\n\n CrimeShoplift: \"shoplift\",\n CrimeRobStore: \"rob a store\",\n CrimeMug: \"mug someone\",\n CrimeLarceny: \"commit larceny\",\n CrimeDrugs: \"deal drugs\",\n CrimeBondForgery: \"forge corporate bonds\",\n CrimeTraffickArms: \"traffick illegal arms\",\n CrimeHomicide: \"commit homicide\",\n CrimeGrandTheftAuto: \"commit grand theft auto\",\n CrimeKidnap: \"kidnap someone for ransom\",\n CrimeAssassination: \"assassinate a high-profile target\",\n CrimeHeist: \"pull off the ultimate heist\",\n\n // Coding Contract\n // TODO: Move this into Coding contract implementation?\n CodingContractBaseFactionRepGain: 2500,\n CodingContractBaseCompanyRepGain: 4000,\n CodingContractBaseMoneyGain: 75e6,\n\n // BitNode/Source-File related stuff\n TotalNumBitNodes: 24,\n\n LatestUpdate: `\n v1.4.0 - 2022-01-18 Sharing is caring\n -------------------------------------\n\n ** Computer sharing **\n\n * A new mechanic has been added, it's is invoked by calling the new function 'share'.\n This mechanic helps you farm reputation faster.\n\n ** gang **\n\n * Installing augs means losing a little bit of ascension multipliers.\n\n ** There's more but I'm going to write it later. **\n\n ** Misc. **\n\n * Nerf noodle bar.\n`,\n};\n","import { ISelfInitializer, ISelfLoading } from \"../types\";\nimport { OwnedAugmentationsOrderSetting, PurchaseAugmentationsOrderSetting } from \"./SettingEnums\";\nimport { defaultTheme, ITheme } from \"../Themes/Themes\";\nimport { defaultStyles } from \"../Themes/Styles\";\nimport { WordWrapOptions } from \"../ScriptEditor/ui/Options\";\nimport { OverviewSettings } from \"../ui/React/Overview\";\nimport { IStyleSettings } from \"../ScriptEditor/NetscriptDefinitions\";\n\n/**\n * Represents the default settings the player could customize.\n */\ninterface IDefaultSettings {\n /**\n * How many servers per page\n */\n ActiveScriptsServerPageSize: number;\n /**\n * How many scripts per page\n */\n ActiveScriptsScriptPageSize: number;\n /**\n * How often the game should autosave the player's progress, in seconds.\n */\n AutosaveInterval: number;\n\n /**\n * How many milliseconds between execution points for Netscript 1 statements.\n */\n CodeInstructionRunTime: number;\n\n /**\n * Render city as list of buttons.\n */\n DisableASCIIArt: boolean;\n\n /**\n * Whether global keyboard shortcuts should be recognized throughout the game.\n */\n DisableHotkeys: boolean;\n\n /**\n * Whether text effects such as corruption should be visible.\n */\n DisableTextEffects: boolean;\n\n /**\n * Whether overview progress bars should be visible.\n */\n DisableOverviewProgressBars: boolean;\n\n /**\n * Enable bash hotkeys\n */\n EnableBashHotkeys: boolean;\n\n /**\n * Timestamps format\n */\n TimestampsFormat: string;\n\n /**\n * Locale used for display numbers\n */\n Locale: string;\n\n /**\n * Limit the number of log entries for each script being executed on each server.\n */\n MaxLogCapacity: number;\n\n /**\n * Limit how many entries can be written to a Netscript Port before entries start to get pushed out.\n */\n MaxPortCapacity: number;\n\n /**\n * Limit the number of entries in the terminal.\n */\n MaxTerminalCapacity: number;\n\n /**\n * Save the game when you save any file.\n */\n SaveGameOnFileSave: boolean;\n\n /**\n * Whether the player should be asked to confirm purchasing each and every augmentation.\n */\n SuppressBuyAugmentationConfirmation: boolean;\n\n /**\n * Whether the user should be prompted to join each faction via a dialog box.\n */\n SuppressFactionInvites: boolean;\n\n /**\n * Whether the user should be shown a dialog box whenever they receive a new message file.\n */\n SuppressMessages: boolean;\n\n /**\n * Whether the user should be asked to confirm travelling between cities.\n */\n SuppressTravelConfirmation: boolean;\n\n /**\n * Whether the user should be displayed a popup message when his Bladeburner actions are cancelled.\n */\n SuppressBladeburnerPopup: boolean;\n\n /**\n * Whether the user should be displayed a popup message on stock market actions.\n */\n SuppressTIXPopup: boolean;\n\n /**\n * Whether the user should be displayed a toast alert when the game is saved.\n */\n SuppressSavedGameToast: boolean;\n\n /*\n * Whether the game should skip saving the running scripts for late game\n */\n ExcludeRunningScriptsFromSave: boolean;\n\n /*\n * Theme colors\n */\n theme: ITheme;\n\n /*\n * Interface styles\n */\n styles: IStyleSettings;\n\n /*\n * Use GiB instead of GB\n */\n UseIEC60027_2: boolean;\n\n /*\n * Character overview settings\n */\n overview: OverviewSettings;\n\n /**\n * If the game's sidebar is opened\n */\n IsSidebarOpened: boolean;\n}\n\n/**\n * Represents all possible settings the player wants to customize to their play style.\n */\ninterface ISettings extends IDefaultSettings {\n /**\n * What order the player's owned Augmentations/Source Files should be displayed in\n */\n OwnedAugmentationsOrder: OwnedAugmentationsOrderSetting;\n\n /**\n * What order the Augmentations should be displayed in when purchasing from a Faction\n */\n PurchaseAugmentationsOrder: PurchaseAugmentationsOrderSetting;\n\n MonacoTheme: string;\n\n MonacoInsertSpaces: boolean;\n\n MonacoFontSize: number;\n\n MonacoVim: boolean;\n\n MonacoWordWrap: WordWrapOptions;\n}\n\nexport const defaultSettings: IDefaultSettings = {\n ActiveScriptsServerPageSize: 10,\n ActiveScriptsScriptPageSize: 10,\n AutosaveInterval: 60,\n CodeInstructionRunTime: 50,\n DisableASCIIArt: false,\n DisableHotkeys: false,\n DisableTextEffects: false,\n DisableOverviewProgressBars: false,\n EnableBashHotkeys: false,\n TimestampsFormat: \"\",\n Locale: \"en\",\n MaxLogCapacity: 50,\n MaxPortCapacity: 50,\n MaxTerminalCapacity: 500,\n SaveGameOnFileSave: true,\n SuppressBuyAugmentationConfirmation: false,\n SuppressFactionInvites: false,\n SuppressMessages: false,\n SuppressTravelConfirmation: false,\n SuppressBladeburnerPopup: false,\n SuppressTIXPopup: false,\n SuppressSavedGameToast: false,\n UseIEC60027_2: false,\n ExcludeRunningScriptsFromSave: false,\n IsSidebarOpened: true,\n\n theme: defaultTheme,\n styles: defaultStyles,\n overview: { x: 0, y: 0, opened: true },\n};\n\n/**\n * The current options the player has customized to their play style.\n */\n// tslint:disable-next-line:variable-name\nexport const Settings: ISettings & ISelfInitializer & ISelfLoading = {\n ActiveScriptsServerPageSize: defaultSettings.ActiveScriptsServerPageSize,\n ActiveScriptsScriptPageSize: defaultSettings.ActiveScriptsScriptPageSize,\n AutosaveInterval: defaultSettings.AutosaveInterval,\n CodeInstructionRunTime: 25,\n DisableASCIIArt: defaultSettings.DisableASCIIArt,\n DisableHotkeys: defaultSettings.DisableHotkeys,\n DisableTextEffects: defaultSettings.DisableTextEffects,\n DisableOverviewProgressBars: defaultSettings.DisableOverviewProgressBars,\n EnableBashHotkeys: defaultSettings.EnableBashHotkeys,\n TimestampsFormat: defaultSettings.TimestampsFormat,\n Locale: \"en\",\n MaxLogCapacity: defaultSettings.MaxLogCapacity,\n MaxPortCapacity: defaultSettings.MaxPortCapacity,\n MaxTerminalCapacity: defaultSettings.MaxTerminalCapacity,\n OwnedAugmentationsOrder: OwnedAugmentationsOrderSetting.AcquirementTime,\n PurchaseAugmentationsOrder: PurchaseAugmentationsOrderSetting.Default,\n SaveGameOnFileSave: defaultSettings.SaveGameOnFileSave,\n SuppressBuyAugmentationConfirmation: defaultSettings.SuppressBuyAugmentationConfirmation,\n SuppressFactionInvites: defaultSettings.SuppressFactionInvites,\n SuppressMessages: defaultSettings.SuppressMessages,\n SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation,\n SuppressBladeburnerPopup: defaultSettings.SuppressBladeburnerPopup,\n SuppressTIXPopup: defaultSettings.SuppressTIXPopup,\n SuppressSavedGameToast: defaultSettings.SuppressSavedGameToast,\n UseIEC60027_2: defaultSettings.UseIEC60027_2,\n ExcludeRunningScriptsFromSave: defaultSettings.ExcludeRunningScriptsFromSave,\n IsSidebarOpened: defaultSettings.IsSidebarOpened,\n\n MonacoTheme: \"monokai\",\n MonacoInsertSpaces: false,\n MonacoFontSize: 20,\n MonacoVim: false,\n MonacoWordWrap: \"off\",\n\n theme: { ...defaultTheme },\n styles: { ...defaultStyles },\n overview: defaultSettings.overview,\n init() {\n Object.assign(Settings, defaultSettings);\n },\n load(saveString: string) {\n const save = JSON.parse(saveString);\n Object.assign(Settings.theme, save.theme);\n delete save.theme;\n Object.assign(Settings.styles, save.styles);\n delete save.styles;\n Object.assign(Settings.overview, save.overview);\n delete save.overview;\n Object.assign(Settings, save);\n },\n};\n","/**\n * Names of all locations\n */\nexport enum LocationName {\n // Cities\n Aevum = \"Aevum\",\n Chongqing = \"Chongqing\",\n Ishima = \"Ishima\",\n NewTokyo = \"New Tokyo\",\n Sector12 = \"Sector-12\",\n Volhaven = \"Volhaven\",\n\n // Aevum Locations\n AevumAeroCorp = \"AeroCorp\",\n AevumBachmanAndAssociates = \"Bachman & Associates\",\n AevumClarkeIncorporated = \"Clarke Incorporated\",\n AevumCrushFitnessGym = \"Crush Fitness Gym\",\n AevumECorp = \"ECorp\",\n AevumFulcrumTechnologies = \"Fulcrum Technologies\",\n AevumGalacticCybersystems = \"Galactic Cybersystems\",\n AevumNetLinkTechnologies = \"NetLink Technologies\",\n AevumPolice = \"Aevum Police Headquarters\",\n AevumRhoConstruction = \"Rho Construction\",\n AevumSnapFitnessGym = \"Snap Fitness Gym\",\n AevumSummitUniversity = \"Summit University\",\n AevumWatchdogSecurity = \"Watchdog Security\",\n AevumCasino = \"Iker Molina Casino\",\n\n // Chongqing locations\n ChongqingKuaiGongInternational = \"KuaiGong International\",\n ChongqingSolarisSpaceSystems = \"Solaris Space Systems\",\n ChongqingChurchOfTheMachineGod = \"Church of the Machine God\",\n\n // Sector 12\n Sector12AlphaEnterprises = \"Alpha Enterprises\",\n Sector12BladeIndustries = \"Blade Industries\",\n Sector12CIA = \"Central Intelligence Agency\",\n Sector12CarmichaelSecurity = \"Carmichael Security\",\n Sector12CityHall = \"Sector-12 City Hall\",\n Sector12DeltaOne = \"DeltaOne\",\n Sector12FoodNStuff = \"FoodNStuff\",\n Sector12FourSigma = \"Four Sigma\",\n Sector12IcarusMicrosystems = \"Icarus Microsystems\",\n Sector12IronGym = \"Iron Gym\",\n Sector12JoesGuns = \"Joe's Guns\",\n Sector12MegaCorp = \"MegaCorp\",\n Sector12NSA = \"National Security Agency\",\n Sector12PowerhouseGym = \"Powerhouse Gym\",\n Sector12RothmanUniversity = \"Rothman University\",\n Sector12UniversalEnergy = \"Universal Energy\",\n\n // New Tokyo\n NewTokyoDefComm = \"DefComm\",\n NewTokyoGlobalPharmaceuticals = \"Global Pharmaceuticals\",\n NewTokyoNoodleBar = \"Noodle Bar\",\n NewTokyoVitaLife = \"VitaLife\",\n\n // Ishima\n IshimaNovaMedical = \"Nova Medical\",\n IshimaOmegaSoftware = \"Omega Software\",\n IshimaStormTechnologies = \"Storm Technologies\",\n IshimaGlitch = \"0x6C1\",\n\n // Volhaven\n VolhavenCompuTek = \"CompuTek\",\n VolhavenHeliosLabs = \"Helios Labs\",\n VolhavenLexoCorp = \"LexoCorp\",\n VolhavenMilleniumFitnessGym = \"Millenium Fitness Gym\",\n VolhavenNWO = \"NWO\",\n VolhavenOmniTekIncorporated = \"OmniTek Incorporated\",\n VolhavenOmniaCybersystems = \"Omnia Cybersystems\",\n VolhavenSysCoreSecurities = \"SysCore Securities\",\n VolhavenZBInstituteOfTechnology = \"ZB Institute of Technology\",\n\n // Generic locations\n Hospital = \"Hospital\",\n Slums = \"The Slums\",\n TravelAgency = \"Travel Agency\",\n WorldStockExchange = \"World Stock Exchange\",\n\n // Default name for Location objects\n Void = \"The Void\",\n}\n","import { IPlayer } from \"src/PersonObjects/IPlayer\";\nimport { IMap } from \"../types\";\n\n// TODO remember to update RamCalculations.js and WorkerScript.js\n\n// RAM costs for Netscript functions\nexport const RamCostConstants: IMap<number> = {\n ScriptBaseRamCost: 1.6,\n ScriptDomRamCost: 25,\n ScriptCorporationRamCost: 1024 - 1.6,\n ScriptHackRamCost: 0.1,\n ScriptHackAnalyzeRamCost: 1,\n ScriptGrowRamCost: 0.15,\n ScriptGrowthAnalyzeRamCost: 1,\n ScriptWeakenRamCost: 0.15,\n ScriptWeakenAnalyzeRamCost: 1,\n ScriptScanRamCost: 0.2,\n ScriptPortProgramRamCost: 0.05,\n ScriptRunRamCost: 1.0,\n ScriptExecRamCost: 1.3,\n ScriptSpawnRamCost: 2.0,\n ScriptScpRamCost: 0.6,\n ScriptKillRamCost: 0.5,\n ScriptHasRootAccessRamCost: 0.05,\n ScriptGetHostnameRamCost: 0.05,\n ScriptGetHackingLevelRamCost: 0.05,\n ScriptGetMultipliersRamCost: 4.0,\n ScriptGetServerRamCost: 0.1,\n ScriptGetServerMaxRam: 0.05,\n ScriptGetServerUsedRam: 0.05,\n ScriptFileExistsRamCost: 0.1,\n ScriptIsRunningRamCost: 0.1,\n ScriptHacknetNodesRamCost: 4.0,\n ScriptHNUpgLevelRamCost: 0.4,\n ScriptHNUpgRamRamCost: 0.6,\n ScriptHNUpgCoreRamCost: 0.8,\n ScriptGetStockRamCost: 2.0,\n ScriptBuySellStockRamCost: 2.5,\n ScriptGetPurchaseServerRamCost: 0.25,\n ScriptPurchaseServerRamCost: 2.25,\n ScriptGetPurchasedServerLimit: 0.05,\n ScriptGetPurchasedServerMaxRam: 0.05,\n ScriptRoundRamCost: 0.05,\n ScriptReadWriteRamCost: 1.0,\n ScriptArbScriptRamCost: 1.0,\n ScriptGetScriptRamCost: 0.1,\n ScriptGetRunningScriptRamCost: 0.3,\n ScriptGetHackTimeRamCost: 0.05,\n ScriptGetFavorToDonate: 0.1,\n ScriptCodingContractBaseRamCost: 10,\n ScriptSleeveBaseRamCost: 4,\n ScriptGetOwnedSourceFiles: 5,\n\n ScriptSingularityFn1RamCost: 2,\n ScriptSingularityFn2RamCost: 3,\n ScriptSingularityFn3RamCost: 5,\n\n ScriptGangApiBaseRamCost: 4,\n\n ScriptBladeburnerApiBaseRamCost: 4,\n\n ScriptStanekCharge: 0.4,\n ScriptStanekFragmentDefinitions: 0,\n ScriptStanekPlacedFragments: 5,\n ScriptStanekClear: 0,\n ScriptStanekCanPlace: 0.5,\n ScriptStanekPlace: 5,\n ScriptStanekFragmentAt: 2,\n ScriptStanekDeleteAt: 0.15,\n};\n\nfunction SF4Cost(cost: number): (player: IPlayer) => number {\n return (player: IPlayer): number => {\n if (player.bitNodeN === 4) return cost;\n const sf4 = player.sourceFileLvl(4);\n if (sf4 <= 1) return cost * 16;\n if (sf4 === 2) return cost * 4;\n return cost;\n };\n}\n\nexport const RamCosts: IMap<any> = {\n hacknet: {\n numNodes: 0,\n purchaseNode: 0,\n getPurchaseNodeCost: 0,\n getNodeStats: 0,\n upgradeLevel: 0,\n upgradeRam: 0,\n upgradeCore: 0,\n upgradeCache: 0,\n getLevelUpgradeCost: 0,\n getRamUpgradeCost: 0,\n getCoreUpgradeCost: 0,\n getCacheUpgradeCost: 0,\n numHashes: 0,\n hashCost: 0,\n spendHashes: 0,\n },\n sprintf: 0,\n vsprintf: 0,\n scan: RamCostConstants.ScriptScanRamCost,\n hack: RamCostConstants.ScriptHackRamCost,\n hackAnalyzeThreads: RamCostConstants.ScriptHackAnalyzeRamCost,\n hackAnalyze: RamCostConstants.ScriptHackAnalyzeRamCost,\n hackAnalyzeSecurity: RamCostConstants.ScriptHackAnalyzeRamCost,\n hackAnalyzeChance: RamCostConstants.ScriptHackAnalyzeRamCost,\n sleep: 0,\n share: 2.4,\n getSharePower: 0.2,\n grow: RamCostConstants.ScriptGrowRamCost,\n growthAnalyze: RamCostConstants.ScriptGrowthAnalyzeRamCost,\n growthAnalyzeSecurity: RamCostConstants.ScriptGrowthAnalyzeRamCost,\n weaken: RamCostConstants.ScriptWeakenRamCost,\n weakenAnalyze: RamCostConstants.ScriptWeakenAnalyzeRamCost,\n print: 0,\n printf: 0,\n tprint: 0,\n clearLog: 0,\n disableLog: 0,\n enableLog: 0,\n isLogEnabled: 0,\n getScriptLogs: 0,\n nuke: RamCostConstants.ScriptPortProgramRamCost,\n brutessh: RamCostConstants.ScriptPortProgramRamCost,\n ftpcrack: RamCostConstants.ScriptPortProgramRamCost,\n relaysmtp: RamCostConstants.ScriptPortProgramRamCost,\n httpworm: RamCostConstants.ScriptPortProgramRamCost,\n sqlinject: RamCostConstants.ScriptPortProgramRamCost,\n run: RamCostConstants.ScriptRunRamCost,\n exec: RamCostConstants.ScriptExecRamCost,\n spawn: RamCostConstants.ScriptSpawnRamCost,\n kill: RamCostConstants.ScriptKillRamCost,\n killall: RamCostConstants.ScriptKillRamCost,\n exit: 0,\n scp: RamCostConstants.ScriptScpRamCost,\n ls: RamCostConstants.ScriptScanRamCost,\n ps: RamCostConstants.ScriptScanRamCost,\n hasRootAccess: RamCostConstants.ScriptHasRootAccessRamCost,\n getIp: RamCostConstants.ScriptGetHostnameRamCost,\n getHostname: RamCostConstants.ScriptGetHostnameRamCost,\n getHackingLevel: RamCostConstants.ScriptGetHackingLevelRamCost,\n getHackingMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,\n getHacknetMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,\n getBitNodeMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,\n getServer: RamCostConstants.ScriptGetMultipliersRamCost / 2,\n getServerMoneyAvailable: RamCostConstants.ScriptGetServerRamCost,\n getServerSecurityLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerBaseSecurityLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerMinSecurityLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerRequiredHackingLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerMaxMoney: RamCostConstants.ScriptGetServerRamCost,\n getServerGrowth: RamCostConstants.ScriptGetServerRamCost,\n getServerNumPortsRequired: RamCostConstants.ScriptGetServerRamCost,\n getServerRam: RamCostConstants.ScriptGetServerRamCost,\n getServerMaxRam: RamCostConstants.ScriptGetServerMaxRam,\n getServerUsedRam: RamCostConstants.ScriptGetServerUsedRam,\n serverExists: RamCostConstants.ScriptGetServerRamCost,\n fileExists: RamCostConstants.ScriptFileExistsRamCost,\n isRunning: RamCostConstants.ScriptIsRunningRamCost,\n stock: {\n getSymbols: RamCostConstants.ScriptGetStockRamCost,\n getPrice: RamCostConstants.ScriptGetStockRamCost,\n getAskPrice: RamCostConstants.ScriptGetStockRamCost,\n getBidPrice: RamCostConstants.ScriptGetStockRamCost,\n getPosition: RamCostConstants.ScriptGetStockRamCost,\n getMaxShares: RamCostConstants.ScriptGetStockRamCost,\n getPurchaseCost: RamCostConstants.ScriptGetStockRamCost,\n getSaleGain: RamCostConstants.ScriptGetStockRamCost,\n buy: RamCostConstants.ScriptBuySellStockRamCost,\n sell: RamCostConstants.ScriptBuySellStockRamCost,\n short: RamCostConstants.ScriptBuySellStockRamCost,\n sellShort: RamCostConstants.ScriptBuySellStockRamCost,\n placeOrder: RamCostConstants.ScriptBuySellStockRamCost,\n cancelOrder: RamCostConstants.ScriptBuySellStockRamCost,\n getOrders: RamCostConstants.ScriptBuySellStockRamCost,\n getVolatility: RamCostConstants.ScriptBuySellStockRamCost,\n getForecast: RamCostConstants.ScriptBuySellStockRamCost,\n purchase4SMarketData: RamCostConstants.ScriptBuySellStockRamCost,\n purchase4SMarketDataTixApi: RamCostConstants.ScriptBuySellStockRamCost,\n },\n getPurchasedServerLimit: RamCostConstants.ScriptGetPurchasedServerLimit,\n getPurchasedServerMaxRam: RamCostConstants.ScriptGetPurchasedServerMaxRam,\n getPurchasedServerCost: RamCostConstants.ScriptGetPurchaseServerRamCost,\n purchaseServer: RamCostConstants.ScriptPurchaseServerRamCost,\n deleteServer: RamCostConstants.ScriptPurchaseServerRamCost,\n getPurchasedServers: RamCostConstants.ScriptPurchaseServerRamCost,\n write: 0,\n tryWritePort: 0,\n read: 0,\n peek: 0,\n clear: 0,\n writePort: 0,\n readPort: 0,\n getPortHandle: 0,\n rm: RamCostConstants.ScriptReadWriteRamCost,\n scriptRunning: RamCostConstants.ScriptArbScriptRamCost,\n scriptKill: RamCostConstants.ScriptArbScriptRamCost,\n getScriptName: 0,\n getScriptRam: RamCostConstants.ScriptGetScriptRamCost,\n getHackTime: RamCostConstants.ScriptGetHackTimeRamCost,\n getGrowTime: RamCostConstants.ScriptGetHackTimeRamCost,\n getWeakenTime: RamCostConstants.ScriptGetHackTimeRamCost,\n getScriptIncome: RamCostConstants.ScriptGetScriptRamCost,\n getScriptExpGain: RamCostConstants.ScriptGetScriptRamCost,\n getRunningScript: RamCostConstants.ScriptGetRunningScriptRamCost,\n nFormat: 0,\n getTimeSinceLastAug: RamCostConstants.ScriptGetHackTimeRamCost,\n prompt: 0,\n wget: 0,\n getFavorToDonate: RamCostConstants.ScriptGetFavorToDonate,\n getPlayer: RamCostConstants.ScriptSingularityFn1RamCost / 4,\n mv: 0,\n getOwnedSourceFiles: RamCostConstants.ScriptGetOwnedSourceFiles,\n\n // Singularity Functions\n universityCourse: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n gymWorkout: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n travelToCity: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n goToLocation: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n purchaseTor: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n purchaseProgram: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n getCurrentServer: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n connect: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n manualHack: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n installBackdoor: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n getStats: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n getCharacterInformation: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n hospitalize: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n isBusy: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n stopAction: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 2),\n upgradeHomeRam: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n upgradeHomeCores: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n getUpgradeHomeRamCost: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 2),\n getUpgradeHomeCoresCost: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 2),\n workForCompany: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n applyToCompany: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n getCompanyRep: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getCompanyFavor: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getCompanyFavorGain: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 4),\n checkFactionInvitations: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n joinFaction: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n workForFaction: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n getFactionRep: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getFactionFavor: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getFactionFavorGain: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 4),\n donateToFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n createProgram: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n commitCrime: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getCrimeChance: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getCrimeStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getOwnedAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationsFromFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationCost: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationPrereq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationPrice: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),\n getAugmentationRepReq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),\n getAugmentationStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n purchaseAugmentation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n softReset: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n installAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n isFocused: SF4Cost(0.1),\n setFocus: SF4Cost(0.1),\n\n // Gang API\n gang: {\n createGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n inGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getMemberNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getOtherGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getMemberInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n canRecruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n recruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getTaskNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getTaskStats: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n setMemberTask: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getEquipmentCost: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentType: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentStats: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n purchaseEquipment: RamCostConstants.ScriptGangApiBaseRamCost,\n ascendMember: RamCostConstants.ScriptGangApiBaseRamCost,\n getAscensionResult: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n setTerritoryWarfare: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getChanceToWinClash: RamCostConstants.ScriptGangApiBaseRamCost,\n getBonusTime: 0,\n },\n\n // Bladeburner API\n bladeburner: {\n getContractNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getOperationNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getBlackOpNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getBlackOpRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,\n getGeneralActionNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getSkillNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n startAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n stopBladeburnerAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,\n getCurrentAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 4,\n getActionTime: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionEstimatedSuccessChance: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionRepGain: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionCountRemaining: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionMaxLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionCurrentLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setActionLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillPoints: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillUpgradeCost: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n upgradeSkill: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityEstimatedPopulation: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityCommunities: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityChaos: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n switchCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getStamina: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n joinBladeburnerFaction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n joinBladeburnerDivision: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getBonusTime: 0,\n },\n\n // Coding Contract API\n codingcontract: {\n attempt: RamCostConstants.ScriptCodingContractBaseRamCost,\n getContractType: RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getData: RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getDescription: RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getNumTriesRemaining: RamCostConstants.ScriptCodingContractBaseRamCost / 5,\n },\n\n // Duplicate Sleeve API\n sleeve: {\n getNumSleeves: RamCostConstants.ScriptSleeveBaseRamCost,\n setToShockRecovery: RamCostConstants.ScriptSleeveBaseRamCost,\n setToSynchronize: RamCostConstants.ScriptSleeveBaseRamCost,\n setToCommitCrime: RamCostConstants.ScriptSleeveBaseRamCost,\n setToUniversityCourse: RamCostConstants.ScriptSleeveBaseRamCost,\n travel: RamCostConstants.ScriptSleeveBaseRamCost,\n setToCompanyWork: RamCostConstants.ScriptSleeveBaseRamCost,\n setToFactionWork: RamCostConstants.ScriptSleeveBaseRamCost,\n setToGymWorkout: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveStats: RamCostConstants.ScriptSleeveBaseRamCost,\n getTask: RamCostConstants.ScriptSleeveBaseRamCost,\n getInformation: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveAugmentations: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleevePurchasableAugs: RamCostConstants.ScriptSleeveBaseRamCost,\n purchaseSleeveAug: RamCostConstants.ScriptSleeveBaseRamCost,\n },\n\n stanek: {\n charge: RamCostConstants.ScriptStanekCharge,\n fragmentDefinitions: RamCostConstants.ScriptStanekFragmentDefinitions,\n activeFragments: RamCostConstants.ScriptStanekPlacedFragments,\n clear: RamCostConstants.ScriptStanekClear,\n canPlace: RamCostConstants.ScriptStanekCanPlace,\n place: RamCostConstants.ScriptStanekPlace,\n get: RamCostConstants.ScriptStanekFragmentAt,\n remove: RamCostConstants.ScriptStanekDeleteAt,\n },\n\n ui: {\n getTheme: 0,\n setTheme: 0,\n resetTheme: 0,\n getStyles: 0,\n setStyles: 0,\n resetStyles: 0,\n getGameInfo: 0,\n },\n\n heart: {\n // Easter egg function\n break: 0,\n },\n};\n\nexport function getRamCost(player: IPlayer, ...args: string[]): number {\n if (args.length === 0) {\n console.warn(`No arguments passed to getRamCost()`);\n return 0;\n }\n\n let curr = RamCosts[args[0]];\n for (let i = 1; i < args.length; ++i) {\n if (curr == null) {\n console.warn(`Invalid function passed to getRamCost: ${args}`);\n return 0;\n }\n\n const currType = typeof curr;\n if (currType === \"function\" || currType === \"number\") {\n break;\n }\n\n curr = curr[args[i]];\n }\n\n if (typeof curr === \"number\") {\n return curr;\n }\n\n if (typeof curr === \"function\") {\n return curr(player);\n }\n\n console.warn(`Unexpected type (${curr}) for value [${args}]`);\n return 0;\n}\n","import { AlertEvents } from \"./AlertManager\";\n\nimport React from \"react\";\nimport { SxProps } from \"@mui/system\";\nimport { Typography } from \"@mui/material\";\n\nexport function dialogBoxCreate(txt: string | JSX.Element, styles?: SxProps): void {\n if (typeof txt !== \"string\") {\n AlertEvents.emit(txt);\n } else {\n AlertEvents.emit(<Typography component=\"span\" sx={styles} dangerouslySetInnerHTML={{ __html: txt }} />);\n }\n}\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n unbuyable: {\n color: theme.palette.action.disabled,\n },\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\ninterface IProps {\n money: number | string;\n player?: IPlayer;\n}\nexport function Money(props: IProps): React.ReactElement {\n const classes = useStyles();\n if (props.player !== undefined) {\n if (typeof props.money !== \"number\") throw new Error(\"if player if provided, money should be number, contact dev\");\n if (!props.player.canAfford(props.money))\n return <span className={classes.unbuyable}>{numeralWrapper.formatMoney(props.money)}</span>;\n }\n return (\n <span className={classes.money}>\n {typeof props.money === \"number\" ? numeralWrapper.formatMoney(props.money) : props.money}\n </span>\n );\n}\n","import { Augmentation } from \"./Augmentation\";\nimport { IMap } from \"../types\";\n\nexport const Augmentations: IMap<Augmentation> = {};\n","/* Generic Reviver, toJSON, and fromJSON functions used for saving and loading objects */\n\nimport { validateObject } from \"./Validator\";\n\ninterface IReviverValue {\n ctor: string;\n data: any;\n}\n\n// A generic \"smart reviver\" function.\n// Looks for object values with a `ctor` property and\n// a `data` property. If it finds them, and finds a matching\n// constructor that has a `fromJSON` property on it, it hands\n// off to that `fromJSON` fuunction, passing in the value.\nexport function Reviver(key: string, value: IReviverValue | null): any {\n if (value == null) {\n return null;\n }\n\n if (typeof value === \"object\" && typeof value.ctor === \"string\" && typeof value.data !== \"undefined\") {\n // Compatibility for version v0.43.1\n // TODO Remove this eventually\n if (value.ctor === \"AllServersMap\") {\n console.warn(\"Converting AllServersMap for v0.43.1\");\n return value.data;\n }\n\n const ctor = Reviver.constructors[value.ctor];\n\n if (typeof ctor === \"function\" && typeof ctor.fromJSON === \"function\") {\n const obj = ctor.fromJSON(value);\n if (ctor.validationData !== undefined) {\n validateObject(obj, ctor.validationData);\n }\n return obj;\n }\n }\n return value;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Reviver {\n export const constructors: { [key: string]: any } = {};\n}\n\n// A generic \"toJSON\" function that creates the data expected\n// by Reviver.\n// `ctorName` The name of the constructor to use to revive it\n// `obj` The object being serialized\n// `keys` (Optional) Array of the properties to serialize,\n// if not given then all of the objects \"own\" properties\n// that don't have function values will be serialized.\n// (Note: If you list a property in `keys`, it will be serialized\n// regardless of whether it's an \"own\" property.)\n// Returns: The structure (which will then be turned into a string\n// as part of the JSON.stringify algorithm)\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function Generic_toJSON(ctorName: string, obj: any, keys?: string[]): IReviverValue {\n if (!keys) {\n keys = Object.keys(obj); // Only \"own\" properties are included\n }\n\n const data: any = {};\n for (let index = 0; index < keys.length; ++index) {\n const key = keys[index];\n data[key] = obj[key];\n }\n return { ctor: ctorName, data: data };\n}\n\n// A generic \"fromJSON\" function for use with Reviver: Just calls the\n// constructor function with no arguments, then applies all of the\n// key/value pairs from the raw data to the instance. Only useful for\n// constructors that can be reasonably called without arguments!\n// `ctor` The constructor to call\n// `data` The data to apply\n// Returns: The object\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function Generic_fromJSON<T>(ctor: new () => T, data: any): T {\n const obj: any = new ctor();\n for (const name in data) {\n obj[name] = data[name];\n }\n return obj;\n}\n","import { Server } from \"./Server\";\nimport { BaseServer } from \"./BaseServer\";\nimport { serverMetadata } from \"./data/servers\";\n\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\n\nimport { IMap } from \"../types\";\nimport { createRandomIp } from \"../utils/IPAddress\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { Reviver } from \"../utils/JSONReviver\";\nimport { isValidIPAddress } from \"../utils/helpers/isValidIPAddress\";\nimport { SpecialServers } from \"./data/SpecialServers\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\n/**\n * Map of all Servers that exist in the game\n * Key (string) = IP\n * Value = Server object\n */\nlet AllServers: IMap<Server | HacknetServer> = {};\n\nfunction GetServerByIP(ip: string): BaseServer | undefined {\n for (const key of Object.keys(AllServers)) {\n const server = AllServers[key];\n if (server.ip !== ip) continue;\n return server;\n }\n}\n\n//Returns server object with corresponding hostname\n// Relatively slow, would rather not use this a lot\nfunction GetServerByHostname(hostname: string): BaseServer | null {\n for (const key of Object.keys(AllServers)) {\n const server = AllServers[key];\n if (server.hostname == hostname) {\n return server;\n }\n }\n\n return null;\n}\n\n//Get server by IP or hostname. Returns null if invalid\nexport function GetServer(s: string): BaseServer | null {\n const server = AllServers[s];\n if (server) return server;\n if (!isValidIPAddress(s)) {\n return GetServerByHostname(s);\n }\n\n const ipserver = GetServerByIP(s);\n if (ipserver !== undefined) {\n return ipserver;\n }\n\n return null;\n}\n\nexport function GetAllServers(): BaseServer[] {\n const servers: BaseServer[] = [];\n for (const key of Object.keys(AllServers)) {\n servers.push(AllServers[key]);\n }\n return servers;\n}\n\nexport function DeleteServer(serverkey: string): void {\n for (const key of Object.keys(AllServers)) {\n const server = AllServers[key];\n if (server.ip !== serverkey && server.hostname !== serverkey) continue;\n delete AllServers[key];\n break;\n }\n}\n\nexport function ipExists(ip: string): boolean {\n return AllServers[ip] != null;\n}\n\nexport function createUniqueRandomIp(): string {\n const ip = createRandomIp();\n\n // If the Ip already exists, recurse to create a new one\n if (ipExists(ip)) {\n return createRandomIp();\n }\n\n return ip;\n}\n\n// Saftely add a Server to the AllServers map\nexport function AddToAllServers(server: Server | HacknetServer): void {\n if (GetServer(server.hostname)) {\n console.warn(`Hostname of the server thats being added: ${server.hostname}`);\n console.warn(`The server that already has this IP is: ${AllServers[server.hostname].hostname}`);\n throw new Error(\"Error: Trying to add a server with an existing IP\");\n }\n\n AllServers[server.hostname] = server;\n}\n\ninterface IServerParams {\n hackDifficulty?: number;\n hostname: string;\n ip: string;\n maxRam?: number;\n moneyAvailable?: number;\n numOpenPortsRequired: number;\n organizationName: string;\n requiredHackingSkill?: number;\n serverGrowth?: number;\n\n [key: string]: any;\n}\n\nexport function initForeignServers(homeComputer: Server): void {\n /* Create a randomized network for all the foreign servers */\n //Groupings for creating a randomized network\n const networkLayers: Server[][] = [];\n for (let i = 0; i < 15; i++) {\n networkLayers.push([]);\n }\n\n // Essentially any property that is of type 'number | IMinMaxRange'\n const propertiesToPatternMatch: string[] = [\n \"hackDifficulty\",\n \"moneyAvailable\",\n \"requiredHackingSkill\",\n \"serverGrowth\",\n ];\n\n const toNumber = (value: any): any => {\n switch (typeof value) {\n case \"number\":\n return value;\n case \"object\":\n return getRandomInt(value.min, value.max);\n default:\n throw Error(`Do not know how to convert the type '${typeof value}' to a number`);\n }\n };\n\n for (const metadata of serverMetadata) {\n const serverParams: IServerParams = {\n hostname: metadata.hostname,\n ip: createUniqueRandomIp(),\n numOpenPortsRequired: metadata.numOpenPortsRequired,\n organizationName: metadata.organizationName,\n };\n\n if (metadata.maxRamExponent !== undefined) {\n serverParams.maxRam = Math.pow(2, toNumber(metadata.maxRamExponent));\n }\n\n for (const prop of propertiesToPatternMatch) {\n if (metadata[prop] !== undefined) {\n serverParams[prop] = toNumber(metadata[prop]);\n }\n }\n\n const server = new Server(serverParams);\n for (const filename of metadata.literature || []) {\n server.messages.push(filename);\n }\n\n if (server.hostname === SpecialServers.WorldDaemon) {\n server.requiredHackingSkill *= BitNodeMultipliers.WorldDaemonDifficulty;\n }\n AddToAllServers(server);\n if (metadata.networkLayer !== undefined) {\n networkLayers[toNumber(metadata.networkLayer) - 1].push(server);\n }\n }\n\n /* Create a randomized network for all the foreign servers */\n const linkComputers = (server1: Server, server2: Server): void => {\n server1.serversOnNetwork.push(server2.hostname);\n server2.serversOnNetwork.push(server1.hostname);\n };\n\n const getRandomArrayItem = (arr: any[]): any => arr[Math.floor(Math.random() * arr.length)];\n\n const linkNetworkLayers = (network1: Server[], selectServer: () => Server): void => {\n for (const server of network1) {\n linkComputers(server, selectServer());\n }\n };\n\n // Connect the first tier of servers to the player's home computer\n linkNetworkLayers(networkLayers[0], () => homeComputer);\n for (let i = 1; i < networkLayers.length; i++) {\n linkNetworkLayers(networkLayers[i], () => getRandomArrayItem(networkLayers[i - 1]));\n }\n}\n\nexport function prestigeAllServers(): void {\n for (const member of Object.keys(AllServers)) {\n delete AllServers[member];\n }\n AllServers = {};\n}\n\nexport function loadAllServers(saveString: string): void {\n AllServers = JSON.parse(saveString, Reviver);\n}\n\nexport function saveAllServers(excludeRunningScripts = false): string {\n const TempAllServers = JSON.parse(JSON.stringify(AllServers), Reviver);\n for (const key of Object.keys(TempAllServers)) {\n const server = TempAllServers[key];\n if (excludeRunningScripts) {\n server.runningScripts = [];\n continue;\n }\n for (let i = 0; i < server.runningScripts.length; ++i) {\n const runningScriptObj = server.runningScripts[i];\n runningScriptObj.logs.length = 0;\n runningScriptObj.logs = [];\n }\n }\n\n return JSON.stringify(TempAllServers);\n}\n","import { EqualityFunc } from \"../types\";\nimport { isString } from \"./helpers/isString\";\n\n/*\nConverts a date representing time in milliseconds to a string with the format H hours M minutes and S seconds\ne.g. 10000 -> \"10 seconds\"\n 120000 -> \"2 minutes and 0 seconds\"\n*/\nfunction convertTimeMsToTimeElapsedString(time: number, showMilli = false): string {\n time = Math.floor(time);\n const millisecondsPerSecond = 1000;\n const secondPerMinute = 60;\n const minutesPerHours = 60;\n const secondPerHours: number = secondPerMinute * minutesPerHours;\n const hoursPerDays = 24;\n const secondPerDay: number = secondPerHours * hoursPerDays;\n\n // Convert ms to seconds, since we only have second-level precision\n const totalSeconds: number = Math.floor(time / millisecondsPerSecond);\n\n const days: number = Math.floor(totalSeconds / secondPerDay);\n const secTruncDays: number = totalSeconds % secondPerDay;\n\n const hours: number = Math.floor(secTruncDays / secondPerHours);\n const secTruncHours: number = secTruncDays % secondPerHours;\n\n const minutes: number = Math.floor(secTruncHours / secondPerMinute);\n const secTruncMinutes: number = secTruncHours % secondPerMinute;\n\n const milliTruncSec: string = (() => {\n let str = `${time % millisecondsPerSecond}`;\n while (str.length < 3) str = \"0\" + str;\n return str;\n })();\n\n const seconds: string = showMilli ? `${secTruncMinutes}.${milliTruncSec}` : `${secTruncMinutes}`;\n\n let res = \"\";\n if (days > 0) {\n res += `${days} days `;\n }\n if (hours > 0) {\n res += `${hours} hours `;\n }\n if (minutes > 0) {\n res += `${minutes} minutes `;\n }\n res += `${seconds} seconds`;\n\n return res;\n}\n\n// Finds the longest common starting substring in a set of strings\nfunction longestCommonStart(strings: string[]): string {\n if (!containsAllStrings(strings)) {\n return \"\";\n }\n if (strings.length === 0) {\n return \"\";\n }\n\n const A: string[] = strings.concat().sort();\n const a1: string = A[0];\n const a2: string = A[A.length - 1];\n const L: number = a1.length;\n let i = 0;\n const areEqualCaseInsensitive: EqualityFunc<string> = (a: string, b: string) => a.toUpperCase() === b.toUpperCase();\n while (i < L && areEqualCaseInsensitive(a1.charAt(i), a2.charAt(i))) {\n i++;\n }\n\n return a1.substring(0, i);\n}\n\n// Returns whether an array contains entirely of string objects\nfunction containsAllStrings(arr: string[]): boolean {\n return arr.every(isString);\n}\n\n// Formats a number with commas and a specific number of decimal digits\nfunction formatNumber(num: number, numFractionDigits = 0): string {\n return num.toLocaleString(undefined, {\n maximumFractionDigits: numFractionDigits,\n minimumFractionDigits: numFractionDigits,\n });\n}\n\n// Generates a random alphanumeric string with N characters\nfunction generateRandomString(n: number): string {\n let str = \"\";\n const chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (let i = 0; i < n; i++) {\n str += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n\n return str;\n}\n\n/**\n * Hashes the input string. This is a fast hash, so NOT good for cryptography.\n * This has been ripped off here: https://stackoverflow.com/a/52171480\n * @param str The string that is to be hashed\n * @param seed A seed to randomize the result\n * @returns An hexadecimal string representation of the hashed input\n */\nfunction cyrb53(str: string, seed = 0): string {\n let h1 = 0xdeadbeef ^ seed;\n let h2 = 0x41c6ce57 ^ seed;\n for (let i = 0, ch; i < str.length; i++) {\n ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(16);\n}\n\nexport {\n convertTimeMsToTimeElapsedString,\n longestCommonStart,\n containsAllStrings,\n formatNumber,\n generateRandomString,\n cyrb53,\n};\n","/**\n * All possible Cities in the game. Names only, not actual \"City\" object\n * Implemented as an enum for typing purposes\n */\nexport enum CityName {\n Aevum = \"Aevum\",\n Chongqing = \"Chongqing\",\n Ishima = \"Ishima\",\n NewTokyo = \"New Tokyo\",\n Sector12 = \"Sector-12\",\n Volhaven = \"Volhaven\",\n}\n","import { Faction } from \"../Faction/Faction\";\nimport { Location } from \"../Locations/Location\";\n\n/**\n * The full-screen page the player is currently be on.\n * These pages are mutually exclusive.\n */\nexport enum Page {\n ActiveScripts,\n Augmentations,\n BitVerse,\n Bladeburner,\n City,\n Corporation,\n CreateProgram,\n ScriptEditor,\n DevMenu,\n Faction,\n Factions,\n Gang,\n Hacknet,\n Infiltration,\n Job,\n Milestones,\n Options,\n Resleeves,\n Sleeves,\n Stats,\n StockMarket,\n Terminal,\n Travel,\n Tutorial,\n Work,\n BladeburnerCinematic,\n Location,\n Loading,\n StaneksGift,\n Recovery,\n Achievements,\n ThemeBrowser,\n ImportSave,\n}\n\nexport interface ScriptEditorRouteOptions {\n vim: boolean;\n}\n\n/**\n * This class keeps track of player navigation/routing within the game.\n */\nexport interface IRouter {\n // toCinematicText(): void;\n // toInfiltration(): void;\n // toMission(): void;\n // toRedPill(): void;\n // toworkInProgress(): void;\n page(): Page;\n allowRouting(value: boolean): void;\n toActiveScripts(): void;\n toAugmentations(): void;\n toBitVerse(flume: boolean, quick: boolean): void;\n toBladeburner(): void;\n toStats(): void;\n toCity(): void; // travel ? city ?\n toCorporation(): void;\n toCreateProgram(): void;\n toDevMenu(): void;\n toFaction(faction?: Faction): void; // faction name\n toFactions(): void;\n toGameOptions(): void;\n toGang(): void;\n toHacknetNodes(): void;\n toInfiltration(location: Location): void;\n toJob(): void;\n toMilestones(): void;\n toResleeves(): void;\n toScriptEditor(files?: Record<string, string>, options?: ScriptEditorRouteOptions): void;\n toSleeves(): void;\n toStockMarket(): void;\n toTerminal(): void;\n toTravel(): void;\n toTutorial(): void;\n toWork(): void;\n toBladeburnerCinematic(): void;\n toLocation(location: Location): void;\n toStaneksGift(): void;\n toAchievements(): void;\n toThemeBrowser(): void;\n toImportSave(base64Save: string, automatic?: boolean): void;\n}\n","/**\n * Initialization and manipulation of the Factions object, which stores data\n * about all Factions in the game\n */\nimport { Faction } from \"./Faction\";\nimport { FactionInfos } from \"./FactionInfo\";\n\nimport { IMap } from \"../types\";\n\nimport { Reviver } from \"../utils/JSONReviver\";\n\nexport let Factions: IMap<Faction> = {};\n\nexport function loadFactions(saveString: string): void {\n Factions = JSON.parse(saveString, Reviver);\n // safety check for when we load older save file that don't have newer factions\n for (const faction of Object.keys(Factions)) {\n try {\n Factions[faction].getInfo();\n } catch (err) {\n console.error(\"deleting \" + faction);\n delete Factions[faction];\n }\n }\n}\n\nfunction AddToFactions(faction: Faction): void {\n const name: string = faction.name;\n Factions[name] = faction;\n}\n\nexport function factionExists(name: string): boolean {\n return Factions.hasOwnProperty(name);\n}\n\nexport function initFactions(): void {\n for (const name of Object.keys(FactionInfos)) {\n resetFaction(new Faction(name));\n }\n}\n\n//Resets a faction during (re-)initialization. Saves the favor in the new\n//Faction object and deletes the old Faction Object from \"Factions\". Then\n//reinserts the new Faction object\nfunction resetFaction(newFactionObject: Faction): void {\n if (!(newFactionObject instanceof Faction)) {\n throw new Error(\"Invalid argument 'newFactionObject' passed into resetFaction()\");\n }\n const factionName: string = newFactionObject.name;\n if (factionExists(factionName)) {\n newFactionObject.favor = Factions[factionName].favor;\n delete Factions[factionName];\n }\n AddToFactions(newFactionObject);\n}\n","import React, { useContext } from \"react\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter } from \"./Router\";\n\nexport const Context: {\n Player: React.Context<IPlayer>;\n Router: React.Context<IRouter>;\n} = {\n Player: React.createContext<IPlayer>({} as IPlayer),\n Router: React.createContext<IRouter>({} as IRouter),\n};\n\nexport const use: {\n Player: () => IPlayer;\n Router: () => IRouter;\n} = {\n Player: () => useContext(Context.Player),\n Router: () => useContext(Context.Router),\n};\n","// Defs for job titles, stored in arrays and categorized by job \"type\"\n\nexport const SoftwareCompanyPositions: string[] = [\n \"Software Engineering Intern\",\n \"Junior Software Engineer\",\n \"Senior Software Engineer\",\n \"Lead Software Developer\",\n \"Head of Software\",\n \"Head of Engineering\",\n \"Vice President of Technology\",\n \"Chief Technology Officer\",\n];\n\nexport const ITCompanyPositions: string[] = [\"IT Intern\", \"IT Analyst\", \"IT Manager\", \"Systems Administrator\"];\n\nexport const SecurityEngineerCompanyPositions: string[] = [\"Security Engineer\"];\n\nexport const NetworkEngineerCompanyPositions: string[] = [\"Network Engineer\", \"Network Administrator\"];\n\nexport const BusinessCompanyPositions: string[] = [\n \"Business Intern\",\n \"Business Analyst\",\n \"Business Manager\",\n \"Operations Manager\",\n \"Chief Financial Officer\",\n \"Chief Executive Officer\",\n];\n\nexport const SecurityCompanyPositions: string[] = [\n \"Police Officer\",\n \"Police Chief\",\n \"Security Guard\",\n \"Security Officer\",\n \"Security Supervisor\",\n \"Head of Security\",\n];\n\nexport const AgentCompanyPositions: string[] = [\"Field Agent\", \"Secret Agent\", \"Special Operative\"];\n\nexport const MiscCompanyPositions: string[] = [\"Waiter\", \"Employee\"];\n\nexport const SoftwareConsultantCompanyPositions: string[] = [\"Software Consultant\", \"Senior Software Consultant\"];\n\nexport const BusinessConsultantCompanyPositions: string[] = [\"Business Consultant\", \"Senior Business Consultant\"];\n\nexport const PartTimeCompanyPositions: string[] = [\"Part-time Waiter\", \"Part-time Employee\"];\n","/**\n * Gets a random integer bounded by the values passed in.\n * @param min The minimum value in the range.\n * @param max The maximum value in the range.\n */\nexport function getRandomInt(min: number, max: number): number {\n const lower: number = Math.min(min, max);\n const upper: number = Math.max(min, max);\n\n return Math.floor(Math.random() * (upper - lower + 1)) + lower;\n}\n","const CyclesPerMarketCycle = 50;\nconst AllCorporationStates = [\"START\", \"PURCHASE\", \"PRODUCTION\", \"SALE\", \"EXPORT\"];\nexport const CorporationConstants: {\n INITIALSHARES: number;\n SHARESPERPRICEUPDATE: number;\n IssueNewSharesCooldown: number;\n SellSharesCooldown: number;\n CyclesPerMarketCycle: number;\n CyclesPerIndustryStateCycle: number;\n SecsPerMarketCycle: number;\n Cities: string[];\n WarehouseInitialCost: number;\n WarehouseInitialSize: number;\n WarehouseUpgradeBaseCost: number;\n OfficeInitialCost: number;\n OfficeInitialSize: number;\n OfficeUpgradeBaseCost: number;\n BribeThreshold: number;\n BribeToRepRatio: number;\n ProductProductionCostRatio: number;\n DividendMaxPercentage: number;\n EmployeeSalaryMultiplier: number;\n CyclesPerEmployeeRaise: number;\n EmployeeRaiseAmount: number;\n BaseMaxProducts: number;\n AllCorporationStates: string[];\n AllMaterials: string[];\n FundingRoundShares: number[];\n FundingRoundMultiplier: number[];\n} = {\n INITIALSHARES: 1e9, //Total number of shares you have at your company\n SHARESPERPRICEUPDATE: 1e6, //When selling large number of shares, price is dynamically updated for every batch of this amount\n IssueNewSharesCooldown: 216e3, // 12 Hour in terms of game cycles\n SellSharesCooldown: 18e3, // 1 Hour in terms of game cycles\n\n CyclesPerMarketCycle: CyclesPerMarketCycle,\n CyclesPerIndustryStateCycle: CyclesPerMarketCycle / AllCorporationStates.length,\n SecsPerMarketCycle: CyclesPerMarketCycle / 5,\n\n Cities: [\"Aevum\", \"Chongqing\", \"Sector-12\", \"New Tokyo\", \"Ishima\", \"Volhaven\"],\n\n WarehouseInitialCost: 5e9, //Initial purchase cost of warehouse\n WarehouseInitialSize: 100,\n WarehouseUpgradeBaseCost: 1e9,\n\n OfficeInitialCost: 4e9,\n OfficeInitialSize: 3,\n OfficeUpgradeBaseCost: 1e9,\n\n BribeThreshold: 100e12, //Money needed to be able to bribe for faction rep\n BribeToRepRatio: 1e9, //Bribe Value divided by this = rep gain\n\n ProductProductionCostRatio: 5, //Ratio of material cost of a product to its production cost\n\n DividendMaxPercentage: 1,\n\n EmployeeSalaryMultiplier: 3, // Employee stats multiplied by this to determine initial salary\n CyclesPerEmployeeRaise: 400, // All employees get a raise every X market cycles\n EmployeeRaiseAmount: 50, // Employee salary increases by this (additive)\n\n BaseMaxProducts: 3, // Initial value for maximum number of products allowed\n AllCorporationStates: AllCorporationStates,\n AllMaterials: [\n \"Water\",\n \"Energy\",\n \"Food\",\n \"Plants\",\n \"Metal\",\n \"Hardware\",\n \"Chemicals\",\n \"Drugs\",\n \"Robots\",\n \"AI Cores\",\n \"Real Estate\",\n ],\n FundingRoundShares: [\n 0.1,\n 0.35,\n 0.25,\n 0.2\n ],\n FundingRoundMultiplier: [\n 4,\n 3,\n 3,\n 2.5\n ],\n};\n","export const HacknetNodeConstants: {\n // Constants for Hacknet Node production\n MoneyGainPerLevel: number;\n\n // Constants for Hacknet Node purchase/upgrade costs\n BaseCost: number;\n LevelBaseCost: number;\n RamBaseCost: number;\n CoreBaseCost: number;\n\n PurchaseNextMult: number;\n UpgradeLevelMult: number;\n UpgradeRamMult: number;\n UpgradeCoreMult: number;\n\n // Constants for max upgrade levels for Hacknet Nodes\n MaxLevel: number;\n MaxRam: number;\n MaxCores: number;\n} = {\n MoneyGainPerLevel: 1.5,\n\n BaseCost: 1000,\n LevelBaseCost: 1,\n RamBaseCost: 30e3,\n CoreBaseCost: 500e3,\n\n PurchaseNextMult: 1.85,\n UpgradeLevelMult: 1.04,\n UpgradeRamMult: 1.28,\n UpgradeCoreMult: 1.48,\n\n MaxLevel: 200,\n MaxRam: 64,\n MaxCores: 16,\n};\n\nexport const PurchaseMultipliers: {\n [key: string]: number | \"MAX\" | undefined;\n x1: number;\n x5: number;\n x10: number;\n MAX: \"MAX\";\n} = {\n x1: 1,\n x5: 5,\n x10: 10,\n MAX: \"MAX\",\n};\n\nexport const HacknetServerConstants: {\n // Constants for Hacknet Server stats/production\n HashesPerLevel: number;\n\n // Constants for Hacknet Server purchase/upgrade costs\n BaseCost: number;\n RamBaseCost: number;\n CoreBaseCost: number;\n CacheBaseCost: number;\n\n PurchaseMult: number; // Multiplier for puchasing an additional Hacknet Server\n UpgradeLevelMult: number; // Multiplier for cost when upgrading level\n UpgradeRamMult: number; // Multiplier for cost when upgrading RAM\n UpgradeCoreMult: number; // Multiplier for cost when buying another core\n UpgradeCacheMult: number; // Multiplier for cost when upgrading cache\n MaxServers: number; // Max number of Hacknet Servers you can own\n\n // Constants for max upgrade levels for Hacknet Server\n MaxLevel: number;\n MaxRam: number;\n MaxCores: number;\n MaxCache: number;\n} = {\n HashesPerLevel: 0.001,\n\n BaseCost: 50e3,\n RamBaseCost: 200e3,\n CoreBaseCost: 1e6,\n CacheBaseCost: 10e6,\n\n PurchaseMult: 3.2,\n UpgradeLevelMult: 1.1,\n UpgradeRamMult: 1.4,\n UpgradeCoreMult: 1.55,\n UpgradeCacheMult: 1.85,\n\n MaxServers: 20,\n\n MaxLevel: 300,\n MaxRam: 8192,\n MaxCores: 128,\n MaxCache: 15,\n};\n","// Class definition for a single Augmentation object\nimport * as React from \"react\";\nimport { IMap } from \"../types\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Faction } from \"../Faction/Faction\";\nimport { Factions } from \"../Faction/Factions\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IConstructorParams {\n info: string | JSX.Element;\n stats?: JSX.Element | null;\n isSpecial?: boolean;\n moneyCost: number;\n name: string;\n prereqs?: string[];\n repCost: number;\n\n hacking_mult?: number;\n strength_mult?: number;\n defense_mult?: number;\n dexterity_mult?: number;\n agility_mult?: number;\n charisma_mult?: number;\n hacking_exp_mult?: number;\n strength_exp_mult?: number;\n defense_exp_mult?: number;\n dexterity_exp_mult?: number;\n agility_exp_mult?: number;\n charisma_exp_mult?: number;\n hacking_chance_mult?: number;\n hacking_speed_mult?: number;\n hacking_money_mult?: number;\n hacking_grow_mult?: number;\n company_rep_mult?: number;\n faction_rep_mult?: number;\n crime_money_mult?: number;\n crime_success_mult?: number;\n work_money_mult?: number;\n hacknet_node_money_mult?: number;\n hacknet_node_purchase_cost_mult?: number;\n hacknet_node_ram_cost_mult?: number;\n hacknet_node_core_cost_mult?: number;\n hacknet_node_level_cost_mult?: number;\n bladeburner_max_stamina_mult?: number;\n bladeburner_stamina_gain_mult?: number;\n bladeburner_analysis_mult?: number;\n bladeburner_success_chance_mult?: number;\n\n startingMoney?: number;\n programs?: string[];\n}\n\nfunction generateStatsDescription(mults: IMap<number>, programs?: string[], startingMoney?: number): JSX.Element {\n const f = (x: number, decimals = 0): string => {\n // look, I don't know how to make a \"smart decimals\"\n // todo, make it smarter\n if (x === 1.0777 - 1) return \"7.77%\";\n if (x === 1.777 - 1) return \"77.7%\";\n return numeralWrapper.formatPercentage(x, decimals);\n };\n let desc = <>Effects:</>;\n\n if (\n mults.hacking_mult &&\n mults.hacking_mult == mults.strength_mult &&\n mults.hacking_mult == mults.defense_mult &&\n mults.hacking_mult == mults.dexterity_mult &&\n mults.hacking_mult == mults.agility_mult &&\n mults.hacking_mult == mults.charisma_mult\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_mult - 1)} all skills\n </>\n );\n } else {\n if (mults.hacking_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_mult - 1)} hacking skill\n </>\n );\n\n if (\n mults.strength_mult &&\n mults.strength_mult == mults.defense_mult &&\n mults.strength_mult == mults.dexterity_mult &&\n mults.strength_mult == mults.agility_mult\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength_mult - 1)} combat skills\n </>\n );\n } else {\n if (mults.strength_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength_mult - 1)} strength skill\n </>\n );\n if (mults.defense_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.defense_mult - 1)} defense skill\n </>\n );\n if (mults.dexterity_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.dexterity_mult - 1)} dexterity skill\n </>\n );\n if (mults.agility_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.agility_mult - 1)} agility skill\n </>\n );\n }\n if (mults.charisma_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.charisma_mult - 1)} Charisma skill\n </>\n );\n }\n\n if (\n mults.hacking_exp_mult &&\n mults.hacking_exp_mult === mults.strength_exp_mult &&\n mults.hacking_exp_mult === mults.defense_exp_mult &&\n mults.hacking_exp_mult === mults.dexterity_exp_mult &&\n mults.hacking_exp_mult === mults.agility_exp_mult &&\n mults.hacking_exp_mult === mults.charisma_exp_mult\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_exp_mult - 1)} exp for all skills\n </>\n );\n } else {\n if (mults.hacking_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_exp_mult - 1)} hacking exp\n </>\n );\n\n if (\n mults.strength_exp_mult &&\n mults.strength_exp_mult === mults.defense_exp_mult &&\n mults.strength_exp_mult === mults.dexterity_exp_mult &&\n mults.strength_exp_mult === mults.agility_exp_mult\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength_exp_mult - 1)} combat exp\n </>\n );\n } else {\n if (mults.strength_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength_exp_mult - 1)} strength exp\n </>\n );\n if (mults.defense_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.defense_exp_mult - 1)} defense exp\n </>\n );\n if (mults.dexterity_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.dexterity_exp_mult - 1)} dexterity exp\n </>\n );\n if (mults.agility_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.agility_exp_mult - 1)} agility exp\n </>\n );\n }\n if (mults.charisma_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.charisma_exp_mult - 1)} charisma exp\n </>\n );\n }\n\n if (mults.hacking_speed_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_speed_mult - 1)} faster hack(), grow(), and weaken()\n </>\n );\n if (mults.hacking_chance_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_chance_mult - 1)} hack() success chance\n </>\n );\n if (mults.hacking_money_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_money_mult - 1)} hack() power\n </>\n );\n if (mults.hacking_grow_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_grow_mult - 1)} grow() power\n </>\n );\n\n if (mults.faction_rep_mult && mults.faction_rep_mult === mults.company_rep_mult) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.faction_rep_mult - 1)} reputation from factions and companies\n </>\n );\n } else {\n if (mults.faction_rep_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.faction_rep_mult - 1)} reputation from factions\n </>\n );\n if (mults.company_rep_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.company_rep_mult - 1)} reputation from companies\n </>\n );\n }\n\n if (mults.crime_money_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.crime_money_mult - 1)} crime money\n </>\n );\n if (mults.crime_success_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.crime_success_mult - 1)} crime success rate\n </>\n );\n if (mults.work_money_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.work_money_mult - 1)} work money\n </>\n );\n\n if (mults.hacknet_node_money_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacknet_node_money_mult - 1)} hacknet production\n </>\n );\n if (mults.hacknet_node_purchase_cost_mult)\n desc = (\n <>\n {desc}\n <br />-{f(-(mults.hacknet_node_purchase_cost_mult - 1))} hacknet nodes cost\n </>\n );\n if (mults.hacknet_node_level_cost_mult)\n desc = (\n <>\n {desc}\n <br />-{f(-(mults.hacknet_node_level_cost_mult - 1))} hacknet nodes upgrade cost\n </>\n );\n\n if (mults.bladeburner_max_stamina_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_max_stamina_mult - 1)} Bladeburner Max Stamina\n </>\n );\n if (mults.bladeburner_stamina_gain_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_stamina_gain_mult - 1)} Bladeburner Stamina gain\n </>\n );\n if (mults.bladeburner_analysis_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_analysis_mult - 1)} Bladeburner Field Analysis effectiveness\n </>\n );\n if (mults.bladeburner_success_chance_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_success_chance_mult - 1)} Bladeburner Contracts and Operations success chance\n </>\n );\n\n if (startingMoney)\n desc = (\n <>\n {desc}\n <br />\n Start with <Money money={startingMoney} /> after installing Augmentations.\n </>\n );\n\n if (programs)\n desc = (\n <>\n {desc}\n <br />\n Start with {programs.join(\" and \")} after installing Augmentations.\n </>\n );\n return desc;\n}\n\nexport class Augmentation {\n // How much money this costs to buy\n baseCost = 0;\n\n // How much faction reputation is required to unlock this\n baseRepRequirement = 0;\n\n // Description of what this Aug is and what it does\n info: string | JSX.Element;\n\n // Description of the stats, often autogenerated, sometimes manually written.\n stats: JSX.Element | null;\n\n // Any Augmentation not immediately available in BitNode-1 is special (e.g. Bladeburner augs)\n isSpecial = false;\n\n // Augmentation level - for repeatable Augs like NeuroFlux Governor\n level = 0;\n\n // Name of Augmentation\n name = \"\";\n\n // Whether the player owns this Augmentation\n owned = false;\n\n // Array of names of all prerequisites\n prereqs: string[] = [];\n\n // Multipliers given by this Augmentation. Must match the property name in\n // The Player/Person classes\n mults: IMap<number> = {};\n\n // Initial cost. Doesn't change when you purchase multiple Augmentation\n startingCost = 0;\n\n constructor(\n params: IConstructorParams = {\n info: \"\",\n moneyCost: 0,\n name: \"\",\n repCost: 0,\n },\n ) {\n this.name = params.name;\n this.info = params.info;\n this.prereqs = params.prereqs ? params.prereqs : [];\n\n this.baseRepRequirement = params.repCost * BitNodeMultipliers.AugmentationRepCost;\n this.baseCost = params.moneyCost * BitNodeMultipliers.AugmentationMoneyCost;\n this.startingCost = this.baseCost;\n\n if (params.isSpecial) {\n this.isSpecial = true;\n }\n\n this.level = 0;\n\n // Set multipliers\n if (params.hacking_mult) {\n this.mults.hacking_mult = params.hacking_mult;\n }\n if (params.strength_mult) {\n this.mults.strength_mult = params.strength_mult;\n }\n if (params.defense_mult) {\n this.mults.defense_mult = params.defense_mult;\n }\n if (params.dexterity_mult) {\n this.mults.dexterity_mult = params.dexterity_mult;\n }\n if (params.agility_mult) {\n this.mults.agility_mult = params.agility_mult;\n }\n if (params.charisma_mult) {\n this.mults.charisma_mult = params.charisma_mult;\n }\n if (params.hacking_exp_mult) {\n this.mults.hacking_exp_mult = params.hacking_exp_mult;\n }\n if (params.strength_exp_mult) {\n this.mults.strength_exp_mult = params.strength_exp_mult;\n }\n if (params.defense_exp_mult) {\n this.mults.defense_exp_mult = params.defense_exp_mult;\n }\n if (params.dexterity_exp_mult) {\n this.mults.dexterity_exp_mult = params.dexterity_exp_mult;\n }\n if (params.agility_exp_mult) {\n this.mults.agility_exp_mult = params.agility_exp_mult;\n }\n if (params.charisma_exp_mult) {\n this.mults.charisma_exp_mult = params.charisma_exp_mult;\n }\n if (params.hacking_chance_mult) {\n this.mults.hacking_chance_mult = params.hacking_chance_mult;\n }\n if (params.hacking_speed_mult) {\n this.mults.hacking_speed_mult = params.hacking_speed_mult;\n }\n if (params.hacking_money_mult) {\n this.mults.hacking_money_mult = params.hacking_money_mult;\n }\n if (params.hacking_grow_mult) {\n this.mults.hacking_grow_mult = params.hacking_grow_mult;\n }\n if (params.company_rep_mult) {\n this.mults.company_rep_mult = params.company_rep_mult;\n }\n if (params.faction_rep_mult) {\n this.mults.faction_rep_mult = params.faction_rep_mult;\n }\n if (params.crime_money_mult) {\n this.mults.crime_money_mult = params.crime_money_mult;\n }\n if (params.crime_success_mult) {\n this.mults.crime_success_mult = params.crime_success_mult;\n }\n if (params.work_money_mult) {\n this.mults.work_money_mult = params.work_money_mult;\n }\n if (params.hacknet_node_money_mult) {\n this.mults.hacknet_node_money_mult = params.hacknet_node_money_mult;\n }\n if (params.hacknet_node_purchase_cost_mult) {\n this.mults.hacknet_node_purchase_cost_mult = params.hacknet_node_purchase_cost_mult;\n }\n if (params.hacknet_node_ram_cost_mult) {\n this.mults.hacknet_node_ram_cost_mult = params.hacknet_node_ram_cost_mult;\n }\n if (params.hacknet_node_core_cost_mult) {\n this.mults.hacknet_node_core_cost_mult = params.hacknet_node_core_cost_mult;\n }\n if (params.hacknet_node_level_cost_mult) {\n this.mults.hacknet_node_level_cost_mult = params.hacknet_node_level_cost_mult;\n }\n if (params.bladeburner_max_stamina_mult) {\n this.mults.bladeburner_max_stamina_mult = params.bladeburner_max_stamina_mult;\n }\n if (params.bladeburner_stamina_gain_mult) {\n this.mults.bladeburner_stamina_gain_mult = params.bladeburner_stamina_gain_mult;\n }\n if (params.bladeburner_analysis_mult) {\n this.mults.bladeburner_analysis_mult = params.bladeburner_analysis_mult;\n }\n if (params.bladeburner_success_chance_mult) {\n this.mults.bladeburner_success_chance_mult = params.bladeburner_success_chance_mult;\n }\n\n if (params.stats === undefined)\n this.stats = generateStatsDescription(this.mults, params.programs, params.startingMoney);\n else this.stats = params.stats;\n }\n\n // Adds this Augmentation to the specified Factions\n addToFactions(factionList: string[]): void {\n for (let i = 0; i < factionList.length; ++i) {\n const faction: Faction | null = Factions[factionList[i]];\n if (faction == null) {\n console.warn(`In Augmentation.addToFactions(), could not find faction with this name: ${factionList[i]}`);\n continue;\n }\n faction.augmentations.push(this.name);\n }\n }\n\n // Adds this Augmentation to all Factions\n addToAllFactions(): void {\n for (const fac of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(fac)) {\n const facObj: Faction | null = Factions[fac];\n if (facObj == null) {\n console.warn(`Invalid Faction object in addToAllFactions(). Key value: ${fac}`);\n continue;\n }\n if (facObj.getInfo().special) continue;\n facObj.augmentations.push(this.name);\n }\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"Augmentation\", this);\n }\n\n // Initiatizes a Augmentation object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Augmentation {\n return Generic_fromJSON(Augmentation, value.data);\n }\n}\n\nReviver.constructors.Augmentation = Augmentation;\n","// Action Identifier enum\nexport const ActionTypes: {\n [key: string]: number;\n Idle: number;\n Contract: number;\n Operation: number;\n BlackOp: number;\n BlackOperation: number;\n Training: number;\n Recruitment: number;\n FieldAnalysis: number;\n \"Field Analysis\": number;\n Diplomacy: number;\n \"Hyperbolic Regeneration Chamber\": number;\n \"Incite Violence\": number;\n} = {\n Idle: 1,\n Contract: 2,\n Operation: 3,\n BlackOp: 4,\n BlackOperation: 4,\n Training: 5,\n Recruitment: 6,\n FieldAnalysis: 7,\n \"Field Analysis\": 7,\n Diplomacy: 8,\n \"Hyperbolic Regeneration Chamber\": 9,\n \"Incite Violence\": 10,\n};\n","import React from \"react\";\nimport { Theme } from \"@mui/material\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport M from \"@mui/material/Modal\";\nimport Fade from \"@mui/material/Fade\";\nimport Box from \"@mui/material/Box\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n modal: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n paper: {\n backgroundColor: theme.palette.background.default,\n border: \"2px solid \" + theme.palette.primary.main,\n boxShadow: `0px 3px 5px -1px ${theme.palette.primary.dark},0px 5px 8px 0px ${theme.palette.primary.dark},0px 1px 14px 0px ${theme.palette.primary.dark}`,\n padding: 2,\n maxWidth: \"80%\",\n maxHeight: \"80%\",\n overflow: \"auto\",\n \"&::-webkit-scrollbar\": {\n // webkit\n display: \"none\",\n },\n scrollbarWidth: \"none\", // firefox\n },\n }),\n);\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n children: React.ReactNode;\n}\n\nexport const Modal = (props: IProps): React.ReactElement => {\n const classes = useStyles();\n return (\n <M\n disableRestoreFocus\n disableScrollLock\n disableEnforceFocus\n disableAutoFocus\n open={props.open}\n onClose={props.onClose}\n closeAfterTransition\n className={classes.modal}\n >\n <Fade in={props.open}>\n <div className={classes.paper}>\n <Box sx={{ m: 2 }}>{props.children}</Box>\n </div>\n </Fade>\n </M>\n );\n};\n","import React from \"react\";\nimport { TableCell as MuiTableCell, TableCellProps, Table as MuiTable, TableProps } from \"@mui/material\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\n\nconst useStyles = makeStyles({\n root: {\n borderBottom: \"none\",\n },\n small: {\n width: \"1px\",\n },\n});\n\nexport const TableCell: React.FC<TableCellProps> = (props: TableCellProps) => {\n return (\n <MuiTableCell\n {...props}\n classes={{\n root: useStyles().root,\n ...props.classes,\n }}\n />\n );\n};\n\nexport const Table: React.FC<TableProps> = (props: TableProps) => {\n return (\n <MuiTable\n {...props}\n classes={{\n root: useStyles().small,\n ...props.classes,\n }}\n />\n );\n};\n","import { Player } from \"./Player\";\n\nimport { LiteratureNames } from \"./Literature/data/LiteratureNames\";\n\nimport { ITutorialEvents } from \"./ui/InteractiveTutorial/ITutorialEvents\";\n\n// Ordered array of keys to Interactive Tutorial Steps\nenum iTutorialSteps {\n Start,\n GoToCharacterPage, // Click on 'Stats' page\n CharacterPage, // Introduction to 'Stats' page\n CharacterGoToTerminalPage, // Go back to Terminal\n TerminalIntro, // Introduction to Terminal\n TerminalHelp, // Using 'help' Terminal command\n TerminalLs, // Using 'ls' Terminal command\n TerminalScan, // Using 'scan' Terminal command\n TerminalScanAnalyze1, // Using 'scan-analyze' Terminal command\n TerminalScanAnalyze2, // Using 'scan-analyze 3' Terminal command\n TerminalConnect, // Connecting to n00dles\n TerminalAnalyze, // Analyzing n00dles\n TerminalNuke, // NUKE n00dles\n TerminalManualHack, // Hack n00dles\n TerminalHackingMechanics, // Explanation of hacking mechanics\n TerminalGoHome, // Go home before creating a script.\n TerminalCreateScript, // Create a script using 'nano'\n TerminalTypeScript, // Script Editor page - Type script and then save & close\n TerminalFree, // Using 'Free' Terminal command\n TerminalRunScript, // Running script using 'run' Terminal command\n TerminalGoToActiveScriptsPage,\n ActiveScriptsPage,\n ActiveScriptsToTerminal,\n TerminalTailScript,\n GoToHacknetNodesPage,\n HacknetNodesIntroduction,\n HacknetNodesGoToWorldPage,\n WorldDescription,\n TutorialPageInfo,\n End,\n}\n\nconst ITutorial: {\n currStep: iTutorialSteps;\n isRunning: boolean;\n stepIsDone: {\n [iTutorialSteps.Start]: boolean;\n [iTutorialSteps.GoToCharacterPage]: boolean;\n [iTutorialSteps.CharacterPage]: boolean;\n [iTutorialSteps.CharacterGoToTerminalPage]: boolean;\n [iTutorialSteps.TerminalIntro]: boolean;\n [iTutorialSteps.TerminalHelp]: boolean;\n [iTutorialSteps.TerminalLs]: boolean;\n [iTutorialSteps.TerminalScan]: boolean;\n [iTutorialSteps.TerminalScanAnalyze1]: boolean;\n [iTutorialSteps.TerminalScanAnalyze2]: boolean;\n [iTutorialSteps.TerminalConnect]: boolean;\n [iTutorialSteps.TerminalAnalyze]: boolean;\n [iTutorialSteps.TerminalNuke]: boolean;\n [iTutorialSteps.TerminalManualHack]: boolean;\n [iTutorialSteps.TerminalHackingMechanics]: boolean;\n [iTutorialSteps.TerminalGoHome]: boolean;\n [iTutorialSteps.TerminalCreateScript]: boolean;\n [iTutorialSteps.TerminalTypeScript]: boolean;\n [iTutorialSteps.TerminalFree]: boolean;\n [iTutorialSteps.TerminalRunScript]: boolean;\n [iTutorialSteps.TerminalGoToActiveScriptsPage]: boolean;\n [iTutorialSteps.ActiveScriptsPage]: boolean;\n [iTutorialSteps.ActiveScriptsToTerminal]: boolean;\n [iTutorialSteps.TerminalTailScript]: boolean;\n [iTutorialSteps.GoToHacknetNodesPage]: boolean;\n [iTutorialSteps.HacknetNodesIntroduction]: boolean;\n [iTutorialSteps.HacknetNodesGoToWorldPage]: boolean;\n [iTutorialSteps.WorldDescription]: boolean;\n [iTutorialSteps.TutorialPageInfo]: boolean;\n [iTutorialSteps.End]: boolean;\n };\n} = {\n currStep: iTutorialSteps.Start,\n isRunning: false,\n\n // Keeps track of whether each step has been done\n stepIsDone: {\n [iTutorialSteps.Start]: false,\n [iTutorialSteps.GoToCharacterPage]: false,\n [iTutorialSteps.CharacterPage]: false,\n [iTutorialSteps.CharacterGoToTerminalPage]: false,\n [iTutorialSteps.TerminalIntro]: false,\n [iTutorialSteps.TerminalHelp]: false,\n [iTutorialSteps.TerminalLs]: false,\n [iTutorialSteps.TerminalScan]: false,\n [iTutorialSteps.TerminalScanAnalyze1]: false,\n [iTutorialSteps.TerminalScanAnalyze2]: false,\n [iTutorialSteps.TerminalConnect]: false,\n [iTutorialSteps.TerminalAnalyze]: false,\n [iTutorialSteps.TerminalNuke]: false,\n [iTutorialSteps.TerminalManualHack]: false,\n [iTutorialSteps.TerminalHackingMechanics]: false,\n [iTutorialSteps.TerminalGoHome]: false,\n [iTutorialSteps.TerminalCreateScript]: false,\n [iTutorialSteps.TerminalTypeScript]: false,\n [iTutorialSteps.TerminalFree]: false,\n [iTutorialSteps.TerminalRunScript]: false,\n [iTutorialSteps.TerminalGoToActiveScriptsPage]: false,\n [iTutorialSteps.ActiveScriptsPage]: false,\n [iTutorialSteps.ActiveScriptsToTerminal]: false,\n [iTutorialSteps.TerminalTailScript]: false,\n [iTutorialSteps.GoToHacknetNodesPage]: false,\n [iTutorialSteps.HacknetNodesIntroduction]: false,\n [iTutorialSteps.HacknetNodesGoToWorldPage]: false,\n [iTutorialSteps.WorldDescription]: false,\n [iTutorialSteps.TutorialPageInfo]: false,\n [iTutorialSteps.End]: false,\n },\n};\n\nfunction iTutorialStart(): void {\n ITutorial.isRunning = true;\n ITutorial.currStep = iTutorialSteps.Start;\n}\n\n// Go to the next step and evaluate it\nfunction iTutorialNextStep(): void {\n ITutorial.stepIsDone[ITutorial.currStep] = true;\n if (ITutorial.currStep < iTutorialSteps.End) {\n ITutorial.currStep += 1;\n }\n if (ITutorial.currStep === iTutorialSteps.End) iTutorialEnd();\n ITutorialEvents.emit();\n}\n\n// Go to previous step and evaluate\nfunction iTutorialPrevStep(): void {\n if (ITutorial.currStep > iTutorialSteps.Start) {\n ITutorial.currStep -= 1;\n }\n ITutorialEvents.emit();\n}\n\nfunction iTutorialEnd(): void {\n ITutorial.isRunning = false;\n ITutorial.currStep = iTutorialSteps.Start;\n Player.getHomeComputer().messages.push(LiteratureNames.HackersStartingHandbook);\n ITutorialEvents.emit();\n}\n\nexport { iTutorialSteps, iTutorialEnd, iTutorialStart, iTutorialNextStep, ITutorial, iTutorialPrevStep };\n","import { IPlayer } from \"../IPlayer\";\nimport { PlayerObject } from \"./PlayerObject\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { applyAugmentation } from \"../../Augmentation/AugmentationHelpers\";\nimport { PlayerOwnedAugmentation } from \"../../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CodingContractRewardType, ICodingContractReward } from \"../../CodingContracts\";\nimport { Company } from \"../../Company/Company\";\nimport { Companies } from \"../../Company/Companies\";\nimport { getNextCompanyPositionHelper } from \"../../Company/GetNextCompanyPosition\";\nimport { getJobRequirementText } from \"../../Company/GetJobRequirementText\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport * as posNames from \"../../Company/data/companypositionnames\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Programs } from \"../../Programs/Programs\";\nimport { determineCrimeSuccess } from \"../../Crime/CrimeHelpers\";\nimport { Crimes } from \"../../Crime/Crimes\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { resetGangs } from \"../../Gang/AllGangs\";\nimport { Cities } from \"../../Locations/Cities\";\nimport { Locations } from \"../../Locations/Locations\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { Sleeve } from \"../../PersonObjects/Sleeve/Sleeve\";\nimport {\n calculateSkill as calculateSkillF,\n calculateSkillProgress as calculateSkillProgressF,\n ISkillProgress,\n} from \"../formulas/skill\";\nimport { calculateIntelligenceBonus } from \"../formulas/intelligence\";\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"../formulas/reputation\";\nimport { GetServer, AddToAllServers, createUniqueRandomIp } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport { safetlyCreateUniqueServer } from \"../../Server/ServerHelpers\";\n\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\nimport { applySourceFile } from \"../../SourceFile/applySourceFile\";\nimport { applyExploit } from \"../../Exploits/applyExploits\";\nimport { SourceFiles } from \"../../SourceFile/SourceFiles\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { influenceStockThroughCompanyWork } from \"../../StockMarket/PlayerInfluencing\";\nimport { getHospitalizationCost } from \"../../Hospital/Hospital\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { IRouter } from \"../../ui/Router\";\nimport { MoneySourceTracker } from \"../../utils/MoneySourceTracker\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\n\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport React from \"react\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { SnackbarEvents } from \"../../ui/React/Snackbar\";\nimport { calculateClassEarnings } from \"../formulas/work\";\nimport { achievements } from \"../../Achievements/Achievements\";\n\nexport function init(this: IPlayer): void {\n /* Initialize Player's home computer */\n const t_homeComp = safetlyCreateUniqueServer({\n adminRights: true,\n hostname: \"home\",\n ip: createUniqueRandomIp(),\n isConnectedTo: true,\n maxRam: 8,\n organizationName: \"Home PC\",\n purchasedByPlayer: true,\n });\n this.currentServer = SpecialServers.Home;\n AddToAllServers(t_homeComp);\n\n this.getHomeComputer().programs.push(Programs.NukeProgram.name);\n}\n\nexport function prestigeAugmentation(this: PlayerObject): void {\n this.currentServer = SpecialServers.Home;\n\n this.numPeopleKilled = 0;\n\n //Reset stats\n this.hacking = 1;\n\n this.strength = 1;\n this.defense = 1;\n this.dexterity = 1;\n this.agility = 1;\n\n this.charisma = 1;\n\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n\n this.money = 1000;\n\n this.city = CityName.Sector12;\n this.location = LocationName.TravelAgency;\n\n this.companyName = \"\";\n this.jobs = {};\n\n this.purchasedServers = [];\n\n this.factions = [];\n this.factionInvitations = [];\n\n this.queuedAugmentations = [];\n\n this.resleeves = [];\n\n const numSleeves = Math.min(3, SourceFileFlags[10] + (this.bitNodeN === 10 ? 1 : 0)) + this.sleevesFromCovenant;\n if (this.sleeves.length > numSleeves) this.sleeves.length = numSleeves;\n for (let i = this.sleeves.length; i < numSleeves; i++) {\n this.sleeves.push(new Sleeve(this));\n }\n\n for (let i = 0; i < this.sleeves.length; ++i) {\n if (this.sleeves[i] instanceof Sleeve) {\n if (this.sleeves[i].shock >= 100) {\n this.sleeves[i].synchronize(this);\n } else {\n this.sleeves[i].shockRecovery(this);\n }\n }\n }\n\n this.isWorking = false;\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n this.createProgramName = \"\";\n this.className = \"\";\n this.crimeType = \"\";\n\n this.workHackExpGainRate = 0;\n this.workStrExpGainRate = 0;\n this.workDefExpGainRate = 0;\n this.workDexExpGainRate = 0;\n this.workAgiExpGainRate = 0;\n this.workChaExpGainRate = 0;\n this.workRepGainRate = 0;\n this.workMoneyGainRate = 0;\n\n this.workHackExpGained = 0;\n this.workStrExpGained = 0;\n this.workDefExpGained = 0;\n this.workDexExpGained = 0;\n this.workAgiExpGained = 0;\n this.workChaExpGained = 0;\n this.workRepGained = 0;\n this.workMoneyGained = 0;\n\n this.timeWorked = 0;\n\n this.lastUpdate = new Date().getTime();\n\n // Statistics Trackers\n this.playtimeSinceLastAug = 0;\n this.scriptProdSinceLastAug = 0;\n this.moneySourceA.reset();\n\n this.hacknetNodes.length = 0;\n this.hashManager.prestige();\n\n // Reapply augs, re-calculate skills and reset HP\n this.reapplyAllAugmentations(true);\n this.hp = this.max_hp;\n}\n\nexport function prestigeSourceFile(this: IPlayer): void {\n this.prestigeAugmentation();\n this.karma = 0;\n // Duplicate sleeves are reset to level 1 every Bit Node (but the number of sleeves you have persists)\n for (let i = 0; i < this.sleeves.length; ++i) {\n if (this.sleeves[i] instanceof Sleeve) {\n this.sleeves[i].prestige(this);\n } else {\n this.sleeves[i] = new Sleeve(this);\n }\n }\n\n if (this.bitNodeN === 10) {\n for (let i = 0; i < this.sleeves.length; i++) {\n this.sleeves[i].shock = Math.max(25, this.sleeves[i].shock);\n this.sleeves[i].sync = Math.max(25, this.sleeves[i].sync);\n }\n }\n\n this.timeWorked = 0;\n\n // Gang\n this.gang = null;\n resetGangs();\n\n // Reset Stock market\n this.hasWseAccount = false;\n this.hasTixApiAccess = false;\n this.has4SData = false;\n this.has4SDataTixApi = false;\n\n // BitNode 3: Corporatocracy\n this.corporation = null;\n\n this.moneySourceB.reset();\n this.playtimeSinceLastBitnode = 0;\n this.augmentations = [];\n}\n\nexport function receiveInvite(this: IPlayer, factionName: string): void {\n if (this.factionInvitations.includes(factionName) || this.factions.includes(factionName)) {\n return;\n }\n this.factionInvitations.push(factionName);\n}\n\n//Calculates skill level based on experience. The same formula will be used for every skill\nexport function calculateSkill(this: IPlayer, exp: number, mult = 1): number {\n return calculateSkillF(exp, mult);\n}\n\n//Calculates skill level progress based on experience. The same formula will be used for every skill\nexport function calculateSkillProgress(this: IPlayer, exp: number, mult = 1): ISkillProgress {\n return calculateSkillProgressF(exp, mult);\n}\n\nexport function updateSkillLevels(this: IPlayer): void {\n this.hacking = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier)),\n );\n this.strength = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.strength_exp, this.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier)),\n );\n this.defense = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.defense_exp, this.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier)),\n );\n this.dexterity = Math.max(\n 1,\n Math.floor(\n this.calculateSkill(this.dexterity_exp, this.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier),\n ),\n );\n this.agility = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.agility_exp, this.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier)),\n );\n this.charisma = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.charisma_exp, this.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier)),\n );\n\n if (this.intelligence > 0) {\n this.intelligence = Math.floor(this.calculateSkill(this.intelligence_exp));\n } else {\n this.intelligence = 0;\n }\n\n const ratio = this.hp / this.max_hp;\n this.max_hp = Math.floor(10 + this.defense / 10);\n this.hp = Math.round(this.max_hp * ratio);\n}\n\nexport function resetMultipliers(this: IPlayer): void {\n this.hacking_chance_mult = 1;\n this.hacking_speed_mult = 1;\n this.hacking_money_mult = 1;\n this.hacking_grow_mult = 1;\n\n this.hacking_mult = 1;\n this.strength_mult = 1;\n this.defense_mult = 1;\n this.dexterity_mult = 1;\n this.agility_mult = 1;\n this.charisma_mult = 1;\n\n this.hacking_exp_mult = 1;\n this.strength_exp_mult = 1;\n this.defense_exp_mult = 1;\n this.dexterity_exp_mult = 1;\n this.agility_exp_mult = 1;\n this.charisma_exp_mult = 1;\n\n this.company_rep_mult = 1;\n this.faction_rep_mult = 1;\n\n this.crime_money_mult = 1;\n this.crime_success_mult = 1;\n\n this.hacknet_node_money_mult = 1;\n this.hacknet_node_purchase_cost_mult = 1;\n this.hacknet_node_ram_cost_mult = 1;\n this.hacknet_node_core_cost_mult = 1;\n this.hacknet_node_level_cost_mult = 1;\n\n this.work_money_mult = 1;\n\n this.bladeburner_max_stamina_mult = 1;\n this.bladeburner_stamina_gain_mult = 1;\n this.bladeburner_analysis_mult = 1;\n this.bladeburner_success_chance_mult = 1;\n}\n\nexport function hasProgram(this: IPlayer, programName: string): boolean {\n const home = this.getHomeComputer();\n if (home == null) {\n return false;\n }\n\n for (let i = 0; i < home.programs.length; ++i) {\n if (programName.toLowerCase() == home.programs[i].toLowerCase()) {\n return true;\n }\n }\n return false;\n}\n\nexport function setMoney(this: PlayerObject, money: number): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.setMoney()\");\n return;\n }\n this.money = money;\n}\n\nexport function gainMoney(this: PlayerObject, money: number, source: string): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.gainMoney()\");\n return;\n }\n\n this.money = this.money + money;\n this.recordMoneySource(money, source);\n}\n\nexport function loseMoney(this: PlayerObject, money: number, source: string): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.loseMoney()\");\n return;\n }\n if (this.money === Infinity && money === Infinity) return;\n this.money = this.money - money;\n this.recordMoneySource(-1 * money, source);\n}\n\nexport function canAfford(this: IPlayer, cost: number): boolean {\n if (isNaN(cost)) {\n console.error(`NaN passed into Player.canAfford()`);\n return false;\n }\n return this.money >= cost;\n}\n\nexport function recordMoneySource(this: PlayerObject, amt: number, source: string): void {\n if (!(this.moneySourceA instanceof MoneySourceTracker)) {\n console.warn(`Player.moneySourceA was not properly initialized. Resetting`);\n this.moneySourceA = new MoneySourceTracker();\n }\n if (!(this.moneySourceB instanceof MoneySourceTracker)) {\n console.warn(`Player.moneySourceB was not properly initialized. Resetting`);\n this.moneySourceB = new MoneySourceTracker();\n }\n this.moneySourceA.record(amt, source);\n this.moneySourceB.record(amt, source);\n}\n\nexport function gainHackingExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainHackingExp()\");\n return;\n }\n this.hacking_exp += exp;\n if (this.hacking_exp < 0) {\n this.hacking_exp = 0;\n }\n\n this.hacking = calculateSkillF(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier);\n}\n\nexport function gainStrengthExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainStrengthExp()\");\n return;\n }\n this.strength_exp += exp;\n if (this.strength_exp < 0) {\n this.strength_exp = 0;\n }\n\n this.strength = calculateSkillF(this.strength_exp, this.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier);\n}\n\nexport function gainDefenseExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into player.gainDefenseExp()\");\n return;\n }\n this.defense_exp += exp;\n if (this.defense_exp < 0) {\n this.defense_exp = 0;\n }\n\n this.defense = calculateSkillF(this.defense_exp, this.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier);\n const ratio = this.hp / this.max_hp;\n this.max_hp = Math.floor(10 + this.defense / 10);\n this.hp = Math.round(this.max_hp * ratio);\n}\n\nexport function gainDexterityExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainDexterityExp()\");\n return;\n }\n this.dexterity_exp += exp;\n if (this.dexterity_exp < 0) {\n this.dexterity_exp = 0;\n }\n\n this.dexterity = calculateSkillF(\n this.dexterity_exp,\n this.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier,\n );\n}\n\nexport function gainAgilityExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainAgilityExp()\");\n return;\n }\n this.agility_exp += exp;\n if (this.agility_exp < 0) {\n this.agility_exp = 0;\n }\n\n this.agility = calculateSkillF(this.agility_exp, this.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier);\n}\n\nexport function gainCharismaExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainCharismaExp()\");\n return;\n }\n this.charisma_exp += exp;\n if (this.charisma_exp < 0) {\n this.charisma_exp = 0;\n }\n\n this.charisma = calculateSkillF(this.charisma_exp, this.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier);\n}\n\nexport function gainIntelligenceExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERROR: NaN passed into Player.gainIntelligenceExp()\");\n return;\n }\n if (SourceFileFlags[5] > 0 || this.intelligence > 0) {\n this.intelligence_exp += exp;\n this.intelligence = Math.floor(this.calculateSkill(this.intelligence_exp));\n }\n}\n\n//Given a string expression like \"str\" or \"strength\", returns the given stat\nexport function queryStatFromString(this: IPlayer, str: string): number {\n const tempStr = str.toLowerCase();\n if (tempStr.includes(\"hack\")) {\n return this.hacking;\n }\n if (tempStr.includes(\"str\")) {\n return this.strength;\n }\n if (tempStr.includes(\"def\")) {\n return this.defense;\n }\n if (tempStr.includes(\"dex\")) {\n return this.dexterity;\n }\n if (tempStr.includes(\"agi\")) {\n return this.agility;\n }\n if (tempStr.includes(\"cha\")) {\n return this.charisma;\n }\n if (tempStr.includes(\"int\")) {\n return this.intelligence;\n }\n return 0;\n}\n\n/******* Working functions *******/\nexport function resetWorkStatus(this: IPlayer, generalType?: string, group?: string, workType?: string): void {\n if (this.workType !== CONSTANTS.WorkTypeFaction && generalType === this.workType && group === this.companyName)\n return;\n if (generalType === this.workType && group === this.currentWorkFactionName && workType === this.factionWorkType)\n return;\n if (this.isWorking) this.singularityStopWork();\n this.workHackExpGainRate = 0;\n this.workStrExpGainRate = 0;\n this.workDefExpGainRate = 0;\n this.workDexExpGainRate = 0;\n this.workAgiExpGainRate = 0;\n this.workChaExpGainRate = 0;\n this.workRepGainRate = 0;\n this.workMoneyGainRate = 0;\n this.workMoneyLossRate = 0;\n\n this.workHackExpGained = 0;\n this.workStrExpGained = 0;\n this.workDefExpGained = 0;\n this.workDexExpGained = 0;\n this.workAgiExpGained = 0;\n this.workChaExpGained = 0;\n this.workRepGained = 0;\n this.workMoneyGained = 0;\n\n this.timeWorked = 0;\n this.timeWorkedCreateProgram = 0;\n\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n this.createProgramName = \"\";\n this.className = \"\";\n this.workType = \"\";\n}\n\nexport function processWorkEarnings(this: IPlayer, numCycles = 1): void {\n let focusBonus = 1;\n if (!this.hasAugmentation(AugmentationNames[\"NeuroreceptorManager\"])) {\n focusBonus = this.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n const hackExpGain = focusBonus * this.workHackExpGainRate * numCycles;\n const strExpGain = focusBonus * this.workStrExpGainRate * numCycles;\n const defExpGain = focusBonus * this.workDefExpGainRate * numCycles;\n const dexExpGain = focusBonus * this.workDexExpGainRate * numCycles;\n const agiExpGain = focusBonus * this.workAgiExpGainRate * numCycles;\n const chaExpGain = focusBonus * this.workChaExpGainRate * numCycles;\n const moneyGain = (this.workMoneyGainRate - this.workMoneyLossRate) * numCycles;\n this.gainHackingExp(hackExpGain);\n this.gainStrengthExp(strExpGain);\n this.gainDefenseExp(defExpGain);\n this.gainDexterityExp(dexExpGain);\n this.gainAgilityExp(agiExpGain);\n this.gainCharismaExp(chaExpGain);\n this.gainMoney(moneyGain, this.className ? \"class\" : \"work\");\n this.workHackExpGained += hackExpGain;\n this.workStrExpGained += strExpGain;\n this.workDefExpGained += defExpGain;\n this.workDexExpGained += dexExpGain;\n this.workAgiExpGained += agiExpGain;\n this.workChaExpGained += chaExpGain;\n this.workRepGained += focusBonus * this.workRepGainRate * numCycles;\n this.workMoneyGained += focusBonus * this.workMoneyGainRate * numCycles;\n this.workMoneyGained -= focusBonus * this.workMoneyLossRate * numCycles;\n}\n\n/* Working for Company */\nexport function startWork(this: IPlayer, companyName: string): void {\n this.resetWorkStatus(CONSTANTS.WorkTypeCompany, companyName);\n this.isWorking = true;\n this.companyName = companyName;\n this.workType = CONSTANTS.WorkTypeCompany;\n\n this.workHackExpGainRate = this.getWorkHackExpGain();\n this.workStrExpGainRate = this.getWorkStrExpGain();\n this.workDefExpGainRate = this.getWorkDefExpGain();\n this.workDexExpGainRate = this.getWorkDexExpGain();\n this.workAgiExpGainRate = this.getWorkAgiExpGain();\n this.workChaExpGainRate = this.getWorkChaExpGain();\n this.workRepGainRate = this.getWorkRepGain();\n this.workMoneyGainRate = this.getWorkMoneyGain();\n\n this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours;\n}\n\nexport function process(this: IPlayer, router: IRouter, numCycles = 1): void {\n // Working\n if (this.isWorking) {\n if (this.workType == CONSTANTS.WorkTypeFaction) {\n if (this.workForFaction(numCycles)) {\n router.toFaction();\n }\n } else if (this.workType == CONSTANTS.WorkTypeCreateProgram) {\n if (this.createProgramWork(numCycles)) {\n router.toTerminal();\n }\n } else if (this.workType == CONSTANTS.WorkTypeStudyClass) {\n if (this.takeClass(numCycles)) {\n router.toCity();\n }\n } else if (this.workType == CONSTANTS.WorkTypeCrime) {\n if (this.commitCrime(numCycles)) {\n router.toLocation(Locations[LocationName.Slums]);\n }\n } else if (this.workType == CONSTANTS.WorkTypeCompanyPartTime) {\n if (this.workPartTime(numCycles)) {\n router.toCity();\n }\n } else {\n if (this.work(numCycles)) {\n router.toCity();\n }\n }\n }\n}\n\nexport function cancelationPenalty(this: IPlayer): number {\n const data = serverMetadata.find((s) => s.specialName === this.companyName);\n if (!data) return 0.5; // Does not have special server.\n const server = GetServer(data.hostname);\n if (server instanceof Server) {\n if (server && server.backdoorInstalled) return 0.75;\n }\n\n return 0.5;\n}\n\nexport function work(this: IPlayer, numCycles: number): boolean {\n // Cap the number of cycles being processed to whatever would put you at\n // the work time limit (8 hours)\n let overMax = false;\n if (this.timeWorked + CONSTANTS._idleSpeed * numCycles >= CONSTANTS.MillisecondsPer8Hours) {\n overMax = true;\n numCycles = Math.round((CONSTANTS.MillisecondsPer8Hours - this.timeWorked) / CONSTANTS._idleSpeed);\n }\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n\n this.workRepGainRate = this.getWorkRepGain();\n this.workMoneyGainRate = this.getWorkMoneyGain();\n this.processWorkEarnings(numCycles);\n\n const comp = Companies[this.companyName];\n influenceStockThroughCompanyWork(comp, this.workRepGainRate, numCycles);\n\n // If timeWorked == 8 hours, then finish. You can only gain 8 hours worth of exp and money\n if (overMax || this.timeWorked >= CONSTANTS.MillisecondsPer8Hours) {\n this.finishWork(false);\n return true;\n }\n return false;\n}\n\nexport function finishWork(this: IPlayer, cancelled: boolean, sing = false): string {\n //Since the work was cancelled early, player only gains half of what they've earned so far\n if (cancelled) {\n this.workRepGained *= this.cancelationPenalty();\n }\n\n const penaltyString = this.cancelationPenalty() === 0.5 ? \"half\" : \"three-quarters\";\n\n const company = Companies[this.companyName];\n company.playerReputation += this.workRepGained;\n\n this.updateSkillLevels();\n\n let content = (\n <>\n You earned a total of: <br />\n <Money money={this.workMoneyGained} />\n <br />\n <Reputation reputation={this.workRepGained} /> reputation for the company <br />\n {this.workHackExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br />\n </>\n )}\n {this.workStrExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br />\n </>\n )}\n {this.workDefExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workDefExpGained)} defense exp <br />\n </>\n )}\n {this.workDexExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity exp <br />\n </>\n )}\n {this.workAgiExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility exp <br />\n </>\n )}\n {this.workChaExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma exp <br />\n </>\n )}\n <br />\n </>\n );\n\n if (cancelled) {\n content = (\n <>\n You worked a short shift of {convertTimeMsToTimeElapsedString(this.timeWorked)} <br />\n <br />\n Since you cancelled your work early, you only gained {penaltyString} of the reputation you earned. <br />\n <br />\n {content}\n </>\n );\n } else {\n content = (\n <>\n You worked a full shift of 8 hours! <br />\n <br />\n {content}\n </>\n );\n }\n if (!sing) {\n dialogBoxCreate(content);\n }\n\n this.isWorking = false;\n this.focus = false;\n\n this.resetWorkStatus();\n if (sing) {\n const res =\n \"You worked a short shift of \" +\n convertTimeMsToTimeElapsedString(this.timeWorked) +\n \" and \" +\n \"earned $\" +\n numeralWrapper.formatMoney(this.workMoneyGained) +\n \", \" +\n numeralWrapper.formatReputation(this.workRepGained) +\n \" reputation, \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hacking exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" strength exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" defense exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dexterity exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agility exp, and \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" charisma exp.\";\n\n return res;\n }\n\n return \"\";\n}\n\nexport function startWorkPartTime(this: IPlayer, companyName: string): void {\n this.resetWorkStatus(CONSTANTS.WorkTypeCompanyPartTime, companyName);\n this.isWorking = true;\n this.companyName = companyName;\n this.workType = CONSTANTS.WorkTypeCompanyPartTime;\n\n this.workHackExpGainRate = this.getWorkHackExpGain();\n this.workStrExpGainRate = this.getWorkStrExpGain();\n this.workDefExpGainRate = this.getWorkDefExpGain();\n this.workDexExpGainRate = this.getWorkDexExpGain();\n this.workAgiExpGainRate = this.getWorkAgiExpGain();\n this.workChaExpGainRate = this.getWorkChaExpGain();\n this.workRepGainRate = this.getWorkRepGain();\n this.workMoneyGainRate = this.getWorkMoneyGain();\n\n this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours;\n}\n\nexport function workPartTime(this: IPlayer, numCycles: number): boolean {\n //Cap the number of cycles being processed to whatever would put you at the\n //work time limit (8 hours)\n let overMax = false;\n if (this.timeWorked + CONSTANTS._idleSpeed * numCycles >= CONSTANTS.MillisecondsPer8Hours) {\n overMax = true;\n numCycles = Math.round((CONSTANTS.MillisecondsPer8Hours - this.timeWorked) / CONSTANTS._idleSpeed);\n }\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n\n this.workRepGainRate = this.getWorkRepGain();\n this.processWorkEarnings(numCycles);\n\n //If timeWorked == 8 hours, then finish. You can only gain 8 hours worth of exp and money\n if (overMax || this.timeWorked >= CONSTANTS.MillisecondsPer8Hours) {\n this.finishWorkPartTime();\n return true;\n }\n return false;\n}\n\nexport function finishWorkPartTime(this: IPlayer, sing = false): string {\n const company = Companies[this.companyName];\n company.playerReputation += this.workRepGained;\n\n this.updateSkillLevels();\n\n const content = (\n <>\n You worked for {convertTimeMsToTimeElapsedString(this.timeWorked)}\n <br />\n <br />\n You earned a total of: <br />\n <Money money={this.workMoneyGained} />\n <br />\n <Reputation reputation={this.workRepGained} /> reputation for the company <br />\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br />\n {numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br />\n {numeralWrapper.formatExp(this.workDefExpGained)} defense exp <br />\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity exp <br />\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility exp <br />\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma exp\n <br />\n </>\n );\n if (!sing) {\n dialogBoxCreate(content);\n }\n\n this.isWorking = false;\n this.resetWorkStatus();\n\n if (sing) {\n const res =\n \"You worked for \" +\n convertTimeMsToTimeElapsedString(this.timeWorked) +\n \" and \" +\n \"earned a total of \" +\n \"$\" +\n numeralWrapper.formatMoney(this.workMoneyGained) +\n \", \" +\n numeralWrapper.formatReputation(this.workRepGained) +\n \" reputation, \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hacking exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" strength exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" defense exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dexterity exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agility exp, and \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" charisma exp\";\n return res;\n }\n return \"\";\n}\n\nexport function startFocusing(this: IPlayer): void {\n this.focus = true;\n}\n\nexport function stopFocusing(this: IPlayer): void {\n this.focus = false;\n}\n\n/* Working for Faction */\nexport function startFactionWork(this: IPlayer, faction: Faction): void {\n //Update reputation gain rate to account for faction favor\n let favorMult = 1 + faction.favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n this.workRepGainRate *= favorMult;\n this.workRepGainRate *= BitNodeMultipliers.FactionWorkRepGain;\n\n this.isWorking = true;\n this.workType = CONSTANTS.WorkTypeFaction;\n this.currentWorkFactionName = faction.name;\n\n this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer20Hours;\n}\n\nexport function startFactionHackWork(this: IPlayer, faction: Faction): void {\n this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkHacking);\n\n this.workHackExpGainRate = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workRepGainRate = getHackingWorkRepGain(this, faction);\n\n this.factionWorkType = CONSTANTS.FactionWorkHacking;\n this.currentWorkFactionDescription = \"carrying out hacking contracts\";\n\n this.startFactionWork(faction);\n}\n\nexport function startFactionFieldWork(this: IPlayer, faction: Faction): void {\n this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkField);\n\n this.workHackExpGainRate = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workStrExpGainRate = 0.1 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDefExpGainRate = 0.1 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDexExpGainRate = 0.1 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workAgiExpGainRate = 0.1 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workChaExpGainRate = 0.1 * this.charisma_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workRepGainRate = getFactionFieldWorkRepGain(this, faction);\n\n this.factionWorkType = CONSTANTS.FactionWorkField;\n this.currentWorkFactionDescription = \"carrying out field missions\";\n\n this.startFactionWork(faction);\n}\n\nexport function startFactionSecurityWork(this: IPlayer, faction: Faction): void {\n this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkSecurity);\n\n this.workHackExpGainRate = 0.05 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workStrExpGainRate = 0.15 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDefExpGainRate = 0.15 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDexExpGainRate = 0.15 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workAgiExpGainRate = 0.15 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workChaExpGainRate = 0.0 * this.charisma_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workRepGainRate = getFactionSecurityWorkRepGain(this, faction);\n\n this.factionWorkType = CONSTANTS.FactionWorkSecurity;\n this.currentWorkFactionDescription = \"performing security detail\";\n\n this.startFactionWork(faction);\n}\n\nexport function workForFaction(this: IPlayer, numCycles: number): boolean {\n const faction = Factions[this.currentWorkFactionName];\n\n //Constantly update the rep gain rate\n switch (this.factionWorkType) {\n case CONSTANTS.FactionWorkHacking:\n this.workRepGainRate = getHackingWorkRepGain(this, faction);\n break;\n case CONSTANTS.FactionWorkField:\n this.workRepGainRate = getFactionFieldWorkRepGain(this, faction);\n break;\n case CONSTANTS.FactionWorkSecurity:\n this.workRepGainRate = getFactionSecurityWorkRepGain(this, faction);\n break;\n default:\n break;\n }\n this.workRepGainRate *= BitNodeMultipliers.FactionWorkRepGain;\n\n //Cap the number of cycles being processed to whatever would put you at limit (20 hours)\n let overMax = false;\n if (this.timeWorked + CONSTANTS._idleSpeed * numCycles >= CONSTANTS.MillisecondsPer20Hours) {\n overMax = true;\n numCycles = Math.round((CONSTANTS.MillisecondsPer20Hours - this.timeWorked) / CONSTANTS._idleSpeed);\n }\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n\n this.processWorkEarnings(numCycles);\n\n //If timeWorked == 20 hours, then finish. You can only work for the faction for 20 hours\n if (overMax || this.timeWorked >= CONSTANTS.MillisecondsPer20Hours) {\n this.finishFactionWork(false);\n return true;\n }\n return false;\n}\n\nexport function finishFactionWork(this: IPlayer, cancelled: boolean, sing = false): string {\n const faction = Factions[this.currentWorkFactionName];\n faction.playerReputation += this.workRepGained;\n\n this.updateSkillLevels();\n\n if (!sing) {\n dialogBoxCreate(\n <>\n You worked for your faction {faction.name} for a total of {convertTimeMsToTimeElapsedString(this.timeWorked)}{\" \"}\n <br />\n <br />\n You earned a total of: <br />\n <Money money={this.workMoneyGained} />\n <br />\n <Reputation reputation={this.workRepGained} /> reputation for the faction <br />\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br />\n {numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br />\n {numeralWrapper.formatExp(this.workDefExpGained)} defense exp <br />\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity exp <br />\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility exp <br />\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma exp\n <br />\n </>,\n );\n }\n\n this.isWorking = false;\n this.resetWorkStatus();\n if (sing) {\n const res =\n \"You worked for your faction \" +\n faction.name +\n \" for a total of \" +\n convertTimeMsToTimeElapsedString(this.timeWorked) +\n \". \" +\n \"You earned \" +\n numeralWrapper.formatReputation(this.workRepGained) +\n \" rep, \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hacking exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" str exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" def exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dex exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agi exp, and \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" cha exp.\";\n\n return res;\n }\n return \"\";\n}\n\n//Money gained per game cycle\nexport function getWorkMoneyGain(this: IPlayer): number {\n // If player has SF-11, calculate salary multiplier from favor\n let bn11Mult = 1;\n const company = Companies[this.companyName];\n if (SourceFileFlags[11] > 0) {\n bn11Mult = 1 + company.favor / 100;\n }\n\n // Get base salary\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (companyPosition == null) {\n console.error(`Could not find CompanyPosition object for ${companyPositionName}. Work salary will be 0`);\n return 0;\n }\n\n return (\n companyPosition.baseSalary *\n company.salaryMultiplier *\n this.work_money_mult *\n BitNodeMultipliers.CompanyWorkMoney *\n bn11Mult\n );\n}\n\n//Hack exp gained per game cycle\nexport function getWorkHackExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work hack exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.hackingExpGain *\n company.expMultiplier *\n this.hacking_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Str exp gained per game cycle\nexport function getWorkStrExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work str exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.strengthExpGain *\n company.expMultiplier *\n this.strength_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Def exp gained per game cycle\nexport function getWorkDefExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work def exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.defenseExpGain *\n company.expMultiplier *\n this.defense_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Dex exp gained per game cycle\nexport function getWorkDexExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work dex exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.dexterityExpGain *\n company.expMultiplier *\n this.dexterity_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Agi exp gained per game cycle\nexport function getWorkAgiExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work agi exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.agilityExpGain *\n company.expMultiplier *\n this.agility_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Charisma exp gained per game cycle\nexport function getWorkChaExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work cha exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.charismaExpGain *\n company.expMultiplier *\n this.charisma_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Reputation gained per game cycle\nexport function getWorkRepGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work rep gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n let jobPerformance = companyPosition.calculateJobPerformance(\n this.hacking,\n this.strength,\n this.defense,\n this.dexterity,\n this.agility,\n this.charisma,\n );\n\n //Intelligence provides a flat bonus to job performance\n jobPerformance += this.intelligence / CONSTANTS.MaxSkillLevel;\n\n //Update reputation gain rate to account for company favor\n let favorMult = 1 + company.favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n return jobPerformance * this.company_rep_mult * favorMult;\n}\n\n// export function getFactionSecurityWorkRepGain(this: IPlayer) {\n// var t = 0.9 * (this.hacking / CONSTANTS.MaxSkillLevel +\n// this.strength / CONSTANTS.MaxSkillLevel +\n// this.defense / CONSTANTS.MaxSkillLevel +\n// this.dexterity / CONSTANTS.MaxSkillLevel +\n// this.agility / CONSTANTS.MaxSkillLevel) / 4.5;\n// return t * this.faction_rep_mult;\n// }\n\n// export function getFactionFieldWorkRepGain(this: IPlayer) {\n// var t = 0.9 * (this.hacking / CONSTANTS.MaxSkillLevel +\n// this.strength / CONSTANTS.MaxSkillLevel +\n// this.defense / CONSTANTS.MaxSkillLevel +\n// this.dexterity / CONSTANTS.MaxSkillLevel +\n// this.agility / CONSTANTS.MaxSkillLevel +\n// this.charisma / CONSTANTS.MaxSkillLevel +\n// this.intelligence / CONSTANTS.MaxSkillLevel) / 5.5;\n// return t * this.faction_rep_mult;\n// }\n\n/* Creating a Program */\nexport function startCreateProgramWork(\n this: IPlayer,\n programName: string,\n time: number,\n reqLevel: number,\n): void {\n this.resetWorkStatus();\n this.isWorking = true;\n this.workType = CONSTANTS.WorkTypeCreateProgram;\n\n //Time needed to complete work affected by hacking skill (linearly based on\n //ratio of (your skill - required level) to MAX skill)\n //var timeMultiplier = (CONSTANTS.MaxSkillLevel - (this.hacking - reqLevel)) / CONSTANTS.MaxSkillLevel;\n //if (timeMultiplier > 1) {timeMultiplier = 1;}\n //if (timeMultiplier < 0.01) {timeMultiplier = 0.01;}\n this.createProgramReqLvl = reqLevel;\n\n this.timeNeededToCompleteWork = time;\n //Check for incomplete program\n for (let i = 0; i < this.getHomeComputer().programs.length; ++i) {\n const programFile = this.getHomeComputer().programs[i];\n if (programFile.startsWith(programName) && programFile.endsWith(\"%-INC\")) {\n const res = programFile.split(\"-\");\n if (res.length != 3) {\n break;\n }\n const percComplete = Number(res[1].slice(0, -1));\n if (isNaN(percComplete) || percComplete < 0 || percComplete >= 100) {\n break;\n }\n this.timeWorkedCreateProgram = (percComplete / 100) * this.timeNeededToCompleteWork;\n this.getHomeComputer().programs.splice(i, 1);\n }\n }\n\n this.createProgramName = programName;\n}\n\nexport function createProgramWork(this: IPlayer, numCycles: number): boolean {\n let focusBonus = 1;\n if (!this.hasAugmentation(AugmentationNames[\"NeuroreceptorManager\"])) {\n focusBonus = this.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n //Higher hacking skill will allow you to create programs faster\n const reqLvl = this.createProgramReqLvl;\n let skillMult = (this.hacking / reqLvl) * this.getIntelligenceBonus(3); //This should always be greater than 1;\n skillMult = 1 + (skillMult - 1) / 5; //The divider constant can be adjusted as necessary\n skillMult *= focusBonus;\n //Skill multiplier directly applied to \"time worked\"\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n this.timeWorkedCreateProgram += CONSTANTS._idleSpeed * numCycles * skillMult;\n\n if (this.timeWorkedCreateProgram >= this.timeNeededToCompleteWork) {\n this.finishCreateProgramWork(false);\n return true;\n }\n return false;\n}\n\nexport function finishCreateProgramWork(this: IPlayer, cancelled: boolean): string {\n const programName = this.createProgramName;\n if (cancelled === false) {\n dialogBoxCreate(\n \"You've finished creating \" + programName + \"!<br>\" + \"The new program can be found on your home computer.\",\n );\n\n this.getHomeComputer().programs.push(programName);\n } else {\n const perc = (Math.floor((this.timeWorkedCreateProgram / this.timeNeededToCompleteWork) * 10000) / 100).toString();\n const incompleteName = programName + \"-\" + perc + \"%-INC\";\n this.getHomeComputer().programs.push(incompleteName);\n }\n\n if (!cancelled) {\n this.gainIntelligenceExp((CONSTANTS.IntelligenceProgramBaseExpGain * this.timeWorked) / 1000);\n }\n\n this.isWorking = false;\n\n this.resetWorkStatus();\n return \"You've finished creating \" + programName + \"! The new program can be found on your home computer.\";\n}\n/* Studying/Taking Classes */\nexport function startClass(this: IPlayer, costMult: number, expMult: number, className: string): void {\n this.resetWorkStatus();\n this.isWorking = true;\n this.workType = CONSTANTS.WorkTypeStudyClass;\n this.workCostMult = costMult;\n this.workExpMult = expMult;\n this.className = className;\n const earnings = calculateClassEarnings(this);\n this.workMoneyLossRate = earnings.workMoneyLossRate;\n this.workHackExpGainRate = earnings.workHackExpGainRate;\n this.workStrExpGainRate = earnings.workStrExpGainRate;\n this.workDefExpGainRate = earnings.workDefExpGainRate;\n this.workDexExpGainRate = earnings.workDexExpGainRate;\n this.workAgiExpGainRate = earnings.workAgiExpGainRate;\n this.workChaExpGainRate = earnings.workChaExpGainRate;\n}\n\nexport function takeClass(this: IPlayer, numCycles: number): boolean {\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n const earnings = calculateClassEarnings(this);\n this.workMoneyLossRate = earnings.workMoneyLossRate;\n this.workHackExpGainRate = earnings.workHackExpGainRate;\n this.workStrExpGainRate = earnings.workStrExpGainRate;\n this.workDefExpGainRate = earnings.workDefExpGainRate;\n this.workDexExpGainRate = earnings.workDexExpGainRate;\n this.workAgiExpGainRate = earnings.workAgiExpGainRate;\n this.workChaExpGainRate = earnings.workChaExpGainRate;\n this.processWorkEarnings(numCycles);\n return false;\n}\n\n//The 'sing' argument defines whether or not this function was called\n//through a Singularity Netscript function\nexport function finishClass(this: IPlayer, sing = false): string {\n this.gainIntelligenceExp(CONSTANTS.IntelligenceClassBaseExpGain * Math.round(this.timeWorked / 1000));\n\n if (this.workMoneyGained > 0) {\n throw new Error(\"ERR: Somehow gained money while taking class\");\n }\n\n this.updateSkillLevels();\n if (!sing) {\n dialogBoxCreate(\n <>\n After {this.className} for {convertTimeMsToTimeElapsedString(this.timeWorked)}, <br />\n you spent a total of <Money money={-this.workMoneyGained} />. <br />\n <br />\n You earned a total of: <br />\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br />\n {numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br />\n {numeralWrapper.formatExp(this.workDefExpGained)} defense exp <br />\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity exp <br />\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility exp <br />\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma exp\n <br />\n </>,\n );\n }\n\n this.isWorking = false;\n\n if (sing) {\n const res =\n \"After \" +\n this.className +\n \" for \" +\n convertTimeMsToTimeElapsedString(this.timeWorked) +\n \", \" +\n \"you spent a total of \" +\n numeralWrapper.formatMoney(this.workMoneyGained * -1) +\n \". \" +\n \"You earned a total of: \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hacking exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" strength exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" defense exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dexterity exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agility exp, and \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" charisma exp\";\n this.resetWorkStatus();\n return res;\n }\n this.resetWorkStatus();\n return \"\";\n}\n\n//The EXP and $ gains are hardcoded. Time is in ms\nexport function startCrime(\n this: IPlayer,\n router: IRouter,\n crimeType: string,\n hackExp: number,\n strExp: number,\n defExp: number,\n dexExp: number,\n agiExp: number,\n chaExp: number,\n money: number,\n time: number,\n workerscript: WorkerScript | null = null,\n): void {\n this.crimeType = crimeType;\n\n this.resetWorkStatus();\n this.isWorking = true;\n this.focus = true;\n this.workType = CONSTANTS.WorkTypeCrime;\n\n if (workerscript !== null) {\n this.committingCrimeThruSingFn = true;\n this.singFnCrimeWorkerScript = workerscript;\n }\n\n this.workHackExpGained = hackExp * this.hacking_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workStrExpGained = strExp * this.strength_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workDefExpGained = defExp * this.defense_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workDexExpGained = dexExp * this.dexterity_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workAgiExpGained = agiExp * this.agility_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workChaExpGained = chaExp * this.charisma_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workMoneyGained = money * this.crime_money_mult * BitNodeMultipliers.CrimeMoney;\n\n this.timeNeededToCompleteWork = time;\n router.toWork();\n}\n\nexport function commitCrime(this: IPlayer, numCycles: number): boolean {\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n\n if (this.timeWorked >= this.timeNeededToCompleteWork) {\n this.finishCrime(false);\n return true;\n }\n return false;\n}\n\nexport function finishCrime(this: IPlayer, cancelled: boolean): string {\n //Determine crime success/failure\n if (!cancelled) {\n if (determineCrimeSuccess(this, this.crimeType)) {\n //Handle Karma and crime statistics\n let crime = null;\n for (const i of Object.keys(Crimes)) {\n if (Crimes[i].type == this.crimeType) {\n crime = Crimes[i];\n break;\n }\n }\n if (crime == null) {\n dialogBoxCreate(\n `ERR: Unrecognized crime type (${this.crimeType}). This is probably a bug please contact the developer`,\n );\n return \"\";\n }\n this.gainMoney(this.workMoneyGained, \"crime\");\n this.karma -= crime.karma;\n this.numPeopleKilled += crime.kills;\n if (crime.intelligence_exp > 0) {\n this.gainIntelligenceExp(crime.intelligence_exp);\n }\n\n //On a crime success, gain 2x exp\n this.workHackExpGained *= 2;\n this.workStrExpGained *= 2;\n this.workDefExpGained *= 2;\n this.workDexExpGained *= 2;\n this.workAgiExpGained *= 2;\n this.workChaExpGained *= 2;\n const ws = this.singFnCrimeWorkerScript;\n if (this.committingCrimeThruSingFn && ws !== null) {\n if (ws.disableLogs.ALL == null && ws.disableLogs.commitCrime == null) {\n ws.scriptRef.log(\n \"SUCCESS: Crime successful! Gained \" +\n numeralWrapper.formatMoney(this.workMoneyGained) +\n \", \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hack exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" str exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" def exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dex exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agi exp, \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" cha exp.\",\n );\n }\n } else {\n dialogBoxCreate(\n <>\n Crime successful!\n <br />\n <br />\n You gained:\n <br />\n <Money money={this.workMoneyGained} />\n <br />\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking experience <br />\n {numeralWrapper.formatExp(this.workStrExpGained)} strength experience\n <br />\n {numeralWrapper.formatExp(this.workDefExpGained)} defense experience\n <br />\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity experience\n <br />\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility experience\n <br />\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma experience\n </>,\n );\n }\n } else {\n //Exp halved on failure\n this.workHackExpGained /= 2;\n this.workStrExpGained /= 2;\n this.workDefExpGained /= 2;\n this.workDexExpGained /= 2;\n this.workAgiExpGained /= 2;\n this.workChaExpGained /= 2;\n const ws = this.singFnCrimeWorkerScript;\n if (this.committingCrimeThruSingFn && ws !== null) {\n if (ws.disableLogs.ALL == null && ws.disableLogs.commitCrime == null) {\n ws.scriptRef.log(\n \"FAIL: Crime failed! Gained \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hack exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" str exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" def exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dex exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agi exp, \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" cha exp.\",\n );\n }\n } else {\n dialogBoxCreate(\n <>\n Crime failed!\n <br />\n <br />\n You gained:\n <br />\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking experience <br />\n {numeralWrapper.formatExp(this.workStrExpGained)} strength experience\n <br />\n {numeralWrapper.formatExp(this.workDefExpGained)} defense experience\n <br />\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity experience\n <br />\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility experience\n <br />\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma experience\n </>,\n );\n }\n }\n\n this.gainHackingExp(this.workHackExpGained);\n this.gainStrengthExp(this.workStrExpGained);\n this.gainDefenseExp(this.workDefExpGained);\n this.gainDexterityExp(this.workDexExpGained);\n this.gainAgilityExp(this.workAgiExpGained);\n this.gainCharismaExp(this.workChaExpGained);\n }\n this.committingCrimeThruSingFn = false;\n this.singFnCrimeWorkerScript = null;\n this.isWorking = false;\n this.crimeType = \"\";\n this.resetWorkStatus();\n return \"\";\n}\n\n//Cancels the player's current \"work\" assignment and gives the proper rewards\n//Used only for Singularity functions, so no popups are created\nexport function singularityStopWork(this: IPlayer): string {\n if (!this.isWorking) {\n return \"\";\n }\n let res = \"\"; //Earnings text for work\n switch (this.workType) {\n case CONSTANTS.WorkTypeStudyClass:\n res = this.finishClass(true);\n break;\n case CONSTANTS.WorkTypeCompany:\n res = this.finishWork(true, true);\n break;\n case CONSTANTS.WorkTypeCompanyPartTime:\n res = this.finishWorkPartTime(true);\n break;\n case CONSTANTS.WorkTypeFaction:\n res = this.finishFactionWork(true, true);\n break;\n case CONSTANTS.WorkTypeCreateProgram:\n res = this.finishCreateProgramWork(true);\n break;\n case CONSTANTS.WorkTypeCrime:\n res = this.finishCrime(true);\n break;\n default:\n console.error(`Unrecognized work type (${this.workType})`);\n return \"\";\n }\n return res;\n}\n\n// Returns true if hospitalized, false otherwise\nexport function takeDamage(this: IPlayer, amt: number): boolean {\n if (typeof amt !== \"number\") {\n console.warn(`Player.takeDamage() called without a numeric argument: ${amt}`);\n return false;\n }\n\n this.hp -= amt;\n if (this.hp <= 0) {\n this.hospitalize();\n return true;\n } else {\n return false;\n }\n}\n\nexport function regenerateHp(this: IPlayer, amt: number): void {\n if (typeof amt !== \"number\") {\n console.warn(`Player.regenerateHp() called without a numeric argument: ${amt}`);\n return;\n }\n this.hp += amt;\n if (this.hp > this.max_hp) {\n this.hp = this.max_hp;\n }\n}\n\nexport function hospitalize(this: IPlayer): number {\n const cost = getHospitalizationCost(this);\n SnackbarEvents.emit(`You've been Hospitalized for ${numeralWrapper.formatMoney(cost)}`, \"warning\", 2000);\n\n this.loseMoney(cost, \"hospitalization\");\n this.hp = this.max_hp;\n return cost;\n}\n\n/********* Company job application **********/\n//Determines the job that the Player should get (if any) at the current company\n//The 'sing' argument designates whether or not this is being called from\n//the applyToCompany() Netscript Singularity function\nexport function applyForJob(this: IPlayer, entryPosType: CompanyPosition, sing = false): boolean {\n // Get current company and job\n let currCompany = null;\n if (this.companyName !== \"\") {\n currCompany = Companies[this.companyName];\n }\n const currPositionName = this.jobs[this.companyName];\n\n // Get company that's being applied to\n const company = Companies[this.location]; //Company being applied to\n if (!(company instanceof Company)) {\n console.error(`Could not find company that matches the location: ${this.location}. Player.applyToCompany() failed`);\n return false;\n }\n\n let pos = entryPosType;\n\n if (!this.isQualified(company, pos)) {\n const reqText = getJobRequirementText(company, pos);\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position<br>\" + reqText);\n }\n return false;\n }\n\n // Check if this company has the position\n if (!company.hasPosition(pos)) {\n return false;\n }\n\n while (true) {\n const newPos = getNextCompanyPositionHelper(pos);\n if (newPos == null) {\n break;\n }\n\n //Check if this company has this position\n if (company.hasPosition(newPos)) {\n if (!this.isQualified(company, newPos)) {\n //If player not qualified for next job, break loop so player will be given current job\n break;\n }\n pos = newPos;\n } else {\n break;\n }\n }\n\n //Check if the determined job is the same as the player's current job\n if (currCompany != null) {\n if (currCompany.name == company.name && pos.name == currPositionName) {\n const nextPos = getNextCompanyPositionHelper(pos);\n if (nextPos == null) {\n if (!sing) {\n dialogBoxCreate(\"You are already at the highest position for your field! No promotion available\");\n }\n return false;\n } else if (company.hasPosition(nextPos)) {\n if (!sing) {\n const reqText = getJobRequirementText(company, nextPos);\n dialogBoxCreate(\"Unfortunately, you do not qualify for a promotion<br>\" + reqText);\n }\n return false;\n } else {\n if (!sing) {\n dialogBoxCreate(\"You are already at the highest position for your field! No promotion available\");\n }\n return false;\n }\n return false; //Same job, do nothing\n }\n }\n\n this.jobs[company.name] = pos.name;\n if (!this.focus && this.isWorking && this.companyName !== this.location) this.resetWorkStatus();\n this.companyName = this.location;\n\n if (!sing) {\n dialogBoxCreate(\"Congratulations! You were offered a new job at \" + this.companyName + \" as a \" + pos.name + \"!\");\n }\n return true;\n}\n\n//Returns your next position at a company given the field (software, business, etc.)\nexport function getNextCompanyPosition(\n this: IPlayer,\n company: Company,\n entryPosType: CompanyPosition,\n): CompanyPosition | null {\n let currCompany = null;\n if (this.companyName !== \"\") {\n currCompany = Companies[this.companyName];\n }\n\n //Not employed at this company, so return the entry position\n if (currCompany == null || currCompany.name != company.name) {\n return entryPosType;\n }\n\n //If the entry pos type and the player's current position have the same type,\n //return the player's \"nextCompanyPosition\". Otherwise return the entryposType\n //Employed at this company, so just return the next position if it exists.\n const currentPositionName = this.jobs[this.companyName];\n if (!currentPositionName) return entryPosType;\n const currentPosition = CompanyPositions[currentPositionName];\n if (\n (currentPosition.isSoftwareJob() && entryPosType.isSoftwareJob()) ||\n (currentPosition.isITJob() && entryPosType.isITJob()) ||\n (currentPosition.isBusinessJob() && entryPosType.isBusinessJob()) ||\n (currentPosition.isSecurityEngineerJob() && entryPosType.isSecurityEngineerJob()) ||\n (currentPosition.isNetworkEngineerJob() && entryPosType.isNetworkEngineerJob()) ||\n (currentPosition.isSecurityJob() && entryPosType.isSecurityJob()) ||\n (currentPosition.isAgentJob() && entryPosType.isAgentJob()) ||\n (currentPosition.isSoftwareConsultantJob() && entryPosType.isSoftwareConsultantJob()) ||\n (currentPosition.isBusinessConsultantJob() && entryPosType.isBusinessConsultantJob()) ||\n (currentPosition.isPartTimeJob() && entryPosType.isPartTimeJob())\n ) {\n return getNextCompanyPositionHelper(currentPosition);\n }\n\n return entryPosType;\n}\n\nexport function quitJob(this: IPlayer, company: string): void {\n if (this.isWorking == true && this.workType.includes(\"Working for Company\") && this.companyName == company) {\n this.isWorking = false;\n this.companyName = \"\";\n }\n if (this.companyName === company) {\n this.companyName = \"\";\n }\n delete this.jobs[company];\n}\n\n/**\n * Method to see if the player has at least one job assigned to them\n * @param this The player instance\n * @returns Whether the user has at least one job\n */\nexport function hasJob(this: IPlayer): boolean {\n return Boolean(Object.keys(this.jobs).length);\n}\n\nexport function applyForSoftwareJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.SoftwareCompanyPositions[0]], sing);\n}\n\nexport function applyForSoftwareConsultantJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.SoftwareConsultantCompanyPositions[0]], sing);\n}\n\nexport function applyForItJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.ITCompanyPositions[0]], sing);\n}\n\nexport function applyForSecurityEngineerJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.SecurityEngineerCompanyPositions[0]])) {\n return this.applyForJob(CompanyPositions[posNames.SecurityEngineerCompanyPositions[0]], sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForNetworkEngineerJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.NetworkEngineerCompanyPositions[0]])) {\n const pos = CompanyPositions[posNames.NetworkEngineerCompanyPositions[0]];\n return this.applyForJob(pos, sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForBusinessJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.BusinessCompanyPositions[0]], sing);\n}\n\nexport function applyForBusinessConsultantJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.BusinessConsultantCompanyPositions[0]], sing);\n}\n\nexport function applyForSecurityJob(this: IPlayer, sing = false): boolean {\n // TODO Police Jobs\n // Indexing starts at 2 because 0 is for police officer\n return this.applyForJob(CompanyPositions[posNames.SecurityCompanyPositions[2]], sing);\n}\n\nexport function applyForAgentJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.AgentCompanyPositions[0]])) {\n const pos = CompanyPositions[posNames.AgentCompanyPositions[0]];\n return this.applyForJob(pos, sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForEmployeeJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.MiscCompanyPositions[1];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n if (!this.focus && this.isWorking && this.companyName !== company.name) this.resetWorkStatus();\n this.companyName = company.name;\n\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed at \" + this.location);\n }\n\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n\n return false;\n }\n}\n\nexport function applyForPartTimeEmployeeJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.PartTimeCompanyPositions[1];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n if (!this.focus && this.isWorking && this.companyName !== company.name) this.resetWorkStatus();\n this.companyName = company.name;\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed part-time at \" + this.location);\n }\n\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n\n return false;\n }\n}\n\nexport function applyForWaiterJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.MiscCompanyPositions[0];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n if (!this.focus && this.isWorking && this.companyName !== company.name) this.resetWorkStatus();\n this.companyName = company.name;\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed as a waiter at \" + this.location);\n }\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForPartTimeWaiterJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.PartTimeCompanyPositions[0];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n if (!this.focus && this.isWorking && this.companyName !== company.name) this.resetWorkStatus();\n this.companyName = company.name;\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed as a part-time waiter at \" + this.location);\n }\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\n//Checks if the Player is qualified for a certain position\nexport function isQualified(this: IPlayer, company: Company, position: CompanyPosition): boolean {\n const offset = company.jobStatReqOffset;\n const reqHacking = position.requiredHacking > 0 ? position.requiredHacking + offset : 0;\n const reqStrength = position.requiredStrength > 0 ? position.requiredStrength + offset : 0;\n const reqDefense = position.requiredDefense > 0 ? position.requiredDefense + offset : 0;\n const reqDexterity = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;\n const reqAgility = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;\n const reqCharisma = position.requiredCharisma > 0 ? position.requiredCharisma + offset : 0;\n\n if (\n this.hacking >= reqHacking &&\n this.strength >= reqStrength &&\n this.defense >= reqDefense &&\n this.dexterity >= reqDexterity &&\n this.agility >= reqAgility &&\n this.charisma >= reqCharisma &&\n company.playerReputation >= position.requiredReputation\n ) {\n return true;\n }\n return false;\n}\n\n/********** Reapplying Augmentations and Source File ***********/\nexport function reapplyAllAugmentations(this: IPlayer, resetMultipliers = true): void {\n if (resetMultipliers) {\n this.resetMultipliers();\n }\n\n for (let i = 0; i < this.augmentations.length; ++i) {\n //Compatibility with new version\n if (this.augmentations[i].name === \"HacknetNode NIC Architecture Neural-Upload\") {\n this.augmentations[i].name = \"Hacknet Node NIC Architecture Neural-Upload\";\n }\n\n const augName = this.augmentations[i].name;\n const aug = Augmentations[augName];\n if (aug == null) {\n console.warn(`Invalid augmentation name in Player.reapplyAllAugmentations(). Aug ${augName} will be skipped`);\n continue;\n }\n aug.owned = true;\n if (aug.name == AugmentationNames.NeuroFluxGovernor) {\n for (let j = 0; j < aug.level; ++j) {\n applyAugmentation(this.augmentations[i], true);\n }\n continue;\n }\n applyAugmentation(this.augmentations[i], true);\n }\n\n this.updateSkillLevels();\n}\n\nexport function reapplyAllSourceFiles(this: IPlayer): void {\n //Will always be called after reapplyAllAugmentations() so multipliers do not have to be reset\n //this.resetMultipliers();\n\n for (let i = 0; i < this.sourceFiles.length; ++i) {\n const srcFileKey = \"SourceFile\" + this.sourceFiles[i].n;\n const sourceFileObject = SourceFiles[srcFileKey];\n if (sourceFileObject == null) {\n console.error(`Invalid source file number: ${this.sourceFiles[i].n}`);\n continue;\n }\n applySourceFile(this.sourceFiles[i]);\n }\n applyExploit();\n this.updateSkillLevels();\n}\n\n/*************** Check for Faction Invitations *************/\n//This function sets the requirements to join a Faction. It checks whether the Player meets\n//those requirements and will return an array of all factions that the Player should\n//receive an invitation to\nexport function checkForFactionInvitations(this: IPlayer): Faction[] {\n const invitedFactions: Faction[] = []; //Array which will hold all Factions the player should be invited to\n\n const numAugmentations = this.augmentations.length;\n\n const allCompanies = Object.keys(this.jobs);\n const allPositions = Object.values(this.jobs);\n\n // Given a company name, safely returns the reputation (returns 0 if invalid company is specified)\n function getCompanyRep(companyName: string): number {\n const company = Companies[companyName];\n if (company == null) {\n return 0;\n } else {\n return company.playerReputation;\n }\n }\n\n // Helper function that returns a boolean indicating whether the Player meets\n // the requirements for the specified company. There are two requirements:\n // 1. High enough reputation\n // 2. Player is employed at the company\n function checkMegacorpRequirements(companyName: string, repNeeded = CONSTANTS.CorpFactionRepRequirement): boolean {\n return allCompanies.includes(companyName) && getCompanyRep(companyName) > repNeeded;\n }\n\n //Illuminati\n const illuminatiFac = Factions[\"Illuminati\"];\n if (\n !illuminatiFac.isBanned &&\n !illuminatiFac.isMember &&\n !illuminatiFac.alreadyInvited &&\n numAugmentations >= 30 &&\n this.money >= 150000000000 &&\n this.hacking >= 1500 &&\n this.strength >= 1200 &&\n this.defense >= 1200 &&\n this.dexterity >= 1200 &&\n this.agility >= 1200\n ) {\n invitedFactions.push(illuminatiFac);\n }\n\n //Daedalus\n const daedalusFac = Factions[\"Daedalus\"];\n if (\n !daedalusFac.isBanned &&\n !daedalusFac.isMember &&\n !daedalusFac.alreadyInvited &&\n numAugmentations >= Math.round(30 * BitNodeMultipliers.DaedalusAugsRequirement) &&\n this.money >= 100000000000 &&\n (this.hacking >= 2500 ||\n (this.strength >= 1500 && this.defense >= 1500 && this.dexterity >= 1500 && this.agility >= 1500))\n ) {\n invitedFactions.push(daedalusFac);\n }\n\n //The Covenant\n const covenantFac = Factions[\"The Covenant\"];\n if (\n !covenantFac.isBanned &&\n !covenantFac.isMember &&\n !covenantFac.alreadyInvited &&\n numAugmentations >= 20 &&\n this.money >= 75000000000 &&\n this.hacking >= 850 &&\n this.strength >= 850 &&\n this.defense >= 850 &&\n this.dexterity >= 850 &&\n this.agility >= 850\n ) {\n invitedFactions.push(covenantFac);\n }\n\n //ECorp\n const ecorpFac = Factions[\"ECorp\"];\n if (\n !ecorpFac.isBanned &&\n !ecorpFac.isMember &&\n !ecorpFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumECorp)\n ) {\n invitedFactions.push(ecorpFac);\n }\n\n //MegaCorp\n const megacorpFac = Factions[\"MegaCorp\"];\n if (\n !megacorpFac.isBanned &&\n !megacorpFac.isMember &&\n !megacorpFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12MegaCorp)\n ) {\n invitedFactions.push(megacorpFac);\n }\n\n //Bachman & Associates\n const bachmanandassociatesFac = Factions[\"Bachman & Associates\"];\n if (\n !bachmanandassociatesFac.isBanned &&\n !bachmanandassociatesFac.isMember &&\n !bachmanandassociatesFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumBachmanAndAssociates)\n ) {\n invitedFactions.push(bachmanandassociatesFac);\n }\n\n //Blade Industries\n const bladeindustriesFac = Factions[\"Blade Industries\"];\n if (\n !bladeindustriesFac.isBanned &&\n !bladeindustriesFac.isMember &&\n !bladeindustriesFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12BladeIndustries)\n ) {\n invitedFactions.push(bladeindustriesFac);\n }\n\n //NWO\n const nwoFac = Factions[\"NWO\"];\n if (\n !nwoFac.isBanned &&\n !nwoFac.isMember &&\n !nwoFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.VolhavenNWO)\n ) {\n invitedFactions.push(nwoFac);\n }\n\n //Clarke Incorporated\n const clarkeincorporatedFac = Factions[\"Clarke Incorporated\"];\n if (\n !clarkeincorporatedFac.isBanned &&\n !clarkeincorporatedFac.isMember &&\n !clarkeincorporatedFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumClarkeIncorporated)\n ) {\n invitedFactions.push(clarkeincorporatedFac);\n }\n\n //OmniTek Incorporated\n const omnitekincorporatedFac = Factions[\"OmniTek Incorporated\"];\n if (\n !omnitekincorporatedFac.isBanned &&\n !omnitekincorporatedFac.isMember &&\n !omnitekincorporatedFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.VolhavenOmniTekIncorporated)\n ) {\n invitedFactions.push(omnitekincorporatedFac);\n }\n\n //Four Sigma\n const foursigmaFac = Factions[\"Four Sigma\"];\n if (\n !foursigmaFac.isBanned &&\n !foursigmaFac.isMember &&\n !foursigmaFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12FourSigma)\n ) {\n invitedFactions.push(foursigmaFac);\n }\n\n //KuaiGong International\n const kuaigonginternationalFac = Factions[\"KuaiGong International\"];\n if (\n !kuaigonginternationalFac.isBanned &&\n !kuaigonginternationalFac.isMember &&\n !kuaigonginternationalFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.ChongqingKuaiGongInternational)\n ) {\n invitedFactions.push(kuaigonginternationalFac);\n }\n\n //Fulcrum Secret Technologies - If u've unlocked fulcrum secret technolgoies server and have a high rep with the company\n const fulcrumsecrettechonologiesFac = Factions[\"Fulcrum Secret Technologies\"];\n const fulcrumSecretServer = GetServer(SpecialServers.FulcrumSecretTechnologies);\n if (!(fulcrumSecretServer instanceof Server)) throw new Error(\"Fulcrum Secret Technologies should be normal server\");\n if (fulcrumSecretServer == null) {\n console.error(\"Could not find Fulcrum Secret Technologies Server\");\n } else {\n if (\n !fulcrumsecrettechonologiesFac.isBanned &&\n !fulcrumsecrettechonologiesFac.isMember &&\n !fulcrumsecrettechonologiesFac.alreadyInvited &&\n fulcrumSecretServer.backdoorInstalled &&\n checkMegacorpRequirements(LocationName.AevumFulcrumTechnologies, 250e3)\n ) {\n invitedFactions.push(fulcrumsecrettechonologiesFac);\n }\n }\n\n //BitRunners\n const bitrunnersFac = Factions[\"BitRunners\"];\n const bitrunnersServer = GetServer(SpecialServers.BitRunnersServer);\n if (!(bitrunnersServer instanceof Server)) throw new Error(\"BitRunners should be normal server\");\n if (bitrunnersServer == null) {\n console.error(\"Could not find BitRunners Server\");\n } else if (\n !bitrunnersFac.isBanned &&\n !bitrunnersFac.isMember &&\n bitrunnersServer.backdoorInstalled &&\n !bitrunnersFac.alreadyInvited\n ) {\n invitedFactions.push(bitrunnersFac);\n }\n\n //The Black Hand\n\n const theblackhandFac = Factions[\"The Black Hand\"];\n const blackhandServer = GetServer(SpecialServers.TheBlackHandServer);\n if (!(blackhandServer instanceof Server)) throw new Error(\"TheBlackHand should be normal server\");\n if (blackhandServer == null) {\n console.error(\"Could not find The Black Hand Server\");\n } else if (\n !theblackhandFac.isBanned &&\n !theblackhandFac.isMember &&\n blackhandServer.backdoorInstalled &&\n !theblackhandFac.alreadyInvited\n ) {\n invitedFactions.push(theblackhandFac);\n }\n\n //NiteSec\n const nitesecFac = Factions[\"NiteSec\"];\n const nitesecServer = GetServer(SpecialServers.NiteSecServer);\n if (!(nitesecServer instanceof Server)) throw new Error(\"NiteSec should be normal server\");\n if (nitesecServer == null) {\n console.error(\"Could not find NiteSec Server\");\n } else if (\n !nitesecFac.isBanned &&\n !nitesecFac.isMember &&\n nitesecServer.backdoorInstalled &&\n !nitesecFac.alreadyInvited\n ) {\n invitedFactions.push(nitesecFac);\n }\n\n //Chongqing\n const chongqingFac = Factions[\"Chongqing\"];\n if (\n !chongqingFac.isBanned &&\n !chongqingFac.isMember &&\n !chongqingFac.alreadyInvited &&\n this.money >= 20000000 &&\n this.city == CityName.Chongqing\n ) {\n invitedFactions.push(chongqingFac);\n }\n\n //Sector-12\n const sector12Fac = Factions[\"Sector-12\"];\n if (\n !sector12Fac.isBanned &&\n !sector12Fac.isMember &&\n !sector12Fac.alreadyInvited &&\n this.money >= 15000000 &&\n this.city == CityName.Sector12\n ) {\n invitedFactions.push(sector12Fac);\n }\n\n //New Tokyo\n const newtokyoFac = Factions[\"New Tokyo\"];\n if (\n !newtokyoFac.isBanned &&\n !newtokyoFac.isMember &&\n !newtokyoFac.alreadyInvited &&\n this.money >= 20000000 &&\n this.city == CityName.NewTokyo\n ) {\n invitedFactions.push(newtokyoFac);\n }\n\n //Aevum\n const aevumFac = Factions[\"Aevum\"];\n if (\n !aevumFac.isBanned &&\n !aevumFac.isMember &&\n !aevumFac.alreadyInvited &&\n this.money >= 40000000 &&\n this.city == CityName.Aevum\n ) {\n invitedFactions.push(aevumFac);\n }\n\n //Ishima\n const ishimaFac = Factions[\"Ishima\"];\n if (\n !ishimaFac.isBanned &&\n !ishimaFac.isMember &&\n !ishimaFac.alreadyInvited &&\n this.money >= 30000000 &&\n this.city == CityName.Ishima\n ) {\n invitedFactions.push(ishimaFac);\n }\n\n //Volhaven\n const volhavenFac = Factions[\"Volhaven\"];\n if (\n !volhavenFac.isBanned &&\n !volhavenFac.isMember &&\n !volhavenFac.alreadyInvited &&\n this.money >= 50000000 &&\n this.city == CityName.Volhaven\n ) {\n invitedFactions.push(volhavenFac);\n }\n\n //Speakers for the Dead\n const speakersforthedeadFac = Factions[\"Speakers for the Dead\"];\n if (\n !speakersforthedeadFac.isBanned &&\n !speakersforthedeadFac.isMember &&\n !speakersforthedeadFac.alreadyInvited &&\n this.hacking >= 100 &&\n this.strength >= 300 &&\n this.defense >= 300 &&\n this.dexterity >= 300 &&\n this.agility >= 300 &&\n this.numPeopleKilled >= 30 &&\n this.karma <= -45 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(speakersforthedeadFac);\n }\n\n //The Dark Army\n const thedarkarmyFac = Factions[\"The Dark Army\"];\n if (\n !thedarkarmyFac.isBanned &&\n !thedarkarmyFac.isMember &&\n !thedarkarmyFac.alreadyInvited &&\n this.hacking >= 300 &&\n this.strength >= 300 &&\n this.defense >= 300 &&\n this.dexterity >= 300 &&\n this.agility >= 300 &&\n this.city == CityName.Chongqing &&\n this.numPeopleKilled >= 5 &&\n this.karma <= -45 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(thedarkarmyFac);\n }\n\n //The Syndicate\n const thesyndicateFac = Factions[\"The Syndicate\"];\n if (\n !thesyndicateFac.isBanned &&\n !thesyndicateFac.isMember &&\n !thesyndicateFac.alreadyInvited &&\n this.hacking >= 200 &&\n this.strength >= 200 &&\n this.defense >= 200 &&\n this.dexterity >= 200 &&\n this.agility >= 200 &&\n (this.city == CityName.Aevum || this.city == CityName.Sector12) &&\n this.money >= 10000000 &&\n this.karma <= -90 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(thesyndicateFac);\n }\n\n //Silhouette\n const silhouetteFac = Factions[\"Silhouette\"];\n if (\n !silhouetteFac.isBanned &&\n !silhouetteFac.isMember &&\n !silhouetteFac.alreadyInvited &&\n (allPositions.includes(\"Chief Technology Officer\") ||\n allPositions.includes(\"Chief Financial Officer\") ||\n allPositions.includes(\"Chief Executive Officer\")) &&\n this.money >= 15000000 &&\n this.karma <= -22\n ) {\n invitedFactions.push(silhouetteFac);\n }\n\n //Tetrads\n const tetradsFac = Factions[\"Tetrads\"];\n if (\n !tetradsFac.isBanned &&\n !tetradsFac.isMember &&\n !tetradsFac.alreadyInvited &&\n (this.city == CityName.Chongqing || this.city == CityName.NewTokyo || this.city == CityName.Ishima) &&\n this.strength >= 75 &&\n this.defense >= 75 &&\n this.dexterity >= 75 &&\n this.agility >= 75 &&\n this.karma <= -18\n ) {\n invitedFactions.push(tetradsFac);\n }\n\n //SlumSnakes\n const slumsnakesFac = Factions[\"Slum Snakes\"];\n if (\n !slumsnakesFac.isBanned &&\n !slumsnakesFac.isMember &&\n !slumsnakesFac.alreadyInvited &&\n this.strength >= 30 &&\n this.defense >= 30 &&\n this.dexterity >= 30 &&\n this.agility >= 30 &&\n this.karma <= -9 &&\n this.money >= 1000000\n ) {\n invitedFactions.push(slumsnakesFac);\n }\n\n //Netburners\n const netburnersFac = Factions[\"Netburners\"];\n let totalHacknetRam = 0;\n let totalHacknetCores = 0;\n let totalHacknetLevels = 0;\n for (let i = 0; i < this.hacknetNodes.length; ++i) {\n const v = this.hacknetNodes[i];\n if (typeof v === \"string\") {\n const hserver = GetServer(v);\n if (hserver === null || !(hserver instanceof HacknetServer))\n throw new Error(\"player hacknet server was not HacknetServer\");\n totalHacknetLevels += hserver.level;\n totalHacknetRam += hserver.maxRam;\n totalHacknetCores += hserver.cores;\n } else {\n totalHacknetLevels += v.level;\n totalHacknetRam += v.ram;\n totalHacknetCores += v.cores;\n }\n }\n if (\n !netburnersFac.isBanned &&\n !netburnersFac.isMember &&\n !netburnersFac.alreadyInvited &&\n this.hacking >= 80 &&\n totalHacknetRam >= 8 &&\n totalHacknetCores >= 4 &&\n totalHacknetLevels >= 100\n ) {\n invitedFactions.push(netburnersFac);\n }\n\n //Tian Di Hui\n const tiandihuiFac = Factions[\"Tian Di Hui\"];\n if (\n !tiandihuiFac.isBanned &&\n !tiandihuiFac.isMember &&\n !tiandihuiFac.alreadyInvited &&\n this.money >= 1000000 &&\n this.hacking >= 50 &&\n (this.city == CityName.Chongqing || this.city == CityName.NewTokyo || this.city == CityName.Ishima)\n ) {\n invitedFactions.push(tiandihuiFac);\n }\n\n //CyberSec\n const cybersecFac = Factions[\"CyberSec\"];\n const cybersecServer = GetServer(SpecialServers.CyberSecServer);\n if (!(cybersecServer instanceof Server)) throw new Error(\"cybersec should be normal server\");\n if (cybersecServer == null) {\n console.error(\"Could not find CyberSec Server\");\n } else if (\n !cybersecFac.isBanned &&\n !cybersecFac.isMember &&\n cybersecServer.backdoorInstalled &&\n !cybersecFac.alreadyInvited\n ) {\n invitedFactions.push(cybersecFac);\n }\n\n return invitedFactions;\n}\n\n/************* BitNodes **************/\nexport function setBitNodeNumber(this: IPlayer, n: number): void {\n this.bitNodeN = n;\n}\n\nexport function queueAugmentation(this: IPlayer, name: string): void {\n for (const aug of this.queuedAugmentations) {\n if (aug.name == name) {\n console.warn(`tried to queue ${name} twice, this may be a bug`);\n return;\n }\n }\n\n for (const aug of this.augmentations) {\n if (aug.name == name) {\n console.warn(`tried to queue ${name} twice, this may be a bug`);\n return;\n }\n }\n\n this.queuedAugmentations.push(new PlayerOwnedAugmentation(name));\n}\n\n/************* Coding Contracts **************/\nexport function gainCodingContractReward(this: IPlayer, reward: ICodingContractReward, difficulty = 1): string {\n if (reward == null || reward.type == null || reward == null) {\n return `No reward for this contract`;\n }\n\n /* eslint-disable no-case-declarations */\n switch (reward.type) {\n case CodingContractRewardType.FactionReputation:\n if (reward.name == null || !(Factions[reward.name] instanceof Faction)) {\n // If no/invalid faction was designated, just give rewards to all factions\n reward.type = CodingContractRewardType.FactionReputationAll;\n return this.gainCodingContractReward(reward);\n }\n const repGain = CONSTANTS.CodingContractBaseFactionRepGain * difficulty;\n Factions[reward.name].playerReputation += repGain;\n return `Gained ${repGain} faction reputation for ${reward.name}`;\n case CodingContractRewardType.FactionReputationAll:\n const totalGain = CONSTANTS.CodingContractBaseFactionRepGain * difficulty;\n\n // Ignore Bladeburners and other special factions for this calculation\n const specialFactions = [\"Bladeburners\"];\n const factions = this.factions.slice().filter((f) => {\n return !specialFactions.includes(f);\n });\n\n // If the player was only part of the special factions, we'll just give money\n if (factions.length == 0) {\n reward.type = CodingContractRewardType.Money;\n return this.gainCodingContractReward(reward, difficulty);\n }\n\n const gainPerFaction = Math.floor(totalGain / factions.length);\n for (const facName of factions) {\n if (!(Factions[facName] instanceof Faction)) {\n continue;\n }\n Factions[facName].playerReputation += gainPerFaction;\n }\n return `Gained ${gainPerFaction} reputation for each of the following factions: ${factions.toString()}`;\n break;\n case CodingContractRewardType.CompanyReputation: {\n if (reward.name == null || !(Companies[reward.name] instanceof Company)) {\n //If no/invalid company was designated, just give rewards to all factions\n reward.type = CodingContractRewardType.FactionReputationAll;\n return this.gainCodingContractReward(reward);\n }\n const repGain = CONSTANTS.CodingContractBaseCompanyRepGain * difficulty;\n Companies[reward.name].playerReputation += repGain;\n return `Gained ${repGain} company reputation for ${reward.name}`;\n }\n case CodingContractRewardType.Money:\n default: {\n const moneyGain = CONSTANTS.CodingContractBaseMoneyGain * difficulty * BitNodeMultipliers.CodingContractMoney;\n this.gainMoney(moneyGain, \"codingcontract\");\n return `Gained ${numeralWrapper.formatMoney(moneyGain)}`;\n }\n }\n /* eslint-enable no-case-declarations */\n}\n\nexport function travel(this: IPlayer, to: CityName): boolean {\n if (Cities[to] == null) {\n console.warn(`Player.travel() called with invalid city: ${to}`);\n return false;\n }\n this.city = to;\n\n return true;\n}\n\nexport function gotoLocation(this: IPlayer, to: LocationName): boolean {\n if (Locations[to] == null) {\n console.warn(`Player.gotoLocation() called with invalid location: ${to}`);\n return false;\n }\n this.location = to;\n\n return true;\n}\n\nexport function canAccessResleeving(this: IPlayer): boolean {\n return this.bitNodeN === 10 || SourceFileFlags[10] > 0;\n}\n\nexport function giveExploit(this: IPlayer, exploit: Exploit): void {\n if (!this.exploits.includes(exploit)) {\n this.exploits.push(exploit);\n SnackbarEvents.emit(\"SF -1 acquired!\", \"success\", 2000);\n }\n}\n\nexport function giveAchievement(this: IPlayer, achievementId: string): void {\n const achievement = achievements[achievementId];\n if (!achievement) return;\n if (!this.achievements.map((a) => a.ID).includes(achievementId)) {\n this.achievements.push({ ID: achievementId, unlockedOn: new Date().getTime() });\n SnackbarEvents.emit(`Unlocked Achievement: \"${achievement.Name}\"`, \"success\", 2000);\n }\n}\n\nexport function getIntelligenceBonus(this: IPlayer, weight: number): number {\n return calculateIntelligenceBonus(this.intelligence, weight);\n}\n\nexport function getCasinoWinnings(this: IPlayer): number {\n return this.moneySourceA.casino;\n}\n\nexport function getMult(this: IPlayer, name: string): number {\n if (!this.hasOwnProperty(name)) return 1;\n return (this as any)[name];\n}\n\nexport function setMult(this: IPlayer, name: string, mult: number): void {\n if (!this.hasOwnProperty(name)) return;\n (this as any)[name] = mult;\n}\n\nexport function canAccessCotMG(this: IPlayer): boolean {\n return this.bitNodeN === 13 || SourceFileFlags[13] > 0;\n}\n\nexport function sourceFileLvl(this: IPlayer, n: number): number {\n const sf = this.sourceFiles.find((sf) => sf.n === n);\n if (!sf) return 0;\n return sf.lvl;\n}\n","// Class representing a single hackable Server\nimport { BaseServer } from \"./BaseServer\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\nimport { createRandomString } from \"../utils/helpers/createRandomString\";\nimport { createRandomIp } from \"../utils/IPAddress\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IConstructorParams {\n adminRights?: boolean;\n hackDifficulty?: number;\n hostname: string;\n ip?: string;\n isConnectedTo?: boolean;\n maxRam?: number;\n moneyAvailable?: number;\n numOpenPortsRequired?: number;\n organizationName?: string;\n purchasedByPlayer?: boolean;\n requiredHackingSkill?: number;\n serverGrowth?: number;\n}\n\nexport class Server extends BaseServer {\n // Flag indicating whether this server has a backdoor installed by a player\n backdoorInstalled = false;\n\n // Initial server security level\n // (i.e. security level when the server was created)\n baseDifficulty = 1;\n\n // Server Security Level\n hackDifficulty = 1;\n\n // Minimum server security level that this server can be weakened to\n minDifficulty = 1;\n\n // How much money currently resides on the server and can be hacked\n moneyAvailable = 0;\n\n // Maximum amount of money that this server can hold\n moneyMax = 0;\n\n // Number of open ports required in order to gain admin/root access\n numOpenPortsRequired = 5;\n\n // How many ports are currently opened on the server\n openPortCount = 0;\n\n // Hacking level required to hack this server\n requiredHackingSkill = 1;\n\n // Parameter that affects how effectively this server's money can\n // be increased using the grow() Netscript function\n serverGrowth = 1;\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n super(params);\n\n // \"hacknet-node-X\" hostnames are reserved for Hacknet Servers\n if (this.hostname.startsWith(\"hacknet-node-\")) {\n this.hostname = createRandomString(10);\n }\n\n this.purchasedByPlayer = params.purchasedByPlayer != null ? params.purchasedByPlayer : false;\n\n //RAM, CPU speed and Scripts\n this.maxRam = params.maxRam != null ? params.maxRam : 0; //GB\n\n /* Hacking information (only valid for \"foreign\" aka non-purchased servers) */\n this.requiredHackingSkill = params.requiredHackingSkill != null ? params.requiredHackingSkill : 1;\n this.moneyAvailable =\n params.moneyAvailable != null ? params.moneyAvailable * BitNodeMultipliers.ServerStartingMoney : 0;\n this.moneyMax = 25 * this.moneyAvailable * BitNodeMultipliers.ServerMaxMoney;\n\n //Hack Difficulty is synonymous with server security. Base Difficulty = Starting difficulty\n this.hackDifficulty =\n params.hackDifficulty != null ? params.hackDifficulty * BitNodeMultipliers.ServerStartingSecurity : 1;\n this.baseDifficulty = this.hackDifficulty;\n this.minDifficulty = Math.max(1, Math.round(this.hackDifficulty / 3));\n this.serverGrowth = params.serverGrowth != null ? params.serverGrowth : 1; //Integer from 0 to 100. Affects money increase from grow()\n\n //Port information, required for porthacking servers to get admin rights\n this.numOpenPortsRequired = params.numOpenPortsRequired != null ? params.numOpenPortsRequired : 5;\n }\n\n /**\n * Ensures that the server's difficulty (server security) doesn't get too high\n */\n capDifficulty(): void {\n if (this.hackDifficulty < this.minDifficulty) {\n this.hackDifficulty = this.minDifficulty;\n }\n if (this.hackDifficulty < 1) {\n this.hackDifficulty = 1;\n }\n\n // Place some arbitrarily limit that realistically should never happen unless someone is\n // screwing around with the game\n if (this.hackDifficulty > 100) {\n this.hackDifficulty = 100;\n }\n }\n\n /**\n * Change this server's minimum security\n * @param n - Value by which to increase/decrease the server's minimum security\n * @param perc - Whether it should be changed by a percentage, or a flat value\n */\n changeMinimumSecurity(n: number, perc = false): void {\n if (perc) {\n this.minDifficulty *= n;\n } else {\n this.minDifficulty += n;\n }\n\n // Server security cannot go below 1\n this.minDifficulty = Math.max(1, this.minDifficulty);\n }\n\n /**\n * Change this server's maximum money\n * @param n - Value by which to change the server's maximum money\n */\n changeMaximumMoney(n: number): void {\n const softCap = 10e12;\n if (this.moneyMax > softCap) {\n const aboveCap = this.moneyMax - softCap;\n n = 1 + (n - 1) / Math.log(aboveCap) / Math.log(8);\n }\n\n this.moneyMax *= n;\n }\n\n /**\n * Strengthens a server's security level (difficulty) by the specified amount\n */\n fortify(amt: number): void {\n this.hackDifficulty += amt;\n this.capDifficulty();\n }\n\n /**\n * Lowers the server's security level (difficulty) by the specified amount)\n */\n weaken(amt: number): void {\n this.hackDifficulty -= amt * BitNodeMultipliers.ServerWeakenRate;\n this.capDifficulty();\n }\n\n /**\n * Serialize the current object to a JSON save state\n */\n toJSON(): any {\n return Generic_toJSON(\"Server\", this);\n }\n\n // Initializes a Server Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Server {\n return Generic_fromJSON(Server, value.data);\n }\n}\n\nReviver.constructors.Server = Server;\n","import React, { useContext } from \"react\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\n\nexport const Context: {\n Corporation: React.Context<ICorporation>;\n Division: React.Context<IIndustry>;\n} = {\n Corporation: React.createContext<ICorporation>({} as ICorporation),\n Division: React.createContext<IIndustry>({} as IIndustry),\n};\n\nexport const useCorporation = (): ICorporation => useContext(Context.Corporation);\nexport const useDivision = (): IIndustry => useContext(Context.Division);\n","import React from \"react\";\nimport { ResearchTree } from \"./ResearchTree\";\nimport { ICorporation } from \"./ICorporation\";\nimport { getBaseResearchTreeCopy, getProductIndustryResearchTreeCopy } from \"./data/BaseResearchTree\";\nimport { MoneyCost } from \"./ui/MoneyCost\";\n\ninterface IIndustryMap<T> {\n [key: string]: T | undefined;\n Energy: T;\n Utilities: T;\n Agriculture: T;\n Fishing: T;\n Mining: T;\n Food: T;\n Tobacco: T;\n Chemical: T;\n Pharmaceutical: T;\n Computer: T;\n Robotics: T;\n Software: T;\n Healthcare: T;\n RealEstate: T;\n}\n\n// Map of official names for each Industry\nexport const Industries: IIndustryMap<string> = {\n Energy: \"Energy\",\n Utilities: \"Water Utilities\",\n Agriculture: \"Agriculture\",\n Fishing: \"Fishing\",\n Mining: \"Mining\",\n Food: \"Food\",\n Tobacco: \"Tobacco\",\n Chemical: \"Chemical\",\n Pharmaceutical: \"Pharmaceutical\",\n Computer: \"Computer Hardware\",\n Robotics: \"Robotics\",\n Software: \"Software\",\n Healthcare: \"Healthcare\",\n RealEstate: \"RealEstate\",\n};\n\n// Map of how much money it takes to start each industry\nexport const IndustryStartingCosts: IIndustryMap<number> = {\n Energy: 225e9,\n Utilities: 150e9,\n Agriculture: 40e9,\n Fishing: 80e9,\n Mining: 300e9,\n Food: 10e9,\n Tobacco: 20e9,\n Chemical: 70e9,\n Pharmaceutical: 200e9,\n Computer: 500e9,\n Robotics: 1e12,\n Software: 25e9,\n Healthcare: 750e9,\n RealEstate: 600e9,\n};\n\n// Map of description for each industry\nexport const IndustryDescriptions: IIndustryMap<(corp: ICorporation) => React.ReactElement> = {\n Energy: (corp: ICorporation) => (\n <>\n Engage in the production and distribution of energy.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Energy} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Utilities: (corp: ICorporation) => (\n <>\n Distribute water and provide wastewater services.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Utilities} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Agriculture: (corp: ICorporation) => (\n <>\n Cultivate crops and breed livestock to produce food.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Agriculture} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Fishing: (corp: ICorporation) => (\n <>\n Produce food through the breeding and processing of fish and fish products.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Fishing} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Mining: (corp: ICorporation) => (\n <>\n Extract and process metals from the earth.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Mining} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Food: (corp: ICorporation) => (\n <>\n Create your own restaurants all around the world.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Food} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Tobacco: (corp: ICorporation) => (\n <>\n Create and distribute tobacco and tobacco-related products.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Tobacco} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Chemical: (corp: ICorporation) => (\n <>\n Produce industrial chemicals.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Chemical} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Pharmaceutical: (corp: ICorporation) => (\n <>\n Discover, develop, and create new pharmaceutical drugs.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Pharmaceutical} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Computer: (corp: ICorporation) => (\n <>\n Develop and manufacture new computer hardware and networking infrastructures.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Computer} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Robotics: (corp: ICorporation) => (\n <>\n Develop and create robots.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Robotics} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Software: (corp: ICorporation) => (\n <>\n Develop computer software and create AI Cores.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Software} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Healthcare: (corp: ICorporation) => (\n <>\n Create and manage hospitals.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Healthcare} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n RealEstate: (corp: ICorporation) => (\n <>\n Develop and manage real estate properties.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.RealEstate} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n};\n\n// Map of available Research for each Industry. This data is held in a\n// ResearchTree object\nexport const IndustryResearchTrees: IIndustryMap<ResearchTree> = {\n Energy: getBaseResearchTreeCopy(),\n Utilities: getBaseResearchTreeCopy(),\n Agriculture: getBaseResearchTreeCopy(),\n Fishing: getBaseResearchTreeCopy(),\n Mining: getBaseResearchTreeCopy(),\n Food: getProductIndustryResearchTreeCopy(),\n Tobacco: getProductIndustryResearchTreeCopy(),\n Chemical: getBaseResearchTreeCopy(),\n Pharmaceutical: getProductIndustryResearchTreeCopy(),\n Computer: getProductIndustryResearchTreeCopy(),\n Robotics: getProductIndustryResearchTreeCopy(),\n Software: getProductIndustryResearchTreeCopy(),\n Healthcare: getProductIndustryResearchTreeCopy(),\n RealEstate: getProductIndustryResearchTreeCopy(),\n};\n\nexport function resetIndustryResearchTrees(): void {\n IndustryResearchTrees.Energy = getBaseResearchTreeCopy();\n IndustryResearchTrees.Utilities = getBaseResearchTreeCopy();\n IndustryResearchTrees.Agriculture = getBaseResearchTreeCopy();\n IndustryResearchTrees.Fishing = getBaseResearchTreeCopy();\n IndustryResearchTrees.Mining = getBaseResearchTreeCopy();\n IndustryResearchTrees.Food = getBaseResearchTreeCopy();\n IndustryResearchTrees.Tobacco = getBaseResearchTreeCopy();\n IndustryResearchTrees.Chemical = getBaseResearchTreeCopy();\n IndustryResearchTrees.Pharmaceutical = getBaseResearchTreeCopy();\n IndustryResearchTrees.Computer = getBaseResearchTreeCopy();\n IndustryResearchTrees.Robotics = getBaseResearchTreeCopy();\n IndustryResearchTrees.Software = getBaseResearchTreeCopy();\n IndustryResearchTrees.Healthcare = getBaseResearchTreeCopy();\n IndustryResearchTrees.RealEstate = getBaseResearchTreeCopy();\n}\n","import { IMap } from \"../types\";\n\nexport const EmployeePositions: IMap<string> = {\n Operations: \"Operations\",\n Engineer: \"Engineer\",\n Business: \"Business\",\n Management: \"Management\",\n RandD: \"Research & Development\",\n Training: \"Training\",\n Unassigned: \"Unassigned\",\n};\n","/**\n * Enum defining the different types of possible locations\n */\nexport enum LocationType {\n Company,\n Gym,\n Hospital,\n Slums,\n Special, // This location has special options/activities (e.g. Bladeburner, Re-sleeving)\n StockMarket,\n TechVendor,\n TravelAgency,\n University,\n Casino,\n}\n","/**\n * Generic helper/utility functions for the Hacknet mechanic:\n * - Purchase nodes/upgrades\n * - Calculating maximum number of upgrades\n * - Processing Hacknet earnings\n * - Updating Hash Manager capacity\n * - Purchasing hash upgrades\n *\n * TODO Should probably split the different types of functions into their own modules\n */\nimport { HacknetNode } from \"./HacknetNode\";\nimport { calculateNodeCost } from \"./formulas/HacknetNodes\";\nimport { calculateServerCost } from \"./formulas/HacknetServers\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"./data/Constants\";\nimport { HacknetServer } from \"./HacknetServer\";\nimport { HashManager } from \"./HashManager\";\nimport { HashUpgrades } from \"./HashUpgrades\";\n\nimport { generateRandomContract } from \"../CodingContractGenerator\";\nimport { iTutorialSteps, iTutorialNextStep, ITutorial } from \"../InteractiveTutorial\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { Server } from \"../Server/Server\";\nimport { SourceFileFlags } from \"../SourceFile/SourceFileFlags\";\n\n// Returns a boolean indicating whether the player has Hacknet Servers\n// (the upgraded form of Hacknet Nodes)\nexport function hasHacknetServers(player: IPlayer): boolean {\n return player.bitNodeN === 9 || SourceFileFlags[9] > 0;\n}\n\nexport function purchaseHacknet(player: IPlayer): number {\n /* INTERACTIVE TUTORIAL */\n if (ITutorial.isRunning) {\n if (ITutorial.currStep === iTutorialSteps.HacknetNodesIntroduction) {\n iTutorialNextStep();\n } else {\n return -1;\n }\n }\n /* END INTERACTIVE TUTORIAL */\n\n const numOwned = player.hacknetNodes.length;\n if (hasHacknetServers(player)) {\n const cost = getCostOfNextHacknetServer(player);\n if (isNaN(cost)) {\n throw new Error(`Calculated cost of purchasing HacknetServer is NaN`);\n }\n\n if (!player.canAfford(cost) || numOwned >= HacknetServerConstants.MaxServers) {\n return -1;\n }\n player.loseMoney(cost, \"hacknet_expenses\");\n player.createHacknetServer();\n updateHashManagerCapacity(player);\n\n return numOwned;\n } else {\n const cost = getCostOfNextHacknetNode(player);\n if (isNaN(cost)) {\n throw new Error(`Calculated cost of purchasing HacknetNode is NaN`);\n }\n\n if (!player.canAfford(cost)) {\n return -1;\n }\n\n // Auto generate a name for the Node\n const name = \"hacknet-node-\" + numOwned;\n const node = new HacknetNode(name, player.hacknet_node_money_mult);\n\n player.loseMoney(cost, \"hacknet_expenses\");\n player.hacknetNodes.push(node);\n\n return numOwned;\n }\n}\n\nexport function hasMaxNumberHacknetServers(player: IPlayer): boolean {\n return hasHacknetServers(player) && player.hacknetNodes.length >= HacknetServerConstants.MaxServers;\n}\n\nexport function getCostOfNextHacknetNode(player: IPlayer): number {\n return calculateNodeCost(player.hacknetNodes.length + 1, player.hacknet_node_purchase_cost_mult);\n}\n\nexport function getCostOfNextHacknetServer(player: IPlayer): number {\n return calculateServerCost(player.hacknetNodes.length + 1, player.hacknet_node_purchase_cost_mult);\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's level\nexport function getMaxNumberLevelUpgrades(\n player: IPlayer,\n nodeObj: HacknetNode | HacknetServer,\n maxLevel: number,\n): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberLevelUpgrades() called without maxLevel arg`);\n }\n\n if (player.money < nodeObj.calculateLevelUpgradeCost(1, player.hacknet_node_level_cost_mult)) {\n return 0;\n }\n\n let min = 1;\n let max = maxLevel - 1;\n const levelsToMax = maxLevel - nodeObj.level;\n if (player.money > nodeObj.calculateLevelUpgradeCost(levelsToMax, player.hacknet_node_level_cost_mult)) {\n return levelsToMax;\n }\n\n while (min <= max) {\n const curr = ((min + max) / 2) | 0;\n if (\n curr !== maxLevel &&\n player.money > nodeObj.calculateLevelUpgradeCost(curr, player.hacknet_node_level_cost_mult) &&\n player.money < nodeObj.calculateLevelUpgradeCost(curr + 1, player.hacknet_node_level_cost_mult)\n ) {\n return Math.min(levelsToMax, curr);\n } else if (player.money < nodeObj.calculateLevelUpgradeCost(curr, player.hacknet_node_level_cost_mult)) {\n max = curr - 1;\n } else if (player.money > nodeObj.calculateLevelUpgradeCost(curr, player.hacknet_node_level_cost_mult)) {\n min = curr + 1;\n } else {\n return Math.min(levelsToMax, curr);\n }\n }\n return 0;\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's RAM\nexport function getMaxNumberRamUpgrades(\n player: IPlayer,\n nodeObj: HacknetNode | HacknetServer,\n maxLevel: number,\n): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberRamUpgrades() called without maxLevel arg`);\n }\n\n if (player.money < nodeObj.calculateRamUpgradeCost(1, player.hacknet_node_ram_cost_mult)) {\n return 0;\n }\n\n let levelsToMax;\n if (nodeObj instanceof HacknetServer) {\n levelsToMax = Math.round(Math.log2(maxLevel / nodeObj.maxRam));\n } else {\n levelsToMax = Math.round(Math.log2(maxLevel / nodeObj.ram));\n }\n if (player.money > nodeObj.calculateRamUpgradeCost(levelsToMax, player.hacknet_node_ram_cost_mult)) {\n return levelsToMax;\n }\n\n //We'll just loop until we find the max\n for (let i = levelsToMax - 1; i >= 0; --i) {\n if (player.money > nodeObj.calculateRamUpgradeCost(i, player.hacknet_node_ram_cost_mult)) {\n return i;\n }\n }\n return 0;\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's cores\nexport function getMaxNumberCoreUpgrades(\n player: IPlayer,\n nodeObj: HacknetNode | HacknetServer,\n maxLevel: number,\n): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberCoreUpgrades() called without maxLevel arg`);\n }\n\n if (player.money < nodeObj.calculateCoreUpgradeCost(1, player.hacknet_node_core_cost_mult)) {\n return 0;\n }\n\n let min = 1;\n let max = maxLevel - 1;\n const levelsToMax = maxLevel - nodeObj.cores;\n if (player.money > nodeObj.calculateCoreUpgradeCost(levelsToMax, player.hacknet_node_core_cost_mult)) {\n return levelsToMax;\n }\n\n // Use a binary search to find the max possible number of upgrades\n while (min <= max) {\n const curr = ((min + max) / 2) | 0;\n if (\n curr != maxLevel &&\n player.money > nodeObj.calculateCoreUpgradeCost(curr, player.hacknet_node_core_cost_mult) &&\n player.money < nodeObj.calculateCoreUpgradeCost(curr + 1, player.hacknet_node_core_cost_mult)\n ) {\n return Math.min(levelsToMax, curr);\n } else if (player.money < nodeObj.calculateCoreUpgradeCost(curr, player.hacknet_node_core_cost_mult)) {\n max = curr - 1;\n } else if (player.money > nodeObj.calculateCoreUpgradeCost(curr, player.hacknet_node_core_cost_mult)) {\n min = curr + 1;\n } else {\n return Math.min(levelsToMax, curr);\n }\n }\n\n return 0;\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's cache\nexport function getMaxNumberCacheUpgrades(player: IPlayer, nodeObj: HacknetServer, maxLevel: number): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberCacheUpgrades() called without maxLevel arg`);\n }\n\n if (!player.canAfford(nodeObj.calculateCacheUpgradeCost(1))) {\n return 0;\n }\n\n let min = 1;\n let max = maxLevel - 1;\n const levelsToMax = maxLevel - nodeObj.cache;\n if (player.canAfford(nodeObj.calculateCacheUpgradeCost(levelsToMax))) {\n return levelsToMax;\n }\n\n // Use a binary search to find the max possible number of upgrades\n while (min <= max) {\n const curr = ((min + max) / 2) | 0;\n if (\n curr != maxLevel &&\n player.canAfford(nodeObj.calculateCacheUpgradeCost(curr)) &&\n !player.canAfford(nodeObj.calculateCacheUpgradeCost(curr + 1))\n ) {\n return Math.min(levelsToMax, curr);\n } else if (!player.canAfford(nodeObj.calculateCacheUpgradeCost(curr))) {\n max = curr - 1;\n } else if (player.canAfford(nodeObj.calculateCacheUpgradeCost(curr))) {\n min = curr + 1;\n } else {\n return Math.min(levelsToMax, curr);\n }\n }\n\n return 0;\n}\n\nexport function purchaseLevelUpgrade(player: IPlayer, node: HacknetNode | HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateLevelUpgradeCost(sanitizedLevels, player.hacknet_node_level_cost_mult);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n const isServer = node instanceof HacknetServer;\n\n // If we're at max level, return false\n if (node.level >= (isServer ? HacknetServerConstants.MaxLevel : HacknetNodeConstants.MaxLevel)) {\n return false;\n }\n\n // If the number of specified upgrades would exceed the max level, calculate\n // the maximum number of upgrades and use that\n if (node.level + sanitizedLevels > (isServer ? HacknetServerConstants.MaxLevel : HacknetNodeConstants.MaxLevel)) {\n const diff = Math.max(0, (isServer ? HacknetServerConstants.MaxLevel : HacknetNodeConstants.MaxLevel) - node.level);\n return purchaseLevelUpgrade(player, node, diff);\n }\n\n if (!player.canAfford(cost)) {\n return false;\n }\n\n player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeLevel(sanitizedLevels, player.hacknet_node_money_mult);\n\n return true;\n}\n\nexport function purchaseRamUpgrade(player: IPlayer, node: HacknetNode | HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateRamUpgradeCost(sanitizedLevels, player.hacknet_node_ram_cost_mult);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n if (node instanceof HacknetServer && node.maxRam >= HacknetServerConstants.MaxRam) {\n return false;\n }\n\n if (node instanceof HacknetNode && node.ram >= HacknetNodeConstants.MaxRam) {\n return false;\n }\n\n // If the number of specified upgrades would exceed the max RAM, calculate the\n // max possible number of upgrades and use that\n if (node instanceof HacknetServer) {\n if (node.maxRam * Math.pow(2, sanitizedLevels) > HacknetServerConstants.MaxRam) {\n const diff = Math.max(0, Math.log2(Math.round(HacknetServerConstants.MaxRam / node.maxRam)));\n return purchaseRamUpgrade(player, node, diff);\n }\n } else if (node instanceof HacknetNode) {\n if (node.ram * Math.pow(2, sanitizedLevels) > HacknetNodeConstants.MaxRam) {\n const diff = Math.max(0, Math.log2(Math.round(HacknetNodeConstants.MaxRam / node.ram)));\n return purchaseRamUpgrade(player, node, diff);\n }\n }\n\n if (!player.canAfford(cost)) {\n return false;\n }\n\n player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeRam(sanitizedLevels, player.hacknet_node_money_mult);\n\n return true;\n}\n\nexport function purchaseCoreUpgrade(player: IPlayer, node: HacknetNode | HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateCoreUpgradeCost(sanitizedLevels, player.hacknet_node_core_cost_mult);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n const isServer = node instanceof HacknetServer;\n\n // Fail if we're already at max\n if (node.cores >= (isServer ? HacknetServerConstants.MaxCores : HacknetNodeConstants.MaxCores)) {\n return false;\n }\n\n // If the specified number of upgrades would exceed the max Cores, calculate\n // the max possible number of upgrades and use that\n if (node.cores + sanitizedLevels > (isServer ? HacknetServerConstants.MaxCores : HacknetNodeConstants.MaxCores)) {\n const diff = Math.max(0, (isServer ? HacknetServerConstants.MaxCores : HacknetNodeConstants.MaxCores) - node.cores);\n return purchaseCoreUpgrade(player, node, diff);\n }\n\n if (!player.canAfford(cost)) {\n return false;\n }\n\n player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeCore(sanitizedLevels, player.hacknet_node_money_mult);\n\n return true;\n}\n\nexport function purchaseCacheUpgrade(player: IPlayer, node: HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateCacheUpgradeCost(sanitizedLevels);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n if (!(node instanceof HacknetServer)) {\n console.warn(`purchaseCacheUpgrade() called for a non-HacknetNode`);\n return false;\n }\n\n // Fail if we're already at max\n if (node.cache + sanitizedLevels > HacknetServerConstants.MaxCache) {\n const diff = Math.max(0, HacknetServerConstants.MaxCache - node.cache);\n return purchaseCacheUpgrade(player, node, diff);\n }\n\n if (!player.canAfford(cost)) {\n return false;\n }\n\n player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeCache(sanitizedLevels);\n\n return true;\n}\n\nexport function processHacknetEarnings(player: IPlayer, numCycles: number): number {\n // Determine if player has Hacknet Nodes or Hacknet Servers, then\n // call the appropriate function\n if (player.hacknetNodes.length === 0) {\n return 0;\n }\n if (hasHacknetServers(player)) {\n return processAllHacknetServerEarnings(player, numCycles);\n } else if (player.hacknetNodes[0] instanceof HacknetNode) {\n return processAllHacknetNodeEarnings(player, numCycles);\n } else {\n return 0;\n }\n}\n\nfunction processAllHacknetNodeEarnings(player: IPlayer, numCycles: number): number {\n let total = 0;\n for (let i = 0; i < player.hacknetNodes.length; ++i) {\n const node = player.hacknetNodes[i];\n if (typeof node === \"string\") throw new Error(\"player node should not be ip string\");\n total += processSingleHacknetNodeEarnings(player, numCycles, node);\n }\n\n return total;\n}\n\nfunction processSingleHacknetNodeEarnings(player: IPlayer, numCycles: number, nodeObj: HacknetNode): number {\n const totalEarnings = nodeObj.process(numCycles);\n player.gainMoney(totalEarnings, \"hacknet\");\n\n return totalEarnings;\n}\n\nfunction processAllHacknetServerEarnings(player: IPlayer, numCycles: number): number {\n if (!(player.hashManager instanceof HashManager)) {\n throw new Error(`Player does not have a HashManager (should be in 'hashManager' prop)`);\n }\n\n let hashes = 0;\n for (let i = 0; i < player.hacknetNodes.length; ++i) {\n // hacknetNodes array only contains the IP addresses of the servers.\n // Also, update the hash rate before processing\n const ip = player.hacknetNodes[i];\n if (ip instanceof HacknetNode) throw new Error(`player nodes should not be HacketNode`);\n const hserver = GetServer(ip);\n if (!(hserver instanceof HacknetServer)) throw new Error(`player nodes shoud not be Server`);\n hserver.updateHashRate(player.hacknet_node_money_mult);\n const h = hserver.process(numCycles);\n hashes += h;\n }\n\n const wastedHashes = player.hashManager.storeHashes(hashes);\n if (wastedHashes > 0) {\n const upgrade = HashUpgrades[\"Sell for Money\"];\n if (upgrade === null) throw new Error(\"Could not get the hash upgrade\");\n if (!upgrade.cost) throw new Error(\"Upgrade is not properly configured\");\n\n const multiplier = Math.floor(wastedHashes / upgrade.cost);\n if (multiplier > 0) {\n player.gainMoney(upgrade.value * multiplier, \"hacknet\");\n }\n }\n\n return hashes;\n}\n\nexport function updateHashManagerCapacity(player: IPlayer): void {\n if (!(player.hashManager instanceof HashManager)) {\n console.error(`Player does not have a HashManager`);\n return;\n }\n\n const nodes = player.hacknetNodes;\n if (nodes.length === 0) {\n player.hashManager.updateCapacity(0);\n return;\n }\n\n let total = 0;\n for (let i = 0; i < nodes.length; ++i) {\n if (typeof nodes[i] !== \"string\") {\n player.hashManager.updateCapacity(0);\n return;\n }\n const ip = nodes[i];\n if (ip instanceof HacknetNode) throw new Error(`player nodes should be string but isn't`);\n const h = GetServer(ip);\n if (!(h instanceof HacknetServer)) {\n player.hashManager.updateCapacity(0);\n return;\n }\n\n total += h.hashCapacity;\n }\n\n player.hashManager.updateCapacity(total);\n}\n\nexport function purchaseHashUpgrade(player: IPlayer, upgName: string, upgTarget: string): boolean {\n if (!(player.hashManager instanceof HashManager)) {\n console.error(`Player does not have a HashManager`);\n return false;\n }\n\n // HashManager handles the transaction. This just needs to actually implement\n // the effects of the upgrade\n if (player.hashManager.upgrade(upgName)) {\n const upg = HashUpgrades[upgName];\n\n switch (upgName) {\n case \"Sell for Money\": {\n player.gainMoney(upg.value, \"hacknet\");\n break;\n }\n case \"Sell for Corporation Funds\": {\n const corp = player.corporation;\n if (corp === null) {\n player.hashManager.refundUpgrade(upgName);\n return false;\n }\n corp.funds = corp.funds + upg.value;\n break;\n }\n case \"Reduce Minimum Security\": {\n try {\n const target = GetServer(upgTarget);\n if (target == null) {\n console.error(`Invalid target specified in purchaseHashUpgrade(): ${upgTarget}`);\n return false;\n }\n if (!(target instanceof Server)) throw new Error(`'${upgTarget}' is not a normal server.`);\n\n target.changeMinimumSecurity(upg.value, true);\n } catch (e) {\n player.hashManager.refundUpgrade(upgName);\n return false;\n }\n break;\n }\n case \"Increase Maximum Money\": {\n try {\n const target = GetServer(upgTarget);\n if (target == null) {\n console.error(`Invalid target specified in purchaseHashUpgrade(): ${upgTarget}`);\n return false;\n }\n if (!(target instanceof Server)) throw new Error(`'${upgTarget}' is not a normal server.`);\n\n target.changeMaximumMoney(upg.value);\n } catch (e) {\n player.hashManager.refundUpgrade(upgName);\n return false;\n }\n break;\n }\n case \"Improve Studying\": {\n // Multiplier handled by HashManager\n break;\n }\n case \"Improve Gym Training\": {\n // Multiplier handled by HashManager\n break;\n }\n case \"Exchange for Corporation Research\": {\n // This will throw if player doesn't have a corporation\n const corp = player.corporation;\n if (corp === null) {\n player.hashManager.refundUpgrade(upgName);\n return false;\n }\n for (const division of corp.divisions) {\n division.sciResearch.qty += upg.value;\n }\n break;\n }\n case \"Exchange for Bladeburner Rank\": {\n // This will throw if player isnt in Bladeburner\n const bladeburner = player.bladeburner;\n if (bladeburner === null) {\n player.hashManager.refundUpgrade(upgName);\n return false;\n }\n bladeburner.changeRank(player, upg.value);\n break;\n }\n case \"Exchange for Bladeburner SP\": {\n // This will throw if player isnt in Bladeburner\n const bladeburner = player.bladeburner;\n if (bladeburner === null) {\n player.hashManager.refundUpgrade(upgName);\n return false;\n }\n\n bladeburner.skillPoints += upg.value;\n break;\n }\n case \"Generate Coding Contract\": {\n generateRandomContract();\n break;\n }\n default:\n console.warn(`Unrecognized upgrade name ${upgName}. Upgrade has no effect`);\n player.hashManager.refundUpgrade(upgName);\n return false;\n }\n\n return true;\n }\n\n return false;\n}\n","export const BladeburnerConstants: {\n CityNames: string[];\n CyclesPerSecond: number;\n StaminaGainPerSecond: number;\n BaseStaminaLoss: number;\n MaxStaminaToGainFactor: number;\n DifficultyToTimeFactor: number;\n DiffMultExponentialFactor: number;\n DiffMultLinearFactor: number;\n EffAgiLinearFactor: number;\n EffDexLinearFactor: number;\n EffAgiExponentialFactor: number;\n EffDexExponentialFactor: number;\n BaseRecruitmentTimeNeeded: number;\n PopulationThreshold: number;\n PopulationExponent: number;\n ChaosThreshold: number;\n BaseStatGain: number;\n BaseIntGain: number;\n ActionCountGrowthPeriod: number;\n RankToFactionRepFactor: number;\n RankNeededForFaction: number;\n ContractSuccessesPerLevel: number;\n OperationSuccessesPerLevel: number;\n RanksPerSkillPoint: number;\n ContractBaseMoneyGain: number;\n HrcHpGain: number;\n HrcStaminaGain: number;\n} = {\n CityNames: [\"Aevum\", \"Chongqing\", \"Sector-12\", \"New Tokyo\", \"Ishima\", \"Volhaven\"],\n CyclesPerSecond: 5, // Game cycle is 200 ms\n\n StaminaGainPerSecond: 0.0085,\n BaseStaminaLoss: 0.285, // Base stamina loss per action. Increased based on difficulty\n MaxStaminaToGainFactor: 70000, // Max Stamina is divided by this to get bonus stamina gain\n\n DifficultyToTimeFactor: 10, // Action Difficulty divided by this to get base action time\n\n /**\n * The difficulty multiplier affects stamina loss and hp loss of an action. Also affects\n * experience gain. Its formula is:\n * difficulty ^ exponentialFactor + difficulty / linearFactor\n */\n DiffMultExponentialFactor: 0.28,\n DiffMultLinearFactor: 650,\n\n /**\n * These factors are used to calculate action time.\n * They affect how much action time is reduced based on your agility and dexterity\n */\n EffAgiLinearFactor: 10e3,\n EffDexLinearFactor: 10e3,\n EffAgiExponentialFactor: 0.04,\n EffDexExponentialFactor: 0.035,\n\n BaseRecruitmentTimeNeeded: 300, // Base time needed (s) to complete a Recruitment action\n\n PopulationThreshold: 1e9, // Population which determines baseline success rate\n PopulationExponent: 0.7, // Exponent that influences how different populations affect success rate\n ChaosThreshold: 50, // City chaos level after which it starts making tasks harder\n\n BaseStatGain: 1, // Base stat gain per second\n BaseIntGain: 0.003, // Base intelligence stat gain\n\n ActionCountGrowthPeriod: 480, // Time (s) it takes for action count to grow by its specified value\n\n RankToFactionRepFactor: 2, // Delta Faction Rep = this * Delta Rank\n RankNeededForFaction: 25,\n\n ContractSuccessesPerLevel: 3, // How many successes you need to level up a contract\n OperationSuccessesPerLevel: 2.5, // How many successes you need to level up an op\n\n RanksPerSkillPoint: 3, // How many ranks needed to get 1 Skill Point\n\n ContractBaseMoneyGain: 250e3, // Base Money Gained per contract\n\n HrcHpGain: 2, // HP Gained from Hyperbolic Regeneration chamber\n HrcStaminaGain: 1, // Percentage Stamina gained from Hyperbolic Regeneration Chamber\n};\n","import { IMap } from \"../../types\";\n\nexport const LiteratureNames: IMap<string> = {\n HackersStartingHandbook: \"hackers-starting-handbook.lit\",\n CorporationManagementHandbook: \"corporation-management-handbook.lit\",\n HistoryOfSynthoids: \"history-of-synthoids.lit\",\n AGreenTomorrow: \"A-Green-Tomorrow.lit\",\n AlphaOmega: \"alpha-omega.lit\",\n SimulatedReality: \"simulated-reality.lit\",\n BeyondMan: \"beyond-man.lit\",\n BrighterThanTheSun: \"brighter-than-the-sun.lit\",\n DemocracyIsDead: \"democracy-is-dead.lit\",\n Sector12Crime: \"sector-12-crime.lit\",\n ManAndMachine: \"man-and-machine.lit\",\n SecretSocieties: \"secret-societies.lit\",\n TheFailedFrontier: \"the-failed-frontier.lit\",\n CodedIntelligence: \"coded-intelligence.lit\",\n SyntheticMuscles: \"synthetic-muscles.lit\",\n TensionsInTechRace: \"tensions-in-tech-race.lit\",\n CostOfImmortality: \"cost-of-immortality.lit\",\n TheHiddenWorld: \"the-hidden-world.lit\",\n TheNewGod: \"the-new-god.lit\",\n NewTriads: \"new-triads.lit\",\n TheSecretWar: \"the-secret-war.lit\",\n};\n","import { Program } from \"./Program\";\nimport { programsMetadata } from \"./data/ProgramsMetadata\";\nimport { IMap } from \"../types\";\n\nexport const Programs: IMap<Program> = {};\n\nfor (const params of programsMetadata) {\n Programs[params.key] = new Program(params.name, params.create, params.run);\n}\n","// Constructs all CompanyPosition objects using the metadata in data/companypositions.ts\nimport { companiesMetadata } from \"./data/CompaniesMetadata\";\nimport { Company, IConstructorParams } from \"./Company\";\nimport { IMap } from \"../types\";\nimport { Reviver } from \"../utils/JSONReviver\";\n\nexport let Companies: IMap<Company> = {};\n\nfunction addCompany(params: IConstructorParams): void {\n if (Companies[params.name] != null) {\n console.warn(`Duplicate Company Position being defined: ${params.name}`);\n }\n Companies[params.name] = new Company(params);\n}\n\n// Used to initialize new Company objects for the Companies map\n// Called when creating new game or after a prestige/reset\nexport function initCompanies(): void {\n // Save Old Company data for 'favor'\n const oldCompanies = Companies;\n\n // Re-construct all Companies\n Companies = {};\n companiesMetadata.forEach((e) => {\n addCompany(e);\n });\n\n // Reset data\n for (const companyName of Object.keys(Companies)) {\n const company = Companies[companyName];\n const oldCompany = oldCompanies[companyName];\n if (!(oldCompany instanceof Company)) {\n // New game, so no OldCompanies data\n company.favor = 0;\n } else {\n company.favor = oldCompanies[companyName].favor;\n if (isNaN(company.favor)) {\n company.favor = 0;\n }\n }\n }\n}\n\n// Used to load Companies map from a save\nexport function loadCompanies(saveString: string): void {\n Companies = JSON.parse(saveString, Reviver);\n}\n","import { ICorporation } from \"./ICorporation\";\nimport { IIndustry } from \"./IIndustry\";\nimport { IndustryStartingCosts, IndustryResearchTrees } from \"./IndustryData\";\nimport { Industry } from \"./Industry\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { OfficeSpace } from \"./OfficeSpace\";\nimport { Material } from \"./Material\";\nimport { Product } from \"./Product\";\nimport { Warehouse } from \"./Warehouse\";\nimport { CorporationUnlockUpgrade } from \"./data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade } from \"./data/CorporationUpgrades\";\nimport { Cities } from \"../Locations/Cities\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { Employee } from \"./Employee\";\nimport { IndustryUpgrades } from \"./IndustryUpgrades\";\nimport { ResearchMap } from \"./ResearchMap\";\n\nexport function NewIndustry(corporation: ICorporation, industry: string, name: string): void {\n for (let i = 0; i < corporation.divisions.length; ++i) {\n if (corporation.divisions[i].name === name) {\n throw new Error(\"This division name is already in use!\");\n return;\n }\n }\n\n const cost = IndustryStartingCosts[industry];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industry}'`);\n }\n if (corporation.funds < cost) {\n throw new Error(\"Not enough money to create a new division in this industry\");\n } else if (name === \"\") {\n throw new Error(\"New division must have a name!\");\n } else {\n corporation.funds = corporation.funds - cost;\n corporation.divisions.push(\n new Industry({\n corp: corporation,\n name: name,\n type: industry,\n }),\n );\n }\n}\n\nexport function NewCity(corporation: ICorporation, division: IIndustry, city: string): void {\n if (corporation.funds < CorporationConstants.OfficeInitialCost) {\n throw new Error(\"You don't have enough company funds to open a new office!\");\n } else {\n corporation.funds = corporation.funds - CorporationConstants.OfficeInitialCost;\n division.offices[city] = new OfficeSpace({\n loc: city,\n size: CorporationConstants.OfficeInitialSize,\n });\n }\n}\n\nexport function UnlockUpgrade(corporation: ICorporation, upgrade: CorporationUnlockUpgrade): void {\n if (corporation.funds < upgrade[1]) {\n throw new Error(\"Insufficient funds\");\n }\n corporation.unlock(upgrade);\n}\n\nexport function LevelUpgrade(corporation: ICorporation, upgrade: CorporationUpgrade): void {\n const baseCost = upgrade[1];\n const priceMult = upgrade[2];\n const level = corporation.upgrades[upgrade[0]];\n const cost = baseCost * Math.pow(priceMult, level);\n if (corporation.funds < cost) {\n throw new Error(\"Insufficient funds\");\n } else {\n corporation.upgrade(upgrade);\n }\n}\n\nexport function IssueDividends(corporation: ICorporation, percent: number): void {\n if (isNaN(percent) || percent < 0 || percent > CorporationConstants.DividendMaxPercentage) {\n throw new Error(`Invalid value. Must be an integer between 0 and ${CorporationConstants.DividendMaxPercentage}`);\n }\n\n corporation.dividendPercentage = percent * 100;\n}\n\nexport function SellMaterial(mat: Material, amt: string, price: string): void {\n if (price === \"\") price = \"0\";\n if (amt === \"\") amt = \"0\";\n let cost = price.replace(/\\s+/g, \"\");\n cost = cost.replace(/[^-()\\d/*+.MPe]/g, \"\"); //Sanitize cost\n let temp = cost.replace(/MP/g, mat.bCost + \"\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell price field: \" + e);\n }\n\n if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {\n throw new Error(\"Invalid value or expression for sell price field\");\n }\n\n if (cost.includes(\"MP\")) {\n mat.sCost = cost; //Dynamically evaluated\n } else {\n mat.sCost = temp;\n }\n\n //Parse quantity\n amt = amt.toUpperCase();\n if (amt.includes(\"MAX\") || amt.includes(\"PROD\")) {\n let q = amt.replace(/\\s+/g, \"\");\n q = q.replace(/[^-()\\d/*+.MAXPROD]/g, \"\");\n let tempQty = q.replace(/MAX/g, \"1\");\n tempQty = tempQty.replace(/PROD/g, \"1\");\n try {\n tempQty = eval(tempQty);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell price field: \" + e);\n }\n\n if (tempQty == null || isNaN(parseFloat(tempQty)) || parseFloat(tempQty) < 0) {\n throw new Error(\"Invalid value or expression for sell price field\");\n }\n\n mat.sllman[0] = true;\n mat.sllman[1] = q; //Use sanitized input\n } else if (isNaN(parseFloat(amt)) || parseFloat(amt) < 0) {\n throw new Error(\"Invalid value for sell quantity field! Must be numeric or 'MAX'\");\n } else {\n let q = parseFloat(amt);\n if (isNaN(q)) {\n q = 0;\n }\n if (q === 0) {\n mat.sllman[0] = false;\n mat.sllman[1] = 0;\n } else {\n mat.sllman[0] = true;\n mat.sllman[1] = q;\n }\n }\n}\n\nexport function SellProduct(product: Product, city: string, amt: string, price: string, all: boolean): void {\n //Parse price\n if (price.includes(\"MP\")) {\n //Dynamically evaluated quantity. First test to make sure its valid\n //Sanitize input, then replace dynamic variables with arbitrary numbers\n price = price.replace(/\\s+/g, \"\");\n price = price.replace(/[^-()\\d/*+.MP]/g, \"\");\n let temp = price.replace(/MP/g, \"1\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell quantity field: \" + e);\n }\n if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {\n throw new Error(\"Invalid value or expression for sell quantity field.\");\n }\n product.sCost = price; //Use sanitized price\n } else {\n const cost = parseFloat(price);\n if (isNaN(cost)) {\n throw new Error(\"Invalid value for sell price field\");\n }\n product.sCost = cost;\n }\n\n // Array of all cities. Used later\n const cities = Object.keys(Cities);\n\n // Parse quantity\n amt = amt.toUpperCase();\n if (amt.includes(\"MAX\") || amt.includes(\"PROD\")) {\n //Dynamically evaluated quantity. First test to make sure its valid\n let qty = amt.replace(/\\s+/g, \"\");\n qty = qty.replace(/[^-()\\d/*+.MAXPROD]/g, \"\");\n let temp = qty.replace(/MAX/g, \"1\");\n temp = temp.replace(/PROD/g, \"1\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell price field: \" + e);\n }\n\n if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {\n throw new Error(\"Invalid value or expression for sell price field\");\n }\n if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = true;\n product.sllman[tempCity][1] = qty; //Use sanitized input\n }\n } else {\n product.sllman[city][0] = true;\n product.sllman[city][1] = qty; //Use sanitized input\n }\n } else if (isNaN(parseFloat(amt)) || parseFloat(amt) < 0) {\n throw new Error(\"Invalid value for sell quantity field! Must be numeric\");\n } else {\n let qty = parseFloat(amt);\n if (isNaN(qty)) {\n qty = 0;\n }\n if (qty === 0) {\n if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = false;\n product.sllman[tempCity][1] = \"\";\n }\n } else {\n product.sllman[city][0] = false;\n product.sllman[city][1] = \"\";\n }\n } else {\n if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = true;\n product.sllman[tempCity][1] = qty;\n }\n } else {\n product.sllman[city][0] = true;\n product.sllman[city][1] = qty;\n }\n }\n }\n}\n\nexport function SetSmartSupply(warehouse: Warehouse, smartSupply: boolean): void {\n warehouse.smartSupplyEnabled = smartSupply;\n}\n\nexport function SetSmartSupplyUseLeftovers(warehouse: Warehouse, material: Material, useLeftover: boolean): void {\n if (!Object.keys(warehouse.smartSupplyUseLeftovers).includes(material.name.replace(/ /g, \"\")))\n throw new Error(`Invalid material '${material.name}'`);\n warehouse.smartSupplyUseLeftovers[material.name.replace(/ /g, \"\")] = useLeftover;\n}\n\nexport function BuyMaterial(material: Material, amt: number): void {\n if (isNaN(amt) || amt < 0) {\n throw new Error(`Invalid amount '${amt}' to buy material '${material.name}'`);\n }\n material.buy = amt;\n}\n\nexport function AssignJob(employee: Employee, job: string): void {\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n employee.pos = job;\n}\n\nexport function UpgradeOfficeSize(corp: ICorporation, office: OfficeSpace, size: number): void {\n const initialPriceMult = Math.round(office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n // Calculate cost to upgrade size by 15 employees\n let mult = 0;\n for (let i = 0; i < size / CorporationConstants.OfficeInitialSize; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n const cost = CorporationConstants.OfficeInitialCost * mult;\n if (corp.funds < cost) return;\n office.size += size;\n corp.funds = corp.funds - cost;\n}\n\nexport function ThrowParty(corp: ICorporation, office: OfficeSpace, costPerEmployee: number): number {\n const totalCost = costPerEmployee * office.employees.length;\n if (corp.funds < totalCost) return 0;\n corp.funds = corp.funds - totalCost;\n let mult = 0;\n for (let i = 0; i < office.employees.length; ++i) {\n mult = office.employees[i].throwParty(costPerEmployee);\n }\n\n return mult;\n}\n\nexport function PurchaseWarehouse(corp: ICorporation, division: IIndustry, city: string): void {\n if (corp.funds < CorporationConstants.WarehouseInitialCost) return;\n if (division.warehouses[city] instanceof Warehouse) return;\n division.warehouses[city] = new Warehouse({\n corp: corp,\n industry: division,\n loc: city,\n size: CorporationConstants.WarehouseInitialSize,\n });\n corp.funds = corp.funds - CorporationConstants.WarehouseInitialCost;\n}\n\nexport function UpgradeWarehouse(corp: ICorporation, division: IIndustry, warehouse: Warehouse): void {\n const sizeUpgradeCost = CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, warehouse.level + 1);\n ++warehouse.level;\n warehouse.updateSize(corp, division);\n corp.funds = corp.funds - sizeUpgradeCost;\n}\n\nexport function BuyCoffee(corp: ICorporation, division: IIndustry, office: OfficeSpace): void {\n const upgrade = IndustryUpgrades[0];\n const cost = office.employees.length * upgrade[1];\n if (corp.funds < cost) return;\n corp.funds = corp.funds - cost;\n division.upgrade(upgrade, {\n corporation: corp,\n office: office,\n });\n}\n\nexport function HireAdVert(corp: ICorporation, division: IIndustry, office: OfficeSpace): void {\n const upgrade = IndustryUpgrades[1];\n const cost = upgrade[1] * Math.pow(upgrade[2], division.upgrades[1]);\n if (corp.funds < cost) return;\n corp.funds = corp.funds - cost;\n division.upgrade(upgrade, {\n corporation: corp,\n office: office,\n });\n}\n\nexport function MakeProduct(\n corp: ICorporation,\n division: IIndustry,\n city: string,\n productName: string,\n designInvest: number,\n marketingInvest: number,\n): void {\n if (designInvest < 0) {\n designInvest = 0;\n }\n if (marketingInvest < 0) {\n marketingInvest = 0;\n }\n if (productName == null || productName === \"\") {\n throw new Error(\"You must specify a name for your product!\");\n }\n if (isNaN(designInvest)) {\n throw new Error(\"Invalid value for design investment\");\n }\n if (isNaN(marketingInvest)) {\n throw new Error(\"Invalid value for marketing investment\");\n }\n if (corp.funds < designInvest + marketingInvest) {\n throw new Error(\"You don't have enough company funds to make this large of an investment\");\n }\n const product = new Product({\n name: productName.replace(/[<>]/g, \"\"), //Sanitize for HTMl elements\n createCity: city,\n designCost: designInvest,\n advCost: marketingInvest,\n });\n if (division.products[product.name] instanceof Product) {\n throw new Error(`You already have a product with this name!`);\n }\n corp.funds = corp.funds - (designInvest + marketingInvest);\n division.products[product.name] = product;\n}\n\nexport function Research(division: IIndustry, researchName: string): void {\n const researchTree = IndustryResearchTrees[division.type];\n if (researchTree === undefined) throw new Error(`No research tree for industry '${division.type}'`);\n const allResearch = researchTree.getAllNodes();\n if (!allResearch.includes(researchName)) throw new Error(`No research named '${researchName}'`);\n const research = ResearchMap[researchName];\n\n if (division.sciResearch.qty < research.cost)\n throw new Error(`You do not have enough Scientific Research for ${research.name}`);\n division.sciResearch.qty -= research.cost;\n\n // Get the Node from the Research Tree and set its 'researched' property\n researchTree.research(researchName);\n division.researched[researchName] = true;\n}\n\nexport function ExportMaterial(divisionName: string, cityName: string, material: Material, amt: string): void {\n // Sanitize amt\n let sanitizedAmt = amt.replace(/\\s+/g, \"\").toUpperCase();\n sanitizedAmt = sanitizedAmt.replace(/[^-()\\d/*+.MAX]/g, \"\");\n let temp = sanitizedAmt.replace(/MAX/g, \"1\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid expression entered for export amount: \" + e);\n }\n\n const n = parseFloat(temp);\n\n if (n == null || isNaN(n) || n < 0) {\n throw new Error(\"Invalid amount entered for export\");\n }\n const exportObj = { ind: divisionName, city: cityName, amt: sanitizedAmt };\n material.exp.push(exportObj);\n}\n\nexport function CancelExportMaterial(divisionName: string, cityName: string, material: Material, amt: string): void {\n for (let i = 0; i < material.exp.length; ++i) {\n if (material.exp[i].ind !== divisionName || material.exp[i].city !== cityName || material.exp[i].amt !== amt)\n continue;\n material.exp.splice(i, 1);\n break;\n }\n}\n\nexport function LimitProductProduction(product: Product, cityName: string, qty: number): void {\n if (qty < 0 || isNaN(qty)) {\n product.prdman[cityName][0] = false;\n } else {\n product.prdman[cityName][0] = true;\n product.prdman[cityName][1] = qty;\n }\n}\n\nexport function SetMaterialMarketTA1(material: Material, on: boolean): void {\n material.marketTa1 = on;\n}\n\nexport function SetMaterialMarketTA2(material: Material, on: boolean): void {\n material.marketTa2 = on;\n}\n\nexport function SetProductMarketTA1(product: Product, on: boolean): void {\n product.marketTa1 = on;\n}\n\nexport function SetProductMarketTA2(product: Product, on: boolean): void {\n product.marketTa2 = on;\n}\n","import { Reviver } from \"../utils/JSONReviver\";\n\ninterface GangTerritory {\n power: number;\n territory: number;\n}\n\nexport let AllGangs: {\n [key: string]: GangTerritory;\n} = {\n \"Slum Snakes\": {\n power: 1,\n territory: 1 / 7,\n },\n Tetrads: {\n power: 1,\n territory: 1 / 7,\n },\n \"The Syndicate\": {\n power: 1,\n territory: 1 / 7,\n },\n \"The Dark Army\": {\n power: 1,\n territory: 1 / 7,\n },\n \"Speakers for the Dead\": {\n power: 1,\n territory: 1 / 7,\n },\n NiteSec: {\n power: 1,\n territory: 1 / 7,\n },\n \"The Black Hand\": {\n power: 1,\n territory: 1 / 7,\n },\n};\n\nexport function resetGangs(): void {\n AllGangs = {\n \"Slum Snakes\": {\n power: 1,\n territory: 1 / 7,\n },\n Tetrads: {\n power: 1,\n territory: 1 / 7,\n },\n \"The Syndicate\": {\n power: 1,\n territory: 1 / 7,\n },\n \"The Dark Army\": {\n power: 1,\n territory: 1 / 7,\n },\n \"Speakers for the Dead\": {\n power: 1,\n territory: 1 / 7,\n },\n NiteSec: {\n power: 1,\n territory: 1 / 7,\n },\n \"The Black Hand\": {\n power: 1,\n territory: 1 / 7,\n },\n };\n}\n\nexport function loadAllGangs(saveString: string): void {\n AllGangs = JSON.parse(saveString, Reviver);\n}\n","export enum PositionTypes {\n Long = \"L\",\n Short = \"S\",\n}\n","export enum FragmentType {\n // Special fragments for the UI\n None,\n Delete,\n\n // Stats boosting fragments\n HackingChance,\n HackingSpeed,\n HackingMoney,\n HackingGrow,\n Hacking,\n Strength,\n Defense,\n Dexterity,\n Agility,\n Charisma,\n HacknetMoney,\n HacknetCost,\n Rep,\n WorkMoney,\n Crime,\n Bladeburner,\n\n // utility fragments.\n Booster,\n}\n\nexport function Effect(tpe: FragmentType): string {\n switch (tpe) {\n case FragmentType.HackingChance: {\n return \"+x% hack() success chance\";\n break;\n }\n case FragmentType.HackingSpeed: {\n return \"+x% faster hack(), grow(), and weaken()\";\n break;\n }\n case FragmentType.HackingMoney: {\n return \"+x% hack() power\";\n break;\n }\n case FragmentType.HackingGrow: {\n return \"+x% grow() power\";\n break;\n }\n case FragmentType.Hacking: {\n return \"+x% hacking skill\";\n break;\n }\n case FragmentType.Strength: {\n return \"+x% strength skill\";\n break;\n }\n case FragmentType.Defense: {\n return \"+x% defense skill\";\n break;\n }\n case FragmentType.Dexterity: {\n return \"+x% dexterity skill\";\n break;\n }\n case FragmentType.Agility: {\n return \"+x% agility skill\";\n break;\n }\n case FragmentType.Charisma: {\n return \"+x% charisma skill\";\n break;\n }\n case FragmentType.HacknetMoney: {\n return \"+x% hacknet production\";\n break;\n }\n case FragmentType.HacknetCost: {\n return \"x% cheaper hacknet cost\";\n break;\n }\n case FragmentType.Rep: {\n return \"+x% reputation from factions and companies\";\n break;\n }\n case FragmentType.WorkMoney: {\n return \"+x% work money\";\n break;\n }\n case FragmentType.Crime: {\n return \"+x% crime money\";\n break;\n }\n case FragmentType.Bladeburner: {\n return \"+x% all bladeburner stats\";\n break;\n }\n }\n throw new Error(\"Calling effect for fragment type that doesn't have an effect \" + tpe);\n}\n","/**\n * Enum for different types of tasks that a Sleeve can perform\n */\nexport enum SleeveTaskType {\n // Same Order as selectable order in UI\n Idle,\n Company,\n Faction,\n Crime,\n Class,\n Gym,\n Recovery,\n Synchro,\n}\n","// Contains an array containing information about the player's source files\n// Array[n] returns what level the player has of Source-File N.\n\nimport { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nexport const SourceFileFlags: number[] = Array(CONSTANTS.TotalNumBitNodes + 1); // Skip index 0\n\nexport function updateSourceFileFlags(p: IPlayer): void {\n for (let i = 0; i < SourceFileFlags.length; ++i) {\n SourceFileFlags[i] = 0;\n }\n\n for (let i = 0; i < p.sourceFiles.length; ++i) {\n const sf = p.sourceFiles[i];\n SourceFileFlags[sf.n] = sf.lvl;\n }\n}\n","/**\n * Helper functions that implement \"directory\" functionality in the Terminal.\n * These aren't \"real\" directories, it's more of a pseudo-directory implementation\n * that uses mainly string manipulation.\n *\n * This file contains functions that deal only with that string manipulation.\n * Functions that need to access/process Server-related things can be\n * found in ./DirectoryServerHelpers.ts\n */\n\n/**\n * Removes leading forward slash (\"/\") from a string.\n */\nexport function removeLeadingSlash(s: string): string {\n if (s.startsWith(\"/\")) {\n return s.slice(1);\n }\n\n return s;\n}\n\n/**\n * Removes trailing forward slash (\"/\") from a string.\n * Note that this will also remove the slash if it is the leading slash (i.e. if s = \"/\")\n */\nexport function removeTrailingSlash(s: string): string {\n if (s.endsWith(\"/\")) {\n return s.slice(0, -1);\n }\n\n return s;\n}\n\n/**\n * Checks whether a string is a valid filename. Only used for the filename itself,\n * not the entire filepath\n */\nexport function isValidFilename(filename: string): boolean {\n // Allows alphanumerics, hyphens, underscores, and percentage signs\n // Must have a file extension\n const regex = /^[.a-zA-Z0-9_-]+[.][a-zA-Z0-9]+(?:-\\d+(?:\\.\\d*)?%-INC)?$/;\n\n // match() returns null if no match is found\n return filename.match(regex) != null;\n}\n\n/**\n * Checks whether a string is a valid directory name. Only used for the directory itself,\n * not an entire path\n */\nexport function isValidDirectoryName(name: string): boolean {\n // Allows alphanumerics, hyphens, underscores, and percentage signs.\n // Name can begin with a single period, but otherwise cannot have any\n const regex = /^.?[a-zA-Z0-9_-]+$/;\n\n // match() returns null if no match is found\n return name.match(regex) != null;\n}\n\n/**\n * Checks whether a string is a valid directory path.\n * This only checks if it has the proper formatting. It does NOT check\n * if the directories actually exist on Terminal\n */\nexport function isValidDirectoryPath(path: string): boolean {\n let t_path: string = path;\n\n if (t_path.length === 0) {\n return false;\n }\n if (t_path.length === 1) {\n return t_path === \"/\";\n }\n\n // A full path must have a leading slash, but we'll ignore it for the checks\n if (t_path.startsWith(\"/\")) {\n t_path = t_path.slice(1);\n } else {\n return false;\n }\n\n // Trailing slash does not matter\n t_path = removeTrailingSlash(t_path);\n\n // Check that every section of the path is a valid directory name\n const dirs = t_path.split(\"/\");\n for (const dir of dirs) {\n // Special case, \".\" and \"..\" are valid for path\n if (dir === \".\" || dir === \"..\") {\n continue;\n }\n if (!isValidDirectoryName(dir)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Checks whether a string is a valid file path. This only checks if it has the\n * proper formatting. It dose NOT check if the file actually exists on Terminal\n */\nexport function isValidFilePath(path: string): boolean {\n if (path == null || typeof path !== \"string\") {\n return false;\n }\n const t_path = path;\n\n // Impossible for filename to have less than length of 3\n if (t_path.length < 3) {\n return false;\n }\n\n // Full filepath can't end with trailing slash because it must be a file\n if (t_path.endsWith(\"/\")) {\n return false;\n }\n\n // Everything after the last forward slash is the filename. Everything before\n // it is the file path\n const fnSeparator = t_path.lastIndexOf(\"/\");\n if (fnSeparator === -1) {\n return isValidFilename(t_path);\n }\n\n const fn = t_path.slice(fnSeparator + 1);\n const dirPath = t_path.slice(0, fnSeparator + 1);\n\n return isValidDirectoryPath(dirPath) && isValidFilename(fn);\n}\n\n/**\n * Returns a formatted string for the first parent directory in a filepath. For example:\n * /home/var/test/ -> home/\n * If there is no first parent directory, then it returns \"/\" for root\n */\nexport function getFirstParentDirectory(path: string): string {\n let t_path = path;\n t_path = removeLeadingSlash(t_path);\n t_path = removeTrailingSlash(t_path);\n\n if (t_path.lastIndexOf(\"/\") === -1) {\n return \"/\";\n }\n\n const dirs = t_path.split(\"/\");\n if (dirs.length === 0) {\n return \"/\";\n }\n\n return dirs[0] + \"/\";\n}\n\n/**\n * Given a filepath, returns a formatted string for all of the parent directories\n * in that filepath. For example:\n * /home/var/tes -> home/var/\n * /home/var/test/ -> home/var/test/\n * If there are no parent directories, it returns the empty string\n */\nexport function getAllParentDirectories(path: string): string {\n const t_path = path;\n const lastSlash = t_path.lastIndexOf(\"/\");\n if (lastSlash === -1) {\n return \"\";\n }\n\n return t_path.slice(0, lastSlash + 1);\n}\n\n/**\n * Given a destination that only contains a directory part, returns the\n * path to the source filename inside the new destination directory.\n * Otherwise, returns the path to the destination file.\n * @param destination The destination path or file name\n * @param source The source path\n * @param cwd The current working directory\n * @returns A file path which may be absolute or relative\n */\nexport function getDestinationFilepath(destination: string, source: string, cwd: string): string {\n const dstDir = evaluateDirectoryPath(destination, cwd);\n // If evaluating the directory for this destination fails, we have a filename or full path.\n if (dstDir === null) {\n return destination;\n } else {\n // Append the filename to the directory provided.\n const t_path = removeTrailingSlash(dstDir);\n const fileName = getFileName(source);\n return t_path + \"/\" + fileName;\n }\n}\n\n/**\n * Given a filepath, returns the file name (e.g. without directory parts)\n * For example:\n * /home/var/test.js -> test.js\n * ./var/test.js -> test.js\n * test.js -> test.js\n */\nexport function getFileName(path: string): string {\n const t_path = path;\n const lastSlash = t_path.lastIndexOf(\"/\");\n if (lastSlash === -1) {\n return t_path;\n }\n\n return t_path.slice(lastSlash + 1);\n}\n\n/**\n * Checks if a file path refers to a file in the root directory.\n */\nexport function isInRootDirectory(path: string): boolean {\n if (!isValidFilePath(path)) {\n return false;\n }\n if (path == null || path.length === 0) {\n return false;\n }\n\n return path.lastIndexOf(\"/\") <= 0;\n}\n\n/**\n * Evaluates a directory path, including the processing of linux dots.\n * Returns the full, proper path, or null if an invalid path is passed in\n */\nexport function evaluateDirectoryPath(path: string, currPath?: string): string | null {\n let t_path = path;\n\n // If the path begins with a slash, then its an absolute path. Otherwise its relative\n // For relative paths, we need to prepend the current directory\n if (!t_path.startsWith(\"/\") && currPath != null) {\n t_path = currPath + (currPath.endsWith(\"/\") ? \"\" : \"/\") + t_path;\n }\n\n if (!isValidDirectoryPath(t_path)) {\n return null;\n }\n\n // Trim leading/trailing slashes\n t_path = removeLeadingSlash(t_path);\n t_path = removeTrailingSlash(t_path);\n\n const dirs = t_path.split(\"/\");\n const reconstructedPath: string[] = [];\n\n for (const dir of dirs) {\n if (dir === \".\") {\n // Current directory, do nothing\n continue;\n } else if (dir === \"..\") {\n // Parent directory\n const res = reconstructedPath.pop();\n if (res == null) {\n return null; // Array was empty, invalid path\n }\n } else {\n reconstructedPath.push(dir);\n }\n }\n\n return \"/\" + reconstructedPath.join(\"/\");\n}\n\n/**\n * Evaluates a file path, including the processing of linux dots.\n * Returns the full, proper path, or null if an invalid path is passed in\n */\nexport function evaluateFilePath(path: string, currPath?: string): string | null {\n let t_path = path;\n\n // If the path begins with a slash, then its an absolute path. Otherwise its relative\n // For relative paths, we need to prepend the current directory\n if (!t_path.startsWith(\"/\") && currPath != null) {\n t_path = currPath + (currPath.endsWith(\"/\") ? \"\" : \"/\") + t_path;\n }\n\n if (!isValidFilePath(t_path)) {\n return null;\n }\n\n // Trim leading/trailing slashes\n t_path = removeLeadingSlash(t_path);\n\n const dirs = t_path.split(\"/\");\n const reconstructedPath: string[] = [];\n\n for (const dir of dirs) {\n if (dir === \".\") {\n // Current directory, do nothing\n continue;\n } else if (dir === \"..\") {\n // Parent directory\n const res = reconstructedPath.pop();\n if (res == null) {\n return null; // Array was empty, invalid path\n }\n } else {\n reconstructedPath.push(dir);\n }\n }\n\n return \"/\" + reconstructedPath.join(\"/\");\n}\n\nexport function areFilesEqual(f0: string, f1: string): boolean {\n if (!f0.startsWith(\"/\")) f0 = \"/\" + f0;\n if (!f1.startsWith(\"/\")) f1 = \"/\" + f1;\n return f0 === f1;\n}\n\nexport function areImportsEquals(f0: string, f1: string): boolean {\n if (!f0.endsWith(\".ns\") && !f0.endsWith(\".js\")) f0 = f0 + \".js\";\n if (!f1.endsWith(\".ns\") && !f1.endsWith(\".js\")) f1 = f1 + \".js\";\n return areFilesEqual(f0, f1);\n}\n","import { Crime } from \"./Crime\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { IMap } from \"../types\";\n\nexport const Crimes: IMap<Crime> = {\n Shoplift: new Crime(\"Shoplift\", CONSTANTS.CrimeShoplift, 2e3, 15e3, 1 / 20, 0.1, {\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n dexterity_exp: 2,\n agility_exp: 2,\n }),\n\n RobStore: new Crime(\"Rob Store\", CONSTANTS.CrimeRobStore, 60e3, 400e3, 1 / 5, 0.5, {\n hacking_exp: 30,\n dexterity_exp: 45,\n agility_exp: 45,\n\n hacking_success_weight: 0.5,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n\n intelligence_exp: 7.5 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Mug: new Crime(\"Mug\", CONSTANTS.CrimeMug, 4e3, 36e3, 1 / 5, 0.25, {\n strength_exp: 3,\n defense_exp: 3,\n dexterity_exp: 3,\n agility_exp: 3,\n\n strength_success_weight: 1.5,\n defense_success_weight: 0.5,\n dexterity_success_weight: 1.5,\n agility_success_weight: 0.5,\n }),\n\n Larceny: new Crime(\"Larceny\", CONSTANTS.CrimeLarceny, 90e3, 800e3, 1 / 3, 1.5, {\n hacking_exp: 45,\n dexterity_exp: 60,\n agility_exp: 60,\n\n hacking_success_weight: 0.5,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n intelligence_exp: 15 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n DealDrugs: new Crime(\"Deal Drugs\", CONSTANTS.CrimeDrugs, 10e3, 120e3, 1, 0.5, {\n dexterity_exp: 5,\n agility_exp: 5,\n charisma_exp: 10,\n\n charisma_success_weight: 3,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n }),\n\n BondForgery: new Crime(\"Bond Forgery\", CONSTANTS.CrimeBondForgery, 300e3, 4.5e6, 1 / 2, 0.1, {\n hacking_exp: 100,\n dexterity_exp: 150,\n charisma_exp: 15,\n\n hacking_success_weight: 0.05,\n dexterity_success_weight: 1.25,\n\n intelligence_exp: 60 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n TraffickArms: new Crime(\"Traffick Arms\", CONSTANTS.CrimeTraffickArms, 40e3, 600e3, 2, 1, {\n strength_exp: 20,\n defense_exp: 20,\n dexterity_exp: 20,\n agility_exp: 20,\n charisma_exp: 40,\n\n charisma_success_weight: 1,\n strength_success_weight: 1,\n defense_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n }),\n\n Homicide: new Crime(\"Homicide\", CONSTANTS.CrimeHomicide, 3e3, 45e3, 1, 3, {\n strength_exp: 2,\n defense_exp: 2,\n dexterity_exp: 2,\n agility_exp: 2,\n\n strength_success_weight: 2,\n defense_success_weight: 2,\n dexterity_success_weight: 0.5,\n agility_success_weight: 0.5,\n\n kills: 1,\n }),\n\n GrandTheftAuto: new Crime(\"Grand Theft Auto\", CONSTANTS.CrimeGrandTheftAuto, 80e3, 1.6e6, 8, 5, {\n strength_exp: 20,\n defense_exp: 20,\n dexterity_exp: 20,\n agility_exp: 80,\n charisma_exp: 40,\n\n hacking_success_weight: 1,\n strength_success_weight: 1,\n dexterity_success_weight: 4,\n agility_success_weight: 2,\n charisma_success_weight: 2,\n\n intelligence_exp: 16 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Kidnap: new Crime(\"Kidnap\", CONSTANTS.CrimeKidnap, 120e3, 3.6e6, 5, 6, {\n strength_exp: 80,\n defense_exp: 80,\n dexterity_exp: 80,\n agility_exp: 80,\n charisma_exp: 80,\n\n charisma_success_weight: 1,\n strength_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n intelligence_exp: 26 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Assassination: new Crime(\"Assassination\", CONSTANTS.CrimeAssassination, 300e3, 12e6, 8, 10, {\n strength_exp: 300,\n defense_exp: 300,\n dexterity_exp: 300,\n agility_exp: 300,\n\n strength_success_weight: 1,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n\n intelligence_exp: 65 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n\n kills: 1,\n }),\n\n Heist: new Crime(\"Heist\", CONSTANTS.CrimeHeist, 600e3, 120e6, 18, 15, {\n hacking_exp: 450,\n strength_exp: 450,\n defense_exp: 450,\n dexterity_exp: 450,\n agility_exp: 450,\n charisma_exp: 450,\n\n hacking_success_weight: 1,\n strength_success_weight: 1,\n defense_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n charisma_success_weight: 1,\n\n intelligence_exp: 130 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n};\n","import * as React from \"react\";\n\nexport function trusted(f: () => void): (event: React.MouseEvent<HTMLElement, MouseEvent>) => any {\n return function (event: React.MouseEvent<HTMLElement, MouseEvent>): any {\n if (!event.isTrusted) return;\n f();\n };\n}\n","import { Terminal as TTerminal } from \"./Terminal/Terminal\";\n\nexport const Terminal = new TTerminal();\n","/**\n * Hacknet Servers - Reworked Hacknet Node mechanic for BitNode-9\n */\nimport { CONSTANTS } from \"../Constants\";\n\nimport { IHacknetNode } from \"./IHacknetNode\";\n\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { HacknetServerConstants } from \"./data/Constants\";\nimport {\n calculateHashGainRate,\n calculateLevelUpgradeCost,\n calculateRamUpgradeCost,\n calculateCoreUpgradeCost,\n calculateCacheUpgradeCost,\n} from \"./formulas/HacknetServers\";\n\nimport { createRandomIp } from \"../utils/IPAddress\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\ninterface IConstructorParams {\n adminRights?: boolean;\n hostname: string;\n ip?: string;\n isConnectedTo?: boolean;\n maxRam?: number;\n organizationName?: string;\n}\n\nexport class HacknetServer extends BaseServer implements IHacknetNode {\n // Cache level. Affects hash Capacity\n cache = 1;\n\n // Number of cores. Improves hash production\n cores = 1;\n\n // Number of hashes that can be stored by this Hacknet Server\n hashCapacity = 0;\n\n // Hashes produced per second\n hashRate = 0;\n\n // Similar to Node level. Improves hash production\n level = 1;\n\n // How long this HacknetServer has existed, in seconds\n onlineTimeSeconds = 0;\n\n // Total number of hashes earned by this server\n totalHashesGenerated = 0;\n\n // Flag indicating wehther this is a purchased server\n purchasedByPlayer = true;\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n super(params);\n\n this.maxRam = 1;\n this.updateHashCapacity();\n }\n\n calculateCacheUpgradeCost(levels: number): number {\n return calculateCacheUpgradeCost(this.cache, levels);\n }\n\n calculateCoreUpgradeCost(levels: number, costMult: number): number {\n return calculateCoreUpgradeCost(this.cores, levels, costMult);\n }\n\n calculateLevelUpgradeCost(levels: number, costMult: number): number {\n return calculateLevelUpgradeCost(this.level, levels, costMult);\n }\n\n calculateRamUpgradeCost(levels: number, costMult: number): number {\n return calculateRamUpgradeCost(this.maxRam, levels, costMult);\n }\n\n // Process this Hacknet Server in the game loop. Returns the number of hashes generated\n process(numCycles = 1): number {\n const seconds = (numCycles * CONSTANTS.MilliPerCycle) / 1000;\n this.onlineTimeSeconds += seconds;\n\n const hashes = this.hashRate * seconds;\n this.totalHashesGenerated += hashes;\n\n return hashes;\n }\n\n upgradeCache(levels: number): void {\n this.cache = Math.min(HacknetServerConstants.MaxCache, Math.round(this.cache + levels));\n this.updateHashCapacity();\n }\n\n upgradeCore(levels: number, prodMult: number): void {\n this.cores = Math.min(HacknetServerConstants.MaxCores, Math.round(this.cores + levels));\n this.updateHashRate(prodMult);\n this.cpuCores = this.cores;\n }\n\n upgradeLevel(levels: number, prodMult: number): void {\n this.level = Math.min(HacknetServerConstants.MaxLevel, Math.round(this.level + levels));\n this.updateHashRate(prodMult);\n }\n\n upgradeRam(levels: number, prodMult: number): boolean {\n for (let i = 0; i < levels; ++i) {\n this.maxRam *= 2;\n }\n this.maxRam = Math.min(HacknetServerConstants.MaxRam, Math.round(this.maxRam));\n this.updateHashRate(prodMult);\n\n return true;\n }\n\n // Whenever a script is run, we must update this server's hash rate\n runScript(script: RunningScript, prodMult?: number): void {\n super.runScript(script);\n if (prodMult != null && typeof prodMult === \"number\") {\n this.updateHashRate(prodMult);\n }\n }\n\n updateRamUsed(ram: number, player: IPlayer): void {\n super.updateRamUsed(ram, player);\n this.updateHashRate(player.hacknet_node_money_mult);\n }\n\n updateHashCapacity(): void {\n this.hashCapacity = 32 * Math.pow(2, this.cache);\n }\n\n updateHashRate(prodMult: number): void {\n this.hashRate = calculateHashGainRate(this.level, this.ramUsed, this.maxRam, this.cores, prodMult);\n\n if (isNaN(this.hashRate)) {\n this.hashRate = 0;\n console.error(\n `Error calculating Hacknet Server hash production. This is a bug. Please report to game dev`,\n false,\n );\n }\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): any {\n return Generic_toJSON(\"HacknetServer\", this);\n }\n\n // Initializes a HacknetServer Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): HacknetServer {\n return Generic_fromJSON(HacknetServer, value.data);\n }\n}\n\nReviver.constructors.HacknetServer = HacknetServer;\n","// Constructs all CompanyPosition objects using the metadata in data/companypositions.ts\nimport { companyPositionMetadata } from \"./data/CompanyPositionsMetadata\";\nimport { CompanyPosition, IConstructorParams } from \"./CompanyPosition\";\nimport { IMap } from \"../types\";\n\nexport const CompanyPositions: IMap<CompanyPosition> = {};\n\nfunction addCompanyPosition(params: IConstructorParams): void {\n if (CompanyPositions[params.name] != null) {\n console.warn(`Duplicate Company Position being defined: ${params.name}`);\n }\n CompanyPositions[params.name] = new CompanyPosition(params);\n}\n\ncompanyPositionMetadata.forEach((e) => {\n addCompanyPosition(e);\n});\n","import { IMap } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nexport const StockSymbols: IMap<string> = {};\n\n// Stocks for companies at which you can work\nStockSymbols[LocationName.AevumECorp] = \"ECP\";\nStockSymbols[LocationName.Sector12MegaCorp] = \"MGCP\";\nStockSymbols[LocationName.Sector12BladeIndustries] = \"BLD\";\nStockSymbols[LocationName.AevumClarkeIncorporated] = \"CLRK\";\nStockSymbols[LocationName.VolhavenOmniTekIncorporated] = \"OMTK\";\nStockSymbols[LocationName.Sector12FourSigma] = \"FSIG\";\nStockSymbols[LocationName.ChongqingKuaiGongInternational] = \"KGI\";\nStockSymbols[LocationName.AevumFulcrumTechnologies] = \"FLCM\";\nStockSymbols[LocationName.IshimaStormTechnologies] = \"STM\";\nStockSymbols[LocationName.NewTokyoDefComm] = \"DCOMM\";\nStockSymbols[LocationName.VolhavenHeliosLabs] = \"HLS\";\nStockSymbols[LocationName.NewTokyoVitaLife] = \"VITA\";\nStockSymbols[LocationName.Sector12IcarusMicrosystems] = \"ICRS\";\nStockSymbols[LocationName.Sector12UniversalEnergy] = \"UNV\";\nStockSymbols[LocationName.AevumAeroCorp] = \"AERO\";\nStockSymbols[LocationName.VolhavenOmniaCybersystems] = \"OMN\";\nStockSymbols[LocationName.ChongqingSolarisSpaceSystems] = \"SLRS\";\nStockSymbols[LocationName.NewTokyoGlobalPharmaceuticals] = \"GPH\";\nStockSymbols[LocationName.IshimaNovaMedical] = \"NVMD\";\nStockSymbols[LocationName.AevumWatchdogSecurity] = \"WDS\";\nStockSymbols[LocationName.VolhavenLexoCorp] = \"LXO\";\nStockSymbols[LocationName.AevumRhoConstruction] = \"RHOC\";\nStockSymbols[LocationName.Sector12AlphaEnterprises] = \"APHE\";\nStockSymbols[LocationName.VolhavenSysCoreSecurities] = \"SYSC\";\nStockSymbols[LocationName.VolhavenCompuTek] = \"CTK\";\nStockSymbols[LocationName.AevumNetLinkTechnologies] = \"NTLK\";\nStockSymbols[LocationName.IshimaOmegaSoftware] = \"OMGA\";\nStockSymbols[LocationName.Sector12FoodNStuff] = \"FNS\";\nStockSymbols[LocationName.Sector12JoesGuns] = \"JGN\";\n\n// Stocks for other companies\nStockSymbols[\"Sigma Cosmetics\"] = \"SGC\";\nStockSymbols[\"Catalyst Ventures\"] = \"CTYS\";\nStockSymbols[\"Microdyne Technologies\"] = \"MDYN\";\nStockSymbols[\"Titan Laboratories\"] = \"TITN\";\n","export const validScriptExtensions: Array<string> = [`.js`, `.script`, `.ns`];\n\nexport function isScriptFilename(f: string): boolean {\n return validScriptExtensions.some((ext) => f.endsWith(ext));\n}\n","import { BitNodeMultipliers } from \"./BitNode/BitNodeMultipliers\";\nimport { IPlayer } from \"./PersonObjects/IPlayer\";\nimport { calculateIntelligenceBonus } from \"./PersonObjects/formulas/intelligence\";\nimport { Server } from \"./Server/Server\";\n\n/**\n * Returns the chance the player has to successfully hack a server\n */\nexport function calculateHackingChance(server: Server, player: IPlayer): number {\n const hackFactor = 1.75;\n const difficultyMult = (100 - server.hackDifficulty) / 100;\n const skillMult = hackFactor * player.hacking;\n const skillChance = (skillMult - server.requiredHackingSkill) / skillMult;\n const chance =\n skillChance * difficultyMult * player.hacking_chance_mult * calculateIntelligenceBonus(player.intelligence, 1);\n if (chance > 1) {\n return 1;\n }\n if (chance < 0) {\n return 0;\n }\n\n return chance;\n}\n\n/**\n * Returns the amount of hacking experience the player will gain upon\n * successfully hacking a server\n */\nexport function calculateHackingExpGain(server: Server, player: IPlayer): number {\n const baseExpGain = 3;\n const diffFactor = 0.3;\n if (server.baseDifficulty == null) {\n server.baseDifficulty = server.hackDifficulty;\n }\n let expGain = baseExpGain;\n expGain += server.baseDifficulty * diffFactor;\n\n return expGain * player.hacking_exp_mult * BitNodeMultipliers.HackExpGain;\n}\n\n/**\n * Returns the percentage of money that will be stolen from a server if\n * it is successfully hacked (returns the decimal form, not the actual percent value)\n */\nexport function calculatePercentMoneyHacked(server: Server, player: IPlayer): number {\n // Adjust if needed for balancing. This is the divisor for the final calculation\n const balanceFactor = 240;\n\n const difficultyMult = (100 - server.hackDifficulty) / 100;\n const skillMult = (player.hacking - (server.requiredHackingSkill - 1)) / player.hacking;\n const percentMoneyHacked = (difficultyMult * skillMult * player.hacking_money_mult * BitNodeMultipliers.ScriptHackMoney) / balanceFactor;\n if (percentMoneyHacked < 0) {\n return 0;\n }\n if (percentMoneyHacked > 1) {\n return 1;\n }\n\n return percentMoneyHacked;\n}\n\n/**\n * Returns time it takes to complete a hack on a server, in seconds\n */\nexport function calculateHackingTime(server: Server, player: IPlayer): number {\n const difficultyMult = server.requiredHackingSkill * server.hackDifficulty;\n\n const baseDiff = 500;\n const baseSkill = 50;\n const diffFactor = 2.5;\n let skillFactor = diffFactor * difficultyMult + baseDiff;\n // tslint:disable-next-line\n skillFactor /= player.hacking + baseSkill;\n\n const hackTimeMultiplier = 5;\n const hackingTime =\n (hackTimeMultiplier * skillFactor) /\n (player.hacking_speed_mult * calculateIntelligenceBonus(player.intelligence, 1));\n\n return hackingTime;\n}\n\n/**\n * Returns time it takes to complete a grow operation on a server, in seconds\n */\nexport function calculateGrowTime(server: Server, player: IPlayer): number {\n const growTimeMultiplier = 3.2; // Relative to hacking time. 16/5 = 3.2\n\n return growTimeMultiplier * calculateHackingTime(server, player);\n}\n\n/**\n * Returns time it takes to complete a weaken operation on a server, in seconds\n */\nexport function calculateWeakenTime(server: Server, player: IPlayer): number {\n const weakenTimeMultiplier = 4; // Relative to hacking time\n\n return weakenTimeMultiplier * calculateHackingTime(server, player);\n}\n","import { IOrderBook } from \"./IOrderBook\";\nimport { IStockMarket } from \"./IStockMarket\";\nimport { Order } from \"./Order\";\nimport { processOrders } from \"./OrderProcessing\";\nimport { Stock } from \"./Stock\";\nimport { TicksPerCycle } from \"./StockMarketConstants\";\nimport { InitStockMetadata } from \"./data/InitStockMetadata\";\nimport { OrderTypes } from \"./data/OrderTypes\";\nimport { PositionTypes } from \"./data/PositionTypes\";\nimport { StockSymbols } from \"./data/StockSymbols\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IMap } from \"../types\";\nimport { EventEmitter } from \"../utils/EventEmitter\";\n\nimport { numeralWrapper } from \".././ui/numeralFormat\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver } from \"../utils/JSONReviver\";\n\nexport let StockMarket: IStockMarket = {\n lastUpdate: 0,\n Orders: {},\n storedCycles: 0,\n ticksUntilCycle: 0,\n} as IStockMarket; // Maps full stock name -> Stock object\nexport const SymbolToStockMap: IMap<Stock> = {}; // Maps symbol -> Stock object\n\nexport function placeOrder(\n stock: Stock,\n shares: number,\n price: number,\n type: OrderTypes,\n position: PositionTypes,\n workerScript: WorkerScript | null = null,\n): boolean {\n if (!(stock instanceof Stock)) {\n if (workerScript) {\n workerScript.log(\"stock.placeOrder\", () => `Invalid stock: '${stock}'`);\n } else {\n dialogBoxCreate(`ERROR: Invalid stock passed to placeOrder() function`);\n }\n return false;\n }\n if (typeof shares !== \"number\" || typeof price !== \"number\") {\n if (workerScript) {\n workerScript.log(\"stock.placeOrder\", () => `Invalid arguments: shares='${shares}' price='${price}'`);\n } else {\n dialogBoxCreate(\"ERROR: Invalid numeric value provided for either 'shares' or 'price' argument\");\n }\n return false;\n }\n\n const order = new Order(stock.symbol, shares, price, type, position);\n if (StockMarket[\"Orders\"] == null) {\n const orders: IOrderBook = {};\n for (const name of Object.keys(StockMarket)) {\n const stk = StockMarket[name];\n if (!(stk instanceof Stock)) {\n continue;\n }\n orders[stk.symbol] = [];\n }\n StockMarket[\"Orders\"] = orders;\n }\n StockMarket[\"Orders\"][stock.symbol].push(order);\n\n // Process to see if it should be executed immediately\n const processOrderRefs = {\n stockMarket: StockMarket as IStockMarket,\n symbolToStockMap: SymbolToStockMap,\n };\n processOrders(stock, order.type, order.pos, processOrderRefs);\n\n return true;\n}\n\n// Returns true if successfully cancels an order, false otherwise\ninterface ICancelOrderParams {\n order?: Order;\n pos?: PositionTypes;\n price?: number;\n shares?: number;\n stock?: Stock;\n type?: OrderTypes;\n}\nexport function cancelOrder(params: ICancelOrderParams, workerScript: WorkerScript | null = null): boolean {\n if (StockMarket[\"Orders\"] == null) {\n return false;\n }\n if (params.order && params.order instanceof Order) {\n const order = params.order;\n // An 'Order' object is passed in\n const stockOrders = StockMarket[\"Orders\"][order.stockSymbol];\n for (let i = 0; i < stockOrders.length; ++i) {\n if (order == stockOrders[i]) {\n stockOrders.splice(i, 1);\n return true;\n }\n }\n return false;\n } else if (\n params.stock &&\n params.shares &&\n params.price &&\n params.type &&\n params.pos &&\n params.stock instanceof Stock\n ) {\n // Order properties are passed in. Need to look for the order\n const stockOrders = StockMarket[\"Orders\"][params.stock.symbol];\n const orderTxt = params.stock.symbol + \" - \" + params.shares + \" @ \" + numeralWrapper.formatMoney(params.price);\n for (let i = 0; i < stockOrders.length; ++i) {\n const order = stockOrders[i];\n if (\n params.shares === order.shares &&\n params.price === order.price &&\n params.type === order.type &&\n params.pos === order.pos\n ) {\n stockOrders.splice(i, 1);\n if (workerScript) {\n workerScript.scriptRef.log(\"Successfully cancelled order: \" + orderTxt);\n }\n return true;\n }\n }\n if (workerScript) {\n workerScript.scriptRef.log(\"Failed to cancel order: \" + orderTxt);\n }\n return false;\n }\n return false;\n}\n\nexport function loadStockMarket(saveString: string): void {\n if (saveString === \"\") {\n StockMarket = {\n lastUpdate: 0,\n Orders: {},\n storedCycles: 0,\n ticksUntilCycle: 0,\n } as IStockMarket;\n } else {\n StockMarket = JSON.parse(saveString, Reviver);\n }\n}\n\nexport function deleteStockMarket(): void {\n StockMarket = {\n lastUpdate: 0,\n Orders: {},\n storedCycles: 0,\n ticksUntilCycle: 0,\n } as IStockMarket;\n}\n\nexport function initStockMarket(): void {\n for (const stk of Object.keys(StockMarket)) {\n if (StockMarket.hasOwnProperty(stk)) {\n delete StockMarket[stk];\n }\n }\n\n for (const metadata of InitStockMetadata) {\n const name = metadata.name;\n StockMarket[name] = new Stock(metadata);\n }\n\n const orders: IOrderBook = {};\n for (const name of Object.keys(StockMarket)) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) {\n continue;\n }\n orders[stock.symbol] = [];\n }\n StockMarket[\"Orders\"] = orders;\n\n StockMarket.storedCycles = 0;\n StockMarket.lastUpdate = 0;\n StockMarket.ticksUntilCycle = TicksPerCycle;\n}\n\nexport function initSymbolToStockMap(): void {\n for (const name of Object.keys(StockSymbols)) {\n if (StockSymbols.hasOwnProperty(name)) {\n const stock = StockMarket[name];\n if (stock == null) {\n console.error(`Could not find Stock for ${name}`);\n continue;\n }\n const symbol = StockSymbols[name];\n SymbolToStockMap[symbol] = stock;\n }\n }\n}\n\nfunction stockMarketCycle(): void {\n for (const name of Object.keys(StockMarket)) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) {\n continue;\n }\n\n const roll = Math.random();\n if (roll < 0.45) {\n stock.b = !stock.b;\n stock.flipForecastForecast();\n }\n\n StockMarket.ticksUntilCycle = TicksPerCycle;\n }\n}\n\n// Stock prices updated every 6 seconds\nconst msPerStockUpdate = 6e3;\nconst cyclesPerStockUpdate = msPerStockUpdate / CONSTANTS.MilliPerCycle;\nexport function processStockPrices(numCycles = 1): void {\n if (StockMarket.storedCycles == null || isNaN(StockMarket.storedCycles)) {\n StockMarket.storedCycles = 0;\n }\n StockMarket.storedCycles += numCycles;\n\n if (StockMarket.storedCycles < cyclesPerStockUpdate) {\n return;\n }\n\n // We can process the update every 4 seconds as long as there are enough\n // stored cycles. This lets us account for offline time\n const timeNow = new Date().getTime();\n if (timeNow - StockMarket.lastUpdate < 4e3) {\n return;\n }\n\n StockMarket.lastUpdate = timeNow;\n StockMarket.storedCycles -= cyclesPerStockUpdate;\n\n // Cycle\n if (StockMarket.ticksUntilCycle == null || typeof StockMarket.ticksUntilCycle !== \"number\") {\n StockMarket.ticksUntilCycle = TicksPerCycle;\n }\n --StockMarket.ticksUntilCycle;\n if (StockMarket.ticksUntilCycle <= 0) {\n stockMarketCycle();\n }\n\n const v = Math.random();\n for (const name of Object.keys(StockMarket)) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) {\n continue;\n }\n let av = (v * stock.mv) / 100;\n if (isNaN(av)) {\n av = 0.02;\n }\n\n let chc = 50;\n if (stock.b) {\n chc = (chc + stock.otlkMag) / 100;\n } else {\n chc = (chc - stock.otlkMag) / 100;\n }\n if (stock.price >= stock.cap) {\n chc = 0.1; // \"Soft Limit\" on stock price. It could still go up but its unlikely\n stock.b = false;\n }\n if (isNaN(chc)) {\n chc = 0.5;\n }\n\n const c = Math.random();\n const processOrderRefs = {\n stockMarket: StockMarket,\n symbolToStockMap: SymbolToStockMap,\n };\n if (c < chc) {\n stock.changePrice(stock.price * (1 + av));\n processOrders(stock, OrderTypes.LimitBuy, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.LimitSell, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.StopBuy, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.StopSell, PositionTypes.Short, processOrderRefs);\n } else {\n stock.changePrice(stock.price / (1 + av));\n processOrders(stock, OrderTypes.LimitBuy, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.LimitSell, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.StopBuy, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.StopSell, PositionTypes.Long, processOrderRefs);\n }\n\n let otlkMagChange = stock.otlkMag * av;\n if (stock.otlkMag < 5) {\n if (stock.otlkMag <= 1) {\n otlkMagChange = 1;\n } else {\n otlkMagChange *= 10;\n }\n }\n stock.cycleForecast(otlkMagChange);\n stock.cycleForecastForecast(otlkMagChange / 2);\n\n // Shares required for price movement gradually approaches max over time\n stock.shareTxUntilMovement = Math.min(stock.shareTxUntilMovement + 10, stock.shareTxForMovement);\n }\n}\n\nexport function initStockMarketFnForReact(): void {\n initStockMarket();\n initSymbolToStockMap();\n}\n\nexport const eventEmitterForUiReset = new EventEmitter<[]>();\n","import React, { useState, useEffect } from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IEngine } from \"../IEngine\";\nimport { ITerminal } from \"../Terminal/ITerminal\";\nimport { installAugmentations } from \"../Augmentation/AugmentationHelpers\";\nimport { saveObject } from \"../SaveObject\";\nimport { onExport } from \"../ExportBonus\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { Location } from \"../Locations/Location\";\nimport { Locations } from \"../Locations/Locations\";\nimport { ITutorial, iTutorialStart } from \"../InteractiveTutorial\";\nimport { InteractiveTutorialRoot } from \"./InteractiveTutorial/InteractiveTutorialRoot\";\nimport { ITutorialEvents } from \"./InteractiveTutorial/ITutorialEvents\";\n\nimport { Faction } from \"../Faction/Faction\";\nimport { prestigeAugmentation } from \"../Prestige\";\nimport { dialogBoxCreate } from \"./React/DialogBox\";\nimport { GetAllServers } from \"../Server/AllServers\";\nimport { Factions } from \"../Faction/Factions\";\nimport { buyStock, sellStock, shortStock, sellShort } from \"../StockMarket/BuyingAndSelling\";\nimport {\n cancelOrder,\n eventEmitterForUiReset,\n initStockMarketFnForReact,\n placeOrder,\n StockMarket,\n} from \"../StockMarket/StockMarket\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\n\nimport { Page, IRouter, ScriptEditorRouteOptions } from \"./Router\";\nimport { Overview } from \"./React/Overview\";\nimport { SidebarRoot } from \"../Sidebar/ui/SidebarRoot\";\nimport { AugmentationsRoot } from \"../Augmentation/ui/AugmentationsRoot\";\nimport { DevMenuRoot } from \"../DevMenu\";\nimport { BladeburnerRoot } from \"../Bladeburner/ui/BladeburnerRoot\";\nimport { GangRoot } from \"../Gang/ui/GangRoot\";\nimport { CorporationRoot } from \"../Corporation/ui/CorporationRoot\";\nimport { InfiltrationRoot } from \"../Infiltration/ui/InfiltrationRoot\";\nimport { ResleeveRoot } from \"../PersonObjects/Resleeving/ui/ResleeveRoot\";\nimport { WorkInProgressRoot } from \"./WorkInProgressRoot\";\nimport { GameOptionsRoot } from \"../ui/React/GameOptionsRoot\";\nimport { SleeveRoot } from \"../PersonObjects/Sleeve/ui/SleeveRoot\";\nimport { HacknetRoot } from \"../Hacknet/ui/HacknetRoot\";\nimport { GenericLocation } from \"../Locations/ui/GenericLocation\";\nimport { LocationCity } from \"../Locations/ui/City\";\nimport { ProgramsRoot } from \"../Programs/ui/ProgramsRoot\";\nimport { Root as ScriptEditorRoot } from \"../ScriptEditor/ui/ScriptEditorRoot\";\nimport { MilestonesRoot } from \"../Milestones/ui/MilestonesRoot\";\nimport { TerminalRoot } from \"../Terminal/ui/TerminalRoot\";\nimport { TutorialRoot } from \"../Tutorial/ui/TutorialRoot\";\nimport { ActiveScriptsRoot } from \"../ui/ActiveScripts/ActiveScriptsRoot\";\nimport { FactionsRoot } from \"../Faction/ui/FactionsRoot\";\nimport { FactionRoot } from \"../Faction/ui/FactionRoot\";\nimport { CharacterStats } from \"./CharacterStats\";\nimport { TravelAgencyRoot } from \"../Locations/ui/TravelAgencyRoot\";\nimport { StockMarketRoot } from \"../StockMarket/ui/StockMarketRoot\";\nimport { BitverseRoot } from \"../BitNode/ui/BitverseRoot\";\nimport { StaneksGiftRoot } from \"../CotMG/ui/StaneksGiftRoot\";\nimport { staneksGift } from \"../CotMG/Helper\";\nimport { CharacterOverview } from \"./React/CharacterOverview\";\nimport { BladeburnerCinematic } from \"../Bladeburner/ui/BladeburnerCinematic\";\nimport { workerScripts } from \"../Netscript/WorkerScripts\";\nimport { Unclickable } from \"../Exploits/Unclickable\";\nimport { Snackbar, SnackbarProvider } from \"./React/Snackbar\";\nimport { LogBoxManager } from \"./React/LogBoxManager\";\nimport { AlertManager } from \"./React/AlertManager\";\nimport { PromptManager } from \"./React/PromptManager\";\nimport { InvitationModal } from \"../Faction/ui/InvitationModal\";\nimport { calculateAchievements } from \"../Achievements/Achievements\";\n\nimport { enterBitNode } from \"../RedPill\";\nimport { Context } from \"./Context\";\nimport { RecoveryMode, RecoveryRoot } from \"./React/RecoveryRoot\";\nimport { AchievementsRoot } from \"../Achievements/AchievementsRoot\";\nimport { ErrorBoundary } from \"./ErrorBoundary\";\nimport { Settings } from \"../Settings/Settings\";\nimport { ThemeBrowser } from \"../Themes/ui/ThemeBrowser\";\nimport { ImportSaveRoot } from \"./React/ImportSaveRoot\";\nimport { BypassWrapper } from \"./React/BypassWrapper\";\n\nimport _wrap from \"lodash/wrap\";\nimport _functions from \"lodash/functions\";\n\nconst htmlLocation = location;\n\ninterface IProps {\n terminal: ITerminal;\n player: IPlayer;\n engine: IEngine;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n \"-ms-overflow-style\": \"none\" /* for Internet Explorer, Edge */,\n \"scrollbar-width\": \"none\" /* for Firefox */,\n margin: theme.spacing(0),\n flexGrow: 1,\n display: \"block\",\n padding: \"8px\",\n minHeight: \"100vh\",\n boxSizing: \"border-box\",\n },\n }),\n);\n\nexport let Router: IRouter = {\n page: () => {\n throw new Error(\"Router called before initialization\");\n },\n allowRouting: () => {\n throw new Error(\"Router called before initialization\");\n },\n toActiveScripts: () => {\n throw new Error(\"Router called before initialization\");\n },\n toAugmentations: () => {\n throw new Error(\"Router called before initialization\");\n },\n toBitVerse: () => {\n throw new Error(\"Router called before initialization\");\n },\n toBladeburner: () => {\n throw new Error(\"Router called before initialization\");\n },\n toStats: () => {\n throw new Error(\"Router called before initialization\");\n },\n toCity: () => {\n throw new Error(\"Router called before initialization\");\n },\n toCorporation: () => {\n throw new Error(\"Router called before initialization\");\n },\n toCreateProgram: () => {\n throw new Error(\"Router called before initialization\");\n },\n toDevMenu: () => {\n throw new Error(\"Router called before initialization\");\n },\n toFaction: () => {\n throw new Error(\"Router called before initialization\");\n },\n toFactions: () => {\n throw new Error(\"Router called before initialization\");\n },\n toGameOptions: () => {\n throw new Error(\"Router called before initialization\");\n },\n toGang: () => {\n throw new Error(\"Router called before initialization\");\n },\n toHacknetNodes: () => {\n throw new Error(\"Router called before initialization\");\n },\n toInfiltration: () => {\n throw new Error(\"Router called before initialization\");\n },\n toJob: () => {\n throw new Error(\"Router called before initialization\");\n },\n toMilestones: () => {\n throw new Error(\"Router called before initialization\");\n },\n toResleeves: () => {\n throw new Error(\"Router called before initialization\");\n },\n toScriptEditor: () => {\n throw new Error(\"Router called before initialization\");\n },\n toSleeves: () => {\n throw new Error(\"Router called before initialization\");\n },\n toStockMarket: () => {\n throw new Error(\"Router called before initialization\");\n },\n toTerminal: () => {\n throw new Error(\"Router called before initialization\");\n },\n toTravel: () => {\n throw new Error(\"Router called before initialization\");\n },\n toTutorial: () => {\n throw new Error(\"Router called before initialization\");\n },\n toWork: () => {\n throw new Error(\"Router called before initialization\");\n },\n toBladeburnerCinematic: () => {\n throw new Error(\"Router called before initialization\");\n },\n toLocation: () => {\n throw new Error(\"Router called before initialization\");\n },\n toStaneksGift: () => {\n throw new Error(\"Router called before initialization\");\n },\n toAchievements: () => {\n throw new Error(\"Router called before initialization\");\n },\n toThemeBrowser: () => {\n throw new Error(\"Router called before initialization\");\n },\n toImportSave: () => {\n throw new Error(\"Router called before initialization\");\n },\n};\n\nfunction determineStartPage(player: IPlayer): Page {\n if (RecoveryMode) return Page.Recovery;\n if (player.isWorking) return Page.Work;\n return Page.Terminal;\n}\n\nexport function GameRoot({ player, engine, terminal }: IProps): React.ReactElement {\n const classes = useStyles();\n const [{ files, vim }, setEditorOptions] = useState({ files: {}, vim: false });\n const [page, setPage] = useState(determineStartPage(player));\n const setRerender = useState(0)[1];\n const [faction, setFaction] = useState<Faction>(\n player.currentWorkFactionName ? Factions[player.currentWorkFactionName] : (undefined as unknown as Faction),\n );\n if (faction === undefined && page === Page.Faction)\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [flume, setFlume] = useState<boolean>(false);\n const [quick, setQuick] = useState<boolean>(false);\n const [location, setLocation] = useState<Location>(undefined as unknown as Location);\n if (location === undefined && (page === Page.Infiltration || page === Page.Location || page === Page.Job))\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [cinematicText, setCinematicText] = useState(\"\");\n const [errorBoundaryKey, setErrorBoundaryKey] = useState<number>(0);\n const [sidebarOpened, setSideBarOpened] = useState(Settings.IsSidebarOpened);\n\n const [importString, setImportString] = useState<string>(undefined as unknown as string);\n const [importAutomatic, setImportAutomatic] = useState<boolean>(false);\n if (importString === undefined && page === Page.ImportSave)\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [allowRoutingCalls, setAllowRoutingCalls] = useState(true);\n\n function resetErrorBoundary(): void {\n setErrorBoundaryKey(errorBoundaryKey + 1);\n }\n\n function rerender(): void {\n setRerender((old) => old + 1);\n }\n useEffect(() => {\n return ITutorialEvents.subscribe(rerender);\n }, []);\n\n function killAllScripts(): void {\n for (const server of GetAllServers()) {\n server.runningScripts = [];\n }\n saveObject.saveGame();\n setTimeout(() => htmlLocation.reload(), 2000);\n }\n\n Router = {\n page: () => page,\n allowRouting: (value: boolean) => setAllowRoutingCalls(value),\n toActiveScripts: () => setPage(Page.ActiveScripts),\n toAugmentations: () => setPage(Page.Augmentations),\n toBladeburner: () => setPage(Page.Bladeburner),\n toStats: () => setPage(Page.Stats),\n toCorporation: () => setPage(Page.Corporation),\n toCreateProgram: () => setPage(Page.CreateProgram),\n toDevMenu: () => setPage(Page.DevMenu),\n toFaction: (faction?: Faction) => {\n setPage(Page.Faction);\n if (faction) setFaction(faction);\n },\n toFactions: () => setPage(Page.Factions),\n toGameOptions: () => setPage(Page.Options),\n toGang: () => setPage(Page.Gang),\n toHacknetNodes: () => setPage(Page.Hacknet),\n toMilestones: () => setPage(Page.Milestones),\n toResleeves: () => setPage(Page.Resleeves),\n toScriptEditor: (files: Record<string, string>, options?: ScriptEditorRouteOptions) => {\n setEditorOptions({\n files,\n vim: !!options?.vim,\n });\n setPage(Page.ScriptEditor);\n },\n toSleeves: () => setPage(Page.Sleeves),\n toStockMarket: () => setPage(Page.StockMarket),\n toTerminal: () => setPage(Page.Terminal),\n toTutorial: () => setPage(Page.Tutorial),\n toJob: () => {\n setLocation(Locations[player.companyName]);\n setPage(Page.Job);\n },\n toCity: () => {\n setPage(Page.City);\n },\n toTravel: () => {\n player.gotoLocation(LocationName.TravelAgency);\n setPage(Page.Travel);\n },\n toBitVerse: (flume: boolean, quick: boolean) => {\n setFlume(flume);\n setQuick(quick);\n calculateAchievements();\n setPage(Page.BitVerse);\n },\n toInfiltration: (location: Location) => {\n setLocation(location);\n setPage(Page.Infiltration);\n },\n toWork: () => setPage(Page.Work),\n toBladeburnerCinematic: () => {\n setPage(Page.BladeburnerCinematic);\n setCinematicText(cinematicText);\n },\n toLocation: (location: Location) => {\n setLocation(location);\n setPage(Page.Location);\n },\n toStaneksGift: () => {\n setPage(Page.StaneksGift);\n },\n toAchievements: () => {\n setPage(Page.Achievements);\n },\n toThemeBrowser: () => {\n setPage(Page.ThemeBrowser);\n },\n toImportSave: (base64save: string, automatic = false) => {\n setImportString(base64save);\n setImportAutomatic(automatic);\n setPage(Page.ImportSave);\n },\n };\n\n\n useEffect(() => {\n // Wrap Router navigate functions to be able to disable the execution\n _functions(Router).\n filter((fnName) => fnName.startsWith('to')).\n forEach((fnName) => {\n // @ts-ignore - tslint does not like this, couldn't find a way to make it cooperate\n Router[fnName] = _wrap(Router[fnName], (func, ...args) => {\n if (!allowRoutingCalls) {\n // Let's just log to console.\n console.log(`Routing is currently disabled - Attempted router.${fnName}()`);\n return;\n }\n\n // Call the function normally\n return func(...args);\n });\n });\n });\n\n useEffect(() => {\n if (page !== Page.Terminal) window.scrollTo(0, 0);\n });\n\n function softReset(): void {\n dialogBoxCreate(\"Soft Reset!\");\n prestigeAugmentation();\n resetErrorBoundary();\n Router.toTerminal();\n }\n\n let mainPage = <Typography>Cannot load</Typography>;\n let withSidebar = true;\n let withPopups = true;\n let bypassGame = false;\n switch (page) {\n case Page.Recovery: {\n mainPage = <RecoveryRoot router={Router} softReset={softReset} />;\n withSidebar = false;\n withPopups = false;\n bypassGame = true;\n break;\n }\n case Page.BitVerse: {\n mainPage = <BitverseRoot flume={flume} enter={enterBitNode} quick={quick} />;\n withSidebar = false;\n withPopups = false;\n break;\n }\n case Page.Infiltration: {\n mainPage = <InfiltrationRoot location={location} />;\n withSidebar = false;\n withPopups = false;\n break;\n }\n case Page.BladeburnerCinematic: {\n mainPage = <BladeburnerCinematic />;\n withSidebar = false;\n withPopups = false;\n break;\n }\n case Page.Work: {\n mainPage = <WorkInProgressRoot />;\n withSidebar = false;\n break;\n }\n case Page.Terminal: {\n mainPage = <TerminalRoot terminal={terminal} router={Router} player={player} />;\n break;\n }\n case Page.Sleeves: {\n mainPage = <SleeveRoot />;\n break;\n }\n case Page.StaneksGift: {\n mainPage = <StaneksGiftRoot staneksGift={staneksGift} />;\n break;\n }\n case Page.Stats: {\n mainPage = <CharacterStats />;\n break;\n }\n case Page.ScriptEditor: {\n mainPage = (\n <ScriptEditorRoot\n files={files}\n hostname={player.getCurrentServer().hostname}\n player={player}\n router={Router}\n vim={vim}\n />\n );\n break;\n }\n case Page.ActiveScripts: {\n mainPage = <ActiveScriptsRoot workerScripts={workerScripts} />;\n break;\n }\n case Page.Hacknet: {\n mainPage = <HacknetRoot player={player} />;\n break;\n }\n case Page.CreateProgram: {\n mainPage = <ProgramsRoot />;\n break;\n }\n case Page.Factions: {\n mainPage = <FactionsRoot player={player} router={Router} />;\n break;\n }\n case Page.Faction: {\n mainPage = <FactionRoot faction={faction} />;\n break;\n }\n case Page.Milestones: {\n mainPage = <MilestonesRoot player={player} />;\n break;\n }\n case Page.Tutorial: {\n mainPage = (\n <TutorialRoot\n reactivateTutorial={() => {\n prestigeAugmentation();\n Router.toTerminal();\n iTutorialStart();\n }}\n />\n );\n break;\n }\n case Page.DevMenu: {\n mainPage = <DevMenuRoot player={player} engine={engine} router={Router} />;\n break;\n }\n case Page.Gang: {\n mainPage = <GangRoot />;\n break;\n }\n case Page.Corporation: {\n mainPage = <CorporationRoot />;\n break;\n }\n case Page.Bladeburner: {\n mainPage = <BladeburnerRoot />;\n break;\n }\n case Page.Resleeves: {\n mainPage = <ResleeveRoot />;\n break;\n }\n case Page.Travel: {\n mainPage = <TravelAgencyRoot p={player} router={Router} />;\n break;\n }\n case Page.StockMarket: {\n mainPage = (\n <StockMarketRoot\n buyStockLong={buyStock}\n buyStockShort={shortStock}\n cancelOrder={cancelOrder}\n eventEmitterForReset={eventEmitterForUiReset}\n initStockMarket={initStockMarketFnForReact}\n p={player}\n placeOrder={placeOrder}\n sellStockLong={sellStock}\n sellStockShort={sellShort}\n stockMarket={StockMarket}\n />\n );\n break;\n }\n case Page.City: {\n mainPage = <LocationCity />;\n break;\n }\n case Page.Job:\n case Page.Location: {\n mainPage = <GenericLocation loc={location} />;\n break;\n }\n case Page.Options: {\n mainPage = (\n <GameOptionsRoot\n player={player}\n router={Router}\n save={() => saveObject.saveGame()}\n export={() => {\n // Apply the export bonus before saving the game\n onExport(player);\n saveObject.exportGame();\n }}\n forceKill={killAllScripts}\n softReset={softReset}\n />\n );\n break;\n }\n case Page.Augmentations: {\n mainPage = (\n <AugmentationsRoot\n exportGameFn={() => {\n // Apply the export bonus before saving the game\n onExport(player);\n saveObject.exportGame();\n }}\n installAugmentationsFn={() => {\n installAugmentations();\n Router.toTerminal();\n }}\n />\n );\n break;\n }\n case Page.Achievements: {\n mainPage = <AchievementsRoot />;\n break;\n }\n case Page.ThemeBrowser: {\n mainPage = <ThemeBrowser router={Router} />;\n break;\n }\n case Page.ImportSave: {\n mainPage = (\n <ImportSaveRoot\n importString={importString}\n automatic={importAutomatic}\n router={Router}\n />\n );\n withSidebar = false;\n withPopups = false;\n bypassGame = true;\n }\n }\n\n return (\n <Context.Player.Provider value={player}>\n <Context.Router.Provider value={Router}>\n <ErrorBoundary key={errorBoundaryKey} router={Router} softReset={softReset}>\n <BypassWrapper content={bypassGame ? mainPage : null}>\n <SnackbarProvider>\n <Overview mode={ITutorial.isRunning ? \"tutorial\" : \"overview\"}>\n {!ITutorial.isRunning ? (\n <CharacterOverview save={() => saveObject.saveGame()} killScripts={killAllScripts} />\n ) : (\n <InteractiveTutorialRoot />\n )}\n </Overview>\n {withSidebar ? (\n <Box display=\"flex\" flexDirection=\"row\" width=\"100%\">\n <SidebarRoot\n player={player}\n router={Router}\n page={page}\n opened={sidebarOpened}\n onToggled={(isOpened) => {\n setSideBarOpened(isOpened);\n Settings.IsSidebarOpened = isOpened;\n }}\n />\n <Box className={classes.root}>{mainPage}</Box>\n </Box>\n ) : (\n <Box className={classes.root}>{mainPage}</Box>\n )}\n <Unclickable />\n {withPopups && (\n <>\n <LogBoxManager />\n <AlertManager />\n <PromptManager />\n <InvitationModal />\n <Snackbar />\n </>\n )}\n </SnackbarProvider>\n </BypassWrapper>\n </ErrorBoundary>\n </Context.Router.Provider>\n </Context.Player.Provider>\n );\n}\n","import { IMap } from \"../../types\";\n\n/**\n * Keyboard key codes\n */\nexport const KEY: IMap<number> = {\n CTRL: 17,\n DOWNARROW: 40,\n ENTER: 13,\n ESC: 27,\n TAB: 9,\n UPARROW: 38,\n\n \"0\": 48,\n \"1\": 49,\n \"2\": 50,\n \"3\": 51,\n \"4\": 52,\n \"5\": 53,\n \"6\": 54,\n \"7\": 55,\n \"8\": 56,\n \"9\": 57,\n\n A: 65,\n B: 66,\n C: 67,\n D: 68,\n E: 69,\n F: 70,\n G: 71,\n H: 72,\n I: 73,\n J: 74,\n K: 75,\n L: 76,\n M: 77,\n N: 78,\n O: 79,\n P: 80,\n Q: 81,\n R: 82,\n S: 83,\n T: 84,\n U: 85,\n V: 86,\n W: 87,\n X: 88,\n Y: 89,\n Z: 90,\n};\n","/* Holds IP of Special Servers */\nexport const SpecialServers: {\n [key: string]: string | undefined;\n\n Home: string;\n FulcrumSecretTechnologies: string;\n CyberSecServer: string;\n NiteSecServer: string;\n TheBlackHandServer: string;\n BitRunnersServer: string;\n TheDarkArmyServer: string;\n DaedalusServer: string;\n WorldDaemon: string;\n DarkWeb: string;\n} = {\n Home: \"home\",\n FulcrumSecretTechnologies: \"fulcrumassets\",\n CyberSecServer: \"CSEC\",\n NiteSecServer: \"avmnite-02h\",\n TheBlackHandServer: \"I.I.I.I\",\n BitRunnersServer: \"run4theh111z\",\n TheDarkArmyServer: \".\",\n DaedalusServer: \"The-Cave\",\n WorldDaemon: \"w0r1d_d43m0n\",\n DarkWeb: \"darkweb\",\n};\n","import { loadAliases, loadGlobalAliases, Aliases, GlobalAliases } from \"./Alias\";\nimport { Companies, loadCompanies } from \"./Company/Companies\";\nimport { CONSTANTS } from \"./Constants\";\nimport { Factions, loadFactions } from \"./Faction/Factions\";\nimport { loadAllGangs, AllGangs } from \"./Gang/AllGangs\";\nimport { loadMessages, initMessages, Messages } from \"./Message/MessageHelpers\";\nimport { Player, loadPlayer } from \"./Player\";\nimport { saveAllServers, loadAllServers, GetAllServers } from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { SourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { loadStockMarket, StockMarket } from \"./StockMarket/StockMarket\";\nimport { staneksGift, loadStaneksGift } from \"./CotMG/Helper\";\n\nimport { SnackbarEvents } from \"./ui/React/Snackbar\";\n\nimport * as ExportBonus from \"./ExportBonus\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON } from \"./utils/JSONReviver\";\nimport { save } from \"./db\";\nimport { v1APIBreak } from \"./utils/v1APIBreak\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { PlayerOwnedAugmentation } from \"./Augmentation/PlayerOwnedAugmentation\";\nimport { LocationName } from \"./Locations/data/LocationNames\";\nimport { SxProps } from \"@mui/system\";\nimport { PlayerObject } from \"./PersonObjects/Player/PlayerObject\";\nimport { pushGameSaved } from \"./Electron\";\n\n/* SaveObject.js\n * Defines the object used to save/load games\n */\n\nexport interface SaveData {\n playerIdentifier: string;\n fileName: string;\n save: string;\n savedOn: number;\n}\n\nexport interface ImportData {\n base64: string;\n parsed: any;\n playerData?: ImportPlayerData;\n}\n\nexport interface ImportPlayerData {\n identifier: string;\n lastSave: number;\n totalPlaytime: number;\n\n money: number;\n hacking: number;\n\n augmentations: number;\n factions: number;\n achievements: number;\n\n bitNode: number;\n bitNodeLevel: number;\n sourceFiles: number;\n}\n\nclass BitburnerSaveObject {\n PlayerSave = \"\";\n AllServersSave = \"\";\n CompaniesSave = \"\";\n FactionsSave = \"\";\n AliasesSave = \"\";\n GlobalAliasesSave = \"\";\n MessagesSave = \"\";\n StockMarketSave = \"\";\n SettingsSave = \"\";\n VersionSave = \"\";\n AllGangsSave = \"\";\n LastExportBonus = \"\";\n StaneksGiftSave = \"\";\n\n getSaveString(excludeRunningScripts = false): string {\n this.PlayerSave = JSON.stringify(Player);\n\n this.AllServersSave = saveAllServers(excludeRunningScripts);\n this.CompaniesSave = JSON.stringify(Companies);\n this.FactionsSave = JSON.stringify(Factions);\n this.AliasesSave = JSON.stringify(Aliases);\n this.GlobalAliasesSave = JSON.stringify(GlobalAliases);\n this.MessagesSave = JSON.stringify(Messages);\n this.StockMarketSave = JSON.stringify(StockMarket);\n this.SettingsSave = JSON.stringify(Settings);\n this.VersionSave = JSON.stringify(CONSTANTS.VersionNumber);\n this.LastExportBonus = JSON.stringify(ExportBonus.LastExportBonus);\n this.StaneksGiftSave = JSON.stringify(staneksGift);\n\n if (Player.inGang()) {\n this.AllGangsSave = JSON.stringify(AllGangs);\n }\n const saveString = btoa(unescape(encodeURIComponent(JSON.stringify(this))));\n\n return saveString;\n }\n\n saveGame(emitToastEvent = true): Promise<void> {\n const savedOn = new Date().getTime();\n Player.lastSave = savedOn;\n const saveString = this.getSaveString(Settings.ExcludeRunningScriptsFromSave);\n return new Promise((resolve, reject) => {\n save(saveString)\n .then(() => {\n const saveData: SaveData = {\n playerIdentifier: Player.identifier,\n fileName: this.getSaveFileName(),\n save: saveString,\n savedOn,\n };\n pushGameSaved(saveData);\n\n if (emitToastEvent) {\n SnackbarEvents.emit(\"Game Saved!\", \"info\", 2000);\n }\n return resolve();\n })\n .catch((err) => {\n console.error(err);\n return reject();\n });\n });\n }\n\n getSaveFileName(isRecovery = false): string {\n // Save file name is based on current timestamp and BitNode\n const epochTime = Math.round(Date.now() / 1000);\n const bn = Player.bitNodeN;\n let filename = `bitburnerSave_${epochTime}_BN${bn}x${SourceFileFlags[bn]}.json`;\n if (isRecovery) filename = \"RECOVERY\" + filename;\n return filename;\n }\n\n exportGame(): void {\n const saveString = this.getSaveString(Settings.ExcludeRunningScriptsFromSave);\n const filename = this.getSaveFileName();\n download(filename, saveString);\n }\n\n importGame(base64Save: string, reload = true): Promise<void> {\n if (!base64Save || base64Save === \"\") throw new Error(\"Invalid import string\");\n return save(base64Save).then(() => {\n if (reload) setTimeout(() => location.reload(), 1000);\n return Promise.resolve();\n });\n }\n\n getImportStringFromFile(files: FileList | null): Promise<string> {\n if (files === null) return Promise.reject(new Error(\"No file selected\"));\n const file = files[0];\n if (!file) return Promise.reject(new Error(\"Invalid file selected\"));\n\n const reader = new FileReader();\n const promise: Promise<string> = new Promise((resolve, reject) => {\n reader.onload = function (this: FileReader, e: ProgressEvent<FileReader>) {\n const target = e.target;\n if (target === null) {\n return reject(new Error(\"Error importing file\"));\n }\n const result = target.result;\n if (typeof result !== \"string\" || result === null) {\n return reject(new Error(\"FileReader event was not type string\"));\n }\n const contents = result;\n resolve(contents);\n };\n });\n reader.readAsText(file);\n return promise;\n }\n\n async getImportDataFromString(base64Save: string): Promise<ImportData> {\n if (!base64Save || base64Save === \"\") throw new Error(\"Invalid import string\");\n\n let newSave;\n try {\n newSave = window.atob(base64Save);\n newSave = newSave.trim();\n } catch (error) {\n console.error(error); // We'll handle below\n }\n\n if (!newSave || newSave === \"\") {\n return Promise.reject(new Error(\"Save game had not content or was not base64 encoded\"));\n }\n\n let parsedSave;\n try {\n parsedSave = JSON.parse(newSave);\n } catch (error) {\n console.log(error); // We'll handle below\n }\n\n if (!parsedSave || parsedSave.ctor !== \"BitburnerSaveObject\" || !parsedSave.data) {\n return Promise.reject(new Error(\"Save game did not seem valid\"));\n }\n\n const data: ImportData = {\n base64: base64Save,\n parsed: parsedSave,\n };\n\n const importedPlayer = PlayerObject.fromJSON(JSON.parse(parsedSave.data.PlayerSave));\n\n const playerData: ImportPlayerData = {\n identifier: importedPlayer.identifier,\n lastSave: importedPlayer.lastSave,\n totalPlaytime: importedPlayer.totalPlaytime,\n\n money: importedPlayer.money,\n hacking: importedPlayer.hacking,\n\n augmentations: importedPlayer.augmentations?.reduce<number>((total, current) => (total += current.level), 0) ?? 0,\n factions: importedPlayer.factions?.length ?? 0,\n achievements: importedPlayer.achievements?.length ?? 0,\n\n bitNode: importedPlayer.bitNodeN,\n bitNodeLevel: importedPlayer.sourceFileLvl(Player.bitNodeN) + 1,\n sourceFiles: importedPlayer.sourceFiles?.reduce<number>((total, current) => (total += current.lvl), 0) ?? 0,\n };\n\n data.playerData = playerData;\n return Promise.resolve(data);\n }\n\n toJSON(): any {\n return Generic_toJSON(\"BitburnerSaveObject\", this);\n }\n\n static fromJSON(value: { data: any }): BitburnerSaveObject {\n return Generic_fromJSON(BitburnerSaveObject, value.data);\n }\n}\n\n// Makes necessary changes to the loaded/imported data to ensure\n// the game stills works with new versions\nfunction evaluateVersionCompatibility(ver: string | number): void {\n // We have to do this because ts won't let us otherwise\n const anyPlayer = Player as any;\n if (typeof ver === \"string\") {\n // This version refactored the Company/job-related code\n if (ver <= \"0.41.2\") {\n // Player's company position is now a string\n if (anyPlayer.companyPosition != null && typeof anyPlayer.companyPosition !== \"string\") {\n anyPlayer.companyPosition = anyPlayer.companyPosition.data.positionName;\n if (anyPlayer.companyPosition == null) {\n anyPlayer.companyPosition = \"\";\n }\n }\n\n // The \"companyName\" property of all Companies is renamed to \"name\"\n for (const companyName of Object.keys(Companies)) {\n const company: any = Companies[companyName];\n if (company.name == 0 && company.companyName != null) {\n company.name = company.companyName;\n }\n\n if (company.companyPositions instanceof Array) {\n const pos: any = {};\n\n for (let i = 0; i < company.companyPositions.length; ++i) {\n pos[company.companyPositions[i]] = true;\n }\n company.companyPositions = pos;\n }\n }\n }\n\n // This version allowed players to hold multiple jobs\n if (ver < \"0.43.0\") {\n if (anyPlayer.companyName !== \"\" && anyPlayer.companyPosition != null && anyPlayer.companyPosition !== \"\") {\n anyPlayer.jobs[anyPlayer.companyName] = anyPlayer.companyPosition;\n }\n\n delete anyPlayer.companyPosition;\n }\n if (ver < \"0.56.0\") {\n for (const q of anyPlayer.queuedAugmentations) {\n if (q.name === \"Graphene BranchiBlades Upgrade\") {\n q.name = \"Graphene BrachiBlades Upgrade\";\n }\n }\n for (const q of anyPlayer.augmentations) {\n if (q.name === \"Graphene BranchiBlades Upgrade\") {\n q.name = \"Graphene BrachiBlades Upgrade\";\n }\n }\n }\n if (ver < \"0.56.1\") {\n if (anyPlayer.bladeburner === 0) {\n anyPlayer.bladeburner = null;\n }\n if (anyPlayer.gang === 0) {\n anyPlayer.gang = null;\n }\n if (anyPlayer.corporation === 0) {\n anyPlayer.corporation = null;\n }\n // convert all Messages to just filename to save space.\n const home = anyPlayer.getHomeComputer();\n for (let i = 0; i < home.messages.length; i++) {\n if (home.messages[i].filename) {\n home.messages[i] = home.messages[i].filename;\n }\n }\n }\n if (ver < \"0.58.0\") {\n const changes: [RegExp, string][] = [\n [/getStockSymbols/g, \"stock.getSymbols\"],\n [/getStockPrice/g, \"stock.getPrice\"],\n [/getStockAskPrice/g, \"stock.getAskPrice\"],\n [/getStockBidPrice/g, \"stock.getBidPrice\"],\n [/getStockPosition/g, \"stock.getPosition\"],\n [/getStockMaxShares/g, \"stock.getMaxShares\"],\n [/getStockPurchaseCost/g, \"stock.getPurchaseCost\"],\n [/getStockSaleGain/g, \"stock.getSaleGain\"],\n [/buyStock/g, \"stock.buy\"],\n [/sellStock/g, \"stock.sell\"],\n [/shortStock/g, \"stock.short\"],\n [/sellShort/g, \"stock.sellShort\"],\n [/placeOrder/g, \"stock.placeOrder\"],\n [/cancelOrder/g, \"stock.cancelOrder\"],\n [/getOrders/g, \"stock.getOrders\"],\n [/getStockVolatility/g, \"stock.getVolatility\"],\n [/getStockForecast/g, \"stock.getForecast\"],\n [/purchase4SMarketData/g, \"stock.purchase4SMarketData\"],\n [/purchase4SMarketDataTixApi/g, \"stock.purchase4SMarketDataTixApi\"],\n ];\n function convert(code: string): string {\n for (const change of changes) {\n code = code.replace(change[0], change[1]);\n }\n return code;\n }\n for (const server of GetAllServers()) {\n for (const script of server.scripts) {\n script.code = convert(script.code);\n }\n }\n }\n v1APIBreak();\n ver = 1;\n }\n if (typeof ver === \"number\") {\n if (ver < 2) {\n // Give 10 neuroflux because v1 API break.\n const nf = Player.augmentations.find((a) => a.name === AugmentationNames.NeuroFluxGovernor);\n if (nf) {\n nf.level += 10;\n } else {\n const nf = new PlayerOwnedAugmentation(AugmentationNames.NeuroFluxGovernor);\n nf.level = 10;\n Player.augmentations.push(nf);\n }\n Player.reapplyAllAugmentations(true);\n Player.reapplyAllSourceFiles();\n }\n if (ver < 3) {\n anyPlayer.money = parseFloat(anyPlayer.money);\n if (anyPlayer.corporation) {\n anyPlayer.corporation.funds = parseFloat(anyPlayer.corporation.funds);\n anyPlayer.corporation.revenue = parseFloat(anyPlayer.corporation.revenue);\n anyPlayer.corporation.expenses = parseFloat(anyPlayer.corporation.expenses);\n\n for (let i = 0; i < anyPlayer.corporation.divisions.length; ++i) {\n const ind = anyPlayer.corporation.divisions[i];\n ind.lastCycleRevenue = parseFloat(ind.lastCycleRevenue);\n ind.lastCycleExpenses = parseFloat(ind.lastCycleExpenses);\n ind.thisCycleRevenue = parseFloat(ind.thisCycleRevenue);\n ind.thisCycleExpenses = parseFloat(ind.thisCycleExpenses);\n }\n }\n }\n if (ver < 9) {\n if (StockMarket.hasOwnProperty(\"Joes Guns\")) {\n const s = StockMarket[\"Joes Guns\"];\n delete StockMarket[\"Joes Guns\"];\n StockMarket[LocationName.Sector12JoesGuns] = s;\n }\n }\n if (ver < 10) {\n // Augmentation name was changed in 0.56.0 but sleeves aug list was missed.\n if (anyPlayer.sleeves && anyPlayer.sleeves.length > 0) {\n for (const sleeve of anyPlayer.sleeves) {\n if (!sleeve.augmentations || sleeve.augmentations.length === 0) continue;\n for (const augmentation of sleeve.augmentations) {\n if (augmentation.name !== \"Graphene BranchiBlades Upgrade\") continue;\n augmentation.name = \"Graphene BrachiBlades Upgrade\";\n }\n }\n }\n }\n }\n}\n\nfunction loadGame(saveString: string): boolean {\n createScamUpdateText();\n if (!saveString) return false;\n saveString = decodeURIComponent(escape(atob(saveString)));\n\n const saveObj = JSON.parse(saveString, Reviver);\n\n loadPlayer(saveObj.PlayerSave);\n loadAllServers(saveObj.AllServersSave);\n loadCompanies(saveObj.CompaniesSave);\n loadFactions(saveObj.FactionsSave);\n\n if (saveObj.hasOwnProperty(\"StaneksGiftSave\")) {\n loadStaneksGift(saveObj.StaneksGiftSave);\n } else {\n console.warn(`Could not load Staneks Gift from save`);\n loadStaneksGift(\"\");\n }\n if (saveObj.hasOwnProperty(\"AliasesSave\")) {\n try {\n loadAliases(saveObj.AliasesSave);\n } catch (e) {\n console.warn(`Could not load Aliases from save`);\n loadAliases(\"\");\n }\n } else {\n console.warn(`Save file did not contain an Aliases property`);\n loadAliases(\"\");\n }\n if (saveObj.hasOwnProperty(\"GlobalAliasesSave\")) {\n try {\n loadGlobalAliases(saveObj.GlobalAliasesSave);\n } catch (e) {\n console.warn(`Could not load GlobalAliases from save`);\n loadGlobalAliases(\"\");\n }\n } else {\n console.warn(`Save file did not contain a GlobalAliases property`);\n loadGlobalAliases(\"\");\n }\n if (saveObj.hasOwnProperty(\"MessagesSave\")) {\n try {\n loadMessages(saveObj.MessagesSave);\n } catch (e) {\n console.warn(`Could not load Messages from save`);\n initMessages();\n }\n } else {\n console.warn(`Save file did not contain a Messages property`);\n initMessages();\n }\n if (saveObj.hasOwnProperty(\"StockMarketSave\")) {\n try {\n loadStockMarket(saveObj.StockMarketSave);\n } catch (e) {\n loadStockMarket(\"\");\n }\n } else {\n loadStockMarket(\"\");\n }\n if (saveObj.hasOwnProperty(\"SettingsSave\")) {\n try {\n Settings.load(saveObj.SettingsSave);\n } catch (e) {\n console.error(\"ERROR: Failed to parse Settings. Re-initing default values\");\n Settings.init();\n }\n } else {\n Settings.init();\n }\n if (saveObj.hasOwnProperty(\"LastExportBonus\")) {\n try {\n ExportBonus.setLastExportBonus(JSON.parse(saveObj.LastExportBonus));\n } catch (err) {\n ExportBonus.setLastExportBonus(new Date().getTime());\n console.error(\"ERROR: Failed to parse last export bonus Settings \" + err);\n }\n }\n if (Player.inGang() && saveObj.hasOwnProperty(\"AllGangsSave\")) {\n try {\n loadAllGangs(saveObj.AllGangsSave);\n } catch (e) {\n console.error(\"ERROR: Failed to parse AllGangsSave: \" + e);\n }\n }\n if (saveObj.hasOwnProperty(\"VersionSave\")) {\n try {\n const ver = JSON.parse(saveObj.VersionSave, Reviver);\n evaluateVersionCompatibility(ver);\n if (window.location.href.toLowerCase().includes(\"bitburner-beta\")) {\n // Beta branch, always show changes\n createBetaUpdateText();\n } else if (ver !== CONSTANTS.VersionNumber) {\n createNewUpdateText();\n }\n } catch (e) {\n createNewUpdateText();\n }\n } else {\n createNewUpdateText();\n }\n return true;\n}\n\nfunction createScamUpdateText(): void {\n if (navigator.userAgent.indexOf(\"wv\") !== -1 && navigator.userAgent.indexOf(\"Chrome/\") !== -1) {\n setInterval(() => {\n dialogBoxCreate(\"SCAM ALERT. This app is not official and you should uninstall it.\");\n }, 1000);\n }\n}\n\nconst resets: SxProps = {\n \"& h1, & h2, & h3, & h4, & p, & a, & ul\": {\n margin: 0,\n color: Settings.theme.primary,\n whiteSpace: \"initial\",\n },\n \"& ul\": {\n paddingLeft: \"1.5em\",\n lineHeight: 1.5,\n },\n};\n\nfunction createNewUpdateText(): void {\n setTimeout(\n () =>\n dialogBoxCreate(\n \"New update!<br>\" +\n \"Please report any bugs/issues through the github repository \" +\n \"or the Bitburner subreddit (reddit.com/r/bitburner).<br><br>\" +\n CONSTANTS.LatestUpdate,\n resets,\n ),\n 1000,\n );\n}\n\nfunction createBetaUpdateText(): void {\n dialogBoxCreate(\n \"You are playing on the beta environment! This branch of the game \" +\n \"features the latest developments in the game. This version may be unstable.<br>\" +\n \"Please report any bugs/issues through the github repository (https://github.com/danielyxie/bitburner/issues) \" +\n \"or the Bitburner subreddit (reddit.com/r/bitburner).<br><br>\" +\n CONSTANTS.LatestUpdate,\n resets,\n );\n}\n\nfunction download(filename: string, content: string): void {\n const file = new Blob([content], { type: \"text/plain\" });\n const navigator = window.navigator as any;\n if (navigator.msSaveOrOpenBlob) {\n // IE10+\n navigator.msSaveOrOpenBlob(file, filename);\n } else {\n // Others\n const a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n}\n\nReviver.constructors.BitburnerSaveObject = BitburnerSaveObject;\n\nexport { saveObject, loadGame, download };\n\nconst saveObject = new BitburnerSaveObject();\n","import { isString } from \"./utils/helpers/isString\";\nimport { GetServer } from \"./Server/AllServers\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\n\nexport function netscriptDelay(time: number, workerScript: WorkerScript): Promise<void> {\n if (workerScript.delayReject) workerScript.delayReject();\n return new Promise(function (resolve, reject) {\n workerScript.delay = window.setTimeout(() => {\n workerScript.delay = null;\n workerScript.delayReject = undefined;\n\n if (workerScript.env.stopFlag) reject(workerScript);\n else resolve();\n }, time);\n workerScript.delayReject = reject;\n });\n}\n\nexport function makeRuntimeRejectMsg(workerScript: WorkerScript, msg: string): string {\n const server = GetServer(workerScript.hostname);\n if (server == null) {\n throw new Error(`WorkerScript constructed with invalid server ip: ${workerScript.hostname}`);\n }\n\n for (const scriptUrl of workerScript.scriptRef.dependencies) {\n // Return just the original msg if it's nullish so that we don't get a workerscript error\n msg = msg?.replace(new RegExp(scriptUrl.url, \"g\"), scriptUrl.filename) ?? msg;\n }\n\n return \"|DELIMITER|\" + server.hostname + \"|DELIMITER|\" + workerScript.name + \"|DELIMITER|\" + msg;\n}\n\nexport function resolveNetscriptRequestedThreads(\n workerScript: WorkerScript,\n functionName: string,\n requestedThreads: number,\n): number {\n const threads = workerScript.scriptRef.threads;\n if (!requestedThreads) {\n return isNaN(threads) || threads < 1 ? 1 : threads;\n }\n const requestedThreadsAsInt = requestedThreads | 0;\n if (isNaN(requestedThreads) || requestedThreadsAsInt < 1) {\n throw makeRuntimeRejectMsg(\n workerScript,\n `Invalid thread count passed to ${functionName}: ${requestedThreads}. Threads must be a positive number.`,\n );\n }\n if (requestedThreadsAsInt > threads) {\n throw makeRuntimeRejectMsg(\n workerScript,\n `Too many threads requested by ${functionName}. Requested: ${requestedThreads}. Has: ${threads}.`,\n );\n }\n return requestedThreadsAsInt;\n}\n\nexport function isScriptErrorMessage(msg: string): boolean {\n if (!isString(msg)) {\n return false;\n }\n const splitMsg = msg.split(\"|DELIMITER|\");\n if (splitMsg.length != 4) {\n return false;\n }\n return true;\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\n\nexport function MoneyRate({ money }: { money: number }): JSX.Element {\n return <Money money={`${numeralWrapper.formatMoney(money)} / sec`} />;\n}\n","import { codingContractTypesMetadata, DescriptionFunc, GeneratorFunc, SolverFunc } from \"./data/codingcontracttypes\";\n\nimport { IMap } from \"./types\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"./utils/JSONReviver\";\nimport { CodingContractEvent } from \"./ui/React/CodingContractModal\";\n\n/* tslint:disable:no-magic-numbers completed-docs max-classes-per-file no-console */\n\n/* Represents different types of problems that a Coding Contract can have */\nclass CodingContractType {\n /**\n * Function that generates a description of the problem\n */\n desc: DescriptionFunc;\n\n /**\n * Number that generally represents the problem's difficulty. Bigger numbers = harder\n */\n difficulty: number;\n\n /**\n * A function that randomly generates a valid 'data' for the problem\n */\n generate: GeneratorFunc;\n\n /**\n * Name of the type of problem\n */\n name: string;\n\n /**\n * The maximum number of tries the player gets on this kind of problem before it self-destructs\n */\n numTries: number;\n\n /**\n * Stores a function that checks if the provided answer is correct\n */\n solver: SolverFunc;\n\n constructor(\n name: string,\n desc: DescriptionFunc,\n gen: GeneratorFunc,\n solver: SolverFunc,\n diff: number,\n numTries: number,\n ) {\n this.name = name;\n this.desc = desc;\n this.generate = gen;\n this.solver = solver;\n this.difficulty = diff;\n this.numTries = numTries;\n }\n}\n\n/* Contract Types */\n// tslint:disable-next-line\nexport const CodingContractTypes: IMap<CodingContractType> = {};\n\nfor (const md of codingContractTypesMetadata) {\n // tslint:disable-next-line\n CodingContractTypes[md.name] = new CodingContractType(\n md.name,\n md.desc,\n md.gen,\n md.solver,\n md.difficulty,\n md.numTries,\n );\n}\n\n/**\n * Enum representing the different types of rewards a Coding Contract can give\n */\nexport enum CodingContractRewardType {\n FactionReputation,\n FactionReputationAll,\n CompanyReputation,\n Money, // This must always be the last reward type\n}\n\n/**\n * Enum representing the result when trying to solve the Contract\n */\nexport enum CodingContractResult {\n Success,\n Failure,\n Cancelled,\n}\n\n/**\n * A class that represents the type of reward a contract gives\n */\nexport interface ICodingContractReward {\n /* Name of Company/Faction name for reward, if applicable */\n name?: string;\n type: CodingContractRewardType;\n}\n\n/**\n * A Coding Contract is a file that poses a programming-related problem to the Player.\n * The player receives a reward if the problem is solved correctly\n */\nexport class CodingContract {\n /* Relevant data for the contract's problem */\n data: any;\n\n /* Contract's filename */\n fn: string;\n\n /* Describes the reward given if this Contract is solved. The reward is actually\n processed outside of this file */\n reward: ICodingContractReward | null;\n\n /* Number of times the Contract has been attempted */\n tries = 0;\n\n /* String representing the contract's type. Must match type in ContractTypes */\n type: string;\n\n constructor(fn = \"\", type = \"Find Largest Prime Factor\", reward: ICodingContractReward | null = null) {\n this.fn = fn;\n if (!this.fn.endsWith(\".cct\")) {\n this.fn += \".cct\";\n }\n\n // tslint:disable-next-line\n if (CodingContractTypes[type] == null) {\n throw new Error(`Error: invalid contract type: ${type} please contact developer`);\n }\n\n this.type = type;\n this.data = CodingContractTypes[type].generate();\n this.reward = reward;\n }\n\n getData(): any {\n return this.data;\n }\n\n getDescription(): string {\n return CodingContractTypes[this.type].desc(this.data);\n }\n\n getDifficulty(): number {\n return CodingContractTypes[this.type].difficulty;\n }\n\n getMaxNumTries(): number {\n return CodingContractTypes[this.type].numTries;\n }\n\n getType(): string {\n return CodingContractTypes[this.type].name;\n }\n\n isSolution(solution: string): boolean {\n return CodingContractTypes[this.type].solver(this.data, solution);\n }\n\n /**\n * Creates a popup to prompt the player to solve the problem\n */\n async prompt(): Promise<CodingContractResult> {\n return new Promise<CodingContractResult>((resolve) => {\n const props = {\n c: this,\n onClose: () => {\n resolve(CodingContractResult.Cancelled);\n },\n onAttempt: (val: string) => {\n if (this.isSolution(val)) {\n resolve(CodingContractResult.Success);\n } else {\n resolve(CodingContractResult.Failure);\n }\n },\n };\n CodingContractEvent.emit(props);\n });\n }\n\n /**\n * Serialize the current file to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"CodingContract\", this);\n }\n\n /**\n * Initiatizes a CodingContract from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): CodingContract {\n return Generic_fromJSON(CodingContract, value.data);\n }\n}\n\nReviver.constructors.CodingContract = CodingContract;\n","export enum OrderTypes {\n LimitBuy = \"Limit Buy Order\",\n LimitSell = \"Limit Sell Order\",\n StopBuy = \"Stop Buy Order\",\n StopSell = \"Stop Sell Order\",\n}\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n reputation: {\n color: theme.colors.rep,\n },\n }),\n);\n\nexport function Reputation({ reputation }: { reputation: number | string }): React.ReactElement {\n const classes = useStyles();\n return (\n <span className={classes.reputation}>\n {typeof reputation === \"number\" ? numeralWrapper.formatReputation(reputation) : reputation}\n </span>\n );\n}\n","/*\nThe game cannot block every possible exploits. Specially since one of them is\nthat you can just edit your save file and that's impragmatic to prevent.\n\nSo instead we have source file minus 1. It is not obtained by destroying a\nBitNode but instead it is awarded when the player finds innovative ways to break\nthe game, this serves 2 purpose, [one] the developpers don't have to spend time\ntrying to implement anti-cheat measures and [two] finding ways to break a\nhacking game is very much in the spirit of the game.\nSource-File minus 1 is extremely weak because it can be fully level up quickly.\n*/\n\nexport enum Exploit {\n Bypass = \"Bypass\",\n PrototypeTampering = \"PrototypeTampering\",\n Unclickable = \"Unclickable\",\n UndocumentedFunctionCall = \"UndocumentedFunctionCall\",\n TimeCompression = \"TimeCompression\",\n RealityAlteration = \"RealityAlteration\",\n N00dles = \"N00dles\",\n YoureNotMeantToAccessThis = \"YoureNotMeantToAccessThis\",\n // To the players reading this. Yes you're supposed to add EditSaveFile by\n // editing your save file, yes you could add them all, no we don't care\n // that's not the point.\n EditSaveFile = \"EditSaveFile\",\n}\n\nconst names: {\n [key: string]: string;\n} = {\n Bypass: \"by circumventing the ram cost of document.\",\n EditSaveFile: \"by editing your save file.\",\n PrototypeTampering: \"by tampering with Numbers prototype.\",\n TimeCompression: \"by compressing time.\",\n Unclickable: \"by clicking the unclickable.\",\n UndocumentedFunctionCall: \"by looking beyond the documentation.\",\n RealityAlteration: \"by altering reality to suit your whims.\",\n N00dles: \"by harnessing the power of the n00dles.\",\n YoureNotMeantToAccessThis: \"by accessing the dev menu.\",\n};\n\nexport function ExploitName(exploit: string): string {\n return names[exploit];\n}\n\nexport function sanitizeExploits(exploits: Exploit[]): Exploit[] {\n exploits = exploits.filter((e: Exploit) => Object.keys(Exploit).includes(e));\n return [...new Set(exploits)];\n}\n","import { Reviver } from \"../utils/JSONReviver\";\n\nimport { IStaneksGift } from \"./IStaneksGift\";\nimport { StaneksGift } from \"./StaneksGift\";\n\nexport let staneksGift: IStaneksGift = new StaneksGift();\n\nexport function loadStaneksGift(saveString: string): void {\n if (saveString) {\n staneksGift = JSON.parse(saveString, Reviver);\n } else {\n staneksGift = new StaneksGift();\n }\n}\n","import { Augmentations } from \"../Augmentation/Augmentations\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\nimport { PlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\n\nimport { Faction } from \"./Faction\";\nimport { Factions } from \"./Factions\";\nimport { Player } from \"../Player\";\nimport { Settings } from \"../Settings/Settings\";\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"../PersonObjects/formulas/reputation\";\nimport { SourceFileFlags } from \"../SourceFile/SourceFileFlags\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { InvitationEvent } from \"./ui/InvitationModal\";\n\nexport function inviteToFaction(faction: Faction): void {\n Player.receiveInvite(faction.name);\n faction.alreadyInvited = true;\n if (!Settings.SuppressFactionInvites) {\n InvitationEvent.emit(faction);\n }\n}\n\nexport function joinFaction(faction: Faction): void {\n if (faction.isMember) return;\n faction.isMember = true;\n Player.factions.push(faction.name);\n const factionInfo = faction.getInfo();\n\n //Determine what factions you are banned from now that you have joined this faction\n for (const enemy of factionInfo.enemies) {\n if (Factions[enemy] instanceof Faction) {\n Factions[enemy].isBanned = true;\n }\n }\n for (let i = 0; i < Player.factionInvitations.length; ++i) {\n if (Player.factionInvitations[i] == faction.name || Factions[Player.factionInvitations[i]].isBanned) {\n Player.factionInvitations.splice(i, 1);\n i--;\n }\n }\n}\n\n//Returns a boolean indicating whether the player has the prerequisites for the\n//specified Augmentation\nexport function hasAugmentationPrereqs(aug: Augmentation): boolean {\n let hasPrereqs = true;\n if (aug.prereqs && aug.prereqs.length > 0) {\n for (let i = 0; i < aug.prereqs.length; ++i) {\n const prereqAug = Augmentations[aug.prereqs[i]];\n if (prereqAug == null) {\n console.error(`Invalid prereq Augmentation ${aug.prereqs[i]}`);\n continue;\n }\n if (prereqAug.owned === false) {\n hasPrereqs = false;\n\n // Check if the aug is purchased\n for (let j = 0; j < Player.queuedAugmentations.length; ++j) {\n if (Player.queuedAugmentations[j].name === prereqAug.name) {\n hasPrereqs = true;\n break;\n }\n }\n }\n }\n }\n\n return hasPrereqs;\n}\n\nexport function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = false): string {\n const factionInfo = fac.getInfo();\n const hasPrereqs = hasAugmentationPrereqs(aug);\n if (!hasPrereqs) {\n const txt =\n \"You must first purchase or install \" + aug.prereqs.join(\",\") + \" before you can \" + \"purchase this one.\";\n if (sing) {\n return txt;\n } else {\n dialogBoxCreate(txt);\n }\n } else if (aug.baseCost !== 0 && Player.money < aug.baseCost * factionInfo.augmentationPriceMult) {\n const txt = \"You don't have enough money to purchase \" + aug.name;\n if (sing) {\n return txt;\n }\n dialogBoxCreate(txt);\n } else if (fac.playerReputation < aug.baseRepRequirement) {\n const txt = \"You don't have enough faction reputation to purchase \" + aug.name;\n if (sing) {\n return txt;\n }\n dialogBoxCreate(txt);\n } else if (aug.baseCost === 0 || Player.money >= aug.baseCost * factionInfo.augmentationPriceMult) {\n const queuedAugmentation = new PlayerOwnedAugmentation(aug.name);\n if (aug.name == AugmentationNames.NeuroFluxGovernor) {\n queuedAugmentation.level = getNextNeurofluxLevel();\n }\n Player.queuedAugmentations.push(queuedAugmentation);\n\n Player.loseMoney(aug.baseCost * factionInfo.augmentationPriceMult, \"augmentations\");\n\n // If you just purchased Neuroflux Governor, recalculate the cost\n if (aug.name == AugmentationNames.NeuroFluxGovernor) {\n let nextLevel = getNextNeurofluxLevel();\n --nextLevel;\n const mult = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel);\n aug.baseRepRequirement = 500 * mult * BitNodeMultipliers.AugmentationRepCost;\n aug.baseCost = 750e3 * mult * BitNodeMultipliers.AugmentationMoneyCost;\n\n for (let i = 0; i < Player.queuedAugmentations.length - 1; ++i) {\n aug.baseCost *= CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][SourceFileFlags[11]];\n }\n }\n\n for (const name of Object.keys(Augmentations)) {\n if (Augmentations.hasOwnProperty(name)) {\n Augmentations[name].baseCost *= CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][SourceFileFlags[11]];\n }\n }\n\n if (sing) {\n return \"You purchased \" + aug.name;\n } else {\n if (!Settings.SuppressBuyAugmentationConfirmation) {\n dialogBoxCreate(\n \"You purchased \" +\n aug.name +\n \". Its enhancements will not take \" +\n \"effect until they are installed. To install your augmentations, go to the \" +\n \"'Augmentations' tab on the left-hand navigation menu. Purchasing additional \" +\n \"augmentations will now be more expensive.\",\n );\n }\n }\n } else {\n dialogBoxCreate(\n \"Hmm, something went wrong when trying to purchase an Augmentation. \" +\n \"Please report this to the game developer with an explanation of how to \" +\n \"reproduce this.\",\n );\n }\n return \"\";\n}\n\nexport function getNextNeurofluxLevel(): number {\n // Get current Neuroflux level based on Player's augmentations\n let currLevel = 0;\n for (let i = 0; i < Player.augmentations.length; ++i) {\n if (Player.augmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n currLevel = Player.augmentations[i].level;\n }\n }\n\n // Account for purchased but uninstalled Augmentations\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n if (Player.queuedAugmentations[i].name == AugmentationNames.NeuroFluxGovernor) {\n ++currLevel;\n }\n }\n return currLevel + 1;\n}\n\nexport function processPassiveFactionRepGain(numCycles: number): void {\n for (const name of Object.keys(Factions)) {\n if (name === Player.currentWorkFactionName) continue;\n if (!Factions.hasOwnProperty(name)) continue;\n const faction = Factions[name];\n if (!faction.isMember) continue;\n // No passive rep for special factions\n const info = faction.getInfo();\n if (!info.offersWork()) continue;\n // No passive rep for gangs.\n if (Player.getGangName() === name) continue;\n // 0 favor = 1%/s\n // 50 favor = 6%/s\n // 100 favor = 11%/s\n const favorMult = Math.min(0.1, faction.favor / 1000 + 0.01);\n // Find the best of all possible favor gain, minimum 1 rep / 2 minute.\n const hRep = getHackingWorkRepGain(Player, faction);\n const sRep = getFactionSecurityWorkRepGain(Player, faction);\n const fRep = getFactionFieldWorkRepGain(Player, faction);\n const rate = Math.max(hRep * favorMult, sRep * favorMult, fRep * favorMult, 1 / 120);\n\n faction.playerReputation += rate * numCycles * Player.faction_rep_mult * BitNodeMultipliers.FactionPassiveRepGain;\n }\n}\n","// Defines the ResearchTree that is common to all Corporation Industries\n// i.e. all Industries have these types of Research available to unlock\nimport { Research } from \"../Research\";\nimport { ResearchMap } from \"../ResearchMap\";\nimport { ResearchTree, Node } from \"../ResearchTree\";\n\nfunction makeNode(name: string): Node {\n const research: Research | null = ResearchMap[name];\n if (research == null) {\n throw new Error(`Invalid research name: ${name}`);\n }\n\n return new Node({ text: research.name, cost: research.cost });\n}\n\n// Creates the Nodes for the BaseResearchTree.\n// Return the Root Node\nfunction createBaseResearchTreeNodes(): Node {\n const rootNode: Node = makeNode(\"Hi-Tech R&D Laboratory\");\n const autoBrew: Node = makeNode(\"AutoBrew\");\n const autoParty: Node = makeNode(\"AutoPartyManager\");\n const autoDrugs: Node = makeNode(\"Automatic Drug Administration\");\n const bulkPurchasing: Node = makeNode(\"Bulk Purchasing\");\n const cph4: Node = makeNode(\"CPH4 Injections\");\n const drones: Node = makeNode(\"Drones\");\n const dronesAssembly: Node = makeNode(\"Drones - Assembly\");\n const dronesTransport: Node = makeNode(\"Drones - Transport\");\n const goJuice: Node = makeNode(\"Go-Juice\");\n const hrRecruitment: Node = makeNode(\"HRBuddy-Recruitment\");\n const hrTraining: Node = makeNode(\"HRBuddy-Training\");\n const joywire: Node = makeNode(\"JoyWire\");\n const marketta1: Node = makeNode(\"Market-TA.I\");\n const marketta2: Node = makeNode(\"Market-TA.II\");\n const overclock: Node = makeNode(\"Overclock\");\n const scAssemblers: Node = makeNode(\"Self-Correcting Assemblers\");\n const stimu: Node = makeNode(\"Sti.mu\");\n\n autoDrugs.addChild(goJuice);\n autoDrugs.addChild(cph4);\n\n drones.addChild(dronesAssembly);\n drones.addChild(dronesTransport);\n\n hrRecruitment.addChild(hrTraining);\n\n marketta1.addChild(marketta2);\n\n overclock.addChild(stimu);\n\n rootNode.addChild(autoBrew);\n rootNode.addChild(autoParty);\n rootNode.addChild(autoDrugs);\n rootNode.addChild(bulkPurchasing);\n rootNode.addChild(drones);\n rootNode.addChild(hrRecruitment);\n rootNode.addChild(joywire);\n rootNode.addChild(marketta1);\n rootNode.addChild(overclock);\n rootNode.addChild(scAssemblers);\n\n return rootNode;\n}\n\nexport function getBaseResearchTreeCopy(): ResearchTree {\n const baseResearchTree: ResearchTree = new ResearchTree();\n baseResearchTree.setRoot(createBaseResearchTreeNodes());\n\n return baseResearchTree;\n}\n\n// Base Research Tree for Industry's that make products\nexport function getProductIndustryResearchTreeCopy(): ResearchTree {\n const researchTree: ResearchTree = new ResearchTree();\n const root = createBaseResearchTreeNodes();\n\n const upgradeFulcrum = makeNode(\"uPgrade: Fulcrum\");\n const upgradeCapacity1 = makeNode(\"uPgrade: Capacity.I\");\n const upgradeCapacity2 = makeNode(\"uPgrade: Capacity.II\");\n const upgradeDashboard = makeNode(\"uPgrade: Dashboard\");\n\n upgradeCapacity1.addChild(upgradeCapacity2);\n upgradeFulcrum.addChild(upgradeCapacity1);\n upgradeFulcrum.addChild(upgradeDashboard);\n root.addChild(upgradeFulcrum);\n\n researchTree.setRoot(root);\n\n return researchTree;\n}\n","/**\n * Generic Event Emitter class following a subscribe/publish paradigm.\n */\nfunction uuidv4(): string {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\nexport class EventEmitter<T extends any[]> {\n subscribers: { [key: string]: (...args: [...T]) => void | undefined } = {};\n\n subscribe(s: (...args: [...T]) => void): () => void {\n let uuid = uuidv4();\n while (this.subscribers[uuid] !== undefined) uuid = uuidv4();\n this.subscribers[uuid] = s;\n\n return () => {\n delete this.subscribers[uuid];\n };\n }\n\n emit(...args: [...T]): void {\n for (const s in this.subscribers) {\n const sub = this.subscribers[s];\n if (sub === undefined) continue;\n\n sub(...args);\n }\n }\n}\n","import { GetServer, createUniqueRandomIp, ipExists } from \"./AllServers\";\nimport { Server, IConstructorParams } from \"./Server\";\nimport { BaseServer } from \"./BaseServer\";\nimport { calculateServerGrowth } from \"./formulas/grow\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Programs } from \"../Programs/Programs\";\nimport { LiteratureNames } from \"../Literature/data/LiteratureNames\";\n\nimport { isValidNumber } from \"../utils/helpers/isValidNumber\";\n\n/**\n * Constructs a new server, while also ensuring that the new server\n * does not have a duplicate hostname/ip.\n */\nexport function safetlyCreateUniqueServer(params: IConstructorParams): Server {\n let hostname: string = params.hostname.replace(/ /g, `-`);\n\n if (params.ip != null && ipExists(params.ip)) {\n params.ip = createUniqueRandomIp();\n }\n\n if (GetServer(hostname) != null) {\n hostname = `${hostname}-0`;\n\n // Use a for loop to ensure that we don't get suck in an infinite loop somehow\n for (let i = 0; i < 200; ++i) {\n hostname = hostname.replace(/-[0-9]+$/, `-${i}`);\n if (GetServer(hostname) == null) {\n break;\n }\n }\n }\n\n params.hostname = hostname;\n return new Server(params);\n}\n\n/**\n * Returns the number of \"growth cycles\" needed to grow the specified server by the\n * specified amount.\n * @param server - Server being grown\n * @param growth - How much the server is being grown by, in DECIMAL form (e.g. 1.5 rather than 50)\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowth(server: Server, growth: number, p: IPlayer, cores = 1): number {\n let ajdGrowthRate = 1 + (CONSTANTS.ServerBaseGrowthRate - 1) / server.hackDifficulty;\n if (ajdGrowthRate > CONSTANTS.ServerMaxGrowthRate) {\n ajdGrowthRate = CONSTANTS.ServerMaxGrowthRate;\n }\n\n const serverGrowthPercentage = server.serverGrowth / 100;\n\n const coreBonus = 1 + (cores - 1) / 16;\n const cycles =\n Math.log(growth) /\n (Math.log(ajdGrowthRate) *\n p.hacking_grow_mult *\n serverGrowthPercentage *\n BitNodeMultipliers.ServerGrowthRate *\n coreBonus);\n\n return cycles;\n}\n\n//Applied server growth for a single server. Returns the percentage growth\nexport function processSingleServerGrowth(server: Server, threads: number, p: IPlayer, cores = 1): number {\n let serverGrowth = calculateServerGrowth(server, threads, p, cores);\n if (serverGrowth < 1) {\n console.warn(\"serverGrowth calculated to be less than 1\");\n serverGrowth = 1;\n }\n\n const oldMoneyAvailable = server.moneyAvailable;\n server.moneyAvailable += 1 * threads; // It can be grown even if it has no money\n server.moneyAvailable *= serverGrowth;\n\n // in case of data corruption\n if (isValidNumber(server.moneyMax) && isNaN(server.moneyAvailable)) {\n server.moneyAvailable = server.moneyMax;\n }\n\n // cap at max\n if (isValidNumber(server.moneyMax) && server.moneyAvailable > server.moneyMax) {\n server.moneyAvailable = server.moneyMax;\n }\n\n // if there was any growth at all, increase security\n if (oldMoneyAvailable !== server.moneyAvailable) {\n //Growing increases server security twice as much as hacking\n let usedCycles = numCycleForGrowth(server, server.moneyAvailable / oldMoneyAvailable, p, cores);\n usedCycles = Math.min(Math.max(0, Math.ceil(usedCycles)), threads);\n server.fortify(2 * CONSTANTS.ServerFortifyAmount * usedCycles);\n }\n return server.moneyAvailable / oldMoneyAvailable;\n}\n\nexport function prestigeHomeComputer(player: IPlayer, homeComp: Server): void {\n const hasBitflume = homeComp.programs.includes(Programs.BitFlume.name);\n\n homeComp.programs.length = 0; //Remove programs\n homeComp.runningScripts = [];\n homeComp.serversOnNetwork = [];\n homeComp.isConnectedTo = true;\n homeComp.ramUsed = 0;\n homeComp.programs.push(Programs.NukeProgram.name);\n if (hasBitflume) {\n homeComp.programs.push(Programs.BitFlume.name);\n }\n\n //Update RAM usage on all scripts\n homeComp.scripts.forEach(function (script) {\n script.updateRamUsage(player, homeComp.scripts);\n });\n\n homeComp.messages.length = 0; //Remove .lit and .msg files\n homeComp.messages.push(LiteratureNames.HackersStartingHandbook);\n}\n\n// Returns the i-th server on the specified server's network\n// A Server's serverOnNetwork property holds only the IPs. This function returns\n// the actual Server object\nexport function getServerOnNetwork(server: BaseServer, i: number): BaseServer | null {\n if (i > server.serversOnNetwork.length) {\n console.error(\"Tried to get server on network that was out of range\");\n return null;\n }\n\n return GetServer(server.serversOnNetwork[i]);\n}\n\nexport function isBackdoorInstalled(server: BaseServer): boolean {\n if (server instanceof Server) {\n return server.backdoorInstalled;\n }\n return false;\n}\n","export const SkillNames: {\n BladesIntuition: string;\n Cloak: string;\n Marksman: string;\n WeaponProficiency: string;\n ShortCircuit: string;\n DigitalObserver: string;\n Tracer: string;\n Overclock: string;\n Reaper: string;\n EvasiveSystem: string;\n Datamancer: string;\n CybersEdge: string;\n HandsOfMidas: string;\n Hyperdrive: string;\n} = {\n BladesIntuition: \"Blade's Intuition\",\n Cloak: \"Cloak\",\n Marksman: \"Marksman\",\n WeaponProficiency: \"Weapon Proficiency\",\n ShortCircuit: \"Short-Circuit\",\n DigitalObserver: \"Digital Observer\",\n Tracer: \"Tracer\",\n Overclock: \"Overclock\",\n Reaper: \"Reaper\",\n EvasiveSystem: \"Evasive System\",\n Datamancer: \"Datamancer\",\n CybersEdge: \"Cyber's Edge\",\n HandsOfMidas: \"Hands of Midas\",\n Hyperdrive: \"Hyperdrive\",\n};\n","/**\n * Checks whether the value passed in can be considered a string.\n * @param value The value to check if it is a string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function isString(value: any): boolean {\n return typeof value === \"string\" || value instanceof String;\n}\n","import React, { useState } from \"react\";\nimport AddIcon from \"@mui/icons-material/Add\";\nimport RemoveIcon from \"@mui/icons-material/Remove\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ClearIcon from \"@mui/icons-material/Clear\";\nimport DoubleArrowIcon from \"@mui/icons-material/DoubleArrow\";\nimport TextField from \"@mui/material/TextField\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IProps {\n label: string;\n placeholder: string;\n add: (x: number) => void;\n subtract: (x: number) => void;\n tons: () => void;\n reset: () => void;\n}\n\nexport function Adjuster(props: IProps): React.ReactElement {\n const [value, setValue] = useState<number | string>(\"\");\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setValue(\"\");\n else setValue(parseFloat(event.target.value));\n }\n\n const { label, placeholder, add, subtract, reset, tons } = props;\n return (\n <>\n <TextField\n label={label}\n value={value}\n onChange={onChange}\n placeholder={placeholder}\n type=\"number\"\n InputProps={{\n startAdornment: (\n <>\n <Tooltip title=\"Add a lot\">\n <IconButton onClick={tons} size=\"large\">\n <DoubleArrowIcon style={{ transform: \"rotate(-90deg)\" }} />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Add\">\n <IconButton onClick={() => add(typeof value !== \"string\" ? value : 0)} size=\"large\">\n <AddIcon />\n </IconButton>\n </Tooltip>\n </>\n ),\n endAdornment: (\n <>\n <Tooltip title=\"Remove\">\n <IconButton onClick={() => subtract(typeof value !== \"string\" ? value : 0)} size=\"large\">\n <RemoveIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Reset\">\n <IconButton onClick={reset} size=\"large\">\n <ClearIcon />\n </IconButton>\n </Tooltip>\n </>\n ),\n }}\n />\n </>\n );\n}\n","import { Operation, IOperationParams } from \"./Operation\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport class BlackOperation extends Operation {\n constructor(params: IOperationParams | null = null) {\n super(params);\n this.count = 1;\n }\n\n // To be implemented by subtypes\n getActionTimePenalty(): number {\n return 1.5;\n }\n\n getChaosCompetencePenalty(/*inst: IBladeburner, params: ISuccessChanceParams*/): number {\n return 1;\n }\n\n getChaosDifficultyBonus(/*inst: IBladeburner, params: ISuccessChanceParams*/): number {\n return 1;\n }\n\n toJSON(): any {\n return Generic_toJSON(\"BlackOperation\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Operation {\n return Generic_fromJSON(BlackOperation, value.data);\n }\n}\n\nReviver.constructors.BlackOperation = BlackOperation;\n","import React, { useContext } from \"react\";\nimport { IGang } from \"../IGang\";\n\nexport const Context: {\n Gang: React.Context<IGang>;\n} = {\n Gang: React.createContext<IGang>({} as IGang),\n};\n\nexport const useGang = (): IGang => useContext(Context.Gang);\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { ICorporation } from \"../ICorporation\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n unbuyable: {\n color: theme.palette.action.disabled,\n },\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\ninterface IProps {\n money: number;\n corp: ICorporation;\n}\n\nexport function MoneyCost(props: IProps): React.ReactElement {\n const classes = useStyles();\n if (!(props.corp.funds > props.money))\n return <span className={classes.unbuyable}>{numeralWrapper.formatMoney(props.money)}</span>;\n\n return <span className={classes.money}>{numeralWrapper.formatMoney(props.money)}</span>;\n}\n","/**\n * Stops an actively-running script (represented by a WorkerScript object)\n * and removes it from the global pool of active scripts.\n */\nimport { WorkerScript } from \"./WorkerScript\";\nimport { workerScripts } from \"./WorkerScripts\";\nimport { WorkerScriptStartStopEventEmitter } from \"./WorkerScriptStartStopEventEmitter\";\n\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { compareArrays } from \"../utils/helpers/compareArrays\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { AddRecentScript } from \"./RecentScripts\";\nimport { Player } from \"../Player\";\n\nexport function killWorkerScript(runningScriptObj: RunningScript, hostname: string, rerenderUi?: boolean): boolean;\nexport function killWorkerScript(workerScript: WorkerScript): boolean;\nexport function killWorkerScript(pid: number): boolean;\nexport function killWorkerScript(\n script: RunningScript | WorkerScript | number,\n hostname?: string,\n rerenderUi?: boolean,\n): boolean {\n if (rerenderUi == null || typeof rerenderUi !== \"boolean\") {\n rerenderUi = true;\n }\n\n if (script instanceof WorkerScript) {\n stopAndCleanUpWorkerScript(script);\n\n return true;\n } else if (script instanceof RunningScript && typeof hostname === \"string\") {\n // Try to kill by PID\n const res = killWorkerScriptByPid(script.pid, rerenderUi);\n if (res) {\n return res;\n }\n\n // If for some reason that doesn't work, we'll try the old way\n for (const ws of workerScripts.values()) {\n if (ws.name == script.filename && ws.hostname == hostname && compareArrays(ws.args, script.args)) {\n stopAndCleanUpWorkerScript(ws, rerenderUi);\n\n return true;\n }\n }\n\n return false;\n } else if (typeof script === \"number\") {\n return killWorkerScriptByPid(script, rerenderUi);\n } else {\n console.error(`killWorkerScript() called with invalid argument:`);\n console.error(script);\n return false;\n }\n}\n\nfunction killWorkerScriptByPid(pid: number, rerenderUi = true): boolean {\n const ws = workerScripts.get(pid);\n if (ws instanceof WorkerScript) {\n stopAndCleanUpWorkerScript(ws, rerenderUi);\n\n return true;\n }\n\n return false;\n}\n\nfunction stopAndCleanUpWorkerScript(workerScript: WorkerScript, rerenderUi = true): void {\n if (typeof workerScript.atExit === \"function\") {\n try {\n workerScript.atExit();\n } catch (e: any) {\n dialogBoxCreate(\n `Error trying to call atExit for script ${workerScript.name} on ${workerScript.hostname} ${workerScript.scriptRef.args} ${e}`,\n );\n }\n workerScript.atExit = undefined;\n }\n workerScript.env.stopFlag = true;\n killNetscriptDelay(workerScript);\n removeWorkerScript(workerScript, rerenderUi);\n}\n\n/**\n * Helper function that removes the script being killed from the global pool.\n * Also handles other cleanup-time operations\n *\n * @param {WorkerScript} - Identifier for WorkerScript. Either the object itself, or\n * its index in the global workerScripts array\n */\nfunction removeWorkerScript(workerScript: WorkerScript, rerenderUi = true): void {\n const ip = workerScript.hostname;\n const name = workerScript.name;\n\n // Get the server on which the script runs\n const server = GetServer(ip);\n if (server == null) {\n console.error(`Could not find server on which this script is running: ${ip}`);\n return;\n }\n\n // Delete the RunningScript object from that server\n for (let i = 0; i < server.runningScripts.length; ++i) {\n const runningScript = server.runningScripts[i];\n if (runningScript.filename === name && compareArrays(runningScript.args, workerScript.args)) {\n server.runningScripts.splice(i, 1);\n break;\n }\n }\n\n // Recalculate ram used on that server\n\n server.updateRamUsed(0, Player);\n for (const rs of server.runningScripts) server.updateRamUsed(server.ramUsed + rs.ramUsage * rs.threads, Player);\n\n // Delete script from global pool (workerScripts)\n workerScripts.delete(workerScript.pid);\n // const res = workerScripts.delete(workerScript.pid);\n // if (!res) {\n // console.warn(`removeWorkerScript() called with WorkerScript that wasn't in the global map:`);\n // console.warn(workerScript);\n // }\n AddRecentScript(workerScript);\n\n if (rerenderUi) {\n WorkerScriptStartStopEventEmitter.emit();\n }\n}\n\n/**\n * Helper function that interrupts a script's delay if it is in the middle of a\n * timed, blocked operation (like hack(), sleep(), etc.). This allows scripts to\n * be killed immediately even if they're in the middle of one of those long operations\n */\nfunction killNetscriptDelay(workerScript: WorkerScript): void {\n if (workerScript instanceof WorkerScript) {\n if (workerScript.delay) {\n clearTimeout(workerScript.delay);\n if (workerScript.delayReject) {\n workerScript.delayReject(workerScript);\n }\n }\n }\n}\n","import React, { useEffect } from \"react\";\nimport { useSnackbar, SnackbarProvider as SB } from \"notistack\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Alert from \"@mui/material/Alert\";\nimport Paper from \"@mui/material/Paper\";\nimport { logBoxBaseZIndex } from \"./LogBoxManager\";\n\ninterface IProps {\n children: React.ReactNode | React.ReactNode[];\n}\n\nconst useStyles = makeStyles(() => ({\n snackbar: {\n // Log popup z-index increments, so let's add a padding to be well above them.\n zIndex: `${logBoxBaseZIndex + 1000} !important` as any,\n\n \"& .MuiAlert-icon\": {\n alignSelf: 'center',\n },\n }\n}));\n\nexport function SnackbarProvider(props: IProps): React.ReactElement {\n const classes = useStyles();\n return (\n <SB dense maxSnack={9} anchorOrigin={{ horizontal: \"right\", vertical: \"bottom\" }} autoHideDuration={2000}\n classes={{ containerRoot: classes.snackbar }}>\n {props.children}\n </SB>\n );\n}\n\nexport const SnackbarEvents = new EventEmitter<[string | React.ReactNode, \"success\" | \"warning\" | \"error\" | \"info\", number]>();\n\nexport function Snackbar(): React.ReactElement {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n\n useEffect(() =>\n SnackbarEvents.subscribe((s, variant, duration) => {\n const id = enqueueSnackbar(<Alert severity={variant}>{s}</Alert>, {\n content: (k, m) => <Paper key={k}>{m}</Paper>,\n variant: variant,\n autoHideDuration: duration,\n onClick: () => closeSnackbar(id),\n })\n }),\n );\n return <></>;\n}\n","import { IMinMaxRange } from \"../types\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\nexport const StockForecastInfluenceLimit = 5;\n\nexport interface IConstructorParams {\n b: boolean;\n initPrice: number | IMinMaxRange;\n marketCap: number;\n mv: number | IMinMaxRange;\n name: string;\n otlkMag: number;\n spreadPerc: number | IMinMaxRange;\n shareTxForMovement: number | IMinMaxRange;\n symbol: string;\n}\n\nconst defaultConstructorParams: IConstructorParams = {\n b: true,\n initPrice: 10e3,\n marketCap: 1e12,\n mv: 1,\n name: \"\",\n otlkMag: 0,\n spreadPerc: 0,\n shareTxForMovement: 1e6,\n symbol: \"\",\n};\n\n// Helper function that convert a IMinMaxRange to a number\nfunction toNumber(n: number | IMinMaxRange): number {\n let value: number;\n switch (typeof n) {\n case \"number\": {\n return n;\n }\n case \"object\": {\n const range = n as IMinMaxRange;\n value = getRandomInt(range.min, range.max);\n break;\n }\n default:\n throw Error(`Do not know how to convert the type '${typeof n}' to a number`);\n }\n\n if (typeof n === \"object\" && typeof n.divisor === \"number\") {\n return value / n.divisor;\n }\n\n return value;\n}\n\n/**\n * Represents the valuation of a company in the World Stock Exchange.\n */\nexport class Stock {\n /**\n * Bear or bull (more likely to go up or down, based on otlkMag)\n */\n b: boolean;\n\n /**\n * Maximum price of a stock (per share)\n */\n readonly cap: number;\n\n /**\n * Stocks previous share price\n */\n lastPrice: number;\n\n /**\n * Maximum number of shares that player can own (both long and short combined)\n */\n readonly maxShares: number;\n\n /**\n * Maximum volatility\n */\n readonly mv: number;\n\n /**\n * Name of the company that the stock is for\n */\n readonly name: string;\n\n /**\n * Outlook magnitude. Represents the stock's forecast and likelihood\n * of increasing/decreasing (based on whether its in bear or bull mode)\n */\n otlkMag: number;\n\n /**\n * Forecast of outlook magnitude. Essentially a second-order forecast.\n * Unlike 'otlkMag', this number is on an absolute scale from 0-100 (rather than 0-50)\n */\n otlkMagForecast: number;\n\n /**\n * Average price of stocks that the player owns in the LONG position\n */\n playerAvgPx: number;\n\n /**\n * Average price of stocks that the player owns in the SHORT position\n */\n playerAvgShortPx: number;\n\n /**\n * Number of shares the player owns in the LONG position\n */\n playerShares: number;\n\n /**\n * Number of shares the player owns in the SHORT position\n */\n playerShortShares: number;\n\n /**\n * Stock's share price\n */\n price: number;\n\n /**\n * How many shares need to be transacted in order to trigger a price movement\n */\n readonly shareTxForMovement: number;\n\n /**\n * How many share transactions remaining until a price movement occurs\n * (separately tracked for upward and downward movements)\n */\n shareTxUntilMovement: number;\n\n /**\n * Spread percentage. The bid/ask prices for this stock are N% above or below\n * the \"real price\" to emulate spread.\n */\n readonly spreadPerc: number;\n\n /**\n * The stock's ticker symbol\n */\n readonly symbol: string;\n\n /**\n * Total number of shares of this stock\n * This is different than maxShares, as this is like authorized stock while\n * maxShares is outstanding stock.\n */\n readonly totalShares: number;\n\n constructor(p: IConstructorParams = defaultConstructorParams) {\n this.name = p.name;\n this.symbol = p.symbol;\n this.price = toNumber(p.initPrice);\n this.lastPrice = this.price;\n this.playerShares = 0;\n this.playerAvgPx = 0;\n this.playerShortShares = 0;\n this.playerAvgShortPx = 0;\n this.mv = toNumber(p.mv);\n this.b = p.b;\n this.otlkMag = p.otlkMag;\n this.otlkMagForecast = this.getAbsoluteForecast();\n this.cap = getRandomInt(this.price * 1e3, this.price * 25e3);\n this.spreadPerc = toNumber(p.spreadPerc);\n this.shareTxForMovement = toNumber(p.shareTxForMovement);\n this.shareTxUntilMovement = this.shareTxForMovement;\n\n // Total shares is determined by market cap, and is rounded to nearest 100k\n const totalSharesUnrounded: number = p.marketCap / this.price;\n this.totalShares = Math.round(totalSharesUnrounded / 1e5) * 1e5;\n\n // Max Shares (Outstanding shares) is a percentage of total shares\n const outstandingSharePercentage = 0.2;\n this.maxShares = Math.round((this.totalShares * outstandingSharePercentage) / 1e5) * 1e5;\n }\n\n /**\n * Safely set the stock's second-order forecast to a new value\n */\n changeForecastForecast(newff: number): void {\n this.otlkMagForecast = newff;\n if (this.otlkMagForecast > 100) {\n this.otlkMagForecast = 100;\n } else if (this.otlkMagForecast < 0) {\n this.otlkMagForecast = 0;\n }\n }\n\n /**\n * Set the stock to a new price. Also updates the stock's previous price tracker\n */\n changePrice(newPrice: number): void {\n this.lastPrice = this.price;\n this.price = newPrice;\n }\n\n /**\n * Change the stock's forecast during a stock market 'tick'.\n * The way a stock's forecast changes depends on various internal properties,\n * but is ultimately determined by RNG\n */\n cycleForecast(changeAmt = 0.1): void {\n const increaseChance = this.getForecastIncreaseChance();\n\n if (Math.random() < increaseChance) {\n // Forecast increases\n if (this.b) {\n this.otlkMag += changeAmt;\n } else {\n this.otlkMag -= changeAmt;\n }\n } else {\n // Forecast decreases\n if (this.b) {\n this.otlkMag -= changeAmt;\n } else {\n this.otlkMag += changeAmt;\n }\n }\n\n this.otlkMag = Math.min(this.otlkMag, 50);\n if (this.otlkMag < 0) {\n this.otlkMag *= -1;\n this.b = !this.b;\n }\n }\n\n /**\n * Change's the stock's second-order forecast during a stock market 'tick'.\n * The change for the second-order forecast to increase is 50/50\n */\n cycleForecastForecast(changeAmt = 0.1): void {\n if (Math.random() < 0.5) {\n this.changeForecastForecast(this.otlkMagForecast + changeAmt);\n } else {\n this.changeForecastForecast(this.otlkMagForecast - changeAmt);\n }\n }\n\n /**\n * \"Flip\" the stock's second-order forecast. This can occur during a\n * stock market \"cycle\" (determined by RNG). It is used to simulate\n * RL stock market cycles and introduce volatility\n */\n flipForecastForecast(): void {\n const diff = this.otlkMagForecast - 50;\n this.otlkMagForecast = 50 + -1 * diff;\n }\n\n /**\n * Returns the stock's absolute forecast, which is a number between 0-100\n */\n getAbsoluteForecast(): number {\n return this.b ? 50 + this.otlkMag : 50 - this.otlkMag;\n }\n\n /**\n * Return the price at which YOUR stock is bought (market ask price). Accounts for spread\n */\n getAskPrice(): number {\n return this.price * (1 + this.spreadPerc / 100);\n }\n\n /**\n * Return the price at which YOUR stock is sold (market bid price). Accounts for spread\n */\n getBidPrice(): number {\n return this.price * (1 - this.spreadPerc / 100);\n }\n\n /**\n * Returns the chance (0-1 decimal) that a stock has of having its forecast increase\n */\n getForecastIncreaseChance(): number {\n const diff = this.otlkMagForecast - this.getAbsoluteForecast();\n\n return (50 + Math.min(Math.max(diff, -45), 45)) / 100;\n }\n\n /**\n * Changes a stock's forecast. This is used when the stock is influenced\n * by a transaction. The stock's forecast always goes towards 50, but the\n * movement is capped by a certain threshold/limit\n */\n influenceForecast(change: number): void {\n if (this.otlkMag > StockForecastInfluenceLimit) {\n this.otlkMag = Math.max(StockForecastInfluenceLimit, this.otlkMag - change);\n }\n }\n\n /**\n * Changes a stock's second-order forecast. This is used when the stock is\n * influenced by a transaction. The stock's second-order forecast always\n * goes towards 50.\n */\n influenceForecastForecast(change: number): void {\n if (this.otlkMagForecast > 50) {\n this.otlkMagForecast -= change;\n this.otlkMagForecast = Math.max(50, this.otlkMagForecast);\n } else if (this.otlkMagForecast < 50) {\n this.otlkMagForecast += change;\n this.otlkMagForecast = Math.min(50, this.otlkMagForecast);\n }\n }\n\n /**\n * Serialize the Stock to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Stock\", this);\n }\n\n /**\n * Initializes a Stock from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Stock {\n return Generic_fromJSON(Stock, value.data);\n }\n}\n\nReviver.constructors.Stock = Stock;\n","/**\n * Map of all Cities in the game\n * Key = City Name, Value = City object\n */\nimport { City } from \"./City\";\nimport { IMap } from \"../types\";\n\nexport const Cities: IMap<City> = {};\n","import { Augmentation, IConstructorParams } from \"./Augmentation\";\nimport { Augmentations } from \"./Augmentations\";\nimport { PlayerOwnedAugmentation, IPlayerOwnedAugmentation } from \"./PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"./data/AugmentationNames\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { Factions, factionExists } from \"../Faction/Factions\";\nimport { Player } from \"../Player\";\nimport { prestigeAugmentation } from \"../Prestige\";\nimport { Programs } from \"../Programs/Programs\";\nimport { SourceFileFlags } from \"../SourceFile/SourceFileFlags\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { clearObject } from \"../utils/helpers/clearObject\";\n\nimport { WHRNG } from \"../Casino/RNG\";\n\nimport React from \"react\";\n\nfunction AddToAugmentations(aug: Augmentation): void {\n const name = aug.name;\n Augmentations[name] = aug;\n}\n\nfunction getRandomBonus(): any {\n const bonuses = [\n {\n bonuses: {\n hacking_chance_mult: 1.25,\n hacking_speed_mult: 1.1,\n hacking_money_mult: 1.25,\n hacking_grow_mult: 1.1,\n },\n description:\n \"Increases the player's hacking chance by 25%.<br>\" +\n \"Increases the player's hacking speed by 10%.<br>\" +\n \"Increases the amount of money the player's gains from hacking by 25%.<br>\" +\n \"Improves grow() by 10%.\",\n },\n {\n bonuses: {\n hacking_mult: 1.15,\n hacking_exp_mult: 2,\n },\n description:\n \"Increases the player's hacking skill by 15%.<br>\" +\n \"Increases the player's hacking experience gain rate by 100%.\",\n },\n {\n bonuses: {\n strength_mult: 1.25,\n strength_exp_mult: 2,\n defense_mult: 1.25,\n defense_exp_mult: 2,\n dexterity_mult: 1.25,\n dexterity_exp_mult: 2,\n agility_mult: 1.25,\n agility_exp_mult: 2,\n },\n description:\n \"Increases all of the player's combat stats by 25%.<br>\" +\n \"Increases all of the player's combat stat experience gain rate by 100%.\",\n },\n {\n bonuses: {\n charisma_mult: 1.5,\n charisma_exp_mult: 2,\n },\n description:\n \"This augmentation increases the player's charisma by 50%.<br>\" +\n \"Increases the player's charisma experience gain rate by 100%.\",\n },\n {\n bonuses: {\n hacknet_node_money_mult: 1.2,\n hacknet_node_purchase_cost_mult: 0.85,\n hacknet_node_ram_cost_mult: 0.85,\n hacknet_node_core_cost_mult: 0.85,\n hacknet_node_level_cost_mult: 0.85,\n },\n description:\n \"Increases the amount of money produced by Hacknet Nodes by 20%.<br>\" +\n \"Decreases all costs related to Hacknet Node by 15%.\",\n },\n {\n bonuses: {\n company_rep_mult: 1.25,\n faction_rep_mult: 1.15,\n work_money_mult: 1.7,\n },\n description:\n \"Increases the amount of money the player gains from working by 70%.<br>\" +\n \"Increases the amount of reputation the player gains when working for a company by 25%.<br>\" +\n \"Increases the amount of reputation the player gains for a faction by 15%.\",\n },\n {\n bonuses: {\n crime_success_mult: 2,\n crime_money_mult: 2,\n },\n description:\n \"Increases the player's crime success rate by 100%.<br>\" +\n \"Increases the amount of money the player gains from crimes by 100%.\",\n },\n ];\n\n const randomNumber = new WHRNG(Math.floor(Player.lastUpdate / 3600000));\n for (let i = 0; i < 5; i++) randomNumber.step();\n\n return bonuses[Math.floor(bonuses.length * randomNumber.random())];\n}\n\nfunction initAugmentations(): void {\n for (const name of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(name)) {\n Factions[name].augmentations = [];\n }\n }\n\n //Reset Augmentations\n clearObject(Augmentations);\n\n //Time-Based Augment Test\n const randomBonuses = getRandomBonus();\n\n const UnstableCircadianModulatorParams: IConstructorParams = {\n name: AugmentationNames.UnstableCircadianModulator,\n moneyCost: 5e9,\n repCost: 3.625e5,\n info:\n \"An experimental nanobot injection. Its unstable nature leads to \" +\n \"unpredictable results based on your circadian rhythm.\",\n };\n Object.keys(randomBonuses.bonuses).forEach(\n (key) => ((UnstableCircadianModulatorParams as any)[key] = randomBonuses.bonuses[key]),\n );\n const UnstableCircadianModulator = new Augmentation(UnstableCircadianModulatorParams);\n\n UnstableCircadianModulator.addToFactions([\"Speakers for the Dead\"]);\n if (augmentationExists(AugmentationNames.UnstableCircadianModulator)) {\n delete Augmentations[AugmentationNames.UnstableCircadianModulator];\n }\n AddToAugmentations(UnstableCircadianModulator);\n\n //Combat stat augmentations\n const HemoRecirculator = new Augmentation({\n name: AugmentationNames.HemoRecirculator,\n moneyCost: 4.5e7,\n repCost: 1e4,\n info: \"A heart implant that greatly increases the body's ability to effectively use and pump \" + \"blood.\",\n strength_mult: 1.08,\n defense_mult: 1.08,\n agility_mult: 1.08,\n dexterity_mult: 1.08,\n });\n HemoRecirculator.addToFactions([\"Tetrads\", \"The Dark Army\", \"The Syndicate\"]);\n if (augmentationExists(AugmentationNames.HemoRecirculator)) {\n delete Augmentations[AugmentationNames.HemoRecirculator];\n }\n AddToAugmentations(HemoRecirculator);\n\n const Targeting1 = new Augmentation({\n name: AugmentationNames.Targeting1,\n moneyCost: 1.5e7,\n repCost: 5e3,\n info:\n \"A cranial implant that is embedded within the inner ear structures and optic nerves. It regulates \" +\n \"and enhances balance and hand-eye coordination.\",\n dexterity_mult: 1.1,\n });\n Targeting1.addToFactions([\n \"Slum Snakes\",\n \"The Dark Army\",\n \"The Syndicate\",\n \"Sector-12\",\n \"Ishima\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.Targeting1)) {\n delete Augmentations[AugmentationNames.Targeting1];\n }\n AddToAugmentations(Targeting1);\n\n const Targeting2 = new Augmentation({\n name: AugmentationNames.Targeting2,\n moneyCost: 4.25e7,\n repCost: 8.75e3,\n info:\n \"This upgraded version of the 'Augmented Targeting' implant is capable of augmenting \" +\n \"reality by digitally displaying weaknesses and vital signs of threats.\",\n prereqs: [AugmentationNames.Targeting1],\n dexterity_mult: 1.2,\n });\n Targeting2.addToFactions([\n \"The Dark Army\",\n \"The Syndicate\",\n \"Sector-12\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.Targeting2)) {\n delete Augmentations[AugmentationNames.Targeting2];\n }\n AddToAugmentations(Targeting2);\n\n const Targeting3 = new Augmentation({\n name: AugmentationNames.Targeting3,\n moneyCost: 1.15e8,\n repCost: 2.75e4,\n info: \"The latest version of the 'Augmented Targeting' implant adds the ability to lock-on and track threats.\",\n prereqs: [AugmentationNames.Targeting2],\n dexterity_mult: 1.3,\n });\n Targeting3.addToFactions([\n \"The Dark Army\",\n \"The Syndicate\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n \"The Covenant\",\n ]);\n if (augmentationExists(AugmentationNames.Targeting3)) {\n delete Augmentations[AugmentationNames.Targeting3];\n }\n AddToAugmentations(Targeting3);\n\n const SyntheticHeart = new Augmentation({\n name: AugmentationNames.SyntheticHeart,\n moneyCost: 2.875e9,\n repCost: 7.5e5,\n info:\n \"This advanced artificial heart, created from plasteel and graphene, is capable of pumping blood \" +\n \"more efficiently than an organic heart.\",\n agility_mult: 1.5,\n strength_mult: 1.5,\n });\n SyntheticHeart.addToFactions([\n \"KuaiGong International\",\n \"Fulcrum Secret Technologies\",\n \"Speakers for the Dead\",\n \"NWO\",\n \"The Covenant\",\n \"Daedalus\",\n \"Illuminati\",\n ]);\n if (augmentationExists(AugmentationNames.SyntheticHeart)) {\n delete Augmentations[AugmentationNames.SyntheticHeart];\n }\n AddToAugmentations(SyntheticHeart);\n\n const SynfibrilMuscle = new Augmentation({\n name: AugmentationNames.SynfibrilMuscle,\n repCost: 4.375e5,\n moneyCost: 1.125e9,\n info:\n \"The myofibrils in human muscles are injected with special chemicals that react with the proteins inside \" +\n \"the myofibrils, altering their underlying structure. The end result is muscles that are stronger and more elastic. \" +\n \"Scientists have named these artificially enhanced units 'synfibrils'.\",\n strength_mult: 1.3,\n defense_mult: 1.3,\n });\n SynfibrilMuscle.addToFactions([\n \"KuaiGong International\",\n \"Fulcrum Secret Technologies\",\n \"Speakers for the Dead\",\n \"NWO\",\n \"The Covenant\",\n \"Daedalus\",\n \"Illuminati\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.SynfibrilMuscle)) {\n delete Augmentations[AugmentationNames.SynfibrilMuscle];\n }\n AddToAugmentations(SynfibrilMuscle);\n\n const CombatRib1 = new Augmentation({\n name: AugmentationNames.CombatRib1,\n repCost: 7.5e3,\n moneyCost: 2.375e7,\n info:\n \"The rib cage is augmented to continuously release boosters into the bloodstream \" +\n \"which increase the oxygen-carrying capacity of blood.\",\n strength_mult: 1.1,\n defense_mult: 1.1,\n });\n CombatRib1.addToFactions([\n \"Slum Snakes\",\n \"The Dark Army\",\n \"The Syndicate\",\n \"Volhaven\",\n \"Ishima\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.CombatRib1)) {\n delete Augmentations[AugmentationNames.CombatRib1];\n }\n AddToAugmentations(CombatRib1);\n\n const CombatRib2 = new Augmentation({\n name: AugmentationNames.CombatRib2,\n repCost: 1.875e4,\n moneyCost: 6.5e7,\n info:\n \"An upgraded version of the 'Combat Rib' augmentation that adds potent stimulants which \" +\n \"improve focus and endurance while decreasing reaction time and fatigue.\",\n prereqs: [AugmentationNames.CombatRib1],\n strength_mult: 1.14,\n defense_mult: 1.14,\n });\n CombatRib2.addToFactions([\n \"The Dark Army\",\n \"The Syndicate\",\n \"Volhaven\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.CombatRib2)) {\n delete Augmentations[AugmentationNames.CombatRib2];\n }\n AddToAugmentations(CombatRib2);\n\n const CombatRib3 = new Augmentation({\n name: AugmentationNames.CombatRib3,\n repCost: 3.5e4,\n moneyCost: 1.2e8,\n info:\n \"The latest version of the 'Combat Rib' augmentation releases advanced anabolic steroids that \" +\n \"improve muscle mass and physical performance while being safe and free of side effects.\",\n prereqs: [AugmentationNames.CombatRib2],\n strength_mult: 1.18,\n defense_mult: 1.18,\n });\n CombatRib3.addToFactions([\n \"The Dark Army\",\n \"The Syndicate\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n \"The Covenant\",\n ]);\n if (augmentationExists(AugmentationNames.CombatRib3)) {\n delete Augmentations[AugmentationNames.CombatRib3];\n }\n AddToAugmentations(CombatRib3);\n\n const NanofiberWeave = new Augmentation({\n name: AugmentationNames.NanofiberWeave,\n repCost: 3.75e4,\n moneyCost: 1.25e8,\n info:\n \"Synthetic nanofibers are woven into the skin's extracellular matrix using electrospinning, \" +\n \"which improves its regenerative and extracellular homeostasis abilities.\",\n strength_mult: 1.2,\n defense_mult: 1.2,\n });\n NanofiberWeave.addToFactions([\n \"Tian Di Hui\",\n \"The Syndicate\",\n \"The Dark Army\",\n \"Speakers for the Dead\",\n \"Blade Industries\",\n \"Fulcrum Secret Technologies\",\n \"OmniTek Incorporated\",\n ]);\n if (augmentationExists(AugmentationNames.NanofiberWeave)) {\n delete Augmentations[AugmentationNames.NanofiberWeave];\n }\n AddToAugmentations(NanofiberWeave);\n\n const SubdermalArmor = new Augmentation({\n name: AugmentationNames.SubdermalArmor,\n repCost: 8.75e5,\n moneyCost: 3.25e9,\n info:\n \"The NEMEAN Subdermal Weave is a thin, light-weight, graphene plating that houses a dilatant fluid. \" +\n \"The material is implanted underneath the skin, and is the most advanced form of defensive enhancement \" +\n \"that has ever been created. The dilatant fluid, despite being thin and light, is extremely effective \" +\n \"at stopping piercing blows and reducing blunt trauma. The properties of graphene allow the plating to \" +\n \"mitigate damage from any fire or electrical traumas.\",\n defense_mult: 2.2,\n });\n SubdermalArmor.addToFactions([\n \"The Syndicate\",\n \"Fulcrum Secret Technologies\",\n \"Illuminati\",\n \"Daedalus\",\n \"The Covenant\",\n ]);\n if (augmentationExists(AugmentationNames.SubdermalArmor)) {\n delete Augmentations[AugmentationNames.SubdermalArmor];\n }\n AddToAugmentations(SubdermalArmor);\n\n const WiredReflexes = new Augmentation({\n name: AugmentationNames.WiredReflexes,\n repCost: 1.25e3,\n moneyCost: 2.5e6,\n info:\n \"Synthetic nerve-enhancements are injected into all major parts of the somatic nervous system, \" +\n \"supercharging the spread of neural signals and increasing reflex speed.\",\n agility_mult: 1.05,\n dexterity_mult: 1.05,\n });\n WiredReflexes.addToFactions([\n \"Tian Di Hui\",\n \"Slum Snakes\",\n \"Sector-12\",\n \"Volhaven\",\n \"Aevum\",\n \"Ishima\",\n \"The Syndicate\",\n \"The Dark Army\",\n \"Speakers for the Dead\",\n ]);\n if (augmentationExists(AugmentationNames.WiredReflexes)) {\n delete Augmentations[AugmentationNames.WiredReflexes];\n }\n AddToAugmentations(WiredReflexes);\n\n const GrapheneBoneLacings = new Augmentation({\n name: AugmentationNames.GrapheneBoneLacings,\n repCost: 1.125e6,\n moneyCost: 4.25e9,\n info:\n \"Graphene is grafted and fused into the skeletal structure, \" + \"enhancing bone density and tensile strength.\",\n strength_mult: 1.7,\n defense_mult: 1.7,\n });\n GrapheneBoneLacings.addToFactions([\"Fulcrum Secret Technologies\", \"The Covenant\"]);\n if (augmentationExists(AugmentationNames.GrapheneBoneLacings)) {\n delete Augmentations[AugmentationNames.GrapheneBoneLacings];\n }\n AddToAugmentations(GrapheneBoneLacings);\n\n const BionicSpine = new Augmentation({\n name: AugmentationNames.BionicSpine,\n repCost: 4.5e4,\n moneyCost: 1.25e8,\n info:\n \"The spine is reconstructed using plasteel and carbon fibers. \" +\n \"It is now capable of stimulating and regulating neural signals \" +\n \"passing through the spinal cord, improving senses and reaction speed. \" +\n \"The 'Bionic Spine' also interfaces with all other 'Bionic' implants.\",\n strength_mult: 1.15,\n defense_mult: 1.15,\n agility_mult: 1.15,\n dexterity_mult: 1.15,\n });\n BionicSpine.addToFactions([\n \"Speakers for the Dead\",\n \"The Syndicate\",\n \"KuaiGong International\",\n \"OmniTek Incorporated\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.BionicSpine)) {\n delete Augmentations[AugmentationNames.BionicSpine];\n }\n AddToAugmentations(BionicSpine);\n\n const GrapheneBionicSpine = new Augmentation({\n name: AugmentationNames.GrapheneBionicSpine,\n repCost: 1.625e6,\n moneyCost: 6e9,\n info:\n \"An upgrade to the 'Bionic Spine' augmentation. The spine is fused with graphene \" +\n \"which enhances durability and supercharges all body functions.\",\n prereqs: [AugmentationNames.BionicSpine],\n strength_mult: 1.6,\n defense_mult: 1.6,\n agility_mult: 1.6,\n dexterity_mult: 1.6,\n });\n GrapheneBionicSpine.addToFactions([\"Fulcrum Secret Technologies\", \"ECorp\"]);\n if (augmentationExists(AugmentationNames.GrapheneBionicSpine)) {\n delete Augmentations[AugmentationNames.GrapheneBionicSpine];\n }\n AddToAugmentations(GrapheneBionicSpine);\n\n const BionicLegs = new Augmentation({\n name: AugmentationNames.BionicLegs,\n repCost: 1.5e5,\n moneyCost: 3.75e8,\n info: \"Cybernetic legs, created from plasteel and carbon fibers, enhance running speed.\",\n agility_mult: 1.6,\n });\n BionicLegs.addToFactions([\n \"Speakers for the Dead\",\n \"The Syndicate\",\n \"KuaiGong International\",\n \"OmniTek Incorporated\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.BionicLegs)) {\n delete Augmentations[AugmentationNames.BionicLegs];\n }\n AddToAugmentations(BionicLegs);\n\n const GrapheneBionicLegs = new Augmentation({\n name: AugmentationNames.GrapheneBionicLegs,\n repCost: 7.5e5,\n moneyCost: 4.5e9,\n info:\n \"An upgrade to the 'Bionic Legs' augmentation. The legs are fused \" +\n \"with graphene, greatly enhancing jumping ability.\",\n prereqs: [AugmentationNames.BionicLegs],\n agility_mult: 2.5,\n });\n GrapheneBionicLegs.addToFactions([\"MegaCorp\", \"ECorp\", \"Fulcrum Secret Technologies\"]);\n if (augmentationExists(AugmentationNames.GrapheneBionicLegs)) {\n delete Augmentations[AugmentationNames.GrapheneBionicLegs];\n }\n AddToAugmentations(GrapheneBionicLegs);\n\n // Work stat augmentations\n const SpeechProcessor = new Augmentation({\n name: AugmentationNames.SpeechProcessor,\n repCost: 7.5e3,\n moneyCost: 5e7,\n info:\n \"A cochlear implant with an embedded computer that analyzes incoming speech. \" +\n \"The embedded computer processes characteristics of incoming speech, such as tone \" +\n \"and inflection, to pick up on subtle cues and aid in social interactions.\",\n charisma_mult: 1.2,\n });\n SpeechProcessor.addToFactions([\n \"Tian Di Hui\",\n \"Chongqing\",\n \"Sector-12\",\n \"New Tokyo\",\n \"Aevum\",\n \"Ishima\",\n \"Volhaven\",\n \"Silhouette\",\n ]);\n if (augmentationExists(AugmentationNames.SpeechProcessor)) {\n delete Augmentations[AugmentationNames.SpeechProcessor];\n }\n AddToAugmentations(SpeechProcessor);\n\n const TITN41Injection = new Augmentation({\n name: AugmentationNames.TITN41Injection,\n repCost: 2.5e4,\n moneyCost: 1.9e8,\n info:\n \"TITN is a series of viruses that targets and alters the sequences of human DNA in genes that \" +\n \"control personality. The TITN-41 strain alters these genes so that the subject becomes more \" +\n \"outgoing and socialable.\",\n charisma_mult: 1.15,\n charisma_exp_mult: 1.15,\n });\n TITN41Injection.addToFactions([\"Silhouette\"]);\n if (augmentationExists(AugmentationNames.TITN41Injection)) {\n delete Augmentations[AugmentationNames.TITN41Injection];\n }\n AddToAugmentations(TITN41Injection);\n\n const EnhancedSocialInteractionImplant = new Augmentation({\n name: AugmentationNames.EnhancedSocialInteractionImplant,\n repCost: 3.75e5,\n moneyCost: 1.375e9,\n info:\n \"A cranial implant that greatly assists in the user's ability to analyze social situations \" +\n \"and interactions. The system uses a wide variety of factors such as facial expressions, body \" +\n \"language, and the voice tone, and inflection to determine the best course of action during social\" +\n \"situations. The implant also uses deep learning software to continuously learn new behavior\" +\n \"patterns and how to best respond.\",\n charisma_mult: 1.6,\n charisma_exp_mult: 1.6,\n });\n EnhancedSocialInteractionImplant.addToFactions([\n \"Bachman & Associates\",\n \"NWO\",\n \"Clarke Incorporated\",\n \"OmniTek Incorporated\",\n \"Four Sigma\",\n ]);\n if (augmentationExists(AugmentationNames.EnhancedSocialInteractionImplant)) {\n delete Augmentations[AugmentationNames.EnhancedSocialInteractionImplant];\n }\n AddToAugmentations(EnhancedSocialInteractionImplant);\n\n // Hacking augmentations\n const BitWire = new Augmentation({\n name: AugmentationNames.BitWire,\n repCost: 3.75e3,\n moneyCost: 1e7,\n info:\n \"A small brain implant embedded in the cerebrum. This regulates and improves the brain's computing \" +\n \"capabilities.\",\n hacking_mult: 1.05,\n });\n BitWire.addToFactions([\"CyberSec\", \"NiteSec\"]);\n if (augmentationExists(AugmentationNames.BitWire)) {\n delete Augmentations[AugmentationNames.BitWire];\n }\n AddToAugmentations(BitWire);\n\n const ArtificialBioNeuralNetwork = new Augmentation({\n name: AugmentationNames.ArtificialBioNeuralNetwork,\n repCost: 2.75e5,\n moneyCost: 3e9,\n info:\n \"A network consisting of millions of nanoprocessors is embedded into the brain. \" +\n \"The network is meant to mimic the way a biological brain solves a problem, with each \" +\n \"nanoprocessor acting similar to the way a neuron would in a neural network. However, these \" +\n \"nanoprocessors are programmed to perform computations much faster than organic neurons, \" +\n \"allowing the user to solve much more complex problems at a much faster rate.\",\n hacking_speed_mult: 1.03,\n hacking_money_mult: 1.15,\n hacking_mult: 1.12,\n });\n ArtificialBioNeuralNetwork.addToFactions([\"BitRunners\", \"Fulcrum Secret Technologies\"]);\n if (augmentationExists(AugmentationNames.ArtificialBioNeuralNetwork)) {\n delete Augmentations[AugmentationNames.ArtificialBioNeuralNetwork];\n }\n AddToAugmentations(ArtificialBioNeuralNetwork);\n\n const ArtificialSynapticPotentiation = new Augmentation({\n name: AugmentationNames.ArtificialSynapticPotentiation,\n repCost: 6.25e3,\n moneyCost: 8e7,\n info:\n \"The body is injected with a chemical that artificially induces synaptic potentiation, \" +\n \"otherwise known as the strengthening of synapses. This results in enhanced cognitive abilities.\",\n hacking_speed_mult: 1.02,\n hacking_chance_mult: 1.05,\n hacking_exp_mult: 1.05,\n });\n ArtificialSynapticPotentiation.addToFactions([\"The Black Hand\", \"NiteSec\"]);\n if (augmentationExists(AugmentationNames.ArtificialSynapticPotentiation)) {\n delete Augmentations[AugmentationNames.ArtificialSynapticPotentiation];\n }\n AddToAugmentations(ArtificialSynapticPotentiation);\n\n const EnhancedMyelinSheathing = new Augmentation({\n name: AugmentationNames.EnhancedMyelinSheathing,\n repCost: 1e5,\n moneyCost: 1.375e9,\n info:\n \"Electrical signals are used to induce a new, artificial form of myelinogenesis in the human body. \" +\n \"This process results in the proliferation of new, synthetic myelin sheaths in the nervous \" +\n \"system. These myelin sheaths can propogate neuro-signals much faster than their organic \" +\n \"counterparts, leading to greater processing speeds and better brain function.\",\n hacking_speed_mult: 1.03,\n hacking_exp_mult: 1.1,\n hacking_mult: 1.08,\n });\n EnhancedMyelinSheathing.addToFactions([\"Fulcrum Secret Technologies\", \"BitRunners\", \"The Black Hand\"]);\n if (augmentationExists(AugmentationNames.EnhancedMyelinSheathing)) {\n delete Augmentations[AugmentationNames.EnhancedMyelinSheathing];\n }\n AddToAugmentations(EnhancedMyelinSheathing);\n\n const SynapticEnhancement = new Augmentation({\n name: AugmentationNames.SynapticEnhancement,\n repCost: 2e3,\n moneyCost: 7.5e6,\n info:\n \"A small cranial implant that continuously uses weak electrical signals to stimulate the brain and \" +\n \"induce stronger synaptic activity. This improves the user's cognitive abilities.\",\n hacking_speed_mult: 1.03,\n });\n SynapticEnhancement.addToFactions([\"CyberSec\", \"Aevum\"]);\n if (augmentationExists(AugmentationNames.SynapticEnhancement)) {\n delete Augmentations[AugmentationNames.SynapticEnhancement];\n }\n AddToAugmentations(SynapticEnhancement);\n\n const NeuralRetentionEnhancement = new Augmentation({\n name: AugmentationNames.NeuralRetentionEnhancement,\n repCost: 2e4,\n moneyCost: 2.5e8,\n info:\n \"Chemical injections are used to permanently alter and strengthen the brain's neuronal \" +\n \"circuits, strengthening the ability to retain information.\",\n hacking_exp_mult: 1.25,\n });\n NeuralRetentionEnhancement.addToFactions([\"NiteSec\"]);\n if (augmentationExists(AugmentationNames.NeuralRetentionEnhancement)) {\n delete Augmentations[AugmentationNames.NeuralRetentionEnhancement];\n }\n AddToAugmentations(NeuralRetentionEnhancement);\n\n const DataJack = new Augmentation({\n name: AugmentationNames.DataJack,\n repCost: 1.125e5,\n moneyCost: 4.5e8,\n info:\n \"A brain implant that provides an interface for direct, wireless communication between a computer's main \" +\n \"memory and the mind. This implant allows the user to not only access a computer's memory, but also alter \" +\n \"and delete it.\",\n hacking_money_mult: 1.25,\n });\n DataJack.addToFactions([\"BitRunners\", \"The Black Hand\", \"NiteSec\", \"Chongqing\", \"New Tokyo\"]);\n if (augmentationExists(AugmentationNames.DataJack)) {\n delete Augmentations[AugmentationNames.DataJack];\n }\n AddToAugmentations(DataJack);\n\n const ENM = new Augmentation({\n name: AugmentationNames.ENM,\n repCost: 1.5e4,\n moneyCost: 2.5e8,\n info:\n \"A thin device embedded inside the arm containing a wireless module capable of connecting \" +\n \"to nearby networks. Once connected, the Netburner Module is capable of capturing and \" +\n \"processing all of the traffic on that network. By itself, the Embedded Netburner Module does \" +\n \"not do much, but a variety of very powerful upgrades can be installed that allow you to fully \" +\n \"control the traffic on a network.\",\n hacking_mult: 1.08,\n });\n ENM.addToFactions([\n \"BitRunners\",\n \"The Black Hand\",\n \"NiteSec\",\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.ENM)) {\n delete Augmentations[AugmentationNames.ENM];\n }\n AddToAugmentations(ENM);\n\n const ENMCore = new Augmentation({\n name: AugmentationNames.ENMCore,\n repCost: 175e3,\n moneyCost: 2.5e9,\n info:\n \"The Core library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgrade allows the Embedded Netburner Module to generate its own data on a network.\",\n prereqs: [AugmentationNames.ENM],\n hacking_speed_mult: 1.03,\n hacking_money_mult: 1.1,\n hacking_chance_mult: 1.03,\n hacking_exp_mult: 1.07,\n hacking_mult: 1.07,\n });\n ENMCore.addToFactions([\n \"BitRunners\",\n \"The Black Hand\",\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.ENMCore)) {\n delete Augmentations[AugmentationNames.ENMCore];\n }\n AddToAugmentations(ENMCore);\n\n const ENMCoreV2 = new Augmentation({\n name: AugmentationNames.ENMCoreV2,\n repCost: 1e6,\n moneyCost: 4.5e9,\n info:\n \"The Core V2 library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgraded firmware allows the Embedded Netburner Module to control information on \" +\n \"a network by re-routing traffic, spoofing IP addresses, and altering the data inside network \" +\n \"packets.\",\n prereqs: [AugmentationNames.ENMCore],\n hacking_speed_mult: 1.05,\n hacking_money_mult: 1.3,\n hacking_chance_mult: 1.05,\n hacking_exp_mult: 1.15,\n hacking_mult: 1.08,\n });\n ENMCoreV2.addToFactions([\n \"BitRunners\",\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Blade Industries\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n ]);\n if (augmentationExists(AugmentationNames.ENMCoreV2)) {\n delete Augmentations[AugmentationNames.ENMCoreV2];\n }\n AddToAugmentations(ENMCoreV2);\n\n const ENMCoreV3 = new Augmentation({\n name: AugmentationNames.ENMCoreV3,\n repCost: 1.75e6,\n moneyCost: 7.5e9,\n info:\n \"The Core V3 library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into \" +\n \"any device on a network.\",\n prereqs: [AugmentationNames.ENMCoreV2],\n hacking_speed_mult: 1.05,\n hacking_money_mult: 1.4,\n hacking_chance_mult: 1.1,\n hacking_exp_mult: 1.25,\n hacking_mult: 1.1,\n });\n ENMCoreV3.addToFactions([\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Daedalus\",\n \"The Covenant\",\n \"Illuminati\",\n ]);\n if (augmentationExists(AugmentationNames.ENMCoreV3)) {\n delete Augmentations[AugmentationNames.ENMCoreV3];\n }\n AddToAugmentations(ENMCoreV3);\n\n const ENMAnalyzeEngine = new Augmentation({\n name: AugmentationNames.ENMAnalyzeEngine,\n repCost: 6.25e5,\n moneyCost: 6e9,\n info:\n \"Installs the Analyze Engine for the Embedded Netburner Module, which is a CPU cluster \" +\n \"that vastly outperforms the Netburner Module's native single-core processor.\",\n prereqs: [AugmentationNames.ENM],\n hacking_speed_mult: 1.1,\n });\n ENMAnalyzeEngine.addToFactions([\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Daedalus\",\n \"The Covenant\",\n \"Illuminati\",\n ]);\n if (augmentationExists(AugmentationNames.ENMAnalyzeEngine)) {\n delete Augmentations[AugmentationNames.ENMAnalyzeEngine];\n }\n AddToAugmentations(ENMAnalyzeEngine);\n\n const ENMDMA = new Augmentation({\n name: AugmentationNames.ENMDMA,\n repCost: 1e6,\n moneyCost: 7e9,\n info:\n \"This implant installs a Direct Memory Access (DMA) controller into the \" +\n \"Embedded Netburner Module. This allows the Module to send and receive data \" +\n \"directly to and from the main memory of devices on a network.\",\n prereqs: [AugmentationNames.ENM],\n hacking_money_mult: 1.4,\n hacking_chance_mult: 1.2,\n });\n ENMDMA.addToFactions([\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Daedalus\",\n \"The Covenant\",\n \"Illuminati\",\n ]);\n if (augmentationExists(AugmentationNames.ENMDMA)) {\n delete Augmentations[AugmentationNames.ENMDMA];\n }\n AddToAugmentations(ENMDMA);\n\n const Neuralstimulator = new Augmentation({\n name: AugmentationNames.Neuralstimulator,\n repCost: 5e4,\n moneyCost: 3e9,\n info:\n \"A cranial implant that intelligently stimulates certain areas of the brain \" +\n \"in order to improve cognitive functions.\",\n hacking_speed_mult: 1.02,\n hacking_chance_mult: 1.1,\n hacking_exp_mult: 1.12,\n });\n Neuralstimulator.addToFactions([\n \"The Black Hand\",\n \"Chongqing\",\n \"Sector-12\",\n \"New Tokyo\",\n \"Aevum\",\n \"Ishima\",\n \"Volhaven\",\n \"Bachman & Associates\",\n \"Clarke Incorporated\",\n \"Four Sigma\",\n ]);\n if (augmentationExists(AugmentationNames.Neuralstimulator)) {\n delete Augmentations[AugmentationNames.Neuralstimulator];\n }\n AddToAugmentations(Neuralstimulator);\n\n const NeuralAccelerator = new Augmentation({\n name: AugmentationNames.NeuralAccelerator,\n repCost: 2e5,\n moneyCost: 1.75e9,\n info:\n \"A microprocessor that accelerates the processing \" +\n \"speed of biological neural networks. This is a cranial implant that is embedded inside the brain.\",\n hacking_mult: 1.1,\n hacking_exp_mult: 1.15,\n hacking_money_mult: 1.2,\n });\n NeuralAccelerator.addToFactions([\"BitRunners\"]);\n if (augmentationExists(AugmentationNames.NeuralAccelerator)) {\n delete Augmentations[AugmentationNames.NeuralAccelerator];\n }\n AddToAugmentations(NeuralAccelerator);\n\n const CranialSignalProcessorsG1 = new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG1,\n repCost: 1e4,\n moneyCost: 7e7,\n info:\n \"The first generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n hacking_speed_mult: 1.01,\n hacking_mult: 1.05,\n });\n CranialSignalProcessorsG1.addToFactions([\"CyberSec\"]);\n if (augmentationExists(AugmentationNames.CranialSignalProcessorsG1)) {\n delete Augmentations[AugmentationNames.CranialSignalProcessorsG1];\n }\n AddToAugmentations(CranialSignalProcessorsG1);\n\n const CranialSignalProcessorsG2 = new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG2,\n repCost: 1.875e4,\n moneyCost: 1.25e8,\n info:\n \"The second generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG1],\n hacking_speed_mult: 1.02,\n hacking_chance_mult: 1.05,\n hacking_mult: 1.07,\n });\n CranialSignalProcessorsG2.addToFactions([\"CyberSec\", \"NiteSec\"]);\n if (augmentationExists(AugmentationNames.CranialSignalProcessorsG2)) {\n delete Augmentations[AugmentationNames.CranialSignalProcessorsG2];\n }\n AddToAugmentations(CranialSignalProcessorsG2);\n\n const CranialSignalProcessorsG3 = new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG3,\n repCost: 5e4,\n moneyCost: 5.5e8,\n info:\n \"The third generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG2],\n hacking_speed_mult: 1.02,\n hacking_money_mult: 1.15,\n hacking_mult: 1.09,\n });\n CranialSignalProcessorsG3.addToFactions([\"NiteSec\", \"The Black Hand\", \"BitRunners\"]);\n if (augmentationExists(AugmentationNames.CranialSignalProcessorsG3)) {\n delete Augmentations[AugmentationNames.CranialSignalProcessorsG3];\n }\n AddToAugmentations(CranialSignalProcessorsG3);\n\n const CranialSignalProcessorsG4 = new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG4,\n repCost: 1.25e5,\n moneyCost: 1.1e9,\n info:\n \"The fourth generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG3],\n hacking_speed_mult: 1.02,\n hacking_money_mult: 1.2,\n hacking_grow_mult: 1.25,\n });\n CranialSignalProcessorsG4.addToFactions([\"The Black Hand\", \"BitRunners\"]);\n if (augmentationExists(AugmentationNames.CranialSignalProcessorsG4)) {\n delete Augmentations[AugmentationNames.CranialSignalProcessorsG4];\n }\n AddToAugmentations(CranialSignalProcessorsG4);\n\n const CranialSignalProcessorsG5 = new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG5,\n repCost: 2.5e5,\n moneyCost: 2.25e9,\n info:\n \"The fifth generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG4],\n hacking_mult: 1.3,\n hacking_money_mult: 1.25,\n hacking_grow_mult: 1.75,\n });\n CranialSignalProcessorsG5.addToFactions([\"BitRunners\"]);\n if (augmentationExists(AugmentationNames.CranialSignalProcessorsG5)) {\n delete Augmentations[AugmentationNames.CranialSignalProcessorsG5];\n }\n AddToAugmentations(CranialSignalProcessorsG5);\n\n const NeuronalDensification = new Augmentation({\n name: AugmentationNames.NeuronalDensification,\n repCost: 1.875e5,\n moneyCost: 1.375e9,\n info:\n \"The brain is surgically re-engineered to have increased neuronal density \" +\n \"by decreasing the neuron gap junction. Then, the body is genetically modified \" +\n \"to enhance the production and capabilities of its neural stem cells.\",\n hacking_mult: 1.15,\n hacking_exp_mult: 1.1,\n hacking_speed_mult: 1.03,\n });\n NeuronalDensification.addToFactions([\"Clarke Incorporated\"]);\n if (augmentationExists(AugmentationNames.NeuronalDensification)) {\n delete Augmentations[AugmentationNames.NeuronalDensification];\n }\n AddToAugmentations(NeuronalDensification);\n\n // Work Augmentations\n const NuoptimalInjectorImplant = new Augmentation({\n name: AugmentationNames.NuoptimalInjectorImplant,\n repCost: 5e3,\n moneyCost: 2e7,\n info:\n \"This torso implant automatically injects nootropic supplements into \" +\n \"the bloodstream to improve memory, increase focus, and provide other \" +\n \"cognitive enhancements.\",\n company_rep_mult: 1.2,\n });\n NuoptimalInjectorImplant.addToFactions([\n \"Tian Di Hui\",\n \"Volhaven\",\n \"New Tokyo\",\n \"Chongqing\",\n \"Clarke Incorporated\",\n \"Four Sigma\",\n \"Bachman & Associates\",\n ]);\n if (augmentationExists(AugmentationNames.NuoptimalInjectorImplant)) {\n delete Augmentations[AugmentationNames.NuoptimalInjectorImplant];\n }\n AddToAugmentations(NuoptimalInjectorImplant);\n\n const SpeechEnhancement = new Augmentation({\n name: AugmentationNames.SpeechEnhancement,\n repCost: 2.5e3,\n moneyCost: 1.25e7,\n info:\n \"An advanced neural implant that improves your speaking abilities, making \" +\n \"you more convincing and likable in conversations and overall improving your \" +\n \"social interactions.\",\n company_rep_mult: 1.1,\n charisma_mult: 1.1,\n });\n SpeechEnhancement.addToFactions([\n \"Tian Di Hui\",\n \"Speakers for the Dead\",\n \"Four Sigma\",\n \"KuaiGong International\",\n \"Clarke Incorporated\",\n \"Bachman & Associates\",\n ]);\n if (augmentationExists(AugmentationNames.SpeechEnhancement)) {\n delete Augmentations[AugmentationNames.SpeechEnhancement];\n }\n AddToAugmentations(SpeechEnhancement);\n\n const FocusWire = new Augmentation({\n name: AugmentationNames.FocusWire,\n repCost: 7.5e4,\n moneyCost: 9e8,\n info: \"A cranial implant that stops procrastination by blocking specific neural pathways \" + \"in the brain.\",\n hacking_exp_mult: 1.05,\n strength_exp_mult: 1.05,\n defense_exp_mult: 1.05,\n dexterity_exp_mult: 1.05,\n agility_exp_mult: 1.05,\n charisma_exp_mult: 1.05,\n company_rep_mult: 1.1,\n work_money_mult: 1.2,\n });\n FocusWire.addToFactions([\"Bachman & Associates\", \"Clarke Incorporated\", \"Four Sigma\", \"KuaiGong International\"]);\n if (augmentationExists(AugmentationNames.FocusWire)) {\n delete Augmentations[AugmentationNames.FocusWire];\n }\n AddToAugmentations(FocusWire);\n\n const PCDNI = new Augmentation({\n name: AugmentationNames.PCDNI,\n repCost: 3.75e5,\n moneyCost: 3.75e9,\n info:\n \"Installs a Direct-Neural Interface jack into your arm that is compatible with most \" +\n \"computers. Connecting to a computer through this jack allows you to interface with \" +\n \"it using the brain's electrochemical signals.\",\n company_rep_mult: 1.3,\n hacking_mult: 1.08,\n });\n PCDNI.addToFactions([\"Four Sigma\", \"OmniTek Incorporated\", \"ECorp\", \"Blade Industries\"]);\n if (augmentationExists(AugmentationNames.PCDNI)) {\n delete Augmentations[AugmentationNames.PCDNI];\n }\n AddToAugmentations(PCDNI);\n\n const PCDNIOptimizer = new Augmentation({\n name: AugmentationNames.PCDNIOptimizer,\n repCost: 5e5,\n moneyCost: 4.5e9,\n info:\n \"This is a submodule upgrade to the PC Direct-Neural Interface augmentation. It \" +\n \"improves the performance of the interface and gives the user more control options \" +\n \"to a connected computer.\",\n prereqs: [AugmentationNames.PCDNI],\n company_rep_mult: 1.75,\n hacking_mult: 1.1,\n });\n PCDNIOptimizer.addToFactions([\"Fulcrum Secret Technologies\", \"ECorp\", \"Blade Industries\"]);\n if (augmentationExists(AugmentationNames.PCDNIOptimizer)) {\n delete Augmentations[AugmentationNames.PCDNIOptimizer];\n }\n AddToAugmentations(PCDNIOptimizer);\n\n const PCDNINeuralNetwork = new Augmentation({\n name: AugmentationNames.PCDNINeuralNetwork,\n repCost: 1.5e6,\n moneyCost: 7.5e9,\n info:\n \"This is an additional installation that upgrades the functionality of the \" +\n \"PC Direct-Neural Interface augmentation. When connected to a computer, \" +\n \"The Neural Network upgrade allows the user to use their own brain's \" +\n \"processing power to aid the computer in computational tasks.\",\n prereqs: [AugmentationNames.PCDNI],\n company_rep_mult: 2,\n hacking_mult: 1.1,\n hacking_speed_mult: 1.05,\n });\n PCDNINeuralNetwork.addToFactions([\"Fulcrum Secret Technologies\"]);\n if (augmentationExists(AugmentationNames.PCDNINeuralNetwork)) {\n delete Augmentations[AugmentationNames.PCDNINeuralNetwork];\n }\n AddToAugmentations(PCDNINeuralNetwork);\n\n const ADRPheromone1 = new Augmentation({\n name: AugmentationNames.ADRPheromone1,\n repCost: 3.75e3,\n moneyCost: 1.75e7,\n info:\n \"The body is genetically re-engineered so that it produces the ADR-V1 pheromone, \" +\n \"an artificial pheromone discovered by scientists. The ADR-V1 pheromone, when excreted, \" +\n \"triggers feelings of admiration and approval in other people.\",\n company_rep_mult: 1.1,\n faction_rep_mult: 1.1,\n });\n ADRPheromone1.addToFactions([\"Tian Di Hui\", \"The Syndicate\", \"NWO\", \"MegaCorp\", \"Four Sigma\"]);\n if (augmentationExists(AugmentationNames.ADRPheromone1)) {\n delete Augmentations[AugmentationNames.ADRPheromone1];\n }\n AddToAugmentations(ADRPheromone1);\n\n const ADRPheromone2 = new Augmentation({\n name: AugmentationNames.ADRPheromone2,\n repCost: 6.25e4,\n moneyCost: 5.5e8,\n info:\n \"The body is genetically re-engineered so that it produces the ADR-V2 pheromone, \" +\n \"which is similar to but more potent than ADR-V1. This pheromone, when excreted, \" +\n \"triggers feelings of admiration, approval, and respect in others.\",\n company_rep_mult: 1.2,\n faction_rep_mult: 1.2,\n });\n ADRPheromone2.addToFactions([\"Silhouette\", \"Four Sigma\", \"Bachman & Associates\", \"Clarke Incorporated\"]);\n if (augmentationExists(AugmentationNames.ADRPheromone2)) {\n delete Augmentations[AugmentationNames.ADRPheromone2];\n }\n AddToAugmentations(ADRPheromone2);\n\n const ShadowsSimulacrum = new Augmentation({\n name: AugmentationNames.ShadowsSimulacrum,\n repCost: 3.75e4,\n moneyCost: 4e8,\n info:\n \"A crude but functional matter phase-shifter module that is embedded \" +\n \"in the brainstem and cerebellum. This augmentation was developed by \" +\n \"criminal organizations and allows the user to project and control holographic \" +\n \"simulacrums within a large radius. These simulacrums are commonly used for \" +\n \"espionage and surveillance work.\",\n company_rep_mult: 1.15,\n faction_rep_mult: 1.15,\n });\n ShadowsSimulacrum.addToFactions([\"The Syndicate\", \"The Dark Army\", \"Speakers for the Dead\"]);\n if (augmentationExists(AugmentationNames.ShadowsSimulacrum)) {\n delete Augmentations[AugmentationNames.ShadowsSimulacrum];\n }\n AddToAugmentations(ShadowsSimulacrum);\n\n // HacknetNode Augmentations\n const HacknetNodeCPUUpload = new Augmentation({\n name: AugmentationNames.HacknetNodeCPUUpload,\n repCost: 3.75e3,\n moneyCost: 1.1e7,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's CPU into \" +\n \"the brain. This allows the user to engineer custom hardware and software \" +\n \"for the Hacknet Node that provides better performance.\",\n hacknet_node_money_mult: 1.15,\n hacknet_node_purchase_cost_mult: 0.85,\n });\n HacknetNodeCPUUpload.addToFactions([\"Netburners\"]);\n if (augmentationExists(AugmentationNames.HacknetNodeCPUUpload)) {\n delete Augmentations[AugmentationNames.HacknetNodeCPUUpload];\n }\n AddToAugmentations(HacknetNodeCPUUpload);\n\n const HacknetNodeCacheUpload = new Augmentation({\n name: AugmentationNames.HacknetNodeCacheUpload,\n repCost: 2.5e3,\n moneyCost: 5.5e6,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's main-memory cache \" +\n \"into the brain. This allows the user to engineer custom cache hardware for the \" +\n \"Hacknet Node that offers better performance.\",\n hacknet_node_money_mult: 1.1,\n hacknet_node_level_cost_mult: 0.85,\n });\n HacknetNodeCacheUpload.addToFactions([\"Netburners\"]);\n if (augmentationExists(AugmentationNames.HacknetNodeCacheUpload)) {\n delete Augmentations[AugmentationNames.HacknetNodeCacheUpload];\n }\n AddToAugmentations(HacknetNodeCacheUpload);\n\n const HacknetNodeNICUpload = new Augmentation({\n name: AugmentationNames.HacknetNodeNICUpload,\n repCost: 1.875e3,\n moneyCost: 4.5e6,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's Network Interface Card (NIC) \" +\n \"into the brain. This allows the user to engineer a custom NIC for the Hacknet Node that \" +\n \"offers better performance.\",\n hacknet_node_money_mult: 1.1,\n hacknet_node_purchase_cost_mult: 0.9,\n });\n HacknetNodeNICUpload.addToFactions([\"Netburners\"]);\n if (augmentationExists(AugmentationNames.HacknetNodeNICUpload)) {\n delete Augmentations[AugmentationNames.HacknetNodeNICUpload];\n }\n AddToAugmentations(HacknetNodeNICUpload);\n\n const HacknetNodeKernelDNI = new Augmentation({\n name: AugmentationNames.HacknetNodeKernelDNI,\n repCost: 7.5e3,\n moneyCost: 4e7,\n info:\n \"Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a \" +\n \"Hacknet Node. This lets the user access and manipulate the Node's kernel using \" +\n \"electrochemical signals.\",\n hacknet_node_money_mult: 1.25,\n });\n HacknetNodeKernelDNI.addToFactions([\"Netburners\"]);\n if (augmentationExists(AugmentationNames.HacknetNodeKernelDNI)) {\n delete Augmentations[AugmentationNames.HacknetNodeKernelDNI];\n }\n AddToAugmentations(HacknetNodeKernelDNI);\n\n const HacknetNodeCoreDNI = new Augmentation({\n name: AugmentationNames.HacknetNodeCoreDNI,\n repCost: 1.25e4,\n moneyCost: 6e7,\n info:\n \"Installs a Direct-Neural Interface jack into the arm that is capable of connecting \" +\n \"to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using \" +\n \"electrochemical signals.\",\n hacknet_node_money_mult: 1.45,\n });\n HacknetNodeCoreDNI.addToFactions([\"Netburners\"]);\n if (augmentationExists(AugmentationNames.HacknetNodeCoreDNI)) {\n delete Augmentations[AugmentationNames.HacknetNodeCoreDNI];\n }\n AddToAugmentations(HacknetNodeCoreDNI);\n\n //Misc/Hybrid augmentations\n const NeuroFluxGovernor = new Augmentation({\n name: AugmentationNames.NeuroFluxGovernor,\n repCost: 1.25e3,\n moneyCost: 3.75e6,\n info:\n \"A device that is embedded in the back of the neck. The NeuroFlux Governor \" +\n \"monitors and regulates nervous impulses coming to and from the spinal column, \" +\n \"essentially 'governing' the body. By doing so, it improves the functionality of the \" +\n \"body's nervous system.\",\n stats: (\n <>\n This special augmentation can be leveled up infinitely. Each level of this augmentation increases MOST\n multipliers by 1%, stacking multiplicatively.\n </>\n ),\n hacking_chance_mult: 1.01,\n hacking_speed_mult: 1.01,\n hacking_money_mult: 1.01,\n hacking_grow_mult: 1.01,\n hacking_mult: 1.01,\n strength_mult: 1.01,\n defense_mult: 1.01,\n dexterity_mult: 1.01,\n agility_mult: 1.01,\n charisma_mult: 1.01,\n hacking_exp_mult: 1.01,\n strength_exp_mult: 1.01,\n defense_exp_mult: 1.01,\n dexterity_exp_mult: 1.01,\n agility_exp_mult: 1.01,\n charisma_exp_mult: 1.01,\n company_rep_mult: 1.01,\n faction_rep_mult: 1.01,\n crime_money_mult: 1.01,\n crime_success_mult: 1.01,\n hacknet_node_money_mult: 1.01,\n hacknet_node_purchase_cost_mult: 0.99,\n hacknet_node_ram_cost_mult: 0.99,\n hacknet_node_core_cost_mult: 0.99,\n hacknet_node_level_cost_mult: 0.99,\n work_money_mult: 1.01,\n });\n\n // Set the Augmentation's level to the currently-installed level\n let currLevel = 0;\n for (let i = 0; i < Player.augmentations.length; ++i) {\n if (Player.augmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n currLevel = Player.augmentations[i].level;\n }\n }\n NeuroFluxGovernor.level = currLevel;\n\n // To set the price/rep req of the NeuroFlux, we have to take into account NeuroFlux\n // levels that are purchased but not yet installed\n let nextLevel = currLevel;\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n ++nextLevel;\n }\n }\n let mult = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel);\n NeuroFluxGovernor.baseRepRequirement = 500 * mult * BitNodeMultipliers.AugmentationRepCost;\n NeuroFluxGovernor.baseCost = 750e3 * mult * BitNodeMultipliers.AugmentationMoneyCost;\n if (augmentationExists(AugmentationNames.NeuroFluxGovernor)) {\n delete Augmentations[AugmentationNames.NeuroFluxGovernor];\n }\n NeuroFluxGovernor.addToAllFactions();\n AddToAugmentations(NeuroFluxGovernor);\n\n const Neurotrainer1 = new Augmentation({\n name: AugmentationNames.Neurotrainer1,\n repCost: 1e3,\n moneyCost: 4e6,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. It is \" +\n \"installed by releasing millions of nanobots into the human brain, each of which \" +\n \"attaches to a different neural pathway to enhance the brain's ability to retain \" +\n \"and retrieve information.\",\n hacking_exp_mult: 1.1,\n strength_exp_mult: 1.1,\n defense_exp_mult: 1.1,\n dexterity_exp_mult: 1.1,\n agility_exp_mult: 1.1,\n charisma_exp_mult: 1.1,\n });\n Neurotrainer1.addToFactions([\"CyberSec\", \"Aevum\"]);\n if (augmentationExists(AugmentationNames.Neurotrainer1)) {\n delete Augmentations[AugmentationNames.Neurotrainer1];\n }\n AddToAugmentations(Neurotrainer1);\n\n const Neurotrainer2 = new Augmentation({\n name: AugmentationNames.Neurotrainer2,\n repCost: 1e4,\n moneyCost: 4.5e7,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. This \" +\n \"is a more powerful version of the Neurotrainer I augmentation, but it does not \" +\n \"require Neurotrainer I to be installed as a prerequisite.\",\n hacking_exp_mult: 1.15,\n strength_exp_mult: 1.15,\n defense_exp_mult: 1.15,\n dexterity_exp_mult: 1.15,\n agility_exp_mult: 1.15,\n charisma_exp_mult: 1.15,\n });\n Neurotrainer2.addToFactions([\"BitRunners\", \"NiteSec\"]);\n if (augmentationExists(AugmentationNames.Neurotrainer2)) {\n delete Augmentations[AugmentationNames.Neurotrainer2];\n }\n AddToAugmentations(Neurotrainer2);\n\n const Neurotrainer3 = new Augmentation({\n name: AugmentationNames.Neurotrainer3,\n repCost: 2.5e4,\n moneyCost: 1.3e8,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. This \" +\n \"is a more powerful version of the Neurotrainer I and Neurotrainer II augmentation, \" +\n \"but it does not require either of them to be installed as a prerequisite.\",\n hacking_exp_mult: 1.2,\n strength_exp_mult: 1.2,\n defense_exp_mult: 1.2,\n dexterity_exp_mult: 1.2,\n agility_exp_mult: 1.2,\n charisma_exp_mult: 1.2,\n });\n Neurotrainer3.addToFactions([\"NWO\", \"Four Sigma\"]);\n if (augmentationExists(AugmentationNames.Neurotrainer3)) {\n delete Augmentations[AugmentationNames.Neurotrainer3];\n }\n AddToAugmentations(Neurotrainer3);\n\n const Hypersight = new Augmentation({\n name: AugmentationNames.Hypersight,\n repCost: 1.5e5,\n moneyCost: 2.75e9,\n info:\n \"A bionic eye implant that grants sight capabilities far beyond those of a natural human. \" +\n \"Embedded circuitry within the implant provides the ability to detect heat and movement \" +\n \"through solid objects such as walls, thus providing 'x-ray vision'-like capabilities.\",\n dexterity_mult: 1.4,\n hacking_speed_mult: 1.03,\n hacking_money_mult: 1.1,\n });\n Hypersight.addToFactions([\"Blade Industries\", \"KuaiGong International\"]);\n if (augmentationExists(AugmentationNames.Hypersight)) {\n delete Augmentations[AugmentationNames.Hypersight];\n }\n AddToAugmentations(Hypersight);\n\n const LuminCloaking1 = new Augmentation({\n name: AugmentationNames.LuminCloaking1,\n repCost: 1.5e3,\n moneyCost: 5e6,\n info:\n \"A skin implant that reinforces the skin with highly-advanced synthetic cells. These \" +\n \"cells, when powered, have a negative refractive index. As a result, they bend light \" +\n \"around the skin, making the user much harder to see to the naked eye.\",\n agility_mult: 1.05,\n crime_money_mult: 1.1,\n });\n LuminCloaking1.addToFactions([\"Slum Snakes\", \"Tetrads\"]);\n if (augmentationExists(AugmentationNames.LuminCloaking1)) {\n delete Augmentations[AugmentationNames.LuminCloaking1];\n }\n AddToAugmentations(LuminCloaking1);\n\n const LuminCloaking2 = new Augmentation({\n name: AugmentationNames.LuminCloaking2,\n repCost: 5e3,\n moneyCost: 3e7,\n info:\n \"This is a more advanced version of the LuminCloaking-V1 augmentation. This skin implant \" +\n \"reinforces the skin with highly-advanced synthetic cells. These \" +\n \"cells, when powered, are capable of not only bending light but also of bending heat, \" +\n \"making the user more resilient as well as stealthy.\",\n prereqs: [AugmentationNames.LuminCloaking1],\n agility_mult: 1.1,\n defense_mult: 1.1,\n crime_money_mult: 1.25,\n });\n LuminCloaking2.addToFactions([\"Slum Snakes\", \"Tetrads\"]);\n if (augmentationExists(AugmentationNames.LuminCloaking2)) {\n delete Augmentations[AugmentationNames.LuminCloaking2];\n }\n AddToAugmentations(LuminCloaking2);\n\n const SmartSonar = new Augmentation({\n name: AugmentationNames.SmartSonar,\n repCost: 2.25e4,\n moneyCost: 7.5e7,\n info: \"A cochlear implant that helps the player detect and locate enemies \" + \"using sound propagation.\",\n dexterity_mult: 1.1,\n dexterity_exp_mult: 1.15,\n crime_money_mult: 1.25,\n });\n SmartSonar.addToFactions([\"Slum Snakes\"]);\n if (augmentationExists(AugmentationNames.SmartSonar)) {\n delete Augmentations[AugmentationNames.SmartSonar];\n }\n AddToAugmentations(SmartSonar);\n\n const PowerRecirculator = new Augmentation({\n name: AugmentationNames.PowerRecirculator,\n repCost: 2.5e4,\n moneyCost: 1.8e8,\n info:\n \"The body's nerves are attached with polypyrrole nanocircuits that \" +\n \"are capable of capturing wasted energy, in the form of heat, \" +\n \"and converting it back into usable power.\",\n hacking_mult: 1.05,\n strength_mult: 1.05,\n defense_mult: 1.05,\n dexterity_mult: 1.05,\n agility_mult: 1.05,\n charisma_mult: 1.05,\n hacking_exp_mult: 1.1,\n strength_exp_mult: 1.1,\n defense_exp_mult: 1.1,\n dexterity_exp_mult: 1.1,\n agility_exp_mult: 1.1,\n charisma_exp_mult: 1.1,\n });\n PowerRecirculator.addToFactions([\"Tetrads\", \"The Dark Army\", \"The Syndicate\", \"NWO\"]);\n if (augmentationExists(AugmentationNames.PowerRecirculator)) {\n delete Augmentations[AugmentationNames.PowerRecirculator];\n }\n AddToAugmentations(PowerRecirculator);\n\n // Unique AUGS (Each Faction gets one unique augmentation)\n // Factions that already have unique augs up to this point:\n // Slum Snakes, CyberSec, Netburners, Fulcrum Secret Technologies,\n // Silhouette\n\n // Illuminati\n const QLink = new Augmentation({\n name: AugmentationNames.QLink,\n repCost: 1.875e6,\n moneyCost: 2.5e13,\n info:\n \"A brain implant that wirelessly connects you to the Illuminati's \" +\n \"quantum supercomputer, allowing you to access and use its incredible \" +\n \"computing power.\",\n hacking_mult: 1.75,\n hacking_speed_mult: 2,\n hacking_chance_mult: 2.5,\n hacking_money_mult: 4,\n });\n QLink.addToFactions([\"Illuminati\"]);\n if (augmentationExists(AugmentationNames.QLink)) {\n delete Augmentations[AugmentationNames.QLink];\n }\n AddToAugmentations(QLink);\n\n // Daedalus\n const RedPill = new Augmentation({\n name: AugmentationNames.TheRedPill,\n repCost: 2.5e6,\n moneyCost: 0,\n info: \"It's time to leave the cave.\",\n stats: null,\n });\n RedPill.addToFactions([\"Daedalus\"]);\n if (augmentationExists(AugmentationNames.TheRedPill)) {\n delete Augmentations[AugmentationNames.TheRedPill];\n }\n AddToAugmentations(RedPill);\n\n // Covenant\n const SPTN97 = new Augmentation({\n name: AugmentationNames.SPTN97,\n repCost: 1.25e6,\n moneyCost: 4.875e9,\n info:\n \"The SPTN-97 gene is injected into the genome. The SPTN-97 gene is an \" +\n \"artificially-synthesized gene that was developed by DARPA to create \" +\n \"super-soldiers through genetic modification. The gene was outlawed in \" +\n \"2056.\",\n strength_mult: 1.75,\n defense_mult: 1.75,\n dexterity_mult: 1.75,\n agility_mult: 1.75,\n hacking_mult: 1.15,\n });\n SPTN97.addToFactions([\"The Covenant\"]);\n if (augmentationExists(AugmentationNames.SPTN97)) {\n delete Augmentations[AugmentationNames.SPTN97];\n }\n AddToAugmentations(SPTN97);\n\n // ECorp\n const HiveMind = new Augmentation({\n name: AugmentationNames.HiveMind,\n repCost: 1.5e6,\n moneyCost: 5.5e9,\n info:\n \"A brain implant developed by ECorp. They do not reveal what \" +\n \"exactly the implant does, but they promise that it will greatly \" +\n \"enhance your abilities.\",\n hacking_grow_mult: 3,\n stats: null,\n });\n HiveMind.addToFactions([\"ECorp\"]);\n if (augmentationExists(AugmentationNames.HiveMind)) {\n delete Augmentations[AugmentationNames.HiveMind];\n }\n AddToAugmentations(HiveMind);\n\n // MegaCorp\n const CordiARCReactor = new Augmentation({\n name: AugmentationNames.CordiARCReactor,\n repCost: 1.125e6,\n moneyCost: 5e9,\n info:\n \"The thoracic cavity is equipped with a small chamber designed \" +\n \"to hold and sustain hydrogen plasma. The plasma is used to generate \" +\n \"fusion power through nuclear fusion, providing limitless amounts of clean \" +\n \"energy for the body.\",\n strength_mult: 1.35,\n defense_mult: 1.35,\n dexterity_mult: 1.35,\n agility_mult: 1.35,\n strength_exp_mult: 1.35,\n defense_exp_mult: 1.35,\n dexterity_exp_mult: 1.35,\n agility_exp_mult: 1.35,\n });\n CordiARCReactor.addToFactions([\"MegaCorp\"]);\n if (augmentationExists(AugmentationNames.CordiARCReactor)) {\n delete Augmentations[AugmentationNames.CordiARCReactor];\n }\n AddToAugmentations(CordiARCReactor);\n\n // BachmanAndAssociates\n const SmartJaw = new Augmentation({\n name: AugmentationNames.SmartJaw,\n repCost: 3.75e5,\n moneyCost: 2.75e9,\n info:\n \"A bionic jaw that contains advanced hardware and software \" +\n \"capable of psychoanalyzing and profiling the personality of \" +\n \"others using optical imaging software.\",\n charisma_mult: 1.5,\n charisma_exp_mult: 1.5,\n company_rep_mult: 1.25,\n faction_rep_mult: 1.25,\n });\n SmartJaw.addToFactions([\"Bachman & Associates\"]);\n if (augmentationExists(AugmentationNames.SmartJaw)) {\n delete Augmentations[AugmentationNames.SmartJaw];\n }\n AddToAugmentations(SmartJaw);\n\n // BladeIndustries\n const Neotra = new Augmentation({\n name: AugmentationNames.Neotra,\n repCost: 5.625e5,\n moneyCost: 2.875e9,\n info:\n \"A highly-advanced techno-organic drug that is injected into the skeletal \" +\n \"and integumentary system. The drug permanently modifies the DNA of the \" +\n \"body's skin and bone cells, granting them the ability to repair \" +\n \"and restructure themselves.\",\n strength_mult: 1.55,\n defense_mult: 1.55,\n });\n Neotra.addToFactions([\"Blade Industries\"]);\n if (augmentationExists(AugmentationNames.Neotra)) {\n delete Augmentations[AugmentationNames.Neotra];\n }\n AddToAugmentations(Neotra);\n\n // NWO\n const Xanipher = new Augmentation({\n name: AugmentationNames.Xanipher,\n repCost: 8.75e5,\n moneyCost: 4.25e9,\n info:\n \"A concoction of advanced nanobots that is orally ingested into the \" +\n \"body. These nanobots induce physiological changes and significantly \" +\n \"improve the body's functioning in all aspects.\",\n hacking_mult: 1.2,\n strength_mult: 1.2,\n defense_mult: 1.2,\n dexterity_mult: 1.2,\n agility_mult: 1.2,\n charisma_mult: 1.2,\n hacking_exp_mult: 1.15,\n strength_exp_mult: 1.15,\n defense_exp_mult: 1.15,\n dexterity_exp_mult: 1.15,\n agility_exp_mult: 1.15,\n charisma_exp_mult: 1.15,\n });\n Xanipher.addToFactions([\"NWO\"]);\n if (augmentationExists(AugmentationNames.Xanipher)) {\n delete Augmentations[AugmentationNames.Xanipher];\n }\n AddToAugmentations(Xanipher);\n\n const HydroflameLeftArm = new Augmentation({\n name: AugmentationNames.HydroflameLeftArm,\n repCost: 1.25e6,\n moneyCost: 2.5e12,\n info:\n \"The left arm of a legendary BitRunner who ascended beyond this world. \" +\n \"It projects a light blue energy shield that protects the exposed inner parts. \" +\n \"Even though it contains no weapons, the advanced tungsten titanium \" +\n \"alloy increases the users strength to unbelievable levels. The augmentation \" +\n \"gets more powerful over time for seemingly no reason.\",\n strength_mult: 2.7,\n });\n HydroflameLeftArm.addToFactions([\"NWO\"]);\n if (augmentationExists(AugmentationNames.HydroflameLeftArm)) {\n delete Augmentations[AugmentationNames.HydroflameLeftArm];\n }\n AddToAugmentations(HydroflameLeftArm);\n\n // ClarkeIncorporated\n const nextSENS = new Augmentation({\n name: AugmentationNames.nextSENS,\n repCost: 4.375e5,\n moneyCost: 1.925e9,\n info:\n \"The body is genetically re-engineered to maintain a state \" +\n \"of negligible senescence, preventing the body from \" +\n \"deteriorating with age.\",\n hacking_mult: 1.2,\n strength_mult: 1.2,\n defense_mult: 1.2,\n dexterity_mult: 1.2,\n agility_mult: 1.2,\n charisma_mult: 1.2,\n });\n nextSENS.addToFactions([\"Clarke Incorporated\"]);\n if (augmentationExists(AugmentationNames.nextSENS)) {\n delete Augmentations[AugmentationNames.nextSENS];\n }\n AddToAugmentations(nextSENS);\n\n // OmniTekIncorporated\n const OmniTekInfoLoad = new Augmentation({\n name: AugmentationNames.OmniTekInfoLoad,\n repCost: 6.25e5,\n moneyCost: 2.875e9,\n info:\n \"OmniTek's data and information repository is uploaded \" +\n \"into your brain, enhancing your programming and \" +\n \"hacking abilities.\",\n hacking_mult: 1.2,\n hacking_exp_mult: 1.25,\n });\n OmniTekInfoLoad.addToFactions([\"OmniTek Incorporated\"]);\n if (augmentationExists(AugmentationNames.OmniTekInfoLoad)) {\n delete Augmentations[AugmentationNames.OmniTekInfoLoad];\n }\n AddToAugmentations(OmniTekInfoLoad);\n\n // FourSigma\n // TODO Later when Intelligence is added in . Some aug that greatly increases int\n\n // KuaiGongInternational\n const PhotosyntheticCells = new Augmentation({\n name: AugmentationNames.PhotosyntheticCells,\n repCost: 5.625e5,\n moneyCost: 2.75e9,\n info:\n \"Chloroplasts are added to epidermal stem cells and are applied \" +\n \"to the body using a skin graft. The result is photosynthetic \" +\n \"skin cells, allowing users to generate their own energy \" +\n \"and nutrition using solar power.\",\n strength_mult: 1.4,\n defense_mult: 1.4,\n agility_mult: 1.4,\n });\n PhotosyntheticCells.addToFactions([\"KuaiGong International\"]);\n if (augmentationExists(AugmentationNames.PhotosyntheticCells)) {\n delete Augmentations[AugmentationNames.PhotosyntheticCells];\n }\n AddToAugmentations(PhotosyntheticCells);\n\n // BitRunners\n const Neurolink = new Augmentation({\n name: AugmentationNames.Neurolink,\n repCost: 8.75e5,\n moneyCost: 4.375e9,\n info:\n \"A brain implant that provides a high-bandwidth, direct neural link between your \" +\n \"mind and the BitRunners' data servers, which reportedly contain \" +\n \"the largest database of hacking tools and information in the world.\",\n hacking_mult: 1.15,\n hacking_exp_mult: 1.2,\n hacking_chance_mult: 1.1,\n hacking_speed_mult: 1.05,\n programs: [Programs.FTPCrackProgram.name, Programs.RelaySMTPProgram.name],\n });\n Neurolink.addToFactions([\"BitRunners\"]);\n if (augmentationExists(AugmentationNames.Neurolink)) {\n delete Augmentations[AugmentationNames.Neurolink];\n }\n AddToAugmentations(Neurolink);\n\n // BlackHand\n const TheBlackHand = new Augmentation({\n name: AugmentationNames.TheBlackHand,\n repCost: 1e5,\n moneyCost: 5.5e8,\n info:\n \"A highly advanced bionic hand. This prosthetic not only \" +\n \"enhances strength and dexterity but it is also embedded \" +\n \"with hardware and firmware that lets the user connect to, access, and hack \" +\n \"devices and machines by just touching them.\",\n strength_mult: 1.15,\n dexterity_mult: 1.15,\n hacking_mult: 1.1,\n hacking_speed_mult: 1.02,\n hacking_money_mult: 1.1,\n });\n TheBlackHand.addToFactions([\"The Black Hand\"]);\n if (augmentationExists(AugmentationNames.TheBlackHand)) {\n delete Augmentations[AugmentationNames.TheBlackHand];\n }\n AddToAugmentations(TheBlackHand);\n\n // NiteSec\n const CRTX42AA = new Augmentation({\n name: AugmentationNames.CRTX42AA,\n repCost: 4.5e4,\n moneyCost: 2.25e8,\n info:\n \"The CRTX42-AA gene is injected into the genome. \" +\n \"The CRTX42-AA is an artificially-synthesized gene that targets the visual and prefrontal \" +\n \"cortex and improves cognitive abilities.\",\n hacking_mult: 1.08,\n hacking_exp_mult: 1.15,\n });\n CRTX42AA.addToFactions([\"NiteSec\"]);\n if (augmentationExists(AugmentationNames.CRTX42AA)) {\n delete Augmentations[AugmentationNames.CRTX42AA];\n }\n AddToAugmentations(CRTX42AA);\n\n // Chongqing\n const Neuregen = new Augmentation({\n name: AugmentationNames.Neuregen,\n repCost: 3.75e4,\n moneyCost: 3.75e8,\n info:\n \"A drug that genetically modifies the neurons in the brain \" +\n \"resulting in neurons that never die, continuously \" +\n \"regenerate, and strengthen themselves.\",\n hacking_exp_mult: 1.4,\n });\n Neuregen.addToFactions([\"Chongqing\"]);\n if (augmentationExists(AugmentationNames.Neuregen)) {\n delete Augmentations[AugmentationNames.Neuregen];\n }\n AddToAugmentations(Neuregen);\n\n // Sector12\n const CashRoot = new Augmentation({\n name: AugmentationNames.CashRoot,\n repCost: 1.25e4,\n moneyCost: 1.25e8,\n info: (\n <>\n A collection of digital assets saved on a small chip. The chip is implanted into your wrist. A small jack in the\n chip allows you to connect it to a computer and upload the assets.\n </>\n ),\n startingMoney: 1e6,\n programs: [Programs.BruteSSHProgram.name],\n });\n CashRoot.addToFactions([\"Sector-12\"]);\n if (augmentationExists(AugmentationNames.CashRoot)) {\n delete Augmentations[AugmentationNames.CashRoot];\n }\n AddToAugmentations(CashRoot);\n\n // NewTokyo\n const NutriGen = new Augmentation({\n name: AugmentationNames.NutriGen,\n repCost: 6.25e3,\n moneyCost: 2.5e6,\n info:\n \"A thermo-powered artificial nutrition generator. Endogenously \" +\n \"synthesizes glucose, amino acids, and vitamins and redistributes them \" +\n \"across the body. The device is powered by the body's naturally wasted \" +\n \"energy in the form of heat.\",\n strength_exp_mult: 1.2,\n defense_exp_mult: 1.2,\n dexterity_exp_mult: 1.2,\n agility_exp_mult: 1.2,\n });\n NutriGen.addToFactions([\"New Tokyo\"]);\n if (augmentationExists(AugmentationNames.NutriGen)) {\n delete Augmentations[AugmentationNames.NutriGen];\n }\n AddToAugmentations(NutriGen);\n\n // Aevum\n const PCMatrix = new Augmentation({\n name: AugmentationNames.PCMatrix,\n repCost: 100e3,\n moneyCost: 2e9,\n info:\n \"A 'Probability Computation Matrix' is installed in the frontal cortex. This implant \" +\n \"uses advanced mathematical algorithims to rapidly identify and compute statistical \" +\n \"outcomes of nearly every situation.\",\n charisma_mult: 1.0777,\n charisma_exp_mult: 1.0777,\n work_money_mult: 1.777,\n faction_rep_mult: 1.0777,\n company_rep_mult: 1.0777,\n crime_success_mult: 1.0777,\n crime_money_mult: 1.0777,\n programs: [Programs.DeepscanV1.name, Programs.AutoLink.name],\n });\n PCMatrix.addToFactions([\"Aevum\"]);\n if (augmentationExists(AugmentationNames.PCMatrix)) {\n delete Augmentations[AugmentationNames.PCMatrix];\n }\n AddToAugmentations(PCMatrix);\n\n // Ishima\n const INFRARet = new Augmentation({\n name: AugmentationNames.INFRARet,\n repCost: 7.5e3,\n moneyCost: 3e7,\n info: \"A tiny chip that sits behind the retinae. This implant lets the user visually detect infrared radiation.\",\n crime_success_mult: 1.25,\n crime_money_mult: 1.1,\n dexterity_mult: 1.1,\n });\n INFRARet.addToFactions([\"Ishima\"]);\n if (augmentationExists(AugmentationNames.INFRARet)) {\n delete Augmentations[AugmentationNames.INFRARet];\n }\n AddToAugmentations(INFRARet);\n\n // Volhaven\n const DermaForce = new Augmentation({\n name: AugmentationNames.DermaForce,\n repCost: 1.5e4,\n moneyCost: 5e7,\n info:\n \"Synthetic skin that is grafted onto the body. This skin consists of \" +\n \"millions of nanobots capable of projecting high-density muon beams, \" +\n \"creating an energy barrier around the user.\",\n defense_mult: 1.4,\n });\n DermaForce.addToFactions([\"Volhaven\"]);\n if (augmentationExists(AugmentationNames.DermaForce)) {\n delete Augmentations[AugmentationNames.DermaForce];\n }\n AddToAugmentations(DermaForce);\n\n // SpeakersForTheDead\n const GrapheneBrachiBlades = new Augmentation({\n name: AugmentationNames.GrapheneBrachiBlades,\n repCost: 2.25e5,\n moneyCost: 2.5e9,\n info:\n \"An upgrade to the BrachiBlades augmentation. It infuses \" +\n \"the retractable blades with an advanced graphene material \" +\n \"making them stronger and lighter.\",\n prereqs: [AugmentationNames.BrachiBlades],\n strength_mult: 1.4,\n defense_mult: 1.4,\n crime_success_mult: 1.1,\n crime_money_mult: 1.3,\n });\n GrapheneBrachiBlades.addToFactions([\"Speakers for the Dead\"]);\n if (augmentationExists(AugmentationNames.GrapheneBrachiBlades)) {\n delete Augmentations[AugmentationNames.GrapheneBrachiBlades];\n }\n AddToAugmentations(GrapheneBrachiBlades);\n\n // DarkArmy\n const GrapheneBionicArms = new Augmentation({\n name: AugmentationNames.GrapheneBionicArms,\n repCost: 5e5,\n moneyCost: 3.75e9,\n info:\n \"An upgrade to the Bionic Arms augmentation. It infuses the \" +\n \"prosthetic arms with an advanced graphene material \" +\n \"to make them stronger and lighter.\",\n prereqs: [AugmentationNames.BionicArms],\n strength_mult: 1.85,\n dexterity_mult: 1.85,\n });\n GrapheneBionicArms.addToFactions([\"The Dark Army\"]);\n if (augmentationExists(AugmentationNames.GrapheneBionicArms)) {\n delete Augmentations[AugmentationNames.GrapheneBionicArms];\n }\n AddToAugmentations(GrapheneBionicArms);\n\n // TheSyndicate\n const BrachiBlades = new Augmentation({\n name: AugmentationNames.BrachiBlades,\n repCost: 1.25e4,\n moneyCost: 9e7,\n info: \"A set of retractable plasteel blades that are implanted in the arm, underneath the skin.\",\n strength_mult: 1.15,\n defense_mult: 1.15,\n crime_success_mult: 1.1,\n crime_money_mult: 1.15,\n });\n BrachiBlades.addToFactions([\"The Syndicate\"]);\n if (augmentationExists(AugmentationNames.BrachiBlades)) {\n delete Augmentations[AugmentationNames.BrachiBlades];\n }\n AddToAugmentations(BrachiBlades);\n\n // Tetrads\n const BionicArms = new Augmentation({\n name: AugmentationNames.BionicArms,\n repCost: 6.25e4,\n moneyCost: 2.75e8,\n info:\n \"Cybernetic arms created from plasteel and carbon fibers that completely replace \" + \"the user's organic arms.\",\n strength_mult: 1.3,\n dexterity_mult: 1.3,\n });\n BionicArms.addToFactions([\"Tetrads\"]);\n if (augmentationExists(AugmentationNames.BionicArms)) {\n delete Augmentations[AugmentationNames.BionicArms];\n }\n AddToAugmentations(BionicArms);\n\n // TianDiHui\n const SNA = new Augmentation({\n name: AugmentationNames.SNA,\n repCost: 6.25e3,\n moneyCost: 3e7,\n info:\n \"A cranial implant that affects the user's personality, making them better \" +\n \"at negotiation in social situations.\",\n work_money_mult: 1.1,\n company_rep_mult: 1.15,\n faction_rep_mult: 1.15,\n });\n SNA.addToFactions([\"Tian Di Hui\"]);\n if (augmentationExists(AugmentationNames.SNA)) {\n delete Augmentations[AugmentationNames.SNA];\n }\n AddToAugmentations(SNA);\n\n const NeuroreceptorManager = new Augmentation({\n name: AugmentationNames.NeuroreceptorManager,\n repCost: 0.75e5,\n moneyCost: 5.5e8,\n info:\n \"A brain implant carefully assembled around the synapses, which \" +\n \"micromanages the activity and levels of various neuroreceptor \" +\n \"chemicals and modulates electrical activity to optimize concentration, \" +\n \"allowing the user to multitask much more effectively.\",\n stats: (\n <>\n This augmentation removes the penalty for not focusing on actions such as working in a job or working for a\n faction.\n </>\n ),\n });\n NeuroreceptorManager.addToFactions([\"Tian Di Hui\"]);\n if (augmentationExists(AugmentationNames.NeuroreceptorManager)) {\n delete Augmentations[AugmentationNames.NeuroreceptorManager];\n }\n AddToAugmentations(NeuroreceptorManager);\n\n // Special Bladeburner Augmentations\n const BladeburnersFactionName = \"Bladeburners\";\n if (factionExists(BladeburnersFactionName)) {\n const EsperEyewear = new Augmentation({\n name: AugmentationNames.EsperEyewear,\n repCost: 1.25e3,\n moneyCost: 1.65e8,\n info:\n \"Ballistic-grade protective and retractable eyewear that was designed specifically \" +\n \"for Bladeburner units. This \" +\n \"is implanted by installing a mechanical frame in the skull's orbit. \" +\n \"This frame interfaces with the brain and allows the user to \" +\n \"automatically extrude and extract the eyewear. The eyewear protects \" +\n \"against debris, shrapnel, lasers, blinding flashes, and gas. It is also \" +\n \"embedded with a data processing chip that can be programmed to display an \" +\n \"AR HUD to assist the user in field missions.\",\n bladeburner_success_chance_mult: 1.03,\n dexterity_mult: 1.05,\n isSpecial: true,\n });\n EsperEyewear.addToFactions([BladeburnersFactionName]);\n resetAugmentation(EsperEyewear);\n\n const EMS4Recombination = new Augmentation({\n name: AugmentationNames.EMS4Recombination,\n repCost: 2.5e3,\n moneyCost: 2.75e8,\n info:\n \"A DNA recombination of the EMS-4 Gene. This genetic engineering \" +\n \"technique was originally used on Bladeburners during the Synthoid uprising \" +\n \"to induce wakefulness and concentration, suppress fear, reduce empathy, \" +\n \"improve reflexes, and improve memory among other things.\",\n bladeburner_success_chance_mult: 1.03,\n bladeburner_analysis_mult: 1.05,\n bladeburner_stamina_gain_mult: 1.02,\n isSpecial: true,\n });\n EMS4Recombination.addToFactions([BladeburnersFactionName]);\n resetAugmentation(EMS4Recombination);\n\n const OrionShoulder = new Augmentation({\n name: AugmentationNames.OrionShoulder,\n repCost: 6.25e3,\n moneyCost: 5.5e8,\n info:\n \"A bionic shoulder augmentation for the right shoulder. Using cybernetics, \" +\n \"the ORION-MKIV shoulder enhances the strength and dexterity \" +\n \"of the user's right arm. It also provides protection due to its \" +\n \"crystallized graphene plating.\",\n defense_mult: 1.05,\n strength_mult: 1.05,\n dexterity_mult: 1.05,\n bladeburner_success_chance_mult: 1.04,\n isSpecial: true,\n });\n OrionShoulder.addToFactions([BladeburnersFactionName]);\n resetAugmentation(OrionShoulder);\n\n const HyperionV1 = new Augmentation({\n name: AugmentationNames.HyperionV1,\n repCost: 1.25e4,\n moneyCost: 2.75e9,\n info:\n \"A pair of mini plasma cannons embedded into the hands. The Hyperion is capable \" +\n \"of rapidly firing bolts of high-density plasma. The weapon is meant to \" +\n \"be used against augmented enemies as the ionized \" +\n \"nature of the plasma disrupts the electrical systems of Augmentations. However, \" +\n \"it can also be effective against non-augmented enemies due to its high temperature \" +\n \"and concussive force.\",\n bladeburner_success_chance_mult: 1.06,\n isSpecial: true,\n });\n HyperionV1.addToFactions([BladeburnersFactionName]);\n resetAugmentation(HyperionV1);\n\n const HyperionV2 = new Augmentation({\n name: AugmentationNames.HyperionV2,\n repCost: 2.5e4,\n moneyCost: 5.5e9,\n info:\n \"A pair of mini plasma cannons embedded into the hands. This augmentation \" +\n \"is more advanced and powerful than the original V1 model. This V2 model is \" +\n \"more power-efficient, more accurate, and can fire plasma bolts at a much \" +\n \"higher velocity than the V1 model.\",\n prereqs: [AugmentationNames.HyperionV1],\n bladeburner_success_chance_mult: 1.08,\n isSpecial: true,\n });\n HyperionV2.addToFactions([BladeburnersFactionName]);\n resetAugmentation(HyperionV2);\n\n const GolemSerum = new Augmentation({\n name: AugmentationNames.GolemSerum,\n repCost: 3.125e4,\n moneyCost: 1.1e10,\n info:\n \"A serum that permanently enhances many aspects of human capabilities, \" +\n \"including strength, speed, immune system enhancements, and mitochondrial efficiency. The \" +\n \"serum was originally developed by the Chinese military in an attempt to \" +\n \"create super soldiers.\",\n strength_mult: 1.07,\n defense_mult: 1.07,\n dexterity_mult: 1.07,\n agility_mult: 1.07,\n bladeburner_stamina_gain_mult: 1.05,\n isSpecial: true,\n });\n GolemSerum.addToFactions([BladeburnersFactionName]);\n resetAugmentation(GolemSerum);\n\n const VangelisVirus = new Augmentation({\n name: AugmentationNames.VangelisVirus,\n repCost: 1.875e4,\n moneyCost: 2.75e9,\n info:\n \"A synthetic symbiotic virus that is injected into human brain tissue. The Vangelis virus \" +\n \"heightens the senses and focus of its host, and also enhances its intuition.\",\n dexterity_exp_mult: 1.1,\n bladeburner_analysis_mult: 1.1,\n bladeburner_success_chance_mult: 1.04,\n isSpecial: true,\n });\n VangelisVirus.addToFactions([BladeburnersFactionName]);\n resetAugmentation(VangelisVirus);\n\n const VangelisVirus3 = new Augmentation({\n name: AugmentationNames.VangelisVirus3,\n repCost: 3.75e4,\n moneyCost: 1.1e10,\n info:\n \"An improved version of Vangelis, a synthetic symbiotic virus that is \" +\n \"injected into human brain tissue. On top of the benefits of the original \" +\n \"virus, this also grants an accelerated healing factor and enhanced \" +\n \"reflexes.\",\n prereqs: [AugmentationNames.VangelisVirus],\n defense_exp_mult: 1.1,\n dexterity_exp_mult: 1.1,\n bladeburner_analysis_mult: 1.15,\n bladeburner_success_chance_mult: 1.05,\n isSpecial: true,\n });\n VangelisVirus3.addToFactions([BladeburnersFactionName]);\n resetAugmentation(VangelisVirus3);\n\n const INTERLINKED = new Augmentation({\n name: AugmentationNames.INTERLINKED,\n repCost: 2.5e4,\n moneyCost: 5.5e9,\n info:\n \"The DNA is genetically modified to enhance the human's body \" +\n \"extracellular matrix (ECM). This improves the ECM's ability to \" +\n \"structurally support the body and grants heightened strength and \" +\n \"durability.\",\n strength_exp_mult: 1.05,\n defense_exp_mult: 1.05,\n dexterity_exp_mult: 1.05,\n agility_exp_mult: 1.05,\n bladeburner_max_stamina_mult: 1.1,\n isSpecial: true,\n });\n INTERLINKED.addToFactions([BladeburnersFactionName]);\n resetAugmentation(INTERLINKED);\n\n const BladeRunner = new Augmentation({\n name: AugmentationNames.BladeRunner,\n repCost: 2e4,\n moneyCost: 8.25e9,\n info:\n \"A cybernetic foot augmentation that was specifically created for Bladeburners \" +\n \"during the Synthoid Uprising. The organic musculature of the human foot \" +\n \"is enhanced with flexible carbon nanotube matrices that are controlled by \" +\n \"intelligent servo-motors.\",\n agility_mult: 1.05,\n bladeburner_max_stamina_mult: 1.05,\n bladeburner_stamina_gain_mult: 1.05,\n isSpecial: true,\n });\n BladeRunner.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeRunner);\n\n const BladeArmor = new Augmentation({\n name: AugmentationNames.BladeArmor,\n repCost: 1.25e4,\n moneyCost: 1.375e9,\n info:\n \"A powered exoskeleton suit designed as armor for Bladeburner units. This \" +\n \"exoskeleton is incredibly adaptable and can protect the wearer from blunt, piercing, \" +\n \"concussive, thermal, chemical, and electric trauma. It also enhances the user's \" +\n \"physical abilities.\",\n strength_mult: 1.04,\n defense_mult: 1.04,\n dexterity_mult: 1.04,\n agility_mult: 1.04,\n bladeburner_stamina_gain_mult: 1.02,\n bladeburner_success_chance_mult: 1.03,\n isSpecial: true,\n });\n BladeArmor.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmor);\n\n const BladeArmorPowerCells = new Augmentation({\n name: AugmentationNames.BladeArmorPowerCells,\n repCost: 1.875e4,\n moneyCost: 2.75e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with Ion Power Cells, which are capable of \" +\n \"more efficiently storing and using power.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_success_chance_mult: 1.05,\n bladeburner_stamina_gain_mult: 1.02,\n bladeburner_max_stamina_mult: 1.05,\n isSpecial: true,\n });\n BladeArmorPowerCells.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmorPowerCells);\n\n const BladeArmorEnergyShielding = new Augmentation({\n name: AugmentationNames.BladeArmorEnergyShielding,\n repCost: 2.125e4,\n moneyCost: 5.5e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with a plasma energy propulsion system \" +\n \"that is capable of projecting an energy shielding force field.\",\n prereqs: [AugmentationNames.BladeArmor],\n defense_mult: 1.05,\n bladeburner_success_chance_mult: 1.06,\n isSpecial: true,\n });\n BladeArmorEnergyShielding.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmorEnergyShielding);\n\n const BladeArmorUnibeam = new Augmentation({\n name: AugmentationNames.BladeArmorUnibeam,\n repCost: 3.125e4,\n moneyCost: 1.65e10,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with a concentrated deuterium-fluoride laser \" +\n \"weapon. It's precision and accuracy makes it useful for quickly neutralizing \" +\n \"threats while keeping casualties to a minimum.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_success_chance_mult: 1.08,\n isSpecial: true,\n });\n BladeArmorUnibeam.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmorUnibeam);\n\n const BladeArmorOmnibeam = new Augmentation({\n name: AugmentationNames.BladeArmorOmnibeam,\n repCost: 6.25e4,\n moneyCost: 2.75e10,\n info:\n \"Upgrades the BLADE-51b Tesla Armor Unibeam augmentation to use a \" +\n \"multiple-fiber system. This upgraded weapon uses multiple fiber laser \" +\n \"modules that combine together to form a single, more powerful beam of up to \" +\n \"2000MW.\",\n prereqs: [AugmentationNames.BladeArmorUnibeam],\n bladeburner_success_chance_mult: 1.1,\n isSpecial: true,\n });\n BladeArmorOmnibeam.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmorOmnibeam);\n\n const BladeArmorIPU = new Augmentation({\n name: AugmentationNames.BladeArmorIPU,\n repCost: 1.5e4,\n moneyCost: 1.1e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with an AI Information Processing \" +\n \"Unit that was specially designed to analyze Synthoid related data and \" +\n \"information.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_analysis_mult: 1.15,\n bladeburner_success_chance_mult: 1.02,\n isSpecial: true,\n });\n BladeArmorIPU.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmorIPU);\n\n const BladesSimulacrum = new Augmentation({\n name: AugmentationNames.BladesSimulacrum,\n repCost: 1.25e3,\n moneyCost: 1.5e11,\n info:\n \"A highly-advanced matter phase-shifter module that is embedded \" +\n \"in the brainstem and cerebellum. This augmentation allows \" +\n \"the user to project and control a holographic simulacrum within an \" +\n \"extremely large radius. These specially-modified holograms were specifically \" +\n \"weaponized by Bladeburner units to be used against Synthoids.\",\n stats: (\n <>\n This augmentation allows you to perform Bladeburner actions and other actions (such as working, commiting\n crimes, etc.) at the same time.\n </>\n ),\n isSpecial: true,\n });\n BladesSimulacrum.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladesSimulacrum);\n }\n\n // Special CotMG Augmentations\n const ChurchOfTheMachineGodFactionName = \"Church of the Machine God\";\n if (factionExists(ChurchOfTheMachineGodFactionName)) {\n const StaneksGift1 = new Augmentation({\n name: AugmentationNames.StaneksGift1,\n repCost: 0,\n moneyCost: 0,\n info:\n 'Allison \"Mother\" Stanek imparts you with her gift. An ' +\n \"experimental Augmentation implanted at the base of the neck. \" +\n \"It allows you to overclock your entire system by carefully \" +\n \"changing the configuration.\",\n isSpecial: true,\n hacking_chance_mult: 0.9,\n hacking_speed_mult: 0.9,\n hacking_money_mult: 0.9,\n hacking_grow_mult: 0.9,\n hacking_mult: 0.9,\n strength_mult: 0.9,\n defense_mult: 0.9,\n dexterity_mult: 0.9,\n agility_mult: 0.9,\n charisma_mult: 0.9,\n hacking_exp_mult: 0.9,\n strength_exp_mult: 0.9,\n defense_exp_mult: 0.9,\n dexterity_exp_mult: 0.9,\n agility_exp_mult: 0.9,\n charisma_exp_mult: 0.9,\n company_rep_mult: 0.9,\n faction_rep_mult: 0.9,\n crime_money_mult: 0.9,\n crime_success_mult: 0.9,\n hacknet_node_money_mult: 0.9,\n hacknet_node_purchase_cost_mult: 1.1,\n hacknet_node_ram_cost_mult: 1.1,\n hacknet_node_core_cost_mult: 1.1,\n hacknet_node_level_cost_mult: 1.1,\n work_money_mult: 0.9,\n stats: <>Its unstable nature decreases all your stats by 10%</>,\n });\n StaneksGift1.addToFactions([ChurchOfTheMachineGodFactionName]);\n resetAugmentation(StaneksGift1);\n\n const StaneksGift2 = new Augmentation({\n name: AugmentationNames.StaneksGift2,\n repCost: 1e6,\n moneyCost: 0,\n info:\n \"The next evolution is near, a coming together of man and machine. A synthesis greater than the birth of the human \" +\n \"organism. Time spent with the gift has allowed for acclimatization of the invasive augment and the toll it takes upon \" +\n \"your frame granting lesser penalty of 5% to all stats.\",\n prereqs: [AugmentationNames.StaneksGift1],\n isSpecial: true,\n hacking_chance_mult: 0.95 / 0.9,\n hacking_speed_mult: 0.95 / 0.9,\n hacking_money_mult: 0.95 / 0.9,\n hacking_grow_mult: 0.95 / 0.9,\n hacking_mult: 0.95 / 0.9,\n strength_mult: 0.95 / 0.9,\n defense_mult: 0.95 / 0.9,\n dexterity_mult: 0.95 / 0.9,\n agility_mult: 0.95 / 0.9,\n charisma_mult: 0.95 / 0.9,\n hacking_exp_mult: 0.95 / 0.9,\n strength_exp_mult: 0.95 / 0.9,\n defense_exp_mult: 0.95 / 0.9,\n dexterity_exp_mult: 0.95 / 0.9,\n agility_exp_mult: 0.95 / 0.9,\n charisma_exp_mult: 0.95 / 0.9,\n company_rep_mult: 0.95 / 0.9,\n faction_rep_mult: 0.95 / 0.9,\n crime_money_mult: 0.95 / 0.9,\n crime_success_mult: 0.95 / 0.9,\n hacknet_node_money_mult: 0.95 / 0.9,\n hacknet_node_purchase_cost_mult: 1.05 / 1.1,\n hacknet_node_ram_cost_mult: 1.05 / 1.1,\n hacknet_node_core_cost_mult: 1.05 / 1.1,\n hacknet_node_level_cost_mult: 1.05 / 1.1,\n work_money_mult: 0.95 / 0.9,\n stats: <>The penalty for the gift is reduced to 5%</>,\n });\n StaneksGift2.addToFactions([ChurchOfTheMachineGodFactionName]);\n resetAugmentation(StaneksGift2);\n\n const StaneksGift3 = new Augmentation({\n name: AugmentationNames.StaneksGift3,\n repCost: 1e8,\n moneyCost: 0,\n info:\n \"The synthesis of human and machine is nothing to fear. It is our destiny. \" +\n \"You will become greater than the sum of our parts. As One. Embrace your gift \" +\n \"fully and wholly free of it's accursed toll. Serenity brings tranquility the form \" +\n \"of no longer suffering a stat penalty. \",\n prereqs: [AugmentationNames.StaneksGift2],\n isSpecial: true,\n hacking_chance_mult: 1 / 0.95,\n hacking_speed_mult: 1 / 0.95,\n hacking_money_mult: 1 / 0.95,\n hacking_grow_mult: 1 / 0.95,\n hacking_mult: 1 / 0.95,\n strength_mult: 1 / 0.95,\n defense_mult: 1 / 0.95,\n dexterity_mult: 1 / 0.95,\n agility_mult: 1 / 0.95,\n charisma_mult: 1 / 0.95,\n hacking_exp_mult: 1 / 0.95,\n strength_exp_mult: 1 / 0.95,\n defense_exp_mult: 1 / 0.95,\n dexterity_exp_mult: 1 / 0.95,\n agility_exp_mult: 1 / 0.95,\n charisma_exp_mult: 1 / 0.95,\n company_rep_mult: 1 / 0.95,\n faction_rep_mult: 1 / 0.95,\n crime_money_mult: 1 / 0.95,\n crime_success_mult: 1 / 0.95,\n hacknet_node_money_mult: 1 / 0.95,\n hacknet_node_purchase_cost_mult: 1 / 1.05,\n hacknet_node_ram_cost_mult: 1 / 1.05,\n hacknet_node_core_cost_mult: 1 / 1.05,\n hacknet_node_level_cost_mult: 1 / 1.05,\n work_money_mult: 1 / 0.95,\n stats: <>Staneks Gift has no penalty.</>,\n });\n StaneksGift3.addToFactions([ChurchOfTheMachineGodFactionName]);\n resetAugmentation(StaneksGift3);\n }\n\n // Update costs based on how many have been purchased\n mult = Math.pow(\n CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][SourceFileFlags[11]],\n Player.queuedAugmentations.length,\n );\n for (const name of Object.keys(Augmentations)) {\n if (Augmentations.hasOwnProperty(name)) {\n Augmentations[name].baseCost *= mult;\n }\n }\n\n Player.reapplyAllAugmentations();\n}\n\n//Resets an Augmentation during (re-initizliation)\nfunction resetAugmentation(newAugObject: Augmentation): void {\n if (!(newAugObject instanceof Augmentation)) {\n throw new Error(\"Invalid argument 'newAugObject' passed into resetAugmentation\");\n }\n const name = newAugObject.name;\n if (augmentationExists(name)) {\n delete Augmentations[name];\n }\n AddToAugmentations(newAugObject);\n}\n\nfunction applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void {\n Augmentations[aug.name].owned = true;\n\n const augObj = Augmentations[aug.name];\n\n // Apply multipliers\n for (const mult of Object.keys(augObj.mults)) {\n const v = Player.getMult(mult) * augObj.mults[mult];\n Player.setMult(mult, v);\n }\n\n // Special logic for NeuroFlux Governor\n if (aug.name === AugmentationNames.NeuroFluxGovernor) {\n if (!reapply) {\n Augmentations[aug.name].level = aug.level;\n for (let i = 0; i < Player.augmentations.length; ++i) {\n if (Player.augmentations[i].name == AugmentationNames.NeuroFluxGovernor) {\n Player.augmentations[i].level = aug.level;\n return;\n // break;\n }\n }\n }\n }\n\n // Push onto Player's Augmentation list\n if (!reapply) {\n const ownedAug = new PlayerOwnedAugmentation(aug.name);\n Player.augmentations.push(ownedAug);\n }\n}\n\nfunction installAugmentations(): boolean {\n if (Player.queuedAugmentations.length == 0) {\n dialogBoxCreate(\"You have not purchased any Augmentations to install!\");\n return false;\n }\n let augmentationList = \"\";\n let nfgIndex = -1;\n for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n nfgIndex = i;\n break;\n }\n }\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n const ownedAug = Player.queuedAugmentations[i];\n const aug = Augmentations[ownedAug.name];\n if (aug == null) {\n console.error(`Invalid augmentation: ${ownedAug.name}`);\n continue;\n }\n\n applyAugmentation(Player.queuedAugmentations[i]);\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;\n\n let level = \"\";\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {\n level = ` - ${ownedAug.level}`;\n }\n augmentationList += aug.name + level + \"<br>\";\n }\n Player.queuedAugmentations = [];\n dialogBoxCreate(\n \"You slowly drift to sleep as scientists put you under in order \" +\n \"to install the following Augmentations:<br>\" +\n augmentationList +\n \"<br>You wake up in your home...you feel different...\",\n );\n prestigeAugmentation();\n return true;\n}\n\nfunction augmentationExists(name: string): boolean {\n return Augmentations.hasOwnProperty(name);\n}\n\nexport function isRepeatableAug(aug: Augmentation): boolean {\n const augName = aug instanceof Augmentation ? aug.name : aug;\n\n if (augName === AugmentationNames.NeuroFluxGovernor) {\n return true;\n }\n\n return false;\n}\n\nexport { installAugmentations, initAugmentations, applyAugmentation, augmentationExists };\n","import React from \"react\";\n\nimport { Table, TableCell } from \"./Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport { Table as MuiTable } from \"@mui/material\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n rows: any[][];\n title?: string;\n wide?: boolean;\n}\n\nexport function StatsTable({ rows, title, wide }: IProps): React.ReactElement {\n const T = wide ? MuiTable : Table;\n return (\n <>\n {title && <Typography>{title}</Typography>}\n <T size=\"small\" padding=\"none\">\n <TableBody>\n {rows.map((row: any[], i: number) => (\n <TableRow key={i}>\n {row.map((elem: any, i: number) => (\n <TableCell key={i} align={i !== 0 ? \"right\" : \"left\"}>\n <Typography noWrap>{elem}</Typography>\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </T>\n </>\n );\n}\n","import { IMap } from \"./types\";\nimport { Terminal } from \"./Terminal\";\n\nexport let Aliases: IMap<string> = {};\nexport let GlobalAliases: IMap<string> = {};\n\nexport function loadAliases(saveString: string): void {\n if (saveString === \"\") {\n Aliases = {};\n } else {\n Aliases = JSON.parse(saveString);\n }\n}\n\nexport function loadGlobalAliases(saveString: string): void {\n if (saveString === \"\") {\n GlobalAliases = {};\n } else {\n GlobalAliases = JSON.parse(saveString);\n }\n}\n\n// Prints all aliases to terminal\nexport function printAliases(): void {\n for (const name of Object.keys(Aliases)) {\n if (Aliases.hasOwnProperty(name)) {\n Terminal.print(\"alias \" + name + \"=\" + Aliases[name]);\n }\n }\n for (const name of Object.keys(GlobalAliases)) {\n if (GlobalAliases.hasOwnProperty(name)) {\n Terminal.print(\"global alias \" + name + \"=\" + GlobalAliases[name]);\n }\n }\n}\n\n// Returns true if successful, false otherwise\nexport function parseAliasDeclaration(dec: string, global = false): boolean {\n const re = /^([\\w|!|%|,|@|-]+)=((\"(.+)\")|('(.+)'))$/;\n const matches = dec.match(re);\n if (matches == null || matches.length != 7) {\n return false;\n }\n\n if (global) {\n addGlobalAlias(matches[1], matches[4] || matches[6]);\n } else {\n addAlias(matches[1], matches[4] || matches[6]);\n }\n return true;\n}\n\nfunction addAlias(name: string, value: string): void {\n if (name in GlobalAliases) {\n delete GlobalAliases[name];\n }\n Aliases[name] = value.trim();\n}\n\nfunction addGlobalAlias(name: string, value: string): void {\n if (name in Aliases) {\n delete Aliases[name];\n }\n GlobalAliases[name] = value.trim();\n}\n\nfunction getAlias(name: string): string | null {\n if (Aliases.hasOwnProperty(name)) {\n return Aliases[name];\n }\n\n return null;\n}\n\nfunction getGlobalAlias(name: string): string | null {\n if (GlobalAliases.hasOwnProperty(name)) {\n return GlobalAliases[name];\n }\n return null;\n}\n\nexport function removeAlias(name: string): boolean {\n if (Aliases.hasOwnProperty(name)) {\n delete Aliases[name];\n return true;\n }\n\n if (GlobalAliases.hasOwnProperty(name)) {\n delete GlobalAliases[name];\n return true;\n }\n\n return false;\n}\n\n/**\n * Returns the original string with any aliases substituted in.\n * Aliases are only applied to \"whole words\", one level deep\n */\nexport function substituteAliases(origCommand: string): string {\n const commandArray = origCommand.split(\" \");\n if (commandArray.length > 0) {\n // For the alias and unalias commands, dont substite\n if (commandArray[0] === \"unalias\" || commandArray[0] === \"alias\") {\n return commandArray.join(\" \");\n }\n\n let somethingSubstituted = true;\n let depth = 0;\n\n while (somethingSubstituted && depth < 10) {\n depth++;\n somethingSubstituted = false;\n const alias = getAlias(commandArray[0])?.split(\" \");\n if (alias != null) {\n somethingSubstituted = true;\n commandArray.splice(0, 1, ...alias);\n //commandArray[0] = alias;\n }\n for (let i = 0; i < commandArray.length; ++i) {\n const alias = getGlobalAlias(commandArray[i])?.split(\" \");\n if (alias != null) {\n somethingSubstituted = true;\n commandArray.splice(i, 1, ...alias);\n i += alias.length - 1;\n //commandArray[i] = alias;\n }\n }\n }\n }\n return commandArray.join(\" \");\n}\n","/**\n * Lore / world building literature files that can be found on servers.\n * These files can be read by the player\n */\nexport class Literature {\n title: string;\n fn: string;\n txt: string;\n\n constructor(title: string, filename: string, txt: string) {\n this.title = title;\n this.fn = filename;\n this.txt = txt;\n }\n}\n","import React from \"react\";\nimport { createTheme, ThemeProvider, Theme, StyledEngineProvider } from \"@mui/material/styles\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Settings } from \"../../Settings/Settings\";\n\nexport const ThemeEvents = new EventEmitter<[]>();\n\ndeclare module \"@mui/material/styles\" {\n interface Theme {\n colors: {\n hp: React.CSSProperties[\"color\"];\n money: React.CSSProperties[\"color\"];\n hack: React.CSSProperties[\"color\"];\n combat: React.CSSProperties[\"color\"];\n cha: React.CSSProperties[\"color\"];\n int: React.CSSProperties[\"color\"];\n rep: React.CSSProperties[\"color\"];\n backgroundprimary: React.CSSProperties[\"color\"];\n backgroundsecondary: React.CSSProperties[\"color\"];\n button: React.CSSProperties[\"color\"];\n successlight: React.CSSProperties[\"color\"];\n success: React.CSSProperties[\"color\"];\n successdark: React.CSSProperties[\"color\"];\n white: React.CSSProperties[\"color\"];\n black: React.CSSProperties[\"color\"];\n };\n }\n interface ThemeOptions {\n colors: {\n hp: React.CSSProperties[\"color\"];\n money: React.CSSProperties[\"color\"];\n hack: React.CSSProperties[\"color\"];\n combat: React.CSSProperties[\"color\"];\n cha: React.CSSProperties[\"color\"];\n int: React.CSSProperties[\"color\"];\n rep: React.CSSProperties[\"color\"];\n backgroundprimary: React.CSSProperties[\"color\"];\n backgroundsecondary: React.CSSProperties[\"color\"];\n button: React.CSSProperties[\"color\"];\n successlight: React.CSSProperties[\"color\"];\n success: React.CSSProperties[\"color\"];\n successdark: React.CSSProperties[\"color\"];\n white: React.CSSProperties[\"color\"];\n black: React.CSSProperties[\"color\"];\n };\n }\n}\n\nlet theme: Theme;\n\nexport function refreshTheme(): void {\n theme = createTheme({\n colors: {\n hp: Settings.theme.hp,\n money: Settings.theme.money,\n hack: Settings.theme.hack,\n combat: Settings.theme.combat,\n cha: Settings.theme.cha,\n int: Settings.theme.int,\n rep: Settings.theme.rep,\n backgroundprimary: Settings.theme.backgroundprimary,\n backgroundsecondary: Settings.theme.backgroundsecondary,\n button: Settings.theme.button,\n successlight: Settings.theme.successlight,\n success: Settings.theme.success,\n successdark: Settings.theme.successdark,\n white: Settings.theme.white,\n black: Settings.theme.black,\n },\n palette: {\n primary: {\n light: Settings.theme.primarylight,\n main: Settings.theme.primary,\n dark: Settings.theme.primarydark,\n },\n secondary: {\n light: Settings.theme.secondarylight,\n main: Settings.theme.secondary,\n dark: Settings.theme.secondarydark,\n },\n error: {\n light: Settings.theme.errorlight,\n main: Settings.theme.error,\n dark: Settings.theme.errordark,\n },\n info: {\n light: Settings.theme.infolight,\n main: Settings.theme.info,\n dark: Settings.theme.infodark,\n },\n warning: {\n light: Settings.theme.warninglight,\n main: Settings.theme.warning,\n dark: Settings.theme.warningdark,\n },\n success: {\n light: Settings.theme.successlight,\n main: Settings.theme.success,\n dark: Settings.theme.successdark,\n },\n background: {\n default: Settings.theme.backgroundprimary,\n paper: Settings.theme.well,\n },\n action: {\n disabled: Settings.theme.disabled,\n },\n },\n typography: {\n fontFamily: Settings.styles.fontFamily,\n button: {\n textTransform: \"none\",\n },\n },\n components: {\n MuiInputBase: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.well,\n color: Settings.theme.primary,\n },\n input: {\n \"&::placeholder\": {\n userSelect: \"none\",\n color: Settings.theme.primarydark,\n },\n },\n },\n },\n\n MuiInput: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.well,\n borderBottomColor: \"#fff\",\n },\n underline: {\n \"&:hover\": {\n borderBottomColor: Settings.theme.primarydark,\n },\n \"&:before\": {\n borderBottomColor: Settings.theme.primary,\n },\n \"&:after\": {\n borderBottomColor: Settings.theme.primarylight,\n },\n },\n },\n },\n\n MuiInputLabel: {\n styleOverrides: {\n root: {\n color: Settings.theme.primarydark, // why is this switched?\n userSelect: \"none\",\n \"&:before\": {\n color: Settings.theme.primarylight,\n },\n },\n },\n },\n\n MuiButtonGroup: {\n styleOverrides: {\n root: {\n '& .MuiButton-root:not(:last-of-type)': {\n marginRight: '1px',\n }\n }\n }\n },\n\n MuiButton: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.button,\n border: \"1px solid \" + Settings.theme.well,\n // color: Settings.theme.primary,\n \"&:hover\": {\n backgroundColor: Settings.theme.backgroundsecondary,\n },\n\n borderRadius: 0,\n },\n },\n },\n MuiSelect: {\n styleOverrides: {\n icon: {\n color: Settings.theme.primary,\n },\n },\n defaultProps: {\n variant: \"standard\",\n },\n },\n MuiTextField: {\n defaultProps: {\n variant: \"standard\",\n },\n },\n MuiTypography: {\n defaultProps: {\n color: \"primary\",\n },\n styleOverrides: {\n root: {\n lineHeight: Settings.styles.lineHeight,\n }\n }\n },\n MuiMenu: {\n styleOverrides: {\n list: {\n backgroundColor: Settings.theme.well,\n },\n },\n },\n MuiMenuItem: {\n styleOverrides: {\n root: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiAccordionSummary: {\n styleOverrides: {\n root: {\n backgroundColor: \"#111\",\n },\n },\n },\n MuiAccordionDetails: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.backgroundsecondary,\n },\n },\n },\n MuiIconButton: {\n styleOverrides: {\n root: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiTooltip: {\n styleOverrides: {\n tooltip: {\n fontSize: \"1em\",\n color: Settings.theme.primary,\n backgroundColor: Settings.theme.well,\n borderRadius: 0,\n border: \"2px solid white\",\n maxWidth: \"100vh\",\n },\n },\n defaultProps: {\n disableInteractive: true,\n },\n },\n MuiSlider: {\n styleOverrides: {\n valueLabel: {\n color: Settings.theme.primary,\n backgroundColor: Settings.theme.well,\n },\n },\n },\n MuiDrawer: {\n styleOverrides: {\n paper: {\n \"&::-webkit-scrollbar\": {\n // webkit\n display: \"none\",\n },\n scrollbarWidth: \"none\", // firefox\n backgroundColor: Settings.theme.backgroundsecondary,\n },\n paperAnchorDockedLeft: {\n borderRight: \"1px solid \" + Settings.theme.welllight,\n },\n },\n },\n MuiDivider: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.welllight,\n },\n },\n },\n MuiFormControlLabel: {\n styleOverrides: {\n root: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiSwitch: {\n styleOverrides: {\n switchBase: {\n color: Settings.theme.primarydark,\n },\n track: {\n backgroundColor: Settings.theme.welllight,\n },\n },\n },\n MuiPaper: {\n styleOverrides: {\n root: {\n borderRadius: 0,\n backgroundColor: Settings.theme.backgroundsecondary,\n border: \"1px solid \" + Settings.theme.welllight,\n },\n },\n },\n MuiTablePagination: {\n styleOverrides: {\n select: {\n color: Settings.theme.primary,\n },\n selectLabel: {\n color: Settings.theme.primary,\n },\n displayedRows: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiTab: {\n styleOverrides: {\n textColorPrimary: {\n color: Settings.theme.secondary,\n \"&.Mui-selected\": {\n color: Settings.theme.primary,\n },\n },\n },\n },\n MuiAlert: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.black,\n borderRadius: 0,\n border: \"1px solid \" + Settings.theme.well,\n },\n standardSuccess: {\n color: Settings.theme.successlight,\n },\n standardError: {\n color: Settings.theme.errorlight,\n },\n standardWarning: {\n color: Settings.theme.warninglight,\n },\n standardInfo: {\n color: Settings.theme.infolight,\n },\n },\n },\n },\n });\n\n document.body.style.backgroundColor = theme.colors.backgroundprimary?.toString() ?? \"black\";\n}\nrefreshTheme();\n\ninterface IProps {\n children: JSX.Element[] | JSX.Element;\n}\n\nexport const TTheme = ({ children }: IProps): React.ReactElement => (\n <StyledEngineProvider injectFirst>\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </StyledEngineProvider>\n);\n","import React, { useState } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ntype IProps = {\n value: string;\n color?: string;\n variant?:\n | \"button\"\n | \"caption\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"subtitle1\"\n | \"subtitle2\"\n | \"body1\"\n | \"body2\"\n | \"overline\"\n | \"inherit\"\n | undefined;\n};\n\nexport function CopyableText(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n function copy(): void {\n const copyText = document.createElement(\"textarea\");\n copyText.value = props.value;\n document.body.appendChild(copyText);\n copyText.select();\n copyText.setSelectionRange(0, 1e10);\n document.execCommand(\"copy\");\n document.body.removeChild(copyText);\n setOpen(true);\n setTimeout(() => setOpen(false), 1000);\n }\n\n return (\n <Tooltip open={open} title={<Typography>Copied!</Typography>}>\n <Typography variant={props.variant} color={props.color} onClick={copy}>\n {props.value}\n </Typography>\n </Tooltip>\n );\n}\n","export function calculateSkill(exp: number, mult = 1): number {\n return Math.max(Math.floor(mult * (32 * Math.log(exp + 534.5) - 200)), 1);\n}\n\nexport function calculateExp(skill: number, mult = 1): number {\n return Math.exp((skill / mult + 200) / 32) - 534.6;\n}\n\nexport function calculateSkillProgress(exp: number, mult = 1): ISkillProgress {\n const currentSkill = calculateSkill(exp, mult);\n const nextSkill = currentSkill + 1;\n\n let baseExperience = calculateExp(currentSkill, mult);\n if (baseExperience < 0) baseExperience = 0;\n\n let nextExperience = calculateExp(nextSkill, mult)\n if (nextExperience < 0) nextExperience = 0;\n\n const normalize = (value: number): number => ((value - baseExperience) * 100) / (nextExperience - baseExperience);\n let progress = (nextExperience - baseExperience !== 0) ? normalize(exp) : 99.99;\n\n // Clamp progress: When sleeves are working out, the player gets way too much progress\n if (progress < 0) progress = 0\n if (progress > 100) progress = 100;\n\n // Clamp floating point imprecisions\n let currentExperience = exp - baseExperience;\n let remainingExperience = nextExperience - exp;\n if (currentExperience < 0) currentExperience = 0;\n if (remainingExperience < 0) remainingExperience = 0;\n\n return {\n currentSkill,\n nextSkill,\n baseExperience,\n experience: exp,\n nextExperience,\n currentExperience,\n remainingExperience,\n progress\n }\n}\n\nexport interface ISkillProgress {\n currentSkill: number;\n nextSkill: number;\n baseExperience: number;\n experience: number;\n nextExperience: number;\n currentExperience: number;\n remainingExperience: number;\n progress: number;\n}\n\nexport function getEmptySkillProgress(): ISkillProgress {\n return {\n currentSkill: 0, nextSkill: 0,\n baseExperience: 0, experience: 0, nextExperience: 0,\n currentExperience: 0, remainingExperience: 0,\n progress: 0,\n };\n}\n","export interface IMults {\n hack?: number;\n str?: number;\n def?: number;\n dex?: number;\n agi?: number;\n cha?: number;\n}\n\nexport enum UpgradeType {\n Weapon = \"w\",\n Armor = \"a\",\n Vehicle = \"v\",\n Rootkit = \"r\",\n Augmentation = \"g\",\n}\n\n/**\n * Defines the parameters that can be used to initialize and describe a GangMemberUpgrade\n * (defined in Gang.js)\n */\ninterface IGangMemberUpgradeMetadata {\n cost: number;\n mults: IMults;\n name: string;\n upgType: UpgradeType;\n}\n\n/**\n * Array of metadata for all Gang Member upgrades. Used to construct the global GangMemberUpgrade\n * objects in Gang.js\n */\nexport const gangMemberUpgradesMetadata: IGangMemberUpgradeMetadata[] = [\n {\n cost: 1e6,\n mults: { str: 1.04, def: 1.04 },\n name: \"Baseball Bat\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 12e6,\n mults: { str: 1.08, def: 1.08, dex: 1.08 },\n name: \"Katana\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 25e6,\n mults: { str: 1.1, def: 1.1, dex: 1.1, agi: 1.1 },\n name: \"Glock 18C\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 50e6,\n mults: { str: 1.12, def: 1.1, agi: 1.1 },\n name: \"P90C\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 60e6,\n mults: { str: 1.2, def: 1.15 },\n name: \"Steyr AUG\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 100e6,\n mults: { str: 1.25, def: 1.2 },\n name: \"AK-47\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 150e6,\n mults: { str: 1.3, def: 1.25 },\n name: \"M15A10 Assault Rifle\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 225e6,\n mults: { str: 1.3, dex: 1.25, agi: 1.3 },\n name: \"AWM Sniper Rifle\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 2e6,\n mults: { def: 1.04 },\n name: \"Bulletproof Vest\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 5e6,\n mults: { def: 1.08 },\n name: \"Full Body Armor\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 25e6,\n mults: { def: 1.15, agi: 1.15 },\n name: \"Liquid Body Armor\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 40e6,\n mults: { def: 1.2 },\n name: \"Graphene Plating Armor\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 3e6,\n mults: { agi: 1.04, cha: 1.04 },\n name: \"Ford Flex V20\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 9e6,\n mults: { agi: 1.08, cha: 1.08 },\n name: \"ATX1070 Superbike\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 18e6,\n mults: { agi: 1.12, cha: 1.12 },\n name: \"Mercedes-Benz S9001\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 30e6,\n mults: { agi: 1.16, cha: 1.16 },\n name: \"White Ferrari\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 5e6,\n mults: { hack: 1.05 },\n name: \"NUKE Rootkit\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 25e6,\n mults: { hack: 1.1 },\n name: \"Soulstealer Rootkit\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 75e6,\n mults: { hack: 1.15 },\n name: \"Demon Rootkit\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 40e6,\n mults: { hack: 1.12 },\n name: \"Hmap Node\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 75e6,\n mults: { hack: 1.15 },\n name: \"Jack the Ripper\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 10e9,\n mults: { str: 1.3, dex: 1.3 },\n name: \"Bionic Arms\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 10e9,\n mults: { agi: 1.6 },\n name: \"Bionic Legs\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 15e9,\n mults: { str: 1.15, def: 1.15, dex: 1.15, agi: 1.15 },\n name: \"Bionic Spine\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 20e9,\n mults: { str: 1.4, def: 1.4 },\n name: \"BrachiBlades\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 12e9,\n mults: { str: 1.2, def: 1.2 },\n name: \"Nanofiber Weave\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 25e9,\n mults: { str: 1.5, agi: 1.5 },\n name: \"Synthetic Heart\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 15e9,\n mults: { str: 1.3, def: 1.3 },\n name: \"Synfibril Muscle\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 5e9,\n mults: { hack: 1.05 },\n name: \"BitWire\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 10e9,\n mults: { hack: 1.15 },\n name: \"Neuralstimulator\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 7.5e9,\n mults: { hack: 1.1 },\n name: \"DataJack\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 50e9,\n mults: { str: 1.7, def: 1.7 },\n name: \"Graphene Bone Lacings\",\n upgType: UpgradeType.Augmentation,\n },\n];\n","import React, { useState, useEffect, useRef } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { RunningScript } from \"../../Script/RunningScript\";\nimport { killWorkerScript } from \"../../Netscript/killWorkerScript\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport Draggable from \"react-draggable\";\nimport { ResizableBox } from \"react-resizable\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport ArrowForwardIosIcon from \"@mui/icons-material/ArrowForwardIos\";\nimport { workerScripts } from \"../../Netscript/WorkerScripts\";\nimport { startWorkerScript } from \"../../NetscriptWorker\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { Theme } from \"@mui/material\";\nimport { findRunningScript } from \"../../Script/ScriptHelpers\";\nimport { Player } from \"../../Player\";\nimport { debounce } from \"lodash\";\n\nlet layerCounter = 0;\n\nexport const LogBoxEvents = new EventEmitter<[RunningScript]>();\nexport const LogBoxClearEvents = new EventEmitter<[]>();\n\ninterface Log {\n id: string;\n script: RunningScript;\n}\n\nlet logs: Log[] = [];\n\nexport function LogBoxManager(): React.ReactElement {\n const setRerender = useState(true)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n useEffect(\n () =>\n LogBoxEvents.subscribe((script: RunningScript) => {\n const id = script.server + \"-\" + script.filename + script.args.map((x: any): string => `${x}`).join(\"-\");\n if (logs.find((l) => l.id === id)) return;\n logs.push({\n id: id,\n script: script,\n });\n rerender();\n }),\n [],\n );\n\n useEffect(() =>\n LogBoxClearEvents.subscribe(() => {\n logs = [];\n rerender();\n }),\n );\n\n function close(id: string): void {\n logs = logs.filter((l) => l.id !== id);\n rerender();\n }\n\n return (\n <>\n {logs.map((log) => (\n <LogWindow key={log.id} script={log.script} id={log.id} onClose={() => close(log.id)} />\n ))}\n </>\n );\n}\n\ninterface IProps {\n script: RunningScript;\n id: string;\n onClose: () => void;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n title: {\n \"&.is-minimized + *\": {\n border: \"none\",\n margin: 0,\n \"max-height\": 0,\n padding: 0,\n \"pointer-events\": \"none\",\n visibility: \"hidden\",\n },\n },\n logs: {\n overflowY: \"scroll\",\n overflowX: \"hidden\",\n scrollbarWidth: \"auto\",\n display: \"flex\",\n flexDirection: \"column-reverse\",\n },\n success: {\n color: theme.colors.success,\n },\n error: {\n color: theme.palette.error.main,\n },\n primary: {\n color: theme.palette.primary.main,\n },\n info: {\n color: theme.palette.info.main,\n },\n warning: {\n color: theme.palette.warning.main,\n },\n }),\n);\n\nexport const logBoxBaseZIndex = 1500;\n\nfunction LogWindow(props: IProps): React.ReactElement {\n const draggableRef = useRef<HTMLDivElement>(null);\n const rootRef = useRef<Draggable>(null)\n const [script, setScript] = useState(props.script);\n const classes = useStyles();\n const container = useRef<HTMLDivElement>(null);\n const setRerender = useState(false)[1];\n const [minimized, setMinimized] = useState(false);\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n updateLayer();\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n function kill(): void {\n killWorkerScript(script, script.server, true);\n }\n\n function run(): void {\n const server = GetServer(script.server);\n if (server === null) return;\n const s = findRunningScript(script.filename, script.args, server);\n if (s === null) {\n startWorkerScript(Player, script, server);\n } else {\n setScript(s);\n }\n }\n\n function updateLayer(): void {\n const c = container.current;\n if (c === null) return;\n c.style.zIndex = logBoxBaseZIndex + layerCounter + \"\";\n layerCounter++;\n rerender();\n }\n\n function title(full = false): string {\n const maxLength = 30;\n const t = `${script.filename} ${script.args.map((x: any): string => `${x}`).join(\" \")}`;\n if (full || t.length <= maxLength) {\n return t;\n }\n return t.slice(0, maxLength - 3) + \"...\";\n }\n\n function minimize(): void {\n setMinimized(!minimized);\n }\n\n function lineClass(s: string): string {\n if (s.match(/(^\\[[^\\]]+\\] )?ERROR/) || s.match(/(^\\[[^\\]]+\\] )?FAIL/)) {\n return classes.error;\n }\n if (s.match(/(^\\[[^\\]]+\\] )?SUCCESS/)) {\n return classes.success;\n }\n if (s.match(/(^\\[[^\\]]+\\] )?WARN/)) {\n return classes.warning;\n }\n if (s.match(/(^\\[[^\\]]+\\] )?INFO/)) {\n return classes.info;\n }\n return classes.primary;\n }\n\n // And trigger fakeDrag when the window is resized\n useEffect(() => {\n window.addEventListener(\"resize\", onResize);\n return () => {\n window.removeEventListener(\"resize\", onResize);\n };\n }, []);\n\n const onResize = debounce((): void => {\n const node = draggableRef?.current;\n if (!node) return;\n\n if(!isOnScreen(node)) {\n resetPosition();\n }\n }, 100);\n\n const isOnScreen = (node: HTMLDivElement): boolean => {\n const bounds = node.getBoundingClientRect();\n\n return !(bounds.right < 0 ||\n bounds.bottom < 0 ||\n bounds.left > innerWidth ||\n bounds.top > outerWidth);\n }\n\n const resetPosition = (): void => {\n const node = rootRef?.current;\n if (!node) return;\n const state = node.state as {x: number; y: number};\n state.x = 0;\n state.y = 0;\n node.setState(state);\n }\n\n const boundToBody = (e: any): void | false => {\n if(e.clientX < 0 ||\n e.clientY < 0 ||\n e.clientX > innerWidth ||\n e.clientY > innerHeight) return false;\n }\n\n return (\n <Draggable handle=\".drag\" onDrag={boundToBody} ref={rootRef}>\n <Paper\n style={{\n display: \"flex\",\n flexFlow: \"column\",\n position: \"fixed\",\n left: \"40%\",\n top: \"30%\",\n zIndex: 1400,\n }}\n ref={container}\n >\n <div onMouseDown={updateLayer}>\n <Paper\n className={classes.title + \" \" + (minimized ? \"is-minimized\" : \"\")}\n style={{\n cursor: \"grab\",\n }}\n >\n <Box className=\"drag\" display=\"flex\" alignItems=\"center\" ref={draggableRef}>\n <Typography color=\"primary\" variant=\"h6\" title={title(true)}>\n {title()}\n </Typography>\n\n <Box position=\"absolute\" right={0}>\n {!workerScripts.has(script.pid) && <Button onClick={run}>Run</Button>}\n {workerScripts.has(script.pid) && <Button onClick={kill}>Kill</Button>}\n <Button onClick={minimize}>{minimized ? \"\\u{1F5D6}\" : \"\\u{1F5D5}\"}</Button>\n <Button onClick={props.onClose}>Close</Button>\n </Box>\n </Box>\n </Paper>\n <Paper sx={{ overflow: \"scroll\", overflowWrap: \"break-word\", whiteSpace: \"pre-wrap\" }}>\n <ResizableBox\n className={classes.logs}\n height={500}\n width={500}\n handle={\n <span style={{ position: \"absolute\", right: \"-10px\", bottom: \"-13px\", cursor: \"nw-resize\" }}>\n <ArrowForwardIosIcon color=\"primary\" style={{ transform: \"rotate(45deg)\" }} />\n </span>\n }\n >\n <Box>\n {script.logs.map(\n (line: string, i: number): JSX.Element => (\n <Typography key={i} className={lineClass(line)}>\n {line}\n <br />\n </Typography>\n ),\n )}\n </Box>\n </ResizableBox>\n </Paper>\n </div>\n </Paper>\n </Draggable>\n );\n}","/**\n * Global pool of all active scripts (scripts that are currently running)\n */\nimport { WorkerScript } from \"./WorkerScript\";\n\nexport const workerScripts: Map<number, WorkerScript> = new Map();\n","import { IMap } from \"../types\";\n\n// Map of material (by name) to their sizes (how much space it takes in warehouse)\nexport const MaterialSizes: IMap<number> = {\n Water: 0.05,\n Energy: 0.01,\n Food: 0.03,\n Plants: 0.05,\n Metal: 0.1,\n Hardware: 0.06,\n Chemicals: 0.05,\n Drugs: 0.02,\n Robots: 0.5,\n AICores: 0.1,\n RealEstate: 0.005,\n \"Real Estate\": 0.005,\n \"AI Cores\": 0.1,\n};\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { HacknetServerConstants } from \"../data/Constants\";\n\nexport function calculateHashGainRate(\n level: number,\n ramUsed: number,\n maxRam: number,\n cores: number,\n mult: number,\n): number {\n const baseGain = HacknetServerConstants.HashesPerLevel * level;\n const ramMultiplier = Math.pow(1.07, Math.log2(maxRam));\n const coreMultiplier = 1 + (cores - 1) / 5;\n const ramRatio = 1 - ramUsed / maxRam;\n\n return baseGain * ramMultiplier * coreMultiplier * ramRatio * mult * BitNodeMultipliers.HacknetNodeMoney;\n}\n\nexport function calculateLevelUpgradeCost(startingLevel: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingLevel >= HacknetServerConstants.MaxLevel) {\n return Infinity;\n }\n\n const mult = HacknetServerConstants.UpgradeLevelMult;\n let totalMultiplier = 0;\n let currLevel = startingLevel;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalMultiplier += Math.pow(mult, currLevel);\n ++currLevel;\n }\n\n return 10 * HacknetServerConstants.BaseCost * totalMultiplier * costMult;\n}\n\nexport function calculateRamUpgradeCost(startingRam: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingRam >= HacknetServerConstants.MaxRam) {\n return Infinity;\n }\n\n let totalCost = 0;\n let numUpgrades = Math.round(Math.log2(startingRam));\n let currentRam = startingRam;\n for (let i = 0; i < sanitizedLevels; ++i) {\n const baseCost = currentRam * HacknetServerConstants.RamBaseCost;\n const mult = Math.pow(HacknetServerConstants.UpgradeRamMult, numUpgrades);\n\n totalCost += baseCost * mult;\n\n currentRam *= 2;\n ++numUpgrades;\n }\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateCoreUpgradeCost(startingCores: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingCores >= HacknetServerConstants.MaxCores) {\n return Infinity;\n }\n\n const mult = HacknetServerConstants.UpgradeCoreMult;\n let totalCost = 0;\n let currentCores = startingCores;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalCost += Math.pow(mult, currentCores - 1);\n ++currentCores;\n }\n totalCost *= HacknetServerConstants.CoreBaseCost;\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateCacheUpgradeCost(startingCache: number, extraLevels = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingCache >= HacknetServerConstants.MaxCache) {\n return Infinity;\n }\n\n const mult = HacknetServerConstants.UpgradeCacheMult;\n let totalCost = 0;\n let currentCache = startingCache;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalCost += Math.pow(mult, currentCache - 1);\n ++currentCache;\n }\n totalCost *= HacknetServerConstants.CacheBaseCost;\n\n return totalCost;\n}\n\nexport function calculateServerCost(n: number, mult = 1): number {\n if (n - 1 >= HacknetServerConstants.MaxServers) {\n return Infinity;\n }\n\n return HacknetServerConstants.BaseCost * Math.pow(HacknetServerConstants.PurchaseMult, n - 1) * mult;\n}\n","export enum FactionWorkType {\n Field,\n Hacking,\n None,\n Security,\n}\n","/**\n * Represents the possible configuration values that can be provided when creating the progress bar text.\n */\ninterface IProgressBarConfiguration {\n /**\n * Current progress, taken as a decimal (i.e. '0.6' to represent '60%')\n */\n progress?: number;\n\n /**\n * Total number of ticks in progress bar. Preferably a factor of 100.\n */\n totalTicks?: number;\n}\n\n/**\n * Represents concrete configuration values when creating the progress bar text.\n */\ninterface IProgressBarConfigurationMaterialized extends IProgressBarConfiguration {\n progress: number;\n totalTicks: number;\n}\n\n/**\n * Creates a graphical \"progress bar\"\n * e.g.: [||||---------------]\n * @param params The configuration parameters for the progress bar\n */\nexport function createProgressBarText(params: IProgressBarConfiguration): string {\n // Default values\n const defaultParams: IProgressBarConfigurationMaterialized = {\n progress: 0,\n totalTicks: 20,\n };\n\n // tslint:disable-next-line:prefer-object-spread\n const derived: IProgressBarConfigurationMaterialized = Object.assign({}, defaultParams, params);\n // Ensure it is 0..1\n derived.progress = Math.max(Math.min(derived.progress, 1), 0);\n\n // This way there is always at least one bar filled in...\n const bars: number = Math.max(Math.floor(derived.progress / (1 / derived.totalTicks)), 1);\n const dashes: number = Math.max(derived.totalTicks - bars, 0);\n\n // String.prototype.repeat isn't completley supported, but good enough for our purposes\n return `[${\"|\".repeat(bars)}${\"-\".repeat(dashes)}]`;\n}\n","/**\n * Functions for handling WorkerScripts, which are the underlying mechanism\n * that allows for scripts to run\n */\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\nimport { generateNextPid } from \"./Netscript/Pid\";\n\nimport { CONSTANTS } from \"./Constants\";\nimport { Interpreter } from \"./ThirdParty/JSInterpreter\";\nimport { isScriptErrorMessage, makeRuntimeRejectMsg } from \"./NetscriptEvaluator\";\nimport { NetscriptFunctions } from \"./NetscriptFunctions\";\nimport { executeJSScript } from \"./NetscriptJSEvaluator\";\nimport { NetscriptPort, IPort } from \"./NetscriptPort\";\nimport { RunningScript } from \"./Script/RunningScript\";\nimport { getRamUsageFromRunningScript } from \"./Script/RunningScriptHelpers\";\nimport { scriptCalculateOfflineProduction } from \"./Script/ScriptHelpers\";\nimport { Script } from \"./Script/Script\";\nimport { GetAllServers } from \"./Server/AllServers\";\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { Settings } from \"./Settings/Settings\";\n\nimport { generate } from \"escodegen\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { roundToTwo } from \"./utils/helpers/roundToTwo\";\nimport { isString } from \"./utils/helpers/isString\";\nimport { sprintf } from \"sprintf-js\";\n\nimport { parse } from \"acorn\";\nimport { simple as walksimple } from \"acorn-walk\";\nimport { areFilesEqual } from \"./Terminal/DirectoryHelpers\";\nimport { Player } from \"./Player\";\nimport { Terminal } from \"./Terminal\";\nimport { IPlayer } from \"./PersonObjects/IPlayer\";\n\n// Netscript Ports are instantiated here\nexport const NetscriptPorts: IPort[] = [];\nfor (let i = 0; i < CONSTANTS.NumNetscriptPorts; ++i) {\n NetscriptPorts.push(NetscriptPort());\n}\n\nexport function prestigeWorkerScripts(): void {\n for (const ws of workerScripts.values()) {\n ws.env.stopFlag = true;\n killWorkerScript(ws);\n }\n for (const port of NetscriptPorts) {\n port.clear();\n }\n\n WorkerScriptStartStopEventEmitter.emit();\n workerScripts.clear();\n}\n\n// JS script promises need a little massaging to have the same guarantees as netscript\n// promises. This does said massaging and kicks the script off. It returns a promise\n// that resolves or rejects when the corresponding worker script is done.\nfunction startNetscript2Script(player: IPlayer, workerScript: WorkerScript): Promise<WorkerScript> {\n workerScript.running = true;\n\n // The name of the currently running netscript function, to prevent concurrent\n // calls to hack, grow, etc.\n let runningFn: string | null = null;\n\n // We need to go through the environment and wrap each function in such a way that it\n // can be called at most once at a time. This will prevent situations where multiple\n // hack promises are outstanding, for example.\n function wrap(propName: string, f: (...args: any[]) => Promise<void>): (...args: any[]) => Promise<void> {\n // This function unfortunately cannot be an async function, because we don't\n // know if the original one was, and there's no way to tell.\n return function (...args: any[]) {\n // Wrap every netscript function with a check for the stop flag.\n // This prevents cases where we never stop because we are only calling\n // netscript functions that don't check this.\n // This is not a problem for legacy Netscript because it also checks the\n // stop flag in the evaluator.\n if (workerScript.env.stopFlag) {\n throw workerScript;\n }\n\n if (propName === \"asleep\") return f(...args); // OK for multiple simultaneous calls to sleep.\n\n const msg =\n \"Concurrent calls to Netscript functions are not allowed! \" +\n \"Did you forget to await hack(), grow(), or some other \" +\n \"promise-returning function? (Currently running: %s tried to run: %s)\";\n if (runningFn) {\n workerScript.errorMessage = makeRuntimeRejectMsg(workerScript, sprintf(msg, runningFn, propName));\n throw workerScript;\n }\n runningFn = propName;\n\n // If the function throws an error, clear the runningFn flag first, and then re-throw it\n // This allows people to properly catch errors thrown by NS functions without getting\n // the concurrent call error above\n let result;\n try {\n result = f(...args);\n } catch (e: any) {\n runningFn = null;\n throw e;\n }\n\n if (result && result.finally !== undefined) {\n return result.finally(function () {\n runningFn = null;\n });\n } else {\n runningFn = null;\n return result;\n }\n };\n }\n\n for (const prop of Object.keys(workerScript.env.vars)) {\n if (typeof workerScript.env.vars[prop] !== \"function\") continue;\n workerScript.env.vars[prop] = wrap(prop, workerScript.env.vars[prop]);\n }\n workerScript.env.vars.stanek.charge = wrap(\"stanek.charge\", workerScript.env.vars.stanek.charge);\n\n // Note: the environment that we pass to the JS script only needs to contain the functions visible\n // to that script, which env.vars does at this point.\n return new Promise<WorkerScript>((resolve, reject) => {\n executeJSScript(player, workerScript.getServer().scripts, workerScript)\n .then(() => {\n resolve(workerScript);\n })\n .catch((e) => reject(e));\n }).catch((e) => {\n if (e instanceof Error) {\n if (e instanceof SyntaxError) {\n workerScript.errorMessage = makeRuntimeRejectMsg(workerScript, e.message + \" (sorry we can't be more helpful)\");\n } else {\n workerScript.errorMessage = makeRuntimeRejectMsg(\n workerScript,\n e.message + ((e.stack && \"\\nstack:\\n\" + e.stack.toString()) || \"\"),\n );\n }\n throw workerScript;\n } else if (isScriptErrorMessage(e)) {\n workerScript.errorMessage = e;\n throw workerScript;\n } else if (e instanceof WorkerScript) {\n throw e;\n }\n\n workerScript.errorMessage = makeRuntimeRejectMsg(workerScript, e);\n throw workerScript; // Don't know what to do with it, let's rethrow.\n });\n}\n\nfunction startNetscript1Script(workerScript: WorkerScript): Promise<WorkerScript> {\n const code = workerScript.code;\n workerScript.running = true;\n\n //Process imports\n let codeWithImports, codeLineOffset;\n try {\n const importProcessingRes = processNetscript1Imports(code, workerScript);\n codeWithImports = importProcessingRes.code;\n codeLineOffset = importProcessingRes.lineOffset;\n } catch (e: any) {\n dialogBoxCreate(\"Error processing Imports in \" + workerScript.name + \":<br>\" + e);\n workerScript.env.stopFlag = true;\n workerScript.running = false;\n killWorkerScript(workerScript);\n return Promise.resolve(workerScript);\n }\n\n const interpreterInitialization = function (int: any, scope: any): void {\n //Add the Netscript environment\n const ns = NetscriptFunctions(workerScript);\n for (const name of Object.keys(ns)) {\n const entry = ns[name];\n if (typeof entry === \"function\") {\n //Async functions need to be wrapped. See JS-Interpreter documentation\n if ([\"hack\", \"grow\", \"weaken\", \"sleep\", \"prompt\", \"manualHack\", \"scp\", \"write\", \"share\"].includes(name)) {\n const tempWrapper = function (...args: any[]): void {\n const fnArgs = [];\n\n //All of the Object/array elements are in JSInterpreter format, so\n //we have to convert them back to native format to pass them to these fns\n for (let i = 0; i < args.length - 1; ++i) {\n if (typeof args[i] === \"object\" || args[i].constructor === Array) {\n fnArgs.push(int.pseudoToNative(args[i]));\n } else {\n fnArgs.push(args[i]);\n }\n }\n const cb = args[args.length - 1];\n const fnPromise = entry(...fnArgs);\n fnPromise\n .then(function (res: any) {\n cb(res);\n })\n .catch(function (err: any) {\n // workerscript is when you cancel a delay\n if (!(err instanceof WorkerScript)) console.error(err);\n });\n };\n int.setProperty(scope, name, int.createAsyncFunction(tempWrapper));\n } else if (\n name === \"sprintf\" ||\n name === \"vsprintf\" ||\n name === \"scp\" ||\n name == \"write\" ||\n name === \"tryWrite\" ||\n name === \"run\" ||\n name === \"exec\"\n ) {\n const tempWrapper = function (...args: any[]): void {\n const fnArgs = [];\n\n //All of the Object/array elements are in JSInterpreter format, so\n //we have to convert them back to native format to pass them to these fns\n for (let i = 0; i < args.length; ++i) {\n if (typeof args[i] === \"object\" || args[i].constructor === Array) {\n fnArgs.push(int.pseudoToNative(args[i]));\n } else {\n fnArgs.push(args[i]);\n }\n }\n\n return entry(...fnArgs);\n };\n int.setProperty(scope, name, int.createNativeFunction(tempWrapper));\n } else {\n const tempWrapper = function (...args: any[]): any {\n const res = entry(...args);\n\n if (res == null) {\n return res;\n } else if (res.constructor === Array || res === Object(res)) {\n //Objects and Arrays must be converted to the interpreter's format\n return int.nativeToPseudo(res);\n } else {\n return res;\n }\n };\n int.setProperty(scope, name, int.createNativeFunction(tempWrapper));\n }\n } else {\n //bladeburner, or anything else\n int.setProperty(scope, name, int.nativeToPseudo(entry));\n }\n }\n\n //Add the arguments\n int.setProperty(scope, \"args\", int.nativeToPseudo(workerScript.args));\n };\n\n let interpreter: any;\n try {\n interpreter = new Interpreter(codeWithImports, interpreterInitialization, codeLineOffset);\n } catch (e: any) {\n dialogBoxCreate(\"Syntax ERROR in \" + workerScript.name + \":<br>\" + e);\n workerScript.env.stopFlag = true;\n workerScript.running = false;\n killWorkerScript(workerScript);\n return Promise.resolve(workerScript);\n }\n\n return new Promise(function (resolve, reject) {\n function runInterpreter(): void {\n try {\n if (workerScript.env.stopFlag) {\n return reject(workerScript);\n }\n\n let more = true;\n let i = 0;\n while (i < 3 && more) {\n more = more && interpreter.step();\n i++;\n }\n\n if (more) {\n setTimeout(runInterpreter, Settings.CodeInstructionRunTime);\n } else {\n resolve(workerScript);\n }\n } catch (e: any) {\n e = e.toString();\n if (!isScriptErrorMessage(e)) {\n e = makeRuntimeRejectMsg(workerScript, e);\n }\n workerScript.errorMessage = e;\n return reject(workerScript);\n }\n }\n\n try {\n runInterpreter();\n } catch (e: any) {\n if (isString(e)) {\n workerScript.errorMessage = e;\n return reject(workerScript);\n } else if (e instanceof WorkerScript) {\n return reject(e);\n } else {\n return reject(workerScript);\n }\n }\n });\n}\n\n/* Since the JS Interpreter used for Netscript 1.0 only supports ES5, the keyword\n 'import' throws an error. However, since we want to support import funtionality\n we'll implement it ourselves by parsing the Nodes in the AST out.\n\n @param code - The script's code\n @returns {Object} {\n code: Newly-generated code with imported functions\n lineOffset: Net number of lines of code added/removed due to imported functions\n Should typically be positive\n }\n*/\nfunction processNetscript1Imports(code: string, workerScript: WorkerScript): any {\n //allowReserved prevents 'import' from throwing error in ES5\n const ast: any = parse(code, {\n ecmaVersion: 9,\n allowReserved: true,\n sourceType: \"module\",\n });\n\n const server = workerScript.getServer();\n if (server == null) {\n throw new Error(\"Failed to find underlying Server object for script\");\n }\n\n function getScript(scriptName: string): Script | null {\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === scriptName) {\n return server.scripts[i];\n }\n }\n return null;\n }\n\n let generatedCode = \"\"; // Generated Javascript Code\n let hasImports = false;\n\n // Walk over the tree and process ImportDeclaration nodes\n walksimple(ast, {\n ImportDeclaration: (node: any) => {\n hasImports = true;\n let scriptName = node.source.value;\n if (scriptName.startsWith(\"./\")) {\n scriptName = scriptName.slice(2);\n }\n const script = getScript(scriptName);\n if (script == null) {\n throw new Error(\"'Import' failed due to invalid script: \" + scriptName);\n }\n const scriptAst = parse(script.code, {\n ecmaVersion: 9,\n allowReserved: true,\n sourceType: \"module\",\n });\n\n if (node.specifiers.length === 1 && node.specifiers[0].type === \"ImportNamespaceSpecifier\") {\n // import * as namespace from script\n const namespace = node.specifiers[0].local.name;\n const fnNames: string[] = []; //Names only\n const fnDeclarations: any[] = []; //FunctionDeclaration Node objects\n walksimple(scriptAst, {\n FunctionDeclaration: (node: any) => {\n fnNames.push(node.id.name);\n fnDeclarations.push(node);\n },\n });\n\n //Now we have to generate the code that would create the namespace\n generatedCode += \"var \" + namespace + \";\\n\" + \"(function (namespace) {\\n\";\n\n //Add the function declarations\n fnDeclarations.forEach((fn: any) => {\n generatedCode += generate(fn);\n generatedCode += \"\\n\";\n });\n\n //Add functions to namespace\n fnNames.forEach((fnName) => {\n generatedCode += \"namespace.\" + fnName + \" = \" + fnName;\n generatedCode += \"\\n\";\n });\n\n //Finish\n generatedCode += \"})(\" + namespace + \" || \" + \"(\" + namespace + \" = {}));\\n\";\n } else {\n //import {...} from script\n\n //Get array of all fns to import\n const fnsToImport: string[] = [];\n node.specifiers.forEach((e: any) => {\n fnsToImport.push(e.local.name);\n });\n\n //Walk through script and get FunctionDeclaration code for all specified fns\n const fnDeclarations: any[] = [];\n walksimple(scriptAst, {\n FunctionDeclaration: (node: any) => {\n if (fnsToImport.includes(node.id.name)) {\n fnDeclarations.push(node);\n }\n },\n });\n\n //Convert FunctionDeclarations into code\n fnDeclarations.forEach((fn: any) => {\n generatedCode += generate(fn);\n generatedCode += \"\\n\";\n });\n }\n },\n });\n\n //If there are no imports, just return the original code\n if (!hasImports) {\n return { code: code, lineOffset: 0 };\n }\n\n //Remove ImportDeclarations from AST. These ImportDeclarations must be in top-level\n let linesRemoved = 0;\n if (ast.type !== \"Program\" || ast.body == null) {\n throw new Error(\"Code could not be properly parsed\");\n }\n for (let i = ast.body.length - 1; i >= 0; --i) {\n if (ast.body[i].type === \"ImportDeclaration\") {\n ast.body.splice(i, 1);\n ++linesRemoved;\n }\n }\n\n //Calculated line offset\n const lineOffset = (generatedCode.match(/\\n/g) || []).length - linesRemoved;\n\n //Convert the AST back into code\n code = generate(ast);\n\n //Add the imported code and re-generate in ES5 (JS Interpreter for NS1 only supports ES5);\n code = generatedCode + code;\n\n const res = {\n code: code,\n lineOffset: lineOffset,\n };\n return res;\n}\n\n/**\n * Used to start a RunningScript (by creating and starting its\n * corresponding WorkerScript), and add the RunningScript to the server on which\n * it is active\n * @param {RunningScript} runningScriptObj - Script that's being run\n * @param {Server} server - Server on which the script is to be run\n * @returns {number} pid of started script\n */\nexport function startWorkerScript(\n player: IPlayer,\n runningScript: RunningScript,\n server: BaseServer,\n parent?: WorkerScript,\n): number {\n if (createAndAddWorkerScript(player, runningScript, server, parent)) {\n // Push onto runningScripts.\n // This has to come after createAndAddWorkerScript() because that fn updates RAM usage\n server.runScript(runningScript);\n\n // Once the WorkerScript is constructed in createAndAddWorkerScript(), the RunningScript\n // object should have a PID assigned to it, so we return that\n return runningScript.pid;\n }\n\n return 0;\n}\n\n/**\n * Given a RunningScript object, constructs its corresponding WorkerScript,\n * adds it to the global 'workerScripts' pool, and begins executing it.\n * @param {RunningScript} runningScriptObj - Script that's being run\n * @param {Server} server - Server on which the script is to be run\n * returns {boolean} indicating whether or not the workerScript was successfully added\n */\nfunction createAndAddWorkerScript(\n player: IPlayer,\n runningScriptObj: RunningScript,\n server: BaseServer,\n parent?: WorkerScript,\n): boolean {\n // Update server's ram usage\n let threads = 1;\n if (runningScriptObj.threads && !isNaN(runningScriptObj.threads)) {\n threads = runningScriptObj.threads;\n } else {\n runningScriptObj.threads = 1;\n }\n const oneRamUsage = getRamUsageFromRunningScript(runningScriptObj);\n const ramUsage = roundToTwo(oneRamUsage * threads);\n const ramAvailable = server.maxRam - server.ramUsed;\n if (ramUsage > ramAvailable) {\n dialogBoxCreate(\n `Not enough RAM to run script ${runningScriptObj.filename} with args ` +\n `${arrayToString(runningScriptObj.args)}. This likely occurred because you re-loaded ` +\n `the game and the script's RAM usage increased (either because of an update to the game or ` +\n `your changes to the script.)`,\n );\n return false;\n }\n\n server.updateRamUsed(roundToTwo(server.ramUsed + ramUsage), Player);\n\n // Get the pid\n const pid = generateNextPid();\n if (pid === -1) {\n throw new Error(\n `Failed to start script because could not find available PID. This is most ` +\n `because you have too many scripts running.`,\n );\n }\n\n // Create the WorkerScript. NOTE: WorkerScript ctor will set the underlying\n // RunningScript's PID as well\n const s = new WorkerScript(runningScriptObj, pid, NetscriptFunctions);\n s.ramUsage = oneRamUsage;\n\n // Add the WorkerScript to the global pool\n workerScripts.set(pid, s);\n WorkerScriptStartStopEventEmitter.emit();\n\n // Start the script's execution\n let p: Promise<WorkerScript> | null = null; // Script's resulting promise\n if (s.name.endsWith(\".js\") || s.name.endsWith(\".ns\")) {\n p = startNetscript2Script(player, s);\n } else {\n p = startNetscript1Script(s);\n if (!(p instanceof Promise)) {\n return false;\n }\n }\n\n // Once the code finishes (either resolved or rejected, doesnt matter), set its\n // running status to false\n p.then(function (w: WorkerScript) {\n w.running = false;\n w.env.stopFlag = true;\n // On natural death, the earnings are transfered to the parent if it still exists.\n if (parent !== undefined) {\n if (parent.running) {\n parent.scriptRef.onlineExpGained += runningScriptObj.onlineExpGained;\n parent.scriptRef.onlineMoneyMade += runningScriptObj.onlineMoneyMade;\n }\n }\n\n killWorkerScript(s);\n w.log(\"\", () => \"Script finished running\");\n }).catch(function (w) {\n if (w instanceof Error) {\n dialogBoxCreate(\"Script runtime unknown error. This is a bug please contact game developer\");\n console.error(\"Evaluating workerscript returns an Error. THIS SHOULDN'T HAPPEN: \" + w.toString());\n return;\n } else if (w instanceof WorkerScript) {\n if (isScriptErrorMessage(w.errorMessage)) {\n const errorTextArray = w.errorMessage.split(\"|DELIMITER|\");\n if (errorTextArray.length != 4) {\n console.error(\"ERROR: Something wrong with Error text in evaluator...\");\n console.error(\"Error text: \" + w.errorMessage);\n return;\n }\n const hostname = errorTextArray[1];\n const scriptName = errorTextArray[2];\n const errorMsg = errorTextArray[3];\n\n let msg = `RUNTIME ERROR<br>${scriptName}@${hostname}<br>`;\n if (w.args.length > 0) {\n msg += `Args: ${arrayToString(w.args)}<br>`;\n }\n msg += \"<br>\";\n msg += errorMsg;\n\n dialogBoxCreate(msg);\n w.log(\"\", () => \"Script crashed with runtime error\");\n } else {\n w.log(\"\", () => \"Script killed\");\n return; // Already killed, so stop here\n }\n } else if (isScriptErrorMessage(w)) {\n dialogBoxCreate(\"Script runtime unknown error. This is a bug please contact game developer\");\n console.error(\n \"ERROR: Evaluating workerscript returns only error message rather than WorkerScript object. THIS SHOULDN'T HAPPEN: \" +\n w.toString(),\n );\n return;\n } else {\n dialogBoxCreate(\"An unknown script died for an unknown reason. This is a bug please contact game dev\");\n console.error(w);\n }\n\n killWorkerScript(s);\n });\n\n return true;\n}\n\n/**\n * Updates the online running time stat of all running scripts\n */\nexport function updateOnlineScriptTimes(numCycles = 1): void {\n const time = (numCycles * CONSTANTS._idleSpeed) / 1000; //seconds\n for (const ws of workerScripts.values()) {\n ws.scriptRef.onlineRunningTime += time;\n }\n}\n\n/**\n * Called when the game is loaded. Loads all running scripts (from all servers)\n * into worker scripts so that they will start running\n */\nexport function loadAllRunningScripts(player: IPlayer): void {\n const skipScriptLoad = window.location.href.toLowerCase().indexOf(\"?noscripts\") !== -1;\n if (skipScriptLoad) {\n Terminal.warn(\"Skipped loading player scripts during startup\");\n console.info(\"Skipping the load of any scripts during startup\");\n }\n for (const server of GetAllServers()) {\n // Reset each server's RAM usage to 0\n server.ramUsed = 0;\n\n // Reset modules on all scripts\n for (let i = 0; i < server.scripts.length; ++i) {\n server.scripts[i].markUpdated();\n }\n\n if (skipScriptLoad) {\n // Start game with no scripts\n server.runningScripts.length = 0;\n } else {\n for (let j = 0; j < server.runningScripts.length; ++j) {\n const fileName = server.runningScripts[j].filename;\n createAndAddWorkerScript(player, server.runningScripts[j], server);\n\n if (!server.runningScripts[j]) {\n // createAndAddWorkerScript can modify the server.runningScripts array if a script is invalid\n console.error(`createAndAddWorkerScript removed ${fileName} from ${server}`);\n continue;\n }\n\n // Offline production\n scriptCalculateOfflineProduction(server.runningScripts[j]);\n }\n }\n }\n}\n\n/**\n * Run a script from inside another script (run(), exec(), spawn(), etc.)\n */\nexport function runScriptFromScript(\n player: IPlayer,\n caller: string,\n server: BaseServer,\n scriptname: string,\n args: any[],\n workerScript: WorkerScript,\n threads = 1,\n): number {\n // Sanitize arguments\n if (!(workerScript instanceof WorkerScript)) {\n return 0;\n }\n\n if (typeof scriptname !== \"string\" || !Array.isArray(args)) {\n workerScript.log(caller, () => `Invalid arguments: scriptname='${scriptname} args='${args}'`);\n console.error(`runScriptFromScript() failed due to invalid arguments`);\n return 0;\n }\n\n args.forEach((arg, i) => {\n if (typeof arg !== \"string\" && typeof arg !== \"number\" && typeof arg !== \"boolean\")\n throw new Error(\n \"Only strings, numbers, and booleans can be passed as arguments to other scripts.\\n\" +\n `${scriptname} argument index ${i} is of type ${typeof arg} and value ${JSON.stringify(arg)}`,\n );\n });\n\n // Check if the script is already running\n const runningScriptObj = server.getRunningScript(scriptname, args);\n if (runningScriptObj != null) {\n workerScript.log(caller, () => `'${scriptname}' is already running on '${server.hostname}'`);\n return 0;\n }\n\n // 'null/undefined' arguments are not allowed\n for (let i = 0; i < args.length; ++i) {\n if (args[i] == null) {\n workerScript.log(caller, () => \"Cannot execute a script with null/undefined as an argument\");\n return 0;\n }\n }\n\n // Check if the script exists and if it does run it\n for (let i = 0; i < server.scripts.length; ++i) {\n if (!areFilesEqual(server.scripts[i].filename, scriptname)) continue;\n // Check for admin rights and that there is enough RAM availble to run\n const script = server.scripts[i];\n let ramUsage = script.ramUsage;\n threads = Math.floor(Number(threads));\n if (threads === 0) {\n return 0;\n }\n ramUsage = ramUsage * threads;\n const ramAvailable = server.maxRam - server.ramUsed;\n\n if (server.hasAdminRights == false) {\n workerScript.log(caller, () => `You do not have root access on '${server.hostname}'`);\n return 0;\n } else if (ramUsage > ramAvailable) {\n workerScript.log(\n caller,\n () =>\n `Cannot run script '${scriptname}' (t=${threads}) on '${server.hostname}' because there is not enough available RAM!`,\n );\n return 0;\n } else {\n // Able to run script\n workerScript.log(\n caller,\n () => `'${scriptname}' on '${server.hostname}' with ${threads} threads and args: ${arrayToString(args)}.`,\n );\n const runningScriptObj = new RunningScript(script, args);\n runningScriptObj.threads = threads;\n runningScriptObj.server = server.hostname;\n\n return startWorkerScript(player, runningScriptObj, server, workerScript);\n }\n break;\n }\n\n workerScript.log(caller, () => `Could not find script '${scriptname}' on '${server.hostname}'`);\n return 0;\n}\n","import { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { Export } from \"./Export\";\n\ninterface IConstructorParams {\n name?: string;\n}\n\nexport class Material {\n // Name of material\n name = \"InitName\";\n\n // Amount of material owned\n qty = 0;\n\n // Material's \"quality\". Unbounded\n qlt = 0;\n\n // How much demand the Material has in the market, and the range of possible\n // values for this \"demand\"\n dmd = 0;\n dmdR: number[] = [0, 0];\n\n // How much competition there is for this Material in the market, and the range\n // of possible values for this \"competition\"\n cmp = 0;\n cmpR: number[] = [0, 0];\n\n // Maximum volatility of this Materials stats\n mv = 0;\n\n // Markup. Determines how high of a price you can charge on the material\n // compared to the market price without suffering loss in # of sales\n // Quality is divided by this to determine markup limits\n // e,g, If mku is 10 and quality is 100 then you can markup prices by 100/10 = 10\n mku = 0;\n\n // How much of this material is being bought, sold, imported and produced every second\n buy = 0;\n sll = 0;\n prd = 0;\n imp = 0;\n\n // Exports of this material to another warehouse/industry\n exp: Export[] = [];\n\n // Total amount of this material exported in the last cycle\n totalExp = 0;\n\n // Cost / sec to buy this material. AKA Market Price\n bCost = 0;\n\n // Cost / sec to sell this material\n sCost: string | number = 0;\n\n // Flags to keep track of whether production and/or sale of this material is limited\n // [Whether production/sale is limited, limit amount]\n prdman: [boolean, number] = [false, 0]; // Production\n sllman: [boolean, string | number] = [false, 0]; // Sale\n\n // Flags that signal whether automatic sale pricing through Market TA is enabled\n marketTa1 = false;\n marketTa2 = false;\n marketTa2Price = 0;\n\n constructor(params: IConstructorParams = {}) {\n if (params.name) {\n this.name = params.name;\n }\n this.init();\n }\n\n getMarkupLimit(): number {\n return this.qlt / this.mku;\n }\n\n init(): void {\n switch (this.name) {\n case \"Water\":\n this.dmd = 75;\n this.dmdR = [65, 85];\n this.cmp = 50;\n this.cmpR = [40, 60];\n this.bCost = 1500;\n this.mv = 0.2;\n this.mku = 6;\n break;\n case \"Energy\":\n this.dmd = 90;\n this.dmdR = [80, 99];\n this.cmp = 80;\n this.cmpR = [65, 95];\n this.bCost = 2000;\n this.mv = 0.2;\n this.mku = 6;\n break;\n case \"Food\":\n this.dmd = 80;\n this.dmdR = [70, 90];\n this.cmp = 60;\n this.cmpR = [35, 85];\n this.bCost = 5000;\n this.mv = 1;\n this.mku = 3;\n break;\n case \"Plants\":\n this.dmd = 70;\n this.dmdR = [20, 90];\n this.cmp = 50;\n this.cmpR = [30, 70];\n this.bCost = 3000;\n this.mv = 0.6;\n this.mku = 3.75;\n break;\n case \"Metal\":\n this.dmd = 80;\n this.dmdR = [75, 85];\n this.cmp = 70;\n this.cmpR = [60, 80];\n this.bCost = 2650;\n this.mv = 1;\n this.mku = 6;\n break;\n case \"Hardware\":\n this.dmd = 85;\n this.dmdR = [80, 90];\n this.cmp = 80;\n this.cmpR = [65, 95];\n this.bCost = 8e3;\n this.mv = 0.5; //Less mv bc its processed twice\n this.mku = 1;\n break;\n case \"Chemicals\":\n this.dmd = 55;\n this.dmdR = [40, 70];\n this.cmp = 60;\n this.cmpR = [40, 80];\n this.bCost = 9e3;\n this.mv = 1.2;\n this.mku = 2;\n break;\n case \"Real Estate\":\n this.dmd = 50;\n this.dmdR = [5, 99];\n this.cmp = 50;\n this.cmpR = [25, 75];\n this.bCost = 80e3;\n this.mv = 1.5; //Less mv bc its processed twice\n this.mku = 1.5;\n break;\n case \"Drugs\":\n this.dmd = 60;\n this.dmdR = [45, 75];\n this.cmp = 70;\n this.cmpR = [40, 99];\n this.bCost = 40e3;\n this.mv = 1.6;\n this.mku = 1;\n break;\n case \"Robots\":\n this.dmd = 90;\n this.dmdR = [80, 9];\n this.cmp = 90;\n this.cmpR = [80, 9];\n this.bCost = 75e3;\n this.mv = 0.5; //Less mv bc its processed twice\n this.mku = 1;\n break;\n case \"AI Cores\":\n this.dmd = 90;\n this.dmdR = [80, 99];\n this.cmp = 90;\n this.cmpR = [80, 9];\n this.bCost = 15e3;\n this.mv = 0.8; //Less mv bc its processed twice\n this.mku = 0.5;\n break;\n case \"Scientific Research\":\n case \"InitName\":\n break;\n default:\n console.error(`Invalid material type in init(): ${this.name}`);\n break;\n }\n }\n\n // Process change in demand, competition, and buy cost of this material\n processMarket(): void {\n // The price will change in accordance with demand and competition.\n // e.g. If demand goes up, then so does price. If competition goes up, price goes down\n const priceVolatility: number = (Math.random() * this.mv) / 300;\n const priceChange: number = 1 + priceVolatility;\n\n //This 1st random check determines whether competition increases or decreases\n const compVolatility: number = (Math.random() * this.mv) / 100;\n const compChange: number = 1 + compVolatility;\n if (Math.random() < 0.5) {\n this.cmp *= compChange;\n if (this.cmp > this.cmpR[1]) {\n this.cmp = this.cmpR[1];\n }\n this.bCost *= 1 / priceChange; // Competition increases, so price goes down\n } else {\n this.cmp *= 1 / compChange;\n if (this.cmp < this.cmpR[0]) {\n this.cmp = this.cmpR[0];\n }\n this.bCost *= priceChange; // Competition decreases, so price goes up\n }\n\n // This 2nd random check determines whether demand increases or decreases\n const dmdVolatility: number = (Math.random() * this.mv) / 100;\n const dmdChange: number = 1 + dmdVolatility;\n if (Math.random() < 0.5) {\n this.dmd *= dmdChange;\n if (this.dmd > this.dmdR[1]) {\n this.dmd = this.dmdR[1];\n }\n this.bCost *= priceChange; // Demand increases, so price goes up\n } else {\n this.dmd *= 1 / dmdChange;\n if (this.dmd < this.dmdR[0]) {\n this.dmd = this.dmdR[0];\n }\n this.bCost *= 1 / priceChange;\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"Material\", this);\n }\n\n // Initiatizes a Material object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Material {\n return Generic_fromJSON(Material, value.data);\n }\n}\n\nReviver.constructors.Material = Material;\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { GangMember } from \"../GangMember\";\nimport { GangMemberTask } from \"../GangMemberTask\";\n\ninterface Gang {\n respect: number;\n territory: number;\n wantedLevel: number;\n}\n\nexport function calculateWantedPenalty(gang: Gang): number {\n return gang.respect / (gang.respect + gang.wantedLevel);\n}\n\nexport function calculateRespectGain(gang: Gang, member: GangMember, task: GangMemberTask): number {\n if (task.baseRespect === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * member.hack +\n (task.strWeight / 100) * member.str +\n (task.defWeight / 100) * member.def +\n (task.dexWeight / 100) * member.dex +\n (task.agiWeight / 100) * member.agi +\n (task.chaWeight / 100) * member.cha;\n statWeight -= 4 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(0.005, Math.pow(gang.territory * 100, task.territory.respect) / 100);\n const territoryPenalty = (0.2 * gang.territory + 0.8) * BitNodeMultipliers.GangSoftcap;\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n const respectMult = calculateWantedPenalty(gang);\n return Math.pow(11 * task.baseRespect * statWeight * territoryMult * respectMult, territoryPenalty);\n}\n\nexport function calculateWantedLevelGain(gang: Gang, member: GangMember, task: GangMemberTask): number {\n if (task.baseWanted === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * member.hack +\n (task.strWeight / 100) * member.str +\n (task.defWeight / 100) * member.def +\n (task.dexWeight / 100) * member.dex +\n (task.agiWeight / 100) * member.agi +\n (task.chaWeight / 100) * member.cha;\n statWeight -= 3.5 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(0.005, Math.pow(gang.territory * 100, task.territory.wanted) / 100);\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n if (task.baseWanted < 0) {\n return 0.4 * task.baseWanted * statWeight * territoryMult;\n }\n const calc = (7 * task.baseWanted) / Math.pow(3 * statWeight * territoryMult, 0.8);\n\n // Put an arbitrary cap on this to prevent wanted level from rising too fast if the\n // denominator is very small. Might want to rethink formula later\n return Math.min(100, calc);\n}\n\nexport function calculateMoneyGain(gang: Gang, member: GangMember, task: GangMemberTask): number {\n if (task.baseMoney === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * member.hack +\n (task.strWeight / 100) * member.str +\n (task.defWeight / 100) * member.def +\n (task.dexWeight / 100) * member.dex +\n (task.agiWeight / 100) * member.agi +\n (task.chaWeight / 100) * member.cha;\n\n statWeight -= 3.2 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(0.005, Math.pow(gang.territory * 100, task.territory.money) / 100);\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n const respectMult = calculateWantedPenalty(gang);\n const territoryPenalty = (0.2 * gang.territory + 0.8) * BitNodeMultipliers.GangSoftcap;\n return Math.pow(5 * task.baseMoney * statWeight * territoryMult * respectMult, territoryPenalty);\n}\n\nexport function calculateAscensionPointsGain(exp: number): number {\n return Math.max(exp - 1000, 0);\n}\n\nexport function calculateAscensionMult(points: number): number {\n return Math.max(Math.pow(points / 2000, 0.5), 1);\n}\n","import { FormControlLabel, Switch, Tooltip, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface IProps {\n checked: boolean;\n onChange: (newValue: boolean, error?: string) => void;\n text: React.ReactNode;\n tooltip: React.ReactNode;\n}\n\nexport function OptionSwitch({ checked, onChange, text, tooltip }: IProps): React.ReactElement {\n const [value, setValue] = useState(checked);\n\n function handleSwitchChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setValue(event.target.checked);\n }\n\n useEffect(() => onChange(value), [value]);\n\n return (\n <FormControlLabel\n control={<Switch checked={value} onChange={handleSwitchChange} />}\n label={\n <Tooltip title={<Typography>{tooltip}</Typography>}>\n <Typography>{text}</Typography>\n </Tooltip>\n }\n />\n );\n}\n","import { FactionInfo, FactionInfos } from \"./FactionInfo\";\nimport { favorToRep, repToFavor } from \"./formulas/favor\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport class Faction {\n /**\n * Flag signalling whether the player has already received an invitation\n * to this faction\n */\n alreadyInvited = false;\n\n /**\n * Holds names of all augmentations that this Faction offers\n */\n augmentations: string[] = [];\n\n /**\n * Amount of favor the player has with this faction.\n */\n favor = 0;\n\n /**\n * Flag signalling whether player has been banned from this faction\n */\n isBanned = false;\n\n /**\n * Flag signalling whether player is a member of this faction\n */\n isMember = false;\n\n /**\n * Name of faction\n */\n name = \"\";\n\n /**\n * Amount of reputation player has with this faction\n */\n playerReputation = 0;\n\n constructor(name = \"\") {\n this.name = name;\n }\n\n getInfo(): FactionInfo {\n const info = FactionInfos[this.name];\n if (info == null) {\n throw new Error(\n `Missing faction from FactionInfos: ${this.name} this probably means the faction got corrupted somehow`,\n );\n }\n\n return info;\n }\n\n gainFavor(): void {\n if (this.favor == null) {\n this.favor = 0;\n }\n this.favor += this.getFavorGain();\n }\n\n //Returns an array with [How much favor would be gained, how much rep would be left over]\n getFavorGain(): number {\n if (this.favor == null) {\n this.favor = 0;\n }\n const storedRep = Math.max(0, favorToRep(this.favor));\n const totalRep = storedRep + this.playerReputation;\n const newFavor = repToFavor(totalRep);\n return newFavor - this.favor;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Faction\", this);\n }\n\n /**\n * Initiatizes a Faction object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Faction {\n return Generic_fromJSON(Faction, value.data);\n }\n}\n\nReviver.constructors.Faction = Faction;\n","// Enums that defined allowed values for setting configuration\n\n/**\n * Allowed values for the 'OwnedAugmentationsOrder' setting\n */\nexport enum PurchaseAugmentationsOrderSetting {\n Cost,\n Default,\n Reputation,\n Purchasable,\n}\n\n/**\n * Allowed values for the 'OwnedAugmentationsOrder' setting\n */\nexport enum OwnedAugmentationsOrderSetting {\n Alphabetically,\n AcquirementTime,\n}\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { HacknetNodeConstants } from \"../data/Constants\";\n\nexport function calculateMoneyGainRate(level: number, ram: number, cores: number, mult: number): number {\n const gainPerLevel = HacknetNodeConstants.MoneyGainPerLevel;\n\n const levelMult = level * gainPerLevel;\n const ramMult = Math.pow(1.035, ram - 1);\n const coresMult = (cores + 5) / 6;\n return levelMult * ramMult * coresMult * mult * BitNodeMultipliers.HacknetNodeMoney;\n}\n\nexport function calculateLevelUpgradeCost(startingLevel: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingLevel >= HacknetNodeConstants.MaxLevel) {\n return Infinity;\n }\n\n const mult = HacknetNodeConstants.UpgradeLevelMult;\n let totalMultiplier = 0;\n let currLevel = startingLevel;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalMultiplier += HacknetNodeConstants.LevelBaseCost * Math.pow(mult, currLevel);\n ++currLevel;\n }\n\n return (HacknetNodeConstants.BaseCost / 2) * totalMultiplier * costMult;\n}\n\nexport function calculateRamUpgradeCost(startingRam: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingRam >= HacknetNodeConstants.MaxRam) {\n return Infinity;\n }\n\n let totalCost = 0;\n let numUpgrades = Math.round(Math.log2(startingRam));\n let currentRam = startingRam;\n\n for (let i = 0; i < sanitizedLevels; ++i) {\n const baseCost = currentRam * HacknetNodeConstants.RamBaseCost;\n const mult = Math.pow(HacknetNodeConstants.UpgradeRamMult, numUpgrades);\n\n totalCost += baseCost * mult;\n\n currentRam *= 2;\n ++numUpgrades;\n }\n\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateCoreUpgradeCost(startingCore: number, extraLevels = 1, costMult = 1): number {\n const sanitizedCores = Math.round(extraLevels);\n if (isNaN(sanitizedCores) || sanitizedCores < 1) {\n return 0;\n }\n\n if (startingCore >= HacknetNodeConstants.MaxCores) {\n return Infinity;\n }\n\n const coreBaseCost = HacknetNodeConstants.CoreBaseCost;\n const mult = HacknetNodeConstants.UpgradeCoreMult;\n let totalCost = 0;\n let currentCores = startingCore;\n for (let i = 0; i < sanitizedCores; ++i) {\n totalCost += coreBaseCost * Math.pow(mult, currentCores - 1);\n ++currentCores;\n }\n\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateNodeCost(n: number, mult = 1): number {\n if (n <= 0) {\n return 0;\n }\n return HacknetNodeConstants.BaseCost * Math.pow(HacknetNodeConstants.PurchaseNextMult, n - 1) * mult;\n}\n","import * as React from \"react\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nconst gainLimit = 10e9;\n\nexport function win(p: IPlayer, n: number): void {\n p.gainMoney(n, \"casino\");\n}\n\nexport function reachedLimit(p: IPlayer): boolean {\n const reached = p.getCasinoWinnings() > gainLimit;\n if (reached) {\n dialogBoxCreate(<>Alright cheater get out of here. You're not allowed here anymore.</>);\n }\n return reached;\n}\n\nexport class Game<T, U> extends React.Component<T, U> {\n win(p: IPlayer, n: number): void {\n p.gainMoney(n, \"casino\");\n }\n\n reachedLimit(p: IPlayer): boolean {\n const reached = p.getCasinoWinnings() > gainLimit;\n if (reached) {\n dialogBoxCreate(<>Alright cheater get out of here. You're not allowed here anymore.</>);\n }\n return reached;\n }\n}\n","const _ = false;\nconst X = true;\nexport const Shapes: {\n O: boolean[][];\n I: boolean[][];\n L: boolean[][];\n J: boolean[][];\n S: boolean[][];\n Z: boolean[][];\n T: boolean[][];\n} = {\n O: [\n [X, X],\n [X, X],\n ],\n I: [[X, X, X, X]],\n L: [\n [_, _, X],\n [X, X, X],\n ],\n J: [\n [X, _, _],\n [X, X, X],\n ],\n S: [\n [_, X, X],\n [X, X, _],\n ],\n Z: [\n [X, X, _],\n [_, X, X],\n ],\n T: [\n [X, X, X],\n [_, X, _],\n ],\n};\n","import React, { useEffect } from \"react\";\n\ninterface IProps {\n onKeyDown: (this: Document, event: KeyboardEvent) => void;\n onFailure: (options?: { automated: boolean }) => void;\n}\n\nexport function KeyHandler(props: IProps): React.ReactElement {\n useEffect(() => {\n function press(this: Document, event: KeyboardEvent): void {\n if (!event.isTrusted) return;\n const f = props.onKeyDown.bind(this);\n f(event);\n }\n document.addEventListener(\"keydown\", press);\n return () => document.removeEventListener(\"keydown\", press);\n });\n\n // invisible autofocused element that eats all the keypress for the minigames.\n return <></>;\n}\n","import LinearProgress from \"@mui/material/LinearProgress\";\nimport React, { useState, useEffect } from \"react\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport { Theme } from \"@mui/material/styles\";\nimport Grid from \"@mui/material/Grid\";\n\nconst TimerProgress = withStyles((theme: Theme) => ({\n root: {\n backgroundColor: theme.palette.background.paper,\n },\n bar: {\n transition: \"none\",\n backgroundColor: theme.palette.primary.main,\n },\n}))(LinearProgress);\n\ninterface IProps {\n millis: number;\n onExpire: () => void;\n}\n\nexport function GameTimer(props: IProps): React.ReactElement {\n const [v, setV] = useState(100);\n\n const tick = 200;\n useEffect(() => {\n const intervalId = setInterval(() => {\n setV((old) => {\n if (old <= 0) props.onExpire();\n return old - (tick / props.millis) * 100;\n });\n }, tick);\n return () => {\n clearInterval(intervalId);\n };\n }, []);\n\n // https://stackoverflow.com/questions/55593367/disable-material-uis-linearprogress-animation\n // TODO(hydroflame): there's like a bug where it triggers the end before the\n // bar physically reaches the end\n return (\n <Grid item xs={12}>\n <TimerProgress variant=\"determinate\" value={v} color=\"primary\" />\n </Grid>\n );\n}\n","interface DifficultySetting {\n [key: string]: number;\n}\n\ninterface DifficultySettings {\n Trivial: DifficultySetting;\n Normal: DifficultySetting;\n Hard: DifficultySetting;\n Impossible: DifficultySetting;\n}\n\n// I could use `any` to simply some of this but I also want to take advantage\n// of the type safety that typescript provides. I'm just not sure how in this\n// case.\nexport function interpolate(settings: DifficultySettings, n: number, out: DifficultySetting): DifficultySetting {\n // interpolates between 2 difficulties.\n function lerpD(a: DifficultySetting, b: DifficultySetting, t: number): DifficultySetting {\n // interpolates between 2 numbers.\n function lerp(x: number, y: number, t: number): number {\n return (1 - t) * x + t * y;\n }\n for (const key of Object.keys(a)) {\n out[key] = lerp(a[key], b[key], t);\n }\n return a;\n }\n if (n < 0) return lerpD(settings.Trivial, settings.Trivial, 0);\n if (n >= 0 && n < 1) return lerpD(settings.Trivial, settings.Normal, n);\n if (n >= 1 && n < 2) return lerpD(settings.Normal, settings.Hard, n - 1);\n if (n >= 2 && n < 3) return lerpD(settings.Hard, settings.Impossible, n - 2);\n return lerpD(settings.Impossible, settings.Impossible, 0);\n}\n","/**\n * Hacknet Node Class\n *\n * Hacknet Nodes are specialized machines that passively earn the player money over time.\n * They can be upgraded to increase their production\n */\nimport { IHacknetNode } from \"./IHacknetNode\";\n\nimport { CONSTANTS } from \"../Constants\";\n\nimport {\n calculateMoneyGainRate,\n calculateLevelUpgradeCost,\n calculateCoreUpgradeCost,\n calculateRamUpgradeCost,\n} from \"./formulas/HacknetNodes\";\nimport { HacknetNodeConstants } from \"./data/Constants\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { ObjectValidator, minMax } from \"../utils/Validator\";\n\nexport class HacknetNode implements IHacknetNode {\n\n static validationData: ObjectValidator<HacknetNode> = {\n cores: minMax(1, 1, HacknetNodeConstants.MaxCores),\n level: minMax(1, 1, HacknetNodeConstants.MaxLevel),\n ram: minMax(1, 1, HacknetNodeConstants.MaxRam),\n onlineTimeSeconds: minMax(0, 0, Infinity),\n totalMoneyGenerated: minMax(0, 0, Infinity)\n }\n\n // Node's number of cores\n cores = 1;\n\n // Node's Level\n level = 1;\n\n // Node's production per second\n moneyGainRatePerSecond = 0;\n\n // Identifier for Node. Includes the full \"name\" (hacknet-node-N)\n name: string;\n\n // How long this Node has existed, in seconds\n onlineTimeSeconds = 0;\n\n // Node's RAM (GB)\n ram = 1;\n\n // Total money earned by this Node\n totalMoneyGenerated = 0;\n\n constructor(name = \"\", prodMult = 1) {\n this.name = name;\n\n this.updateMoneyGainRate(prodMult);\n }\n\n // Get the cost to upgrade this Node's number of cores\n calculateCoreUpgradeCost(levels = 1, costMult: number): number {\n return calculateCoreUpgradeCost(this.cores, levels, costMult);\n }\n\n // Get the cost to upgrade this Node's level\n calculateLevelUpgradeCost(levels = 1, costMult: number): number {\n return calculateLevelUpgradeCost(this.level, levels, costMult);\n }\n\n // Get the cost to upgrade this Node's RAM\n calculateRamUpgradeCost(levels = 1, costMult: number): number {\n return calculateRamUpgradeCost(this.ram, levels, costMult);\n }\n\n // Process this Hacknet Node in the game loop.\n // Returns the amount of money generated\n process(numCycles = 1): number {\n const seconds = (numCycles * CONSTANTS.MilliPerCycle) / 1000;\n let gain = this.moneyGainRatePerSecond * seconds;\n if (isNaN(gain)) {\n console.error(`Hacknet Node ${this.name} calculated earnings of NaN`);\n gain = 0;\n }\n\n this.totalMoneyGenerated += gain;\n this.onlineTimeSeconds += seconds;\n\n return gain;\n }\n\n // Upgrade this Node's number of cores, if possible\n // Returns a boolean indicating whether new cores were successfully bought\n upgradeCore(levels = 1, prodMult: number): void {\n this.cores = Math.min(HacknetNodeConstants.MaxCores, Math.round(this.cores + levels));\n this.updateMoneyGainRate(prodMult);\n }\n\n // Upgrade this Node's level, if possible\n // Returns a boolean indicating whether the level was successfully updated\n upgradeLevel(levels = 1, prodMult: number): void {\n this.level = Math.min(HacknetNodeConstants.MaxLevel, Math.round(this.level + levels));\n this.updateMoneyGainRate(prodMult);\n }\n\n // Upgrade this Node's RAM, if possible\n // Returns a boolean indicating whether the RAM was successfully upgraded\n upgradeRam(levels = 1, prodMult: number): void {\n for (let i = 0; i < levels; ++i) {\n this.ram *= 2; // Ram is always doubled\n }\n this.ram = Math.round(this.ram); // Handle any floating point precision issues\n this.updateMoneyGainRate(prodMult);\n }\n\n // Re-calculate this Node's production and update the moneyGainRatePerSecond prop\n updateMoneyGainRate(prodMult: number): void {\n this.moneyGainRatePerSecond = calculateMoneyGainRate(this.level, this.ram, this.cores, prodMult);\n if (isNaN(this.moneyGainRatePerSecond)) {\n this.moneyGainRatePerSecond = 0;\n dialogBoxCreate(\"Error in calculating Hacknet Node production. Please report to game developer\");\n }\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"HacknetNode\", this);\n }\n\n /**\n * Initiatizes a HacknetNode object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): HacknetNode {\n return Generic_fromJSON(HacknetNode, value.data);\n }\n}\n\nReviver.constructors.HacknetNode = HacknetNode;\n","/**\n * Implements functions for purchasing servers or purchasing more RAM for\n * the home computer\n */\nimport { AddToAllServers, createUniqueRandomIp } from \"./AllServers\";\nimport { safetlyCreateUniqueServer } from \"./ServerHelpers\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { isPowerOfTwo } from \"../utils/helpers/isPowerOfTwo\";\n\n// Returns the cost of purchasing a server with the given RAM\n// Returns Infinity for invalid 'ram' arguments\n/**\n * @param ram Amount of RAM on purchased server (GB)\n * @returns Cost of purchasing the given server. Returns infinity for invalid arguments\n */\nexport function getPurchaseServerCost(ram: number): number {\n const sanitizedRam = Math.round(ram);\n if (isNaN(sanitizedRam) || !isPowerOfTwo(sanitizedRam) || !(Math.sign(sanitizedRam) === 1)) {\n return Infinity;\n }\n\n if (sanitizedRam > getPurchaseServerMaxRam()) {\n return Infinity;\n }\n\n const upg = Math.max(0, Math.log(sanitizedRam) / Math.log(2) - 6);\n\n return Math.round(\n sanitizedRam *\n CONSTANTS.BaseCostFor1GBOfRamServer *\n BitNodeMultipliers.PurchasedServerCost *\n Math.pow(BitNodeMultipliers.PurchasedServerSoftcap, upg)\n );\n}\n\nexport function getPurchaseServerLimit(): number {\n return Math.round(CONSTANTS.PurchasedServerLimit * BitNodeMultipliers.PurchasedServerLimit);\n}\n\nexport function getPurchaseServerMaxRam(): number {\n const ram = Math.round(CONSTANTS.PurchasedServerMaxRam * BitNodeMultipliers.PurchasedServerMaxRam);\n\n // Round this to the nearest power of 2\n return 1 << (31 - Math.clz32(ram));\n}\n\n// Manually purchase a server (NOT through Netscript)\nexport function purchaseServer(hostname: string, ram: number, cost: number, p: IPlayer): void {\n //Check if player has enough money\n if (!p.canAfford(cost)) {\n dialogBoxCreate(\"You don't have enough money to purchase this server!\");\n return;\n }\n\n //Maximum server limit\n if (p.purchasedServers.length >= getPurchaseServerLimit()) {\n dialogBoxCreate(\n \"You have reached the maximum limit of \" +\n getPurchaseServerLimit() +\n \" servers. \" +\n \"You cannot purchase any more. You can \" +\n \"delete some of your purchased servers using the deleteServer() Netscript function in a script\",\n );\n return;\n }\n\n if (hostname == \"\") {\n dialogBoxCreate(\"You must enter a hostname for your new server!\");\n return;\n }\n\n // Create server\n const newServ = safetlyCreateUniqueServer({\n adminRights: true,\n hostname: hostname,\n ip: createUniqueRandomIp(),\n isConnectedTo: false,\n maxRam: ram,\n organizationName: \"\",\n purchasedByPlayer: true,\n });\n AddToAllServers(newServ);\n\n // Add to Player's purchasedServers array\n p.purchasedServers.push(newServ.hostname);\n\n // Connect new server to home computer\n const homeComputer = p.getHomeComputer();\n homeComputer.serversOnNetwork.push(newServ.hostname);\n newServ.serversOnNetwork.push(homeComputer.hostname);\n\n p.loseMoney(cost, \"servers\");\n\n dialogBoxCreate(\"Server successfully purchased with hostname \" + newServ.hostname);\n}\n\n// Manually upgrade RAM on home computer (NOT through Netscript)\nexport function purchaseRamForHomeComputer(p: IPlayer): void {\n const cost = p.getUpgradeHomeRamCost();\n if (!p.canAfford(cost)) {\n dialogBoxCreate(\"You do not have enough money to purchase additional RAM for your home computer\");\n return;\n }\n\n const homeComputer = p.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n dialogBoxCreate(`You cannot upgrade your home computer RAM because it is at its maximum possible value`);\n return;\n }\n\n homeComputer.maxRam *= 2;\n p.loseMoney(cost, \"servers\");\n}\n","import { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"./utils/JSONReviver\";\nimport { removeLeadingSlash, isInRootDirectory } from \"./Terminal/DirectoryHelpers\"\n\n/**\n * Represents a plain text file that is typically stored on a server.\n */\nexport class TextFile {\n /**\n * The full file name.\n */\n fn: string;\n\n /**\n * The content of the file.\n */\n text: string;\n\n /**\n * The full file name.\n */\n get filename(): string {\n return this.fn;\n }\n\n /**\n * The full file name.\n */\n set filename(value: string) {\n this.fn = value;\n }\n\n constructor(fn = \"\", txt = \"\") {\n this.fn = (fn.endsWith(\".txt\") ? fn : `${fn}.txt`).replace(/\\s+/g, \"\");\n this.text = txt;\n }\n\n /**\n * Concatenates the raw values to the end of current content.\n */\n append(txt: string): void {\n this.text += txt;\n }\n\n /**\n * Serves the file to the user as a downloadable resource through the browser.\n */\n download(): void {\n const filename: string = this.fn;\n const file: Blob = new Blob([this.text], { type: \"text/plain\" });\n /* tslint:disable-next-line:strict-boolean-expressions */\n const navigator = window.navigator as any;\n if (navigator.msSaveOrOpenBlob) {\n // IE10+\n navigator.msSaveOrOpenBlob(file, filename);\n } else {\n // Others\n const a: HTMLAnchorElement = document.createElement(\"a\");\n const url: string = URL.createObjectURL(file);\n a.href = url;\n a.download = this.fn;\n document.body.appendChild(a);\n a.click();\n setTimeout(() => {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n }\n\n /**\n * Retrieve the content of the file.\n */\n read(): string {\n return this.text;\n }\n\n /**\n * Shows the content to the user via the game's dialog box.\n */\n show(): void {\n dialogBoxCreate(`${this.fn}<br /><br />${this.text}`);\n }\n\n /**\n * Serialize the current file to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"TextFile\", this);\n }\n\n /**\n * Replaces the current content with the text provided.\n */\n write(txt: string): void {\n this.text = txt;\n }\n\n /**\n * Initiatizes a TextFile from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): TextFile {\n return Generic_fromJSON(TextFile, value.data);\n }\n}\n\nReviver.constructors.TextFile = TextFile;\n\n/**\n * Retrieve the file object for the filename on the specified server.\n * @param fn The file name to look for\n * @param server The server object to look in\n * @returns The file object, or null if it couldn't find it.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTextFile(fn: string, server: BaseServer): TextFile | null {\n let filename: string = !fn.endsWith(\".txt\") ? `${fn}.txt` : fn;\n\n if (isInRootDirectory(filename)) {\n filename = removeLeadingSlash(filename);\n }\n\n for (const file of server.textFiles as TextFile[]) {\n if (file.fn === filename) {\n return file;\n }\n }\n\n return null;\n}\n\n/**\n * Creates a TextFile on the target server.\n * @param fn The file name to create.\n * @param txt The contents of the file.\n * @param server The server that the file should be created on.\n * @returns The instance of the file.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function createTextFile(fn: string, txt: string, server: BaseServer): TextFile | undefined {\n if (getTextFile(fn, server) !== null) {\n // This should probably be a `throw`...\n /* tslint:disable-next-line:no-console */\n console.error(`A file named \"${fn}\" already exists on server ${server.hostname}.`);\n\n return undefined;\n }\n const file: TextFile = new TextFile(fn, txt);\n server.textFiles.push(file);\n\n return file;\n}\n","import { Skill } from \"./Skill\";\nimport { SkillNames } from \"./data/SkillNames\";\nimport { IMap } from \"../types\";\n\nexport const Skills: IMap<Skill> = {};\n\n(function () {\n Skills[SkillNames.BladesIntuition] = new Skill({\n name: SkillNames.BladesIntuition,\n desc:\n \"Each level of this skill increases your success chance \" + \"for all Contracts, Operations, and BlackOps by 3%\",\n baseCost: 3,\n costInc: 2.1,\n successChanceAll: 3,\n });\n Skills[SkillNames.Cloak] = new Skill({\n name: SkillNames.Cloak,\n desc:\n \"Each level of this skill increases your \" +\n \"success chance in stealth-related Contracts, Operations, and BlackOps by 5.5%\",\n baseCost: 2,\n costInc: 1.1,\n successChanceStealth: 5.5,\n });\n Skills[SkillNames.ShortCircuit] = new Skill({\n name: SkillNames.ShortCircuit,\n desc:\n \"Each level of this skill increases your success chance \" +\n \"in Contracts, Operations, and BlackOps that involve retirement by 5.5%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceKill: 5.5,\n });\n Skills[SkillNames.DigitalObserver] = new Skill({\n name: SkillNames.DigitalObserver,\n desc: \"Each level of this skill increases your success chance in \" + \"all Operations and BlackOps by 4%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceOperation: 4,\n });\n Skills[SkillNames.Tracer] = new Skill({\n name: SkillNames.Tracer,\n desc: \"Each level of this skill increases your success chance in \" + \"all Contracts by 4%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceContract: 4,\n });\n Skills[SkillNames.Overclock] = new Skill({\n name: SkillNames.Overclock,\n desc:\n \"Each level of this skill decreases the time it takes \" +\n \"to attempt a Contract, Operation, and BlackOp by 1% (Max Level: 90)\",\n baseCost: 3,\n costInc: 1.4,\n maxLvl: 90,\n actionTime: 1,\n });\n Skills[SkillNames.Reaper] = new Skill({\n name: SkillNames.Reaper,\n desc: \"Each level of this skill increases your effective combat stats for Bladeburner actions by 2%\",\n baseCost: 2,\n costInc: 2.1,\n effStr: 2,\n effDef: 2,\n effDex: 2,\n effAgi: 2,\n });\n Skills[SkillNames.EvasiveSystem] = new Skill({\n name: SkillNames.EvasiveSystem,\n desc: \"Each level of this skill increases your effective \" + \"dexterity and agility for Bladeburner actions by 4%\",\n baseCost: 2,\n costInc: 2.1,\n effDex: 4,\n effAgi: 4,\n });\n Skills[SkillNames.Datamancer] = new Skill({\n name: SkillNames.Datamancer,\n desc:\n \"Each level of this skill increases your effectiveness in \" +\n \"synthoid population analysis and investigation by 5%. \" +\n \"This affects all actions that can potentially increase \" +\n \"the accuracy of your synthoid population/community estimates.\",\n baseCost: 3,\n costInc: 1,\n successChanceEstimate: 5,\n });\n Skills[SkillNames.CybersEdge] = new Skill({\n name: SkillNames.CybersEdge,\n desc: \"Each level of this skill increases your max stamina by 2%\",\n baseCost: 1,\n costInc: 3,\n stamina: 2,\n });\n Skills[SkillNames.HandsOfMidas] = new Skill({\n name: SkillNames.HandsOfMidas,\n desc: \"Each level of this skill increases the amount of money you receive from Contracts by 10%\",\n baseCost: 2,\n costInc: 2.5,\n money: 10,\n });\n Skills[SkillNames.Hyperdrive] = new Skill({\n name: SkillNames.Hyperdrive,\n desc: \"Each level of this skill increases the experience earned from Contracts, Operations, and BlackOps by 10%\",\n baseCost: 1,\n costInc: 2.5,\n expGain: 10,\n });\n})();\n","import { gangMemberUpgradesMetadata } from \"./data/upgrades\";\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\n\nexport const GangMemberUpgrades: {\n [key: string]: GangMemberUpgrade;\n} = {};\n\n(function () {\n gangMemberUpgradesMetadata.forEach((e) => {\n GangMemberUpgrades[e.name] = new GangMemberUpgrade(e.name, e.cost, e.upgType, e.mults);\n });\n})();\n","/**\n * Stock Market Helper Functions\n */\nimport { Stock } from \"./Stock\";\nimport { PositionTypes } from \"./data/PositionTypes\";\nimport { CONSTANTS } from \"../Constants\";\n\n// Amount by which a stock's forecast changes during each price movement\nexport const forecastChangePerPriceMovement = 0.006;\n\n/**\n * Calculate the total cost of a \"buy\" transaction. This accounts for spread and commission.\n * @param {Stock} stock - Stock being purchased\n * @param {number} shares - Number of shares being transacted\n * @param {PositionTypes} posType - Long or short position\n * @returns {number | null} Total transaction cost. Returns null for an invalid transaction\n */\nexport function getBuyTransactionCost(stock: Stock, shares: number, posType: PositionTypes): number | null {\n if (isNaN(shares) || shares <= 0 || !(stock instanceof Stock)) {\n return null;\n }\n\n // Cap the 'shares' arg at the stock's maximum shares. This'll prevent\n // hanging in the case when a really big number is passed in\n shares = Math.min(shares, stock.maxShares);\n\n const isLong = posType === PositionTypes.Long;\n\n // If the number of shares doesn't trigger a price movement, its a simple calculation\n if (isLong) {\n return shares * stock.getAskPrice() + CONSTANTS.StockMarketCommission;\n } else {\n return shares * stock.getBidPrice() + CONSTANTS.StockMarketCommission;\n }\n}\n\n/**\n * Calculate the TOTAL amount of money gained from a sale (NOT net profit). This accounts\n * for spread and commission.\n * @param {Stock} stock - Stock being sold\n * @param {number} shares - Number of sharse being transacted\n * @param {PositionTypes} posType - Long or short position\n * @returns {number | null} Amount of money gained from transaction. Returns null for an invalid transaction\n */\nexport function getSellTransactionGain(stock: Stock, shares: number, posType: PositionTypes): number | null {\n if (isNaN(shares) || shares <= 0 || !(stock instanceof Stock)) {\n return null;\n }\n\n // Cap the 'shares' arg at the stock's maximum shares. This'll prevent\n // hanging in the case when a really big number is passed in\n shares = Math.min(shares, stock.maxShares);\n\n const isLong = posType === PositionTypes.Long;\n if (isLong) {\n return shares * stock.getBidPrice() - CONSTANTS.StockMarketCommission;\n } else {\n // Calculating gains for a short position requires calculating the profit made\n const origCost = shares * stock.playerAvgShortPx;\n const profit = (stock.playerAvgShortPx - stock.getAskPrice()) * shares - CONSTANTS.StockMarketCommission;\n\n return origCost + profit;\n }\n}\n\n/**\n * Processes a stock's change in forecast & second-order forecast\n * whenever it is transacted\n * @param {Stock} stock - Stock being sold\n * @param {number} shares - Number of sharse being transacted\n * @param {PositionTypes} posType - Long or short position\n */\nexport function processTransactionForecastMovement(stock: Stock, shares: number): void {\n if (isNaN(shares) || shares <= 0 || !(stock instanceof Stock)) {\n return;\n }\n\n // Cap the 'shares' arg at the stock's maximum shares. This'll prevent\n // hanging in the case when a really big number is passed in\n shares = Math.min(shares, stock.maxShares);\n\n // If there's only going to be one iteration at most\n const firstShares = stock.shareTxUntilMovement;\n if (shares <= firstShares) {\n stock.shareTxUntilMovement -= shares;\n if (stock.shareTxUntilMovement <= 0) {\n stock.shareTxUntilMovement = stock.shareTxForMovement;\n stock.influenceForecast(forecastChangePerPriceMovement);\n stock.influenceForecastForecast(forecastChangePerPriceMovement * (stock.mv / 100));\n }\n\n return;\n }\n\n // Calculate how many iterations of price changes we need to account for\n const remainingShares = shares - firstShares;\n let numIterations = 1 + Math.ceil(remainingShares / stock.shareTxForMovement);\n\n // If on the offchance we end up perfectly at the next price movement\n stock.shareTxUntilMovement =\n stock.shareTxForMovement - ((shares - stock.shareTxUntilMovement) % stock.shareTxForMovement);\n if (stock.shareTxUntilMovement === stock.shareTxForMovement || stock.shareTxUntilMovement <= 0) {\n ++numIterations;\n stock.shareTxUntilMovement = stock.shareTxForMovement;\n }\n\n // Forecast always decreases in magnitude\n const forecastChange = forecastChangePerPriceMovement * (numIterations - 1);\n const forecastForecastChange = forecastChange * (stock.mv / 100);\n stock.influenceForecast(forecastChange);\n stock.influenceForecastForecast(forecastForecastChange);\n}\n\n/**\n * Calculate the maximum number of shares of a stock that can be purchased.\n * Handles mid-transaction price movements, both L and S positions, etc.\n * Used for the \"Buy Max\" button in the UI\n * @param {Stock} stock - Stock being purchased\n * @param {PositionTypes} posType - Long or short position\n * @param {number} money - Amount of money player has\n * @returns maximum number of shares that the player can purchase\n */\nexport function calculateBuyMaxAmount(stock: Stock, posType: PositionTypes, money: number): number {\n if (!(stock instanceof Stock)) {\n return 0;\n }\n\n const isLong = posType === PositionTypes.Long;\n\n const remainingMoney = money - CONSTANTS.StockMarketCommission;\n const currPrice = isLong ? stock.getAskPrice() : stock.getBidPrice();\n\n return Math.floor(remainingMoney / currPrice);\n}\n","// Base class representing a person-like object\nimport { Augmentation } from \"../Augmentation/Augmentation\";\nimport { IPlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { CONSTANTS } from \"../Constants\";\nimport { calculateSkill } from \"./formulas/skill\";\nimport { calculateIntelligenceBonus } from \"./formulas/intelligence\";\n\n// Interface that defines a generic object used to track experience/money\n// earnings for tasks\nexport interface ITaskTracker {\n hack: number;\n str: number;\n def: number;\n dex: number;\n agi: number;\n cha: number;\n money: number;\n}\n\nexport function createTaskTracker(): ITaskTracker {\n return {\n hack: 0,\n str: 0,\n def: 0,\n dex: 0,\n agi: 0,\n cha: 0,\n money: 0,\n };\n}\n\nexport abstract class Person {\n /**\n * Stats\n */\n hacking = 1;\n strength = 1;\n defense = 1;\n dexterity = 1;\n agility = 1;\n charisma = 1;\n intelligence = 1;\n hp = 10;\n max_hp = 10;\n\n /**\n * Experience\n */\n hacking_exp = 0;\n strength_exp = 0;\n defense_exp = 0;\n dexterity_exp = 0;\n agility_exp = 0;\n charisma_exp = 0;\n intelligence_exp = 0;\n\n /**\n * Multipliers\n */\n hacking_mult = 1;\n strength_mult = 1;\n defense_mult = 1;\n dexterity_mult = 1;\n agility_mult = 1;\n charisma_mult = 1;\n\n hacking_exp_mult = 1;\n strength_exp_mult = 1;\n defense_exp_mult = 1;\n dexterity_exp_mult = 1;\n agility_exp_mult = 1;\n charisma_exp_mult = 1;\n\n hacking_chance_mult = 1;\n hacking_speed_mult = 1;\n hacking_money_mult = 1;\n hacking_grow_mult = 1;\n\n company_rep_mult = 1;\n faction_rep_mult = 1;\n\n crime_money_mult = 1;\n crime_success_mult = 1;\n\n work_money_mult = 1;\n\n hacknet_node_money_mult = 1;\n hacknet_node_purchase_cost_mult = 1;\n hacknet_node_ram_cost_mult = 1;\n hacknet_node_core_cost_mult = 1;\n hacknet_node_level_cost_mult = 1;\n\n bladeburner_max_stamina_mult = 1;\n bladeburner_stamina_gain_mult = 1;\n bladeburner_analysis_mult = 1;\n bladeburner_success_chance_mult = 1;\n\n /**\n * Augmentations\n */\n augmentations: IPlayerOwnedAugmentation[] = [];\n queuedAugmentations: IPlayerOwnedAugmentation[] = [];\n\n /**\n * City that the person is in\n */\n city: CityName = CityName.Sector12;\n\n /**\n * Updates this object's multipliers for the given augmentation\n */\n applyAugmentation(aug: Augmentation): void {\n for (const mult of Object.keys(aug.mults)) {\n if ((this as any)[mult] == null) {\n console.warn(`Augmentation has unrecognized multiplier property: ${mult}`);\n } else {\n (this as any)[mult] *= aug.mults[mult];\n }\n }\n }\n\n /**\n * Given an experience amount and stat multiplier, calculates the\n * stat level. Stat-agnostic (same formula for every stat)\n */\n calculateStat(exp: number, mult = 1): number {\n return calculateSkill(exp, mult);\n }\n\n /**\n * Calculate and return the amount of faction reputation earned per cycle\n * when doing Field Work for a faction\n */\n getFactionFieldWorkRepGain(): number {\n const t =\n (0.9 *\n (this.hacking / CONSTANTS.MaxSkillLevel +\n this.strength / CONSTANTS.MaxSkillLevel +\n this.defense / CONSTANTS.MaxSkillLevel +\n this.dexterity / CONSTANTS.MaxSkillLevel +\n this.agility / CONSTANTS.MaxSkillLevel +\n this.charisma / CONSTANTS.MaxSkillLevel)) /\n 5.5;\n return t * this.faction_rep_mult;\n }\n\n /**\n * Calculate and return the amount of faction reputation earned per cycle\n * when doing Hacking Work for a faction\n */\n getFactionHackingWorkRepGain(): number {\n return (this.hacking / CONSTANTS.MaxSkillLevel) * this.faction_rep_mult;\n }\n\n /**\n * Calculate and return the amount of faction reputation earned per cycle\n * when doing Security Work for a faction\n */\n getFactionSecurityWorkRepGain(): number {\n const t =\n (0.9 *\n (this.hacking / CONSTANTS.MaxSkillLevel +\n this.strength / CONSTANTS.MaxSkillLevel +\n this.defense / CONSTANTS.MaxSkillLevel +\n this.dexterity / CONSTANTS.MaxSkillLevel +\n this.agility / CONSTANTS.MaxSkillLevel)) /\n 4.5;\n return t * this.faction_rep_mult;\n }\n\n /**\n * Reset all multipliers to 1\n */\n resetMultipliers(): void {\n this.hacking_mult = 1;\n this.strength_mult = 1;\n this.defense_mult = 1;\n this.dexterity_mult = 1;\n this.agility_mult = 1;\n this.charisma_mult = 1;\n\n this.hacking_exp_mult = 1;\n this.strength_exp_mult = 1;\n this.defense_exp_mult = 1;\n this.dexterity_exp_mult = 1;\n this.agility_exp_mult = 1;\n this.charisma_exp_mult = 1;\n\n this.company_rep_mult = 1;\n this.faction_rep_mult = 1;\n\n this.crime_money_mult = 1;\n this.crime_success_mult = 1;\n\n this.work_money_mult = 1;\n }\n\n /**\n * Update all stat levels\n */\n updateStatLevels(): void {\n this.hacking = Math.max(\n 1,\n Math.floor(this.calculateStat(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier)),\n );\n this.strength = Math.max(\n 1,\n Math.floor(\n this.calculateStat(this.strength_exp, this.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier),\n ),\n );\n this.defense = Math.max(\n 1,\n Math.floor(this.calculateStat(this.defense_exp, this.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier)),\n );\n this.dexterity = Math.max(\n 1,\n Math.floor(\n this.calculateStat(this.dexterity_exp, this.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier),\n ),\n );\n this.agility = Math.max(\n 1,\n Math.floor(this.calculateStat(this.agility_exp, this.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier)),\n );\n this.charisma = Math.max(\n 1,\n Math.floor(\n this.calculateStat(this.charisma_exp, this.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier),\n ),\n );\n\n const ratio: number = this.hp / this.max_hp;\n this.max_hp = Math.floor(10 + this.defense / 10);\n this.hp = Math.round(this.max_hp * ratio);\n }\n\n getIntelligenceBonus(weight: number): number {\n return calculateIntelligenceBonus(this.intelligence, weight);\n }\n}\n","import React from \"react\";\nimport { BitNodeMultipliers } from \"./BitNodeMultipliers\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IMap } from \"../types\";\n\nclass BitNode {\n // A short description, or tagline, about the BitNode\n desc: string;\n\n // A long, detailed overview of the BitNode\n info: JSX.Element;\n\n // Name of BitNode\n name: string;\n\n // BitNode number\n number: number;\n\n difficulty: 0 | 1 | 2;\n\n constructor(n: number, difficulty: 0 | 1 | 2, name: string, desc = \"\", info: JSX.Element = <></>) {\n this.number = n;\n this.difficulty = difficulty;\n this.name = name;\n this.desc = desc;\n this.info = info;\n }\n}\n\nexport const BitNodes: IMap<BitNode> = {};\n\nBitNodes[\"BitNode1\"] = new BitNode(\n 1,\n 0,\n \"Source Genesis\",\n \"The original BitNode\",\n (\n <>\n The first BitNode created by the Enders to imprison the minds of humans. It became the prototype and\n testing-grounds for all of the BitNodes that followed.\n <br />\n <br />\n This is the first BitNode that you play through. It has no special modifications or mechanics.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 1, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets the player start with 32GB of RAM on his/her home computer when\n entering a new BitNode, and also increases all of the player's multipliers by:\n <br />\n <br />\n Level 1: 16%\n <br />\n Level 2: 24%\n <br />\n Level 3: 28%\n </>\n ),\n);\nBitNodes[\"BitNode2\"] = new BitNode(\n 2,\n 0,\n \"Rise of the Underworld\",\n \"From the shadows, they rose\", //Gangs\n (\n <>\n From the shadows, they rose.\n <br />\n <br />\n Organized crime groups quickly filled the void of power left behind from the collapse of Western government in the\n 2050s. As society and civilization broke down, people quickly succumbed to the innate human impulse of evil and\n savagery. The organized crime factions quickly rose to the top of the modern world.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n Your hacking level is reduced by 20%\n <br />\n The growth rate and maximum amount of money available on servers are significantly decreased\n <br />\n The amount of money gained from crimes and Infiltration is tripled\n <br />\n Certain Factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead, NiteSec, The Black\n Hand) give the player the ability to form and manage their own gangs. These gangs will earn the player money and\n reputation with the corresponding Faction\n <br />\n Every Augmentation in the game will be available through the Factions listed above\n <br />\n For every Faction NOT listed above, reputation gains are halved\n <br />\n You will no longer gain passive reputation with Factions\n <br />\n <br />\n Destroying this BitNode will give you Source-File 2, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes once your karma decreases\n to a certain value. It also increases the player's crime success rate, crime money, and charisma multipliers by:\n <br />\n <br />\n Level 1: 24%\n <br />\n Level 2: 36%\n <br />\n Level 3: 42%\n </>\n ),\n);\nBitNodes[\"BitNode3\"] = new BitNode(\n 3,\n 0,\n \"Corporatocracy\",\n \"The Price of Civilization\",\n (\n <>\n Our greatest illusion is that a healthy society can revolve around a single-minded pursuit of wealth.\n <br />\n <br />\n Sometime in the early 21st century economic and political globalization turned the world into a corporatocracy,\n and it never looked back. Now, the privileged elite will happily bankrupt their own countrymen, decimate their own\n community, and evict their neighbors from houses in their desperate bid to increase their wealth.\n <br />\n <br />\n In this BitNode you can create and manage your own corporation. Running a successful corporation has the potential\n of generating massive profits. All other forms of income are reduced by 75%. Furthermore: <br />\n <br />\n The price and reputation cost of all Augmentations is tripled\n <br />\n The starting and maximum amount of money on servers is reduced by 75%\n <br />\n Server growth rate is reduced by 80%\n <br />\n You now only need 75 favour with a faction in order to donate to it, rather than 150\n <br />\n <br />\n Destroying this BitNode will give you Source-File 3, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although some\n BitNodes will disable this mechanic). This Source-File also increases your charisma and company salary multipliers\n by:\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nBitNodes[\"BitNode4\"] = new BitNode(\n 4,\n 1,\n \"The Singularity\",\n \"The Man and the Machine\",\n (\n <>\n The Singularity has arrived. The human race is gone, replaced by artificially superintelligent beings that are\n more machine than man. <br />\n <br />\n In this BitNode, progressing is significantly harder. Experience gain rates for all stats are reduced. Most\n methods of earning money will now give significantly less.\n <br />\n <br />\n In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions. These\n functions allow you to control most aspects of the game through scripts, including working for factions/companies,\n purchasing/installing Augmentations, and creating programs.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 4, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets you access and use the Singularity Functions in other BitNodes.\n Each level of this Source-File reduces the RAM cost of singularity functions.\n </>\n ),\n);\nBitNodes[\"BitNode5\"] = new BitNode(\n 5,\n 1,\n \"Artificial Intelligence\",\n \"Posthuman\",\n (\n <>\n They said it couldn't be done. They said the human brain, along with its consciousness and intelligence, couldn't\n be replicated. They said the complexity of the brain results from unpredictable, nonlinear interactions that\n couldn't be modeled by 1's and 0's. They were wrong.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n The base security level of servers is doubled\n <br />\n The starting money on servers is halved, but the maximum money remains the same\n <br />\n Most methods of earning money now give significantly less\n <br />\n Infiltration gives 50% more reputation and money\n <br />\n Corporations have 50% lower valuations and are therefore less profitable\n <br />\n Augmentations are more expensive\n <br />\n Hacking experience gain rates are reduced\n <br />\n <br />\n Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants you a special new stat called Intelligence. Intelligence is\n unique because it is permanent and persistent (it never gets reset back to 1). However gaining Intelligence\n experience is much slower than other stats, and it is also hidden (you won't know when you gain experience and how\n much). Higher Intelligence levels will boost your production for many actions in the game. <br />\n <br />\n In addition, this Source-File will unlock the getBitNodeMultipliers() Netscript function and let you start with\n Formulas.exe, and will also raise all of your hacking-related multipliers by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nBitNodes[\"BitNode6\"] = new BitNode(\n 6,\n 1,\n \"Bladeburners\",\n \"Like Tears in Rain\",\n (\n <>\n In the middle of the 21st century, OmniTek Incorporated began designing and manufacturing advanced synthetic\n androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth generation of\n their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was the first\n sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than\n the humans that had created them.\n <br />\n <br />\n In this BitNode you will be able to access the Bladeburner Division at the NSA, which provides a new mechanic for\n progression. Furthermore:\n <br />\n <br />\n Hacking and Hacknet Nodes will be less profitable\n <br />\n Your hacking level is reduced by 65%\n <br />\n Hacking experience gain from scripts is reduced by 75%\n <br />\n Corporations have 80% lower valuations and are therefore less profitable\n <br />\n Working for companies is 50% less profitable\n <br />\n Crimes and Infiltration are 25% less profitable\n <br />\n <br />\n Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to access the NSA's Bladeburner Division in other\n BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat\n stats by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nBitNodes[\"BitNode7\"] = new BitNode(\n 7,\n 2,\n \"Bladeburners 2079\",\n \"More human than humans\",\n (\n <>\n In the middle of the 21st century, you were doing cutting-edge work at OmniTek Incorporated as part of the AI\n design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major technological\n breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing a\n hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models\n that were stronger, faster, and more intelligent than the humans that had created them.\n <br />\n <br />\n In this BitNode you will be able to access the Bladeburner API, which allows you to access Bladeburner\n functionality through Netscript. Furthermore: <br />\n <br />\n The rank you gain from Bladeburner contracts/operations is reduced by 40%\n <br />\n Bladeburner skills cost twice as many skill points\n <br />\n Augmentations are 3x more expensive\n <br />\n Hacking and Hacknet Nodes will be significantly less profitable\n <br />\n Your hacking level is reduced by 65%\n <br />\n Hacking experience gain from scripts is reduced by 75%\n <br />\n Corporations have 80% lower valuations and are therefore less profitable\n <br />\n Working for companies is 50% less profitable\n <br />\n Crimes and Infiltration are 25% less profitable\n <br />\n <br />\n Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to access the Bladeburner Netscript API in other BitNodes.\n In addition, this Source-File will increase all of your Bladeburner multipliers by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nBitNodes[\"BitNode8\"] = new BitNode(\n 8,\n 2,\n \"Ghost of Wall Street\",\n \"Money never sleeps\",\n (\n <>\n You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n You start with $250 million\n <br />\n The only way to earn money is by trading on the stock market\n <br />\n You start with a WSE membership and access to the TIX API\n <br />\n You are able to short stocks and place different types of orders (limit/stop)\n <br />\n You can immediately donate to factions to gain reputation\n <br />\n <br />\n Destroying this BitNode will give you Source-File 8, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants the following benefits:\n <br />\n <br />\n Level 1: Permanent access to WSE and TIX API\n <br />\n Level 2: Ability to short stocks in other BitNodes\n <br />\n Level 3: Ability to use limit/stop orders in other BitNodes\n <br />\n <br />\n This Source-File also increases your hacking growth multipliers by:\n <br />\n Level 1: 12%\n <br />\n Level 2: 18%\n <br />\n Level 3: 21%\n </>\n ),\n);\nBitNodes[\"BitNode9\"] = new BitNode(\n 9,\n 2,\n \"Hacktocracy\",\n \"Hacknet Unleashed\",\n (\n <>\n When Fulcrum Technologies released their open-source Linux distro Chapeau, it quickly became the OS of choice for\n the underground hacking community. Chapeau became especially notorious for powering the Hacknet, a global,\n decentralized network used for nefarious purposes. Fulcrum quickly abandoned the project and dissociated\n themselves from it.\n <br />\n <br />\n This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate hashes,\n which can be spent on a variety of different upgrades.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n Your stats are significantly decreased\n <br />\n You cannnot purchase additional servers\n <br />\n Hacking is significantly less profitable\n <br />\n <br />\n Destroying this BitNode will give you Source-File 9, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants the following benefits:\n <br />\n <br />\n Level 1: Permanently unlocks the Hacknet Server in other BitNodes\n <br />\n Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode\n <br />\n Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode\n <br />\n <br />\n (Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing\n Augmentations)\n <br />\n <br />\n This Source-File also increases your hacknet multipliers by:\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nBitNodes[\"BitNode10\"] = new BitNode(\n 10,\n 2,\n \"Digital Carbon\",\n \"Your body is not who you are\",\n (\n <>\n In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people to digitize their\n consciousness. Their consciousness could then be transferred into Synthoids or other bodies by trasmitting the\n digitized data. Human bodies became nothing more than 'sleeves' for the human consciousness. Mankind had finally\n achieved immortality - at least for those that could afford it.\n <br />\n <br />\n This BitNode unlocks Sleeve technology. Sleeve technology allows you to:\n <br />\n <br />\n 1. Re-sleeve: Purchase and transfer your consciousness into a new body\n <br />\n 2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks\n synchronously\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n Your stats are significantly decreased\n <br />\n All methods of gaining money are half as profitable (except Stock Market)\n <br />\n Purchased servers are more expensive, have less max RAM, and a lower maximum limit\n <br />\n Augmentations are 5x as expensive and require twice as much reputation\n <br />\n <br />\n Destroying this BitNode will give you Source-File 10, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File unlocks Sleeve technology in other BitNodes. Each level of this\n Source-File also grants you a Duplicate Sleeve\n </>\n ),\n);\nBitNodes[\"BitNode11\"] = new BitNode(\n 11,\n 1,\n \"The Big Crash\",\n \"Okay. Sell it all.\",\n (\n <>\n The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around\n the world. It was this period of disorder that eventually lead to the governmental reformation of many global\n superpowers, most notably the USA and China. But just as the world was slowly beginning to recover from these dark\n times, financial catastrophe hit.\n <br />\n <br />\n In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of\n this chaos and confusion, hackers were able to steal billions of dollars from the world's largest electronic\n banks, prompting an international banking crisis as governments were unable to bail out insolvent banks. Now, the\n world is slowly crumbling in the middle of the biggest economic crisis of all time.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n Your hacking stat and experience gain are halved\n <br />\n The starting and maximum amount of money available on servers is significantly decreased\n <br />\n The growth rate of servers is significantly reduced\n <br />\n Weakening a server is twice as effective\n <br />\n Company wages are decreased by 50%\n <br />\n Corporation valuations are 90% lower and are therefore significantly less profitable\n <br />\n Hacknet Node production is significantly decreased\n <br />\n Crime and Infiltration are more lucrative\n <br />\n Augmentations are twice as expensive\n <br />\n <br />\n Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH the player's salary and\n reputation gain rate at that company by 1% per favor (rather than just the reputation gain). This Source-File also\n increases the player's company salary and reputation gain multipliers by:\n <br />\n <br />\n Level 1: 32%\n <br />\n Level 2: 48%\n <br />\n Level 3: 56%\n <br />\n <br />\n It also reduces the price increase for every aug bought by:\n <br />\n <br />\n Level 1: 4%\n <br />\n Level 2: 6%\n <br />\n Level 3: 7%\n </>\n ),\n);\nBitNodes[\"BitNode12\"] = new BitNode(\n 12,\n 0,\n \"The Recursion\",\n \"Repeat.\",\n (\n <>\n To iterate is human, to recurse divine.\n <br />\n <br />\n Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give you\n Source-File 12, or if you already have this Source-File it will upgrade its level. There is no maximum level for\n Source-File 12. Each level of Source-File 12 lets you start any BitNodes with NeuroFlux Governor equal to the\n level of this source file.\n </>\n ),\n);\nBitNodes[\"BitNode13\"] = new BitNode(\n 13,\n 2,\n \"They're lunatics\",\n \"1 step back, 2 steps forward\",\n (\n <>\n With the invention of Augmentations in the 2040s a religious group known as the Church of the Machine God has\n rallied far more support than anyone would have hoped.\n <br />\n <br />\n Their leader, Allison \"Mother\" Stanek is said to have created her own Augmentation whose power goes beyond any\n other. Find her in Chongqing and gain her trust.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n Every stat is significantly reduced\n <br />\n Stanek's Gift power is significantly increased.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 13, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets the Church of the Machine God appear in other BitNodes.\n <br />\n <br />\n Each level of this Source-File increases the size of Stanek's Gift.\n </>\n ),\n);\n// Books: Frontera, Shiner\nBitNodes[\"BitNode14\"] = new BitNode(14, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode15\"] = new BitNode(15, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode16\"] = new BitNode(16, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode17\"] = new BitNode(17, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode18\"] = new BitNode(18, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode19\"] = new BitNode(19, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode20\"] = new BitNode(20, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode21\"] = new BitNode(21, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode22\"] = new BitNode(22, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode23\"] = new BitNode(23, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode24\"] = new BitNode(24, 2, \"\", \"COMING SOON\");\n\nexport function initBitNodeMultipliers(p: IPlayer): void {\n if (p.bitNodeN == null) {\n p.bitNodeN = 1;\n }\n for (const mult of Object.keys(BitNodeMultipliers)) {\n if (BitNodeMultipliers.hasOwnProperty(mult)) {\n BitNodeMultipliers[mult] = 1;\n }\n }\n // Special case.\n BitNodeMultipliers.StaneksGiftExtraSize = 0;\n\n switch (p.bitNodeN) {\n case 1: // Source Genesis (every multiplier is 1)\n break;\n case 2: // Rise of the Underworld\n BitNodeMultipliers.HackingLevelMultiplier = 0.8;\n BitNodeMultipliers.ServerGrowthRate = 0.8;\n BitNodeMultipliers.ServerMaxMoney = 0.2;\n BitNodeMultipliers.ServerStartingMoney = 0.4;\n BitNodeMultipliers.CrimeMoney = 3;\n BitNodeMultipliers.InfiltrationMoney = 3;\n BitNodeMultipliers.FactionWorkRepGain = 0.5;\n BitNodeMultipliers.FactionPassiveRepGain = 0;\n BitNodeMultipliers.StaneksGiftPowerMultiplier = 2;\n BitNodeMultipliers.StaneksGiftExtraSize = -6;\n BitNodeMultipliers.PurchasedServerSoftcap = 1.3;\n BitNodeMultipliers.CorporationSoftCap = 0.9;\n BitNodeMultipliers.WorldDaemonDifficulty = 5;\n break;\n case 3: // Corporatocracy\n BitNodeMultipliers.HackingLevelMultiplier = 0.8;\n BitNodeMultipliers.RepToDonateToFaction = 0.5;\n BitNodeMultipliers.AugmentationRepCost = 3;\n BitNodeMultipliers.AugmentationMoneyCost = 3;\n BitNodeMultipliers.ServerMaxMoney = 0.2;\n BitNodeMultipliers.ServerStartingMoney = 0.2;\n BitNodeMultipliers.ServerGrowthRate = 0.2;\n BitNodeMultipliers.ScriptHackMoney = 0.2;\n BitNodeMultipliers.CompanyWorkMoney = 0.25;\n BitNodeMultipliers.CrimeMoney = 0.25;\n BitNodeMultipliers.HacknetNodeMoney = 0.25;\n BitNodeMultipliers.HomeComputerRamCost = 1.5;\n BitNodeMultipliers.PurchasedServerCost = 2;\n BitNodeMultipliers.StaneksGiftPowerMultiplier = 0.75;\n BitNodeMultipliers.StaneksGiftExtraSize = -2;\n BitNodeMultipliers.PurchasedServerSoftcap = 1.3;\n BitNodeMultipliers.GangSoftcap = 0.9;\n BitNodeMultipliers.WorldDaemonDifficulty = 2;\n break;\n case 4: // The Singularity\n BitNodeMultipliers.ServerMaxMoney = 0.15;\n BitNodeMultipliers.ServerStartingMoney = 0.75;\n BitNodeMultipliers.ScriptHackMoney = 0.2;\n BitNodeMultipliers.CompanyWorkMoney = 0.1;\n BitNodeMultipliers.CrimeMoney = 0.2;\n BitNodeMultipliers.HacknetNodeMoney = 0.05;\n BitNodeMultipliers.CompanyWorkExpGain = 0.5;\n BitNodeMultipliers.ClassGymExpGain = 0.5;\n BitNodeMultipliers.FactionWorkExpGain = 0.5;\n BitNodeMultipliers.HackExpGain = 0.4;\n BitNodeMultipliers.CrimeExpGain = 0.5;\n BitNodeMultipliers.FactionWorkRepGain = 0.75;\n BitNodeMultipliers.StaneksGiftPowerMultiplier = 1.5;\n BitNodeMultipliers.StaneksGiftExtraSize = 0;\n BitNodeMultipliers.PurchasedServerSoftcap = 1.2;\n BitNodeMultipliers.WorldDaemonDifficulty = 3;\n break;\n case 5: // Artificial intelligence\n BitNodeMultipliers.ServerMaxMoney = 2;\n BitNodeMultipliers.ServerStartingSecurity = 2;\n BitNodeMultipliers.ServerStartingMoney = 0.5;\n BitNodeMultipliers.ScriptHackMoney = 0.15;\n BitNodeMultipliers.HacknetNodeMoney = 0.2;\n BitNodeMultipliers.CrimeMoney = 0.5;\n BitNodeMultipliers.InfiltrationRep = 1.5;\n BitNodeMultipliers.InfiltrationMoney = 1.5;\n BitNodeMultipliers.AugmentationMoneyCost = 2;\n BitNodeMultipliers.HackExpGain = 0.5;\n BitNodeMultipliers.CorporationValuation = 0.5;\n BitNodeMultipliers.StaneksGiftPowerMultiplier = 1.3;\n BitNodeMultipliers.StaneksGiftExtraSize = 0;\n BitNodeMultipliers.PurchasedServerSoftcap = 1.2;\n BitNodeMultipliers.WorldDaemonDifficulty = 1.5;\n break;\n case 6: // Bladeburner\n BitNodeMultipliers.HackingLevelMultiplier = 0.35;\n BitNodeMultipliers.ServerMaxMoney = 0.4;\n BitNodeMultipliers.ServerStartingMoney = 0.5;\n BitNodeMultipliers.ServerStartingSecurity = 1.5;\n BitNodeMultipliers.ScriptHackMoney = 0.75;\n BitNodeMultipliers.CompanyWorkMoney = 0.5;\n BitNodeMultipliers.CrimeMoney = 0.75;\n BitNodeMultipliers.InfiltrationMoney = 0.75;\n BitNodeMultipliers.CorporationValuation = 0.2;\n BitNodeMultipliers.HacknetNodeMoney = 0.2;\n BitNodeMultipliers.FactionPassiveRepGain = 0;\n BitNodeMultipliers.HackExpGain = 0.25;\n BitNodeMultipliers.DaedalusAugsRequirement = 1.166; // Results in 35 Augs needed\n BitNodeMultipliers.PurchasedServerSoftcap = 2;\n BitNodeMultipliers.StaneksGiftPowerMultiplier = 0.5;\n BitNodeMultipliers.StaneksGiftExtraSize = 2;\n BitNodeMultipliers.GangSoftcap = 0.7;\n BitNodeMultipliers.CorporationSoftCap = 0.9;\n BitNodeMultipliers.WorldDaemonDifficulty = 2;\n break;\n case 7: // Bladeburner 2079\n BitNodeMultipliers.BladeburnerRank = 0.6;\n BitNodeMultipliers.BladeburnerSkillCost = 2;\n BitNodeMultipliers.AugmentationMoneyCost = 3;\n BitNodeMultipliers.HackingLevelMultiplier = 0.35;\n BitNodeMultipliers.ServerMaxMoney = 0.4;\n BitNodeMultipliers.ServerStartingMoney = 0.5;\n BitNodeMultipliers.ServerStartingSecurity = 1.5;\n BitNodeMultipliers.ScriptHackMoney = 0.5;\n BitNodeMultipliers.CompanyWorkMoney = 0.5;\n BitNodeMultipliers.CrimeMoney = 0.75;\n BitNodeMultipliers.InfiltrationMoney = 0.75;\n BitNodeMultipliers.CorporationValuation = 0.2;\n BitNodeMultipliers.HacknetNodeMoney = 0.2;\n BitNodeMultipliers.FactionPassiveRepGain = 0;\n BitNodeMultipliers.HackExpGain = 0.25;\n BitNodeMultipliers.FourSigmaMarketDataCost = 2;\n BitNodeMultipliers.FourSigmaMarketDataApiCost = 2;\n BitNodeMultipliers.DaedalusAugsRequirement = 1.166; // Results in 35 Augs needed\n BitNodeMultipliers.PurchasedServerSoftcap = 2;\n BitNodeMultipliers.StaneksGiftPowerMultiplier = 0.9;\n BitNodeMultipliers.StaneksGiftExtraSize = -1;\n BitNodeMultipliers.GangSoftcap = 0.7;\n BitNodeMultipliers.CorporationSoftCap = 0.9;\n BitNodeMultipliers.WorldDaemonDifficulty = 2;\n break;\n case 8: // Ghost of Wall Street\n BitNodeMultipliers.ScriptHackMoney = 0.3;\n BitNodeMultipliers.ScriptHackMoneyGain = 0;\n BitNodeMultipliers.ManualHackMoney = 0;\n BitNodeMultipliers.CompanyWorkMoney = 0;\n BitNodeMultipliers.CrimeMoney = 0;\n BitNodeMultipliers.HacknetNodeMoney = 0;\n BitNodeMultipliers.InfiltrationMoney = 0;\n BitNodeMultipliers.RepToDonateToFaction = 0;\n BitNodeMultipliers.CorporationValuation = 0;\n BitNodeMultipliers.CodingContractMoney = 0;\n BitNodeMultipliers.StaneksGiftExtraSize = -7;\n BitNodeMultipliers.PurchasedServerSoftcap = 4;\n BitNodeMultipliers.GangSoftcap = 0;\n BitNodeMultipliers.CorporationSoftCap = 0;\n break;\n case 9: // Hacktocracy\n BitNodeMultipliers.HackingLevelMultiplier = 0.5;\n BitNodeMultipliers.StrengthLevelMultiplier = 0.45;\n BitNodeMultipliers.DefenseLevelMultiplier = 0.45;\n BitNodeMultipliers.DexterityLevelMultiplier = 0.45;\n BitNodeMultipliers.AgilityLevelMultiplier = 0.45;\n BitNodeMultipliers.CharismaLevelMultiplier = 0.45;\n BitNodeMultipliers.PurchasedServerLimit = 0;\n BitNodeMultipliers.HomeComputerRamCost = 5;\n BitNodeMultipliers.CrimeMoney = 0.5;\n BitNodeMultipliers.ScriptHackMoney = 0.1;\n BitNodeMultipliers.HackExpGain = 0.05;\n BitNodeMultipliers.ServerStartingMoney = 0.1;\n BitNodeMultipliers.ServerMaxMoney = 0.1;\n BitNodeMultipliers.ServerStartingSecurity = 2.5;\n BitNodeMultipliers.CorporationValuation = 0.5;\n BitNodeMultipliers.FourSigmaMarketDataCost = 5;\n BitNodeMultipliers.FourSigmaMarketDataApiCost = 4;\n BitNodeMultipliers.BladeburnerRank = 0.9;\n BitNodeMultipliers.BladeburnerSkillCost = 1.2;\n BitNodeMultipliers.StaneksGiftPowerMultiplier = 0.5;\n BitNodeMultipliers.StaneksGiftExtraSize = 2;\n BitNodeMultipliers.GangSoftcap = 0.8;\n BitNodeMultipliers.CorporationSoftCap = 0.7;\n BitNodeMultipliers.WorldDaemonDifficulty = 2;\n break;\n case 10: // Digital Carbon\n BitNodeMultipliers.HackingLevelMultiplier = 0.35;\n BitNodeMultipliers.StrengthLevelMultiplier = 0.4;\n BitNodeMultipliers.DefenseLevelMultiplier = 0.4;\n BitNodeMultipliers.DexterityLevelMultiplier = 0.4;\n BitNodeMultipliers.AgilityLevelMultiplier = 0.4;\n BitNodeMultipliers.CharismaLevelMultiplier = 0.4;\n BitNodeMultipliers.CompanyWorkMoney = 0.5;\n BitNodeMultipliers.CrimeMoney = 0.5;\n BitNodeMultipliers.HacknetNodeMoney = 0.5;\n BitNodeMultipliers.ManualHackMoney = 0.5;\n BitNodeMultipliers.ScriptHackMoney = 0.5;\n BitNodeMultipliers.CodingContractMoney = 0.5;\n BitNodeMultipliers.InfiltrationMoney = 0.5;\n BitNodeMultipliers.CorporationValuation = 0.5;\n BitNodeMultipliers.AugmentationMoneyCost = 5;\n BitNodeMultipliers.AugmentationRepCost = 2;\n BitNodeMultipliers.HomeComputerRamCost = 1.5;\n BitNodeMultipliers.PurchasedServerCost = 5;\n BitNodeMultipliers.PurchasedServerLimit = 0.6;\n BitNodeMultipliers.PurchasedServerMaxRam = 0.5;\n BitNodeMultipliers.BladeburnerRank = 0.8;\n BitNodeMultipliers.StaneksGiftPowerMultiplier = 0.75;\n BitNodeMultipliers.StaneksGiftExtraSize = -3;\n BitNodeMultipliers.PurchasedServerSoftcap = 1.1;\n BitNodeMultipliers.GangSoftcap = 0.9;\n BitNodeMultipliers.CorporationSoftCap = 0.9;\n BitNodeMultipliers.WorldDaemonDifficulty = 2;\n break;\n case 11: //The Big Crash\n BitNodeMultipliers.HackingLevelMultiplier = 0.6;\n BitNodeMultipliers.HackExpGain = 0.5;\n BitNodeMultipliers.ServerMaxMoney = 0.1;\n BitNodeMultipliers.ServerStartingMoney = 0.1;\n BitNodeMultipliers.ServerGrowthRate = 0.2;\n BitNodeMultipliers.ServerWeakenRate = 2;\n BitNodeMultipliers.CrimeMoney = 3;\n BitNodeMultipliers.CompanyWorkMoney = 0.5;\n BitNodeMultipliers.HacknetNodeMoney = 0.1;\n BitNodeMultipliers.AugmentationMoneyCost = 2;\n BitNodeMultipliers.InfiltrationMoney = 2.5;\n BitNodeMultipliers.InfiltrationRep = 2.5;\n BitNodeMultipliers.CorporationValuation = 0.1;\n BitNodeMultipliers.CodingContractMoney = 0.25;\n BitNodeMultipliers.FourSigmaMarketDataCost = 4;\n BitNodeMultipliers.FourSigmaMarketDataApiCost = 4;\n BitNodeMultipliers.PurchasedServerSoftcap = 2;\n BitNodeMultipliers.CorporationSoftCap = 0.9;\n BitNodeMultipliers.WorldDaemonDifficulty = 1.5;\n break;\n case 12: {\n //The Recursion\n let sf12Lvl = 0;\n for (let i = 0; i < p.sourceFiles.length; i++) {\n if (p.sourceFiles[i].n === 12) {\n sf12Lvl = p.sourceFiles[i].lvl;\n }\n }\n const inc = Math.pow(1.02, sf12Lvl);\n const dec = 1 / inc;\n\n // Multiplier for number of augs needed for Daedalus increases\n // up to a maximum of 1.34, which results in 40 Augs required\n BitNodeMultipliers.DaedalusAugsRequirement = Math.min(inc, 1.34);\n\n BitNodeMultipliers.HackingLevelMultiplier = dec;\n BitNodeMultipliers.StrengthLevelMultiplier = dec;\n BitNodeMultipliers.DefenseLevelMultiplier = dec;\n BitNodeMultipliers.DexterityLevelMultiplier = dec;\n BitNodeMultipliers.AgilityLevelMultiplier = dec;\n BitNodeMultipliers.CharismaLevelMultiplier = dec;\n\n BitNodeMultipliers.ServerMaxMoney = dec;\n BitNodeMultipliers.ServerStartingMoney = dec;\n BitNodeMultipliers.ServerGrowthRate = dec;\n BitNodeMultipliers.ServerWeakenRate = dec;\n\n //Does not scale, otherwise security might start at 300+\n BitNodeMultipliers.ServerStartingSecurity = 1.5;\n\n BitNodeMultipliers.HomeComputerRamCost = inc;\n\n BitNodeMultipliers.PurchasedServerCost = inc;\n BitNodeMultipliers.PurchasedServerLimit = dec;\n BitNodeMultipliers.PurchasedServerMaxRam = dec;\n BitNodeMultipliers.PurchasedServerSoftcap = inc;\n\n BitNodeMultipliers.ManualHackMoney = dec;\n BitNodeMultipliers.ScriptHackMoney = dec;\n BitNodeMultipliers.CompanyWorkMoney = dec;\n BitNodeMultipliers.CrimeMoney = dec;\n BitNodeMultipliers.HacknetNodeMoney = dec;\n BitNodeMultipliers.CodingContractMoney = dec;\n\n BitNodeMultipliers.CompanyWorkExpGain = dec;\n BitNodeMultipliers.ClassGymExpGain = dec;\n BitNodeMultipliers.FactionWorkExpGain = dec;\n BitNodeMultipliers.HackExpGain = dec;\n BitNodeMultipliers.CrimeExpGain = dec;\n\n BitNodeMultipliers.FactionWorkRepGain = dec;\n BitNodeMultipliers.FactionPassiveRepGain = dec;\n BitNodeMultipliers.RepToDonateToFaction = inc;\n\n BitNodeMultipliers.AugmentationRepCost = inc;\n BitNodeMultipliers.AugmentationMoneyCost = inc;\n\n BitNodeMultipliers.InfiltrationMoney = dec;\n BitNodeMultipliers.InfiltrationRep = dec;\n\n BitNodeMultipliers.FourSigmaMarketDataCost = inc;\n BitNodeMultipliers.FourSigmaMarketDataApiCost = inc;\n\n BitNodeMultipliers.CorporationValuation = dec;\n\n BitNodeMultipliers.BladeburnerRank = dec;\n BitNodeMultipliers.BladeburnerSkillCost = inc;\n\n BitNodeMultipliers.StaneksGiftPowerMultiplier = inc;\n BitNodeMultipliers.StaneksGiftExtraSize = inc;\n BitNodeMultipliers.GangSoftcap = 0.8;\n BitNodeMultipliers.CorporationSoftCap = 0.8;\n BitNodeMultipliers.WorldDaemonDifficulty = inc;\n break;\n }\n case 13: {\n BitNodeMultipliers.PurchasedServerSoftcap = 1.6;\n\n BitNodeMultipliers.HackingLevelMultiplier = 0.25;\n BitNodeMultipliers.StrengthLevelMultiplier = 0.7;\n BitNodeMultipliers.DefenseLevelMultiplier = 0.7;\n BitNodeMultipliers.DexterityLevelMultiplier = 0.7;\n BitNodeMultipliers.AgilityLevelMultiplier = 0.7;\n\n BitNodeMultipliers.ServerMaxMoney = 0.45;\n BitNodeMultipliers.ServerStartingMoney = 0.75;\n\n BitNodeMultipliers.ServerStartingSecurity = 3;\n\n BitNodeMultipliers.ScriptHackMoney = 0.2;\n BitNodeMultipliers.CompanyWorkMoney = 0.4;\n BitNodeMultipliers.CrimeMoney = 0.4;\n BitNodeMultipliers.HacknetNodeMoney = 0.4;\n BitNodeMultipliers.CodingContractMoney = 0.4;\n\n BitNodeMultipliers.CompanyWorkExpGain = 0.5;\n BitNodeMultipliers.ClassGymExpGain = 0.5;\n BitNodeMultipliers.FactionWorkExpGain = 0.5;\n BitNodeMultipliers.HackExpGain = 0.1;\n BitNodeMultipliers.CrimeExpGain = 0.5;\n\n BitNodeMultipliers.FactionWorkRepGain = 0.6;\n\n BitNodeMultipliers.FourSigmaMarketDataCost = 10;\n BitNodeMultipliers.FourSigmaMarketDataApiCost = 10;\n\n BitNodeMultipliers.CorporationValuation = 0.001;\n\n BitNodeMultipliers.BladeburnerRank = 0.45;\n BitNodeMultipliers.BladeburnerSkillCost = 2;\n BitNodeMultipliers.StaneksGiftPowerMultiplier = 2;\n BitNodeMultipliers.StaneksGiftExtraSize = 1;\n BitNodeMultipliers.GangSoftcap = 0.3;\n BitNodeMultipliers.CorporationSoftCap = 0.3;\n BitNodeMultipliers.WorldDaemonDifficulty = 3;\n break;\n }\n default:\n console.warn(\"Player.bitNodeN invalid\");\n break;\n }\n}\n","import { CONSTANTS } from \"../Constants\";\nimport { Player } from \"../Player\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { Server } from \"../Server/Server\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { processSingleServerGrowth } from \"../Server/ServerHelpers\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport { compareArrays } from \"../utils/helpers/compareArrays\";\n\nexport function scriptCalculateOfflineProduction(runningScript: RunningScript): void {\n //The Player object stores the last update time from when we were online\n const thisUpdate = new Date().getTime();\n const lastUpdate = Player.lastUpdate;\n const timePassed = (thisUpdate - lastUpdate) / 1000; //Seconds\n\n //Calculate the \"confidence\" rating of the script's true production. This is based\n //entirely off of time. We will arbitrarily say that if a script has been running for\n //4 hours (14400 sec) then we are completely confident in its ability\n let confidence = runningScript.onlineRunningTime / 14400;\n if (confidence >= 1) {\n confidence = 1;\n }\n\n //Data map: [MoneyStolen, NumTimesHacked, NumTimesGrown, NumTimesWeaken]\n\n // Grow\n for (const hostname of Object.keys(runningScript.dataMap)) {\n if (runningScript.dataMap.hasOwnProperty(hostname)) {\n if (runningScript.dataMap[hostname][2] == 0 || runningScript.dataMap[hostname][2] == null) {\n continue;\n }\n const serv = GetServer(hostname);\n if (serv == null) {\n continue;\n }\n const timesGrown = Math.round(\n ((0.5 * runningScript.dataMap[hostname][2]) / runningScript.onlineRunningTime) * timePassed,\n );\n runningScript.log(`Called on ${serv.hostname} ${timesGrown} times while offline`);\n const host = GetServer(runningScript.server);\n if (host === null) throw new Error(\"getServer of null key?\");\n if (!(serv instanceof Server)) throw new Error(\"trying to grow a non-normal server\");\n const growth = processSingleServerGrowth(serv, timesGrown, Player, host.cpuCores);\n runningScript.log(\n `'${serv.hostname}' grown by ${numeralWrapper.format(growth * 100 - 100, \"0.000000%\")} while offline`,\n );\n }\n }\n\n // Offline EXP gain\n // A script's offline production will always be at most half of its online production.\n const expGain = confidence * (runningScript.onlineExpGained / runningScript.onlineRunningTime) * timePassed;\n Player.gainHackingExp(expGain);\n\n // Update script stats\n runningScript.offlineRunningTime += timePassed;\n runningScript.offlineExpGained += expGain;\n\n // Weaken\n for (const hostname of Object.keys(runningScript.dataMap)) {\n if (runningScript.dataMap.hasOwnProperty(hostname)) {\n if (runningScript.dataMap[hostname][3] == 0 || runningScript.dataMap[hostname][3] == null) {\n continue;\n }\n const serv = GetServer(hostname);\n if (serv == null) {\n continue;\n }\n\n if (!(serv instanceof Server)) throw new Error(\"trying to weaken a non-normal server\");\n const host = GetServer(runningScript.server);\n if (host === null) throw new Error(\"getServer of null key?\");\n const timesWeakened = Math.round(\n ((0.5 * runningScript.dataMap[hostname][3]) / runningScript.onlineRunningTime) * timePassed,\n );\n runningScript.log(`Called weaken() on ${serv.hostname} ${timesWeakened} times while offline`);\n const coreBonus = 1 + (host.cpuCores - 1) / 16;\n serv.weaken(CONSTANTS.ServerWeakenAmount * timesWeakened * coreBonus);\n }\n }\n}\n\n//Returns a RunningScript object matching the filename and arguments on the\n//designated server, and false otherwise\nexport function findRunningScript(\n filename: string,\n args: (string | number | boolean)[],\n server: BaseServer,\n): RunningScript | null {\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename === filename && compareArrays(server.runningScripts[i].args, args)) {\n return server.runningScripts[i];\n }\n }\n return null;\n}\n\n//Returns a RunningScript object matching the pid on the\n//designated server, and false otherwise\nexport function findRunningScriptByPid(pid: number, server: BaseServer): RunningScript | null {\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].pid === pid) {\n return server.runningScripts[i];\n }\n }\n return null;\n}\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\nexport function Hashes({ hashes }: { hashes: number | string }): React.ReactElement {\n const classes = useStyles();\n return (\n <span className={classes.money}>{typeof hashes === \"number\" ? numeralWrapper.formatHashes(hashes) : hashes}</span>\n );\n}\n","import { Reviver, Generic_toJSON, Generic_fromJSON } from \"../utils/JSONReviver\";\nimport { IBladeburner } from \"./IBladeburner\";\nimport { IActionIdentifier } from \"./IActionIdentifier\";\nimport { ActionIdentifier } from \"./ActionIdentifier\";\nimport { ActionTypes } from \"./data/ActionTypes\";\nimport { Growths } from \"./data/Growths\";\nimport { BlackOperations } from \"./BlackOperations\";\nimport { BlackOperation } from \"./BlackOperation\";\nimport { Operation } from \"./Operation\";\nimport { Contract } from \"./Contract\";\nimport { GeneralActions } from \"./GeneralActions\";\nimport { formatNumber } from \"../utils/StringHelperFunctions\";\nimport { Skills } from \"./Skills\";\nimport { Skill } from \"./Skill\";\nimport { City } from \"./City\";\nimport { IAction } from \"./IAction\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter, Page } from \"../ui/Router\";\nimport { ConsoleHelpText } from \"./data/Help\";\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { BladeburnerConstants } from \"./data/Constants\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\nimport { Faction } from \"../Faction/Faction\";\nimport { Factions, factionExists } from \"../Faction/Factions\";\nimport { calculateHospitalizationCost } from \"../Hospital/Hospital\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Settings } from \"../Settings/Settings\";\nimport { Augmentations } from \"../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { getTimestamp } from \"../utils/helpers/getTimestamp\";\nimport { joinFaction } from \"../Faction/FactionHelpers\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\n\ninterface BlackOpsAttempt {\n error?: string;\n isAvailable?: boolean;\n action?: BlackOperation;\n}\n\nexport class Bladeburner implements IBladeburner {\n numHosp = 0;\n moneyLost = 0;\n rank = 0;\n maxRank = 0;\n\n skillPoints = 0;\n totalSkillPoints = 0;\n\n teamSize = 0;\n teamLost = 0;\n hpLost = 0;\n\n storedCycles = 0;\n\n randomEventCounter: number = getRandomInt(240, 600);\n\n actionTimeToComplete = 0;\n actionTimeCurrent = 0;\n actionTimeOverflow = 0;\n\n action: IActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n\n cities: any = {};\n city: string = BladeburnerConstants.CityNames[2];\n skills: any = {};\n skillMultipliers: any = {};\n staminaBonus = 0;\n maxStamina = 0;\n stamina = 0;\n contracts: any = {};\n operations: any = {};\n blackops: any = {};\n logging: any = {\n general: true,\n contracts: true,\n ops: true,\n blackops: true,\n events: true,\n };\n automateEnabled = false;\n automateActionHigh: IActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n automateThreshHigh = 0;\n automateActionLow: IActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n automateThreshLow = 0;\n consoleHistory: string[] = [];\n consoleLogs: string[] = [\"Bladeburner Console\", \"Type 'help' to see console commands\"];\n\n constructor(player?: IPlayer) {\n for (let i = 0; i < BladeburnerConstants.CityNames.length; ++i) {\n this.cities[BladeburnerConstants.CityNames[i]] = new City(BladeburnerConstants.CityNames[i]);\n }\n\n this.updateSkillMultipliers(); // Calls resetSkillMultipliers()\n\n // Max Stamina is based on stats and Bladeburner-specific bonuses\n if (player) this.calculateMaxStamina(player);\n this.stamina = this.maxStamina;\n this.create();\n }\n\n getCurrentCity(): City {\n const city = this.cities[this.city];\n if (!(city instanceof City)) {\n throw new Error(\"Bladeburner.getCurrentCity() did not properly return a City object\");\n }\n return city;\n }\n\n calculateStaminaPenalty(): number {\n return Math.min(1, this.stamina / (0.5 * this.maxStamina));\n }\n\n canAttemptBlackOp(actionId: IActionIdentifier): BlackOpsAttempt {\n // Safety measure - don't repeat BlackOps that are already done\n if (this.blackops[actionId.name] != null) {\n return { error: \"Tried to start a Black Operation that had already been completed\" };\n }\n\n const action = this.getActionObject(actionId);\n if (!(action instanceof BlackOperation)) throw new Error(`Action should be BlackOperation but isn't`);\n if (action == null) throw new Error(\"Failed to get BlackOperation object for: \" + actionId.name);\n\n if (action.reqdRank > this.rank) {\n return { error: \"Tried to start a Black Operation without the rank requirement\" };\n }\n\n // Can't start a BlackOp if you haven't done the one before it\n const blackops = [];\n for (const nm of Object.keys(BlackOperations)) {\n if (BlackOperations.hasOwnProperty(nm)) {\n blackops.push(nm);\n }\n }\n blackops.sort(function (a, b) {\n return BlackOperations[a].reqdRank - BlackOperations[b].reqdRank; // Sort black ops in intended order\n });\n\n const i = blackops.indexOf(actionId.name);\n if (i === -1) {\n return { error: `Invalid Black Op: '${name}'` };\n }\n\n if (i > 0 && this.blackops[blackops[i - 1]] == null) {\n return { error: `Preceding Black Op must be completed before starting '${actionId.name}'.` };\n }\n\n return { isAvailable: true, action };\n }\n\n startAction(player: IPlayer, actionId: IActionIdentifier): void {\n if (actionId == null) return;\n this.action = actionId;\n this.actionTimeCurrent = 0;\n switch (actionId.type) {\n case ActionTypes[\"Idle\"]:\n this.actionTimeToComplete = 0;\n break;\n case ActionTypes[\"Contract\"]:\n try {\n const action = this.getActionObject(actionId);\n if (action == null) {\n throw new Error(\"Failed to get Contract Object for: \" + actionId.name);\n }\n if (action.count < 1) {\n return this.resetAction();\n }\n this.actionTimeToComplete = action.getActionTime(this);\n } catch (e: any) {\n exceptionAlert(e);\n }\n break;\n case ActionTypes[\"Operation\"]: {\n try {\n const action = this.getActionObject(actionId);\n if (action == null) {\n throw new Error(\"Failed to get Operation Object for: \" + actionId.name);\n }\n if (action.count < 1) {\n return this.resetAction();\n }\n if (actionId.name === \"Raid\" && this.getCurrentCity().comms === 0) {\n return this.resetAction();\n }\n this.actionTimeToComplete = action.getActionTime(this);\n } catch (e: any) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]: {\n try {\n const testBlackOp = this.canAttemptBlackOp(actionId);\n if (!testBlackOp.isAvailable) {\n this.resetAction();\n this.log(`Error: ${testBlackOp.error}`);\n break;\n }\n if (testBlackOp.action === undefined) {\n throw new Error(\"action should not be null\");\n }\n this.actionTimeToComplete = testBlackOp.action.getActionTime(this);\n } catch (e: any) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"Recruitment\"]:\n this.actionTimeToComplete = this.getRecruitmentTime(player);\n break;\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Field Analysis\"]:\n this.actionTimeToComplete = 30;\n break;\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n this.actionTimeToComplete = 60;\n break;\n default:\n throw new Error(\"Invalid Action Type in startAction(Bladeburner,player, ): \" + actionId.type);\n break;\n }\n }\n\n upgradeSkill(skill: Skill): void {\n // This does NOT handle deduction of skill points\n const skillName = skill.name;\n if (this.skills[skillName]) {\n ++this.skills[skillName];\n } else {\n this.skills[skillName] = 1;\n }\n if (isNaN(this.skills[skillName]) || this.skills[skillName] < 0) {\n throw new Error(\"Level of Skill \" + skillName + \" is invalid: \" + this.skills[skillName]);\n }\n this.updateSkillMultipliers();\n }\n\n executeConsoleCommands(player: IPlayer, commands: string): void {\n try {\n // Console History\n if (this.consoleHistory[this.consoleHistory.length - 1] != commands) {\n this.consoleHistory.push(commands);\n if (this.consoleHistory.length > 50) {\n this.consoleHistory.splice(0, 1);\n }\n }\n\n const arrayOfCommands = commands.split(\";\");\n for (let i = 0; i < arrayOfCommands.length; ++i) {\n this.executeConsoleCommand(player, arrayOfCommands[i]);\n }\n } catch (e: any) {\n exceptionAlert(e);\n }\n }\n\n postToConsole(input: string, saveToLogs = true): void {\n const MaxConsoleEntries = 100;\n if (saveToLogs) {\n this.consoleLogs.push(input);\n if (this.consoleLogs.length > MaxConsoleEntries) {\n this.consoleLogs.shift();\n }\n }\n }\n\n log(input: string): void {\n // Adds a timestamp and then just calls postToConsole\n this.postToConsole(`[${getTimestamp()}] ${input}`);\n }\n\n resetAction(): void {\n this.action = new ActionIdentifier({ type: ActionTypes.Idle });\n }\n\n clearConsole(): void {\n this.consoleLogs.length = 0;\n }\n\n prestige(): void {\n this.resetAction();\n const bladeburnerFac = Factions[\"Bladeburners\"];\n if (this.rank >= BladeburnerConstants.RankNeededForFaction) {\n joinFaction(bladeburnerFac);\n }\n }\n\n storeCycles(numCycles = 0): void {\n this.storedCycles += numCycles;\n }\n\n // working on\n getActionIdFromTypeAndName(type = \"\", name = \"\"): IActionIdentifier | null {\n if (type === \"\" || name === \"\") {\n return null;\n }\n const action = new ActionIdentifier();\n const convertedType = type.toLowerCase().trim();\n const convertedName = name.toLowerCase().trim();\n switch (convertedType) {\n case \"contract\":\n case \"contracts\":\n case \"contr\":\n action.type = ActionTypes[\"Contract\"];\n if (this.contracts.hasOwnProperty(name)) {\n action.name = name;\n return action;\n } else {\n return null;\n }\n break;\n case \"operation\":\n case \"operations\":\n case \"op\":\n case \"ops\":\n action.type = ActionTypes[\"Operation\"];\n if (this.operations.hasOwnProperty(name)) {\n action.name = name;\n return action;\n } else {\n return null;\n }\n break;\n case \"blackoperation\":\n case \"black operation\":\n case \"black operations\":\n case \"black op\":\n case \"black ops\":\n case \"blackop\":\n case \"blackops\":\n action.type = ActionTypes[\"BlackOp\"];\n if (BlackOperations.hasOwnProperty(name)) {\n action.name = name;\n return action;\n } else {\n return null;\n }\n break;\n case \"general\":\n case \"general action\":\n case \"gen\":\n break;\n default:\n return null;\n }\n\n if (convertedType.startsWith(\"gen\")) {\n switch (convertedName) {\n case \"training\":\n action.type = ActionTypes[\"Training\"];\n action.name = \"Training\";\n break;\n case \"recruitment\":\n case \"recruit\":\n action.type = ActionTypes[\"Recruitment\"];\n action.name = \"Recruitment\";\n break;\n case \"field analysis\":\n case \"fieldanalysis\":\n action.type = ActionTypes[\"Field Analysis\"];\n action.name = \"Field Analysis\";\n break;\n case \"diplomacy\":\n action.type = ActionTypes[\"Diplomacy\"];\n action.name = \"Diplomacy\";\n break;\n case \"hyperbolic regeneration chamber\":\n action.type = ActionTypes[\"Hyperbolic Regeneration Chamber\"];\n action.name = \"Hyperbolic Regeneration Chamber\";\n break;\n case \"incite violence\":\n action.type = ActionTypes[\"Incite Violence\"];\n action.name = \"Incite Violence\";\n break;\n default:\n return null;\n }\n return action;\n }\n\n return null;\n }\n\n executeStartConsoleCommand(player: IPlayer, args: string[]): void {\n if (args.length !== 3) {\n this.postToConsole(\"Invalid usage of 'start' console command: start [type] [name]\");\n this.postToConsole(\"Use 'help start' for more info\");\n return;\n }\n const name = args[2];\n switch (args[1].toLowerCase()) {\n case \"general\":\n case \"gen\":\n if (GeneralActions[name] != null) {\n this.action.type = ActionTypes[name];\n this.action.name = name;\n this.startAction(player, this.action);\n } else {\n this.postToConsole(\"Invalid action name specified: \" + args[2]);\n }\n break;\n case \"contract\":\n case \"contracts\":\n if (this.contracts[name] != null) {\n this.action.type = ActionTypes.Contract;\n this.action.name = name;\n this.startAction(player, this.action);\n } else {\n this.postToConsole(\"Invalid contract name specified: \" + args[2]);\n }\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n if (this.operations[name] != null) {\n this.action.type = ActionTypes.Operation;\n this.action.name = name;\n this.startAction(player, this.action);\n } else {\n this.postToConsole(\"Invalid Operation name specified: \" + args[2]);\n }\n break;\n case \"blackops\":\n case \"blackop\":\n case \"black operations\":\n case \"black operation\":\n if (BlackOperations[name] != null) {\n this.action.type = ActionTypes.BlackOperation;\n this.action.name = name;\n this.startAction(player, this.action);\n } else {\n this.postToConsole(\"Invalid BlackOp name specified: \" + args[2]);\n }\n break;\n default:\n this.postToConsole(\"Invalid action/event type specified: \" + args[1]);\n this.postToConsole(\"Examples of valid action/event identifiers are: [general, contract, op, blackop]\");\n break;\n }\n }\n\n executeSkillConsoleCommand(args: string[]): void {\n switch (args.length) {\n case 1: {\n // Display Skill Help Command\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n break;\n }\n case 2: {\n if (args[1].toLowerCase() === \"list\") {\n // List all skills and their level\n this.postToConsole(\"Skills: \");\n const skillNames = Object.keys(Skills);\n for (let i = 0; i < skillNames.length; ++i) {\n const skill = Skills[skillNames[i]];\n let level = 0;\n if (this.skills[skill.name] != null) {\n level = this.skills[skill.name];\n }\n this.postToConsole(skill.name + \": Level \" + formatNumber(level, 0));\n }\n this.postToConsole(\" \");\n this.postToConsole(\"Effects: \");\n const multKeys = Object.keys(this.skillMultipliers);\n for (let i = 0; i < multKeys.length; ++i) {\n let mult = this.skillMultipliers[multKeys[i]];\n if (mult && mult !== 1) {\n mult = formatNumber(mult, 3);\n switch (multKeys[i]) {\n case \"successChanceAll\":\n this.postToConsole(\"Total Success Chance: x\" + mult);\n break;\n case \"successChanceStealth\":\n this.postToConsole(\"Stealth Success Chance: x\" + mult);\n break;\n case \"successChanceKill\":\n this.postToConsole(\"Retirement Success Chance: x\" + mult);\n break;\n case \"successChanceContract\":\n this.postToConsole(\"Contract Success Chance: x\" + mult);\n break;\n case \"successChanceOperation\":\n this.postToConsole(\"Operation Success Chance: x\" + mult);\n break;\n case \"successChanceEstimate\":\n this.postToConsole(\"Synthoid Data Estimate: x\" + mult);\n break;\n case \"actionTime\":\n this.postToConsole(\"Action Time: x\" + mult);\n break;\n case \"effHack\":\n this.postToConsole(\"Hacking Skill: x\" + mult);\n break;\n case \"effStr\":\n this.postToConsole(\"Strength: x\" + mult);\n break;\n case \"effDef\":\n this.postToConsole(\"Defense: x\" + mult);\n break;\n case \"effDex\":\n this.postToConsole(\"Dexterity: x\" + mult);\n break;\n case \"effAgi\":\n this.postToConsole(\"Agility: x\" + mult);\n break;\n case \"effCha\":\n this.postToConsole(\"Charisma: x\" + mult);\n break;\n case \"effInt\":\n this.postToConsole(\"Intelligence: x\" + mult);\n break;\n case \"stamina\":\n this.postToConsole(\"Stamina: x\" + mult);\n break;\n default:\n console.warn(`Unrecognized SkillMult Key: ${multKeys[i]}`);\n break;\n }\n }\n }\n } else {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n }\n break;\n }\n case 3: {\n const skillName = args[2];\n const skill = Skills[skillName];\n if (skill == null || !(skill instanceof Skill)) {\n this.postToConsole(\"Invalid skill name (Note that it is case-sensitive): \" + skillName);\n break;\n }\n if (args[1].toLowerCase() === \"list\") {\n let level = 0;\n if (this.skills[skill.name] !== undefined) {\n level = this.skills[skill.name];\n }\n this.postToConsole(skill.name + \": Level \" + formatNumber(level));\n } else if (args[1].toLowerCase() === \"level\") {\n let currentLevel = 0;\n if (this.skills[skillName] && !isNaN(this.skills[skillName])) {\n currentLevel = this.skills[skillName];\n }\n const pointCost = skill.calculateCost(currentLevel);\n if (skill.maxLvl !== 0 && currentLevel >= skill.maxLvl) {\n this.postToConsole(`This skill ${skill.name} is already at max level (${currentLevel}/${skill.maxLvl}).`);\n } else if (this.skillPoints >= pointCost) {\n this.skillPoints -= pointCost;\n this.upgradeSkill(skill);\n this.log(skill.name + \" upgraded to Level \" + this.skills[skillName]);\n } else {\n this.postToConsole(\n \"You do not have enough Skill Points to upgrade this. You need \" + formatNumber(pointCost, 0),\n );\n }\n } else {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n }\n break;\n }\n default: {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n break;\n }\n }\n }\n\n executeLogConsoleCommand(args: string[]): void {\n if (args.length < 3) {\n this.postToConsole(\"Invalid usage of log command: log [enable/disable] [action/event]\");\n this.postToConsole(\"Use 'help log' for more details and examples\");\n return;\n }\n\n let flag = true;\n if (args[1].toLowerCase().includes(\"d\")) {\n flag = false;\n } // d for disable\n\n switch (args[2].toLowerCase()) {\n case \"general\":\n case \"gen\":\n this.logging.general = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for general actions\");\n break;\n case \"contract\":\n case \"contracts\":\n this.logging.contracts = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for Contracts\");\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n this.logging.ops = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for Operations\");\n break;\n case \"blackops\":\n case \"blackop\":\n case \"black operations\":\n case \"black operation\":\n this.logging.blackops = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for BlackOps\");\n break;\n case \"event\":\n case \"events\":\n this.logging.events = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for events\");\n break;\n case \"all\":\n this.logging.general = flag;\n this.logging.contracts = flag;\n this.logging.ops = flag;\n this.logging.blackops = flag;\n this.logging.events = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for everything\");\n break;\n default:\n this.postToConsole(\"Invalid action/event type specified: \" + args[2]);\n this.postToConsole(\n \"Examples of valid action/event identifiers are: [general, contracts, ops, blackops, events]\",\n );\n break;\n }\n }\n\n executeHelpConsoleCommand(args: string[]): void {\n if (args.length === 1) {\n for (const line of ConsoleHelpText.helpList) {\n this.postToConsole(line);\n }\n } else {\n for (let i = 1; i < args.length; ++i) {\n if (!(args[i] in ConsoleHelpText)) continue;\n const helpText = ConsoleHelpText[args[i]];\n for (const line of helpText) {\n this.postToConsole(line);\n }\n }\n }\n }\n\n executeAutomateConsoleCommand(args: string[]): void {\n if (args.length !== 2 && args.length !== 4) {\n this.postToConsole(\n \"Invalid use of 'automate' command: automate [var] [val] [hi/low]. Use 'help automate' for more info\",\n );\n return;\n }\n\n // Enable/Disable\n if (args.length === 2) {\n const flag = args[1];\n if (flag.toLowerCase() === \"status\") {\n this.postToConsole(\"Automation: \" + (this.automateEnabled ? \"enabled\" : \"disabled\"));\n this.postToConsole(\n \"When your stamina drops to \" +\n formatNumber(this.automateThreshLow, 0) +\n \", you will automatically switch to \" +\n this.automateActionLow.name +\n \". When your stamina recovers to \" +\n formatNumber(this.automateThreshHigh, 0) +\n \", you will automatically \" +\n \"switch to \" +\n this.automateActionHigh.name +\n \".\",\n );\n } else if (flag.toLowerCase().includes(\"en\")) {\n if (\n !(this.automateActionLow instanceof ActionIdentifier) ||\n !(this.automateActionHigh instanceof ActionIdentifier)\n ) {\n return this.log(\"Failed to enable automation. Actions were not set\");\n }\n this.automateEnabled = true;\n this.log(\"Bladeburner automation enabled\");\n } else if (flag.toLowerCase().includes(\"d\")) {\n this.automateEnabled = false;\n this.log(\"Bladeburner automation disabled\");\n } else {\n this.log(\"Invalid argument for 'automate' console command: \" + args[1]);\n }\n return;\n }\n\n // Set variables\n if (args.length === 4) {\n const variable = args[1];\n const val = args[2];\n\n let highLow = false; // True for high, false for low\n if (args[3].toLowerCase().includes(\"hi\")) {\n highLow = true;\n }\n\n switch (variable) {\n case \"general\":\n case \"gen\":\n if (GeneralActions[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes[val],\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid action name specified: \" + val);\n }\n break;\n case \"contract\":\n case \"contracts\":\n if (this.contracts[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes.Contract,\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid contract name specified: \" + val);\n }\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n if (this.operations[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes.Operation,\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid Operation name specified: \" + val);\n }\n break;\n case \"stamina\":\n if (isNaN(parseFloat(val))) {\n this.postToConsole(\"Invalid value specified for stamina threshold (must be numeric): \" + val);\n } else {\n if (highLow) {\n this.automateThreshHigh = Number(val);\n } else {\n this.automateThreshLow = Number(val);\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") stamina threshold set to \" + val);\n }\n break;\n default:\n break;\n }\n\n return;\n }\n }\n\n parseCommandArguments(command: string): string[] {\n /**\n * Returns an array with command and its arguments in each index.\n * e.g. skill \"blade's intuition\" foo returns [skill, blade's intuition, foo]\n * The input to the fn will be trimmed and will have all whitespace replaced w/ a single space\n */\n const args = [];\n let start = 0;\n let i = 0;\n while (i < command.length) {\n const c = command.charAt(i);\n if (c === '\"') {\n // Double quotes\n const endQuote = command.indexOf('\"', i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === \" \")) {\n args.push(command.substr(i + 1, endQuote - i - 1));\n if (endQuote === command.length - 1) {\n start = i = endQuote + 1;\n } else {\n start = i = endQuote + 2; // Skip the space\n }\n continue;\n }\n } else if (c === \"'\") {\n // Single quotes, same thing as above\n const endQuote = command.indexOf(\"'\", i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === \" \")) {\n args.push(command.substr(i + 1, endQuote - i - 1));\n if (endQuote === command.length - 1) {\n start = i = endQuote + 1;\n } else {\n start = i = endQuote + 2; // Skip the space\n }\n continue;\n }\n } else if (c === \" \") {\n args.push(command.substr(start, i - start));\n start = i + 1;\n }\n ++i;\n }\n if (start !== i) {\n args.push(command.substr(start, i - start));\n }\n return args;\n }\n\n executeConsoleCommand(player: IPlayer, command: string): void {\n command = command.trim();\n command = command.replace(/\\s\\s+/g, \" \"); // Replace all whitespace w/ a single space\n\n const args = this.parseCommandArguments(command);\n if (args.length <= 0) return; // Log an error?\n\n switch (args[0].toLowerCase()) {\n case \"automate\":\n this.executeAutomateConsoleCommand(args);\n break;\n case \"clear\":\n case \"cls\":\n this.clearConsole();\n break;\n case \"help\":\n this.executeHelpConsoleCommand(args);\n break;\n case \"log\":\n this.executeLogConsoleCommand(args);\n break;\n case \"skill\":\n this.executeSkillConsoleCommand(args);\n break;\n case \"start\":\n this.executeStartConsoleCommand(player, args);\n break;\n case \"stop\":\n this.resetAction();\n break;\n default:\n this.postToConsole(\"Invalid console command\");\n break;\n }\n }\n\n triggerMigration(sourceCityName: string): void {\n let destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n while (destCityName === sourceCityName) {\n destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n }\n const destCity = this.cities[destCityName];\n const sourceCity = this.cities[sourceCityName];\n if (destCity == null || sourceCity == null) {\n throw new Error(\"Failed to find City with name: \" + destCityName);\n }\n const rand = Math.random();\n let percentage = getRandomInt(3, 15) / 100;\n\n if (rand < 0.05 && sourceCity.comms > 0) {\n // 5% chance for community migration\n percentage *= getRandomInt(2, 4); // Migration increases population change\n --sourceCity.comms;\n ++destCity.comms;\n }\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n destCity.pop += count;\n }\n\n triggerPotentialMigration(sourceCityName: string, chance: number): void {\n if (chance == null || isNaN(chance)) {\n console.error(\"Invalid 'chance' parameter passed into Bladeburner.triggerPotentialMigration()\");\n }\n if (chance > 1) {\n chance /= 100;\n }\n if (Math.random() < chance) {\n this.triggerMigration(sourceCityName);\n }\n }\n\n randomEvent(): void {\n const chance = Math.random();\n\n // Choose random source/destination city for events\n const sourceCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n const sourceCity = this.cities[sourceCityName];\n if (!(sourceCity instanceof City)) {\n throw new Error(\"sourceCity was not a City object in Bladeburner.randomEvent()\");\n }\n\n let destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n while (destCityName === sourceCityName) {\n destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n }\n const destCity = this.cities[destCityName];\n\n if (!(sourceCity instanceof City) || !(destCity instanceof City)) {\n throw new Error(\"sourceCity/destCity was not a City object in Bladeburner.randomEvent()\");\n }\n\n if (chance <= 0.05) {\n // New Synthoid Community, 5%\n ++sourceCity.comms;\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\"Intelligence indicates that a new Synthoid community was formed in a city\");\n }\n } else if (chance <= 0.1) {\n // Synthoid Community Migration, 5%\n if (sourceCity.comms <= 0) {\n // If no comms in source city, then instead trigger a new Synthoid community event\n ++sourceCity.comms;\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\"Intelligence indicates that a new Synthoid community was formed in a city\");\n }\n } else {\n --sourceCity.comms;\n ++destCity.comms;\n\n // Change pop\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n destCity.pop += count;\n\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that a Synthoid community migrated from \" + sourceCityName + \" to some other city\",\n );\n }\n }\n } else if (chance <= 0.3) {\n // New Synthoids (non community), 20%\n const percentage = getRandomInt(8, 24) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that the Synthoid population of \" + sourceCityName + \" just changed significantly\",\n );\n }\n } else if (chance <= 0.5) {\n // Synthoid migration (non community) 20%\n this.triggerMigration(sourceCityName);\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that a large number of Synthoids migrated from \" +\n sourceCityName +\n \" to some other city\",\n );\n }\n } else if (chance <= 0.7) {\n // Synthoid Riots (+chaos), 20%\n sourceCity.chaos += 1;\n sourceCity.chaos *= 1 + getRandomInt(5, 20) / 100;\n if (this.logging.events) {\n this.log(\"Tensions between Synthoids and humans lead to riots in \" + sourceCityName + \"! Chaos increased\");\n }\n } else if (chance <= 0.9) {\n // Less Synthoids, 20%\n const percentage = getRandomInt(8, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that the Synthoid population of \" + sourceCityName + \" just changed significantly\",\n );\n }\n }\n // 10% chance of nothing happening\n }\n\n /**\n * Process stat gains from Contracts, Operations, and Black Operations\n * @param action(Action obj) - Derived action class\n * @param success(bool) - Whether action was successful\n */\n gainActionStats(player: IPlayer, action: IAction, success: boolean): void {\n const difficulty = action.getDifficulty();\n\n /**\n * Gain multiplier based on difficulty. If it changes then the\n * same variable calculated in completeAction() needs to change too\n */\n const difficultyMult =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n\n const time = this.actionTimeToComplete;\n const successMult = success ? 1 : 0.5;\n\n const unweightedGain = time * BladeburnerConstants.BaseStatGain * successMult * difficultyMult;\n const unweightedIntGain = time * BladeburnerConstants.BaseIntGain * successMult * difficultyMult;\n const skillMult = this.skillMultipliers.expGain;\n player.gainHackingExp(unweightedGain * action.weights.hack * player.hacking_exp_mult * skillMult);\n player.gainStrengthExp(unweightedGain * action.weights.str * player.strength_exp_mult * skillMult);\n player.gainDefenseExp(unweightedGain * action.weights.def * player.defense_exp_mult * skillMult);\n player.gainDexterityExp(unweightedGain * action.weights.dex * player.dexterity_exp_mult * skillMult);\n player.gainAgilityExp(unweightedGain * action.weights.agi * player.agility_exp_mult * skillMult);\n player.gainCharismaExp(unweightedGain * action.weights.cha * player.charisma_exp_mult * skillMult);\n player.gainIntelligenceExp(unweightedIntGain * action.weights.int * skillMult);\n }\n\n getDiplomacyEffectiveness(player: IPlayer): number {\n // Returns a decimal by which the city's chaos level should be multiplied (e.g. 0.98)\n const CharismaLinearFactor = 1e3;\n const CharismaExponentialFactor = 0.045;\n\n const charismaEff = Math.pow(player.charisma, CharismaExponentialFactor) + player.charisma / CharismaLinearFactor;\n return (100 - charismaEff) / 100;\n }\n\n getRecruitmentSuccessChance(player: IPlayer): number {\n return Math.pow(player.charisma, 0.45) / (this.teamSize + 1);\n }\n\n getRecruitmentTime(player: IPlayer): number {\n const effCharisma = player.charisma * this.skillMultipliers.effCha;\n const charismaFactor = Math.pow(effCharisma, 0.81) + effCharisma / 90;\n return Math.max(10, Math.round(BladeburnerConstants.BaseRecruitmentTimeNeeded - charismaFactor));\n }\n\n resetSkillMultipliers(): void {\n this.skillMultipliers = {\n successChanceAll: 1,\n successChanceStealth: 1,\n successChanceKill: 1,\n successChanceContract: 1,\n successChanceOperation: 1,\n successChanceEstimate: 1,\n actionTime: 1,\n effHack: 1,\n effStr: 1,\n effDef: 1,\n effDex: 1,\n effAgi: 1,\n effCha: 1,\n effInt: 1,\n stamina: 1,\n money: 1,\n expGain: 1,\n };\n }\n\n updateSkillMultipliers(): void {\n this.resetSkillMultipliers();\n for (const skillName of Object.keys(this.skills)) {\n if (this.skills.hasOwnProperty(skillName)) {\n const skill = Skills[skillName];\n if (skill == null) {\n throw new Error(\"Could not find Skill Object for: \" + skillName);\n }\n const level = this.skills[skillName];\n if (level == null || level <= 0) {\n continue;\n } //Not upgraded\n\n const multiplierNames = Object.keys(this.skillMultipliers);\n for (let i = 0; i < multiplierNames.length; ++i) {\n const multiplierName = multiplierNames[i];\n if (skill.getMultiplier(multiplierName) != null && !isNaN(skill.getMultiplier(multiplierName))) {\n const value = skill.getMultiplier(multiplierName) * level;\n let multiplierValue = 1 + value / 100;\n if (multiplierName === \"actionTime\") {\n multiplierValue = 1 - value / 100;\n }\n this.skillMultipliers[multiplierName] *= multiplierValue;\n }\n }\n }\n }\n }\n\n completeOperation(success: boolean): void {\n if (this.action.type !== ActionTypes.Operation) {\n throw new Error(\"completeOperation() called even though current action is not an Operation\");\n }\n const action = this.getActionObject(this.action);\n if (action == null) {\n throw new Error(\"Failed to get Contract/Operation Object for: \" + this.action.name);\n }\n\n // Calculate team losses\n const teamCount = action.teamCount;\n if (teamCount >= 1) {\n let max;\n if (success) {\n max = Math.ceil(teamCount / 2);\n } else {\n max = Math.floor(teamCount);\n }\n const losses = getRandomInt(0, max);\n this.teamSize -= losses;\n this.teamLost += losses;\n if (this.logging.ops && losses > 0) {\n this.log(\"Lost \" + formatNumber(losses, 0) + \" team members during this \" + action.name);\n }\n }\n\n const city = this.getCurrentCity();\n switch (action.name) {\n case \"Investigation\":\n if (success) {\n city.improvePopulationEstimateByPercentage(0.4 * this.skillMultipliers.successChanceEstimate);\n } else {\n this.triggerPotentialMigration(this.city, 0.1);\n }\n break;\n case \"Undercover Operation\":\n if (success) {\n city.improvePopulationEstimateByPercentage(0.8 * this.skillMultipliers.successChanceEstimate);\n } else {\n this.triggerPotentialMigration(this.city, 0.15);\n }\n break;\n case \"Sting Operation\":\n if (success) {\n city.changePopulationByPercentage(-0.1, {\n changeEstEqually: true,\n nonZero: true,\n });\n }\n city.changeChaosByCount(0.1);\n break;\n case \"Raid\":\n if (success) {\n city.changePopulationByPercentage(-1, {\n changeEstEqually: true,\n nonZero: true,\n });\n --city.comms;\n } else {\n const change = getRandomInt(-10, -5) / 10;\n city.changePopulationByPercentage(change, {\n nonZero: true,\n changeEstEqually: false,\n });\n }\n city.changeChaosByPercentage(getRandomInt(1, 5));\n break;\n case \"Stealth Retirement Operation\":\n if (success) {\n city.changePopulationByPercentage(-0.5, {\n changeEstEqually: true,\n nonZero: true,\n });\n }\n city.changeChaosByPercentage(getRandomInt(-3, -1));\n break;\n case \"Assassination\":\n if (success) {\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n }\n city.changeChaosByPercentage(getRandomInt(-5, 5));\n break;\n default:\n throw new Error(\"Invalid Action name in completeOperation: \" + this.action.name);\n }\n }\n\n getActionObject(actionId: IActionIdentifier): IAction | null {\n /**\n * Given an ActionIdentifier object, returns the corresponding\n * GeneralAction, Contract, Operation, or BlackOperation object\n */\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n return this.contracts[actionId.name];\n case ActionTypes[\"Operation\"]:\n return this.operations[actionId.name];\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return BlackOperations[actionId.name];\n case ActionTypes[\"Training\"]:\n return GeneralActions[\"Training\"];\n case ActionTypes[\"Field Analysis\"]:\n return GeneralActions[\"Field Analysis\"];\n case ActionTypes[\"Recruitment\"]:\n return GeneralActions[\"Recruitment\"];\n case ActionTypes[\"Diplomacy\"]:\n return GeneralActions[\"Diplomacy\"];\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n return GeneralActions[\"Hyperbolic Regeneration Chamber\"];\n case ActionTypes[\"Incite Violence\"]:\n return GeneralActions[\"Incite Violence\"];\n default:\n return null;\n }\n }\n\n completeContract(success: boolean): void {\n if (this.action.type !== ActionTypes.Contract) {\n throw new Error(\"completeContract() called even though current action is not a Contract\");\n }\n const city = this.getCurrentCity();\n if (success) {\n switch (this.action.name) {\n case \"Tracking\":\n // Increase estimate accuracy by a relatively small amount\n city.improvePopulationEstimateByCount(getRandomInt(100, 1e3));\n break;\n case \"Bounty Hunter\":\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n city.changeChaosByCount(0.02);\n break;\n case \"Retirement\":\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n city.changeChaosByCount(0.04);\n break;\n default:\n throw new Error(\"Invalid Action name in completeContract: \" + this.action.name);\n }\n }\n }\n\n completeAction(router: IRouter, player: IPlayer): void {\n switch (this.action.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]: {\n try {\n const isOperation = this.action.type === ActionTypes[\"Operation\"];\n const action = this.getActionObject(this.action);\n if (action == null) {\n throw new Error(\"Failed to get Contract/Operation Object for: \" + this.action.name);\n }\n const difficulty = action.getDifficulty();\n const difficultyMultiplier =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n const rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n\n // Stamina loss is based on difficulty\n this.stamina -= BladeburnerConstants.BaseStaminaLoss * difficultyMultiplier;\n if (this.stamina < 0) {\n this.stamina = 0;\n }\n\n // Process Contract/Operation success/failure\n if (action.attempt(this)) {\n this.gainActionStats(player, action, true);\n ++action.successes;\n --action.count;\n\n // Earn money for contracts\n let moneyGain = 0;\n if (!isOperation) {\n moneyGain = BladeburnerConstants.ContractBaseMoneyGain * rewardMultiplier * this.skillMultipliers.money;\n player.gainMoney(moneyGain, \"bladeburner\");\n }\n\n if (isOperation) {\n action.setMaxLevel(BladeburnerConstants.OperationSuccessesPerLevel);\n } else {\n action.setMaxLevel(BladeburnerConstants.ContractSuccessesPerLevel);\n }\n if (action.rankGain) {\n const gain = addOffset(action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank, 10);\n this.changeRank(player, gain);\n if (isOperation && this.logging.ops) {\n this.log(action.name + \" successfully completed! Gained \" + formatNumber(gain, 3) + \" rank\");\n } else if (!isOperation && this.logging.contracts) {\n this.log(\n action.name +\n \" contract successfully completed! Gained \" +\n formatNumber(gain, 3) +\n \" rank and \" +\n numeralWrapper.formatMoney(moneyGain),\n );\n }\n }\n isOperation ? this.completeOperation(true) : this.completeContract(true);\n } else {\n this.gainActionStats(player, action, false);\n ++action.failures;\n let loss = 0,\n damage = 0;\n if (action.rankLoss) {\n loss = addOffset(action.rankLoss * rewardMultiplier, 10);\n this.changeRank(player, -1 * loss);\n }\n if (action.hpLoss) {\n damage = action.hpLoss * difficultyMultiplier;\n damage = Math.ceil(addOffset(damage, 10));\n this.hpLost += damage;\n const cost = calculateHospitalizationCost(player, damage);\n if (player.takeDamage(damage)) {\n ++this.numHosp;\n this.moneyLost += cost;\n }\n }\n let logLossText = \"\";\n if (loss > 0) {\n logLossText += \"Lost \" + formatNumber(loss, 3) + \" rank. \";\n }\n if (damage > 0) {\n logLossText += \"Took \" + formatNumber(damage, 0) + \" damage.\";\n }\n if (isOperation && this.logging.ops) {\n this.log(action.name + \" failed! \" + logLossText);\n } else if (!isOperation && this.logging.contracts) {\n this.log(action.name + \" contract failed! \" + logLossText);\n }\n isOperation ? this.completeOperation(false) : this.completeContract(false);\n }\n if (action.autoLevel) {\n action.level = action.maxLevel;\n } // Autolevel\n this.startAction(player, this.action); // Repeat action\n } catch (e: any) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]: {\n try {\n const action = this.getActionObject(this.action);\n if (action == null || !(action instanceof BlackOperation)) {\n throw new Error(\"Failed to get BlackOperation Object for: \" + this.action.name);\n }\n const difficulty = action.getDifficulty();\n const difficultyMultiplier =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n\n // Stamina loss is based on difficulty\n this.stamina -= BladeburnerConstants.BaseStaminaLoss * difficultyMultiplier;\n if (this.stamina < 0) {\n this.stamina = 0;\n }\n\n // Team loss variables\n const teamCount = action.teamCount;\n let teamLossMax;\n\n if (action.attempt(this)) {\n this.gainActionStats(player, action, true);\n action.count = 0;\n this.blackops[action.name] = true;\n let rankGain = 0;\n if (action.rankGain) {\n rankGain = addOffset(action.rankGain * BitNodeMultipliers.BladeburnerRank, 10);\n this.changeRank(player, rankGain);\n }\n teamLossMax = Math.ceil(teamCount / 2);\n\n // Operation Daedalus\n if (action.name === \"Operation Daedalus\") {\n this.resetAction();\n return router.toBitVerse(false, false);\n }\n\n if (this.logging.blackops) {\n this.log(action.name + \" successful! Gained \" + formatNumber(rankGain, 1) + \" rank\");\n }\n } else {\n this.gainActionStats(player, action, false);\n let rankLoss = 0;\n let damage = 0;\n if (action.rankLoss) {\n rankLoss = addOffset(action.rankLoss, 10);\n this.changeRank(player, -1 * rankLoss);\n }\n if (action.hpLoss) {\n damage = action.hpLoss * difficultyMultiplier;\n damage = Math.ceil(addOffset(damage, 10));\n const cost = calculateHospitalizationCost(player, damage);\n if (player.takeDamage(damage)) {\n ++this.numHosp;\n this.moneyLost += cost;\n }\n }\n teamLossMax = Math.floor(teamCount);\n\n if (this.logging.blackops) {\n this.log(\n action.name +\n \" failed! Lost \" +\n formatNumber(rankLoss, 1) +\n \" rank and took \" +\n formatNumber(damage, 0) +\n \" damage\",\n );\n }\n }\n\n this.resetAction(); // Stop regardless of success or fail\n\n // Calculate team lossses\n if (teamCount >= 1) {\n const losses = getRandomInt(1, teamLossMax);\n this.teamSize -= losses;\n this.teamLost += losses;\n if (this.logging.blackops) {\n this.log(\"You lost \" + formatNumber(losses, 0) + \" team members during \" + action.name);\n }\n }\n } catch (e: any) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"Training\"]: {\n this.stamina -= 0.5 * BladeburnerConstants.BaseStaminaLoss;\n const strExpGain = 30 * player.strength_exp_mult,\n defExpGain = 30 * player.defense_exp_mult,\n dexExpGain = 30 * player.dexterity_exp_mult,\n agiExpGain = 30 * player.agility_exp_mult,\n staminaGain = 0.04 * this.skillMultipliers.stamina;\n player.gainStrengthExp(strExpGain);\n player.gainDefenseExp(defExpGain);\n player.gainDexterityExp(dexExpGain);\n player.gainAgilityExp(agiExpGain);\n this.staminaBonus += staminaGain;\n if (this.logging.general) {\n this.log(\n \"Training completed. Gained: \" +\n formatNumber(strExpGain, 1) +\n \" str exp, \" +\n formatNumber(defExpGain, 1) +\n \" def exp, \" +\n formatNumber(dexExpGain, 1) +\n \" dex exp, \" +\n formatNumber(agiExpGain, 1) +\n \" agi exp, \" +\n formatNumber(staminaGain, 3) +\n \" max stamina\",\n );\n }\n this.startAction(player, this.action); // Repeat action\n break;\n }\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Field Analysis\"]: {\n // Does not use stamina. Effectiveness depends on hacking, int, and cha\n let eff =\n 0.04 * Math.pow(player.hacking, 0.3) +\n 0.04 * Math.pow(player.intelligence, 0.9) +\n 0.02 * Math.pow(player.charisma, 0.3);\n eff *= player.bladeburner_analysis_mult;\n if (isNaN(eff) || eff < 0) {\n throw new Error(\"Field Analysis Effectiveness calculated to be NaN or negative\");\n }\n const hackingExpGain = 20 * player.hacking_exp_mult,\n charismaExpGain = 20 * player.charisma_exp_mult;\n player.gainHackingExp(hackingExpGain);\n player.gainIntelligenceExp(BladeburnerConstants.BaseIntGain);\n player.gainCharismaExp(charismaExpGain);\n this.changeRank(player, 0.1 * BitNodeMultipliers.BladeburnerRank);\n this.getCurrentCity().improvePopulationEstimateByPercentage(eff * this.skillMultipliers.successChanceEstimate);\n if (this.logging.general) {\n this.log(\n \"Field analysis completed. Gained 0.1 rank, \" +\n formatNumber(hackingExpGain, 1) +\n \" hacking exp, and \" +\n formatNumber(charismaExpGain, 1) +\n \" charisma exp\",\n );\n }\n this.startAction(player, this.action); // Repeat action\n break;\n }\n case ActionTypes[\"Recruitment\"]: {\n const successChance = this.getRecruitmentSuccessChance(player);\n if (Math.random() < successChance) {\n const expGain = 2 * BladeburnerConstants.BaseStatGain * this.actionTimeToComplete;\n player.gainCharismaExp(expGain);\n ++this.teamSize;\n if (this.logging.general) {\n this.log(\"Successfully recruited a team member! Gained \" + formatNumber(expGain, 1) + \" charisma exp\");\n }\n } else {\n const expGain = BladeburnerConstants.BaseStatGain * this.actionTimeToComplete;\n player.gainCharismaExp(expGain);\n if (this.logging.general) {\n this.log(\"Failed to recruit a team member. Gained \" + formatNumber(expGain, 1) + \" charisma exp\");\n }\n }\n this.startAction(player, this.action); // Repeat action\n break;\n }\n case ActionTypes[\"Diplomacy\"]: {\n const eff = this.getDiplomacyEffectiveness(player);\n this.getCurrentCity().chaos *= eff;\n if (this.getCurrentCity().chaos < 0) {\n this.getCurrentCity().chaos = 0;\n }\n if (this.logging.general) {\n this.log(\n `Diplomacy completed. Chaos levels in the current city fell by ${numeralWrapper.formatPercentage(1 - eff)}`,\n );\n }\n this.startAction(player, this.action); // Repeat Action\n break;\n }\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]: {\n player.regenerateHp(BladeburnerConstants.HrcHpGain);\n\n const staminaGain = this.maxStamina * (BladeburnerConstants.HrcStaminaGain / 100);\n this.stamina = Math.min(this.maxStamina, this.stamina + staminaGain);\n this.startAction(player, this.action);\n if (this.logging.general) {\n this.log(\n `Rested in Hyperbolic Regeneration Chamber. Restored ${\n BladeburnerConstants.HrcHpGain\n } HP and gained ${numeralWrapper.formatStamina(staminaGain)} stamina`,\n );\n }\n break;\n }\n case ActionTypes[\"Incite Violence\"]: {\n for (const contract of Object.keys(this.contracts)) {\n const growthF = Growths[contract];\n if (!growthF) throw new Error(\"trying to generate count for action that doesn't exist? \" + contract);\n this.contracts[contract].count += (60 * 3 * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n for (const operation of Object.keys(this.operations)) {\n const growthF = Growths[operation];\n if (!growthF) throw new Error(\"trying to generate count for action that doesn't exist? \" + operation);\n this.operations[operation].count += (60 * 3 * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n if (this.logging.general) {\n this.log(`Incited violence in the synthoid communities.`);\n }\n for (const cityName of Object.keys(this.cities)) {\n const city = this.cities[cityName];\n city.chaos += 10;\n city.chaos += city.chaos / (Math.log(city.chaos) / Math.log(10));\n }\n\n this.startAction(player, this.action);\n break;\n }\n default:\n console.error(`Bladeburner.completeAction() called for invalid action: ${this.action.type}`);\n break;\n }\n }\n\n changeRank(player: IPlayer, change: number): void {\n if (isNaN(change)) {\n throw new Error(\"NaN passed into Bladeburner.changeRank()\");\n }\n this.rank += change;\n if (this.rank < 0) {\n this.rank = 0;\n }\n this.maxRank = Math.max(this.rank, this.maxRank);\n\n const bladeburnersFactionName = \"Bladeburners\";\n if (factionExists(bladeburnersFactionName)) {\n const bladeburnerFac = Factions[bladeburnersFactionName];\n if (!(bladeburnerFac instanceof Faction)) {\n throw new Error(\"Could not properly get Bladeburner Faction object in Bladeburner UI Overview Faction button\");\n }\n if (bladeburnerFac.isMember) {\n const favorBonus = 1 + bladeburnerFac.favor / 100;\n bladeburnerFac.playerReputation +=\n BladeburnerConstants.RankToFactionRepFactor * change * player.faction_rep_mult * favorBonus;\n }\n }\n\n // Gain skill points\n const rankNeededForSp = (this.totalSkillPoints + 1) * BladeburnerConstants.RanksPerSkillPoint;\n if (this.maxRank >= rankNeededForSp) {\n // Calculate how many skill points to gain\n const gainedSkillPoints = Math.floor(\n (this.maxRank - rankNeededForSp) / BladeburnerConstants.RanksPerSkillPoint + 1,\n );\n this.skillPoints += gainedSkillPoints;\n this.totalSkillPoints += gainedSkillPoints;\n }\n }\n\n processAction(router: IRouter, player: IPlayer, seconds: number): void {\n if (this.action.type === ActionTypes[\"Idle\"]) return;\n if (this.actionTimeToComplete <= 0) {\n throw new Error(`Invalid actionTimeToComplete value: ${this.actionTimeToComplete}, type; ${this.action.type}`);\n }\n if (!(this.action instanceof ActionIdentifier)) {\n throw new Error(\"Bladeburner.action is not an ActionIdentifier Object\");\n }\n\n // If the previous action went past its completion time, add to the next action\n // This is not added inmediatly in case the automation changes the action\n this.actionTimeCurrent += seconds + this.actionTimeOverflow;\n this.actionTimeOverflow = 0;\n if (this.actionTimeCurrent >= this.actionTimeToComplete) {\n this.actionTimeOverflow = this.actionTimeCurrent - this.actionTimeToComplete;\n return this.completeAction(router, player);\n }\n }\n\n calculateStaminaGainPerSecond(player: IPlayer): number {\n const effAgility = player.agility * this.skillMultipliers.effAgi;\n const maxStaminaBonus = this.maxStamina / BladeburnerConstants.MaxStaminaToGainFactor;\n const gain = (BladeburnerConstants.StaminaGainPerSecond + maxStaminaBonus) * Math.pow(effAgility, 0.17);\n return gain * (this.skillMultipliers.stamina * player.bladeburner_stamina_gain_mult);\n }\n\n calculateMaxStamina(player: IPlayer): void {\n const effAgility = player.agility * this.skillMultipliers.effAgi;\n const maxStamina =\n (Math.pow(effAgility, 0.8) + this.staminaBonus) *\n this.skillMultipliers.stamina *\n player.bladeburner_max_stamina_mult;\n if (this.maxStamina !== maxStamina) {\n const oldMax = this.maxStamina;\n this.maxStamina = maxStamina;\n this.stamina = (this.maxStamina * this.stamina) / oldMax;\n }\n if (isNaN(maxStamina)) {\n throw new Error(\"Max Stamina calculated to be NaN in Bladeburner.calculateMaxStamina()\");\n }\n }\n\n create(): void {\n this.contracts[\"Tracking\"] = new Contract({\n name: \"Tracking\",\n baseDifficulty: 125,\n difficultyFac: 1.02,\n rewardFac: 1.041,\n rankGain: 0.3,\n hpLoss: 0.5,\n count: getRandomInt(25, 150),\n weights: {\n hack: 0,\n str: 0.05,\n def: 0.05,\n dex: 0.35,\n agi: 0.35,\n cha: 0.1,\n int: 0.05,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.9,\n int: 1,\n },\n isStealth: true,\n });\n this.contracts[\"Bounty Hunter\"] = new Contract({\n name: \"Bounty Hunter\",\n baseDifficulty: 250,\n difficultyFac: 1.04,\n rewardFac: 1.085,\n rankGain: 0.9,\n hpLoss: 1,\n count: getRandomInt(5, 150),\n weights: {\n hack: 0,\n str: 0.15,\n def: 0.15,\n dex: 0.25,\n agi: 0.25,\n cha: 0.1,\n int: 0.1,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.8,\n int: 0.9,\n },\n isKill: true,\n });\n this.contracts[\"Retirement\"] = new Contract({\n name: \"Retirement\",\n baseDifficulty: 200,\n difficultyFac: 1.03,\n rewardFac: 1.065,\n rankGain: 0.6,\n hpLoss: 1,\n count: getRandomInt(5, 150),\n weights: {\n hack: 0,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0.1,\n int: 0.1,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.8,\n int: 0.9,\n },\n isKill: true,\n });\n\n this.operations[\"Investigation\"] = new Operation({\n name: \"Investigation\",\n baseDifficulty: 400,\n difficultyFac: 1.03,\n rewardFac: 1.07,\n reqdRank: 25,\n rankGain: 2.2,\n rankLoss: 0.2,\n count: getRandomInt(1, 100),\n weights: {\n hack: 0.25,\n str: 0.05,\n def: 0.05,\n dex: 0.2,\n agi: 0.1,\n cha: 0.25,\n int: 0.1,\n },\n decays: {\n hack: 0.85,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Undercover Operation\"] = new Operation({\n name: \"Undercover Operation\",\n baseDifficulty: 500,\n difficultyFac: 1.04,\n rewardFac: 1.09,\n reqdRank: 100,\n rankGain: 4.4,\n rankLoss: 0.4,\n hpLoss: 2,\n count: getRandomInt(1, 100),\n weights: {\n hack: 0.2,\n str: 0.05,\n def: 0.05,\n dex: 0.2,\n agi: 0.2,\n cha: 0.2,\n int: 0.1,\n },\n decays: {\n hack: 0.8,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Sting Operation\"] = new Operation({\n name: \"Sting Operation\",\n baseDifficulty: 650,\n difficultyFac: 1.04,\n rewardFac: 1.095,\n reqdRank: 500,\n rankGain: 5.5,\n rankLoss: 0.5,\n hpLoss: 2.5,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.25,\n str: 0.05,\n def: 0.05,\n dex: 0.25,\n agi: 0.1,\n cha: 0.2,\n int: 0.1,\n },\n decays: {\n hack: 0.8,\n str: 0.85,\n def: 0.85,\n dex: 0.85,\n agi: 0.85,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Raid\"] = new Operation({\n name: \"Raid\",\n baseDifficulty: 800,\n difficultyFac: 1.045,\n rewardFac: 1.1,\n reqdRank: 3000,\n rankGain: 55,\n rankLoss: 2.5,\n hpLoss: 50,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.7,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.9,\n },\n isKill: true,\n });\n this.operations[\"Stealth Retirement Operation\"] = new Operation({\n name: \"Stealth Retirement Operation\",\n baseDifficulty: 1000,\n difficultyFac: 1.05,\n rewardFac: 1.11,\n reqdRank: 20e3,\n rankGain: 22,\n rankLoss: 2,\n hpLoss: 10,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.1,\n def: 0.1,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.7,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.9,\n },\n isStealth: true,\n isKill: true,\n });\n this.operations[\"Assassination\"] = new Operation({\n name: \"Assassination\",\n baseDifficulty: 1500,\n difficultyFac: 1.06,\n rewardFac: 1.14,\n reqdRank: 50e3,\n rankGain: 44,\n rankLoss: 4,\n hpLoss: 5,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.1,\n def: 0.1,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.8,\n },\n isStealth: true,\n isKill: true,\n });\n }\n\n process(router: IRouter, player: IPlayer): void {\n // Edge case condition...if Operation Daedalus is complete trigger the BitNode\n if (router.page() !== Page.BitVerse && this.blackops.hasOwnProperty(\"Operation Daedalus\")) {\n return router.toBitVerse(false, false);\n }\n\n // If the Player starts doing some other actions, set action to idle and alert\n if (Augmentations[AugmentationNames.BladesSimulacrum].owned === false && player.isWorking) {\n if (this.action.type !== ActionTypes[\"Idle\"]) {\n let msg = \"Your Bladeburner action was cancelled because you started doing something else.\";\n if (this.automateEnabled) {\n msg += `<br /><br />Your automation was disabled as well. You will have to re-enable it through the Bladeburner console`;\n this.automateEnabled = false;\n }\n if (!Settings.SuppressBladeburnerPopup) {\n dialogBoxCreate(msg);\n }\n }\n this.resetAction();\n }\n\n // If the Player has no Stamina, set action to idle\n if (this.stamina <= 0) {\n this.log(\"Your Bladeburner action was cancelled because your stamina hit 0\");\n this.resetAction();\n }\n\n // A 'tick' for this mechanic is one second (= 5 game cycles)\n if (this.storedCycles >= BladeburnerConstants.CyclesPerSecond) {\n let seconds = Math.floor(this.storedCycles / BladeburnerConstants.CyclesPerSecond);\n seconds = Math.min(seconds, 5); // Max of 5 'ticks'\n this.storedCycles -= seconds * BladeburnerConstants.CyclesPerSecond;\n\n // Stamina\n this.calculateMaxStamina(player);\n this.stamina += this.calculateStaminaGainPerSecond(player) * seconds;\n this.stamina = Math.min(this.maxStamina, this.stamina);\n\n // Count increase for contracts/operations\n for (const contract of Object.values(this.contracts) as Contract[]) {\n const growthF = Growths[contract.name];\n if (growthF === undefined) throw new Error(`growth formula for action '${contract.name}' is undefined`);\n contract.count += (seconds * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n for (const op of Object.values(this.operations) as Operation[]) {\n const growthF = Growths[op.name];\n if (growthF === undefined) throw new Error(`growth formula for action '${op.name}' is undefined`);\n if (growthF !== undefined) {\n op.count += (seconds * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n }\n\n // Chaos goes down very slowly\n for (const cityName of BladeburnerConstants.CityNames) {\n const city = this.cities[cityName];\n if (!(city instanceof City)) {\n throw new Error(\"Invalid City object when processing passive chaos reduction in Bladeburner.process\");\n }\n city.chaos -= 0.0001 * seconds;\n city.chaos = Math.max(0, city.chaos);\n }\n\n // Random Events\n this.randomEventCounter -= seconds;\n if (this.randomEventCounter <= 0) {\n this.randomEvent();\n // Add instead of setting because we might have gone over the required time for the event\n this.randomEventCounter += getRandomInt(240, 600);\n }\n\n this.processAction(router, player, seconds);\n\n // Automation\n if (this.automateEnabled) {\n // Note: Do NOT set this.action = this.automateActionHigh/Low since it creates a reference\n if (this.stamina <= this.automateThreshLow) {\n if (this.action.name !== this.automateActionLow.name || this.action.type !== this.automateActionLow.type) {\n this.action = new ActionIdentifier({\n type: this.automateActionLow.type,\n name: this.automateActionLow.name,\n });\n this.startAction(player, this.action);\n }\n } else if (this.stamina >= this.automateThreshHigh) {\n if (this.action.name !== this.automateActionHigh.name || this.action.type !== this.automateActionHigh.type) {\n this.action = new ActionIdentifier({\n type: this.automateActionHigh.type,\n name: this.automateActionHigh.name,\n });\n this.startAction(player, this.action);\n }\n }\n }\n }\n }\n\n getTypeAndNameFromActionId(actionId: IActionIdentifier): {\n type: string;\n name: string;\n } {\n const res = { type: \"\", name: \"\" };\n const types = Object.keys(ActionTypes);\n for (let i = 0; i < types.length; ++i) {\n if (actionId.type === ActionTypes[types[i]]) {\n res.type = types[i];\n break;\n }\n }\n const gen = [\n \"Training\",\n \"Recruitment\",\n \"FieldAnalysis\",\n \"Field Analysis\",\n \"Diplomacy\",\n \"Hyperbolic Regeneration Chamber\",\n \"Incite Violence\",\n ];\n if (gen.includes(res.type)) {\n res.type = \"General\";\n }\n\n if (res.type == null) {\n res.type = \"Idle\";\n }\n\n res.name = actionId.name != null ? actionId.name : \"Idle\";\n return res;\n }\n\n getContractNamesNetscriptFn(): string[] {\n return Object.keys(this.contracts);\n }\n\n getOperationNamesNetscriptFn(): string[] {\n return Object.keys(this.operations);\n }\n\n getBlackOpNamesNetscriptFn(): string[] {\n return Object.keys(BlackOperations);\n }\n\n getGeneralActionNamesNetscriptFn(): string[] {\n return Object.keys(GeneralActions);\n }\n\n getSkillNamesNetscriptFn(): string[] {\n return Object.keys(Skills);\n }\n\n startActionNetscriptFn(player: IPlayer, type: string, name: string, workerScript: WorkerScript): boolean {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.startAction\", () => errorLogText);\n return false;\n }\n\n // Special logic for Black Ops\n if (actionId.type === ActionTypes[\"BlackOp\"]) {\n const canRunOp = this.canAttemptBlackOp(actionId);\n if (!canRunOp.isAvailable) {\n workerScript.log(\"bladeburner.startAction\", () => canRunOp.error + \"\");\n return false;\n }\n }\n\n try {\n this.startAction(player, actionId);\n workerScript.log(\n \"bladeburner.startAction\",\n () => `Starting bladeburner action with type '${type}' and name ${name}\"`,\n );\n return true;\n } catch (e: any) {\n this.resetAction();\n workerScript.log(\"bladeburner.startAction\", () => errorLogText);\n return false;\n }\n }\n\n getActionTimeNetscriptFn(player: IPlayer, type: string, name: string, workerScript: WorkerScript): number {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getActionTime\", () => errorLogText);\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getActionTime\", () => errorLogText);\n return -1;\n }\n\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return actionObj.getActionTime(this) * 1000;\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n return 30000;\n case ActionTypes[\"Recruitment\"]:\n return this.getRecruitmentTime(player) * 1000;\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n return 60000;\n default:\n workerScript.log(\"bladeburner.getActionTime\", () => errorLogText);\n return -1;\n }\n }\n\n getActionEstimatedSuccessChanceNetscriptFn(\n player: IPlayer,\n type: string,\n name: string,\n workerScript: WorkerScript,\n ): [number, number] {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getActionEstimatedSuccessChance\", () => errorLogText);\n return [-1, -1];\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getActionEstimatedSuccessChance\", () => errorLogText);\n return [-1, -1];\n }\n\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return actionObj.getEstSuccessChance(this);\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n return [1, 1];\n case ActionTypes[\"Recruitment\"]: {\n const recChance = this.getRecruitmentSuccessChance(player);\n return [recChance, recChance];\n }\n default:\n workerScript.log(\"bladeburner.getActionEstimatedSuccessChance\", () => errorLogText);\n return [-1, -1];\n }\n }\n\n getActionCountRemainingNetscriptFn(type: string, name: string, workerScript: WorkerScript): number {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getActionCountRemaining\", () => errorLogText);\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getActionCountRemaining\", () => errorLogText);\n return -1;\n }\n\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n return Math.floor(actionObj.count);\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n if (this.blackops[name] != null) {\n return 0;\n } else {\n return 1;\n }\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Recruitment\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n return Infinity;\n default:\n workerScript.log(\"bladeburner.getActionCountRemaining\", () => errorLogText);\n return -1;\n }\n }\n\n getSkillLevelNetscriptFn(skillName: string, workerScript: WorkerScript): number {\n if (skillName === \"\" || !Skills.hasOwnProperty(skillName)) {\n workerScript.log(\"bladeburner.getSkillLevel\", () => `Invalid skill: '${skillName}'`);\n return -1;\n }\n\n if (this.skills[skillName] == null) {\n return 0;\n } else {\n return this.skills[skillName];\n }\n }\n\n getSkillUpgradeCostNetscriptFn(skillName: string, workerScript: WorkerScript): number {\n if (skillName === \"\" || !Skills.hasOwnProperty(skillName)) {\n workerScript.log(\"bladeburner.getSkillUpgradeCost\", () => `Invalid skill: '${skillName}'`);\n return -1;\n }\n\n const skill = Skills[skillName];\n if (this.skills[skillName] == null) {\n return skill.calculateCost(0);\n } else {\n return skill.calculateCost(this.skills[skillName]);\n }\n }\n\n upgradeSkillNetscriptFn(skillName: string, workerScript: WorkerScript): boolean {\n const errorLogText = `Invalid skill: '${skillName}'`;\n if (!Skills.hasOwnProperty(skillName)) {\n workerScript.log(\"bladeburner.upgradeSkill\", () => errorLogText);\n return false;\n }\n\n const skill = Skills[skillName];\n let currentLevel = 0;\n if (this.skills[skillName] && !isNaN(this.skills[skillName])) {\n currentLevel = this.skills[skillName];\n }\n const cost = skill.calculateCost(currentLevel);\n\n if (skill.maxLvl && currentLevel >= skill.maxLvl) {\n workerScript.log(\"bladeburner.upgradeSkill\", () => `Skill '${skillName}' is already maxed.`);\n return false;\n }\n\n if (this.skillPoints < cost) {\n workerScript.log(\n \"bladeburner.upgradeSkill\",\n () =>\n `You do not have enough skill points to upgrade ${skillName} (You have ${this.skillPoints}, you need ${cost})`,\n );\n return false;\n }\n\n this.skillPoints -= cost;\n this.upgradeSkill(skill);\n workerScript.log(\"bladeburner.upgradeSkill\", () => `'${skillName}' upgraded to level ${this.skills[skillName]}`);\n return true;\n }\n\n getTeamSizeNetscriptFn(type: string, name: string, workerScript: WorkerScript): number {\n if (type === \"\" && name === \"\") {\n return this.teamSize;\n }\n\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getTeamSize\", () => errorLogText);\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getTeamSize\", () => errorLogText);\n return -1;\n }\n\n if (\n actionId.type === ActionTypes[\"Operation\"] ||\n actionId.type === ActionTypes[\"BlackOp\"] ||\n actionId.type === ActionTypes[\"BlackOperation\"]\n ) {\n return actionObj.teamCount;\n } else {\n return 0;\n }\n }\n\n setTeamSizeNetscriptFn(type: string, name: string, size: number, workerScript: WorkerScript): number {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.setTeamSize\", () => errorLogText);\n return -1;\n }\n\n if (\n actionId.type !== ActionTypes[\"Operation\"] &&\n actionId.type !== ActionTypes[\"BlackOp\"] &&\n actionId.type !== ActionTypes[\"BlackOperation\"]\n ) {\n workerScript.log(\"bladeburner.setTeamSize\", () => \"Only valid for 'Operations' and 'BlackOps'\");\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.setTeamSize\", () => errorLogText);\n return -1;\n }\n\n let sanitizedSize = Math.round(size);\n if (isNaN(sanitizedSize) || sanitizedSize < 0) {\n workerScript.log(\"bladeburner.setTeamSize\", () => `Invalid size: ${size}`);\n return -1;\n }\n if (this.teamSize < sanitizedSize) {\n sanitizedSize = this.teamSize;\n }\n actionObj.teamCount = sanitizedSize;\n workerScript.log(\"bladeburner.setTeamSize\", () => `Team size for '${name}' set to ${sanitizedSize}.`);\n return sanitizedSize;\n }\n\n joinBladeburnerFactionNetscriptFn(workerScript: WorkerScript): boolean {\n const bladeburnerFac = Factions[\"Bladeburners\"];\n if (bladeburnerFac.isMember) {\n return true;\n } else if (this.rank >= BladeburnerConstants.RankNeededForFaction) {\n joinFaction(bladeburnerFac);\n workerScript.log(\"bladeburner.joinBladeburnerFaction\", () => \"Joined Bladeburners faction.\");\n return true;\n } else {\n workerScript.log(\n \"bladeburner.joinBladeburnerFaction\",\n () => `You do not have the required rank (${this.rank}/${BladeburnerConstants.RankNeededForFaction}).`,\n );\n return false;\n }\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Bladeburner\", this);\n }\n\n /**\n * Initiatizes a Bladeburner object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Bladeburner {\n return Generic_fromJSON(Bladeburner, value.data);\n }\n}\n\nReviver.constructors.Bladeburner = Bladeburner;\n","import { CompanyPosition } from \"./CompanyPosition\";\nimport * as posNames from \"./data/companypositionnames\";\nimport { favorToRep, repToFavor } from \"../Faction/formulas/favor\";\n\nimport { IMap } from \"../types\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IConstructorParams {\n name: string;\n info: string;\n companyPositions: IMap<boolean>;\n expMultiplier: number;\n salaryMultiplier: number;\n jobStatReqOffset: number;\n isMegacorp?: boolean;\n}\n\nconst DefaultConstructorParams: IConstructorParams = {\n name: \"\",\n info: \"\",\n companyPositions: {},\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n};\n\nexport class Company {\n /**\n * Company name\n */\n name: string;\n\n /**\n * Description and general information about company\n */\n info: string;\n\n /**\n * Has faction associated.\n */\n isMegacorp: boolean;\n\n /**\n * Object that holds all available positions in this Company.\n * Position names are held in keys.\n * The values for the keys don't matter, but we'll make them booleans\n *\n * Must match names of Company Positions, defined in data/companypositionnames.ts\n */\n companyPositions: IMap<boolean>;\n\n /**\n * Company-specific multiplier for earnings\n */\n expMultiplier: number;\n salaryMultiplier: number;\n\n /**\n * The additional levels of stats you need to quality for a job\n * in this company.\n *\n * For example, the base stat requirement for an intern position is 1.\n * But if a company has a offset of 200, then you would need stat(s) of 201\n */\n jobStatReqOffset: number;\n\n /**\n * Properties to track the player's progress in this company\n */\n isPlayerEmployed: boolean;\n playerReputation: number;\n favor: number;\n\n constructor(p: IConstructorParams = DefaultConstructorParams) {\n this.name = p.name;\n this.info = p.info;\n this.companyPositions = p.companyPositions;\n this.expMultiplier = p.expMultiplier;\n this.salaryMultiplier = p.salaryMultiplier;\n this.jobStatReqOffset = p.jobStatReqOffset;\n\n this.isPlayerEmployed = false;\n this.playerReputation = 1;\n this.favor = 0;\n this.isMegacorp = false;\n if (p.isMegacorp) this.isMegacorp = true;\n }\n\n hasPosition(pos: CompanyPosition | string): boolean {\n if (pos instanceof CompanyPosition) {\n return this.companyPositions[pos.name] != null;\n } else {\n return this.companyPositions[pos] != null;\n }\n }\n\n hasAgentPositions(): boolean {\n return this.companyPositions[posNames.AgentCompanyPositions[0]] != null;\n }\n\n hasBusinessConsultantPositions(): boolean {\n return this.companyPositions[posNames.BusinessConsultantCompanyPositions[0]] != null;\n }\n\n hasBusinessPositions(): boolean {\n return this.companyPositions[posNames.BusinessCompanyPositions[0]] != null;\n }\n\n hasEmployeePositions(): boolean {\n return this.companyPositions[posNames.MiscCompanyPositions[1]] != null;\n }\n\n hasITPositions(): boolean {\n return this.companyPositions[posNames.ITCompanyPositions[0]] != null;\n }\n\n hasSecurityPositions(): boolean {\n return this.companyPositions[posNames.SecurityCompanyPositions[2]] != null;\n }\n\n hasSoftwareConsultantPositions(): boolean {\n return this.companyPositions[posNames.SoftwareConsultantCompanyPositions[0]] != null;\n }\n\n hasSoftwarePositions(): boolean {\n return this.companyPositions[posNames.SoftwareCompanyPositions[0]] != null;\n }\n\n hasWaiterPositions(): boolean {\n return this.companyPositions[posNames.MiscCompanyPositions[0]] != null;\n }\n\n gainFavor(): void {\n if (this.favor == null) {\n this.favor = 0;\n }\n this.favor += this.getFavorGain();\n }\n\n getFavorGain(): number {\n if (this.favor == null) {\n this.favor = 0;\n }\n const storedRep = Math.max(0, favorToRep(this.favor));\n const totalRep = storedRep + this.playerReputation;\n const newFavor = repToFavor(totalRep);\n return newFavor - this.favor;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Company\", this);\n }\n\n /**\n * Initiatizes a Company from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Company {\n return Generic_fromJSON(Company, value.data);\n }\n}\n\nReviver.constructors.Company = Company;\n","import { Material } from \"./Material\";\nimport { ICorporation } from \"./ICorporation\";\nimport { IIndustry } from \"./IIndustry\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { IMap } from \"../types\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\n\ninterface IConstructorParams {\n corp?: ICorporation;\n industry?: IIndustry;\n loc?: string;\n size?: number;\n}\n\nexport class Warehouse {\n // Warehouse's level, which affects its maximum size\n level = 1;\n\n // City that this Warehouse is in\n loc: string;\n\n // Map of Materials held by this Warehouse\n materials: IMap<Material>;\n\n // Maximum amount warehouse can hold\n size: number;\n\n // Amount of space currently used by warehouse\n sizeUsed = 0;\n\n // Whether Smart Supply is enabled for this Industry (the Industry that this Warehouse is for)\n smartSupplyEnabled = false;\n\n // Decide if smart supply should use the materials already in the warehouse when deciding on the amount to buy.\n smartSupplyUseLeftovers: { [key: string]: boolean | undefined } = {};\n\n // Stores the amount of product to be produced. Used for Smart Supply unlock.\n // The production tracked by smart supply is always based on the previous cycle,\n // so it will always trail the \"true\" production by 1 cycle\n smartSupplyStore = 0;\n\n constructor(params: IConstructorParams = {}) {\n this.loc = params.loc ? params.loc : \"\";\n this.size = params.size ? params.size : 0;\n\n this.materials = {\n Water: new Material({ name: \"Water\" }),\n Energy: new Material({ name: \"Energy\" }),\n Food: new Material({ name: \"Food\" }),\n Plants: new Material({ name: \"Plants\" }),\n Metal: new Material({ name: \"Metal\" }),\n Hardware: new Material({ name: \"Hardware\" }),\n Chemicals: new Material({ name: \"Chemicals\" }),\n Drugs: new Material({ name: \"Drugs\" }),\n Robots: new Material({ name: \"Robots\" }),\n AICores: new Material({ name: \"AI Cores\" }),\n RealEstate: new Material({ name: \"Real Estate\" }),\n };\n\n this.smartSupplyUseLeftovers = {\n Water: true,\n Energy: true,\n Food: true,\n Plants: true,\n Metal: true,\n Hardware: true,\n Chemicals: true,\n Drugs: true,\n Robots: true,\n AICores: true,\n RealEstate: true,\n };\n\n if (params.corp && params.industry) {\n this.updateSize(params.corp, params.industry);\n }\n\n // Default smart supply to being enabled if the upgrade is unlocked\n if (params.corp?.unlockUpgrades[1]) {\n this.smartSupplyEnabled = true;\n }\n }\n\n // Re-calculate how much space is being used by this Warehouse\n updateMaterialSizeUsed(): void {\n this.sizeUsed = 0;\n for (const matName of Object.keys(this.materials)) {\n const mat = this.materials[matName];\n if (MaterialSizes.hasOwnProperty(matName)) {\n this.sizeUsed += mat.qty * MaterialSizes[matName];\n }\n }\n if (this.sizeUsed > this.size) {\n console.warn(\"Warehouse size used greater than capacity, something went wrong\");\n }\n }\n\n updateSize(corporation: ICorporation, industry: IIndustry): void {\n try {\n this.size = this.level * 100 * corporation.getStorageMultiplier() * industry.getStorageMultiplier();\n } catch (e: any) {\n exceptionAlert(e);\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"Warehouse\", this);\n }\n\n // Initiatizes a Warehouse object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Warehouse {\n return Generic_fromJSON(Warehouse, value.data);\n }\n}\n\nReviver.constructors.Warehouse = Warehouse;\n","import { gangMemberTasksMetadata } from \"./data/tasks\";\nimport { GangMemberTask } from \"./GangMemberTask\";\n\nexport const GangMemberTasks: {\n [key: string]: GangMemberTask;\n} = {};\n\n(function () {\n gangMemberTasksMetadata.forEach((e) => {\n GangMemberTasks[e.name] = new GangMemberTask(e.name, e.desc, e.isHacking, e.isCombat, e.params);\n });\n})();\n","/**\n * Map of all Hash Upgrades\n * Key = Hash name, Value = HashUpgrade object\n */\nimport { HashUpgrade, IConstructorParams } from \"./HashUpgrade\";\nimport { HashUpgradesMetadata } from \"./data/HashUpgradesMetadata\";\nimport { IMap } from \"../types\";\n\nexport const HashUpgrades: IMap<HashUpgrade> = {};\n\nfunction createHashUpgrade(p: IConstructorParams): void {\n HashUpgrades[p.name] = new HashUpgrade(p);\n}\n\nfor (const metadata of HashUpgradesMetadata) {\n createHashUpgrade(metadata);\n}\n","import { FragmentType } from \"./FragmentType\";\nimport { Shapes } from \"./data/Shapes\";\n\nexport const Fragments: Fragment[] = [];\n\nexport class Fragment {\n id: number;\n shape: boolean[][];\n type: FragmentType;\n power: number;\n limit: number;\n\n constructor(id: number, shape: boolean[][], type: FragmentType, power: number, limit: number) {\n this.id = id;\n this.shape = shape;\n this.type = type;\n this.power = power;\n this.limit = limit;\n }\n\n fullAt(x: number, y: number, rotation: number): boolean {\n if (y < 0) return false;\n if (y >= this.height(rotation)) return false;\n if (x < 0) return false;\n if (x >= this.width(rotation)) return false;\n // start xy, modifier xy\n let [sx, sy, mx, my] = [0, 0, 1, 1];\n if (rotation === 1) {\n [sx, sy, mx, my] = [this.width(rotation) - 1, 0, -1, 1];\n } else if (rotation === 2) {\n [sx, sy, mx, my] = [this.width(rotation) - 1, this.height(rotation) - 1, -1, -1];\n } else if (rotation === 3) {\n [sx, sy, mx, my] = [0, this.height(rotation) - 1, 1, -1];\n }\n let [qx, qy] = [sx + mx * x, sy + my * y];\n if (rotation % 2 === 1) [qx, qy] = [qy, qx];\n return this.shape[qy][qx];\n }\n\n width(rotation: number): number {\n if (rotation % 2 === 0) return this.shape[0].length;\n return this.shape.length;\n }\n\n height(rotation: number): number {\n if (rotation % 2 === 0) return this.shape.length;\n return this.shape[0].length;\n }\n\n // List of direct neighboors of this fragment.\n neighboors(rotation: number): number[][] {\n const candidates: number[][] = [];\n\n const add = (x: number, y: number): void => {\n if (this.fullAt(x, y, rotation)) return;\n if (candidates.some((coord) => coord[0] === x && coord[1] === y)) return;\n candidates.push([x, y]);\n };\n for (let y = 0; y < this.height(rotation); y++) {\n for (let x = 0; x < this.width(rotation); x++) {\n // This cell is full, add all it's neighboors.\n if (!this.fullAt(x, y, rotation)) continue;\n add(x - 1, y);\n add(x + 1, y);\n add(x, y - 1);\n add(x, y + 1);\n }\n }\n const cells: number[][] = [];\n for (const candidate of candidates) {\n if (cells.some((cell) => cell[0] === candidate[0] && cell[1] === candidate[1])) continue;\n cells.push(candidate);\n }\n\n return cells;\n }\n\n copy(): Fragment {\n return new Fragment(\n this.id,\n this.shape.map((a) => a.slice()),\n this.type,\n this.power,\n this.limit,\n );\n }\n}\n\nexport function FragmentById(id: number): Fragment | null {\n for (const fragment of Fragments) {\n if (fragment.id === id) return fragment;\n }\n return null;\n}\n\n(function () {\n const _ = false;\n const X = true;\n Fragments.push(\n new Fragment(\n 0, // id\n Shapes.S,\n FragmentType.Hacking, // type\n 1,\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 1, // id\n Shapes.Z,\n FragmentType.Hacking, // type\n 1,\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 5, // id\n Shapes.T,\n FragmentType.HackingSpeed, // type\n 1.3,\n 1, // limit\n ),\n );\n\n Fragments.push(\n new Fragment(\n 6, // id\n Shapes.I,\n FragmentType.HackingMoney, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 7, // id\n Shapes.J,\n FragmentType.HackingGrow, // type\n 0.5, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 10, // id\n Shapes.T,\n FragmentType.Strength, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 12, // id\n Shapes.L,\n FragmentType.Defense, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 14, // id\n Shapes.L,\n FragmentType.Dexterity, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 16, // id\n Shapes.S,\n FragmentType.Agility, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 18, // id\n Shapes.S,\n FragmentType.Charisma, // type\n 3, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 20, // id\n Shapes.I,\n FragmentType.HacknetMoney, // type\n 1, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 21, // id\n Shapes.O,\n FragmentType.HacknetCost, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 25, // id\n Shapes.J,\n FragmentType.Rep, // type\n 0.5, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 27, // id\n Shapes.J,\n FragmentType.WorkMoney, // type\n 10, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 28, // id\n Shapes.L,\n FragmentType.Crime, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 30, // id\n Shapes.S,\n FragmentType.Bladeburner, // type\n 0.4, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 100, // id\n [\n // shape\n [_, X, X],\n [X, X, _],\n [_, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 101, // id\n [\n // shape\n [X, X, X, X],\n [X, _, _, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 102, // id\n [\n // shape\n [_, X, X, X],\n [X, X, _, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 103, // id\n [\n // shape\n [X, X, X, _],\n [_, _, X, X],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 104, // id\n [\n // shape\n [_, X, X],\n [_, X, _],\n [X, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 105, // id\n [\n // shape\n [_, _, X],\n [_, X, X],\n [X, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 106, // id\n [\n // shape\n [X, _, _],\n [X, X, X],\n [X, _, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 107, // id\n [\n // shape\n [_, X, _],\n [X, X, X],\n [_, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n})();\n\nexport const NoneFragment = new Fragment(-2, [], FragmentType.None, 0, Infinity);\nexport const DeleteFragment = new Fragment(-2, [], FragmentType.Delete, 0, Infinity);\n","import { IPlayer } from \"../IPlayer\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CalculateShareMult } from \"../../NetworkShare/Share\";\n\nfunction mult(f: Faction): number {\n let favorMult = 1 + f.favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n return favorMult * BitNodeMultipliers.FactionWorkRepGain;\n}\n\nexport function getHackingWorkRepGain(p: IPlayer, f: Faction): number {\n return (\n ((p.hacking + p.intelligence / 3) / CONSTANTS.MaxSkillLevel) *\n p.faction_rep_mult *\n p.getIntelligenceBonus(1) *\n mult(f) *\n CalculateShareMult()\n );\n}\n\nexport function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number {\n const t =\n (0.9 *\n (p.hacking / CONSTANTS.MaxSkillLevel +\n p.strength / CONSTANTS.MaxSkillLevel +\n p.defense / CONSTANTS.MaxSkillLevel +\n p.dexterity / CONSTANTS.MaxSkillLevel +\n p.agility / CONSTANTS.MaxSkillLevel +\n p.intelligence / CONSTANTS.MaxSkillLevel)) /\n 4.5;\n return t * p.faction_rep_mult * mult(f) * p.getIntelligenceBonus(1);\n}\n\nexport function getFactionFieldWorkRepGain(p: IPlayer, f: Faction): number {\n const t =\n (0.9 *\n (p.hacking / CONSTANTS.MaxSkillLevel +\n p.strength / CONSTANTS.MaxSkillLevel +\n p.defense / CONSTANTS.MaxSkillLevel +\n p.dexterity / CONSTANTS.MaxSkillLevel +\n p.agility / CONSTANTS.MaxSkillLevel +\n p.charisma / CONSTANTS.MaxSkillLevel +\n p.intelligence / CONSTANTS.MaxSkillLevel)) /\n 5.5;\n return t * p.faction_rep_mult * mult(f) * p.getIntelligenceBonus(1);\n}\n","/**\n * Functions for buying/selling stocks. There are four functions total, two for\n * long positions and two for short positions.\n */\nimport { Stock } from \"./Stock\";\nimport {\n getBuyTransactionCost,\n getSellTransactionGain,\n processTransactionForecastMovement,\n} from \"./StockMarketHelpers\";\n\nimport { PositionTypes } from \"./data/PositionTypes\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { Player } from \"../Player\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nimport * as React from \"react\";\n\n/**\n * Each function takes an optional config object as its last argument\n */\ninterface IOptions {\n rerenderFn?: () => void;\n suppressDialog?: boolean;\n}\n\n/**\n * Attempt to buy a stock in the long position\n * @param {Stock} stock - Stock to buy\n * @param {number} shares - Number of shares to buy\n * @param {WorkerScript} workerScript - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * @returns {boolean} - true if successful, false otherwise\n */\nexport function buyStock(\n stock: Stock,\n shares: number,\n workerScript: WorkerScript | null = null,\n opts: IOptions = {},\n): boolean {\n // Validate arguments\n shares = Math.round(shares);\n if (shares <= 0) {\n return false;\n }\n if (stock == null || isNaN(shares)) {\n if (workerScript) {\n workerScript.log(\"stock.buy\", () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\"Failed to buy stock. This may be a bug, contact developer\");\n }\n\n return false;\n }\n\n // Does player have enough money?\n const totalPrice = getBuyTransactionCost(stock, shares, PositionTypes.Long);\n if (totalPrice == null) {\n return false;\n }\n if (Player.money < totalPrice) {\n if (workerScript) {\n workerScript.log(\n \"stock.buy\",\n () =>\n `You do not have enough money to purchase this position. You need ${numeralWrapper.formatMoney(totalPrice)}.`,\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n You do not have enough money to purchase this. You need <Money money={totalPrice} />\n </>,\n );\n }\n\n return false;\n }\n\n // Would this purchase exceed the maximum number of shares?\n if (shares + stock.playerShares + stock.playerShortShares > stock.maxShares) {\n if (workerScript) {\n workerScript.log(\n \"stock.buy\",\n () =>\n `Purchasing '${shares + stock.playerShares + stock.playerShortShares}' shares would exceed ${\n stock.symbol\n }'s maximum (${stock.maxShares}) number of shares`,\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n `You cannot purchase this many shares. ${stock.symbol} has a maximum of ${numeralWrapper.formatShares(\n stock.maxShares,\n )} shares.`,\n );\n }\n\n return false;\n }\n\n const origTotal = stock.playerShares * stock.playerAvgPx;\n Player.loseMoney(totalPrice, \"stock\");\n const newTotal = origTotal + totalPrice - CONSTANTS.StockMarketCommission;\n stock.playerShares = Math.round(stock.playerShares + shares);\n stock.playerAvgPx = newTotal / stock.playerShares;\n processTransactionForecastMovement(stock, shares);\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (workerScript) {\n const resultTxt =\n `Bought ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol} for ${numeralWrapper.formatMoney(\n totalPrice,\n )}. ` + `Paid ${numeralWrapper.formatMoney(CONSTANTS.StockMarketCommission)} in commission fees.`;\n workerScript.log(\"stock.buy\", () => resultTxt);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n Bought {numeralWrapper.formatShares(shares)} shares of {stock.symbol} for <Money money={totalPrice} />. Paid{\" \"}\n <Money money={CONSTANTS.StockMarketCommission} /> in commission fees.\n </>,\n );\n }\n\n return true;\n}\n\n/**\n * Attempt to sell a stock in the long position\n * @param {Stock} stock - Stock to sell\n * @param {number} shares - Number of shares to sell\n * @param {WorkerScript} workerScript - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * returns {boolean} - true if successfully sells given number of shares OR MAX owned, false otherwise\n */\nexport function sellStock(\n stock: Stock,\n shares: number,\n workerScript: WorkerScript | null = null,\n opts: IOptions = {},\n): boolean {\n // Sanitize/Validate arguments\n if (stock == null || shares < 0 || isNaN(shares)) {\n if (workerScript) {\n workerScript.log(\"stock.sell\", () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n \"Failed to sell stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, contact developer\",\n );\n }\n\n return false;\n }\n shares = Math.round(shares);\n if (shares > stock.playerShares) {\n shares = stock.playerShares;\n }\n if (shares === 0) {\n return false;\n }\n\n const gains = getSellTransactionGain(stock, shares, PositionTypes.Long);\n if (gains == null) {\n return false;\n }\n let netProfit = gains - stock.playerAvgPx * shares;\n if (isNaN(netProfit)) {\n netProfit = 0;\n }\n Player.gainMoney(gains, \"stock\");\n if (workerScript) {\n workerScript.scriptRef.onlineMoneyMade += netProfit;\n Player.scriptProdSinceLastAug += netProfit;\n }\n\n stock.playerShares = Math.round(stock.playerShares - shares);\n if (stock.playerShares === 0) {\n stock.playerAvgPx = 0;\n }\n\n processTransactionForecastMovement(stock, shares);\n\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (workerScript) {\n const resultTxt =\n `Sold ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol}. ` +\n `After commissions, you gained a total of ${numeralWrapper.formatMoney(gains)}.`;\n workerScript.log(\"stock.sell\", () => resultTxt);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n Sold {numeralWrapper.formatShares(shares)} shares of {stock.symbol}. After commissions, you gained a total of{\" \"}\n <Money money={gains} />.\n </>,\n );\n }\n\n return true;\n}\n\n/**\n * Attempt to buy a stock in the short position\n * @param {Stock} stock - Stock to sell\n * @param {number} shares - Number of shares to short\n * @param {WorkerScript} workerScript - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * @returns {boolean} - true if successful, false otherwise\n */\nexport function shortStock(\n stock: Stock,\n shares: number,\n workerScript: WorkerScript | null = null,\n opts: IOptions = {},\n): boolean {\n // Validate arguments\n shares = Math.round(shares);\n if (shares <= 0) {\n return false;\n }\n if (stock == null || isNaN(shares)) {\n if (workerScript) {\n workerScript.log(\"stock.short\", () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n \"Failed to initiate a short position in a stock. This is probably \" +\n \"due to an invalid quantity. Otherwise, this may be a bug, so contact developer\",\n );\n }\n return false;\n }\n\n // Does the player have enough money?\n const totalPrice = getBuyTransactionCost(stock, shares, PositionTypes.Short);\n if (totalPrice == null) {\n return false;\n }\n if (Player.money < totalPrice) {\n if (workerScript) {\n workerScript.log(\n \"stock.short\",\n () =>\n \"You do not have enough \" +\n \"money to purchase this short position. You need \" +\n numeralWrapper.formatMoney(totalPrice),\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n You do not have enough money to purchase this short position. You need <Money money={totalPrice} />\n </>,\n );\n }\n\n return false;\n }\n\n // Would this purchase exceed the maximum number of shares?\n if (shares + stock.playerShares + stock.playerShortShares > stock.maxShares) {\n if (workerScript) {\n workerScript.log(\n \"stock.short\",\n () =>\n `This '${shares + stock.playerShares + stock.playerShortShares}' short shares would exceed ${\n stock.symbol\n }'s maximum (${stock.maxShares}) number of shares.`,\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n `You cannot purchase this many shares. ${stock.symbol} has a maximum of ${stock.maxShares} shares.`,\n );\n }\n\n return false;\n }\n\n const origTotal = stock.playerShortShares * stock.playerAvgShortPx;\n Player.loseMoney(totalPrice, \"stock\");\n const newTotal = origTotal + totalPrice - CONSTANTS.StockMarketCommission;\n stock.playerShortShares = Math.round(stock.playerShortShares + shares);\n stock.playerAvgShortPx = newTotal / stock.playerShortShares;\n processTransactionForecastMovement(stock, shares);\n\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (workerScript) {\n const resultTxt =\n `Bought a short position of ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol} ` +\n `for ${numeralWrapper.formatMoney(totalPrice)}. Paid ${numeralWrapper.formatMoney(\n CONSTANTS.StockMarketCommission,\n )} ` +\n `in commission fees.`;\n workerScript.log(\"stock.short\", () => resultTxt);\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n <>\n Bought a short position of {numeralWrapper.formatShares(shares)} shares of {stock.symbol} for{\" \"}\n <Money money={totalPrice} />. Paid <Money money={CONSTANTS.StockMarketCommission} /> in commission fees.\n </>,\n );\n }\n\n return true;\n}\n\n/**\n * Attempt to sell a stock in the short position\n * @param {Stock} stock - Stock to sell\n * @param {number} shares - Number of shares to sell\n * @param {WorkerScript} workerScript - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * @returns {boolean} true if successfully sells given amount OR max owned, false otherwise\n */\nexport function sellShort(\n stock: Stock,\n shares: number,\n workerScript: WorkerScript | null = null,\n opts: IOptions = {},\n): boolean {\n if (stock == null || isNaN(shares) || shares < 0) {\n if (workerScript) {\n workerScript.log(\"stock.sellShort\", () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n \"Failed to sell a short position in a stock. This is probably \" +\n \"due to an invalid quantity. Otherwise, this may be a bug, so contact developer\",\n );\n }\n\n return false;\n }\n shares = Math.round(shares);\n if (shares > stock.playerShortShares) {\n shares = stock.playerShortShares;\n }\n if (shares === 0) {\n return false;\n }\n\n const origCost = shares * stock.playerAvgShortPx;\n const totalGain = getSellTransactionGain(stock, shares, PositionTypes.Short);\n if (totalGain == null || isNaN(totalGain) || origCost == null) {\n if (workerScript) {\n workerScript.log(\n \"stock.sellShort\",\n () => `Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug`,\n );\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n `Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug`,\n );\n }\n\n return false;\n }\n let profit = totalGain - origCost;\n if (isNaN(profit)) {\n profit = 0;\n }\n Player.gainMoney(totalGain, \"stock\");\n if (workerScript) {\n workerScript.scriptRef.onlineMoneyMade += profit;\n Player.scriptProdSinceLastAug += profit;\n }\n\n stock.playerShortShares = Math.round(stock.playerShortShares - shares);\n if (stock.playerShortShares === 0) {\n stock.playerAvgShortPx = 0;\n }\n processTransactionForecastMovement(stock, shares);\n\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (workerScript) {\n const resultTxt =\n `Sold your short position of ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol}. ` +\n `After commissions, you gained a total of ${numeralWrapper.formatMoney(totalGain)}`;\n workerScript.log(\"stock.sellShort\", () => resultTxt);\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n <>\n Sold your short position of {numeralWrapper.formatShares(shares)} shares of {stock.symbol}. After commissions,\n you gained a total of <Money money={totalGain} />\n </>,\n );\n }\n\n return true;\n}\n","import React from \"react\";\nimport { TextFile } from \"../TextFile\";\nimport { Script } from \"../Script/Script\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter } from \"../ui/Router\";\nimport { Settings } from \"../Settings/Settings\";\nimport { formatTime } from \"../utils/helpers/formatTime\";\nimport { BaseServer } from \"../Server/BaseServer\";\n\nexport class Output {\n text: string;\n color: \"primary\" | \"error\" | \"success\" | \"info\" | \"warn\";\n constructor(text: string, color: \"primary\" | \"error\" | \"success\" | \"info\" | \"warn\") {\n if (Settings.TimestampsFormat) text = \"[\" + formatTime(Settings.TimestampsFormat) + \"] \" + text;\n this.text = text;\n this.color = color;\n }\n}\n\nexport class RawOutput {\n raw: React.ReactNode;\n constructor(node: React.ReactNode) {\n if (Settings.TimestampsFormat)\n node = (\n <>\n [{formatTime(Settings.TimestampsFormat)}] {node}\n </>\n );\n this.raw = node;\n }\n}\n\nexport class Link {\n hostname: string;\n dashes: string;\n constructor(dashes: string, hostname: string) {\n if (Settings.TimestampsFormat) dashes = \"[\" + formatTime(Settings.TimestampsFormat) + \"] \" + dashes;\n this.hostname = hostname;\n this.dashes = dashes;\n }\n}\n\nexport class TTimer {\n time: number;\n timeLeft: number;\n action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\";\n server?: BaseServer;\n\n constructor(time: number, action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\", server?: BaseServer) {\n this.time = time;\n this.timeLeft = time;\n this.action = action;\n this.server = server;\n }\n}\n\nexport interface ITerminal {\n action: TTimer | null;\n\n commandHistory: string[];\n commandHistoryIndex: number;\n\n outputHistory: (Output | Link | RawOutput)[];\n\n // True if a Coding Contract prompt is opened\n contractOpen: boolean;\n\n // Full Path of current directory\n // Excludes the trailing forward slash\n currDir: string;\n\n print(s: string): void;\n printRaw(node: React.ReactNode): void;\n error(s: string): void;\n success(s: string): void;\n info(s: string): void;\n warn(s: string): void;\n\n clear(): void;\n startAnalyze(player: IPlayer): void;\n startBackdoor(player: IPlayer): void;\n startHack(player: IPlayer): void;\n startGrow(player: IPlayer): void;\n startWeaken(player: IPlayer): void;\n finishHack(router: IRouter, player: IPlayer, server: BaseServer, cancelled?: boolean): void;\n finishGrow(player: IPlayer, server: BaseServer, cancelled?: boolean): void;\n finishWeaken(player: IPlayer, server: BaseServer, cancelled?: boolean): void;\n finishBackdoor(router: IRouter, player: IPlayer, server: BaseServer, cancelled?: boolean): void;\n finishAnalyze(player: IPlayer, server: BaseServer, cancelled?: boolean): void;\n finishAction(router: IRouter, player: IPlayer, cancelled?: boolean): void;\n getFilepath(filename: string): string;\n getFile(player: IPlayer, filename: string): Script | TextFile | string | null;\n getScript(player: IPlayer, filename: string): Script | null;\n getTextFile(player: IPlayer, filename: string): TextFile | null;\n getLitFile(player: IPlayer, filename: string): string | null;\n cwd(): string;\n setcwd(dir: string): void;\n runContract(player: IPlayer, name: string): void;\n executeScanAnalyzeCommand(player: IPlayer, depth?: number, all?: boolean): void;\n connectToServer(player: IPlayer, server: string): void;\n executeCommand(router: IRouter, player: IPlayer, command: string): void;\n executeCommands(router: IRouter, player: IPlayer, commands: string): void;\n // If there was any changes, will return true, once.\n process(router: IRouter, player: IPlayer, cycles: number): void;\n prestige(): void;\n getProgressText(): string;\n}\n","import { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\ninterface ISkillParams {\n name: string;\n desc: string;\n\n baseCost?: number;\n costInc?: number;\n maxLvl?: number;\n\n successChanceAll?: number;\n successChanceStealth?: number;\n successChanceKill?: number;\n successChanceContract?: number;\n successChanceOperation?: number;\n successChanceEstimate?: number;\n\n actionTime?: number;\n\n effHack?: number;\n effStr?: number;\n effDef?: number;\n effDex?: number;\n effAgi?: number;\n effCha?: number;\n\n stamina?: number;\n money?: number;\n expGain?: number;\n}\n\nexport class Skill {\n name: string;\n desc: string;\n // Cost is in Skill Points\n baseCost = 1;\n // Additive cost increase per level\n costInc = 1;\n maxLvl = 0;\n\n /**\n * These benefits are additive. So total multiplier will be level (handled externally) times the\n * effects below\n */\n successChanceAll = 0;\n successChanceStealth = 0;\n successChanceKill = 0;\n successChanceContract = 0;\n successChanceOperation = 0;\n\n /**\n * This multiplier affects everything that increases synthoid population/community estimate\n * e.g. Field analysis, Investigation Op, Undercover Op\n */\n successChanceEstimate = 0;\n actionTime = 0;\n effHack = 0;\n effStr = 0;\n effDef = 0;\n effDex = 0;\n effAgi = 0;\n effCha = 0;\n stamina = 0;\n money = 0;\n expGain = 0;\n\n constructor(params: ISkillParams = { name: \"foo\", desc: \"foo\" }) {\n if (!params.name) {\n throw new Error(\"Failed to initialize Bladeburner Skill. No name was specified in ctor\");\n }\n if (!params.desc) {\n throw new Error(\"Failed to initialize Bladeburner Skills. No desc was specified in ctor\");\n }\n this.name = params.name;\n this.desc = params.desc;\n this.baseCost = params.baseCost ? params.baseCost : 1;\n this.costInc = params.costInc ? params.costInc : 1;\n\n if (params.maxLvl) {\n this.maxLvl = params.maxLvl;\n }\n\n if (params.successChanceAll) {\n this.successChanceAll = params.successChanceAll;\n }\n if (params.successChanceStealth) {\n this.successChanceStealth = params.successChanceStealth;\n }\n if (params.successChanceKill) {\n this.successChanceKill = params.successChanceKill;\n }\n if (params.successChanceContract) {\n this.successChanceContract = params.successChanceContract;\n }\n if (params.successChanceOperation) {\n this.successChanceOperation = params.successChanceOperation;\n }\n\n if (params.successChanceEstimate) {\n this.successChanceEstimate = params.successChanceEstimate;\n }\n\n if (params.actionTime) {\n this.actionTime = params.actionTime;\n }\n if (params.effHack) {\n this.effHack = params.effHack;\n }\n if (params.effStr) {\n this.effStr = params.effStr;\n }\n if (params.effDef) {\n this.effDef = params.effDef;\n }\n if (params.effDex) {\n this.effDex = params.effDex;\n }\n if (params.effAgi) {\n this.effAgi = params.effAgi;\n }\n if (params.effCha) {\n this.effCha = params.effCha;\n }\n\n if (params.stamina) {\n this.stamina = params.stamina;\n }\n if (params.money) {\n this.money = params.money;\n }\n if (params.expGain) {\n this.expGain = params.expGain;\n }\n }\n\n calculateCost(currentLevel: number): number {\n return Math.floor((this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost);\n }\n\n getMultiplier(name: string): number {\n if (name === \"successChanceAll\") return this.successChanceAll;\n if (name === \"successChanceStealth\") return this.successChanceStealth;\n if (name === \"successChanceKill\") return this.successChanceKill;\n if (name === \"successChanceContract\") return this.successChanceContract;\n if (name === \"successChanceOperation\") return this.successChanceOperation;\n if (name === \"successChanceEstimate\") return this.successChanceEstimate;\n\n if (name === \"actionTime\") return this.actionTime;\n\n if (name === \"effHack\") return this.effHack;\n if (name === \"effStr\") return this.effStr;\n if (name === \"effDef\") return this.effDef;\n if (name === \"effDex\") return this.effDex;\n if (name === \"effAgi\") return this.effAgi;\n if (name === \"effCha\") return this.effCha;\n\n if (name === \"stamina\") return this.stamina;\n if (name === \"money\") return this.money;\n if (name === \"expGain\") return this.expGain;\n return 0;\n }\n}\n","export function hash(): string {\n try {\n if (__COMMIT_HASH__) {\n return __COMMIT_HASH__;\n }\n } catch (err) {}\n return \"DEV\";\n}\n","/**\n * Map of all Locations in the game\n * Key = Location name, value = Location object\n */\nimport { City } from \"./City\";\nimport { Cities } from \"./Cities\";\nimport { Location, IConstructorParams } from \"./Location\";\nimport { CityName } from \"./data/CityNames\";\nimport { LocationsMetadata } from \"./data/LocationsMetadata\";\n\nimport { IMap } from \"../types\";\n\nexport const Locations: IMap<Location> = {};\n\n/**\n * Here, we'll initialize both Locations and Cities data. These can both\n * be initialized from the `LocationsMetadata`\n */\nfunction constructLocation(p: IConstructorParams): Location {\n if (!p.name) {\n throw new Error(`Invalid constructor parameters for Location. No 'name' property`);\n }\n\n if (Locations[p.name] instanceof Location) {\n console.warn(`Property with name ${p.name} already exists and is being overwritten`);\n }\n\n Locations[p.name] = new Location(p);\n\n return Locations[p.name];\n}\n\n// First construct all cities\nCities[CityName.Aevum] = new City(CityName.Aevum);\nCities[CityName.Chongqing] = new City(CityName.Chongqing);\nCities[CityName.Ishima] = new City(CityName.Ishima);\nCities[CityName.NewTokyo] = new City(CityName.NewTokyo);\nCities[CityName.Sector12] = new City(CityName.Sector12);\nCities[CityName.Volhaven] = new City(CityName.Volhaven);\n\nCities[CityName.Aevum].asciiArt = `\n [aevum police headquarters] 26 \n o \n I \\\\ [bachman & associates] \n \\\\ 56 B \n x \\\\ [summit university] \n \\\\ \\\\ 28 \n \\\\ [snap fitness gym] x o--L-----------N \n K \\\\ / \n \\\\ \\\\ Q [casino] \n x 58 \\\\ / [travel agency] \n \\\\ 94 95 o \n 90 x 59 o------o | \n \\\\ / \\\\ | 98 102 103 \n o--------O------x----o 93 96 o-----+------------o o----o \n \\\\ | \\\\ / \n [hospital] \\\\ 61 [ecorp] x 31 99 o-F-o 101 \n o | \n | o---E-- | [fulcrum tech.] \n x 62 / A [aerocorp] \n [crush fitness gym] | / | \n | / | \n o--------D------+--o o \n | |\\\\ [rho construction] \n H [netlink tech.] | J \n | | \\\\ \n | 34 x \\\\ \n [clarke inc.] C | \\\\ [world stock exchange] \n | | \\\\ \n | | o-M-------R--------o \n[galactic cybersystems] G 35 x \n | [watchdog security] \n | \n 67 o \n \n [the slums] P `;\nCities[CityName.Chongqing].asciiArt = `\n | \n 75 o \n \\\\ \n o 76 \n 7 | | \n | + 77 \n [world stock exchange] F | \n \\\\ o 78 [kuaigong international] \n \\\\ / \n 38 o----x--x------x------A------G-- \n / 39 | 41 [church] \n 37 o + 79 o--x--x-C-0 \n / | / \n / x-----+-----x-----0 [hospital] \n[solaris space system] B | \n | + 80 \n | | \n 34 o E [travel agency] \n | \n | \n x 82 \n [the slums] D `;\nCities[CityName.Ishima].asciiArt = `\n o 59 \n o o | \n [storm tech.] | | G [world stock exchange] \n | | 28 | \n 23 o--C------o--------+----x----o | \n / / 25 | 27 \\\\ x 57 \n / / | \\\\ | \n / / | \\\\ | \n o 22 o | \\\\| 29/56 \n | | o \n | [hospital] D / \\\\ 3 2 1 \n o | / \\\\ o-------x------o \n / o / \\\\ / \n 48 o / 55 x \\\\ / \n \\\\ / / x [glitch] \n \\\\ / [nova medical] / 4/30 \\\\ \n 49 x A \\\\ H \n / \\\\ / \\\\ \n / \\\\ [travel agency] F o 31 \n / \\\\ 51 / \n / o----B------x-----o \n o 50 52 \n [omega soft.] \n [the slums] E `;\nCities[CityName.NewTokyo].asciiArt = `\n \n \n o \n \\\\ \n \\\\ [defcomm] \n \\\\ \n o--x---A--x--o [travel agency] \n 7 8 10 G \n [vitalife] o 12 [global pharmaceuticals] \n | \n o--D-x----x-------x-C-+--------x--x-B-x---x-o \n 21 22 23 \\\\ 24 25 26 27 \n \\\\ \n [noodle bar] x 14 \n \\\\ \n \\\\ \n [hospital] o 15 [world stock exchange] \n | \n o--x--E--x-----x-----x---+---x----x--H--x-o \n | \n | \n o 17 \n \n \n \n F [the slums] \n `;\nCities[CityName.Sector12].asciiArt = `\n 78 o 97 \n o [icarus microsystems] / \n N [powerhouse gym] o I \n 1 | | / \n o-----+---x----o 4 A [alpha ent.] o-------o / \n | 3 \\\\ | \\\\ / \n | \\\\ | [iron gym] x 95 \n (79) x \\\\ | / \\\\ \n | o-E----+----x----J--o 10 / o----T--o \n | | 8 \\\\ 94 x \n 80 x [city hall] | x 11 / [world stock exchange]\n | | \\\\ / \n | C [cia] \\\\ / \n Q [hospital] | F P [universal energy] \n | o [deltaone] \\\\ / \n | 35 o---------x 13/92/36 \n L [megacorp] 33 / / \\\\ \n | o------------o 34 / \\\\ \n (29) | / [carmichael sec.] D \\\\ \n o-----+-----x------o / O [rothman university] \n | 31 32 [nsa] M \n | / \n B [blade industries] H \n | / [four sigma] \n | [joe's guns] / \n | / \n 85 o--G--------K--------S-------o 88 [the slums] R \n \n [foodnstuff] [travel agency] `;\nCities[CityName.Volhaven].asciiArt = `\n [omnia cybersystems] \n 17 66 68 \n o o------G-------o \n \\\\ / \\\\ \n \\\\ o 65 o 69 \n [syscore sec.] H | | \n \\\\ | | [millenium fitness gym] \n \\\\ | 21 22 23 24 | 26 \n o----+--x--x----x---x---+-----x-------D-----o \n 19 | | 28 \n | F [omnitek inc.] \n [hospital] J 63 o \n | / 72 \n 3 | 5 6 / 9 \n o--------+----x-----x----+----------M-------o \n / | | \n / 61 x [helios labs] B [world stock exchange] \n [travel agency] L | | \n / | o \n / E [nwo] / 75 \n / [computek] | / \n / A-------o------I-----o \n 1 o | | \n | [zb] o 77 \n [lexocorp] C \n | \n o \n 57 \n \n \n [the slums] K `;\n\n// Then construct all locations, and add them to the cities as we go.\nfor (const metadata of LocationsMetadata) {\n const loc = constructLocation(metadata);\n\n const cityName = loc.city;\n if (cityName === null) {\n // Generic location, add to all cities\n for (const city of Object.keys(Cities)) {\n Cities[city].addLocation(loc.name);\n }\n } else {\n Cities[cityName].addLocation(loc.name);\n }\n}\n","/**\n * Class representing a script file.\n *\n * This does NOT represent a script that is actively running and\n * being evaluated. See RunningScript for that\n */\nimport { calculateRamUsage, RamUsageEntry } from \"./RamCalculations\";\nimport { ScriptUrl } from \"./ScriptUrl\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { roundToTwo } from \"../utils/helpers/roundToTwo\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nlet globalModuleSequenceNumber = 0;\n\ninterface ScriptReference {\n filename: string;\n server: string;\n}\n\nexport class Script {\n // Code for this script\n code = \"\";\n\n // Filename for the script file\n filename = \"\";\n\n // url of the script if any, only for NS2.\n url = \"\";\n\n // The dynamic module generated for this script when it is run.\n // This is only applicable for NetscriptJS\n module: any = \"\";\n\n // The timestamp when when the script was last updated.\n moduleSequenceNumber: number;\n\n // Only used with NS2 scripts; the list of dependency script filenames. This is constructed\n // whenever the script is first evaluated, and therefore may be out of date if the script\n // has been updated since it was last run.\n dependencies: ScriptUrl[] = [];\n dependents: ScriptReference[] = [];\n\n // Amount of RAM this Script requres to run\n ramUsage = 0;\n ramUsageEntries?: RamUsageEntry[];\n\n // hostname of server that this script is on.\n server = \"\";\n\n constructor(player: IPlayer | null = null, fn = \"\", code = \"\", server = \"\", otherScripts: Script[] = []) {\n this.filename = fn;\n this.code = code;\n this.ramUsage = 0;\n this.server = server; // hostname of server this script is on\n this.module = \"\";\n this.moduleSequenceNumber = ++globalModuleSequenceNumber;\n if (this.code !== \"\" && player !== null) {\n this.updateRamUsage(player, otherScripts);\n }\n }\n\n /**\n * Download the script as a file\n */\n download(): void {\n const filename = this.filename;\n const file = new Blob([this.code], { type: \"text/plain\" });\n const navigator = window.navigator as any;\n if (navigator.msSaveOrOpenBlob) {\n // IE10+\n navigator.msSaveOrOpenBlob(file, filename);\n } else {\n // Others\n const a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n }\n\n /**\n * Marks this script as having been updated. It will be recompiled next time something tries\n * to exec it.\n */\n markUpdated(): void {\n this.module = \"\";\n this.moduleSequenceNumber = ++globalModuleSequenceNumber;\n }\n\n /**\n * Save a script from the script editor\n * @param {string} code - The new contents of the script\n * @param {Script[]} otherScripts - Other scripts on the server. Used to process imports\n */\n saveScript(player: IPlayer, filename: string, code: string, hostname: string, otherScripts: Script[]): void {\n // Update code and filename\n this.code = Script.formatCode(code);\n\n this.filename = filename;\n this.server = hostname;\n this.updateRamUsage(player, otherScripts);\n this.markUpdated();\n for (const dependent of this.dependents) {\n const [dependentScript] = otherScripts.filter(\n (s) => s.filename === dependent.filename && s.server == dependent.server,\n );\n if (dependentScript !== null) dependentScript.markUpdated();\n }\n }\n\n /**\n * Calculates and updates the script's RAM usage based on its code\n * @param {Script[]} otherScripts - Other scripts on the server. Used to process imports\n */\n async updateRamUsage(player: IPlayer, otherScripts: Script[]): Promise<void> {\n const res = await calculateRamUsage(player, this.code, otherScripts);\n if (res.cost > 0) {\n this.ramUsage = roundToTwo(res.cost);\n this.ramUsageEntries = res.entries;\n }\n this.markUpdated();\n }\n\n imports(): string[] {\n return [];\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): any {\n return Generic_toJSON(\"Script\", this);\n }\n\n // Initializes a Script Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Script {\n const s = Generic_fromJSON(Script, value.data);\n // Force the url to blank from the save data. Urls are not valid outside the current browser page load.\n s.url = \"\";\n s.dependents = [];\n return s;\n }\n\n /**\n * Formats code: Removes the starting & trailing whitespace\n * @param {string} code - The code to format\n * @returns The formatted code\n */\n static formatCode(code: string): string {\n return code.replace(/^\\s+|\\s+$/g, \"\");\n }\n}\n\nReviver.constructors.Script = Script;\n","/**\n * Returns the input array as a comma separated string.\n *\n * Does several things that Array.toString() doesn't do\n * - Adds brackets around the array\n * - Adds quotation marks around strings\n */\nexport function arrayToString<T>(a: T[]): string {\n const vals: any[] = [];\n for (let i = 0; i < a.length; ++i) {\n let elem: any = a[i];\n if (Array.isArray(elem)) {\n elem = arrayToString(elem);\n } else if (typeof elem === \"string\") {\n elem = `\"${elem}\"`;\n }\n vals.push(elem);\n }\n\n return `[${vals.join(\", \")}]`;\n}\n","import { Action } from \"./Action\";\nimport { IMap } from \"../types\";\n\nexport const GeneralActions: IMap<Action> = {};\n\nconst actionNames : Array<string> = [\n \"Training\",\n \"Field Analysis\",\n \"Recruitment\",\n \"Diplomacy\",\n \"Hyperbolic Regeneration Chamber\",\n \"Incite Violence\"\n];\n\nfor (const actionName of actionNames){\n GeneralActions[actionName] = new Action({\n name: actionName,\n });\n}","// Enum values are lowercased to match css classes\nexport enum Suit {\n Clubs = \"clubs\",\n Diamonds = \"diamonds\",\n Hearts = \"hearts\",\n Spades = \"spades\",\n}\n\nexport class Card {\n constructor(readonly value: number, readonly suit: Suit) {\n if (value < 1 || value > 13) {\n throw new Error(`Card instantiated with improper value: ${value}`);\n }\n }\n\n formatValue(): string {\n switch (this.value) {\n case 1:\n return \"A\";\n case 11:\n return \"J\";\n case 12:\n return \"Q\";\n case 13:\n return \"K\";\n default:\n return `${this.value}`;\n }\n }\n\n isRedSuit(): boolean {\n return this.suit === Suit.Hearts || this.suit === Suit.Diamonds;\n }\n\n getStringRepresentation(): string {\n const value = this.formatValue();\n\n return `${value} of ${this.suit}`;\n }\n}\n","import { IActionIdentifier } from \"./IActionIdentifier\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\ninterface IParams {\n name?: string;\n type?: number;\n}\n\nexport class ActionIdentifier implements IActionIdentifier {\n name = \"\";\n type = -1;\n\n constructor(params: IParams = {}) {\n if (params.name) this.name = params.name;\n if (params.type) this.type = params.type;\n }\n\n toJSON(): any {\n return Generic_toJSON(\"ActionIdentifier\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): ActionIdentifier {\n return Generic_fromJSON(ActionIdentifier, value.data);\n }\n}\n\nReviver.constructors.ActionIdentifier = ActionIdentifier;\n","import { BitNodes } from \"../BitNode/BitNode\";\n\nexport class SourceFile {\n info: JSX.Element;\n lvl = 1;\n n: number;\n name: string;\n owned = false;\n\n constructor(number: number, info: JSX.Element) {\n const bitnodeKey = \"BitNode\" + number;\n const bitnode = BitNodes[bitnodeKey];\n if (bitnode == null) {\n throw new Error(\"Invalid Bit Node for this Source File\");\n }\n\n this.n = number;\n this.name = `Source-File ${number}: ${bitnode.name}`;\n this.info = info;\n }\n}\n","export function random(min: number, max: number): number {\n return Math.random() * (max - min) + min;\n}\n\nexport function getArrow(event: KeyboardEvent): string {\n switch (event.key) {\n case \"ArrowUp\":\n case \"w\":\n return \"↑\";\n case \"ArrowLeft\":\n case \"a\":\n return \"←\";\n case \"ArrowDown\":\n case \"s\":\n return \"↓\";\n case \"ArrowRight\":\n case \"d\":\n return \"→\";\n }\n return \"\";\n}\n","import React from 'react';\nimport { MathJax, MathJaxContext } from \"better-react-mathjax\";\n\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport function MathJaxWrapper({ children }: IProps): React.ReactElement {\n return (\n <MathJaxContext version={3} src={\"dist/ext/MathJax-3.2.0/es5/tex-chtml.js\"}>\n <MathJax>{children}</MathJax>\n </MathJaxContext>\n )\n}\n","import { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\ninterface IError {\n fileName?: string;\n lineNumber?: number;\n}\n\nexport function exceptionAlert(e: IError | string): void {\n console.error(e);\n dialogBoxCreate(\n \"Caught an exception: \" +\n e +\n \"<br><br>\" +\n \"Filename: \" +\n ((e as any).fileName || \"UNKNOWN FILE NAME\") +\n \"<br><br>\" +\n \"Line Number: \" +\n ((e as any).lineNumber || \"UNKNOWN LINE NUMBER\") +\n \"<br><br>\" +\n \"This is a bug, please report to game developer with this \" +\n \"message as well as details about how to reproduce the bug.<br><br>\" +\n \"If you want to be safe, I suggest refreshing the game WITHOUT saving so that your \" +\n \"safe doesn't get corrupted\",\n );\n}\n","import { Message } from \"./Message\";\nimport { Augmentations } from \"../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { Programs } from \"../Programs/Programs\";\nimport { Player } from \"../Player\";\nimport { redPillFlag } from \"../RedPill\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { Settings } from \"../Settings/Settings\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver } from \"../utils/JSONReviver\";\n\n//Sends message to player, including a pop up\nfunction sendMessage(msg: Message, forced = false): void {\n msg.recvd = true;\n if (forced || !Settings.SuppressMessages) {\n showMessage(msg.filename);\n }\n addMessageToServer(msg, \"home\");\n}\n\nfunction showMessage(name: string): void {\n const msg = Messages[name];\n if (!msg) throw new Error(\"trying to display unexistent message\");\n const txt =\n \"Message received from unknown sender: <br><br>\" +\n \"<i>\" +\n msg.msg +\n \"</i><br><br>\" +\n \"This message was saved as \" +\n msg.filename +\n \" onto your home computer.\";\n dialogBoxCreate(txt);\n}\n\n//Adds a message to a server\nfunction addMessageToServer(msg: Message, serverHostname: string): void {\n const server = GetServer(serverHostname);\n if (server == null) {\n console.warn(`Could not find server ${serverHostname}`);\n return;\n }\n for (let i = 0; i < server.messages.length; ++i) {\n const other = server.messages[i];\n if (msg.filename === other) {\n return; //Already exists\n }\n }\n server.messages.push(msg.filename);\n}\n\n//Checks if any of the 'timed' messages should be sent\nfunction checkForMessagesToSend(): void {\n if (redPillFlag) return;\n const jumper0 = Messages[MessageFilenames.Jumper0];\n const jumper1 = Messages[MessageFilenames.Jumper1];\n const jumper2 = Messages[MessageFilenames.Jumper2];\n const jumper3 = Messages[MessageFilenames.Jumper3];\n const jumper4 = Messages[MessageFilenames.Jumper4];\n const cybersecTest = Messages[MessageFilenames.CyberSecTest];\n const nitesecTest = Messages[MessageFilenames.NiteSecTest];\n const bitrunnersTest = Messages[MessageFilenames.BitRunnersTest];\n const redpill = Messages[MessageFilenames.RedPill];\n\n let redpillOwned = false;\n if (Augmentations[AugmentationNames.TheRedPill].owned) {\n redpillOwned = true;\n }\n\n if (redpill && redpillOwned && Player.sourceFiles.length === 0 && !redPillFlag) {\n sendMessage(redpill, true);\n } else if (redpill && redpillOwned) {\n //If player has already destroyed a BitNode, message is not forced\n if (!redPillFlag) {\n sendMessage(redpill);\n }\n } else if (jumper0 && !jumper0.recvd && Player.hacking >= 25) {\n sendMessage(jumper0);\n const flightName = Programs.Flight.name;\n const homeComp = Player.getHomeComputer();\n if (!homeComp.programs.includes(flightName)) {\n homeComp.programs.push(flightName);\n }\n } else if (jumper1 && !jumper1.recvd && Player.hacking >= 40) {\n sendMessage(jumper1);\n } else if (cybersecTest && !cybersecTest.recvd && Player.hacking >= 50) {\n sendMessage(cybersecTest);\n } else if (jumper2 && !jumper2.recvd && Player.hacking >= 175) {\n sendMessage(jumper2);\n } else if (nitesecTest && !nitesecTest.recvd && Player.hacking >= 200) {\n sendMessage(nitesecTest);\n } else if (jumper3 && !jumper3.recvd && Player.hacking >= 350) {\n sendMessage(jumper3);\n } else if (jumper4 && !jumper4.recvd && Player.hacking >= 490) {\n sendMessage(jumper4);\n } else if (bitrunnersTest && !bitrunnersTest.recvd && Player.hacking >= 500) {\n sendMessage(bitrunnersTest);\n }\n}\n\nfunction AddToAllMessages(msg: Message): void {\n Messages[msg.filename] = msg;\n}\n\nlet Messages: { [key: string]: Message | undefined } = {};\n\nfunction loadMessages(saveString: string): void {\n Messages = JSON.parse(saveString, Reviver);\n}\n\nconst MessageFilenames = {\n Jumper0: \"j0.msg\",\n Jumper1: \"j1.msg\",\n Jumper2: \"j2.msg\",\n Jumper3: \"j3.msg\",\n Jumper4: \"j4.msg\",\n CyberSecTest: \"csec-test.msg\",\n NiteSecTest: \"nitesec-test.msg\",\n BitRunnersTest: \"19dfj3l1nd.msg\",\n RedPill: \"icarus.msg\",\n};\n\nfunction initMessages(): void {\n //Reset\n Messages = {};\n\n //jump3R Messages\n AddToAllMessages(\n new Message(\n MessageFilenames.Jumper0,\n \"I know you can sense it. I know you're searching for it. \" +\n \"It's why you spend night after \" +\n \"night at your computer. <br><br>It's real, I've seen it. And I can \" +\n \"help you find it. But not right now. You're not ready yet.<br><br>\" +\n \"Use this program to track your progress<br><br>\" +\n \"The fl1ght.exe program was added to your home computer<br><br>\" +\n \"-jump3R\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.Jumper1,\n \"Soon you will be contacted by a hacking group known as CyberSec. \" +\n \"They can help you with your search. <br><br>\" +\n \"You should join them, garner their favor, and \" +\n \"exploit them for their Augmentations. But do not trust them. \" +\n \"They are not what they seem. No one is.<br><br>\" +\n \"-jump3R\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.Jumper2,\n \"Do not try to save the world. There is no world to save. If \" +\n \"you want to find the truth, worry only about yourself. Ethics and \" +\n \"morals will get you killed. <br><br>Watch out for a hacking group known as NiteSec.\" +\n \"<br><br>-jump3R\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.Jumper3,\n \"You must learn to walk before you can run. And you must \" +\n \"run before you can fly. Look for the black hand. <br><br>\" +\n \"I.I.I.I <br><br>-jump3R\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.Jumper4,\n \"To find what you are searching for, you must understand the bits. \" +\n \"The bits are all around us. The runners will help you.<br><br>\" +\n \"-jump3R\",\n ),\n );\n\n //Messages from hacking factions\n AddToAllMessages(\n new Message(\n MessageFilenames.CyberSecTest,\n \"We've been watching you. Your skills are very impressive. But you're wasting \" +\n \"your talents. If you join us, you can put your skills to good use and change \" +\n \"the world for the better. If you join us, we can unlock your full potential. <br><br>\" +\n \"But first, you must pass our test. Find and install the backdoor on our server. <br><br>\" +\n \"-CyberSec\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.NiteSecTest,\n \"People say that the corrupted governments and corporations rule the world. \" +\n \"Yes, maybe they do. But do you know who everyone really fears? People \" +\n \"like us. Because they can't hide from us. Because they can't fight shadows \" +\n \"and ideas with bullets. <br><br>\" +\n \"Join us, and people will fear you, too. <br><br>\" +\n \"Find and install the backdoor on our server. Then, we will contact you again.\" +\n \"<br><br>-NiteSec\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.BitRunnersTest,\n \"We know what you are doing. We know what drives you. We know \" +\n \"what you are looking for. <br><br> \" +\n \"We can help you find the answers.<br><br>\" +\n \"run4theh111z\",\n ),\n );\n\n AddToAllMessages(\n new Message(\n MessageFilenames.RedPill,\n \"@)(#V%*N)@(#*)*C)@#%*)*V)@#(*%V@)(#VN%*)@#(*%<br>\" +\n \")@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)<br>\" +\n \"@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB<br>\" +\n \"DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)\",\n ),\n );\n}\n\nexport { Messages, checkForMessagesToSend, showMessage, loadMessages, initMessages };\n","/**\n * The worker agent for running a script instance. Each running script instance\n * has its own underlying WorkerScript object.\n *\n * Note that these objects are not saved and re-loaded when the game is refreshed.\n * Instead, whenever the game is opened, WorkerScripts are re-created from\n * RunningScript objects\n */\nimport { Environment } from \"./Environment\";\nimport { RamCostConstants } from \"./RamCostGenerator\";\n\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { Script } from \"../Script/Script\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { IMap } from \"../types\";\n\nexport class WorkerScript {\n /**\n * Script's arguments\n */\n args: any[];\n\n /**\n * Copy of the script's code\n */\n code = \"\";\n\n /**\n * Holds the timeoutID (numeric value) for whenever this script is blocked by a\n * timed Netscript function. i.e. Holds the return value of setTimeout()\n */\n delay: number | null = null;\n\n /**\n * Holds the Promise reject() function while the script is \"blocked\" by an async op\n */\n delayReject?: (reason?: any) => void;\n\n /**\n * Stores names of all functions that have logging disabled\n */\n disableLogs: IMap<boolean> = {};\n\n /**\n * Used for dynamic RAM calculation. Stores names of all functions that have\n * already been checked by this script.\n * TODO: Could probably just combine this with loadedFns?\n */\n dynamicLoadedFns: IMap<boolean> = {};\n\n /**\n * Tracks dynamic RAM usage\n */\n dynamicRamUsage: number = RamCostConstants.ScriptBaseRamCost;\n\n /**\n * Netscript Environment for this script\n */\n env: Environment;\n\n /**\n * Status message in case of script error. Currently unused I think\n */\n errorMessage = \"\";\n\n /**\n * Used for static RAM calculation. Stores names of all functions that have\n * already been checked by this script\n */\n loadedFns: IMap<boolean> = {};\n\n /**\n * Filename of script\n */\n name: string;\n\n /**\n * Script's output/return value. Currently not used or implemented\n */\n output = \"\";\n\n /**\n * Process ID. Must be an integer. Used for efficient script\n * killing and removal.\n */\n pid: number;\n\n /**\n * Script's Static RAM usage. Equivalent to underlying script's RAM usage\n */\n ramUsage = 0;\n\n /**\n * Whether or not this workerScript is currently running\n */\n running = false;\n\n /**\n * Reference to underlying RunningScript object\n */\n scriptRef: RunningScript;\n\n /**\n * IP Address on which this script is running\n */\n hostname: string;\n\n /**\n * Function called when the script ends.\n */\n atExit: any;\n\n constructor(runningScriptObj: RunningScript, pid: number, nsFuncsGenerator?: (ws: WorkerScript) => any) {\n this.name = runningScriptObj.filename;\n this.hostname = runningScriptObj.server;\n\n const sanitizedPid = Math.round(pid);\n if (typeof sanitizedPid !== \"number\" || isNaN(sanitizedPid)) {\n throw new Error(`Invalid PID when constructing WorkerScript: ${pid}`);\n }\n this.pid = sanitizedPid;\n runningScriptObj.pid = sanitizedPid;\n\n // Get the underlying script's code\n const server = GetServer(this.hostname);\n if (server == null) {\n throw new Error(`WorkerScript constructed with invalid server ip: ${this.hostname}`);\n }\n let found = false;\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === this.name) {\n found = true;\n this.code = server.scripts[i].code;\n }\n }\n if (!found) {\n throw new Error(`WorkerScript constructed with invalid script filename: ${this.name}`);\n }\n this.scriptRef = runningScriptObj;\n this.args = runningScriptObj.args.slice();\n this.env = new Environment(null);\n if (typeof nsFuncsGenerator === \"function\") {\n this.env.vars = nsFuncsGenerator(this);\n }\n this.env.set(\"args\", runningScriptObj.args.slice());\n }\n\n /**\n * Returns the Server on which this script is running\n */\n getServer(): BaseServer {\n const server = GetServer(this.hostname);\n if (server == null) throw new Error(`Script ${this.name} pid ${this.pid} is running on non-existent server?`);\n return server;\n }\n\n /**\n * Returns the Script object for the underlying script.\n * Returns null if it cannot be found (which would be a bug)\n */\n getScript(): Script | null {\n const server = this.getServer();\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === this.name) {\n return server.scripts[i];\n }\n }\n\n console.error(\n \"Failed to find underlying Script object in WorkerScript.getScript(). This probably means somethings wrong\",\n );\n return null;\n }\n\n /**\n * Returns the script with the specified filename on the specified server,\n * or null if it cannot be found\n */\n getScriptOnServer(fn: string, server: BaseServer): Script | null {\n if (server == null) {\n server = this.getServer();\n }\n\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === fn) {\n return server.scripts[i];\n }\n }\n\n return null;\n }\n\n shouldLog(fn: string): boolean {\n return this.disableLogs[fn] == null;\n }\n\n log(func: string, txt: () => string): void {\n if (this.shouldLog(func)) {\n if (func && txt) {\n this.scriptRef.log(`${func}: ${txt()}`);\n } else if (func) {\n this.scriptRef.log(func);\n } else {\n this.scriptRef.log(txt());\n }\n }\n }\n\n print(txt: string): void {\n this.scriptRef.log(txt);\n }\n}\n","import { BlackOperation } from \"./BlackOperation\";\nimport { IMap } from \"../types\";\n\nexport const BlackOperations: IMap<BlackOperation> = {};\n\n(function () {\n BlackOperations[\"Operation Typhoon\"] = new BlackOperation({\n name: \"Operation Typhoon\",\n baseDifficulty: 2000,\n reqdRank: 2.5e3,\n rankGain: 50,\n rankLoss: 10,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Zero\"] = new BlackOperation({\n name: \"Operation Zero\",\n baseDifficulty: 2500,\n reqdRank: 5e3,\n rankGain: 60,\n rankLoss: 15,\n hpLoss: 50,\n weights: {\n hack: 0.2,\n str: 0.15,\n def: 0.15,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[\"Operation X\"] = new BlackOperation({\n name: \"Operation X\",\n baseDifficulty: 3000,\n reqdRank: 7.5e3,\n rankGain: 75,\n rankLoss: 15,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Titan\"] = new BlackOperation({\n name: \"Operation Titan\",\n baseDifficulty: 4000,\n reqdRank: 10e3,\n rankGain: 100,\n rankLoss: 20,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Ares\"] = new BlackOperation({\n name: \"Operation Ares\",\n baseDifficulty: 5000,\n reqdRank: 12.5e3,\n rankGain: 125,\n rankLoss: 20,\n hpLoss: 200,\n weights: {\n hack: 0,\n str: 0.25,\n def: 0.25,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Archangel\"] = new BlackOperation({\n name: \"Operation Archangel\",\n baseDifficulty: 7500,\n reqdRank: 15e3,\n rankGain: 200,\n rankLoss: 20,\n hpLoss: 25,\n weights: {\n hack: 0,\n str: 0.2,\n def: 0.2,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Juggernaut\"] = new BlackOperation({\n name: \"Operation Juggernaut\",\n baseDifficulty: 10e3,\n reqdRank: 20e3,\n rankGain: 300,\n rankLoss: 40,\n hpLoss: 300,\n weights: {\n hack: 0,\n str: 0.25,\n def: 0.25,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Red Dragon\"] = new BlackOperation({\n name: \"Operation Red Dragon\",\n baseDifficulty: 12.5e3,\n reqdRank: 25e3,\n rankGain: 500,\n rankLoss: 50,\n hpLoss: 500,\n weights: {\n hack: 0.05,\n str: 0.2,\n def: 0.2,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation K\"] = new BlackOperation({\n name: \"Operation K\",\n baseDifficulty: 15e3,\n reqdRank: 30e3,\n rankGain: 750,\n rankLoss: 60,\n hpLoss: 1000,\n weights: {\n hack: 0.05,\n str: 0.2,\n def: 0.2,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Deckard\"] = new BlackOperation({\n name: \"Operation Deckard\",\n baseDifficulty: 20e3,\n reqdRank: 40e3,\n rankGain: 1e3,\n rankLoss: 75,\n hpLoss: 200,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Tyrell\"] = new BlackOperation({\n name: \"Operation Tyrell\",\n baseDifficulty: 25e3,\n reqdRank: 50e3,\n rankGain: 1.5e3,\n rankLoss: 100,\n hpLoss: 500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Wallace\"] = new BlackOperation({\n name: \"Operation Wallace\",\n baseDifficulty: 30e3,\n reqdRank: 75e3,\n rankGain: 2e3,\n rankLoss: 150,\n hpLoss: 1500,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Shoulder of Orion\"] = new BlackOperation({\n name: \"Operation Shoulder of Orion\",\n baseDifficulty: 35e3,\n reqdRank: 100e3,\n rankGain: 2.5e3,\n rankLoss: 500,\n hpLoss: 1500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[\"Operation Hyron\"] = new BlackOperation({\n name: \"Operation Hyron\",\n baseDifficulty: 40e3,\n reqdRank: 125e3,\n rankGain: 3e3,\n rankLoss: 1e3,\n hpLoss: 500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Morpheus\"] = new BlackOperation({\n name: \"Operation Morpheus\",\n baseDifficulty: 45e3,\n reqdRank: 150e3,\n rankGain: 4e3,\n rankLoss: 1e3,\n hpLoss: 100,\n weights: {\n hack: 0.05,\n str: 0.15,\n def: 0.15,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[\"Operation Ion Storm\"] = new BlackOperation({\n name: \"Operation Ion Storm\",\n baseDifficulty: 50e3,\n reqdRank: 175e3,\n rankGain: 5e3,\n rankLoss: 1e3,\n hpLoss: 5000,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Annihilus\"] = new BlackOperation({\n name: \"Operation Annihilus\",\n baseDifficulty: 55e3,\n reqdRank: 200e3,\n rankGain: 7.5e3,\n rankLoss: 1e3,\n hpLoss: 10e3,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Ultron\"] = new BlackOperation({\n name: \"Operation Ultron\",\n baseDifficulty: 60e3,\n reqdRank: 250e3,\n rankGain: 10e3,\n rankLoss: 2e3,\n hpLoss: 10e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Centurion\"] = new BlackOperation({\n name: \"Operation Centurion\",\n baseDifficulty: 70e3,\n reqdRank: 300e3,\n rankGain: 15e3,\n rankLoss: 5e3,\n hpLoss: 10e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n BlackOperations[\"Operation Vindictus\"] = new BlackOperation({\n name: \"Operation Vindictus\",\n baseDifficulty: 75e3,\n reqdRank: 350e3,\n rankGain: 20e3,\n rankLoss: 20e3,\n hpLoss: 20e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n BlackOperations[\"Operation Daedalus\"] = new BlackOperation({\n name: \"Operation Daedalus\",\n baseDifficulty: 80e3,\n reqdRank: 400e3,\n rankGain: 40e3,\n rankLoss: 10e3,\n hpLoss: 100e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n})();\n","import { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IPlayerOrSleeve } from \"../PersonObjects/IPlayerOrSleeve\";\nimport { IRouter } from \"../ui/Router\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\n\ninterface IConstructorParams {\n hacking_success_weight?: number;\n strength_success_weight?: number;\n defense_success_weight?: number;\n dexterity_success_weight?: number;\n agility_success_weight?: number;\n charisma_success_weight?: number;\n hacking_exp?: number;\n strength_exp?: number;\n defense_exp?: number;\n dexterity_exp?: number;\n agility_exp?: number;\n charisma_exp?: number;\n intelligence_exp?: number;\n\n kills?: number;\n}\n\nexport class Crime {\n // Number representing the difficulty of the crime. Used for success chance calculations\n difficulty = 0;\n\n // Amount of karma lost for SUCCESSFULLY committing this crime\n karma = 0;\n\n // How many people die as a result of this crime\n kills = 0;\n\n // How much money is given by the\n money = 0;\n\n // Name of crime\n name = \"\";\n\n // Milliseconds it takes to attempt the crime\n time = 0;\n\n // Corresponding type in CONSTANTS. Contains a description for the crime activity\n type = \"\";\n\n // Weighting factors that determine how stats affect the success rate of this crime\n hacking_success_weight = 0;\n strength_success_weight = 0;\n defense_success_weight = 0;\n dexterity_success_weight = 0;\n agility_success_weight = 0;\n charisma_success_weight = 0;\n\n // How much stat experience is granted by this crime\n hacking_exp = 0;\n strength_exp = 0;\n defense_exp = 0;\n dexterity_exp = 0;\n agility_exp = 0;\n charisma_exp = 0;\n intelligence_exp = 0;\n\n constructor(name = \"\", type = \"\", time = 0, money = 0, difficulty = 0, karma = 0, params: IConstructorParams = {}) {\n this.name = name;\n this.type = type;\n this.time = time;\n this.money = money;\n this.difficulty = difficulty;\n this.karma = karma;\n\n this.hacking_success_weight = params.hacking_success_weight ? params.hacking_success_weight : 0;\n this.strength_success_weight = params.strength_success_weight ? params.strength_success_weight : 0;\n this.defense_success_weight = params.defense_success_weight ? params.defense_success_weight : 0;\n this.dexterity_success_weight = params.dexterity_success_weight ? params.dexterity_success_weight : 0;\n this.agility_success_weight = params.agility_success_weight ? params.agility_success_weight : 0;\n this.charisma_success_weight = params.charisma_success_weight ? params.charisma_success_weight : 0;\n\n this.hacking_exp = params.hacking_exp ? params.hacking_exp : 0;\n this.strength_exp = params.strength_exp ? params.strength_exp : 0;\n this.defense_exp = params.defense_exp ? params.defense_exp : 0;\n this.dexterity_exp = params.dexterity_exp ? params.dexterity_exp : 0;\n this.agility_exp = params.agility_exp ? params.agility_exp : 0;\n this.charisma_exp = params.charisma_exp ? params.charisma_exp : 0;\n this.intelligence_exp = params.intelligence_exp ? params.intelligence_exp : 0;\n\n this.kills = params.kills ? params.kills : 0;\n }\n\n commit(router: IRouter, p: IPlayer, div = 1, workerScript: WorkerScript | null = null): number {\n if (div <= 0) {\n div = 1;\n }\n p.startCrime(\n router,\n this.type,\n this.hacking_exp / div,\n this.strength_exp / div,\n this.defense_exp / div,\n this.dexterity_exp / div,\n this.agility_exp / div,\n this.charisma_exp / div,\n this.money / div,\n this.time,\n workerScript,\n );\n\n return this.time;\n }\n\n successRate(p: IPlayerOrSleeve): number {\n let chance: number =\n this.hacking_success_weight * p.hacking +\n this.strength_success_weight * p.strength +\n this.defense_success_weight * p.defense +\n this.dexterity_success_weight * p.dexterity +\n this.agility_success_weight * p.agility +\n this.charisma_success_weight * p.charisma +\n CONSTANTS.IntelligenceCrimeWeight * p.intelligence;\n chance /= CONSTANTS.MaxSkillLevel;\n chance /= this.difficulty;\n chance *= p.crime_success_mult;\n chance *= p.getIntelligenceBonus(1);\n\n return Math.min(chance, 1);\n }\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n onConfirm: () => void;\n confirmationText: string | React.ReactNode;\n additionalButton?: React.ReactNode;\n}\n\nexport function ConfirmationModal(props: IProps): React.ReactElement {\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>{props.confirmationText}</Typography>\n <Button\n onClick={() => {\n props.onConfirm();\n }}\n >\n Confirm\n </Button>\n {props.additionalButton && <>{props.additionalButton}</>}\n </>\n </Modal>\n );\n}\n","export function calculateIntelligenceBonus(intelligence: number, weight = 1): number {\n return 1 + (weight * Math.pow(intelligence, 0.8)) / 600;\n}\n","// The Research Map is an object that holds all Corporation Research objects\n// as values. They are identified by their names\nimport { Research, IConstructorParams } from \"./Research\";\nimport { researchMetadata } from \"./data/ResearchMetadata\";\nimport { IMap } from \"../types\";\n\nexport const ResearchMap: IMap<Research> = {};\n\nfunction addResearch(p: IConstructorParams): void {\n if (ResearchMap[p.name] != null) {\n console.warn(`Duplicate Research being defined: ${p.name}`);\n }\n ResearchMap[p.name] = new Research(p);\n}\n\nfor (const metadata of researchMetadata) {\n addResearch(metadata);\n}\n","import { DarkWebItem } from \"./DarkWebItem\";\nimport { IMap } from \"../types\";\nimport { Programs } from \"../Programs/Programs\";\n\nexport const DarkWebItems: IMap<DarkWebItem> = {\n BruteSSHProgram: new DarkWebItem(Programs.BruteSSHProgram.name, 500e3, \"Opens up SSH Ports.\"),\n FTPCrackProgram: new DarkWebItem(Programs.FTPCrackProgram.name, 1500e3, \"Opens up FTP Ports.\"),\n RelaySMTPProgram: new DarkWebItem(Programs.RelaySMTPProgram.name, 5e6, \"Opens up SMTP Ports.\"),\n HTTPWormProgram: new DarkWebItem(Programs.HTTPWormProgram.name, 30e6, \"Opens up HTTP Ports.\"),\n SQLInjectProgram: new DarkWebItem(Programs.SQLInjectProgram.name, 250e6, \"Opens up SQL Ports.\"),\n ServerProfiler: new DarkWebItem(\n Programs.ServerProfiler.name,\n 500000,\n \"Displays detailed information about a server.\",\n ),\n DeepscanV1: new DarkWebItem(Programs.DeepscanV1.name, 500000, \"Enables 'scan-analyze' with a depth up to 5.\"),\n DeepscanV2: new DarkWebItem(Programs.DeepscanV2.name, 25e6, \"Enables 'scan-analyze' with a depth up to 10.\"),\n AutolinkProgram: new DarkWebItem(Programs.AutoLink.name, 1e6, \"Enables direct connect via 'scan-analyze'.\"),\n FormulasProgram: new DarkWebItem(Programs.Formulas.name, 5e9, \"Unlock access to the formulas API.\"),\n};\n","import { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\n\nexport function getStockMarket4SDataCost(): number {\n return CONSTANTS.MarketData4SCost * BitNodeMultipliers.FourSigmaMarketDataCost;\n}\n\nexport function getStockMarket4STixApiCost(): number {\n return CONSTANTS.MarketDataTixApi4SCost * BitNodeMultipliers.FourSigmaMarketDataApiCost;\n}\n","/**\n * React Component for a button that's used to apply for a job\n */\nimport * as React from \"react\";\n\nimport { Company } from \"../../Company/Company\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { getJobRequirementText } from \"../../Company/GetJobRequirementText\";\n\nimport { use } from \"../../ui/Context\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ntype IProps = {\n company: Company;\n entryPosType: CompanyPosition;\n onClick: (e: React.MouseEvent<HTMLElement>) => void;\n text: string;\n};\n\nexport function ApplyToJobButton(props: IProps): React.ReactElement {\n const player = use.Player();\n\n function getJobRequirementTooltip(): string {\n const pos = player.getNextCompanyPosition(props.company, props.entryPosType);\n if (pos == null) {\n return \"\";\n }\n\n if (!props.company.hasPosition(pos)) {\n return \"\";\n }\n\n return getJobRequirementText(props.company, pos, true);\n }\n\n return (\n <>\n <Tooltip title={<span dangerouslySetInnerHTML={{ __html: getJobRequirementTooltip() }}></span>}>\n <Button onClick={props.onClick}>{props.text}</Button>\n </Tooltip>\n </>\n );\n}\n","/**\n * Event emitter that triggers when scripts are started/stopped\n */\nimport { EventEmitter } from \"../utils/EventEmitter\";\n\nexport const WorkerScriptStartStopEventEmitter = new EventEmitter<[]>();\n","import { Player } from \"./Player\";\nimport { Router } from \"./ui/GameRoot\";\nimport { isScriptFilename } from \"./Script/isScriptFilename\";\nimport { Script } from \"./Script/Script\";\nimport { removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { Terminal } from \"./Terminal\";\nimport { SnackbarEvents } from \"./ui/React/Snackbar\";\nimport { IMap, IReturnStatus } from \"./types\";\nimport { GetServer } from \"./Server/AllServers\";\nimport { resolve } from \"cypress/types/bluebird\";\nimport { ImportPlayerData, SaveData, saveObject } from \"./SaveObject\";\nimport { Settings } from \"./Settings/Settings\";\nimport { exportScripts } from \"./Terminal/commands/download\";\nimport { CONSTANTS } from \"./Constants\";\nimport { hash } from \"./hash/hash\";\n\nexport function initElectron(): void {\n const userAgent = navigator.userAgent.toLowerCase();\n if (userAgent.indexOf(\" electron/\") > -1) {\n // Electron-specific code\n (document as any).achievements = [];\n initWebserver();\n initAppNotifier();\n initSaveFunctions();\n initElectronBridge();\n }\n}\n\nfunction initWebserver(): void {\n interface IReturnWebStatus extends IReturnStatus {\n data?: {\n [propName: string]: any;\n };\n }\n function normalizeFileName(filename: string): string {\n filename = filename.replace(/\\/\\/+/g, \"/\");\n filename = removeLeadingSlash(filename);\n if (filename.includes(\"/\")) {\n filename = \"/\" + removeLeadingSlash(filename);\n }\n return filename;\n }\n\n (document as any).getFiles = function (): IReturnWebStatus {\n const home = GetServer(\"home\");\n if (home === null) {\n return {\n res: false,\n msg: \"Home server does not exist.\",\n };\n }\n return {\n res: true,\n data: {\n files: home.scripts.map((script) => ({\n filename: script.filename,\n code: script.code,\n ramUsage: script.ramUsage,\n })),\n },\n };\n };\n\n (document as any).deleteFile = function (filename: string): IReturnWebStatus {\n filename = normalizeFileName(filename);\n const home = GetServer(\"home\");\n if (home === null) {\n return {\n res: false,\n msg: \"Home server does not exist.\",\n };\n }\n return home.removeFile(filename);\n };\n\n (document as any).saveFile = function (filename: string, code: string): IReturnWebStatus {\n filename = normalizeFileName(filename);\n\n code = Buffer.from(code, \"base64\").toString();\n const home = GetServer(\"home\");\n if (home === null) {\n return {\n res: false,\n msg: \"Home server does not exist.\",\n };\n }\n const { success, overwritten } = home.writeToScriptFile(Player, filename, code);\n let script;\n if (success) {\n script = home.getScript(filename);\n }\n return {\n res: success,\n data: {\n overwritten,\n ramUsage: script?.ramUsage,\n },\n };\n };\n}\n\n// Expose certain alert functions to allow the wrapper to sends message to the game\nfunction initAppNotifier(): void {\n const funcs = {\n terminal: (message: string, type?: string) => {\n const typesFn: IMap<(s: string) => void> = {\n info: Terminal.info,\n warn: Terminal.warn,\n error: Terminal.error,\n success: Terminal.success,\n };\n let fn;\n if (type) fn = typesFn[type];\n if (!fn) fn = Terminal.print;\n fn.bind(Terminal)(message);\n },\n toast: (message: string, type: \"info\" | \"success\" | \"warning\" | \"error\", duration = 2000) =>\n SnackbarEvents.emit(message, type, duration),\n };\n\n // Will be consumud by the electron wrapper.\n (window as any).appNotifier = funcs;\n}\n\nfunction initSaveFunctions(): void {\n const funcs = {\n triggerSave: (): Promise<void> => saveObject.saveGame(true),\n triggerGameExport: (): void => {\n try {\n saveObject.exportGame();\n } catch (error) {\n console.log(error);\n SnackbarEvents.emit(\"Could not export game.\", \"error\", 2000);\n }\n },\n triggerScriptsExport: (): void => exportScripts(\"*\", Player.getHomeComputer()),\n getSaveData: (): { save: string; fileName: string } => {\n return {\n save: saveObject.getSaveString(Settings.ExcludeRunningScriptsFromSave),\n fileName: saveObject.getSaveFileName(),\n };\n },\n getSaveInfo: async (base64save: string): Promise<ImportPlayerData | undefined> => {\n try {\n const data = await saveObject.getImportDataFromString(base64save);\n return data.playerData;\n } catch (error) {\n console.error(error);\n return;\n }\n },\n pushSaveData: (base64save: string, automatic = false): void => Router.toImportSave(base64save, automatic),\n };\n\n // Will be consumud by the electron wrapper.\n (window as any).appSaveFns = funcs;\n}\n\nfunction initElectronBridge(): void {\n const bridge = (window as any).electronBridge as any;\n if (!bridge) return;\n\n bridge.receive(\"get-save-data-request\", () => {\n const data = (window as any).appSaveFns.getSaveData();\n bridge.send(\"get-save-data-response\", data);\n });\n bridge.receive(\"get-save-info-request\", async (save: string) => {\n const data = await (window as any).appSaveFns.getSaveInfo(save);\n bridge.send(\"get-save-info-response\", data);\n });\n bridge.receive(\"push-save-request\", ({ save, automatic = false }: { save: string; automatic: boolean }) => {\n (window as any).appSaveFns.pushSaveData(save, automatic);\n });\n bridge.receive(\"trigger-save\", () => {\n return (window as any).appSaveFns\n .triggerSave()\n .then(() => {\n bridge.send(\"save-completed\");\n })\n .catch((error: any) => {\n console.log(error);\n SnackbarEvents.emit(\"Could not save game.\", \"error\", 2000);\n });\n });\n bridge.receive(\"trigger-game-export\", () => {\n try {\n (window as any).appSaveFns.triggerGameExport();\n } catch (error) {\n console.log(error);\n SnackbarEvents.emit(\"Could not export game.\", \"error\", 2000);\n }\n });\n bridge.receive(\"trigger-scripts-export\", () => {\n try {\n (window as any).appSaveFns.triggerScriptsExport();\n } catch (error) {\n console.log(error);\n SnackbarEvents.emit(\"Could not export scripts.\", \"error\", 2000);\n }\n });\n}\n\nexport function pushGameSaved(data: SaveData): void {\n const bridge = (window as any).electronBridge as any;\n if (!bridge) return;\n\n bridge.send(\"push-game-saved\", data);\n}\n\nexport function pushGameReady(): void {\n const bridge = (window as any).electronBridge as any;\n if (!bridge) return;\n\n // Send basic information to the electron wrapper\n bridge.send(\"push-game-ready\", {\n player: {\n identifier: Player.identifier,\n playtime: Player.totalPlaytime,\n lastSave: Player.lastSave,\n },\n game: {\n version: CONSTANTS.VersionString,\n hash: hash(),\n },\n });\n}\n\nexport function pushImportResult(wasImported: boolean): void {\n const bridge = (window as any).electronBridge as any;\n if (!bridge) return;\n\n bridge.send(\"push-import-result\", { wasImported });\n pushDisableRestore();\n}\n\nexport function pushDisableRestore(): void {\n const bridge = (window as any).electronBridge as any;\n if (!bridge) return;\n\n bridge.send(\"push-disable-restore\", { duration: 1000 * 60 });\n}\n","import { PlayerObject } from \"src/PersonObjects/Player/PlayerObject\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { SkillNames } from \"../Bladeburner/data/SkillNames\";\nimport { Skills } from \"../Bladeburner/Skills\";\nimport { CONSTANTS } from \"../Constants\";\nimport { Industries } from \"../Corporation/IndustryData\";\nimport { Exploit } from \"../Exploits/Exploit\";\nimport { Factions } from \"../Faction/Factions\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { GangConstants } from \"../Gang/data/Constants\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { hasHacknetServers } from \"../Hacknet/HacknetHelpers\";\nimport { HacknetNode } from \"../Hacknet/HacknetNode\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { Player } from \"../Player\";\nimport { Programs } from \"../Programs/Programs\";\nimport { GetAllServers, GetServer } from \"../Server/AllServers\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Server } from \"../Server/Server\";\nimport { Router } from \"../ui/GameRoot\";\nimport { Page } from \"../ui/Router\";\nimport { IMap } from \"../types\";\nimport * as data from \"./AchievementData.json\";\n\n// Unable to correctly cast the JSON data into AchievementDataJson type otherwise...\nconst achievementData = (<AchievementDataJson>(<unknown>data)).achievements;\n\nexport interface Achievement {\n ID: string;\n Icon?: string;\n Name?: string;\n Description?: string;\n Secret?: boolean;\n Condition: () => boolean;\n Visible?: () => boolean;\n AdditionalUnlock?: string[]; // IDs of achievements that should be awarded when awarding this one\n}\n\nexport interface PlayerAchievement {\n ID: string;\n unlockedOn?: number;\n}\n\nexport interface AchievementDataJson {\n achievements: IMap<AchievementData>;\n}\n\nexport interface AchievementData {\n ID: string;\n Name: string;\n Description: string;\n}\n\nfunction bitNodeFinishedState(): boolean {\n const wd = GetServer(SpecialServers.WorldDaemon);\n if (!(wd instanceof Server)) return false;\n if (wd.backdoorInstalled) return true;\n return Player.bladeburner !== null && Player.bladeburner.blackops.hasOwnProperty(\"Operation Daedalus\");\n}\n\nfunction hasAccessToSF(player: PlayerObject, bn: number): boolean {\n return player.bitNodeN === bn || player.sourceFiles.some((a) => a.n === bn);\n}\n\nfunction knowsAboutBitverse(player: PlayerObject): boolean {\n return player.sourceFiles.some((a) => a.n === 1);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction sfAchievement(): Achievement[] {\n const achs: Achievement[] = [];\n for (let i = 0; i <= 11; i++) {\n for (let j = 1; j <= 3; j++) {\n achs.push({\n ID: `SF${i}.${j}`,\n Condition: () => Player.sourceFileLvl(i) >= j,\n });\n }\n }\n return achs;\n}\n\nexport const achievements: IMap<Achievement> = {\n CYBERSEC: {\n ...achievementData[\"CYBERSEC\"],\n Icon: \"CSEC\",\n Condition: () => Player.factions.includes(\"CyberSec\"),\n },\n NITESEC: {\n ...achievementData[\"NITESEC\"],\n Icon: \"NiteSec\",\n Condition: () => Player.factions.includes(\"NiteSec\"),\n },\n THE_BLACK_HAND: {\n ...achievementData[\"THE_BLACK_HAND\"],\n Icon: \"TBH\",\n Condition: () => Player.factions.includes(\"The Black Hand\"),\n },\n BITRUNNERS: {\n ...achievementData[\"BITRUNNERS\"],\n Icon: \"bitrunners\",\n Condition: () => Player.factions.includes(\"BitRunners\"),\n },\n DAEDALUS: {\n ...achievementData[\"DAEDALUS\"],\n Icon: \"daedalus\",\n Condition: () => Player.factions.includes(\"Daedalus\"),\n },\n THE_COVENANT: {\n ...achievementData[\"THE_COVENANT\"],\n Icon: \"thecovenant\",\n Condition: () => Player.factions.includes(\"The Covenant\"),\n },\n ILLUMINATI: {\n ...achievementData[\"ILLUMINATI\"],\n Icon: \"illuminati\",\n Condition: () => Player.factions.includes(\"Illuminati\"),\n },\n \"BRUTESSH.EXE\": {\n ...achievementData[\"BRUTESSH.EXE\"],\n Icon: \"p0\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.BruteSSHProgram.name),\n },\n \"FTPCRACK.EXE\": {\n ...achievementData[\"FTPCRACK.EXE\"],\n Icon: \"p1\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.FTPCrackProgram.name),\n },\n //-----------------------------------------------------\n \"RELAYSMTP.EXE\": {\n ...achievementData[\"RELAYSMTP.EXE\"],\n Icon: \"p2\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.RelaySMTPProgram.name),\n },\n \"HTTPWORM.EXE\": {\n ...achievementData[\"HTTPWORM.EXE\"],\n Icon: \"p3\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.HTTPWormProgram.name),\n },\n \"SQLINJECT.EXE\": {\n ...achievementData[\"SQLINJECT.EXE\"],\n Icon: \"p4\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.SQLInjectProgram.name),\n },\n \"FORMULAS.EXE\": {\n ...achievementData[\"FORMULAS.EXE\"],\n Icon: \"formulas\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.Formulas.name),\n },\n \"SF1.1\": {\n ...achievementData[\"SF1.1\"],\n Icon: \"SF1.1\",\n Visible: () => hasAccessToSF(Player, 1),\n Condition: () => Player.sourceFileLvl(1) >= 1,\n },\n \"SF2.1\": {\n ...achievementData[\"SF2.1\"],\n Icon: \"SF2.1\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.sourceFileLvl(2) >= 1,\n },\n \"SF3.1\": {\n ...achievementData[\"SF3.1\"],\n Icon: \"SF3.1\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.sourceFileLvl(3) >= 1,\n },\n \"SF4.1\": {\n ...achievementData[\"SF4.1\"],\n Icon: \"SF4.1\",\n Visible: () => hasAccessToSF(Player, 4),\n Condition: () => Player.sourceFileLvl(4) >= 1,\n },\n \"SF5.1\": {\n ...achievementData[\"SF5.1\"],\n Icon: \"SF5.1\",\n Visible: () => hasAccessToSF(Player, 5),\n Condition: () => Player.sourceFileLvl(5) >= 1,\n },\n \"SF6.1\": {\n ...achievementData[\"SF6.1\"],\n Icon: \"SF6.1\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.sourceFileLvl(6) >= 1,\n },\n \"SF7.1\": {\n ...achievementData[\"SF7.1\"],\n Icon: \"SF7.1\",\n Visible: () => hasAccessToSF(Player, 7),\n Condition: () => Player.sourceFileLvl(7) >= 1,\n },\n \"SF8.1\": {\n ...achievementData[\"SF8.1\"],\n Icon: \"SF8.1\",\n Visible: () => hasAccessToSF(Player, 8),\n Condition: () => Player.sourceFileLvl(8) >= 1,\n },\n \"SF9.1\": {\n ...achievementData[\"SF9.1\"],\n Icon: \"SF9.1\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => Player.sourceFileLvl(9) >= 1,\n },\n \"SF10.1\": {\n ...achievementData[\"SF10.1\"],\n Icon: \"SF10.1\",\n Visible: () => hasAccessToSF(Player, 10),\n Condition: () => Player.sourceFileLvl(10) >= 1,\n },\n \"SF11.1\": {\n ...achievementData[\"SF11.1\"],\n Icon: \"SF11.1\",\n Visible: () => hasAccessToSF(Player, 11),\n Condition: () => Player.sourceFileLvl(11) >= 1,\n },\n \"SF12.1\": {\n ...achievementData[\"SF12.1\"],\n Icon: \"SF12.1\",\n Visible: () => hasAccessToSF(Player, 12),\n Condition: () => Player.sourceFileLvl(12) >= 1,\n },\n MONEY_1Q: {\n ...achievementData[\"MONEY_1Q\"],\n Icon: \"$1Q\",\n Condition: () => Player.money >= 1e18,\n },\n MONEY_M1B: {\n ...achievementData[\"MONEY_M1B\"],\n Icon: \"-1b\",\n Secret: true,\n Condition: () => Player.money <= -1e9,\n },\n INSTALL_1: {\n ...achievementData[\"INSTALL_1\"],\n Icon: \"install\",\n Condition: () => Player.augmentations.length >= 1,\n },\n INSTALL_100: {\n ...achievementData[\"INSTALL_100\"],\n Icon: \"install_100\",\n Condition: () => Player.augmentations.length >= 100,\n },\n QUEUE_40: {\n ...achievementData[\"QUEUE_40\"],\n Icon: \"queue40\",\n Condition: () => Player.queuedAugmentations.length >= 40,\n },\n HACKING_100000: {\n ...achievementData[\"HACKING_100000\"],\n Icon: \"hack100000\",\n Condition: () => Player.hacking >= 100000,\n },\n COMBAT_3000: {\n ...achievementData[\"COMBAT_3000\"],\n Icon: \"combat3000\",\n Condition: () =>\n Player.strength >= 3000 && Player.defense >= 3000 && Player.dexterity >= 3000 && Player.agility >= 3000,\n },\n NEUROFLUX_255: {\n ...achievementData[\"NEUROFLUX_255\"],\n Icon: \"nf255\",\n Condition: () => Player.augmentations.some((a) => a.name === AugmentationNames.NeuroFluxGovernor && a.level >= 255),\n },\n NS2: {\n ...achievementData[\"NS2\"],\n Icon: \"ns2\",\n Condition: () =>\n Player.getHomeComputer().scripts.some((s) => s.filename.endsWith(\".js\") || s.filename.endsWith(\".ns\")),\n },\n FROZE: {\n ...achievementData[\"FROZE\"],\n Icon: \"forze\",\n Condition: () => location.href.includes(\"noScripts\"),\n },\n RUNNING_SCRIPTS_1000: {\n ...achievementData[\"RUNNING_SCRIPTS_1000\"],\n Icon: \"run1000\",\n Condition: (): boolean => {\n let running = 0;\n for (const s of GetAllServers()) {\n running += s.runningScripts.length;\n }\n return running >= 1000;\n },\n },\n DRAIN_SERVER: {\n ...achievementData[\"DRAIN_SERVER\"],\n Icon: \"drain\",\n Condition: (): boolean => {\n for (const s of GetAllServers()) {\n if (s instanceof Server) {\n if (s.moneyMax > 0 && s.moneyAvailable === 0) return true;\n }\n }\n return false;\n },\n },\n MAX_RAM: {\n ...achievementData[\"MAX_RAM\"],\n Icon: \"maxram\",\n Condition: () => Player.getHomeComputer().maxRam === CONSTANTS.HomeComputerMaxRam,\n },\n MAX_CORES: {\n ...achievementData[\"MAX_CORES\"],\n Icon: \"maxcores\",\n Condition: () => Player.getHomeComputer().cpuCores === 8,\n },\n SCRIPTS_30: {\n ...achievementData[\"SCRIPTS_30\"],\n Icon: \"folders\",\n Condition: () => Player.getHomeComputer().scripts.length >= 30,\n },\n KARMA_1000000: {\n ...achievementData[\"KARMA_1000000\"],\n Icon: \"karma\",\n Secret: true,\n Condition: () => Player.karma <= -1e6,\n },\n STOCK_1q: {\n ...achievementData[\"STOCK_1q\"],\n Icon: \"$1Q\",\n Condition: () => Player.moneySourceB.stock >= 1e15,\n },\n DISCOUNT: {\n ...achievementData[\"DISCOUNT\"],\n Icon: \"discount\",\n Condition: (): boolean => {\n const p = GetServer(\"powerhouse-fitness\");\n if (!(p instanceof Server)) return false;\n return p.backdoorInstalled;\n },\n },\n SCRIPT_32GB: {\n ...achievementData[\"SCRIPT_32GB\"],\n Icon: \"bigcost\",\n Condition: () => Player.getHomeComputer().scripts.some((s) => s.ramUsage >= 32),\n },\n FIRST_HACKNET_NODE: {\n ...achievementData[\"FIRST_HACKNET_NODE\"],\n Icon: \"node\",\n Condition: () => !hasHacknetServers(Player) && Player.hacknetNodes.length > 0,\n },\n \"30_HACKNET_NODE\": {\n ...achievementData[\"30_HACKNET_NODE\"],\n Icon: \"hacknet-all\",\n Condition: () => !hasHacknetServers(Player) && Player.hacknetNodes.length >= 30,\n },\n MAX_HACKNET_NODE: {\n ...achievementData[\"MAX_HACKNET_NODE\"],\n Icon: \"hacknet-max\",\n Condition: (): boolean => {\n if (hasHacknetServers(Player)) return false;\n for (const h of Player.hacknetNodes) {\n if (!(h instanceof HacknetNode)) return false;\n if (\n h.ram === HacknetNodeConstants.MaxRam &&\n h.cores === HacknetNodeConstants.MaxCores &&\n h.level === HacknetNodeConstants.MaxLevel\n )\n return true;\n }\n return false;\n },\n },\n HACKNET_NODE_10M: {\n ...achievementData[\"HACKNET_NODE_10M\"],\n Icon: \"hacknet-10m\",\n Condition: () => !hasHacknetServers(Player) && Player.moneySourceB.hacknet >= 10e6,\n },\n REPUTATION_10M: {\n ...achievementData[\"REPUTATION_10M\"],\n Icon: \"reputation\",\n Condition: () => Object.values(Factions).some((f) => f.playerReputation >= 10e6),\n },\n DONATION: {\n ...achievementData[\"DONATION\"],\n Icon: \"donation\",\n Condition: () => Object.values(Factions).some((f) => f.favor >= 150),\n },\n TRAVEL: {\n ...achievementData[\"TRAVEL\"],\n Icon: \"TRAVEL\",\n Condition: () => Player.city !== CityName.Sector12,\n },\n WORKOUT: {\n ...achievementData[\"WORKOUT\"],\n Icon: \"WORKOUT\",\n Condition: () =>\n [\n CONSTANTS.ClassGymStrength,\n CONSTANTS.ClassGymDefense,\n CONSTANTS.ClassGymDexterity,\n CONSTANTS.ClassGymAgility,\n ].includes(Player.className),\n },\n TOR: {\n ...achievementData[\"TOR\"],\n Icon: \"TOR\",\n Condition: () => Player.hasTorRouter(),\n },\n HOSPITALIZED: {\n ...achievementData[\"HOSPITALIZED\"],\n Icon: \"OUCH\",\n Condition: () => Player.moneySourceB.hospitalization !== 0,\n },\n GANG: {\n ...achievementData[\"GANG\"],\n Icon: \"GANG\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.gang !== null,\n },\n FULL_GANG: {\n ...achievementData[\"FULL_GANG\"],\n Icon: \"GANGMAX\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.gang !== null && Player.gang.members.length === GangConstants.MaximumGangMembers,\n },\n GANG_TERRITORY: {\n ...achievementData[\"GANG_TERRITORY\"],\n Icon: \"GANG100%\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.gang !== null && AllGangs[Player.gang.facName].territory >= 0.999,\n },\n GANG_MEMBER_POWER: {\n ...achievementData[\"GANG_MEMBER_POWER\"],\n Icon: \"GANG10000\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () =>\n Player.gang !== null &&\n Player.gang.members.some(\n (m) =>\n m.hack >= 10000 || m.str >= 10000 || m.def >= 10000 || m.dex >= 10000 || m.agi >= 10000 || m.cha >= 10000,\n ),\n },\n CORPORATION: {\n ...achievementData[\"CORPORATION\"],\n Icon: \"CORP\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.corporation !== null,\n },\n CORPORATION_BRIBE: {\n ...achievementData[\"CORPORATION_BRIBE\"],\n Icon: \"CORPLOBBY\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.corporation !== null && Player.corporation.unlockUpgrades[6] === 1,\n },\n CORPORATION_PROD_1000: {\n ...achievementData[\"CORPORATION_PROD_1000\"],\n Icon: \"CORP1000\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.corporation !== null && Player.corporation.divisions.some((d) => d.prodMult >= 1000),\n },\n CORPORATION_EMPLOYEE_3000: {\n ...achievementData[\"CORPORATION_EMPLOYEE_3000\"],\n Icon: \"CORPCITY\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: (): boolean => {\n if (Player.corporation === null) return false;\n for (const d of Player.corporation.divisions) {\n for (const o of Object.values(d.offices)) {\n if (o === 0) continue;\n if (o.employees.length >= 3000) return true;\n }\n }\n return false;\n },\n },\n CORPORATION_REAL_ESTATE: {\n ...achievementData[\"CORPORATION_REAL_ESTATE\"],\n Icon: \"CORPRE\",\n Name: \"Own the land\",\n Description: \"Expand to the Real Estate division.\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () =>\n Player.corporation !== null && Player.corporation.divisions.some((d) => d.type === Industries.RealEstate),\n },\n INTELLIGENCE_255: {\n ...achievementData[\"INTELLIGENCE_255\"],\n Icon: \"INT255\",\n Visible: () => hasAccessToSF(Player, 5),\n Condition: () => Player.intelligence >= 255,\n },\n BLADEBURNER_DIVISION: {\n ...achievementData[\"BLADEBURNER_DIVISION\"],\n Icon: \"BLADE\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.bladeburner !== null,\n },\n BLADEBURNER_OVERCLOCK: {\n ...achievementData[\"BLADEBURNER_OVERCLOCK\"],\n Icon: \"BLADEOVERCLOCK\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () =>\n Player.bladeburner !== null &&\n Player.bladeburner.skills[SkillNames.Overclock] === Skills[SkillNames.Overclock].maxLvl,\n },\n BLADEBURNER_UNSPENT_100000: {\n ...achievementData[\"BLADEBURNER_UNSPENT_100000\"],\n Icon: \"BLADE100K\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.bladeburner !== null && Player.bladeburner.skillPoints >= 100000,\n },\n \"4S\": {\n ...achievementData[\"4S\"],\n Icon: \"4S\",\n Condition: () => Player.has4SData,\n },\n FIRST_HACKNET_SERVER: {\n ...achievementData[\"FIRST_HACKNET_SERVER\"],\n Icon: \"HASHNET\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => hasHacknetServers(Player) && Player.hacknetNodes.length > 0,\n AdditionalUnlock: [achievementData.FIRST_HACKNET_NODE.ID],\n },\n ALL_HACKNET_SERVER: {\n ...achievementData[\"ALL_HACKNET_SERVER\"],\n Icon: \"HASHNETALL\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => hasHacknetServers(Player) && Player.hacknetNodes.length === HacknetServerConstants.MaxServers,\n AdditionalUnlock: [achievementData[\"30_HACKNET_NODE\"].ID],\n },\n MAX_HACKNET_SERVER: {\n ...achievementData[\"MAX_HACKNET_SERVER\"],\n Icon: \"HASHNETALL\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: (): boolean => {\n if (!hasHacknetServers(Player)) return false;\n for (const h of Player.hacknetNodes) {\n if (typeof h !== \"string\") return false;\n const hs = GetServer(h);\n if (!(hs instanceof HacknetServer)) return false;\n if (\n hs.maxRam === HacknetServerConstants.MaxRam &&\n hs.cores === HacknetServerConstants.MaxCores &&\n hs.level === HacknetServerConstants.MaxLevel &&\n hs.cache === HacknetServerConstants.MaxCache\n )\n return true;\n }\n return false;\n },\n AdditionalUnlock: [achievementData.MAX_HACKNET_NODE.ID],\n },\n HACKNET_SERVER_1B: {\n ...achievementData[\"HACKNET_SERVER_1B\"],\n Icon: \"HASHNETMONEY\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => hasHacknetServers(Player) && Player.moneySourceB.hacknet >= 1e9,\n AdditionalUnlock: [achievementData.HACKNET_NODE_10M.ID],\n },\n MAX_CACHE: {\n ...achievementData[\"MAX_CACHE\"],\n Icon: \"HASHNETCAP\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => hasHacknetServers(Player) &&\n Player.hashManager.hashes === Player.hashManager.capacity &&\n Player.hashManager.capacity > 0,\n },\n SLEEVE_8: {\n ...achievementData[\"SLEEVE_8\"],\n Icon: \"SLEEVE8\",\n Visible: () => hasAccessToSF(Player, 10),\n Condition: () => Player.sleeves.length === 8,\n },\n INDECISIVE: {\n ...achievementData[\"INDECISIVE\"],\n Icon: \"1H\",\n Visible: () => knowsAboutBitverse(Player),\n Condition: (function () {\n let c = 0;\n setInterval(() => {\n if (Router.page() === Page.BitVerse) {\n c++;\n } else {\n c = 0;\n }\n }, 60 * 1000);\n return () => c > 60;\n })(),\n },\n FAST_BN: {\n ...achievementData[\"FAST_BN\"],\n Icon: \"2DAYS\",\n Visible: () => knowsAboutBitverse(Player),\n Condition: () => bitNodeFinishedState() && Player.playtimeSinceLastBitnode < 1000 * 60 * 60 * 24 * 2,\n },\n CHALLENGE_BN1: {\n ...achievementData[\"CHALLENGE_BN1\"],\n Icon: \"BN1+\",\n Visible: () => knowsAboutBitverse(Player),\n Condition: () =>\n Player.bitNodeN === 1 &&\n bitNodeFinishedState() &&\n Player.getHomeComputer().maxRam <= 128 &&\n Player.getHomeComputer().cpuCores === 1,\n },\n CHALLENGE_BN2: {\n ...achievementData[\"CHALLENGE_BN2\"],\n Icon: \"BN2+\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.bitNodeN === 2 && bitNodeFinishedState() && Player.gang === null,\n },\n CHALLENGE_BN3: {\n ...achievementData[\"CHALLENGE_BN3\"],\n Icon: \"BN3+\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.bitNodeN === 3 && bitNodeFinishedState() && Player.corporation === null,\n },\n CHALLENGE_BN6: {\n ...achievementData[\"CHALLENGE_BN6\"],\n Icon: \"BN6+\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.bitNodeN === 6 && bitNodeFinishedState() && Player.bladeburner === null,\n },\n CHALLENGE_BN7: {\n ...achievementData[\"CHALLENGE_BN7\"],\n Icon: \"BN7+\",\n Visible: () => hasAccessToSF(Player, 7),\n Condition: () => Player.bitNodeN === 7 && bitNodeFinishedState() && Player.bladeburner === null,\n },\n CHALLENGE_BN8: {\n ...achievementData[\"CHALLENGE_BN8\"],\n Icon: \"BN8+\",\n Visible: () => hasAccessToSF(Player, 8),\n Condition: () => Player.bitNodeN === 8 && bitNodeFinishedState() && !Player.has4SData && !Player.has4SDataTixApi,\n },\n CHALLENGE_BN9: {\n ...achievementData[\"CHALLENGE_BN9\"],\n Icon: \"BN9+\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () =>\n Player.bitNodeN === 9 &&\n bitNodeFinishedState() &&\n Player.moneySourceB.hacknet === 0 &&\n Player.moneySourceB.hacknet_expenses === 0,\n },\n CHALLENGE_BN10: {\n ...achievementData[\"CHALLENGE_BN10\"],\n Icon: \"BN10+\",\n Visible: () => hasAccessToSF(Player, 10),\n Condition: () =>\n Player.bitNodeN === 10 &&\n bitNodeFinishedState() &&\n !Player.sleeves.some(\n (s) =>\n s.augmentations.length > 0 ||\n s.hacking_exp > 0 ||\n s.strength_exp > 0 ||\n s.defense_exp > 0 ||\n s.agility_exp > 0 ||\n s.dexterity_exp > 0 ||\n s.charisma_exp > 0,\n ),\n },\n CHALLENGE_BN12: {\n ...achievementData[\"CHALLENGE_BN12\"],\n Icon: \"BN12+\",\n Visible: () => hasAccessToSF(Player, 12),\n Condition: () => Player.sourceFileLvl(12) >= 50,\n },\n BYPASS: {\n ...achievementData[\"BYPASS\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.Bypass),\n },\n PROTOTYPETAMPERING: {\n ...achievementData[\"PROTOTYPETAMPERING\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.PrototypeTampering),\n },\n UNCLICKABLE: {\n ...achievementData[\"UNCLICKABLE\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.Unclickable),\n },\n UNDOCUMENTEDFUNCTIONCALL: {\n ...achievementData[\"UNDOCUMENTEDFUNCTIONCALL\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.UndocumentedFunctionCall),\n },\n TIMECOMPRESSION: {\n ...achievementData[\"TIMECOMPRESSION\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.TimeCompression),\n },\n REALITYALTERATION: {\n ...achievementData[\"REALITYALTERATION\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.RealityAlteration),\n },\n N00DLES: {\n ...achievementData[\"N00DLES\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.N00dles),\n },\n EDITSAVEFILE: {\n ...achievementData[\"EDITSAVEFILE\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.EditSaveFile),\n },\n UNACHIEVABLE: {\n ...achievementData[\"UNACHIEVABLE\"],\n Icon: \"SF-1\",\n Secret: true,\n // Hey Players! Yes, you're supposed to modify this to get the achievement!\n Condition: () => false,\n },\n CHALLENGE_BN13: {\n ...achievementData[\"CHALLENGE_BN13\"],\n Icon: \"BN13+\",\n Visible: () => hasAccessToSF(Player, 13),\n Condition: () =>\n Player.bitNodeN === 13 &&\n bitNodeFinishedState() &&\n !Player.augmentations.some((a) => a.name === AugmentationNames.StaneksGift1),\n },\n DEVMENU: {\n ...achievementData[\"DEVMENU\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.YoureNotMeantToAccessThis),\n },\n};\n\n// Steam has a limit of 100 achievement. So these were planned but commented for now.\n// { ID: \"ECORP\", Condition: () => Player.factions.includes(\"ECorp\") },\n// { ID: \"MEGACORP\", Condition: () => Player.factions.includes(\"MegaCorp\") },\n// { ID: \"BACHMAN_&_ASSOCIATES\", Condition: () => Player.factions.includes(\"Bachman & Associates\") },\n// { ID: \"BLADE_INDUSTRIES\", Condition: () => Player.factions.includes(\"Blade Industries\") },\n// { ID: \"NWO\", Condition: () => Player.factions.includes(\"NWO\") },\n// { ID: \"CLARKE_INCORPORATED\", Condition: () => Player.factions.includes(\"Clarke Incorporated\") },\n// { ID: \"OMNITEK_INCORPORATED\", Condition: () => Player.factions.includes(\"OmniTek Incorporated\") },\n// { ID: \"FOUR_SIGMA\", Condition: () => Player.factions.includes(\"Four Sigma\") },\n// { ID: \"KUAIGONG_INTERNATIONAL\", Condition: () => Player.factions.includes(\"KuaiGong International\") },\n// { ID: \"FULCRUM_SECRET_TECHNOLOGIES\", Condition: () => Player.factions.includes(\"Fulcrum Secret Technologies\") },\n// { ID: \"AEVUM\", Condition: () => Player.factions.includes(\"Aevum\") },\n// { ID: \"CHONGQING\", Condition: () => Player.factions.includes(\"Chongqing\") },\n// { ID: \"ISHIMA\", Condition: () => Player.factions.includes(\"Ishima\") },\n// { ID: \"NEW_TOKYO\", Condition: () => Player.factions.includes(\"New Tokyo\") },\n// { ID: \"SECTOR-12\", Condition: () => Player.factions.includes(\"Sector-12\") },\n// { ID: \"VOLHAVEN\", Condition: () => Player.factions.includes(\"Volhaven\") },\n// { ID: \"SPEAKERS_FOR_THE_DEAD\", Condition: () => Player.factions.includes(\"Speakers for the Dead\") },\n// { ID: \"THE_DARK_ARMY\", Condition: () => Player.factions.includes(\"The Dark Army\") },\n// { ID: \"THE_SYNDICATE\", Condition: () => Player.factions.includes(\"The Syndicate\") },\n// { ID: \"SILHOUETTE\", Condition: () => Player.factions.includes(\"Silhouette\") },\n// { ID: \"TETRADS\", Condition: () => Player.factions.includes(\"Tetrads\") },\n// { ID: \"SLUM_SNAKES\", Condition: () => Player.factions.includes(\"Slum Snakes\") },\n// { ID: \"NETBURNERS\", Condition: () => Player.factions.includes(\"Netburners\") },\n// { ID: \"TIAN_DI_HUI\", Condition: () => Player.factions.includes(\"Tian Di Hui\") },\n// { ID: \"BLADEBURNERS\", Condition: () => Player.factions.includes(\"Bladeburners\") },\n// { ID: \"DEEPSCANV1.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.DeepscanV1.name) },\n// { ID: \"DEEPSCANV2.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.DeepscanV2.name) },\n// {\n// ID: \"SERVERPROFILER.EXE\",\n// Condition: () => Player.getHomeComputer().programs.includes(Programs.ServerProfiler.name),\n// },\n// { ID: \"AUTOLINK.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.AutoLink.name) },\n// { ID: \"FLIGHT.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.Flight.name) },\n\nexport function calculateAchievements(): void {\n const playerAchievements = Player.achievements.map((a) => a.ID);\n\n const missingAchievements = Object.values(achievements)\n .filter((a) => !playerAchievements.includes(a.ID) && a.Condition())\n // callback returns array of achievement id and id of any in the additional list, flatmap means we have only a 1D array\n .flatMap((a) => [a.ID, ...(a.AdditionalUnlock || [])]);\n\n for (const id of missingAchievements) {\n Player.giveAchievement(id);\n }\n\n // Write all player's achievements to document for Steam/Electron\n // This could be replaced by \"availableAchievements\"\n // if we don't want to grant the save game achievements to steam but only currently available\n (document as any).achievements = [...Player.achievements.map((a) => a.ID)];\n}\n","import { IMap } from \"../../types\";\n\nexport type CorporationUnlockUpgrade = [number, number, string, string];\n\n// Corporation Unlock Upgrades\n// Upgrades for entire corporation, unlocks features, either you have it or you dont\n// The data structure is an array with the following format:\n// [index in Corporation feature upgrades array, price, name, description]\nexport const CorporationUnlockUpgrades: IMap<CorporationUnlockUpgrade> = {\n //Lets you export goods\n \"0\": [\n 0,\n 20e9,\n \"Export\",\n \"Develop infrastructure to export your materials to your other facilities. \" +\n \"This allows you to move materials around between different divisions and cities.\",\n ],\n\n //Lets you buy exactly however many required materials you need for production\n \"1\": [\n 1,\n 25e9,\n \"Smart Supply\",\n \"Use advanced AI to anticipate your supply needs. \" +\n \"This allows you to purchase exactly however many materials you need for production.\",\n ],\n\n //Displays each material/product's demand\n \"2\": [\n 2,\n 5e9,\n \"Market Research - Demand\",\n \"Mine and analyze market data to determine the demand of all resources. \" +\n \"The demand attribute, which affects sales, will be displayed for every material and product.\",\n ],\n\n //Display's each material/product's competition\n \"3\": [\n 3,\n 5e9,\n \"Market Data - Competition\",\n \"Mine and analyze market data to determine how much competition there is on the market \" +\n \"for all resources. The competition attribute, which affects sales, will be displayed for \" +\n \"every material and product.\",\n ],\n \"4\": [\n 4,\n 10e9,\n \"VeChain\",\n \"Use AI and blockchain technology to identify where you can improve your supply chain systems. \" +\n \"This upgrade will allow you to view a wide array of useful statistics about your \" +\n \"Corporation.\",\n ],\n \"5\": [\n 5,\n 500e12,\n \"Shady Accounting\",\n \"Utilize unscrupulous accounting practices and pay off government officials to save money \" +\n \"on taxes. This reduces the dividend tax rate by 5%.\",\n ],\n \"6\": [\n 6,\n 2e15,\n \"Government Partnership\",\n \"Help national governments further their agendas in exchange for lowered taxes. \" +\n \"This reduces the dividend tax rate by 10%\",\n ],\n \"7\": [7, 50e9, \"Warehouse API\", \"Enables the warehouse API.\"],\n \"8\": [8, 50e9, \"Office API\", \"Enables the office API.\"],\n};\n","/**\n * Implementation for what happens when you destroy a BitNode\n */\nimport React from \"react\";\nimport { Player } from \"./Player\";\nimport { prestigeSourceFile } from \"./Prestige\";\nimport { PlayerOwnedSourceFile } from \"./SourceFile/PlayerOwnedSourceFile\";\nimport { SourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { SourceFiles } from \"./SourceFile/SourceFiles\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { IRouter } from \"./ui/Router\";\n\nexport let redPillFlag = false;\n\nexport function setRedPillFlag(b: boolean): void {\n redPillFlag = b;\n}\n\nfunction giveSourceFile(bitNodeNumber: number): void {\n const sourceFileKey = \"SourceFile\" + bitNodeNumber.toString();\n const sourceFile = SourceFiles[sourceFileKey];\n if (sourceFile == null) {\n console.error(`Could not find source file for Bit node: ${bitNodeNumber}`);\n return;\n }\n\n // Check if player already has this source file\n let alreadyOwned = false;\n let ownedSourceFile = null;\n for (let i = 0; i < Player.sourceFiles.length; ++i) {\n if (Player.sourceFiles[i].n === bitNodeNumber) {\n alreadyOwned = true;\n ownedSourceFile = Player.sourceFiles[i];\n break;\n }\n }\n\n if (alreadyOwned && ownedSourceFile) {\n if (ownedSourceFile.lvl >= 3 && ownedSourceFile.n !== 12) {\n dialogBoxCreate(\n \"The Source-File for the BitNode you just destroyed, \" + sourceFile.name + \", \" + \"is already at max level!\",\n );\n } else {\n ++ownedSourceFile.lvl;\n dialogBoxCreate(\n sourceFile.name +\n \" was upgraded to level \" +\n ownedSourceFile.lvl +\n \" for \" +\n \"destroying its corresponding BitNode!\",\n );\n }\n } else {\n const playerSrcFile = new PlayerOwnedSourceFile(bitNodeNumber, 1);\n Player.sourceFiles.push(playerSrcFile);\n if (bitNodeNumber === 5 && Player.intelligence === 0) {\n // Artificial Intelligence\n Player.intelligence = 1;\n }\n dialogBoxCreate(\n <>\n You received a Source-File for destroying a BitNode!\n <br />\n <br />\n {sourceFile.name}\n <br />\n <br />\n {sourceFile.info}\n </>,\n );\n }\n}\n\nexport function enterBitNode(router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number): void {\n if (!flume) {\n giveSourceFile(destroyedBitNode);\n } else {\n if (SourceFileFlags[5] === 0 && newBitNode !== 5) {\n Player.intelligence = 0;\n Player.intelligence_exp = 0;\n }\n }\n if (newBitNode === 5 && Player.intelligence === 0) {\n Player.intelligence = 1;\n }\n redPillFlag = false;\n // Set new Bit Node\n Player.bitNodeN = newBitNode;\n\n if (newBitNode === 6) {\n router.toBladeburnerCinematic();\n } else {\n router.toTerminal();\n }\n prestigeSourceFile(flume);\n}\n","/**\n * Adds a random offset to a number within a certain percentage\n * @example\n * // Returns between 95-105\n * addOffset(100, 5);\n * @example\n * // Returns between 63-77\n * addOffSet(70, 10);\n * @param midpoint The number to be the midpoint of the offset range\n * @param percentage The percentage (in a range of 0-100) to offset\n */\nexport function addOffset(midpoint: number, percentage: number): number {\n const maxPercent = 100;\n if (percentage < 0 || percentage > maxPercent) {\n return midpoint;\n }\n\n const offset: number = midpoint * (percentage / maxPercent);\n\n // Double the range to account for both sides of the midpoint.\n // tslint:disable-next-line:no-magic-numbers\n return midpoint + (Math.random() * (offset * 2) - offset);\n}\n","export enum RamCalculationErrorCode {\n SyntaxError = -1,\n ImportError = -2,\n URLImportError = -3,\n}\n","export class DarkWebItem {\n program: string;\n price: number;\n description: string;\n\n constructor(program: string, price: number, description: string) {\n this.program = program;\n this.price = price;\n this.description = description;\n }\n}\n","export class PlayerOwnedAugmentation {\n level = 1;\n name = \"\";\n\n constructor(name = \"\") {\n this.name = name;\n }\n}\n\nexport interface IPlayerOwnedAugmentation {\n level: number;\n name: string;\n}\n","import { getRandomByte } from \"./helpers/getRandomByte\";\n\n/**\n * Generate a random IP address\n * Does not check to see if the IP already exists in the game\n */\nexport function createRandomIp(): string {\n const ip: string = getRandomByte(99) + \".\" + getRandomByte(9) + \".\" + getRandomByte(9) + \".\" + getRandomByte(9);\n\n return ip;\n}\n","/**\n * Does a shallow compare of two arrays to determine if they are equal.\n * @param a1 The first array\n * @param a2 The second array\n */\nexport function compareArrays<T>(a1: T[], a2: T[]): boolean {\n if (a1.length !== a2.length) {\n return false;\n }\n\n for (let i = 0; i < a1.length; ++i) {\n if (Array.isArray(a1[i])) {\n // If the other element is not an array, then these cannot be equal\n if (!Array.isArray(a2[i])) {\n return false;\n }\n\n const elem1 = a1[i] as any;\n const elem2 = a2[i] as any;\n if (!compareArrays(elem1, elem2)) {\n return false;\n }\n } else if (a1[i] !== a2[i] && !(Number.isNaN(a1[i]) && Number.isNaN(a2[i]))) {\n // strict (in)equality considers NaN not equal to itself\n return false;\n }\n }\n\n return true;\n}\n","import { IMap } from \"../types\";\n\nexport type IndustryUpgrade = [number, number, number, number, string, string];\n\n// Industry upgrades\n// The data structure is an array with the following format:\n// [index in array, base price, price mult, benefit mult (if applicable), name, desc]\nexport const IndustryUpgrades: IMap<IndustryUpgrade> = {\n \"0\": [0, 500e3, 1, 1.05, \"Coffee\", \"Provide your employees with coffee, increasing their energy by 5%.\"],\n \"1\": [\n 1,\n 1e9,\n 1.06,\n 1.03,\n \"AdVert.Inc\",\n \"Hire AdVert.Inc to advertise your company. Each level of \" +\n \"this upgrade grants your company a static increase of 3 and 1 to its awareness and \" +\n \"popularity, respectively. It will then increase your company's awareness by 1%, and its popularity \" +\n \"by a random percentage between 1% and 3%. These effects are increased by other upgrades \" +\n \"that increase the power of your advertising.\",\n ],\n};\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n favor: {\n color: theme.colors.rep,\n },\n }),\n);\n\nexport function Favor({ favor }: { favor: number | string }): React.ReactElement {\n const classes = useStyles();\n return <span className={classes.favor}>{typeof favor === \"number\" ? numeralWrapper.formatFavor(favor) : favor}</span>;\n}\n","export const GangConstants: {\n GangRespectToReputationRatio: number;\n MaximumGangMembers: number;\n CyclesPerTerritoryAndPowerUpdate: number;\n AscensionMultiplierRatio: number;\n Names: string[];\n} = {\n // Respect is divided by this to get rep gain\n GangRespectToReputationRatio: 75,\n MaximumGangMembers: 12,\n CyclesPerTerritoryAndPowerUpdate: 100,\n // Portion of upgrade multiplier that is kept after ascending\n AscensionMultiplierRatio: 0.15,\n // Names of possible Gangs\n Names: [\n \"Slum Snakes\",\n \"Tetrads\",\n \"The Syndicate\",\n \"The Dark Army\",\n \"Speakers for the Dead\",\n \"NiteSec\",\n \"The Black Hand\",\n ],\n};\n","/**\n * Sleeves are bodies that contain the player's cloned consciousness.\n * The player can use these bodies to perform different tasks synchronously.\n *\n * Each sleeve is its own individual, meaning it has its own stats/exp\n *\n * Sleeves are unlocked in BitNode-10.\n */\nimport { SleeveTaskType } from \"./SleeveTaskTypesEnum\";\n\nimport { IPlayer } from \"../IPlayer\";\nimport { Person, ITaskTracker, createTaskTracker } from \"../Person\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\n\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nimport { Crime } from \"../../Crime/Crime\";\nimport { Crimes } from \"../../Crime/Crimes\";\n\nimport { Companies } from \"../../Company/Companies\";\nimport { Company } from \"../../Company/Company\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { FactionWorkType } from \"../../Faction/FactionWorkTypeEnum\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../../utils/JSONReviver\";\n\nexport class Sleeve extends Person {\n /**\n * Stores the name of the class that the player is currently taking\n */\n className = \"\";\n\n /**\n * Stores the type of crime the sleeve is currently attempting\n * Must match the name of a Crime object\n */\n crimeType = \"\";\n\n /**\n * Enum value for current task\n */\n currentTask: SleeveTaskType = SleeveTaskType.Idle;\n\n /**\n * Contains details about the sleeve's current task. The info stored\n * in this depends on the task type\n *\n * Faction/Company Work: Name of Faction/Company\n * Crime: Money earned if successful\n * Class/Gym: Name of university/gym\n */\n currentTaskLocation = \"\";\n\n /**\n * Maximum amount of time (in milliseconds) that can be spent on current task.\n */\n currentTaskMaxTime = 0;\n\n /**\n * Milliseconds spent on current task\n */\n currentTaskTime = 0;\n\n /**\n * Keeps track of experience earned for other sleeves\n */\n earningsForSleeves: ITaskTracker = createTaskTracker();\n\n /**\n * Keeps track of experience + money earned for player\n */\n earningsForPlayer: ITaskTracker = createTaskTracker();\n\n /**\n * Keeps track of experienced earned in the current task/action\n */\n earningsForTask: ITaskTracker = createTaskTracker();\n\n /**\n * Keeps track of what type of work sleeve is doing for faction, if applicable\n */\n factionWorkType: FactionWorkType = FactionWorkType.None;\n\n /**\n * Records experience gain rate for the current task\n */\n gainRatesForTask: ITaskTracker = createTaskTracker();\n\n /**\n * String that stores what stat the sleeve is training at the gym\n */\n gymStatType = \"\";\n\n /**\n * Keeps track of events/notifications for this sleeve\n */\n logs: string[] = [];\n\n /**\n * Clone retains 'memory' synchronization (and maybe exp?) upon prestige/installing Augs\n */\n memory = 1;\n\n /**\n * Sleeve shock. Number between 0 and 100\n * Trauma/shock that comes with being in a sleeve. Experience earned\n * is multipled by shock%. This gets applied before synchronization\n *\n * Reputation earned is also multiplied by shock%\n */\n shock = 1;\n\n /**\n * Stored number of game \"loop\" cycles\n */\n storedCycles = 0;\n\n /**\n * Synchronization. Number between 0 and 100\n * When experience is earned by sleeve, both the player and the sleeve get\n * sync% of the experience earned. Other sleeves get sync^2% of exp\n */\n sync = 1;\n\n constructor(p: IPlayer | null = null) {\n super();\n if (p != null) {\n this.shockRecovery(p);\n }\n }\n\n /**\n * Commit crimes\n */\n commitCrime(p: IPlayer, crimeKey: string): boolean {\n const crime: Crime | null = Crimes[crimeKey] || Object.values(Crimes).find((crime) => crime.name === crimeKey);\n if (!crime) {\n return false;\n }\n\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n this.gainRatesForTask.hack = crime.hacking_exp * this.hacking_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.str = crime.strength_exp * this.strength_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.def = crime.defense_exp * this.defense_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.dex = crime.dexterity_exp * this.dexterity_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.agi = crime.agility_exp * this.agility_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.cha = crime.charisma_exp * this.charisma_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.money = crime.money * this.crime_money_mult * BitNodeMultipliers.CrimeMoney;\n\n this.currentTaskLocation = String(this.gainRatesForTask.money);\n\n this.crimeType = crime.name;\n this.currentTaskMaxTime = crime.time;\n this.currentTask = SleeveTaskType.Crime;\n return true;\n }\n\n /**\n * Called to stop the current task\n */\n finishTask(p: IPlayer): ITaskTracker {\n let retValue: ITaskTracker = createTaskTracker(); // Amount of exp to be gained by other sleeves\n\n if (this.currentTask === SleeveTaskType.Crime) {\n // For crimes, all experience and money is gained at the end\n if (this.currentTaskTime >= this.currentTaskMaxTime) {\n const crime: Crime | undefined = Object.values(Crimes).find((crime) => crime.name === this.crimeType);\n if (!crime) {\n console.error(`Invalid data stored in sleeve.crimeType: ${this.crimeType}`);\n this.resetTaskStatus();\n return retValue;\n }\n if (Math.random() < crime.successRate(this)) {\n // Success\n const successGainRates: ITaskTracker = createTaskTracker();\n\n const keysForIteration: (keyof ITaskTracker)[] = Object.keys(successGainRates) as (keyof ITaskTracker)[];\n for (let i = 0; i < keysForIteration.length; ++i) {\n const key = keysForIteration[i];\n successGainRates[key] = this.gainRatesForTask[key] * 2;\n }\n retValue = this.gainExperience(p, successGainRates);\n this.gainMoney(p, this.gainRatesForTask);\n\n p.karma -= crime.karma * (this.sync / 100);\n } else {\n retValue = this.gainExperience(p, this.gainRatesForTask);\n }\n\n // Do not reset task to IDLE\n this.currentTaskTime = 0;\n return retValue;\n }\n } else {\n // For other crimes... I dont think anything else needs to be done\n }\n\n this.resetTaskStatus();\n\n return retValue;\n }\n\n /**\n * Earn experience for any stats (supports multiple)\n * This function also handles experience propogating to Player and other sleeves\n */\n gainExperience(p: IPlayer, exp: ITaskTracker, numCycles = 1, fromOtherSleeve = false): ITaskTracker {\n // If the experience is coming from another sleeve, it is not multiplied by anything.\n // Also the player does not earn anything\n if (fromOtherSleeve) {\n if (exp.hack > 0) {\n this.hacking_exp += exp.hack;\n }\n\n if (exp.str > 0) {\n this.strength_exp += exp.str;\n }\n\n if (exp.def > 0) {\n this.defense_exp += exp.def;\n }\n\n if (exp.dex > 0) {\n this.dexterity_exp += exp.dex;\n }\n\n if (exp.agi > 0) {\n this.agility_exp += exp.agi;\n }\n\n if (exp.cha > 0) {\n this.charisma_exp += exp.cha;\n }\n\n return createTaskTracker();\n }\n\n // Experience is first multiplied by shock. Then 'synchronization'\n // is accounted for\n\n const multFac = (this.shock / 100) * (this.sync / 100) * numCycles;\n const pHackExp = exp.hack * multFac;\n const pStrExp = exp.str * multFac;\n const pDefExp = exp.def * multFac;\n const pDexExp = exp.dex * multFac;\n const pAgiExp = exp.agi * multFac;\n const pChaExp = exp.cha * multFac;\n\n // Experience is gained by both this sleeve and player\n if (pHackExp > 0) {\n this.hacking_exp += pHackExp;\n p.gainHackingExp(pHackExp);\n this.earningsForPlayer.hack += pHackExp;\n this.earningsForTask.hack += pHackExp;\n }\n\n if (pStrExp > 0) {\n this.strength_exp += pStrExp;\n p.gainStrengthExp(pStrExp);\n this.earningsForPlayer.str += pStrExp;\n this.earningsForTask.str += pStrExp;\n }\n\n if (pDefExp > 0) {\n this.defense_exp += pDefExp;\n p.gainDefenseExp(pDefExp);\n this.earningsForPlayer.def += pDefExp;\n this.earningsForTask.def += pDefExp;\n }\n\n if (pDexExp > 0) {\n this.dexterity_exp += pDexExp;\n p.gainDexterityExp(pDexExp);\n this.earningsForPlayer.dex += pDexExp;\n this.earningsForTask.dex += pDexExp;\n }\n\n if (pAgiExp > 0) {\n this.agility_exp += pAgiExp;\n p.gainAgilityExp(pAgiExp);\n this.earningsForPlayer.agi += pAgiExp;\n this.earningsForTask.agi += pAgiExp;\n }\n\n if (pChaExp > 0) {\n this.charisma_exp += pChaExp;\n p.gainCharismaExp(pChaExp);\n this.earningsForPlayer.cha += pChaExp;\n this.earningsForTask.cha += pChaExp;\n }\n\n // Record earnings for other sleeves\n this.earningsForSleeves.hack += pHackExp * (this.sync / 100);\n this.earningsForSleeves.str += pStrExp * (this.sync / 100);\n this.earningsForSleeves.def += pDefExp * (this.sync / 100);\n this.earningsForSleeves.dex += pDexExp * (this.sync / 100);\n this.earningsForSleeves.agi += pAgiExp * (this.sync / 100);\n this.earningsForSleeves.cha += pChaExp * (this.sync / 100);\n\n // Return the experience to be gained by other sleeves\n return {\n hack: pHackExp * (this.sync / 100),\n str: pStrExp * (this.sync / 100),\n def: pDefExp * (this.sync / 100),\n dex: pDexExp * (this.sync / 100),\n agi: pAgiExp * (this.sync / 100),\n cha: pChaExp * (this.sync / 100),\n money: 0,\n };\n }\n\n /**\n * Earn money for player\n */\n gainMoney(p: IPlayer, task: ITaskTracker, numCycles = 1): void {\n const gain: number = task.money * numCycles;\n this.earningsForTask.money += gain;\n this.earningsForPlayer.money += gain;\n p.gainMoney(gain, \"sleeves\");\n }\n\n /**\n * Returns the cost of upgrading this sleeve's memory by a certain amount\n */\n getMemoryUpgradeCost(n: number): number {\n const amt = Math.round(n);\n if (amt < 0) {\n return 0;\n }\n\n if (this.memory + amt > 100) {\n return this.getMemoryUpgradeCost(100 - this.memory);\n }\n\n const mult = 1.02;\n const baseCost = 1e12;\n let currCost = 0;\n let currMemory = this.memory - 1;\n for (let i = 0; i < n; ++i) {\n currCost += Math.pow(mult, currMemory);\n ++currMemory;\n }\n\n return currCost * baseCost;\n }\n\n /**\n * Gets reputation gain for the current task\n * Only applicable when working for company or faction\n */\n getRepGain(p: IPlayer): number {\n if (this.currentTask === SleeveTaskType.Faction) {\n let favorMult = 1;\n const fac: Faction | null = Factions[this.currentTaskLocation];\n if (fac != null) {\n favorMult = 1 + fac.favor / 100;\n }\n\n switch (this.factionWorkType) {\n case FactionWorkType.Hacking:\n return this.getFactionHackingWorkRepGain() * (this.shock / 100) * favorMult;\n case FactionWorkType.Field:\n return this.getFactionFieldWorkRepGain() * (this.shock / 100) * favorMult;\n case FactionWorkType.Security:\n return this.getFactionSecurityWorkRepGain() * (this.shock / 100) * favorMult;\n default:\n console.warn(`Invalid Sleeve.factionWorkType property in Sleeve.getRepGain(): ${this.factionWorkType}`);\n return 0;\n }\n } else if (this.currentTask === SleeveTaskType.Company) {\n const companyName: string = this.currentTaskLocation;\n const company: Company | null = Companies[companyName];\n if (company == null) {\n console.error(`Invalid company found when trying to calculate rep gain: ${companyName}`);\n return 0;\n }\n\n const companyPosition: CompanyPosition | null = CompanyPositions[p.jobs[companyName]];\n if (companyPosition == null) {\n console.error(`Invalid company position name found when trying to calculate rep gain: ${p.jobs[companyName]}`);\n return 0;\n }\n\n const jobPerformance: number = companyPosition.calculateJobPerformance(\n this.hacking,\n this.strength,\n this.defense,\n this.dexterity,\n this.agility,\n this.charisma,\n );\n const favorMult = 1 + company.favor / 100;\n\n return jobPerformance * this.company_rep_mult * favorMult;\n } else {\n return 0;\n }\n }\n\n installAugmentation(aug: Augmentation): void {\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n this.applyAugmentation(aug);\n this.augmentations.push({ name: aug.name, level: 1 });\n this.updateStatLevels();\n }\n\n log(entry: string): void {\n const MaxLogSize = 50;\n this.logs.push(entry);\n if (this.logs.length > MaxLogSize) {\n this.logs.shift();\n }\n }\n\n /**\n * Called on every sleeve for a Source File prestige\n */\n prestige(p: IPlayer): void {\n // Reset exp\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n\n // Reset task-related stuff\n this.resetTaskStatus();\n this.earningsForSleeves = createTaskTracker();\n this.earningsForPlayer = createTaskTracker();\n this.shockRecovery(p);\n\n // Reset augs and multipliers\n this.augmentations = [];\n this.resetMultipliers();\n\n // Reset sleeve-related stats\n this.shock = 1;\n this.storedCycles = 0;\n this.sync = Math.max(this.memory, 1);\n\n this.logs = [];\n }\n\n /**\n * Process loop\n * Returns an object containing the amount of experience that should be\n * transferred to all other sleeves\n */\n process(p: IPlayer, numCycles = 1): ITaskTracker | null {\n // Only process once every second (5 cycles)\n const CyclesPerSecond = 1000 / CONSTANTS.MilliPerCycle;\n this.storedCycles += numCycles;\n if (this.storedCycles < CyclesPerSecond) {\n return null;\n }\n\n let cyclesUsed = this.storedCycles;\n cyclesUsed = Math.min(cyclesUsed, 15);\n let time = cyclesUsed * CONSTANTS.MilliPerCycle;\n if (this.currentTaskMaxTime !== 0 && this.currentTaskTime + time > this.currentTaskMaxTime) {\n time = this.currentTaskMaxTime - this.currentTaskTime;\n cyclesUsed = Math.floor(time / CONSTANTS.MilliPerCycle);\n\n if (time < 0 || cyclesUsed < 0) {\n console.warn(`Sleeve.process() calculated negative cycle usage`);\n time = 0;\n cyclesUsed = 0;\n }\n }\n\n this.currentTaskTime += time;\n\n // Shock gradually goes towards 100\n this.shock = Math.min(100, this.shock + 0.0001 * cyclesUsed);\n\n let retValue: ITaskTracker = createTaskTracker();\n switch (this.currentTask) {\n case SleeveTaskType.Idle:\n break;\n case SleeveTaskType.Class:\n case SleeveTaskType.Gym:\n this.updateTaskGainRates(p);\n retValue = this.gainExperience(p, this.gainRatesForTask, cyclesUsed);\n this.gainMoney(p, this.gainRatesForTask, cyclesUsed);\n break;\n case SleeveTaskType.Faction: {\n retValue = this.gainExperience(p, this.gainRatesForTask, cyclesUsed);\n this.gainMoney(p, this.gainRatesForTask, cyclesUsed);\n\n // Gain faction reputation\n const fac: Faction = Factions[this.currentTaskLocation];\n if (!(fac instanceof Faction)) {\n console.error(`Invalid faction for Sleeve task: ${this.currentTaskLocation}`);\n break;\n }\n\n fac.playerReputation += this.getRepGain(p) * cyclesUsed;\n break;\n }\n case SleeveTaskType.Company: {\n retValue = this.gainExperience(p, this.gainRatesForTask, cyclesUsed);\n this.gainMoney(p, this.gainRatesForTask, cyclesUsed);\n\n const company: Company = Companies[this.currentTaskLocation];\n if (!(company instanceof Company)) {\n console.error(`Invalid company for Sleeve task: ${this.currentTaskLocation}`);\n break;\n }\n\n company.playerReputation += this.getRepGain(p) * cyclesUsed;\n break;\n }\n case SleeveTaskType.Recovery:\n this.shock = Math.min(100, this.shock + 0.0002 * cyclesUsed);\n if (this.shock >= 100) this.resetTaskStatus();\n break;\n case SleeveTaskType.Synchro:\n this.sync = Math.min(100, this.sync + p.getIntelligenceBonus(0.5) * 0.0002 * cyclesUsed);\n if (this.sync >= 100) this.resetTaskStatus();\n break;\n default:\n break;\n }\n\n if (this.currentTaskMaxTime !== 0 && this.currentTaskTime >= this.currentTaskMaxTime) {\n if (this.currentTask === SleeveTaskType.Crime) {\n retValue = this.finishTask(p);\n } else {\n this.finishTask(p);\n }\n }\n\n this.updateStatLevels();\n\n this.storedCycles -= cyclesUsed;\n\n return retValue;\n }\n\n /**\n * Resets all parameters used to keep information about the current task\n */\n resetTaskStatus(): void {\n this.earningsForTask = createTaskTracker();\n this.gainRatesForTask = createTaskTracker();\n this.currentTask = SleeveTaskType.Idle;\n this.currentTaskTime = 0;\n this.currentTaskMaxTime = 0;\n this.factionWorkType = FactionWorkType.None;\n this.crimeType = \"\";\n this.currentTaskLocation = \"\";\n this.gymStatType = \"\";\n this.className = \"\";\n }\n\n shockRecovery(p: IPlayer): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n this.currentTask = SleeveTaskType.Recovery;\n return true;\n }\n\n synchronize(p: IPlayer): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n this.currentTask = SleeveTaskType.Synchro;\n return true;\n }\n\n /**\n * Take a course at a university\n */\n takeUniversityCourse(p: IPlayer, universityName: string, className: string): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n // Set exp/money multipliers based on which university.\n // Also check that the sleeve is in the right city\n let costMult = 1;\n switch (universityName.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase():\n if (this.city !== CityName.Aevum) {\n return false;\n }\n this.currentTaskLocation = LocationName.AevumSummitUniversity;\n costMult = 4;\n break;\n case LocationName.Sector12RothmanUniversity.toLowerCase():\n if (this.city !== CityName.Sector12) {\n return false;\n }\n this.currentTaskLocation = LocationName.Sector12RothmanUniversity;\n costMult = 3;\n break;\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():\n if (this.city !== CityName.Volhaven) {\n return false;\n }\n this.currentTaskLocation = LocationName.VolhavenZBInstituteOfTechnology;\n costMult = 5;\n break;\n default:\n return false;\n }\n\n // Set experience/money gains based on class\n switch (className.toLowerCase()) {\n case \"study computer science\":\n break;\n case \"data structures\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassDataStructuresBaseCost * costMult);\n break;\n case \"networks\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassNetworksBaseCost * costMult);\n break;\n case \"algorithms\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassAlgorithmsBaseCost * costMult);\n break;\n case \"management\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassManagementBaseCost * costMult);\n break;\n case \"leadership\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassLeadershipBaseCost * costMult);\n break;\n default:\n return false;\n }\n\n this.className = className;\n this.currentTask = SleeveTaskType.Class;\n return true;\n }\n\n /**\n * Travel to another City. Costs money from player\n */\n travel(p: IPlayer, newCity: CityName): boolean {\n p.loseMoney(CONSTANTS.TravelCost, \"sleeves\");\n this.city = newCity;\n\n return true;\n }\n\n tryBuyAugmentation(p: IPlayer, aug: Augmentation): boolean {\n if (!p.canAfford(aug.startingCost)) {\n return false;\n }\n\n // Verify that this sleeve does not already have that augmentation.\n if (this.augmentations.some((a) => a.name === aug.name)) {\n return false;\n }\n\n p.loseMoney(aug.startingCost, \"sleeves\");\n this.installAugmentation(aug);\n return true;\n }\n\n updateTaskGainRates(p: IPlayer): void {\n if (this.currentTask === SleeveTaskType.Class) {\n let expMult = 1;\n switch (this.currentTaskLocation.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase():\n expMult = 3;\n break;\n case LocationName.Sector12RothmanUniversity.toLowerCase():\n expMult = 2;\n break;\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():\n expMult = 4;\n break;\n default:\n return;\n }\n\n const totalExpMult = expMult * p.hashManager.getStudyMult();\n switch (this.className.toLowerCase()) {\n case \"study computer science\":\n this.gainRatesForTask.hack =\n CONSTANTS.ClassStudyComputerScienceBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"data structures\":\n this.gainRatesForTask.hack = CONSTANTS.ClassDataStructuresBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"networks\":\n this.gainRatesForTask.hack = CONSTANTS.ClassNetworksBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"algorithms\":\n this.gainRatesForTask.hack = CONSTANTS.ClassAlgorithmsBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"management\":\n this.gainRatesForTask.cha = CONSTANTS.ClassManagementBaseExp * totalExpMult * this.charisma_exp_mult;\n break;\n case \"leadership\":\n this.gainRatesForTask.cha = CONSTANTS.ClassLeadershipBaseExp * totalExpMult * this.charisma_exp_mult;\n break;\n default:\n break;\n }\n\n return;\n }\n\n if (this.currentTask === SleeveTaskType.Gym) {\n // Get gym exp multiplier\n let expMult = 1;\n switch (this.currentTaskLocation.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase():\n expMult = 2;\n break;\n case LocationName.AevumSnapFitnessGym.toLowerCase():\n expMult = 5;\n break;\n case LocationName.Sector12IronGym.toLowerCase():\n expMult = 1;\n break;\n case LocationName.Sector12PowerhouseGym.toLowerCase():\n expMult = 10;\n break;\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase():\n expMult = 4;\n break;\n default:\n return;\n }\n\n // Set stat gain rate\n const baseGymExp = 1;\n const totalExpMultiplier = p.hashManager.getTrainingMult() * expMult;\n const sanitizedStat: string = this.gymStatType.toLowerCase();\n if (sanitizedStat.includes(\"str\")) {\n this.gainRatesForTask.str = baseGymExp * totalExpMultiplier * this.strength_exp_mult;\n } else if (sanitizedStat.includes(\"def\")) {\n this.gainRatesForTask.def = baseGymExp * totalExpMultiplier * this.defense_exp_mult;\n } else if (sanitizedStat.includes(\"dex\")) {\n this.gainRatesForTask.dex = baseGymExp * totalExpMultiplier * this.dexterity_exp_mult;\n } else if (sanitizedStat.includes(\"agi\")) {\n this.gainRatesForTask.agi = baseGymExp * totalExpMultiplier * this.agility_exp_mult;\n }\n\n return;\n }\n\n console.warn(`Sleeve.updateTaskGainRates() called for unexpected task type ${this.currentTask}`);\n }\n\n upgradeMemory(n: number): void {\n if (n < 0) {\n console.warn(`Sleeve.upgradeMemory() called with negative value: ${n}`);\n return;\n }\n\n this.memory = Math.min(100, Math.round(this.memory + n));\n }\n\n /**\n * Start work for one of the player's companies\n * Returns boolean indicating success\n */\n workForCompany(p: IPlayer, companyName: string): boolean {\n if (!(Companies[companyName] instanceof Company) || p.jobs[companyName] == null) {\n return false;\n }\n\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n const company: Company | null = Companies[companyName];\n const companyPosition: CompanyPosition | null = CompanyPositions[p.jobs[companyName]];\n if (company == null) {\n return false;\n }\n if (companyPosition == null) {\n return false;\n }\n this.gainRatesForTask.money =\n companyPosition.baseSalary *\n company.salaryMultiplier *\n this.work_money_mult *\n BitNodeMultipliers.CompanyWorkMoney;\n this.gainRatesForTask.hack =\n companyPosition.hackingExpGain *\n company.expMultiplier *\n this.hacking_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.str =\n companyPosition.strengthExpGain *\n company.expMultiplier *\n this.strength_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.def =\n companyPosition.defenseExpGain *\n company.expMultiplier *\n this.defense_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.dex =\n companyPosition.dexterityExpGain *\n company.expMultiplier *\n this.dexterity_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.agi =\n companyPosition.agilityExpGain *\n company.expMultiplier *\n this.agility_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.cha =\n companyPosition.charismaExpGain *\n company.expMultiplier *\n this.charisma_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n\n this.currentTaskLocation = companyName;\n this.currentTask = SleeveTaskType.Company;\n\n return true;\n }\n\n /**\n * Start work for one of the player's factions\n * Returns boolean indicating success\n */\n workForFaction(p: IPlayer, factionName: string, workType: string): boolean {\n if (factionName === \"\") {\n return false;\n }\n if (!(Factions[factionName] instanceof Faction) || !p.factions.includes(factionName)) {\n return false;\n }\n\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n const factionInfo = Factions[factionName].getInfo();\n\n // Set type of work (hacking/field/security), and the experience gains\n const sanitizedWorkType: string = workType.toLowerCase();\n if (sanitizedWorkType.includes(\"hack\")) {\n if (!factionInfo.offerHackingWork) {\n return false;\n }\n this.factionWorkType = FactionWorkType.Hacking;\n this.gainRatesForTask.hack = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n } else if (sanitizedWorkType.includes(\"field\")) {\n if (!factionInfo.offerFieldWork) {\n return false;\n }\n this.factionWorkType = FactionWorkType.Field;\n this.gainRatesForTask.hack = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.str = 0.1 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.def = 0.1 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.dex = 0.1 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.agi = 0.1 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.cha = 0.1 * this.charisma_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n } else if (sanitizedWorkType.includes(\"security\")) {\n if (!factionInfo.offerSecurityWork) {\n return false;\n }\n this.factionWorkType = FactionWorkType.Security;\n this.gainRatesForTask.hack = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.str = 0.15 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.def = 0.15 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.dex = 0.15 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.agi = 0.15 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n } else {\n return false;\n }\n\n this.currentTaskLocation = factionName;\n this.currentTask = SleeveTaskType.Faction;\n\n return true;\n }\n\n /**\n * Begin a gym workout task\n */\n workoutAtGym(p: IPlayer, gymName: string, stat: string): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n // Set exp/money multipliers based on which university.\n // Also check that the sleeve is in the right city\n let costMult = 1;\n switch (gymName.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase():\n if (this.city != CityName.Aevum) {\n return false;\n }\n this.currentTaskLocation = LocationName.AevumCrushFitnessGym;\n costMult = 3;\n break;\n case LocationName.AevumSnapFitnessGym.toLowerCase():\n if (this.city != CityName.Aevum) {\n return false;\n }\n this.currentTaskLocation = LocationName.AevumSnapFitnessGym;\n costMult = 10;\n break;\n case LocationName.Sector12IronGym.toLowerCase():\n if (this.city != CityName.Sector12) {\n return false;\n }\n this.currentTaskLocation = LocationName.Sector12IronGym;\n costMult = 1;\n break;\n case LocationName.Sector12PowerhouseGym.toLowerCase():\n if (this.city != CityName.Sector12) {\n return false;\n }\n this.currentTaskLocation = LocationName.Sector12PowerhouseGym;\n costMult = 20;\n break;\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase():\n if (this.city != CityName.Volhaven) {\n return false;\n }\n this.currentTaskLocation = LocationName.VolhavenMilleniumFitnessGym;\n costMult = 7;\n break;\n default:\n return false;\n }\n\n // Set experience/money gains based on class\n const sanitizedStat: string = stat.toLowerCase();\n\n // Set cost\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassGymBaseCost * costMult);\n\n // Validate \"stat\" argument\n if (\n !sanitizedStat.includes(\"str\") &&\n !sanitizedStat.includes(\"def\") &&\n !sanitizedStat.includes(\"dex\") &&\n !sanitizedStat.includes(\"agi\")\n ) {\n return false;\n }\n\n this.gymStatType = stat;\n this.currentTask = SleeveTaskType.Gym;\n\n return true;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Sleeve\", this);\n }\n\n /**\n * Initiatizes a Sleeve object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Sleeve {\n return Generic_fromJSON(Sleeve, value.data);\n }\n}\n\nReviver.constructors.Sleeve = Sleeve;\n","import { EventEmitter } from \"../utils/EventEmitter\";\nexport const TerminalEvents = new EventEmitter<[]>();\nexport const TerminalClearEvents = new EventEmitter<[]>();\n","import { Reviver, Generic_toJSON, Generic_fromJSON } from \"../utils/JSONReviver\";\n\nexport class Message {\n // Name of Message file\n filename = \"\";\n\n // The text contains in the Message\n msg = \"\";\n\n // Flag indicating whether this Message has been received by the player\n recvd = false;\n\n constructor(filename = \"\", msg = \"\") {\n this.filename = filename;\n this.msg = msg;\n this.recvd = false;\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): any {\n return Generic_toJSON(\"Message\", this);\n }\n\n // Initializes a Message Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Message {\n return Generic_fromJSON(Message, value.data);\n }\n}\n\nReviver.constructors.Message = Message;\n","/**\n * Helper functions for determine whether Limit and Stop orders should\n * be executed (and executing them)\n */\nimport { buyStock, sellStock, shortStock, sellShort } from \"./BuyingAndSelling\";\nimport { IOrderBook } from \"./IOrderBook\";\nimport { IStockMarket } from \"./IStockMarket\";\nimport { Order } from \"./Order\";\nimport { Stock } from \"./Stock\";\n\nimport { OrderTypes } from \"./data/OrderTypes\";\nimport { PositionTypes } from \"./data/PositionTypes\";\n\nimport { IMap } from \"../types\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Settings } from \"../Settings/Settings\";\n\nimport * as React from \"react\";\n\nexport interface IProcessOrderRefs {\n stockMarket: IStockMarket;\n symbolToStockMap: IMap<Stock>;\n}\n\n/**\n * Search for all orders of a specific type and execute them if appropriate\n * @param {Stock} stock - Stock for which orders should be processed\n * @param {OrderTypes} orderType - Type of order to check (Limit/Stop buy/sell)\n * @param {PositionTypes} posType - Long or short\n * @param {IProcessOrderRefs} refs - References to objects/functions that are required for this function\n */\nexport function processOrders(\n stock: Stock,\n orderType: OrderTypes,\n posType: PositionTypes,\n refs: IProcessOrderRefs,\n): void {\n const orderBook = refs.stockMarket[\"Orders\"];\n if (orderBook == null) {\n const orders: IOrderBook = {};\n for (const name of Object.keys(refs.stockMarket)) {\n const stock = refs.stockMarket[name];\n if (!(stock instanceof Stock)) {\n continue;\n }\n orders[stock.symbol] = [];\n }\n refs.stockMarket[\"Orders\"] = orders;\n return; // Newly created, so no orders to process\n }\n let stockOrders = orderBook[stock.symbol];\n if (stockOrders == null || !(stockOrders.constructor === Array)) {\n console.error(`Invalid Order book for ${stock.symbol} in processOrders(): ${stockOrders}`);\n stockOrders = [];\n return;\n }\n\n for (const order of stockOrders) {\n if (order.type === orderType && order.pos === posType) {\n switch (order.type) {\n case OrderTypes.LimitBuy:\n if (order.pos === PositionTypes.Long && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n case OrderTypes.LimitSell:\n if (order.pos === PositionTypes.Long && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n case OrderTypes.StopBuy:\n if (order.pos === PositionTypes.Long && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n case OrderTypes.StopSell:\n if (order.pos === PositionTypes.Long && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n default:\n console.warn(`Invalid order type: ${order.type}`);\n return;\n }\n }\n }\n}\n\n/**\n * Execute a Stop or Limit Order.\n * @param {Order} order - Order being executed\n * @param {IProcessOrderRefs} refs - References to objects/functions that are required for this function\n */\nfunction executeOrder(order: Order, refs: IProcessOrderRefs): void {\n const stock = refs.symbolToStockMap[order.stockSymbol];\n if (!(stock instanceof Stock)) {\n console.error(`Could not find stock for this order: ${order.stockSymbol}`);\n return;\n }\n const stockMarket = refs.stockMarket;\n const orderBook = stockMarket[\"Orders\"];\n const stockOrders = orderBook[stock.symbol];\n\n // When orders are executed, the buying and selling functions shouldn't\n // emit popup dialog boxes. This options object configures the functions for that\n const opts = {\n suppressDialog: true,\n };\n\n let res = true;\n let isBuy = false;\n switch (order.type) {\n case OrderTypes.LimitBuy:\n case OrderTypes.StopBuy:\n isBuy = true;\n if (order.pos === PositionTypes.Long) {\n res = buyStock(stock, order.shares, null, opts) && res;\n } else if (order.pos === PositionTypes.Short) {\n res = shortStock(stock, order.shares, null, opts) && res;\n }\n break;\n case OrderTypes.LimitSell:\n case OrderTypes.StopSell:\n if (order.pos === PositionTypes.Long) {\n res = sellStock(stock, order.shares, null, opts) && res;\n } else if (order.pos === PositionTypes.Short) {\n res = sellShort(stock, order.shares, null, opts) && res;\n }\n break;\n default:\n console.warn(`Invalid order type: ${order.type}`);\n return;\n }\n\n // Position type, for logging/message purposes\n const pos = order.pos === PositionTypes.Long ? \"Long\" : \"Short\";\n\n if (res) {\n for (let i = 0; i < stockOrders.length; ++i) {\n if (order == stockOrders[i]) {\n stockOrders.splice(i, 1);\n if (!Settings.SuppressTIXPopup) {\n dialogBoxCreate(\n <>\n {order.type} for {stock.symbol} @ <Money money={order.price} /> ({pos}) was filled (\n {numeralWrapper.formatShares(Math.round(order.shares))} shares)\n </>,\n );\n }\n return;\n }\n }\n\n console.error(\"Could not find the following Order in Order Book: \");\n console.error(order);\n } else {\n if (isBuy) {\n dialogBoxCreate(\n <>\n Failed to execute {order.type} for {stock.symbol} @ <Money money={order.price} /> ({pos}). This is most likely\n because you do not have enough money or the order would exceed the stock's maximum number of shares\n </>,\n );\n }\n }\n}\n","import { IMap } from \"../types\";\nimport * as predefined from \"./data\";\n\nexport interface ITheme {\n [key: string]: string | undefined;\n primarylight: string;\n primary: string;\n primarydark: string;\n successlight: string;\n success: string;\n successdark: string;\n errorlight: string;\n error: string;\n errordark: string;\n secondarylight: string;\n secondary: string;\n secondarydark: string;\n warninglight: string;\n warning: string;\n warningdark: string;\n infolight: string;\n info: string;\n infodark: string;\n welllight: string;\n well: string;\n white: string;\n black: string;\n hp: string;\n money: string;\n hack: string;\n combat: string;\n cha: string;\n int: string;\n rep: string;\n disabled: string;\n backgroundprimary: string;\n backgroundsecondary: string;\n button: string;\n}\n\nexport interface IPredefinedTheme {\n colors: ITheme;\n name: string;\n credit: string;\n screenshot: string;\n description: string;\n reference?: string;\n}\n\nexport const defaultTheme: ITheme = {\n ...predefined.Default.colors,\n};\n\nexport const getPredefinedThemes = (): IMap<IPredefinedTheme> => ({\n ...predefined,\n});\n","import { Augmentations } from \"./Augmentation/Augmentations\";\nimport { augmentationExists, initAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { initBitNodeMultipliers } from \"./BitNode/BitNode\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { Companies, initCompanies } from \"./Company/Companies\";\nimport { resetIndustryResearchTrees } from \"./Corporation/IndustryData\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Faction } from \"./Faction/Faction\";\nimport { Factions, initFactions } from \"./Faction/Factions\";\nimport { joinFaction } from \"./Faction/FactionHelpers\";\nimport { updateHashManagerCapacity } from \"./Hacknet/HacknetHelpers\";\nimport { initMessages } from \"./Message/MessageHelpers\";\nimport { prestigeWorkerScripts } from \"./NetscriptWorker\";\nimport { Player } from \"./Player\";\nimport { Router } from \"./ui/GameRoot\";\nimport { resetPidCounter } from \"./Netscript/Pid\";\nimport { LiteratureNames } from \"./Literature/data/LiteratureNames\";\n\nimport { GetServer, AddToAllServers, initForeignServers, prestigeAllServers } from \"./Server/AllServers\";\nimport { prestigeHomeComputer } from \"./Server/ServerHelpers\";\nimport { SourceFileFlags, updateSourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { SpecialServers } from \"./Server/data/SpecialServers\";\nimport { deleteStockMarket, initStockMarket, initSymbolToStockMap } from \"./StockMarket/StockMarket\";\nimport { Terminal } from \"./Terminal\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\n\nimport { staneksGift } from \"./CotMG/Helper\";\nimport { ProgramsSeen } from \"./Programs/ui/ProgramsRoot\";\nimport { InvitationsSeen } from \"./Faction/ui/FactionsRoot\";\nimport { CONSTANTS } from \"./Constants\";\nimport { LogBoxClearEvents } from \"./ui/React/LogBoxManager\";\n\nconst BitNode8StartingMoney = 250e6;\n\n// Prestige by purchasing augmentation\nexport function prestigeAugmentation(): void {\n initBitNodeMultipliers(Player);\n\n const maintainMembership = Player.factions.concat(Player.factionInvitations).filter(function (faction) {\n return Factions[faction].getInfo().keep;\n });\n Player.prestigeAugmentation();\n\n // Delete all Worker Scripts objects\n prestigeWorkerScripts();\n\n const homeComp = Player.getHomeComputer();\n // Delete all servers except home computer\n prestigeAllServers();\n\n // Reset home computer (only the programs) and add to AllServers\n AddToAllServers(homeComp);\n prestigeHomeComputer(Player, homeComp);\n\n if (augmentationExists(AugmentationNames.Neurolink) && Augmentations[AugmentationNames.Neurolink].owned) {\n homeComp.programs.push(Programs.FTPCrackProgram.name);\n homeComp.programs.push(Programs.RelaySMTPProgram.name);\n }\n if (augmentationExists(AugmentationNames.CashRoot) && Augmentations[AugmentationNames.CashRoot].owned) {\n Player.setMoney(1e6);\n homeComp.programs.push(Programs.BruteSSHProgram.name);\n }\n if (augmentationExists(AugmentationNames.PCMatrix) && Augmentations[AugmentationNames.PCMatrix].owned) {\n homeComp.programs.push(Programs.DeepscanV1.name);\n homeComp.programs.push(Programs.AutoLink.name);\n }\n\n if (Player.sourceFileLvl(5) > 0 || Player.bitNodeN === 5) {\n homeComp.programs.push(Programs.Formulas.name);\n }\n\n // Re-create foreign servers\n initForeignServers(Player.getHomeComputer());\n\n // Gain favor for Companies\n for (const member of Object.keys(Companies)) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].gainFavor();\n }\n }\n\n // Gain favor for factions\n for (const member of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(member)) {\n Factions[member].gainFavor();\n }\n }\n\n // Stop a Terminal action if there is one.\n if (Terminal.action !== null) {\n Terminal.finishAction(Router, Player, true);\n }\n Terminal.clear();\n LogBoxClearEvents.emit();\n\n // Re-initialize things - This will update any changes\n initFactions(); // Factions must be initialized before augmentations\n\n Player.factionInvitations = Player.factionInvitations.concat(maintainMembership);\n initAugmentations(); // Calls reapplyAllAugmentations() and resets Player multipliers\n Player.reapplyAllSourceFiles();\n initCompanies();\n\n // Messages\n initMessages();\n\n // Gang\n const gang = Player.gang;\n if (Player.inGang() && gang !== null) {\n const faction = Factions[gang.facName];\n if (faction instanceof Faction) {\n joinFaction(faction);\n }\n const penalty = 0.95;\n for (const m of gang.members) {\n m.hack_asc_points *= penalty;\n m.str_asc_points *= penalty;\n m.def_asc_points *= penalty;\n m.dex_asc_points *= penalty;\n m.agi_asc_points *= penalty;\n m.cha_asc_points *= penalty;\n }\n }\n\n // BitNode 3: Corporatocracy\n if (Player.bitNodeN === 3) {\n homeComp.messages.push(LiteratureNames.CorporationManagementHandbook);\n }\n\n // Cancel Bladeburner action\n if (Player.bladeburner instanceof Bladeburner) {\n Player.bladeburner.prestige();\n }\n\n // BitNode 8: Ghost of Wall Street\n if (Player.bitNodeN === 8) {\n Player.money = BitNode8StartingMoney;\n }\n if (Player.bitNodeN === 8 || SourceFileFlags[8] > 0) {\n Player.hasWseAccount = true;\n Player.hasTixApiAccess = true;\n }\n\n // Reset Stock market\n if (Player.hasWseAccount) {\n initStockMarket();\n initSymbolToStockMap();\n }\n\n // Red Pill\n if (augmentationExists(AugmentationNames.TheRedPill) && Augmentations[AugmentationNames.TheRedPill].owned) {\n const WorldDaemon = GetServer(SpecialServers.WorldDaemon);\n const DaedalusServer = GetServer(SpecialServers.DaedalusServer);\n if (WorldDaemon && DaedalusServer) {\n WorldDaemon.serversOnNetwork.push(DaedalusServer.hostname);\n DaedalusServer.serversOnNetwork.push(WorldDaemon.hostname);\n }\n }\n\n if (augmentationExists(AugmentationNames.StaneksGift1) && Augmentations[AugmentationNames.StaneksGift1].owned) {\n // TODO(hydroflame): refactor faction names so we don't have to hard\n // code strings.\n joinFaction(Factions[\"Church of the Machine God\"]);\n }\n\n staneksGift.prestigeAugmentation();\n\n resetPidCounter();\n ProgramsSeen.splice(0, ProgramsSeen.length);\n InvitationsSeen.splice(0, InvitationsSeen.length);\n}\n\n// Prestige by destroying Bit Node and gaining a Source File\nexport function prestigeSourceFile(flume: boolean): void {\n initBitNodeMultipliers(Player);\n updateSourceFileFlags(Player);\n\n Player.prestigeSourceFile();\n prestigeWorkerScripts(); // Delete all Worker Scripts objects\n\n const homeComp = Player.getHomeComputer();\n\n // Stop a Terminal action if there is one.\n if (Terminal.action !== null) {\n Terminal.finishAction(Router, Player, true);\n }\n Terminal.clear();\n LogBoxClearEvents.emit();\n\n // Delete all servers except home computer\n prestigeAllServers(); // Must be done before initForeignServers()\n\n // Reset home computer (only the programs) and add to AllServers\n AddToAllServers(homeComp);\n prestigeHomeComputer(Player, homeComp);\n\n // Re-create foreign servers\n initForeignServers(Player.getHomeComputer());\n\n if (SourceFileFlags[9] >= 2) {\n homeComp.setMaxRam(128);\n } else if (SourceFileFlags[1] > 0) {\n homeComp.setMaxRam(32);\n } else {\n homeComp.setMaxRam(8);\n }\n homeComp.cpuCores = 1;\n\n // Reset favor for Companies\n for (const member of Object.keys(Companies)) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].favor = 0;\n }\n }\n\n // Reset favor for factions\n for (const member of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(member)) {\n Factions[member].favor = 0;\n }\n }\n\n // Stop a Terminal action if there is one\n if (Terminal.action !== null) {\n Terminal.finishAction(Router, Player, true);\n }\n\n // Delete all Augmentations\n for (const name of Object.keys(Augmentations)) {\n if (Augmentations.hasOwnProperty(name)) {\n delete Augmentations[name];\n }\n }\n\n // Give levels of NeuroFluxGoverner for Source-File 12. Must be done here before Augmentations are recalculated\n if (SourceFileFlags[12] > 0) {\n Player.augmentations.push({\n name: AugmentationNames.NeuroFluxGovernor,\n level: SourceFileFlags[12],\n });\n }\n\n // Re-initialize things - This will update any changes\n initFactions(); // Factions must be initialized before augmentations\n initAugmentations(); // Calls reapplyAllAugmentations() and resets Player multipliers\n Player.reapplyAllSourceFiles();\n initCompanies();\n\n // Messages\n initMessages();\n\n if (Player.sourceFileLvl(5) > 0 || Player.bitNodeN === 5) {\n homeComp.programs.push(Programs.Formulas.name);\n }\n\n // BitNode 3: Corporatocracy\n if (Player.bitNodeN === 3) {\n homeComp.messages.push(LiteratureNames.CorporationManagementHandbook);\n dialogBoxCreate(\n \"You received a copy of the Corporation Management Handbook on your home computer. \" +\n \"Read it if you need help getting started with Corporations!\",\n );\n }\n\n // BitNode 8: Ghost of Wall Street\n if (Player.bitNodeN === 8) {\n Player.money = BitNode8StartingMoney;\n }\n if (Player.bitNodeN === 8 || SourceFileFlags[8] > 0) {\n Player.hasWseAccount = true;\n Player.hasTixApiAccess = true;\n }\n\n // Bit Node 10: Digital Carbon\n if (Player.bitNodeN === 10) {\n dialogBoxCreate(\"Visit VitaLife in New Tokyo if you'd like to purchase a new sleeve!\");\n }\n\n if (Player.bitNodeN === 13) {\n dialogBoxCreate(\"Trouble is brewing in Chongqing\");\n }\n\n // Reset Stock market, gang, and corporation\n if (Player.hasWseAccount) {\n initStockMarket();\n initSymbolToStockMap();\n } else {\n deleteStockMarket();\n }\n\n Player.gang = null;\n Player.corporation = null;\n resetIndustryResearchTrees();\n Player.bladeburner = null;\n\n // Source-File 9 (level 3) effect\n if (SourceFileFlags[9] >= 3) {\n const hserver = Player.createHacknetServer();\n\n hserver.level = 100;\n hserver.cores = 10;\n hserver.cache = 5;\n hserver.updateHashRate(Player.hacknet_node_money_mult);\n hserver.updateHashCapacity();\n updateHashManagerCapacity(Player);\n }\n\n if (Player.bitNodeN === 13) {\n Player.money = CONSTANTS.TravelCost;\n }\n staneksGift.prestigeSourceFile();\n\n // Gain int exp\n if (SourceFileFlags[5] !== 0 && !flume) Player.gainIntelligenceExp(300);\n\n resetPidCounter();\n}\n","function getDB(): Promise<IDBObjectStore> {\n return new Promise((resolve, reject) => {\n if (!window.indexedDB) {\n reject(\"Indexed DB does not exists\");\n }\n /**\n * DB is called bitburnerSave\n * Object store is called savestring\n * key for the Object store is called save\n * Version `1` is important\n */\n const indexedDbRequest: IDBOpenDBRequest = window.indexedDB.open(\"bitburnerSave\", 1);\n\n // This is called when there's no db to begin with. It's important, don't remove it.\n indexedDbRequest.onupgradeneeded = function (this: IDBRequest<IDBDatabase>) {\n const db = this.result;\n db.createObjectStore(\"savestring\");\n };\n\n indexedDbRequest.onerror = function (this: IDBRequest<IDBDatabase>, ev: Event) {\n reject(`Failed to get IDB ${ev}`);\n };\n\n indexedDbRequest.onsuccess = function (this: IDBRequest<IDBDatabase>) {\n const db = this.result;\n if (!db) {\n reject(\"database loading result was undefined\");\n return;\n }\n resolve(db.transaction([\"savestring\"], \"readwrite\").objectStore(\"savestring\"));\n };\n });\n}\n\nexport function load(): Promise<string> {\n return new Promise((resolve, reject) => {\n getDB()\n .then((db) => {\n return new Promise<string>((resolve, reject) => {\n const request: IDBRequest<string> = db.get(\"save\");\n request.onerror = function (this: IDBRequest<string>, ev: Event) {\n reject(\"Error in Database request to get savestring: \" + ev);\n };\n\n request.onsuccess = function (this: IDBRequest<string>) {\n resolve(this.result);\n };\n }).then((saveString) => resolve(saveString));\n })\n .catch((r) => reject(r));\n });\n}\n\nexport function save(saveString: string): Promise<void> {\n return getDB().then((db) => {\n return new Promise<void>((resolve, reject) => {\n // We'll save to both localstorage and indexedDb\n const request = db.put(saveString, \"save\");\n\n request.onerror = function (e) {\n reject(\"Error saving game to IndexedDB: \" + e);\n };\n\n request.onsuccess = () => resolve();\n });\n });\n}\n\nexport function deleteGame(): Promise<void> {\n return getDB().then((db) => {\n db.delete(\"save\");\n });\n}\n","import { Factions } from \"./Faction/Factions\";\nimport { IPlayer } from \"./PersonObjects/IPlayer\";\n\nexport let LastExportBonus = 0;\n\nconst bonusTimer = 24 * 60 * 60 * 1000; // 24h\nexport function canGetBonus(): boolean {\n const now = new Date().getTime();\n if (now - LastExportBonus > bonusTimer) return true;\n return false;\n}\n\nexport function onExport(p: IPlayer): void {\n if (!canGetBonus()) return;\n for (const facName of p.factions) {\n Factions[facName].favor++;\n }\n LastExportBonus = new Date().getTime();\n}\n\nexport function setLastExportBonus(unixTime: number): void {\n LastExportBonus = unixTime;\n}\n","import { IBladeburner } from \"./IBladeburner\";\nimport { BladeburnerConstants } from \"./data/Constants\";\nimport { Action, IActionParams } from \"./Action\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IOperationParams extends IActionParams {\n reqdRank?: number;\n teamCount?: number;\n}\n\nexport class Operation extends Action {\n reqdRank = 100;\n teamCount = 0;\n\n constructor(params: IOperationParams | null = null) {\n super(params);\n if (params && params.reqdRank) this.reqdRank = params.reqdRank;\n if (params && params.teamCount) this.teamCount = params.teamCount;\n }\n\n // For actions that have teams. To be implemented by subtypes.\n getTeamSuccessBonus(inst: IBladeburner): number {\n if (this.teamCount && this.teamCount > 0) {\n this.teamCount = Math.min(this.teamCount, inst.teamSize);\n const teamMultiplier = Math.pow(this.teamCount, 0.05);\n return teamMultiplier;\n }\n\n return 1;\n }\n\n getActionTypeSkillSuccessBonus(inst: IBladeburner): number {\n return inst.skillMultipliers.successChanceOperation;\n }\n\n getChaosDifficultyBonus(inst: IBladeburner /*, params: ISuccessChanceParams*/): number {\n const city = inst.getCurrentCity();\n if (city.chaos > BladeburnerConstants.ChaosThreshold) {\n const diff = 1 + (city.chaos - BladeburnerConstants.ChaosThreshold);\n const mult = Math.pow(diff, 0.5);\n return mult;\n }\n\n return 1;\n }\n\n toJSON(): any {\n return Generic_toJSON(\"Operation\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Operation {\n return Generic_fromJSON(Operation, value.data);\n }\n}\n\nReviver.constructors.Operation = Operation;\n","/**\n * React Component for the first part of a gang member details.\n * Contains skills and exp.\n */\nimport React from \"react\";\nimport { useGang } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableRow,\n} from \"@mui/material\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMember } from \"../GangMember\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { characterOverviewStyles as useStyles } from \"../../ui/React/CharacterOverview\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport const generateTableRow = (\n name: string,\n level: number,\n exp: number,\n color: string,\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n classes: any\n): React.ReactElement => {\n return (\n <TableRow>\n <TableCell classes={{ root: classes.cellNone }}>\n <Typography style={{ color: color }}>{name}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography style={{ color: color }}>\n {formatNumber(level, 0)} ({numeralWrapper.formatExp(exp)} exp)\n </Typography>\n </TableCell>\n </TableRow>\n )\n}\n\nexport function GangMemberStats(props: IProps): React.ReactElement {\n const classes = useStyles();\n\n const asc = {\n hack: props.member.calculateAscensionMult(props.member.hack_asc_points),\n str: props.member.calculateAscensionMult(props.member.str_asc_points),\n def: props.member.calculateAscensionMult(props.member.def_asc_points),\n dex: props.member.calculateAscensionMult(props.member.dex_asc_points),\n agi: props.member.calculateAscensionMult(props.member.agi_asc_points),\n cha: props.member.calculateAscensionMult(props.member.cha_asc_points),\n };\n\n\n\n const gang = useGang();\n const data = [\n [`Money:`, <MoneyRate money={5 * props.member.calculateMoneyGain(gang)} />],\n [`Respect:`, `${numeralWrapper.formatRespect(5 * props.member.calculateRespectGain(gang))} / sec`],\n [`Wanted Level:`, `${numeralWrapper.formatWanted(5 * props.member.calculateWantedLevelGain(gang))} / sec`],\n [`Total Respect:`, `${numeralWrapper.formatRespect(props.member.earnedRespect)}`],\n ];\n\n return (\n <>\n <Tooltip\n title={\n <Typography>\n Hk: x{numeralWrapper.formatMultiplier(props.member.hack_mult * asc.hack)}(x\n {numeralWrapper.formatMultiplier(props.member.hack_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.hack)}{\" \"}\n Asc)\n <br />\n St: x{numeralWrapper.formatMultiplier(props.member.str_mult * asc.str)}\n (x{numeralWrapper.formatMultiplier(props.member.str_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.str)}{\" \"}\n Asc)\n <br />\n Df: x{numeralWrapper.formatMultiplier(props.member.def_mult * asc.def)}\n (x{numeralWrapper.formatMultiplier(props.member.def_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.def)}{\" \"}\n Asc)\n <br />\n Dx: x{numeralWrapper.formatMultiplier(props.member.dex_mult * asc.dex)}\n (x{numeralWrapper.formatMultiplier(props.member.dex_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.dex)}{\" \"}\n Asc)\n <br />\n Ag: x{numeralWrapper.formatMultiplier(props.member.agi_mult * asc.agi)}\n (x{numeralWrapper.formatMultiplier(props.member.agi_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.agi)}{\" \"}\n Asc)\n <br />\n Ch: x{numeralWrapper.formatMultiplier(props.member.cha_mult * asc.cha)}\n (x{numeralWrapper.formatMultiplier(props.member.cha_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.cha)}{\" \"}\n Asc)\n </Typography>\n }\n >\n <Table sx={{ display: 'table', mb: 1, width: '100%' }}>\n <TableBody>\n {generateTableRow(\"Hacking\", props.member.hack, props.member.hack_exp, Settings.theme.hack, classes)}\n {generateTableRow(\"Strength\", props.member.str, props.member.str_exp, Settings.theme.combat, classes)}\n {generateTableRow(\"Defense\", props.member.def, props.member.def_exp, Settings.theme.combat, classes)}\n {generateTableRow(\"Dexterity\", props.member.dex, props.member.dex_exp, Settings.theme.combat, classes)}\n {generateTableRow(\"Agility\", props.member.agi, props.member.agi_exp, Settings.theme.combat, classes)}\n {generateTableRow(\"Charisma\", props.member.cha, props.member.cha_exp, Settings.theme.cha, classes)}\n <TableRow>\n <TableCell classes={{ root: classes.cellNone }}>\n <br />\n </TableCell>\n </TableRow>\n {data.map(([a, b]) => (\n <TableRow key={a.toString() + b.toString()}>\n <TableCell classes={{ root: classes.cellNone }}>\n <Typography>{a}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography>{b}</Typography>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </Tooltip>\n </>\n );\n}\n","// tslint:disable:max-file-line-count\n\n// This could actually be a JSON file as it should be constant metadata to be imported...\nimport { IMinMaxRange } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { LiteratureNames } from \"../../Literature/data/LiteratureNames\";\nimport { SpecialServers } from \"./SpecialServers\";\n\n/**\n * The metadata describing the base state of servers on the network.\n * These values will be adjusted based on Bitnode multipliers when the Server objects are built out.\n */\ninterface IServerMetadata {\n /**\n * When populated, the base security level of the server.\n */\n hackDifficulty?: number | IMinMaxRange;\n\n /**\n * The DNS name of the server.\n */\n hostname: string;\n\n /**\n * When populated, the files will be added to the server when created.\n */\n literature?: string[];\n\n /**\n * When populated, the exponent of 2^x amount of RAM the server has.\n * This should be in the range of 1-20, to match the Player's max RAM.\n */\n maxRamExponent?: number | IMinMaxRange;\n\n /**\n * How much money the server starts out with.\n */\n moneyAvailable: number | IMinMaxRange;\n\n /**\n * The number of network layers away from the `home` server.\n * This value is between 1 and 15.\n * If this is not populated, @specialName should be.\n */\n networkLayer?: number | IMinMaxRange;\n\n /**\n * The number of ports that must be opened before the player can execute NUKE.\n */\n numOpenPortsRequired: number;\n\n /**\n * The organization that the server belongs to.\n */\n organizationName: string;\n\n /**\n * The minimum hacking level before the player can run NUKE.\n */\n requiredHackingSkill: number | IMinMaxRange;\n\n /**\n * The growth factor for the server.\n */\n serverGrowth?: number | IMinMaxRange;\n\n /**\n * A \"unique\" server that has special implications when the player manually hacks it.\n */\n specialName?: string;\n\n [key: string]: any;\n}\n\n/**\n * The metadata for building up the servers on the network.\n */\nexport const serverMetadata: IServerMetadata[] = [\n {\n hackDifficulty: 99,\n hostname: \"ecorp\",\n moneyAvailable: {\n max: 70e9,\n min: 30e9,\n },\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumECorp,\n requiredHackingSkill: {\n max: 1400,\n min: 1050,\n },\n serverGrowth: 99,\n specialName: LocationName.AevumECorp,\n },\n {\n hackDifficulty: 99,\n hostname: \"megacorp\",\n moneyAvailable: {\n max: 60e9,\n min: 40e9,\n },\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12MegaCorp,\n requiredHackingSkill: {\n max: 1350,\n min: 1100,\n },\n serverGrowth: 99,\n specialName: LocationName.Sector12MegaCorp,\n },\n {\n hackDifficulty: {\n max: 88,\n min: 72,\n },\n hostname: \"b-and-a\",\n moneyAvailable: {\n max: 30e9,\n min: 15e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumBachmanAndAssociates,\n requiredHackingSkill: {\n max: 1150,\n min: 900,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n specialName: LocationName.AevumBachmanAndAssociates,\n },\n {\n hackDifficulty: {\n max: 97,\n min: 88,\n },\n hostname: \"blade\",\n literature: [LiteratureNames.BeyondMan],\n maxRamExponent: {\n max: 9,\n min: 5,\n },\n moneyAvailable: {\n max: 40e9,\n min: 10e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12BladeIndustries,\n requiredHackingSkill: {\n max: 1200,\n min: 900,\n },\n serverGrowth: {\n max: 85,\n min: 55,\n },\n specialName: LocationName.Sector12BladeIndustries,\n },\n {\n hackDifficulty: 99,\n hostname: \"nwo\",\n literature: [LiteratureNames.TheHiddenWorld],\n moneyAvailable: {\n max: 40e9,\n min: 20e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenNWO,\n requiredHackingSkill: {\n max: 1300,\n min: 950,\n },\n serverGrowth: {\n max: 95,\n min: 65,\n },\n specialName: LocationName.VolhavenNWO,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 45,\n },\n hostname: \"clarkinc\",\n literature: [LiteratureNames.BeyondMan, LiteratureNames.CostOfImmortality],\n moneyAvailable: {\n max: 25e9,\n min: 15e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumClarkeIncorporated,\n requiredHackingSkill: {\n max: 1250,\n min: 950,\n },\n serverGrowth: {\n max: 75,\n min: 45,\n },\n specialName: LocationName.AevumClarkeIncorporated,\n },\n {\n hackDifficulty: {\n max: 99,\n min: 90,\n },\n hostname: \"omnitek\",\n literature: [LiteratureNames.CodedIntelligence, LiteratureNames.HistoryOfSynthoids],\n maxRamExponent: {\n max: 9,\n min: 7,\n },\n moneyAvailable: {\n max: 22e9,\n min: 13e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenOmniTekIncorporated,\n requiredHackingSkill: {\n max: 1100,\n min: 900,\n },\n serverGrowth: {\n max: 99,\n min: 95,\n },\n specialName: LocationName.VolhavenOmniTekIncorporated,\n },\n {\n hackDifficulty: {\n max: 75,\n min: 55,\n },\n hostname: \"4sigma\",\n moneyAvailable: {\n max: 25e9,\n min: 15e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12FourSigma,\n requiredHackingSkill: {\n max: 1250,\n min: 900,\n },\n serverGrowth: {\n max: 99,\n min: 75,\n },\n specialName: LocationName.Sector12FourSigma,\n },\n {\n hackDifficulty: {\n max: 99,\n min: 95,\n },\n hostname: \"kuai-gong\",\n moneyAvailable: {\n max: 30e9,\n min: 20e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.ChongqingKuaiGongInternational,\n requiredHackingSkill: {\n max: 1300,\n min: 950,\n },\n serverGrowth: {\n max: 99,\n min: 90,\n },\n specialName: LocationName.ChongqingKuaiGongInternational,\n },\n {\n hackDifficulty: {\n max: 97,\n min: 83,\n },\n hostname: \"fulcrumtech\",\n literature: [LiteratureNames.SimulatedReality],\n maxRamExponent: {\n max: 11,\n min: 7,\n },\n moneyAvailable: {\n max: 1800e6,\n min: 1400e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumFulcrumTechnologies,\n requiredHackingSkill: {\n max: 1250,\n min: 950,\n },\n serverGrowth: {\n max: 99,\n min: 80,\n },\n specialName: LocationName.AevumFulcrumTechnologies,\n },\n {\n hackDifficulty: 99,\n hostname: \"fulcrumassets\",\n moneyAvailable: 1e6,\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumFulcrumTechnologies,\n requiredHackingSkill: {\n max: 1600,\n min: 1100,\n },\n serverGrowth: 1,\n specialName: SpecialServers.FulcrumSecretTechnologies,\n },\n {\n hackDifficulty: {\n max: 92,\n min: 78,\n },\n hostname: \"stormtech\",\n moneyAvailable: {\n max: 1200e6,\n min: 1000e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.IshimaStormTechnologies,\n requiredHackingSkill: {\n max: 1075,\n min: 875,\n },\n serverGrowth: {\n max: 92,\n min: 68,\n },\n specialName: LocationName.IshimaStormTechnologies,\n },\n {\n hackDifficulty: {\n max: 96,\n min: 84,\n },\n hostname: \"defcomm\",\n moneyAvailable: {\n max: 950e6,\n min: 800e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.NewTokyoDefComm,\n requiredHackingSkill: {\n max: 1050,\n min: 850,\n },\n serverGrowth: {\n max: 73,\n min: 47,\n },\n specialName: LocationName.NewTokyoDefComm,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 70,\n },\n hostname: \"infocomm\",\n moneyAvailable: {\n max: 900e6,\n min: 600e6,\n },\n networkLayer: 10,\n numOpenPortsRequired: 5,\n organizationName: \"InfoComm\",\n requiredHackingSkill: {\n max: 950,\n min: 875,\n },\n serverGrowth: {\n max: 75,\n min: 35,\n },\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"helios\",\n literature: [LiteratureNames.BeyondMan],\n maxRamExponent: {\n max: 8,\n min: 5,\n },\n moneyAvailable: {\n max: 750e6,\n min: 550e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenHeliosLabs,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n specialName: LocationName.VolhavenHeliosLabs,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: \"vitalife\",\n literature: [LiteratureNames.AGreenTomorrow],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 800e6,\n min: 700e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.NewTokyoVitaLife,\n requiredHackingSkill: {\n max: 900,\n min: 775,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n specialName: LocationName.NewTokyoVitaLife,\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"icarus\",\n moneyAvailable: {\n max: 1000e6,\n min: 900e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12IcarusMicrosystems,\n requiredHackingSkill: {\n max: 925,\n min: 850,\n },\n serverGrowth: {\n max: 95,\n min: 85,\n },\n specialName: LocationName.Sector12IcarusMicrosystems,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: \"univ-energy\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 1200e6,\n min: 1100e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 4,\n organizationName: LocationName.Sector12UniversalEnergy,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 90,\n min: 80,\n },\n specialName: LocationName.Sector12UniversalEnergy,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"titan-labs\",\n literature: [LiteratureNames.CodedIntelligence],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 900000000,\n min: 750000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 5,\n organizationName: \"Titan Laboratories\",\n requiredHackingSkill: {\n max: 875,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n },\n {\n hackDifficulty: {\n max: 75,\n min: 65,\n },\n hostname: \"microdyne\",\n literature: [LiteratureNames.SyntheticMuscles],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 700000000,\n min: 500000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 5,\n organizationName: \"Microdyne Technologies\",\n requiredHackingSkill: {\n max: 875,\n min: 800,\n },\n serverGrowth: {\n max: 90,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"taiyang-digital\",\n literature: [LiteratureNames.AGreenTomorrow, LiteratureNames.BrighterThanTheSun],\n moneyAvailable: {\n max: 900000000,\n min: 800000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 5,\n organizationName: \"Taiyang Digital\",\n requiredHackingSkill: {\n max: 950,\n min: 850,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"galactic-cyber\",\n moneyAvailable: {\n max: 850000000,\n min: 750000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumGalacticCybersystems,\n requiredHackingSkill: {\n max: 875,\n min: 825,\n },\n serverGrowth: {\n max: 90,\n min: 70,\n },\n specialName: LocationName.AevumGalacticCybersystems,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: \"aerocorp\",\n literature: [LiteratureNames.ManAndMachine],\n moneyAvailable: {\n max: 1200000000,\n min: 1000000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumAeroCorp,\n requiredHackingSkill: {\n max: 925,\n min: 850,\n },\n serverGrowth: {\n max: 65,\n min: 55,\n },\n specialName: LocationName.AevumAeroCorp,\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"omnia\",\n literature: [LiteratureNames.HistoryOfSynthoids],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 1000000000,\n min: 900000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenOmniaCybersystems,\n requiredHackingSkill: {\n max: 950,\n min: 850,\n },\n serverGrowth: {\n max: 70,\n min: 60,\n },\n specialName: LocationName.VolhavenOmniaCybersystems,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"zb-def\",\n literature: [LiteratureNames.SyntheticMuscles],\n moneyAvailable: {\n max: 1100000000,\n min: 900000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 4,\n organizationName: \"ZB Defense Industries\",\n requiredHackingSkill: {\n max: 825,\n min: 775,\n },\n serverGrowth: {\n max: 75,\n min: 65,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"applied-energetics\",\n moneyAvailable: {\n max: 1000000000,\n min: 700000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 4,\n organizationName: \"Applied Energetics\",\n requiredHackingSkill: {\n max: 850,\n min: 775,\n },\n serverGrowth: {\n max: 75,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"solaris\",\n literature: [LiteratureNames.AGreenTomorrow, LiteratureNames.TheFailedFrontier],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 900000000,\n min: 700000000,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.ChongqingSolarisSpaceSystems,\n requiredHackingSkill: {\n max: 850,\n min: 750,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n specialName: LocationName.ChongqingSolarisSpaceSystems,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 75,\n },\n hostname: \"deltaone\",\n moneyAvailable: {\n max: 1700000000,\n min: 1300000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12DeltaOne,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 70,\n min: 50,\n },\n specialName: LocationName.Sector12DeltaOne,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 75,\n },\n hostname: \"global-pharm\",\n literature: [LiteratureNames.AGreenTomorrow],\n maxRamExponent: {\n max: 6,\n min: 3,\n },\n moneyAvailable: {\n max: 1750000000,\n min: 1500000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 4,\n organizationName: LocationName.NewTokyoGlobalPharmaceuticals,\n requiredHackingSkill: {\n max: 850,\n min: 750,\n },\n serverGrowth: {\n max: 90,\n min: 80,\n },\n specialName: LocationName.NewTokyoGlobalPharmaceuticals,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"nova-med\",\n moneyAvailable: {\n max: 1250000000,\n min: 1100000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 4,\n organizationName: LocationName.IshimaNovaMedical,\n requiredHackingSkill: {\n max: 850,\n min: 775,\n },\n serverGrowth: {\n max: 85,\n min: 65,\n },\n specialName: LocationName.IshimaNovaMedical,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 70,\n },\n hostname: \"zeus-med\",\n moneyAvailable: {\n max: 1500000000,\n min: 1300000000,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: \"Zeus Medical\",\n requiredHackingSkill: {\n max: 850,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"unitalife\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 1100000000,\n min: 1000000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 4,\n organizationName: \"UnitaLife Group\",\n requiredHackingSkill: {\n max: 825,\n min: 775,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"lexo-corp\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 800000000,\n min: 700000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.VolhavenLexoCorp,\n requiredHackingSkill: {\n max: 750,\n min: 650,\n },\n serverGrowth: {\n max: 65,\n min: 55,\n },\n specialName: LocationName.VolhavenLexoCorp,\n },\n {\n hackDifficulty: {\n max: 60,\n min: 40,\n },\n hostname: \"rho-construction\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 700000000,\n min: 500000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumRhoConstruction,\n requiredHackingSkill: {\n max: 525,\n min: 475,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumRhoConstruction,\n },\n {\n hackDifficulty: {\n max: 70,\n min: 50,\n },\n hostname: \"alpha-ent\",\n literature: [LiteratureNames.Sector12Crime],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 750000000,\n min: 600000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.Sector12AlphaEnterprises,\n requiredHackingSkill: {\n max: 600,\n min: 500,\n },\n serverGrowth: {\n max: 60,\n min: 50,\n },\n specialName: LocationName.Sector12AlphaEnterprises,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"aevum-police\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 400000000,\n min: 200000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.AevumPolice,\n requiredHackingSkill: {\n max: 450,\n min: 400,\n },\n serverGrowth: {\n max: 50,\n min: 30,\n },\n specialName: LocationName.AevumPolice,\n },\n {\n hackDifficulty: {\n max: 55,\n min: 45,\n },\n hostname: \"rothman-uni\",\n literature: [\n LiteratureNames.SecretSocieties,\n LiteratureNames.TheFailedFrontier,\n LiteratureNames.TensionsInTechRace,\n ],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 250000000,\n min: 175000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: LocationName.Sector12RothmanUniversity,\n requiredHackingSkill: {\n max: 430,\n min: 370,\n },\n serverGrowth: {\n max: 45,\n min: 35,\n },\n specialName: LocationName.Sector12RothmanUniversity,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 65,\n },\n hostname: \"zb-institute\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 1100000000,\n min: 800000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenZBInstituteOfTechnology,\n requiredHackingSkill: {\n max: 775,\n min: 725,\n },\n serverGrowth: {\n max: 85,\n min: 75,\n },\n specialName: LocationName.VolhavenZBInstituteOfTechnology,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 45,\n },\n hostname: \"summit-uni\",\n literature: [LiteratureNames.SecretSocieties, LiteratureNames.TheFailedFrontier, LiteratureNames.SyntheticMuscles],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 350000000,\n min: 200000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumSummitUniversity,\n requiredHackingSkill: {\n max: 475,\n min: 425,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumSummitUniversity,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"syscore\",\n moneyAvailable: {\n max: 600000000,\n min: 400000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 4,\n organizationName: LocationName.VolhavenSysCoreSecurities,\n requiredHackingSkill: {\n max: 650,\n min: 550,\n },\n serverGrowth: {\n max: 70,\n min: 60,\n },\n specialName: LocationName.VolhavenSysCoreSecurities,\n },\n {\n hackDifficulty: {\n max: 70,\n min: 60,\n },\n hostname: \"catalyst\",\n literature: [LiteratureNames.TensionsInTechRace],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 550000000,\n min: 300000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: \"Catalyst Ventures\",\n requiredHackingSkill: {\n max: 450,\n min: 400,\n },\n serverGrowth: {\n max: 55,\n min: 25,\n },\n },\n {\n hackDifficulty: {\n max: 45,\n min: 35,\n },\n hostname: \"the-hub\",\n maxRamExponent: {\n max: 6,\n min: 3,\n },\n moneyAvailable: {\n max: 200000000,\n min: 150000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"The Hub\",\n requiredHackingSkill: {\n max: 325,\n min: 275,\n },\n serverGrowth: {\n max: 55,\n min: 45,\n },\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"comptek\",\n literature: [LiteratureNames.ManAndMachine],\n moneyAvailable: {\n max: 250000000,\n min: 220000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 3,\n organizationName: LocationName.VolhavenCompuTek,\n requiredHackingSkill: {\n max: 400,\n min: 300,\n },\n serverGrowth: {\n max: 65,\n min: 45,\n },\n specialName: LocationName.VolhavenCompuTek,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"netlink\",\n literature: [LiteratureNames.SimulatedReality],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: 275000000,\n networkLayer: 4,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumNetLinkTechnologies,\n requiredHackingSkill: {\n max: 425,\n min: 375,\n },\n serverGrowth: {\n max: 75,\n min: 45,\n },\n specialName: LocationName.AevumNetLinkTechnologies,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 35,\n },\n hostname: \"johnson-ortho\",\n moneyAvailable: {\n max: 85000000,\n min: 70000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"Johnson Orthopedics\",\n requiredHackingSkill: {\n max: 300,\n min: 250,\n },\n serverGrowth: {\n max: 65,\n min: 35,\n },\n },\n {\n hackDifficulty: 1,\n hostname: \"n00dles\",\n literature: [],\n maxRamExponent: 2,\n moneyAvailable: 70000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.NewTokyoNoodleBar,\n requiredHackingSkill: 1,\n serverGrowth: 3000,\n specialName: LocationName.NewTokyoNoodleBar,\n },\n {\n hackDifficulty: 10,\n hostname: \"foodnstuff\",\n literature: [LiteratureNames.Sector12Crime],\n maxRamExponent: 4,\n moneyAvailable: 2000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.Sector12FoodNStuff,\n requiredHackingSkill: 1,\n serverGrowth: 5,\n specialName: LocationName.Sector12FoodNStuff,\n },\n {\n hackDifficulty: 10,\n hostname: \"sigma-cosmetics\",\n maxRamExponent: 4,\n moneyAvailable: 2300000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"Sigma Cosmetics\",\n requiredHackingSkill: 5,\n serverGrowth: 10,\n },\n {\n hackDifficulty: 15,\n hostname: \"joesguns\",\n maxRamExponent: 4,\n moneyAvailable: 2500000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.Sector12JoesGuns,\n requiredHackingSkill: 10,\n serverGrowth: 20,\n specialName: LocationName.Sector12JoesGuns,\n },\n {\n hackDifficulty: 25,\n hostname: \"zer0\",\n maxRamExponent: 5,\n moneyAvailable: 7500000,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: \"ZER0 Nightclub\",\n requiredHackingSkill: 75,\n serverGrowth: 40,\n },\n {\n hackDifficulty: 20,\n hostname: \"nectar-net\",\n maxRamExponent: 4,\n moneyAvailable: 2750000,\n networkLayer: 2,\n numOpenPortsRequired: 0,\n organizationName: \"Nectar Nightclub Network\",\n requiredHackingSkill: 20,\n serverGrowth: 25,\n },\n {\n hackDifficulty: 25,\n hostname: \"neo-net\",\n literature: [LiteratureNames.TheHiddenWorld],\n maxRamExponent: 5,\n moneyAvailable: 5000000,\n networkLayer: 3,\n numOpenPortsRequired: 1,\n organizationName: \"Neo Nightclub Network\",\n requiredHackingSkill: 50,\n serverGrowth: 25,\n },\n {\n hackDifficulty: 30,\n hostname: \"silver-helix\",\n literature: [LiteratureNames.NewTriads],\n maxRamExponent: 6,\n moneyAvailable: 45000000,\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: \"Silver Helix\",\n requiredHackingSkill: 150,\n serverGrowth: 30,\n },\n {\n hackDifficulty: 15,\n hostname: \"hong-fang-tea\",\n literature: [LiteratureNames.BrighterThanTheSun],\n maxRamExponent: 4,\n moneyAvailable: 3000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"HongFang Teahouse\",\n requiredHackingSkill: 30,\n serverGrowth: 20,\n },\n {\n hackDifficulty: 15,\n hostname: \"harakiri-sushi\",\n maxRamExponent: 4,\n moneyAvailable: 4000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"HaraKiri Sushi Bar Network\",\n requiredHackingSkill: 40,\n serverGrowth: 40,\n },\n {\n hackDifficulty: 20,\n hostname: \"phantasy\",\n maxRamExponent: 5,\n moneyAvailable: 24000000,\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: \"Phantasy Club\",\n requiredHackingSkill: 100,\n serverGrowth: 35,\n },\n {\n hackDifficulty: 15,\n hostname: \"max-hardware\",\n maxRamExponent: 5,\n moneyAvailable: 10000000,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: \"Max Hardware Store\",\n requiredHackingSkill: 80,\n serverGrowth: 30,\n },\n {\n hackDifficulty: {\n max: 35,\n min: 25,\n },\n hostname: \"omega-net\",\n literature: [LiteratureNames.TheNewGod],\n maxRamExponent: 5,\n moneyAvailable: {\n max: 70000000,\n min: 60000000,\n },\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: LocationName.IshimaOmegaSoftware,\n requiredHackingSkill: {\n max: 220,\n min: 180,\n },\n serverGrowth: {\n max: 40,\n min: 30,\n },\n specialName: LocationName.IshimaOmegaSoftware,\n },\n {\n hackDifficulty: {\n max: 45,\n min: 35,\n },\n hostname: \"crush-fitness\",\n moneyAvailable: {\n max: 60000000,\n min: 40000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"Crush Fitness\",\n requiredHackingSkill: {\n max: 275,\n min: 225,\n },\n serverGrowth: {\n max: 33,\n min: 27,\n },\n specialName: LocationName.AevumCrushFitnessGym,\n },\n {\n hackDifficulty: 30,\n hostname: \"iron-gym\",\n maxRamExponent: 5,\n moneyAvailable: 20000000,\n networkLayer: 1,\n numOpenPortsRequired: 1,\n organizationName: \"Iron Gym Network\",\n requiredHackingSkill: 100,\n serverGrowth: 20,\n specialName: LocationName.Sector12IronGym,\n },\n {\n hackDifficulty: {\n max: 55,\n min: 45,\n },\n hostname: \"millenium-fitness\",\n maxRamExponent: {\n max: 8,\n min: 4,\n },\n moneyAvailable: 250000000,\n networkLayer: 6,\n numOpenPortsRequired: 3,\n organizationName: \"Millenium Fitness Network\",\n requiredHackingSkill: {\n max: 525,\n min: 475,\n },\n serverGrowth: {\n max: 45,\n min: 25,\n },\n specialName: LocationName.VolhavenMilleniumFitnessGym,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"powerhouse-fitness\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: 900000000,\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: \"Powerhouse Fitness\",\n requiredHackingSkill: {\n max: 1100,\n min: 950,\n },\n serverGrowth: {\n max: 60,\n min: 50,\n },\n specialName: LocationName.Sector12PowerhouseGym,\n },\n {\n hackDifficulty: {\n max: 60,\n min: 40,\n },\n hostname: \"snap-fitness\",\n moneyAvailable: 450000000,\n networkLayer: 7,\n numOpenPortsRequired: 4,\n organizationName: \"Snap Fitness\",\n requiredHackingSkill: {\n max: 800,\n min: 675,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumSnapFitnessGym,\n },\n {\n hackDifficulty: 0,\n hostname: \"run4theh111z\",\n literature: [LiteratureNames.SimulatedReality, LiteratureNames.TheNewGod],\n maxRamExponent: {\n max: 9,\n min: 5,\n },\n moneyAvailable: 0,\n networkLayer: 11,\n numOpenPortsRequired: 4,\n organizationName: \"The Runners\",\n requiredHackingSkill: {\n max: 550,\n min: 505,\n },\n serverGrowth: 0,\n specialName: SpecialServers.BitRunnersServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"I.I.I.I\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: {\n max: 8,\n min: 4,\n },\n moneyAvailable: 0,\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: \"I.I.I.I\",\n requiredHackingSkill: {\n max: 365,\n min: 340,\n },\n serverGrowth: 0,\n specialName: SpecialServers.TheBlackHandServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"avmnite-02h\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: 0,\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"NiteSec\",\n requiredHackingSkill: {\n max: 220,\n min: 202,\n },\n serverGrowth: 0,\n specialName: SpecialServers.NiteSecServer,\n },\n {\n hackDifficulty: 0,\n hostname: \".\",\n maxRamExponent: 4,\n moneyAvailable: 0,\n networkLayer: 13,\n numOpenPortsRequired: 4,\n organizationName: \".\",\n requiredHackingSkill: {\n max: 550,\n min: 505,\n },\n serverGrowth: 0,\n specialName: SpecialServers.TheDarkArmyServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"CSEC\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: 3,\n moneyAvailable: 0,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: \"CyberSec\",\n requiredHackingSkill: {\n max: 60,\n min: 51,\n },\n serverGrowth: 0,\n specialName: SpecialServers.CyberSecServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"The-Cave\",\n literature: [LiteratureNames.AlphaOmega],\n moneyAvailable: 0,\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: \"Helios\",\n requiredHackingSkill: 925,\n serverGrowth: 0,\n specialName: SpecialServers.DaedalusServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"w0r1d_d43m0n\",\n moneyAvailable: 0,\n numOpenPortsRequired: 5,\n organizationName: \"w0r1d_d43m0n\",\n requiredHackingSkill: 3000,\n serverGrowth: 0,\n specialName: SpecialServers.WorldDaemon,\n },\n];\n","import { CONSTANTS } from \"../Constants\";\nimport * as names from \"./data/companypositionnames\";\n\n/* tslint:disable:completed-docs */\n\nexport interface IConstructorParams {\n name: string;\n nextPosition: string | null;\n baseSalary: number;\n repMultiplier: number;\n\n reqdHacking?: number;\n reqdStrength?: number;\n reqdDefense?: number;\n reqdDexterity?: number;\n reqdAgility?: number;\n reqdCharisma?: number;\n reqdReputation?: number;\n\n hackingEffectiveness?: number;\n strengthEffectiveness?: number;\n defenseEffectiveness?: number;\n dexterityEffectiveness?: number;\n agilityEffectiveness?: number;\n charismaEffectiveness?: number;\n\n hackingExpGain?: number;\n strengthExpGain?: number;\n defenseExpGain?: number;\n dexterityExpGain?: number;\n agilityExpGain?: number;\n charismaExpGain?: number;\n}\n\nexport class CompanyPosition {\n /**\n * Position title\n */\n name: string;\n\n /**\n * Title of next position to be promoted to\n */\n nextPosition: string | null;\n\n /**\n * Base salary for this position ($ per 200ms game cycle)\n * Will be multiplier by a company-specific multiplier for final salary\n */\n baseSalary: number;\n\n /**\n * Reputation multiplier\n */\n repMultiplier: number;\n\n /**\n * Required stats to earn this position\n */\n requiredAgility: number;\n requiredCharisma: number;\n requiredDefense: number;\n requiredDexterity: number;\n requiredHacking: number;\n requiredStrength: number;\n\n /**\n * Required company reputation to earn this position\n */\n requiredReputation: number;\n\n /**\n * Effectiveness of each stat time for job performance\n */\n hackingEffectiveness: number;\n strengthEffectiveness: number;\n defenseEffectiveness: number;\n dexterityEffectiveness: number;\n agilityEffectiveness: number;\n charismaEffectiveness: number;\n\n /**\n * Experience gain for performing job (per 200ms game cycle)\n */\n hackingExpGain: number;\n strengthExpGain: number;\n defenseExpGain: number;\n dexterityExpGain: number;\n agilityExpGain: number;\n charismaExpGain: number;\n\n constructor(p: IConstructorParams) {\n this.name = p.name;\n this.nextPosition = p.nextPosition;\n this.baseSalary = p.baseSalary;\n this.repMultiplier = p.repMultiplier;\n\n this.requiredHacking = p.reqdHacking != null ? p.reqdHacking : 0;\n this.requiredStrength = p.reqdStrength != null ? p.reqdStrength : 0;\n this.requiredDefense = p.reqdDefense != null ? p.reqdDefense : 0;\n this.requiredDexterity = p.reqdDexterity != null ? p.reqdDexterity : 0;\n this.requiredAgility = p.reqdAgility != null ? p.reqdAgility : 0;\n this.requiredCharisma = p.reqdCharisma != null ? p.reqdCharisma : 0;\n this.requiredReputation = p.reqdReputation != null ? p.reqdReputation : 0;\n\n this.hackingEffectiveness = p.hackingEffectiveness != null ? p.hackingEffectiveness : 0;\n this.strengthEffectiveness = p.strengthEffectiveness != null ? p.strengthEffectiveness : 0;\n this.defenseEffectiveness = p.defenseEffectiveness != null ? p.defenseEffectiveness : 0;\n this.dexterityEffectiveness = p.dexterityEffectiveness != null ? p.dexterityEffectiveness : 0;\n this.agilityEffectiveness = p.agilityEffectiveness != null ? p.agilityEffectiveness : 0;\n this.charismaEffectiveness = p.charismaEffectiveness != null ? p.charismaEffectiveness : 0;\n\n if (\n Math.round(\n this.hackingEffectiveness +\n this.strengthEffectiveness +\n this.defenseEffectiveness +\n this.dexterityEffectiveness +\n this.agilityEffectiveness +\n this.charismaEffectiveness,\n ) !== 100\n ) {\n console.error(`CompanyPosition ${this.name} parameters do not sum to 100`);\n }\n\n this.hackingExpGain = p.hackingExpGain != null ? p.hackingExpGain : 0;\n this.strengthExpGain = p.strengthExpGain != null ? p.strengthExpGain : 0;\n this.defenseExpGain = p.defenseExpGain != null ? p.defenseExpGain : 0;\n this.dexterityExpGain = p.dexterityExpGain != null ? p.dexterityExpGain : 0;\n this.agilityExpGain = p.agilityExpGain != null ? p.agilityExpGain : 0;\n this.charismaExpGain = p.charismaExpGain != null ? p.charismaExpGain : 0;\n }\n\n calculateJobPerformance(hack: number, str: number, def: number, dex: number, agi: number, cha: number): number {\n const hackRatio: number = (this.hackingEffectiveness * hack) / CONSTANTS.MaxSkillLevel;\n const strRatio: number = (this.strengthEffectiveness * str) / CONSTANTS.MaxSkillLevel;\n const defRatio: number = (this.defenseEffectiveness * def) / CONSTANTS.MaxSkillLevel;\n const dexRatio: number = (this.dexterityEffectiveness * dex) / CONSTANTS.MaxSkillLevel;\n const agiRatio: number = (this.agilityEffectiveness * agi) / CONSTANTS.MaxSkillLevel;\n const chaRatio: number = (this.charismaEffectiveness * cha) / CONSTANTS.MaxSkillLevel;\n\n let reputationGain: number =\n (this.repMultiplier * (hackRatio + strRatio + defRatio + dexRatio + agiRatio + chaRatio)) / 100;\n if (isNaN(reputationGain)) {\n console.error(\"Company reputation gain calculated to be NaN\");\n reputationGain = 0;\n }\n\n return reputationGain;\n }\n\n isSoftwareJob(): boolean {\n return names.SoftwareCompanyPositions.includes(this.name);\n }\n\n isITJob(): boolean {\n return names.ITCompanyPositions.includes(this.name);\n }\n\n isSecurityEngineerJob(): boolean {\n return names.SecurityEngineerCompanyPositions.includes(this.name);\n }\n\n isNetworkEngineerJob(): boolean {\n return names.NetworkEngineerCompanyPositions.includes(this.name);\n }\n\n isBusinessJob(): boolean {\n return names.BusinessCompanyPositions.includes(this.name);\n }\n\n isSecurityJob(): boolean {\n return names.SecurityCompanyPositions.includes(this.name);\n }\n\n isAgentJob(): boolean {\n return names.AgentCompanyPositions.includes(this.name);\n }\n\n isSoftwareConsultantJob(): boolean {\n return names.SoftwareConsultantCompanyPositions.includes(this.name);\n }\n\n isBusinessConsultantJob(): boolean {\n return names.BusinessConsultantCompanyPositions.includes(this.name);\n }\n\n isPartTimeJob(): boolean {\n return names.PartTimeCompanyPositions.includes(this.name);\n }\n}\n","import React from \"react\";\nimport { SourceFile } from \"./SourceFile\";\nimport { IMap } from \"../types\";\n\nexport const SourceFiles: IMap<SourceFile> = {};\n\nSourceFiles[\"SourceFile1\"] = new SourceFile(\n 1,\n (\n <>\n This Source-File lets the player start with 32GB of RAM on his/her home computer. It also increases all of the\n player's multipliers by:\n <br />\n <br />\n Level 1: 16%\n <br />\n Level 2: 24%\n <br />\n Level 3: 28%\n </>\n ),\n);\nSourceFiles[\"SourceFile2\"] = new SourceFile(\n 2,\n (\n <>\n This Source-File allows you to form gangs in other BitNodes once your karma decreases to a certain value. It also\n increases the player's crime success rate, crime money, and charisma multipliers by:\n <br />\n <br />\n Level 1: 24%\n <br />\n Level 2: 36%\n <br />\n Level 3: 42%\n </>\n ),\n);\nSourceFiles[\"SourceFile3\"] = new SourceFile(\n 3,\n (\n <>\n This Source-File lets you create corporations on other BitNodes (although some BitNodes will disable this\n mechanic). This Source-File also increases your charisma and company salary multipliers by:\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nSourceFiles[\"SourceFile4\"] = new SourceFile(\n 4,\n (\n <>\n This Source-File lets you access and use the Singularity Functions in every BitNode. Every level of this\n Source-File reduces the RAM cost of Singularity functions.\n </>\n ),\n);\nSourceFiles[\"SourceFile5\"] = new SourceFile(\n 5,\n (\n <>\n This Source-File grants a special new stat called Intelligence. Intelligence is unique because it is permanent and\n persistent (it never gets reset back to 1). However, gaining Intelligence experience is much slower than other\n stats, and it is also hidden (you won't know when you gain experience and how much). Higher Intelligence levels\n will boost your production for many actions in the game. In addition, this Source-File will unlock the\n getBitNodeMultipliers() Netscript function and let you start with Formulas.exe, and will raise all of your\n hacking-related multipliers by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nSourceFiles[\"SourceFile6\"] = new SourceFile(\n 6,\n (\n <>\n This Source-File allows you to access the NSA's Bladeburner Division in other BitNodes. In addition, this\n Source-File will raise both the level and experience gain rate of all your combat stats by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nSourceFiles[\"SourceFile7\"] = new SourceFile(\n 7,\n (\n <>\n This Source-File allows you to access the Bladeburner Netscript API in other BitNodes. In addition, this\n Source-File will increase all of your Bladeburner multipliers by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nSourceFiles[\"SourceFile8\"] = new SourceFile(\n 8,\n (\n <>\n This Source-File grants the following benefits:\n <br />\n <br />\n Level 1: Permanent access to WSE and TIX API\n <br />\n Level 2: Ability to short stocks in other BitNodes\n <br />\n Level 3: Ability to use limit/stop orders in other BitNodes\n <br />\n <br />\n This Source-File also increases your hacking growth multipliers by:\n <br />\n Level 1: 12%\n <br />\n Level 2: 18%\n <br />\n Level 3: 21%\n </>\n ),\n);\nSourceFiles[\"SourceFile9\"] = new SourceFile(\n 9,\n (\n <>\n This Source-File grants the following benefits:\n <br />\n <br />\n Level 1: Permanently unlocks the Hacknet Server in other BitNodes\n <br />\n Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode\n <br />\n Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode\n <br />\n <br />\n (Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing\n Augmentations)\n <br />\n <br />\n This Source-File also increases your hacknet multipliers by:\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nSourceFiles[\"SourceFile10\"] = new SourceFile(\n 10,\n (\n <>\n This Source-File unlocks Sleeve technology in other BitNodes. Each level of this Source-File also grants you a\n Duplicate Sleeve\n </>\n ),\n);\nSourceFiles[\"SourceFile11\"] = new SourceFile(\n 11,\n (\n <>\n This Source-File makes it so that company favor increases BOTH the player's salary and reputation gain rate at\n that company by 1% per favor (rather than just the reputation gain). This Source-File also increases the player's\n company salary and reputation gain multipliers by:\n <br />\n <br />\n Level 1: 32%\n <br />\n Level 2: 48%\n <br />\n Level 3: 56%\n <br />\n <br />\n It also reduces the price increase for every aug bought by:\n <br />\n <br />\n Level 1: 4%\n <br />\n Level 2: 6%\n <br />\n Level 3: 7%\n </>\n ),\n);\nSourceFiles[\"SourceFile12\"] = new SourceFile(\n 12,\n <>This Source-File lets the player start with Neuroflux Governor equal to the level of this Source-File.</>,\n);\nSourceFiles[\"SourceFile13\"] = new SourceFile(\n 13,\n <>Each level of this Source-File increases the size of Stanek's Gift.</>,\n);\n","/**\n * Class representing a Script instance that is actively running.\n * A Script can have multiple active instances\n */\nimport { Script } from \"./Script\";\nimport { ScriptUrl } from \"./ScriptUrl\";\nimport { Settings } from \"../Settings/Settings\";\nimport { IMap } from \"../types\";\nimport { Terminal } from \"../Terminal\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { formatTime } from \"../utils/helpers/formatTime\";\n\nexport class RunningScript {\n // Script arguments\n args: any[] = [];\n\n // Map of [key: hostname] -> Hacking data. Used for offline progress calculations.\n // Hacking data format: [MoneyStolen, NumTimesHacked, NumTimesGrown, NumTimesWeaken]\n dataMap: IMap<number[]> = {};\n\n // Script filename\n filename = \"\";\n\n // This script's logs. An array of log entries\n logs: string[] = [];\n\n // Flag indicating whether the logs have been updated since\n // the last time the UI was updated\n logUpd = false;\n\n // Total amount of hacking experience earned from this script when offline\n offlineExpGained = 0;\n\n // Total amount of money made by this script when offline\n offlineMoneyMade = 0;\n\n // Number of seconds that the script has been running offline\n offlineRunningTime = 0.01;\n\n // Total amount of hacking experience earned from this script when online\n onlineExpGained = 0;\n\n // Total amount of money made by this script when online\n onlineMoneyMade = 0;\n\n // Number of seconds that this script has been running online\n onlineRunningTime = 0.01;\n\n // Process ID. Must be an integer and equals the PID of corresponding WorkerScript\n pid = -1;\n\n // How much RAM this script uses for ONE thread\n ramUsage = 0;\n\n // hostname of the server on which this script is running\n server = \"\";\n\n // Number of threads that this script is running with\n threads = 1;\n\n // Script urls for the current running script for translating urls back to file names in errors\n dependencies: ScriptUrl[] = [];\n\n constructor(script: Script | null = null, args: any[] = []) {\n if (script == null) {\n return;\n }\n this.filename = script.filename;\n this.args = args;\n this.server = script.server;\n this.ramUsage = script.ramUsage;\n this.dependencies = script.dependencies;\n }\n\n log(txt: string): void {\n if (this.logs.length > Settings.MaxLogCapacity) {\n this.logs.shift();\n }\n\n let logEntry = txt;\n if (Settings.TimestampsFormat) {\n logEntry = \"[\" + formatTime(Settings.TimestampsFormat) + \"] \" + logEntry;\n }\n\n this.logs.push(logEntry);\n this.logUpd = true;\n }\n\n displayLog(): void {\n for (let i = 0; i < this.logs.length; ++i) {\n Terminal.print(this.logs[i]);\n }\n }\n\n clearLog(): void {\n this.logs.length = 0;\n }\n\n // Update the moneyStolen and numTimesHack maps when hacking\n recordHack(hostname: string, moneyGained: number, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][0] += moneyGained;\n this.dataMap[hostname][1] += n;\n }\n\n // Update the grow map when calling grow()\n recordGrow(hostname: string, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][2] += n;\n }\n\n // Update the weaken map when calling weaken() {\n recordWeaken(hostname: string, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][3] += n;\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): any {\n return Generic_toJSON(\"RunningScript\", this);\n }\n\n // Initializes a RunningScript Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): RunningScript {\n return Generic_fromJSON(RunningScript, value.data);\n }\n}\n\nReviver.constructors.RunningScript = RunningScript;\n","import React from \"react\";\n\nimport { IBladeburner } from \"../IBladeburner\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { use } from \"../../ui/Context\";\nimport Button from \"@mui/material/Button\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n type: number;\n name: string;\n rerender: () => void;\n}\nexport function StartButton(props: IProps): React.ReactElement {\n const player = use.Player();\n const action = props.bladeburner.getActionObject({ name: props.name, type: props.type });\n if (action == null) {\n throw new Error(\"Failed to get Operation Object for: \" + props.name);\n }\n let disabled = false;\n if (action.count < 1) {\n disabled = true;\n }\n if (props.name === \"Raid\" && props.bladeburner.getCurrentCity().comms === 0) {\n disabled = true;\n }\n\n if (action instanceof BlackOperation && props.bladeburner.rank < action.reqdRank) {\n disabled = true;\n }\n function onStart(): void {\n if (disabled) return;\n props.bladeburner.action.type = props.type;\n props.bladeburner.action.name = props.name;\n if (!player.hasAugmentation(AugmentationNames.BladesSimulacrum, true)) player.singularityStopWork();\n props.bladeburner.startAction(player, props.bladeburner.action);\n props.rerender();\n }\n\n return (\n <Button sx={{ mx: 1 }} disabled={disabled} onClick={onStart}>\n Start\n </Button>\n );\n}\n","// Root React Component for the Corporation UI\nimport React, { useState, useEffect } from \"react\";\n\nimport { Theme, useTheme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Reputation } from \"./Reputation\";\nimport { KillScriptsModal } from \"./KillScriptsModal\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\n\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport IconButton from \"@mui/material/IconButton\";\nimport SaveIcon from \"@mui/icons-material/Save\";\nimport ClearAllIcon from \"@mui/icons-material/ClearAll\";\n\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../Context\";\nimport { StatsProgressOverviewCell } from \"./StatsProgressBar\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nimport { Box, Tooltip } from \"@mui/material\";\nimport { CONSTANTS } from \"../../Constants\";\n\ninterface IProps {\n save: () => void;\n killScripts: () => void;\n}\n\nfunction Intelligence(): React.ReactElement {\n const player = use.Player();\n const classes = useStyles();\n if (player.intelligence === 0) return <></>;\n return (\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.int }}>Int </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.int }}>{numeralWrapper.formatSkill(player.intelligence)}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-int-hook\" classes={{ root: classes.int }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n );\n}\n\nfunction Bladeburner(): React.ReactElement {\n const player = use.Player();\n const classes = useStyles();\n const bladeburner = player.bladeburner;\n if (bladeburner === null) return <></>;\n const action = bladeburner.getTypeAndNameFromActionId(bladeburner.action);\n if (action.type === \"Idle\") return <></>;\n return (\n <>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.cellNone }}>\n <Typography>Bladeburner:</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.cellNone }}>\n <Typography>\n {action.type}: {action.name}\n </Typography>\n </TableCell>\n </TableRow>\n </>\n );\n}\n\ninterface WorkInProgressOverviewProps {\n tooltip: React.ReactNode;\n header: React.ReactNode;\n children: React.ReactNode;\n onClickFocus: () => void;\n}\n\nfunction WorkInProgressOverview({\n tooltip,\n children,\n onClickFocus,\n header,\n}: WorkInProgressOverviewProps): React.ReactElement {\n const classes = useStyles();\n return (\n <>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.workCell }}>\n <Tooltip title={<>{tooltip}</>}>\n <Typography className={classes.workHeader} sx={{ pt: 1, pb: 0.5 }}>\n {header}\n </Typography>\n </Tooltip>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.workCell }}>\n <Typography className={classes.workSubtitles}>{children}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" align=\"center\" colSpan={2} classes={{ root: classes.cellNone }}>\n <Button sx={{ mt: 1 }} onClick={onClickFocus}>\n Focus\n </Button>\n </TableCell>\n </TableRow>\n </>\n );\n}\n\nfunction Work(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const onClickFocus = (): void => {\n player.startFocusing();\n router.toWork();\n };\n\n if (!player.isWorking || player.focus) return <></>;\n\n let details = <></>;\n let header = <></>;\n let innerText = <></>;\n if (player.workType === CONSTANTS.WorkTypeCompanyPartTime || player.workType === CONSTANTS.WorkTypeCompany) {\n details = (\n <>\n {player.jobs[player.companyName]} at <strong>{player.companyName}</strong>\n </>\n );\n header = (\n <>\n Working at <strong>{player.companyName}</strong>\n </>\n );\n innerText = (\n <>\n +<Reputation reputation={player.workRepGained} /> rep\n </>\n );\n } else if (player.workType === CONSTANTS.WorkTypeFaction) {\n details = (\n <>\n {player.factionWorkType} for <strong>{player.currentWorkFactionName}</strong>\n </>\n );\n header = (\n <>\n Working for <strong>{player.currentWorkFactionName}</strong>\n </>\n );\n innerText = (\n <>\n +<Reputation reputation={player.workRepGained} /> rep\n </>\n );\n } else if (player.workType === CONSTANTS.WorkTypeStudyClass) {\n details = <>{player.workType}</>;\n header = <>You are {player.className}</>;\n innerText = <>{convertTimeMsToTimeElapsedString(player.timeWorked)}</>;\n } else if (player.workType === CONSTANTS.WorkTypeCreateProgram) {\n details = <>Coding {player.createProgramName}</>;\n header = <>Creating a program</>;\n innerText = (\n <>\n {player.createProgramName}{\" \"}\n {((player.timeWorkedCreateProgram / player.timeNeededToCompleteWork) * 100).toFixed(2)}%\n </>\n );\n }\n\n return (\n <WorkInProgressOverview tooltip={details} header={header} onClickFocus={onClickFocus}>\n {innerText}\n </WorkInProgressOverview>\n );\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n workCell: {\n textAlign: \"center\",\n maxWidth: \"200px\",\n borderBottom: \"none\",\n padding: 0,\n margin: 0,\n },\n\n workHeader: {\n fontSize: \"0.9rem\",\n },\n\n workSubtitles: {\n fontSize: \"0.8rem\",\n },\n\n cellNone: {\n borderBottom: \"none\",\n padding: 0,\n margin: 0,\n },\n cell: {\n padding: 0,\n margin: 0,\n },\n hp: {\n color: theme.colors.hp,\n },\n money: {\n color: theme.colors.money,\n },\n hack: {\n color: theme.colors.hack,\n },\n combat: {\n color: theme.colors.combat,\n },\n cha: {\n color: theme.colors.cha,\n },\n int: {\n color: theme.colors.int,\n },\n }),\n);\n\nexport { useStyles as characterOverviewStyles };\n\nexport function CharacterOverview({ save, killScripts }: IProps): React.ReactElement {\n const [killOpen, setKillOpen] = useState(false);\n const player = use.Player();\n\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 600);\n return () => clearInterval(id);\n }, []);\n\n const classes = useStyles();\n const theme = useTheme();\n\n const hackingProgress = player.calculateSkillProgress(\n player.hacking_exp,\n player.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier,\n );\n const strengthProgress = player.calculateSkillProgress(\n player.strength_exp,\n player.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier,\n );\n const defenseProgress = player.calculateSkillProgress(\n player.defense_exp,\n player.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier,\n );\n const dexterityProgress = player.calculateSkillProgress(\n player.dexterity_exp,\n player.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier,\n );\n const agilityProgress = player.calculateSkillProgress(\n player.agility_exp,\n player.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier,\n );\n const charismaProgress = player.calculateSkillProgress(\n player.charisma_exp,\n player.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier,\n );\n\n return (\n <>\n <Table sx={{ display: \"block\", m: 1 }}>\n <TableBody>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.hp }}>HP </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.hp }}>\n {numeralWrapper.formatHp(player.hp)} / {numeralWrapper.formatHp(player.max_hp)}\n </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-hp-hook\" classes={{ root: classes.hp }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.money }}>Money </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.money }}>{numeralWrapper.formatMoney(player.money)}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-money-hook\" classes={{ root: classes.money }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.hack }}>Hack </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.hack }}>{numeralWrapper.formatSkill(player.hacking)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={hackingProgress} color={theme.colors.hack} />\n )}\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.hack }}></Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-hack-hook\" classes={{ root: classes.hack }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>Str </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>{numeralWrapper.formatSkill(player.strength)}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-str-hook\" classes={{ root: classes.combat }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={strengthProgress} color={theme.colors.combat} />\n )}\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>Def </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>{numeralWrapper.formatSkill(player.defense)}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-def-hook\" classes={{ root: classes.combat }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={defenseProgress} color={theme.colors.combat} />\n )}\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>Dex </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.combat }}>{numeralWrapper.formatSkill(player.dexterity)}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-dex-hook\" classes={{ root: classes.combat }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={dexterityProgress} color={theme.colors.combat} />\n )}\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.combat }}>Agi </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.combat }}>{numeralWrapper.formatSkill(player.agility)}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-agi-hook\" classes={{ root: classes.combat }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={agilityProgress} color={theme.colors.combat} />\n )}\n </TableRow>\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.cha }}>Cha </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.cha }}>{numeralWrapper.formatSkill(player.charisma)}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography id=\"overview-cha-hook\" classes={{ root: classes.cha }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={charismaProgress} color={theme.colors.cha} />\n )}\n </TableRow>\n\n <Intelligence />\n\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-extra-hook-0\" classes={{ root: classes.hack }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n <TableCell component=\"th\" scope=\"row\" align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-extra-hook-1\" classes={{ root: classes.hack }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n <TableCell component=\"th\" scope=\"row\" align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-extra-hook-2\" classes={{ root: classes.hack }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n <Work />\n <Bladeburner />\n </TableBody>\n </Table>\n <Box sx={{ display: \"flex\", borderTop: `1px solid ${Settings.theme.welllight}` }}>\n <Box sx={{ display: \"flex\", flex: 1, justifyContent: \"flex-start\", alignItems: \"center\" }}>\n <IconButton aria-label=\"save game\" onClick={save}>\n <Tooltip title=\"Save game\">\n <SaveIcon color={Settings.AutosaveInterval !== 0 ? \"primary\" : \"error\"} />\n </Tooltip>\n </IconButton>\n </Box>\n <Box sx={{ display: \"flex\", flex: 1, justifyContent: \"flex-end\", alignItems: \"center\" }}>\n <IconButton aria-label=\"kill all scripts\" onClick={() => setKillOpen(true)}>\n <Tooltip title=\"Kill all running scripts\">\n <ClearAllIcon color=\"error\" />\n </Tooltip>\n </IconButton>\n </Box>\n </Box>\n <KillScriptsModal open={killOpen} onClose={() => setKillOpen(false)} killScripts={killScripts} />\n </>\n );\n}\n","interface RNG {\n random(): number;\n}\n\n/*\n * very bad RNG, meant to be used as introduction to RNG manipulation. It has a\n * period of 1024.\n */\nclass RNG0 implements RNG {\n x: number;\n m = 1024;\n a = 341;\n c = 1;\n\n constructor() {\n this.x = 0;\n this.reset();\n }\n\n step(): void {\n this.x = (this.a * this.x + this.c) % this.m;\n }\n\n random(): number {\n this.step();\n return this.x / this.m;\n }\n\n reset(): void {\n this.x = new Date().getTime() % this.m;\n }\n}\n\nexport const BadRNG: RNG0 = new RNG0();\n\n/*\n * Wichmann–Hill PRNG\n * The period is 6e12.\n */\nexport class WHRNG implements RNG {\n s1 = 0;\n s2 = 0;\n s3 = 0;\n\n constructor(totalPlaytime: number) {\n // This one is seeded by the players total play time.\n const v: number = (totalPlaytime / 1000) % 30000;\n this.s1 = v;\n this.s2 = v;\n this.s3 = v;\n }\n\n step(): void {\n this.s1 = (171 * this.s1) % 30269;\n this.s2 = (172 * this.s2) % 30307;\n this.s3 = (170 * this.s3) % 30323;\n }\n\n random(): number {\n this.step();\n return (this.s1 / 30269.0 + this.s2 / 30307.0 + this.s3 / 30323.0) % 1.0;\n }\n}\n","import { format } from \"date-fns\";\n\nexport function formatTime(fmt: string): string {\n try {\n return format(new Date(), fmt);\n } catch (err: any) {\n return \"format error\";\n }\n}\n","import { IMap } from \"../../types\";\n\nexport type CorporationUpgrade = [number, number, number, number, string, string];\n\n// Corporation Upgrades\n// Upgrades for entire corporation, levelable upgrades\n// The data structure is an array with the following format\n// [index in Corporation upgrades array, base price, price mult, benefit mult (additive), name, desc]\nexport const CorporationUpgrades: IMap<CorporationUpgrade> = {\n //Smart factories, increases production\n \"0\": [\n 0,\n 2e9,\n 1.06,\n 0.03,\n \"Smart Factories\",\n \"Advanced AI automatically optimizes the operation and productivity \" +\n \"of factories. Each level of this upgrade increases your global production by 3% (additive).\",\n ],\n\n //Smart warehouses, increases storage size\n \"1\": [\n 1,\n 2e9,\n 1.06,\n 0.1,\n \"Smart Storage\",\n \"Advanced AI automatically optimizes your warehouse storage methods. \" +\n \"Each level of this upgrade increases your global warehouse storage size by 10% (additive).\",\n ],\n\n //Advertise through dreams, passive popularity/ awareness gain\n \"2\": [\n 2,\n 4e9,\n 1.1,\n 0.001,\n \"DreamSense\",\n \"Use DreamSense LCC Technologies to advertise your corporation \" +\n \"to consumers through their dreams. Each level of this upgrade provides a passive \" +\n \"increase in awareness of all of your companies (divisions) by 0.004 / market cycle,\" +\n \"and in popularity by 0.001 / market cycle. A market cycle is approximately \" +\n \"15 seconds.\",\n ],\n\n //Makes advertising more effective\n \"3\": [\n 3,\n 4e9,\n 1.5,\n 0.005,\n \"Wilson Analytics\",\n \"Purchase data and analysis from Wilson, a marketing research \" +\n \"firm. Each level of this upgrades increases the effectiveness of your \" +\n \"advertising by 0.5% (additive).\",\n ],\n\n //Augmentation for employees, increases cre\n \"4\": [\n 4,\n 1e9,\n 1.06,\n 0.1,\n \"Nuoptimal Nootropic Injector Implants\",\n \"Purchase the Nuoptimal Nootropic \" +\n \"Injector augmentation for your employees. Each level of this upgrade \" +\n \"globally increases the creativity of your employees by 10% (additive).\",\n ],\n\n //Augmentation for employees, increases cha\n \"5\": [\n 5,\n 1e9,\n 1.06,\n 0.1,\n \"Speech Processor Implants\",\n \"Purchase the Speech Processor augmentation for your employees. \" +\n \"Each level of this upgrade globally increases the charisma of your employees by 10% (additive).\",\n ],\n\n //Augmentation for employees, increases int\n \"6\": [\n 6,\n 1e9,\n 1.06,\n 0.1,\n \"Neural Accelerators\",\n \"Purchase the Neural Accelerator augmentation for your employees. \" +\n \"Each level of this upgrade globally increases the intelligence of your employees \" +\n \"by 10% (additive).\",\n ],\n\n //Augmentation for employees, increases eff\n \"7\": [\n 7,\n 1e9,\n 1.06,\n 0.1,\n \"FocusWires\",\n \"Purchase the FocusWire augmentation for your employees. Each level \" +\n \"of this upgrade globally increases the efficiency of your employees by 10% (additive).\",\n ],\n\n //Improves sales of materials/products\n \"8\": [\n 8,\n 1e9,\n 1.07,\n 0.01,\n \"ABC SalesBots\",\n \"Always Be Closing. Purchase these robotic salesmen to increase the amount of \" +\n \"materials and products you sell. Each level of this upgrade globally increases your sales \" +\n \"by 1% (additive).\",\n ],\n\n //Improves scientific research rate\n \"9\": [\n 9,\n 5e9,\n 1.07,\n 0.05,\n \"Project Insight\",\n \"Purchase 'Project Insight', a R&D service provided by the secretive \" +\n \"Fulcrum Technologies. Each level of this upgrade globally increases the amount of \" +\n \"Scientific Research you produce by 5% (additive).\",\n ],\n};\n","/**\n * This is a central class for storing and managing the player's hashes,\n * which are generated by Hacknet Servers\n *\n * It is also used to keep track of what upgrades the player has bought with\n * his hashes, and contains method for grabbing the data/multipliers from\n * those upgrades\n */\nimport { HashUpgrades } from \"./HashUpgrades\";\nimport { HashUpgrade } from \"./HashUpgrade\";\n\nimport { IMap } from \"../types\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport class HashManager {\n // Max number of hashes this can hold. Equal to the sum of capacities of\n // all Hacknet Servers\n capacity = 0;\n\n // Number of hashes currently in storage\n hashes = 0;\n\n // Map of Hash Upgrade Name -> levels in that upgrade\n upgrades: IMap<number> = {};\n\n constructor() {\n for (const name of Object.keys(HashUpgrades)) {\n this.upgrades[name] = 0;\n }\n }\n\n /**\n * Generic helper function for getting a multiplier from a HashUpgrade\n */\n getMult(upgName: string): number {\n const upg = HashUpgrades[upgName];\n const currLevel = this.upgrades[upgName];\n if (upg == null || currLevel == null) {\n console.error(`Could not find Hash Study upgrade`);\n return 1;\n }\n\n return 1 + (upg.value * currLevel) / 100;\n }\n\n /**\n * One of the Hash upgrades improves studying. This returns that multiplier\n */\n getStudyMult(): number {\n const upgName = \"Improve Studying\";\n\n return this.getMult(upgName);\n }\n\n /**\n * One of the Hash upgrades improves gym training. This returns that multiplier\n */\n getTrainingMult(): number {\n const upgName = \"Improve Gym Training\";\n\n return this.getMult(upgName);\n }\n\n getUpgrade(upgName: string): HashUpgrade | null {\n const upg = HashUpgrades[upgName];\n if (!upg) {\n console.error(`Invalid Upgrade Name given to HashManager.getUpgrade(): ${upgName}`);\n return null;\n }\n return upg;\n }\n\n /**\n * Get the cost (in hashes) of an upgrade\n */\n getUpgradeCost(upgName: string): number {\n const upg = this.getUpgrade(upgName);\n const currLevel = this.upgrades[upgName];\n if (upg == null || currLevel == null) {\n console.error(`Invalid Upgrade Name given to HashManager.getUpgradeCost(): ${upgName}`);\n return Infinity;\n }\n\n return upg.getCost(currLevel);\n }\n\n prestige(): void {\n for (const name of Object.keys(HashUpgrades)) {\n this.upgrades[name] = 0;\n }\n this.hashes = 0;\n\n // When prestiging, player's hacknet nodes are always reset. So capacity = 0\n this.updateCapacity(0);\n }\n\n /**\n * Reverts an upgrade and refunds the hashes used to buy it\n */\n refundUpgrade(upgName: string): void {\n const upg = HashUpgrades[upgName];\n\n // Reduce the level first, so we get the right cost\n --this.upgrades[upgName];\n\n const currLevel = this.upgrades[upgName];\n if (upg == null || currLevel == null || currLevel < 0) {\n console.error(`Invalid Upgrade Name given to HashManager.upgrade(): ${upgName}`);\n return;\n }\n\n const cost = upg.getCost(currLevel);\n this.hashes += cost;\n }\n\n /**\n * Stores the given hashes, capping at capacity\n * @param numHashes The number of hashes to increment\n * @returns The number of wasted hashes (over capacity)\n */\n storeHashes(numHashes: number): number {\n this.hashes += numHashes;\n let wastedHashes = this.hashes;\n this.hashes = Math.min(this.hashes, this.capacity);\n wastedHashes -= this.hashes;\n return wastedHashes;\n }\n\n updateCapacity(newCap: number): void {\n if (newCap < 0) {\n this.capacity = 0;\n }\n this.capacity = Math.max(newCap, 0);\n }\n\n /**\n * Returns boolean indicating whether or not the upgrade was successfully purchased\n * Note that this does NOT actually implement the effect\n */\n upgrade(upgName: string): boolean {\n const upg = HashUpgrades[upgName];\n if (upg == null) {\n console.error(`Invalid Upgrade Name given to HashManager.upgrade(): ${upgName}`);\n return false;\n }\n\n const cost = this.getUpgradeCost(upgName);\n\n if (this.hashes < cost) {\n return false;\n }\n\n this.hashes -= cost;\n ++this.upgrades[upgName];\n\n return true;\n }\n\n //Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"HashManager\", this);\n }\n\n // Initiatizes a HashManager object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): HashManager {\n return Generic_fromJSON(HashManager, value.data);\n }\n}\n\nReviver.constructors.HashManager = HashManager;\n","import {\n CodingContract,\n CodingContractRewardType,\n CodingContractTypes,\n ICodingContractReward,\n} from \"./CodingContracts\";\nimport { Factions } from \"./Faction/Factions\";\nimport { Player } from \"./Player\";\nimport { GetServer, GetAllServers } from \"./Server/AllServers\";\nimport { SpecialServers } from \"./Server/data/SpecialServers\";\nimport { Server } from \"./Server/Server\";\nimport { BaseServer } from \"./Server/BaseServer\";\n\nimport { getRandomInt } from \"./utils/helpers/getRandomInt\";\n\nexport function generateRandomContract(): void {\n // First select a random problem type\n const problemType = getRandomProblemType();\n\n // Then select a random reward type. 'Money' will always be the last reward type\n const reward = getRandomReward();\n\n // Choose random server\n const randServer = getRandomServer();\n\n const contractFn = getRandomFilename(randServer, reward);\n const contract = new CodingContract(contractFn, problemType, reward);\n\n randServer.addContract(contract);\n}\n\nexport function generateRandomContractOnHome(): void {\n // First select a random problem type\n const problemType = getRandomProblemType();\n\n // Then select a random reward type. 'Money' will always be the last reward type\n const reward = getRandomReward();\n\n // Choose random server\n const serv = Player.getHomeComputer();\n\n const contractFn = getRandomFilename(serv, reward);\n const contract = new CodingContract(contractFn, problemType, reward);\n\n serv.addContract(contract);\n}\n\ninterface IGenerateContractParams {\n problemType?: string;\n server?: string;\n fn?: string;\n}\n\nexport function generateContract(params: IGenerateContractParams): void {\n // Problem Type\n let problemType;\n const problemTypes = Object.keys(CodingContractTypes);\n if (params.problemType != null && problemTypes.includes(params.problemType)) {\n problemType = params.problemType;\n } else {\n problemType = getRandomProblemType();\n }\n\n // Reward Type - This is always random for now\n const reward = getRandomReward();\n\n // Server\n let server;\n if (params.server != null) {\n server = GetServer(params.server);\n if (server == null) {\n server = getRandomServer();\n }\n } else {\n server = getRandomServer();\n }\n\n // Filename\n let fn;\n if (params.fn != null) {\n fn = params.fn;\n } else {\n fn = getRandomFilename(server, reward);\n }\n\n const contract = new CodingContract(fn, problemType, reward);\n server.addContract(contract);\n}\n\n// Ensures that a contract's reward type is valid\nfunction sanitizeRewardType(rewardType: CodingContractRewardType): CodingContractRewardType {\n let type = rewardType; // Create copy\n\n const factionsThatAllowHacking = Player.factions.filter((fac) => {\n try {\n return Factions[fac].getInfo().offerHackingWork;\n } catch (e) {\n console.error(`Error when trying to filter Hacking Factions for Coding Contract Generation: ${e}`);\n return false;\n }\n });\n if (type === CodingContractRewardType.FactionReputation && factionsThatAllowHacking.length === 0) {\n type = CodingContractRewardType.CompanyReputation;\n }\n if (type === CodingContractRewardType.FactionReputationAll && factionsThatAllowHacking.length === 0) {\n type = CodingContractRewardType.CompanyReputation;\n }\n if (type === CodingContractRewardType.CompanyReputation && Object.keys(Player.jobs).length === 0) {\n type = CodingContractRewardType.Money;\n }\n\n return type;\n}\n\nfunction getRandomProblemType(): string {\n const problemTypes = Object.keys(CodingContractTypes);\n const randIndex = getRandomInt(0, problemTypes.length - 1);\n\n return problemTypes[randIndex];\n}\n\nfunction getRandomReward(): ICodingContractReward {\n const reward: ICodingContractReward = {\n name: \"\",\n type: getRandomInt(0, CodingContractRewardType.Money),\n };\n reward.type = sanitizeRewardType(reward.type);\n\n // Add additional information based on the reward type\n const factionsThatAllowHacking = Player.factions.filter((fac) => Factions[fac].getInfo().offerHackingWork);\n\n switch (reward.type) {\n case CodingContractRewardType.FactionReputation: {\n // Get a random faction that player is a part of. That\n // faction must allow hacking contracts\n const numFactions = factionsThatAllowHacking.length;\n const randFaction = factionsThatAllowHacking[getRandomInt(0, numFactions - 1)];\n reward.name = randFaction;\n break;\n }\n case CodingContractRewardType.CompanyReputation: {\n const allJobs = Object.keys(Player.jobs);\n if (allJobs.length > 0) {\n reward.name = allJobs[getRandomInt(0, allJobs.length - 1)];\n } else {\n reward.type = CodingContractRewardType.Money;\n }\n break;\n }\n default:\n break;\n }\n\n return reward;\n}\n\nfunction getRandomServer(): BaseServer {\n const servers = GetAllServers();\n let randIndex = getRandomInt(0, servers.length - 1);\n let randServer = servers[randIndex];\n\n // An infinite loop shouldn't ever happen, but to be safe we'll use\n // a for loop with a limited number of tries\n for (let i = 0; i < 200; ++i) {\n if (\n randServer instanceof Server &&\n !randServer.purchasedByPlayer &&\n randServer.hostname !== SpecialServers.WorldDaemon\n ) {\n break;\n }\n randIndex = getRandomInt(0, servers.length - 1);\n randServer = servers[randIndex];\n }\n\n return randServer;\n}\n\nfunction getRandomFilename(server: BaseServer, reward: ICodingContractReward): string {\n let contractFn = `contract-${getRandomInt(0, 1e6)}`;\n\n for (let i = 0; i < 1000; ++i) {\n if (\n server.contracts.filter((c: CodingContract) => {\n return c.fn === contractFn;\n }).length <= 0\n ) {\n break;\n }\n contractFn = `contract-${getRandomInt(0, 1e6)}`;\n }\n\n if (reward.name) {\n contractFn += `-${reward.name.replace(/\\s/g, \"\")}`;\n }\n\n return contractFn;\n}\n","import { EventEmitter } from \"../../utils/EventEmitter\";\nexport const ITutorialEvents = new EventEmitter<[]>();\n","import { Crimes } from \"./Crimes\";\nimport { Crime } from \"./Crime\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nexport function determineCrimeSuccess(p: IPlayer, type: string): boolean {\n let chance = 0;\n let found = false;\n for (const i of Object.keys(Crimes)) {\n const crime = Crimes[i];\n if (crime.type == type) {\n chance = crime.successRate(p);\n found = true;\n break;\n }\n }\n\n if (!found) {\n dialogBoxCreate(`ERR: Unrecognized crime type: ${type} This is probably a bug please contact the developer`);\n return false;\n }\n\n if (Math.random() <= chance) {\n //Success\n return true;\n } else {\n //Failure\n return false;\n }\n}\n\nexport function findCrime(roughName: string): Crime | null {\n roughName = roughName.toLowerCase();\n if (roughName.includes(\"shoplift\")) {\n return Crimes.Shoplift;\n } else if (roughName.includes(\"rob\") && roughName.includes(\"store\")) {\n return Crimes.RobStore;\n } else if (roughName.includes(\"mug\")) {\n return Crimes.Mug;\n } else if (roughName.includes(\"larceny\")) {\n return Crimes.Larceny;\n } else if (roughName.includes(\"drugs\")) {\n return Crimes.DealDrugs;\n } else if (roughName.includes(\"bond\") && roughName.includes(\"forge\")) {\n return Crimes.BondForgery;\n } else if (roughName.includes(\"traffick\") && roughName.includes(\"arms\")) {\n return Crimes.TraffickArms;\n } else if (roughName.includes(\"homicide\")) {\n return Crimes.Homicide;\n } else if (roughName.includes(\"grand\") && roughName.includes(\"auto\")) {\n return Crimes.GrandTheftAuto;\n } else if (roughName.includes(\"kidnap\")) {\n return Crimes.Kidnap;\n } else if (roughName.includes(\"assassinate\") || roughName.includes(\"assassination\")) {\n return Crimes.Assassination;\n } else if (roughName.includes(\"heist\")) {\n return Crimes.Heist;\n }\n\n return null;\n}\n","import { EmployeePositions } from \"./EmployeePositions\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { generateRandomString } from \"../utils/StringHelperFunctions\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { Employee } from \"./Employee\";\nimport { IIndustry } from \"./IIndustry\";\nimport { ICorporation } from \"./ICorporation\";\n\ninterface IParams {\n loc?: string;\n size?: number;\n}\n\nexport class OfficeSpace {\n loc: string;\n size: number;\n minEne = 0;\n maxEne = 100;\n minHap = 0;\n maxHap = 100;\n maxMor = 100;\n employees: Employee[] = [];\n employeeProd: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n total: 0,\n };\n\n constructor(params: IParams = {}) {\n this.loc = params.loc ? params.loc : \"\";\n this.size = params.size ? params.size : 1;\n }\n\n atCapacity(): boolean {\n return this.employees.length >= this.size;\n }\n\n process(marketCycles = 1, corporation: ICorporation, industry: IIndustry): number {\n // HRBuddy AutoRecruitment and training\n if (industry.hasResearch(\"HRBuddy-Recruitment\") && !this.atCapacity()) {\n const emp = this.hireRandomEmployee();\n if (industry.hasResearch(\"HRBuddy-Training\") && emp !== undefined) {\n emp.pos = EmployeePositions.Training;\n }\n }\n\n // Process Office properties\n this.maxEne = 100;\n this.maxHap = 100;\n this.maxMor = 100;\n if (industry.hasResearch(\"Go-Juice\")) {\n this.maxEne += 10;\n }\n if (industry.hasResearch(\"JoyWire\")) {\n this.maxHap += 10;\n }\n if (industry.hasResearch(\"Sti.mu\")) {\n this.maxMor += 10;\n }\n\n // Calculate changes in Morale/Happiness/Energy for Employees\n let perfMult = 1; //Multiplier for employee morale/happiness/energy based on company performance\n if (corporation.funds < 0 && industry.lastCycleRevenue < 0) {\n perfMult = Math.pow(0.99, marketCycles);\n } else if (corporation.funds > 0 && industry.lastCycleRevenue > 0) {\n perfMult = Math.pow(1.01, marketCycles);\n }\n\n const hasAutobrew = industry.hasResearch(\"AutoBrew\");\n const hasAutoparty = industry.hasResearch(\"AutoPartyManager\");\n\n let salaryPaid = 0;\n for (let i = 0; i < this.employees.length; ++i) {\n const emp = this.employees[i];\n if (hasAutoparty) {\n emp.mor = this.maxMor;\n emp.hap = this.maxHap;\n } else {\n emp.mor *= perfMult;\n emp.hap *= perfMult;\n emp.mor = Math.min(emp.mor, this.maxMor);\n emp.hap = Math.min(emp.hap, this.maxHap);\n }\n\n if (hasAutobrew) {\n emp.ene = this.maxEne;\n } else {\n emp.ene *= perfMult;\n emp.ene = Math.min(emp.ene, this.maxEne);\n }\n\n const salary = emp.process(marketCycles, this);\n salaryPaid += salary;\n }\n\n this.calculateEmployeeProductivity(corporation, industry);\n return salaryPaid;\n }\n\n calculateEmployeeProductivity(corporation: ICorporation, industry: IIndustry): void {\n //Reset\n for (const name of Object.keys(this.employeeProd)) {\n this.employeeProd[name] = 0;\n }\n\n let total = 0;\n for (let i = 0; i < this.employees.length; ++i) {\n const employee = this.employees[i];\n const prod = employee.calculateProductivity(corporation, industry);\n this.employeeProd[employee.pos] += prod;\n total += prod;\n }\n this.employeeProd.total = total;\n }\n\n hireRandomEmployee(): Employee | undefined {\n if (this.atCapacity()) return;\n if (document.getElementById(\"cmpy-mgmt-hire-employee-popup\") != null) return;\n\n //Generate three random employees (meh, decent, amazing)\n const int = getRandomInt(50, 100),\n cha = getRandomInt(50, 100),\n exp = getRandomInt(50, 100),\n cre = getRandomInt(50, 100),\n eff = getRandomInt(50, 100),\n sal = CorporationConstants.EmployeeSalaryMultiplier * (int + cha + exp + cre + eff);\n\n const emp = new Employee({\n intelligence: int,\n charisma: cha,\n experience: exp,\n creativity: cre,\n efficiency: eff,\n salary: sal,\n });\n\n const name = generateRandomString(7);\n\n for (let i = 0; i < this.employees.length; ++i) {\n if (this.employees[i].name === name) {\n return this.hireRandomEmployee();\n }\n }\n emp.name = name;\n this.employees.push(emp);\n\n return emp;\n }\n\n //Finds the first unassigned employee and assigns its to the specified job\n assignEmployeeToJob(job: string): boolean {\n for (let i = 0; i < this.employees.length; ++i) {\n if (this.employees[i].pos === EmployeePositions.Unassigned) {\n this.employees[i].pos = job;\n return true;\n }\n }\n return false;\n }\n\n //Finds the first employee with the given job and unassigns it\n unassignEmployeeFromJob(job: string): boolean {\n for (let i = 0; i < this.employees.length; ++i) {\n if (this.employees[i].pos === job) {\n this.employees[i].pos = EmployeePositions.Unassigned;\n return true;\n }\n }\n return false;\n }\n\n setEmployeeToJob(job: string, amount: number): boolean {\n let unassignedCount = 0;\n let jobCount = 0;\n for (let i = 0; i < this.employees.length; ++i) {\n if (this.employees[i].pos === EmployeePositions.Unassigned) {\n unassignedCount++;\n } else if (this.employees[i].pos === job) {\n jobCount++;\n }\n }\n\n if ((jobCount + unassignedCount) < amount) return false;\n\n for (let i = 0; i < this.employees.length; ++i) {\n if (this.employees[i].pos === EmployeePositions.Unassigned) {\n if (jobCount <= amount) {\n this.employees[i].pos = job;\n jobCount++;\n unassignedCount--;\n }\n if (jobCount === amount) break;\n } else if (this.employees[i].pos === job) {\n if (jobCount >= amount) {\n this.employees[i].pos = EmployeePositions.Unassigned;\n jobCount--;\n unassignedCount++;\n }\n if (jobCount === amount) break;\n }\n }\n if (jobCount !== amount) return false;\n return true;\n }\n\n toJSON(): any {\n return Generic_toJSON(\"OfficeSpace\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): OfficeSpace {\n return Generic_fromJSON(OfficeSpace, value.data);\n }\n}\n\nReviver.constructors.OfficeSpace = OfficeSpace;\n","export type ObjectValidator<T> = {\n [key in keyof T]?: ParameterValidator<T, keyof T>;\n}\n\ninterface ParameterValidatorObject<Type, Key extends keyof Type> {\n default?: any;\n min?: number;\n max?: number;\n func?: (obj: Type, validator: ObjectValidator<Type>, key: Key) => void;\n}\ntype ParameterValidatorFunction<Type, Key extends keyof Type> = (obj: Type, key: Key) => void;\ntype ParameterValidator<Type, Key extends keyof Type> = ParameterValidatorObject<Type, Key> | ParameterValidatorFunction<Type, Key>\n\nexport function validateObject<Type extends Record<string, unknown>, Key extends keyof Type>(obj: Type, validator: ObjectValidator<Type>): void {\n for (const key of Object.keys(validator) as Key[]) {\n const paramValidator = validator[key];\n if (paramValidator !== undefined) {\n if (typeof paramValidator === 'function') {\n paramValidator(obj, key);\n } else {\n if (paramValidator.func !== undefined) {\n paramValidator.func(obj, validator, key);\n } else {\n if ((typeof obj[key]) !== (typeof paramValidator.default)) {\n obj[key] = paramValidator.default\n }\n if (typeof obj[key] === 'number' && paramValidator.min !== undefined) {\n if (obj[key] < paramValidator.min) obj[key] = paramValidator.min as Type[Key];\n }\n if (typeof obj[key] === 'number' && paramValidator.max !== undefined) {\n if (obj[key] > paramValidator.max) obj[key] = paramValidator.max as Type[Key];\n }\n }\n }\n }\n }\n}\n\nexport function minMax<Type, Key extends keyof Type>(def: number, min: number, max: number): (obj: Type, key: Key & keyof Type) => void {\n return (obj, key) => {\n if (typeof obj[key] !== 'number') {\n obj[key] = def as unknown as Type[Key];\n return;\n }\n if ((obj[key] as unknown as number) < min) {\n obj[key] = min as unknown as Type[Key];\n }\n if ((obj[key] as unknown as number) > max) {\n obj[key] = max as unknown as Type[Key];\n }\n };\n}\n\nexport function oneOf<Type, Key extends keyof Type, Value>(def: Value, options: Value[]): (obj: Type, key: Key & keyof Type) => void {\n return (obj, key) => {\n if (typeof obj[key] !== typeof def) {\n obj[key] = def as unknown as Type[Key];\n return;\n }\n if (!options.includes(obj[key] as unknown as Value)) {\n obj[key] = def as unknown as Type[Key];\n }\n };\n}\n\nexport function subsetOf<Type, Key extends keyof Type, Value>(options: Value[]): (obj: Type, key: Key & keyof Type) => void {\n return (obj, key) => {\n if (typeof obj[key] !== 'object' || !Array.isArray(obj[key])) {\n obj[key] = [] as unknown as Type[Key];\n return;\n }\n const validValues: Value[] = [];\n for (const value of obj[key] as unknown as Value[]) {\n if (options.includes(value)) validValues.push(value);\n }\n obj[key] = validValues as unknown as Type[Key];\n };\n}","/**\n * This is an object that is used to keep track of where all of the player's\n * money is coming from (or going to)\n */\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"./JSONReviver\";\n\nexport class MoneySourceTracker {\n // eslint-disable-next-line @typescript-eslint/ban-types\n [key: string]: number | Function;\n\n bladeburner = 0;\n casino = 0;\n class = 0;\n codingcontract = 0;\n corporation = 0;\n crime = 0;\n gang = 0;\n hacking = 0;\n hacknet = 0;\n hacknet_expenses = 0;\n hospitalization = 0;\n infiltration = 0;\n sleeves = 0;\n stock = 0;\n total = 0;\n work = 0;\n servers = 0;\n other = 0;\n augmentations = 0;\n\n // Record money earned\n record(amt: number, source: string): void {\n const sanitizedSource = source.toLowerCase();\n if (typeof this[sanitizedSource] !== \"number\") {\n console.warn(`MoneySourceTracker.record() called with invalid source: ${source}`);\n return;\n }\n\n (this[sanitizedSource] as number) += amt;\n this.total += amt;\n }\n\n // Reset the money tracker by setting all stats to 0\n reset(): void {\n for (const prop in this) {\n if (typeof this[prop] === \"number\") {\n (this[prop] as number) = 0;\n }\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"MoneySourceTracker\", this);\n }\n\n // Initiatizes a MoneySourceTracker object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): MoneySourceTracker {\n return Generic_fromJSON(MoneySourceTracker, value.data);\n }\n}\n\nReviver.constructors.MoneySourceTracker = MoneySourceTracker;\n","import { IStyleSettings } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport const defaultStyles: IStyleSettings = {\n lineHeight: 1.5,\n fontFamily: \"Lucida Console, Lucida Sans Unicode, Fira Mono, Consolas, Courier New, Courier, monospace, Times New Roman\"\n}\n","import React, { useState, useEffect } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport {sha256} from \"js-sha256\";\n\nexport const AlertEvents = new EventEmitter<[string | JSX.Element]>();\n\ninterface Alert {\n id: string;\n text: string | JSX.Element;\n hash: string;\n}\n\nlet i = 0;\nexport function AlertManager(): React.ReactElement {\n const [alerts, setAlerts] = useState<Alert[]>([]);\n useEffect(\n () =>\n AlertEvents.subscribe((text: string | JSX.Element) => {\n const id = i + \"\";\n i++;\n setAlerts((old) => {\n const hash = getMessageHash(text);\n if (old.some(a => a.hash === hash)) {\n console.log('Duplicate message');\n return old;\n }\n return [\n ...old,\n {\n id: id,\n text: text,\n hash: hash,\n },\n ];\n });\n }),\n [],\n );\n\n useEffect(() => {\n function handle(this: Document, event: KeyboardEvent): void {\n if (event.code === \"Escape\") {\n setAlerts([]);\n }\n }\n document.addEventListener(\"keydown\", handle);\n return () => document.removeEventListener(\"keydown\", handle);\n }, []);\n\n function getMessageHash(text: string | JSX.Element): string {\n if (typeof text === 'string') return sha256(text);\n return sha256(JSON.stringify(text.props));\n }\n\n function close(): void {\n setAlerts((old) => {\n return old.slice(1, 1e99);\n });\n }\n\n return (\n <>\n {alerts.length > 0 && (\n <Modal open={true} onClose={close}>\n <Box overflow=\"scroll\" sx={{ overflowWrap: \"break-word\", whiteSpace: \"pre-line\" }}>\n <Typography>{alerts[0].text}</Typography>\n </Box>\n </Modal>\n )}\n </>\n );\n}\n","import { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nexport function getHospitalizationCost(p: IPlayer): number {\n if (p.money < 0) {\n return 0;\n }\n\n return Math.min(p.money * 0.1, (p.max_hp - p.hp) * CONSTANTS.HospitalCostPerHp);\n}\n\nexport function calculateHospitalizationCost(p: IPlayer, damage: number): number {\n const oldhp = p.hp;\n p.hp -= damage;\n const cost = getHospitalizationCost(p);\n p.hp = oldhp;\n return cost;\n}\n","import React, { useState, useEffect } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const PromptEvent = new EventEmitter<[Prompt]>();\n\ninterface Prompt {\n txt: string;\n resolve: (result: boolean) => void;\n}\n\nexport function PromptManager(): React.ReactElement {\n const [prompt, setPrompt] = useState<Prompt | null>(null);\n useEffect(\n () =>\n PromptEvent.subscribe((p: Prompt) => {\n setPrompt(p);\n }),\n [],\n );\n\n function close(): void {\n if (prompt === null) return;\n prompt.resolve(false);\n setPrompt(null);\n }\n\n function yes(): void {\n if (prompt === null) return;\n prompt.resolve(true);\n setPrompt(null);\n }\n function no(): void {\n if (prompt === null) return;\n prompt.resolve(false);\n setPrompt(null);\n }\n\n return (\n <>\n {prompt != null && (\n <Modal open={true} onClose={close}>\n <Typography>{prompt.txt}</Typography>\n <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', paddingTop: '10px' }}>\n <Button style={{ marginRight: 'auto' }} onClick={yes}>Yes</Button>\n <Button onClick={no}>No</Button>\n </div>\n </Modal>\n )}\n </>\n );\n}\n","import { EmployeePositions } from \"./EmployeePositions\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { IIndustry } from \"./IIndustry\";\nimport { ProductRatingWeights, IProductRatingWeight } from \"./ProductRatingWeights\";\n\nimport { createCityMap } from \"../Locations/createCityMap\";\nimport { IMap } from \"../types\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\ninterface IConstructorParams {\n name?: string;\n demand?: number;\n competition?: number;\n markup?: number;\n createCity?: string;\n designCost?: number;\n advCost?: number;\n quality?: number;\n performance?: number;\n durability?: number;\n reliability?: number;\n aesthetics?: number;\n features?: number;\n loc?: string;\n size?: number;\n req?: IMap<number>;\n}\n\nexport class Product {\n // Product name\n name = \"\";\n\n // The demand for this Product in the market. Gradually decreases\n dmd = 0;\n\n // How much competition there is in the market for this Product\n cmp = 0;\n\n // Markup. Affects how high of a price you can charge for this Product\n // without suffering a loss in the # of sales\n mku = 0;\n\n // Production cost - estimation of how much money it costs to make this Product\n pCost = 0;\n\n // Sell cost\n sCost: string | number = 0;\n\n // Variables for handling the creation process of this Product\n fin = false; // Whether this Product has finished being created\n prog = 0; // Creation progress - A number betwee 0-100 representing percentage\n createCity = \"\"; // City in which the product is/was being created\n designCost = 0; // How much money was invested into designing this Product\n advCost = 0; // How much money was invested into advertising this Product\n\n // Aggregate score for this Product's 'rating'\n // This is based on the stats/properties below. The weighting of the\n // stats/properties below differs between different industries\n rat = 0;\n\n // Stats/properties of this Product\n qlt = 0;\n per = 0;\n dur = 0;\n rel = 0;\n aes = 0;\n fea = 0;\n\n // Data refers to the production, sale, and quantity of the products\n // These values are specific to a city\n // For each city, the data is [qty, prod, sell]\n data: IMap<number[]> = createCityMap<number[]>([0, 0, 0]);\n\n // Location of this Product\n // Only applies for location-based products like restaurants/hospitals\n loc = \"\";\n\n // How much space 1 unit of the Product takes (in the warehouse)\n // Not applicable for all Products\n siz = 0;\n\n // Material requirements. An object that maps the name of a material to how much it requires\n // to make 1 unit of the product.\n reqMats: IMap<number> = {};\n\n // Data to keep track of whether production/sale of this Product is\n // manually limited. These values are specific to a city\n // [Whether production/sale is limited, limit amount]\n prdman: IMap<any[]> = createCityMap<any[]>([false, 0]);\n sllman: IMap<any[]> = createCityMap<any[]>([false, 0]);\n\n // Flags that signal whether automatic sale pricing through Market TA is enabled\n marketTa1 = false;\n marketTa2 = false;\n marketTa2Price: IMap<number> = createCityMap<number>(0);\n\n constructor(params: IConstructorParams = {}) {\n this.name = params.name ? params.name : \"\";\n this.dmd = params.demand ? params.demand : 0;\n this.cmp = params.competition ? params.competition : 0;\n this.mku = params.markup ? params.markup : 0;\n this.createCity = params.createCity ? params.createCity : \"\";\n this.designCost = params.designCost ? params.designCost : 0;\n this.advCost = params.advCost ? params.advCost : 0;\n this.qlt = params.quality ? params.quality : 0;\n this.per = params.performance ? params.performance : 0;\n this.dur = params.durability ? params.durability : 0;\n this.rel = params.reliability ? params.reliability : 0;\n this.aes = params.aesthetics ? params.aesthetics : 0;\n this.fea = params.features ? params.features : 0;\n this.loc = params.loc ? params.loc : \"\";\n this.siz = params.size ? params.size : 0;\n this.reqMats = params.req ? params.req : {};\n }\n\n // empWorkMult is a multiplier that increases progress rate based on\n // productivity of employees\n createProduct(marketCycles = 1, empWorkMult = 1): void {\n if (this.fin) {\n return;\n }\n this.prog += marketCycles * 0.01 * empWorkMult;\n }\n\n // @param industry - Industry object. Reference to industry that makes this Product\n finishProduct(employeeProd: { [key: string]: number }, industry: IIndustry): void {\n this.fin = true;\n\n //Calculate properties\n const progrMult = this.prog / 100;\n\n const engrRatio = employeeProd[EmployeePositions.Engineer] / employeeProd[\"total\"];\n const mgmtRatio = employeeProd[EmployeePositions.Management] / employeeProd[\"total\"];\n const rndRatio = employeeProd[EmployeePositions.RandD] / employeeProd[\"total\"];\n const opsRatio = employeeProd[EmployeePositions.Operations] / employeeProd[\"total\"];\n const busRatio = employeeProd[EmployeePositions.Business] / employeeProd[\"total\"];\n const designMult = 1 + Math.pow(this.designCost, 0.1) / 100;\n const balanceMult = 1.2 * engrRatio + 0.9 * mgmtRatio + 1.3 * rndRatio + 1.5 * opsRatio + busRatio;\n const sciMult = 1 + Math.pow(industry.sciResearch.qty, industry.sciFac) / 800;\n const totalMult = progrMult * balanceMult * designMult * sciMult;\n\n this.qlt =\n totalMult *\n (0.1 * employeeProd[EmployeePositions.Engineer] +\n 0.05 * employeeProd[EmployeePositions.Management] +\n 0.05 * employeeProd[EmployeePositions.RandD] +\n 0.02 * employeeProd[EmployeePositions.Operations] +\n 0.02 * employeeProd[EmployeePositions.Business]);\n this.per =\n totalMult *\n (0.15 * employeeProd[EmployeePositions.Engineer] +\n 0.02 * employeeProd[EmployeePositions.Management] +\n 0.02 * employeeProd[EmployeePositions.RandD] +\n 0.02 * employeeProd[EmployeePositions.Operations] +\n 0.02 * employeeProd[EmployeePositions.Business]);\n this.dur =\n totalMult *\n (0.05 * employeeProd[EmployeePositions.Engineer] +\n 0.02 * employeeProd[EmployeePositions.Management] +\n 0.08 * employeeProd[EmployeePositions.RandD] +\n 0.05 * employeeProd[EmployeePositions.Operations] +\n 0.05 * employeeProd[EmployeePositions.Business]);\n this.rel =\n totalMult *\n (0.02 * employeeProd[EmployeePositions.Engineer] +\n 0.08 * employeeProd[EmployeePositions.Management] +\n 0.02 * employeeProd[EmployeePositions.RandD] +\n 0.05 * employeeProd[EmployeePositions.Operations] +\n 0.08 * employeeProd[EmployeePositions.Business]);\n this.aes =\n totalMult *\n (0.0 * employeeProd[EmployeePositions.Engineer] +\n 0.08 * employeeProd[EmployeePositions.Management] +\n 0.05 * employeeProd[EmployeePositions.RandD] +\n 0.02 * employeeProd[EmployeePositions.Operations] +\n 0.1 * employeeProd[EmployeePositions.Business]);\n this.fea =\n totalMult *\n (0.08 * employeeProd[EmployeePositions.Engineer] +\n 0.05 * employeeProd[EmployeePositions.Management] +\n 0.02 * employeeProd[EmployeePositions.RandD] +\n 0.05 * employeeProd[EmployeePositions.Operations] +\n 0.05 * employeeProd[EmployeePositions.Business]);\n this.calculateRating(industry);\n const advMult = 1 + Math.pow(this.advCost, 0.1) / 100;\n const busmgtgRatio = Math.max(busRatio + mgmtRatio, 1 / employeeProd[\"total\"]);\n this.mku = 100 / (advMult * Math.pow(this.qlt + 0.001, 0.65) * busmgtgRatio);\n\n // I actually don't understand well enough to know if this is right.\n // I'm adding this to prevent a crash.\n if (this.mku === 0 || !isFinite(this.mku)) this.mku = 1;\n\n this.dmd =\n industry.awareness === 0 ? 20 : Math.min(100, advMult * (100 * (industry.popularity / industry.awareness)));\n this.cmp = getRandomInt(0, 70);\n\n //Calculate the product's required materials\n //For now, just set it to be the same as the requirements to make materials\n for (const matName of Object.keys(industry.reqMats)) {\n if (industry.reqMats.hasOwnProperty(matName)) {\n const reqMat = industry.reqMats[matName];\n if (reqMat === undefined) continue;\n this.reqMats[matName] = reqMat;\n }\n }\n\n //Calculate the product's size\n //For now, just set it to be the same size as the requirements to make materials\n this.siz = 0;\n for (const matName of Object.keys(industry.reqMats)) {\n const reqMat = industry.reqMats[matName];\n if (reqMat === undefined) continue;\n this.siz += MaterialSizes[matName] * reqMat;\n }\n }\n\n calculateRating(industry: IIndustry): void {\n const weights: IProductRatingWeight = ProductRatingWeights[industry.type];\n if (weights == null) {\n console.error(`Could not find product rating weights for: ${industry}`);\n return;\n }\n this.rat = 0;\n this.rat += weights.Quality ? this.qlt * weights.Quality : 0;\n this.rat += weights.Performance ? this.per * weights.Performance : 0;\n this.rat += weights.Durability ? this.dur * weights.Durability : 0;\n this.rat += weights.Reliability ? this.rel * weights.Reliability : 0;\n this.rat += weights.Aesthetics ? this.aes * weights.Aesthetics : 0;\n this.rat += weights.Features ? this.fea * weights.Features : 0;\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"Product\", this);\n }\n\n // Initiatizes a Product object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Product {\n return Generic_fromJSON(Product, value.data);\n }\n}\n\nReviver.constructors.Product = Product;\n","import React, { useState, useEffect } from \"react\";\nimport { use } from \"../../ui/Context\";\nimport { getAvailableCreatePrograms } from \"../ProgramHelpers\";\n\nimport { Box, Tooltip, Typography } from \"@mui/material\";\nimport Button from \"@mui/material/Button\";\n\nexport const ProgramsSeen: string[] = [];\n\nexport function ProgramsRoot(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const programs = getAvailableCreatePrograms(player);\n\n useEffect(() => {\n programs.forEach((p) => {\n if (ProgramsSeen.includes(p.name)) return;\n ProgramsSeen.push(p.name);\n });\n }, []);\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <>\n <Typography variant=\"h4\">Create program</Typography>\n <Typography>\n This page displays any programs that you are able to create. Writing the code for a program takes time, which\n can vary based on how complex the program is. If you are working on creating a program you can cancel at any\n time. Your progress will be saved and you can continue later.\n </Typography>\n\n <Box sx={{ display: 'grid', width: 'fit-content' }}>\n {programs.map((program) => {\n const create = program.create;\n if (create === null) return <></>;\n\n return (\n <React.Fragment key={program.name}>\n <Tooltip title={create.tooltip}>\n <Button\n sx={{ my: 1 }}\n onClick={(event) => {\n if (!event.isTrusted) return;\n player.startCreateProgramWork(program.name, create.time, create.level);\n player.startFocusing();\n router.toWork();\n }}\n >\n {program.name}\n </Button>\n </Tooltip>\n </React.Fragment>\n );\n })}\n </Box>\n </>\n );\n}\n","import Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Container from \"@mui/material/Container\";\nimport Paper from \"@mui/material/Paper\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Table, TableCell } from \"../../ui/React/Table\";\nimport { IRouter } from \"../../ui/Router\";\nimport { Faction } from \"../Faction\";\nimport { joinFaction } from \"../FactionHelpers\";\nimport { Factions } from \"../Factions\";\n\nexport const InvitationsSeen: string[] = [];\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n}\n\nexport function FactionsRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n useEffect(() => {\n props.player.factionInvitations.forEach((faction) => {\n if (InvitationsSeen.includes(faction)) return;\n InvitationsSeen.push(faction);\n });\n }, []);\n\n function openFaction(faction: Faction): void {\n props.router.toFaction(faction);\n }\n\n function acceptInvitation(event: React.MouseEvent<HTMLButtonElement, MouseEvent>, faction: string): void {\n if (!event.isTrusted) return;\n joinFaction(Factions[faction]);\n setRerender((x) => !x);\n }\n\n return (\n <Container disableGutters maxWidth=\"md\" sx={{ mx: 0, mb: 10 }}>\n <Typography variant=\"h4\">Factions</Typography>\n <Typography mb={4}>\n Throughout the game you may receive invitations from factions. There are many different factions, and each\n faction has different criteria for determining its potential members. Joining a faction and furthering its cause\n is crucial to progressing in the game and unlocking endgame content.\n </Typography>\n\n <Typography variant=\"h5\" color=\"primary\" mt={2} mb={1}>\n Factions you have joined:\n </Typography>\n {(props.player.factions.length > 0 && (\n <Paper sx={{ my: 1, p: 1, pb: 0, display: \"inline-block\" }}>\n <Table padding=\"none\">\n <TableBody>\n {props.player.factions.map((faction: string) => (\n <TableRow key={faction}>\n <TableCell>\n <Typography noWrap mb={1}>\n {faction}\n </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Box ml={1} mb={1}>\n <Button onClick={() => openFaction(Factions[faction])}>Details</Button>\n </Box>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </Paper>\n )) || <Typography>You haven't joined any factions.</Typography>}\n <Typography variant=\"h5\" color=\"primary\" mt={4} mb={1}>\n Outstanding Faction Invitations\n </Typography>\n <Typography mb={1}>\n Factions you have been invited to. You can accept these faction invitations at any time:\n </Typography>\n {(props.player.factionInvitations.length > 0 && (\n <Paper sx={{ my: 1, mb: 4, p: 1, pb: 0, display: \"inline-block\" }}>\n <Table padding=\"none\">\n <TableBody>\n {props.player.factionInvitations.map((faction: string) => (\n <TableRow key={faction}>\n <TableCell>\n <Typography noWrap mb={1}>\n {faction}\n </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Box ml={1} mb={1}>\n <Button onClick={(e) => acceptInvitation(e, faction)}>Join!</Button>\n </Box>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </Paper>\n )) || <Typography>You have no outstanding faction invites.</Typography>}\n </Container>\n );\n}\n","import React, { useEffect } from \"react\";\n\nimport { Typography, Link, Button, ButtonGroup, Tooltip, Box, Paper, TextField } from \"@mui/material\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { load } from \"../../db\";\nimport { IRouter } from \"../Router\";\nimport { download } from \"../../SaveObject\";\nimport { IErrorData, newIssueUrl } from \"../../utils/ErrorHelper\";\nimport { DeleteGameButton } from \"./DeleteGameButton\";\nimport { SoftResetButton } from \"./SoftResetButton\";\n\nimport DirectionsRunIcon from '@mui/icons-material/DirectionsRun';\nimport GitHubIcon from \"@mui/icons-material/GitHub\";\n\nexport let RecoveryMode = false;\n\nexport function ActivateRecoveryMode(): void {\n RecoveryMode = true;\n}\n\ninterface IProps {\n router: IRouter;\n softReset: () => void;\n errorData?: IErrorData;\n resetError?: () => void;\n}\n\nexport function RecoveryRoot({ router, softReset, errorData, resetError }: IProps): React.ReactElement {\n function recover(): void {\n if (resetError) resetError();\n RecoveryMode = false;\n router.toTerminal();\n }\n Settings.AutosaveInterval = 0;\n\n useEffect(() => {\n load().then((content) => {\n const epochTime = Math.round(Date.now() / 1000);\n const filename = `RECOVERY_BITBURNER_${epochTime}.json`;\n download(filename, content);\n });\n }, []);\n\n return (\n <Box sx={{ padding: \"8px 16px\", minHeight: \"100vh\", maxWidth: '1200px', boxSizing: \"border-box\",}}>\n <Typography variant=\"h3\">RECOVERY MODE ACTIVATED</Typography>\n <Typography>\n There was an error with your save file and the game went into recovery mode. In this mode saving is disabled\n and the game will automatically export your save file (to prevent corruption).\n </Typography>\n <Typography>At this point it is recommended to alert a developer.</Typography>\n <Typography>\n <Link href={errorData?.issueUrl ?? newIssueUrl} target=\"_blank\">File an issue on github</Link>\n </Typography>\n <Typography>\n <Link href=\"https://www.reddit.com/r/Bitburner/\" target=\"_blank\">Make a reddit post</Link>\n </Typography>\n <Typography>\n <Link href=\"https://discord.gg/TFc3hKD\" target=\"_blank\">Post in the #bug-report channel on Discord.</Link>\n </Typography>\n <Typography>Please include your save file.</Typography>\n <br />\n <br />\n <Typography>You can disable recovery mode now. But chances are the game will not work correctly.</Typography>\n <ButtonGroup sx={{ my: 2 }}>\n <Tooltip title=\"Disables the recovery mode & attempt to head back to the terminal page. This may or may not work. Ensure you have saved the recovery file.\">\n <Button onClick={recover} startIcon={<DirectionsRunIcon />}>Disable Recovery Mode</Button>\n </Tooltip>\n <SoftResetButton color=\"warning\" onTriggered={softReset} />\n <DeleteGameButton color=\"error\" />\n </ButtonGroup>\n\n {errorData && (\n <Paper sx={{ px: 2, pt: 1, pb: 2, mt: 2}}>\n <Typography variant=\"h5\">\n {errorData.title}\n </Typography>\n <Box sx={{ my: 2 }}>\n <TextField\n label=\"Bug Report Text\"\n value={errorData.body}\n variant=\"outlined\"\n color=\"secondary\"\n multiline\n fullWidth\n rows={12}\n sx={{ \"& .MuiOutlinedInput-root\": { color: Settings.theme.secondary }}} />\n </Box>\n <Tooltip title=\"Submitting an issue to GitHub really help us improve the game!\">\n <Button component={Link} startIcon={<GitHubIcon />} color=\"info\" sx={{ px: 2 }}\n href={errorData.issueUrl ?? newIssueUrl} target={\"_blank\"} >\n Submit Issue to GitHub\n </Button>\n </Tooltip>\n </Paper>\n )}\n </Box>\n );\n}\n","import { CorporationState } from \"./CorporationState\";\nimport { CorporationUnlockUpgrade, CorporationUnlockUpgrades } from \"./data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade, CorporationUpgrades } from \"./data/CorporationUpgrades\";\nimport { Warehouse } from \"./Warehouse\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { Industry } from \"./Industry\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { showLiterature } from \"../Literature/LiteratureHelpers\";\nimport { LiteratureNames } from \"../Literature/data/LiteratureNames\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON } from \"../utils/JSONReviver\";\nimport { isString } from \"../utils/helpers/isString\";\n\ninterface IParams {\n name?: string;\n}\n\nexport class Corporation {\n name = \"The Corporation\";\n\n //A division/business sector is represented by the object:\n divisions: Industry[] = [];\n\n //Financial stats\n funds = 150e9;\n revenue = 0;\n expenses = 0;\n fundingRound = 0;\n public = false; //Publicly traded\n totalShares = CorporationConstants.INITIALSHARES; // Total existing shares\n numShares = CorporationConstants.INITIALSHARES; // Total shares owned by player\n shareSalesUntilPriceUpdate = CorporationConstants.SHARESPERPRICEUPDATE;\n shareSaleCooldown = 0; // Game cycles until player can sell shares again\n issueNewSharesCooldown = 0; // Game cycles until player can issue shares again\n dividendPercentage = 0;\n dividendTaxPercentage = 50;\n issuedShares = 0;\n sharePrice = 0;\n storedCycles = 0;\n\n unlockUpgrades: number[];\n upgrades: number[];\n upgradeMultipliers: number[];\n\n state = new CorporationState();\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"The Corporation\";\n const numUnlockUpgrades = Object.keys(CorporationUnlockUpgrades).length;\n const numUpgrades = Object.keys(CorporationUpgrades).length;\n this.unlockUpgrades = Array(numUnlockUpgrades).fill(0);\n this.upgrades = Array(numUpgrades).fill(0);\n this.upgradeMultipliers = Array(numUpgrades).fill(1);\n }\n\n addFunds(amt: number): void {\n if (!isFinite(amt)) {\n console.error(\"Trying to add invalid amount of funds. Report to a developper.\");\n return;\n }\n this.funds = this.funds + amt;\n }\n\n getState(): string {\n return this.state.getState();\n }\n\n storeCycles(numCycles = 1): void {\n this.storedCycles += numCycles;\n }\n\n process(player: IPlayer): void {\n if (this.storedCycles >= CorporationConstants.CyclesPerIndustryStateCycle) {\n const state = this.getState();\n const marketCycles = 1;\n const gameCycles = marketCycles * CorporationConstants.CyclesPerIndustryStateCycle;\n this.storedCycles -= gameCycles;\n\n this.divisions.forEach((ind) => {\n ind.process(marketCycles, state, this);\n });\n\n // Process cooldowns\n if (this.shareSaleCooldown > 0) {\n this.shareSaleCooldown -= gameCycles;\n }\n if (this.issueNewSharesCooldown > 0) {\n this.issueNewSharesCooldown -= gameCycles;\n }\n\n //At the start of a new cycle, calculate profits from previous cycle\n if (state === \"START\") {\n this.revenue = 0;\n this.expenses = 0;\n this.divisions.forEach((ind) => {\n if (ind.lastCycleRevenue === -Infinity || ind.lastCycleRevenue === Infinity) {\n return;\n }\n if (ind.lastCycleExpenses === -Infinity || ind.lastCycleExpenses === Infinity) {\n return;\n }\n this.revenue = this.revenue + ind.lastCycleRevenue;\n this.expenses = this.expenses + ind.lastCycleExpenses;\n });\n const profit = this.revenue - this.expenses;\n const cycleProfit = profit * (marketCycles * CorporationConstants.SecsPerMarketCycle);\n if (isNaN(this.funds) || this.funds === Infinity || this.funds === -Infinity) {\n dialogBoxCreate(\n \"There was an error calculating your Corporations funds and they got reset to 0. \" +\n \"This is a bug. Please report to game developer.<br><br>\" +\n \"(Your funds have been set to $150b for the inconvenience)\",\n );\n this.funds = 150e9;\n }\n\n // Process dividends\n if (this.dividendPercentage > 0 && cycleProfit > 0) {\n // Validate input again, just to be safe\n if (\n isNaN(this.dividendPercentage) ||\n this.dividendPercentage < 0 ||\n this.dividendPercentage > CorporationConstants.DividendMaxPercentage * 100\n ) {\n console.error(`Invalid Corporation dividend percentage: ${this.dividendPercentage}`);\n } else {\n const totalDividends = (this.dividendPercentage / 100) * cycleProfit;\n const retainedEarnings = cycleProfit - totalDividends;\n player.gainMoney(this.getDividends(), \"corporation\");\n this.addFunds(retainedEarnings);\n }\n } else {\n this.addFunds(cycleProfit);\n }\n\n this.updateSharePrice();\n }\n\n this.state.nextState();\n }\n }\n\n getDividends(): number {\n const profit = this.revenue - this.expenses;\n const cycleProfit = profit * CorporationConstants.SecsPerMarketCycle;\n const totalDividends = (this.dividendPercentage / 100) * cycleProfit;\n const dividendsPerShare = totalDividends / this.totalShares;\n const dividends = this.numShares * dividendsPerShare;\n let upgrades = -0.15;\n if (this.unlockUpgrades[5] === 1) {\n upgrades += 0.05;\n }\n if (this.unlockUpgrades[6] === 1) {\n upgrades += 0.1;\n }\n return Math.pow(dividends, BitNodeMultipliers.CorporationSoftCap + upgrades);\n }\n\n determineValuation(): number {\n let val,\n profit = this.revenue - this.expenses;\n if (this.public) {\n // Account for dividends\n if (this.dividendPercentage > 0) {\n profit *= (100 - this.dividendPercentage) / 100;\n }\n\n val = this.funds + profit * 85e3;\n val *= Math.pow(1.1, this.divisions.length);\n val = Math.max(val, 0);\n } else {\n val = 10e9 + Math.max(this.funds, 0) / 3; //Base valuation\n if (profit > 0) {\n val += profit * 315e3;\n val *= Math.pow(1.1, this.divisions.length);\n } else {\n val = 10e9 * Math.pow(1.1, this.divisions.length);\n }\n val -= val % 1e6; //Round down to nearest millionth\n }\n return val * BitNodeMultipliers.CorporationValuation;\n }\n\n getTargetSharePrice(): number {\n // Note: totalShares - numShares is not the same as issuedShares because\n // issuedShares does not account for private investors\n return this.determineValuation() / (2 * (this.totalShares - this.numShares) + 1);\n }\n\n updateSharePrice(): void {\n const targetPrice = this.getTargetSharePrice();\n if (this.sharePrice <= targetPrice) {\n this.sharePrice *= 1 + Math.random() * 0.01;\n } else {\n this.sharePrice *= 1 - Math.random() * 0.01;\n }\n if (this.sharePrice <= 0.01) {\n this.sharePrice = 0.01;\n }\n }\n\n immediatelyUpdateSharePrice(): void {\n this.sharePrice = this.getTargetSharePrice();\n }\n\n // Calculates how much money will be made and what the resulting stock price\n // will be when the player sells his/her shares\n // @return - [Player profit, final stock price, end shareSalesUntilPriceUpdate property]\n calculateShareSale(numShares: number): [number, number, number] {\n let sharesTracker = numShares;\n let sharesUntilUpdate = this.shareSalesUntilPriceUpdate;\n let sharePrice = this.sharePrice;\n let sharesSold = 0;\n let profit = 0;\n\n const maxIterations = Math.ceil(numShares / CorporationConstants.SHARESPERPRICEUPDATE);\n if (isNaN(maxIterations) || maxIterations > 10e6) {\n console.error(\n `Something went wrong or unexpected when calculating share sale. Maxiterations calculated to be ${maxIterations}`,\n );\n return [0, 0, 0];\n }\n\n for (let i = 0; i < maxIterations; ++i) {\n if (sharesTracker < sharesUntilUpdate) {\n profit += sharePrice * sharesTracker;\n sharesUntilUpdate -= sharesTracker;\n break;\n } else {\n profit += sharePrice * sharesUntilUpdate;\n sharesUntilUpdate = CorporationConstants.SHARESPERPRICEUPDATE;\n sharesTracker -= sharesUntilUpdate;\n sharesSold += sharesUntilUpdate;\n\n // Calculate what new share price would be\n sharePrice = this.determineValuation() / (2 * (this.totalShares + sharesSold - this.numShares));\n }\n }\n\n return [profit, sharePrice, sharesUntilUpdate];\n }\n\n convertCooldownToString(cd: number): string {\n // The cooldown value is based on game cycles. Convert to a simple string\n const seconds = cd / 5;\n\n const SecondsPerMinute = 60;\n const SecondsPerHour = 3600;\n\n if (seconds > SecondsPerHour) {\n return `${Math.floor(seconds / SecondsPerHour)} hour(s)`;\n } else if (seconds > SecondsPerMinute) {\n return `${Math.floor(seconds / SecondsPerMinute)} minute(s)`;\n } else {\n return `${Math.floor(seconds)} second(s)`;\n }\n }\n\n //One time upgrades that unlock new features\n unlock(upgrade: CorporationUnlockUpgrade): void {\n const upgN = upgrade[0],\n price = upgrade[1];\n while (this.unlockUpgrades.length <= upgN) {\n this.unlockUpgrades.push(0);\n }\n if (this.funds < price) {\n dialogBoxCreate(\"You don't have enough funds to unlock this!\");\n return;\n }\n this.unlockUpgrades[upgN] = 1;\n this.funds = this.funds - price;\n\n // Apply effects for one-time upgrades\n if (upgN === 5) {\n this.dividendTaxPercentage -= 5;\n } else if (upgN === 6) {\n this.dividendTaxPercentage -= 10;\n }\n }\n\n //Levelable upgrades\n upgrade(upgrade: CorporationUpgrade): void {\n const upgN = upgrade[0],\n basePrice = upgrade[1],\n priceMult = upgrade[2],\n upgradeAmt = upgrade[3]; //Amount by which the upgrade multiplier gets increased (additive)\n while (this.upgrades.length <= upgN) {\n this.upgrades.push(0);\n }\n while (this.upgradeMultipliers.length <= upgN) {\n this.upgradeMultipliers.push(1);\n }\n const totalCost = basePrice * Math.pow(priceMult, this.upgrades[upgN]);\n if (this.funds < totalCost) {\n dialogBoxCreate(\"You don't have enough funds to purchase this!\");\n return;\n }\n ++this.upgrades[upgN];\n this.funds = this.funds - totalCost;\n\n //Increase upgrade multiplier\n this.upgradeMultipliers[upgN] = 1 + this.upgrades[upgN] * upgradeAmt;\n\n //If storage size is being updated, update values in Warehouse objects\n if (upgN === 1) {\n for (let i = 0; i < this.divisions.length; ++i) {\n const industry = this.divisions[i];\n for (const city of Object.keys(industry.warehouses)) {\n const warehouse = industry.warehouses[city];\n if (warehouse === 0) continue;\n if (industry.warehouses.hasOwnProperty(city) && warehouse instanceof Warehouse) {\n warehouse.updateSize(this, industry);\n }\n }\n }\n }\n }\n\n getProductionMultiplier(): number {\n const mult = this.upgradeMultipliers[0];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getStorageMultiplier(): number {\n const mult = this.upgradeMultipliers[1];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getDreamSenseGain(): number {\n const gain = this.upgradeMultipliers[2] - 1;\n return gain <= 0 ? 0 : gain;\n }\n\n getAdvertisingMultiplier(): number {\n const mult = this.upgradeMultipliers[3];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeCreMultiplier(): number {\n const mult = this.upgradeMultipliers[4];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeChaMultiplier(): number {\n const mult = this.upgradeMultipliers[5];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeIntMultiplier(): number {\n const mult = this.upgradeMultipliers[6];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeEffMultiplier(): number {\n const mult = this.upgradeMultipliers[7];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getSalesMultiplier(): number {\n const mult = this.upgradeMultipliers[8];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getScientificResearchMultiplier(): number {\n const mult = this.upgradeMultipliers[9];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n // Adds the Corporation Handbook (Starter Guide) to the player's home computer.\n // This is a lit file that gives introductory info to the player\n // This occurs when the player clicks the \"Getting Started Guide\" button on the overview panel\n getStarterGuide(player: IPlayer): void {\n // Check if player already has Corporation Handbook\n const homeComp = player.getHomeComputer();\n let hasHandbook = false;\n const handbookFn = LiteratureNames.CorporationManagementHandbook;\n for (let i = 0; i < homeComp.messages.length; ++i) {\n if (isString(homeComp.messages[i]) && homeComp.messages[i] === handbookFn) {\n hasHandbook = true;\n break;\n }\n }\n\n if (!hasHandbook) {\n homeComp.messages.push(handbookFn);\n }\n showLiterature(handbookFn);\n return;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Corporation\", this);\n }\n\n /**\n * Initiatizes a Corporation object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Corporation {\n return Generic_fromJSON(Corporation, value.data);\n }\n}\n\nReviver.constructors.Corporation = Corporation;\n","import React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Hashes } from \"../../ui/React/Hashes\";\n\nexport function HashRate({ hashes }: { hashes: number }): React.ReactElement {\n return <Hashes hashes={`${numeralWrapper.formatHashes(hashes)} h / s`} />;\n}\n","import { BladeburnerConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\n\ninterface IChangePopulationByCountParams {\n estChange: number;\n estOffset: number;\n}\n\ninterface IChangePopulationByPercentageParams {\n nonZero: boolean;\n changeEstEqually: boolean;\n}\n\nexport class City {\n /**\n * Name of the city.\n */\n name = \"\";\n\n /**\n * Population of the city.\n */\n pop = 0;\n\n /**\n * Population estimation of the city.\n */\n popEst = 0;\n\n /**\n * Number of communities in the city.\n */\n comms = 0;\n\n /**\n * Chaos level of the city.\n */\n chaos = 0;\n\n constructor(name: string = BladeburnerConstants.CityNames[2]) {\n this.name = name;\n\n // Synthoid population and estimate\n this.pop = getRandomInt(BladeburnerConstants.PopulationThreshold, 1.5 * BladeburnerConstants.PopulationThreshold);\n this.popEst = this.pop * (Math.random() + 0.5);\n\n // Number of Synthoid communities population and estimate\n this.comms = getRandomInt(5, 150);\n this.chaos = 0;\n }\n\n /**\n * p is the percentage, not the multiplier (e.g. pass in p = 5 for 5%)\n */\n changeChaosByPercentage(p: number): void {\n if (isNaN(p)) {\n throw new Error(\"NaN passed into City.chaosChaosByPercentage()\");\n }\n if (p === 0) {\n return;\n }\n this.chaos += this.chaos * (p / 100);\n if (this.chaos < 0) {\n this.chaos = 0;\n }\n }\n\n improvePopulationEstimateByCount(n: number): void {\n if (isNaN(n)) {\n throw new Error(\"NaN passeed into City.improvePopulationEstimateByCount()\");\n }\n if (this.popEst < this.pop) {\n this.popEst += n;\n if (this.popEst > this.pop) {\n this.popEst = this.pop;\n }\n } else if (this.popEst > this.pop) {\n this.popEst -= n;\n if (this.popEst < this.pop) {\n this.popEst = this.pop;\n }\n }\n }\n\n /**\n * p is the percentage, not the multiplier (e.g. pass in p = 5 for 5%)\n */\n improvePopulationEstimateByPercentage(p: number, skillMult = 1): void {\n p = p * skillMult;\n if (isNaN(p)) {\n throw new Error(\"NaN passed into City.improvePopulationEstimateByPercentage()\");\n }\n if (this.popEst < this.pop) {\n ++this.popEst; // In case estimate is 0\n this.popEst *= 1 + p / 100;\n if (this.popEst > this.pop) {\n this.popEst = this.pop;\n }\n } else if (this.popEst > this.pop) {\n this.popEst *= 1 - p / 100;\n if (this.popEst < this.pop) {\n this.popEst = this.pop;\n }\n }\n }\n\n /**\n * @params options:\n * estChange(int): How much the estimate should change by\n * estOffset(int): Add offset to estimate (offset by percentage)\n */\n changePopulationByCount(n: number, params: IChangePopulationByCountParams = { estChange: 0, estOffset: 0 }): void {\n if (isNaN(n)) {\n throw new Error(\"NaN passed into City.changePopulationByCount()\");\n }\n this.pop += n;\n if (params.estChange && !isNaN(params.estChange)) {\n this.popEst += params.estChange;\n }\n if (params.estOffset) {\n this.popEst = addOffset(this.popEst, params.estOffset);\n }\n this.popEst = Math.max(this.popEst, 0);\n }\n\n /**\n * @p is the percentage, not the multiplier. e.g. pass in p = 5 for 5%\n * @params options:\n * changeEstEqually(bool) - Change the population estimate by an equal amount\n * nonZero (bool) - Set to true to ensure that population always changes by at least 1\n */\n changePopulationByPercentage(\n p: number,\n params: IChangePopulationByPercentageParams = {\n nonZero: false,\n changeEstEqually: false,\n },\n ): number {\n if (isNaN(p)) {\n throw new Error(\"NaN passed into City.changePopulationByPercentage()\");\n }\n if (p === 0) {\n return 0;\n }\n let change = Math.round(this.pop * (p / 100));\n\n // Population always changes by at least 1\n if (params.nonZero && change === 0) {\n p > 0 ? (change = 1) : (change = -1);\n }\n\n this.pop += change;\n if (params.changeEstEqually) {\n this.popEst += change;\n if (this.popEst < 0) {\n this.popEst = 0;\n }\n }\n return change;\n }\n\n changeChaosByCount(n: number): void {\n if (isNaN(n)) {\n throw new Error(\"NaN passed into City.changeChaosByCount()\");\n }\n if (n === 0) {\n return;\n }\n this.chaos += n;\n if (this.chaos < 0) {\n this.chaos = 0;\n }\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"City\", this);\n }\n\n /**\n * Initiatizes a City object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): City {\n return Generic_fromJSON(City, value.data);\n }\n}\n\nReviver.constructors.City = City;\n","import { Factions } from \"../../Faction/Factions\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Gang } from \"../../Gang/Gang\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { IPlayer } from \"../IPlayer\";\n\n// Amount of negative karma needed to manage a gang in BitNodes other than 2\nconst GangKarmaRequirement = -54000;\n\nexport function canAccessGang(this: IPlayer): boolean {\n if (this.bitNodeN === 2) {\n return true;\n }\n if (SourceFileFlags[2] <= 0) {\n return false;\n }\n\n return this.karma <= GangKarmaRequirement;\n}\n\nexport function getGangFaction(this: IPlayer): Faction {\n const gang = this.gang;\n if (gang === null) {\n throw new Error(\"Cannot get gang faction because player is not in a gang.\");\n }\n const fac = Factions[gang.facName];\n if (fac == null) {\n throw new Error(`Gang has invalid faction name: ${gang.facName}`);\n }\n\n return fac;\n}\n\nexport function getGangName(this: IPlayer): string {\n if (!this.inGang()) return \"\";\n const gang = this.gang;\n if (gang === null) {\n throw new Error(\"Cannot get gang faction because player is not in a gang.\");\n }\n return gang.facName;\n}\n\nexport function hasGangWith(this: IPlayer, facName: string): boolean {\n if (!this.inGang()) return false;\n const gang = this.gang;\n if (gang === null) {\n throw new Error(\"Cannot get gang faction because player is not in a gang.\");\n }\n return gang.facName === facName;\n}\n\nexport function inGang(this: IPlayer): boolean {\n if (this.gang == null || this.gang == undefined) {\n return false;\n }\n\n return this.gang instanceof Gang;\n}\n\nexport function startGang(this: IPlayer, factionName: string, hacking: boolean): void {\n this.gang = new Gang(factionName, hacking);\n\n const fac = Factions[factionName];\n if (fac == null) {\n throw new Error(`Invalid faction name when creating gang: ${factionName}`);\n }\n fac.playerReputation = 0;\n}\n","/**\n * Class representing a City in the game\n */\nimport { CityName } from \"./data/CityNames\";\nimport { LocationName } from \"./data/LocationNames\";\n\nexport class City {\n /**\n * List of all locations in this city\n */\n locations: LocationName[];\n\n /**\n * Name of this city\n */\n name: CityName;\n\n /**\n * Metro map ascii art\n */\n asciiArt: string;\n\n constructor(name: CityName, locations: LocationName[] = [], asciiArt = \"\") {\n this.name = name;\n this.locations = locations;\n this.asciiArt = asciiArt;\n }\n\n addLocation(loc: LocationName): void {\n this.locations.push(loc);\n }\n}\n","import * as React from \"react\";\nimport LinearProgress from \"@mui/material/LinearProgress\";\nimport { TableCell, Tooltip, Typography } from \"@mui/material\";\nimport { characterOverviewStyles } from \"./CharacterOverview\";\nimport { ISkillProgress } from \"src/PersonObjects/formulas/skill\";\nimport { numeralWrapper } from \"../numeralFormat\";\n\ninterface IProgressProps {\n min: number;\n max: number;\n current: number;\n remaining: number;\n progress: number;\n color?: React.CSSProperties[\"color\"];\n}\n\ninterface IStatsOverviewCellProps {\n progress: ISkillProgress;\n color?: React.CSSProperties[\"color\"];\n}\n\nexport function StatsProgressBar({ min, max, current, remaining, progress, color }: IProgressProps): React.ReactElement {\n const tooltip = (\n <Typography sx={{ textAlign: 'right' }}>\n <strong>Progress:</strong> \n {numeralWrapper.formatExp(current)} / {numeralWrapper.formatExp(max - min)}\n <br />\n <strong>Remaining:</strong> \n {numeralWrapper.formatExp(remaining)} ({progress.toFixed(2)}%)\n </Typography>\n );\n\n return (\n <Tooltip title={tooltip}>\n <LinearProgress\n variant=\"determinate\"\n value={progress}\n sx={{\n backgroundColor: \"#111111\",\n \"& .MuiLinearProgress-bar1Determinate\": {\n backgroundColor: color,\n },\n }}\n />\n </Tooltip>\n );\n}\n\nexport function StatsProgressOverviewCell({ progress: skill, color }: IStatsOverviewCellProps): React.ReactElement {\n const classes = characterOverviewStyles();\n return (\n <TableCell\n component=\"th\"\n scope=\"row\"\n colSpan={2}\n classes={{ root: classes.cellNone }}\n style={{ paddingBottom: \"2px\", position: \"relative\", top: \"-3px\" }}\n >\n <StatsProgressBar\n min={skill.baseExperience}\n max={skill.nextExperience}\n current={skill.currentExperience}\n remaining={skill.remainingExperience}\n progress={skill.progress}\n color={color}\n />\n </TableCell>\n );\n}\n","/**\n * React component for a selectable option on the Faction UI. These\n * options including working for the faction, hacking missions, purchasing\n * augmentations, etc.\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n buttonText: string;\n infoText: string;\n onClick: (e: React.MouseEvent<HTMLElement>) => void;\n};\n\nexport function Option(props: IProps): React.ReactElement {\n return (\n <Box>\n <Paper sx={{ my: 1, p: 1 }}>\n <Button onClick={props.onClick}>{props.buttonText}</Button>\n <Typography>{props.infoText}</Typography>\n </Paper>\n </Box>\n );\n}\n","/**\n * React component for the tickers configuration section of the Stock Market UI.\n * This config lets you change the way stock tickers are displayed (watchlist,\n * all/portoflio mode, etc)\n */\nimport * as React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\nexport enum TickerDisplayMode {\n AllStocks,\n Portfolio,\n}\n\ntype IProps = {\n changeDisplayMode: () => void;\n changeWatchlistFilter: (e: React.ChangeEvent<HTMLInputElement>) => void;\n tickerDisplayMode: TickerDisplayMode;\n};\n\nfunction DisplayModeButton(props: IProps): React.ReactElement {\n let txt = \"\";\n let tooltip = \"\";\n if (props.tickerDisplayMode === TickerDisplayMode.Portfolio) {\n txt = \"Switch to 'All Stocks' Mode\";\n tooltip = \"Displays all stocks on the WSE\";\n } else {\n txt = \"Switch to 'Portfolio' Mode\";\n tooltip = \"Displays only the stocks for which you have shares or orders\";\n }\n\n return (\n <Tooltip title={<Typography>{tooltip}</Typography>}>\n <Button onClick={props.changeDisplayMode}>{txt}</Button>\n </Tooltip>\n );\n}\n\nexport function StockTickersConfig(props: IProps): React.ReactElement {\n return (\n <>\n <DisplayModeButton {...props} />\n <br />\n <TextField\n sx={{ width: \"100%\" }}\n onChange={props.changeWatchlistFilter}\n placeholder=\"Filter Stocks by symbol (comma-separated list)\"\n type=\"text\"\n />\n </>\n );\n}\n","/**\n * Server and HacknetServer-related methods for the Player class (PlayerObject)\n */\nimport { IPlayer } from \"../IPlayer\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { GetServer, AddToAllServers, createUniqueRandomIp } from \"../../Server/AllServers\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\n\nexport function hasTorRouter(this: IPlayer): boolean {\n return !!GetServer(SpecialServers.DarkWeb);\n}\n\nexport function getCurrentServer(this: IPlayer): BaseServer {\n const server = GetServer(this.currentServer);\n if (server === null) throw new Error(`somehow connected to a server that does not exist. ${this.currentServer}`);\n return server;\n}\n\nexport function getHomeComputer(this: IPlayer): Server {\n const home = GetServer(\"home\");\n if (home instanceof Server) return home;\n throw new Error(\"home computer was not a normal server\");\n}\n\nexport function getUpgradeHomeRamCost(this: IPlayer): number {\n //Calculate how many times ram has been upgraded (doubled)\n const currentRam = this.getHomeComputer().maxRam;\n const numUpgrades = Math.log2(currentRam);\n\n //Calculate cost\n //Have cost increase by some percentage each time RAM has been upgraded\n const mult = Math.pow(1.58, numUpgrades);\n const cost = currentRam * CONSTANTS.BaseCostFor1GBOfRamHome * mult * BitNodeMultipliers.HomeComputerRamCost;\n return cost;\n}\n\nexport function getUpgradeHomeCoresCost(this: IPlayer): number {\n return 1e9 * Math.pow(7.5, this.getHomeComputer().cpuCores);\n}\n\nexport function createHacknetServer(this: IPlayer): HacknetServer {\n const numOwned = this.hacknetNodes.length;\n const name = `hacknet-node-${numOwned}`;\n const server = new HacknetServer({\n adminRights: true,\n hostname: name,\n ip: createUniqueRandomIp(),\n // player: this,\n });\n this.hacknetNodes.push(server.hostname);\n\n // Configure the HacknetServer to actually act as a Server\n AddToAllServers(server);\n const homeComputer = this.getHomeComputer();\n homeComputer.serversOnNetwork.push(server.hostname);\n server.serversOnNetwork.push(SpecialServers.Home);\n\n return server;\n}\n","import { Player } from \"../Player\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { BladeburnerConstants } from \"./data/Constants\";\nimport { IBladeburner } from \"./IBladeburner\";\nimport { IAction, ISuccessChanceParams } from \"./IAction\";\n\nclass StatsMultiplier {\n [key: string]: number;\n\n hack = 0;\n str = 0;\n def = 0;\n dex = 0;\n agi = 0;\n cha = 0;\n int = 0;\n}\n\nexport interface IActionParams {\n name?: string;\n level?: number;\n maxLevel?: number;\n autoLevel?: boolean;\n baseDifficulty?: number;\n difficultyFac?: number;\n rewardFac?: number;\n successes?: number;\n failures?: number;\n rankGain?: number;\n rankLoss?: number;\n hpLoss?: number;\n hpLost?: number;\n isStealth?: boolean;\n isKill?: boolean;\n count?: number;\n weights?: StatsMultiplier;\n decays?: StatsMultiplier;\n teamCount?: number;\n}\n\nexport class Action implements IAction {\n name = \"\";\n\n // Difficulty scales with level. See getDifficulty() method\n level = 1;\n maxLevel = 1;\n autoLevel = true;\n baseDifficulty = 100;\n difficultyFac = 1.01;\n\n // Rank increase/decrease is affected by this exponent\n rewardFac = 1.02;\n\n successes = 0;\n failures = 0;\n\n // All of these scale with level/difficulty\n rankGain = 0;\n rankLoss = 0;\n hpLoss = 0;\n hpLost = 0;\n\n // Action Category. Current categories are stealth and kill\n isStealth = false;\n isKill = false;\n\n /**\n * Number of this contract remaining, and its growth rate\n * Growth rate is an integer and the count will increase by that integer every \"cycle\"\n */\n count: number = getRandomInt(1e3, 25e3);\n\n // Weighting of each stat in determining action success rate\n weights: StatsMultiplier = {\n hack: 1 / 7,\n str: 1 / 7,\n def: 1 / 7,\n dex: 1 / 7,\n agi: 1 / 7,\n cha: 1 / 7,\n int: 1 / 7,\n };\n // Diminishing returns of stats (stat ^ decay where 0 <= decay <= 1)\n decays: StatsMultiplier = {\n hack: 0.9,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.9,\n int: 0.9,\n };\n teamCount = 0;\n\n // Base Class for Contracts, Operations, and BlackOps\n constructor(params: IActionParams | null = null) {\n // | null = null\n if (params && params.name) this.name = params.name;\n\n if (params && params.baseDifficulty) this.baseDifficulty = addOffset(params.baseDifficulty, 10);\n if (params && params.difficultyFac) this.difficultyFac = params.difficultyFac;\n\n if (params && params.rewardFac) this.rewardFac = params.rewardFac;\n if (params && params.rankGain) this.rankGain = params.rankGain;\n if (params && params.rankLoss) this.rankLoss = params.rankLoss;\n if (params && params.hpLoss) this.hpLoss = params.hpLoss;\n\n if (params && params.isStealth) this.isStealth = params.isStealth;\n if (params && params.isKill) this.isKill = params.isKill;\n\n if (params && params.count) this.count = params.count;\n\n if (params && params.weights) this.weights = params.weights;\n if (params && params.decays) this.decays = params.decays;\n\n // Check to make sure weights are summed properly\n let sum = 0;\n for (const weight of Object.keys(this.weights)) {\n if (this.weights.hasOwnProperty(weight)) {\n sum += this.weights[weight];\n }\n }\n if (sum - 1 >= 10 * Number.EPSILON) {\n throw new Error(\n \"Invalid weights when constructing Action \" +\n this.name +\n \". The weights should sum up to 1. They sum up to :\" +\n 1,\n );\n }\n\n for (const decay of Object.keys(this.decays)) {\n if (this.decays.hasOwnProperty(decay)) {\n if (this.decays[decay] > 1) {\n throw new Error(\n \"Invalid decays when constructing \" + \"Action \" + this.name + \". \" + \"Decay value cannot be greater than 1\",\n );\n }\n }\n }\n }\n\n getDifficulty(): number {\n const difficulty = this.baseDifficulty * Math.pow(this.difficultyFac, this.level - 1);\n if (isNaN(difficulty)) {\n throw new Error(\"Calculated NaN in Action.getDifficulty()\");\n }\n return difficulty;\n }\n\n /**\n * Tests for success. Should be called when an action has completed\n * @param inst {Bladeburner} - Bladeburner instance\n */\n attempt(inst: IBladeburner): boolean {\n return Math.random() < this.getSuccessChance(inst);\n }\n\n // To be implemented by subtypes\n getActionTimePenalty(): number {\n return 1;\n }\n\n getActionTime(inst: IBladeburner): number {\n const difficulty = this.getDifficulty();\n let baseTime = difficulty / BladeburnerConstants.DifficultyToTimeFactor;\n const skillFac = inst.skillMultipliers.actionTime; // Always < 1\n\n const effAgility = Player.agility * inst.skillMultipliers.effAgi;\n const effDexterity = Player.dexterity * inst.skillMultipliers.effDex;\n const statFac =\n 0.5 *\n (Math.pow(effAgility, BladeburnerConstants.EffAgiExponentialFactor) +\n Math.pow(effDexterity, BladeburnerConstants.EffDexExponentialFactor) +\n effAgility / BladeburnerConstants.EffAgiLinearFactor +\n effDexterity / BladeburnerConstants.EffDexLinearFactor); // Always > 1\n\n baseTime = Math.max(1, (baseTime * skillFac) / statFac);\n\n return Math.ceil(baseTime * this.getActionTimePenalty());\n }\n\n // For actions that have teams. To be implemented by subtypes.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getTeamSuccessBonus(inst: IBladeburner): number {\n return 1;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getActionTypeSkillSuccessBonus(inst: IBladeburner): number {\n return 1;\n }\n\n getChaosCompetencePenalty(inst: IBladeburner, params: ISuccessChanceParams): number {\n const city = inst.getCurrentCity();\n if (params.est) {\n return Math.pow(city.popEst / BladeburnerConstants.PopulationThreshold, BladeburnerConstants.PopulationExponent);\n } else {\n return Math.pow(city.pop / BladeburnerConstants.PopulationThreshold, BladeburnerConstants.PopulationExponent);\n }\n }\n\n getChaosDifficultyBonus(inst: IBladeburner /*, params: ISuccessChanceParams*/): number {\n const city = inst.getCurrentCity();\n if (city.chaos > BladeburnerConstants.ChaosThreshold) {\n const diff = 1 + (city.chaos - BladeburnerConstants.ChaosThreshold);\n const mult = Math.pow(diff, 0.5);\n return mult;\n }\n\n return 1;\n }\n\n getEstSuccessChance(inst: IBladeburner): [number, number] {\n function clamp(x: number): number {\n return Math.max(0, Math.min(x, 1));\n }\n const est = this.getSuccessChance(inst, { est: true });\n const real = this.getSuccessChance(inst);\n const diff = Math.abs(real - est);\n let low = real - diff;\n let high = real + diff;\n const city = inst.getCurrentCity();\n const r = city.pop / city.popEst;\n if (r < 1) low *= r;\n else high *= r;\n return [clamp(low), clamp(high)];\n }\n\n /**\n * @inst - Bladeburner Object\n * @params - options:\n * est (bool): Get success chance estimate instead of real success chance\n */\n getSuccessChance(inst: IBladeburner, params: ISuccessChanceParams = { est: false }): number {\n if (inst == null) {\n throw new Error(\"Invalid Bladeburner instance passed into Action.getSuccessChance\");\n }\n let difficulty = this.getDifficulty();\n let competence = 0;\n for (const stat of Object.keys(this.weights)) {\n if (this.weights.hasOwnProperty(stat)) {\n const playerStatLvl = Player.queryStatFromString(stat);\n const key = \"eff\" + stat.charAt(0).toUpperCase() + stat.slice(1);\n let effMultiplier = inst.skillMultipliers[key];\n if (effMultiplier == null) {\n console.error(`Failed to find Bladeburner Skill multiplier for: ${stat}`);\n effMultiplier = 1;\n }\n competence += this.weights[stat] * Math.pow(effMultiplier * playerStatLvl, this.decays[stat]);\n }\n }\n competence *= Player.getIntelligenceBonus(0.75);\n competence *= inst.calculateStaminaPenalty();\n\n competence *= this.getTeamSuccessBonus(inst);\n\n competence *= this.getChaosCompetencePenalty(inst, params);\n difficulty *= this.getChaosDifficultyBonus(inst);\n\n if (this.name == \"Raid\" && inst.getCurrentCity().comms <= 0) {\n return 0;\n }\n\n // Factor skill multipliers into success chance\n competence *= inst.skillMultipliers.successChanceAll;\n competence *= this.getActionTypeSkillSuccessBonus(inst);\n if (this.isStealth) {\n competence *= inst.skillMultipliers.successChanceStealth;\n }\n if (this.isKill) {\n competence *= inst.skillMultipliers.successChanceKill;\n }\n\n // Augmentation multiplier\n competence *= Player.bladeburner_success_chance_mult;\n\n if (isNaN(competence)) {\n throw new Error(\"Competence calculated as NaN in Action.getSuccessChance()\");\n }\n return Math.min(1, competence / difficulty);\n }\n\n getSuccessesNeededForNextLevel(baseSuccessesPerLevel: number): number {\n return Math.ceil(0.5 * this.maxLevel * (2 * baseSuccessesPerLevel + (this.maxLevel - 1)));\n }\n\n setMaxLevel(baseSuccessesPerLevel: number): void {\n if (this.successes >= this.getSuccessesNeededForNextLevel(baseSuccessesPerLevel)) {\n ++this.maxLevel;\n }\n }\n\n toJSON(): any {\n return Generic_toJSON(\"Action\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Action {\n return Generic_fromJSON(Action, value.data);\n }\n}\n\nReviver.constructors.Action = Action;\n","import React from \"react\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface ICityProps {\n currentCity: CityName;\n city: CityName;\n onTravel: (city: CityName) => void;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n travel: {\n color: theme.colors.white,\n lineHeight: \"1em\",\n whiteSpace: \"pre\",\n cursor: \"pointer\"\n },\n })\n);\n\nfunction City(props: ICityProps): React.ReactElement {\n const classes = useStyles();\n if (props.city !== props.currentCity) {\n return (\n <Tooltip title={<Typography>{props.city}</Typography>}>\n <span\n onClick={() => props.onTravel(props.city)}\n className={classes.travel}\n >\n {props.city[0]}\n </span>\n </Tooltip>\n );\n }\n return <span>{props.city[0]}</span>;\n}\n\ninterface IProps {\n currentCity: CityName;\n onTravel: (city: CityName) => void;\n}\n\nexport function WorldMap(props: IProps): React.ReactElement {\n // prettier-ignore\n return (\n <>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ,_ . ._. _. .</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> , _-\\','|~\\~ ~/ ;-'_ _-' ,;_;_, ~~-</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> /~~-\\_/-'~'--' \\~~| ', ,' / / ~|-_\\_/~/~ ~~--~~~~'--_</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / ,/'-/~ '\\ ,' _ , '<City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Volhaven} />,'|~ ._/-, /~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~/-'~\\_, '-,| '|. ' ~ ,\\ /'~ / /_ /~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>.-~ '| '',\\~|\\ _\\~ ,_ , <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Chongqing} /> /,</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> '\\ <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Sector12} /> /'~ |_/~\\\\,-,~ \\ \" ,_,/ |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | / ._-~'\\_ _~| \\ ) <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.NewTokyo} /></Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ __-\\ '/ ~ |\\ \\_ / ~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ., '\\ |, ~-_ - | \\\\_' ~| /\\ \\~ ,</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~-_' _; '\\ '-, \\,' /\\/ |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> '\\_,~'\\_ \\_ _, /' ' |, /|'</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / \\_ ~ | / \\ ~'; -,_.</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ~\\ | | , '-_, ,; ~ ~\\</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\, <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Aevum} /> / \\ / /| ,-, , -,</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ,/ | |' |/ ,- ~ \\ '.</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ,| ,/ \\ ,/ \\ <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Ishima} /> |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / | ~ -~~-, / _</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ,-' ~ /</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / ,' ~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ',| ~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~'</Typography>\n </>\n );\n}\n","import React from \"react\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { StealthIcon } from \"./StealthIcon\";\nimport { KillIcon } from \"./KillIcon\";\nimport { IAction } from \"../IAction\";\nimport { IBladeburner } from \"../IBladeburner\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n action: IAction;\n}\n\nexport function SuccessChance(props: IProps): React.ReactElement {\n const estimatedSuccessChance = props.action.getEstSuccessChance(props.bladeburner);\n\n let chance = <></>;\n if (estimatedSuccessChance[0] === estimatedSuccessChance[1]) {\n chance = <>{formatNumber(estimatedSuccessChance[0] * 100, 1)}%</>;\n } else {\n chance = (\n <>\n {formatNumber(estimatedSuccessChance[0] * 100, 1)}% ~ {formatNumber(estimatedSuccessChance[1] * 100, 1)}%\n </>\n );\n }\n\n return (\n <>\n Estimated success chance: {chance} {props.action.isStealth ? <StealthIcon /> : <></>}\n {props.action.isKill ? <KillIcon /> : <></>}\n </>\n );\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n children: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n}\n\nexport function StaticModal(props: IProps): React.ReactElement {\n return (\n <Modal open={props.open} onClose={props.onClose}>\n {props.children}\n </Modal>\n );\n}\n","import React, { useEffect, useState } from \"react\";\n\nfunction replace(str: string, i: number, char: string): string {\n return str.substring(0, i) + char + str.substring(i + 1);\n}\n\ninterface IProps {\n content: string;\n}\n\nfunction randomize(char: string): string {\n const randFrom = (str: string): string => str[Math.floor(Math.random() * str.length)];\n const classes = [\"abcdefghijklmnopqrstuvwxyz\", \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", \"1234567890\", \" _\", \"()[]{}<>\"];\n const other = `!@#$%^&*()_+|\\\\';\"/.,?\\`~`;\n\n for (const c of classes) {\n if (c.includes(char)) return randFrom(c);\n }\n\n return randFrom(other);\n}\n\nexport function CorruptableText(props: IProps): JSX.Element {\n const [content, setContent] = useState(props.content);\n\n useEffect(() => {\n let counter = 5;\n const timers: number[] = [];\n const intervalId = setInterval(() => {\n counter--;\n if (counter > 0) return;\n counter = Math.random() * 5;\n const index = Math.random() * content.length;\n const letter = content.charAt(index);\n setContent((content) => replace(content, index, randomize(letter)));\n timers.push(window.setTimeout(() => {\n setContent((content) => replace(content, index, letter));\n }, 500));\n }, 20);\n\n return () => {\n clearInterval(intervalId);\n timers.forEach((timerId) => clearTimeout(timerId));\n };\n }, []);\n\n return <span>{content}</span>;\n}\n","import React from \"react\";\nimport { DarkWebItems } from \"./DarkWebItems\";\n\nimport { Player } from \"../Player\";\nimport { Terminal } from \"../Terminal\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\nimport { DarkWebItem } from \"./DarkWebItem\";\n\n//Posts a \"help\" message if connected to DarkWeb\nexport function checkIfConnectedToDarkweb(): void {\n const server = Player.getCurrentServer();\n if (server !== null && SpecialServers.DarkWeb == server.hostname) {\n Terminal.print(\n \"You are now connected to the dark web. From the dark web you can purchase illegal items. \" +\n \"Use the 'buy -l' command to display a list of all the items you can buy. Use 'buy [item-name]' \" +\n \"to purchase an item. Use 'buy -a' to purchase all unowned items.\",\n );\n }\n}\n\nexport function listAllDarkwebItems(): void {\n for (const key of Object.keys(DarkWebItems)) {\n const item = DarkWebItems[key];\n\n const cost = Player.getHomeComputer().programs.includes(item.program) ? (\n <span style={{ color: `green` }}>[OWNED]</span>\n ) : (\n <Money money={item.price} />\n );\n\n Terminal.printRaw(\n <>\n <span>{item.program}</span> - <span>{cost}</span> - <span>{item.description}</span>\n </>,\n );\n }\n}\n\nexport function buyDarkwebItem(itemName: string): void {\n itemName = itemName.toLowerCase();\n\n // find the program that matches, if any\n let item: DarkWebItem | null = null;\n\n for (const key of Object.keys(DarkWebItems)) {\n const i = DarkWebItems[key];\n if (i.program.toLowerCase() == itemName) {\n item = i;\n }\n }\n\n // return if invalid\n if (item === null) {\n Terminal.error(\"Unrecognized item: \" + itemName);\n return;\n }\n\n // return if the player already has it.\n if (Player.hasProgram(item.program)) {\n Terminal.print(\"You already have the \" + item.program + \" program\");\n return;\n }\n\n // return if the player doesn't have enough money\n if (Player.money < item.price) {\n Terminal.error(\"Not enough money to purchase \" + item.program);\n return;\n }\n\n // buy and push\n Player.loseMoney(item.price, \"other\");\n\n const programsRef = Player.getHomeComputer().programs;\n // Remove partially created program if there is one\n const existingPartialExeIndex = programsRef.findIndex(\n (program) => item?.program && program.startsWith(item?.program),\n );\n // findIndex returns -1 if there is no match, we only want to splice on a match\n if (existingPartialExeIndex > -1) {\n programsRef.splice(existingPartialExeIndex, 1);\n }\n // Add the newly bought, full .exe\n Player.getHomeComputer().programs.push(item.program);\n\n Terminal.print(\n \"You have purchased the \" + item.program + \" program. The new program can be found on your home computer.\",\n );\n}\n\nexport function buyAllDarkwebItems(): void {\n const itemsToBuy: DarkWebItem[] = [];\n let cost = 0;\n\n for (const key of Object.keys(DarkWebItems)) {\n const item = DarkWebItems[key];\n if (!Player.hasProgram(item.program)) {\n itemsToBuy.push(item);\n cost += item.price;\n }\n }\n\n if (itemsToBuy.length === 0) {\n Terminal.print(\"All available programs have been purchased already.\");\n return;\n }\n\n if (cost > Player.money) {\n Terminal.error(\"Not enough money to purchase remaining programs, \" + numeralWrapper.formatMoney(cost) + \" required\");\n return;\n }\n\n for (const item of itemsToBuy) {\n buyDarkwebItem(item.program);\n }\n}\n","// The initial formulas was sum 0 to f of 500*1.02^f.\n// see https://en.wikipedia.org/wiki/Geometric_series#Closed-form_formula\n// for information on how to calculate this\n\nexport function favorToRep(f: number): number {\n const raw = 25000 * (Math.pow(1.02, f) - 1);\n return Math.round(raw * 10000) / 10000; // round to make things easier.\n}\n\nexport function repToFavor(r: number): number {\n const raw = Math.log(r / 25000 + 1) / Math.log(1.02);\n return Math.round(raw * 10000) / 10000; // round to make things easier.\n}\n","/**\n * Functions used to determine whether the target can be hacked (or grown/weakened).\n * Meant to be used for Netscript implementation\n *\n * The returned status object's message should be used for logging in Netscript\n */\nimport { IReturnStatus } from \"../types\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Server } from \"../Server/Server\";\n\nfunction baseCheck(server: Server, fnName: string): IReturnStatus {\n const hostname = server.hostname;\n\n if (!(\"requiredHackingSkill\" in server)) {\n return {\n res: false,\n msg: `Cannot ${fnName} ${hostname} server because it is a Hacknet Node`,\n };\n }\n\n if (server.hasAdminRights === false) {\n return {\n res: false,\n msg: `Cannot ${fnName} ${hostname} server because you do not have root access`,\n };\n }\n\n return { res: true };\n}\n\nexport function netscriptCanHack(server: Server, p: IPlayer): IReturnStatus {\n const initialCheck = baseCheck(server, \"hack\");\n if (!initialCheck.res) {\n return initialCheck;\n }\n\n const s = server;\n if (s.requiredHackingSkill > p.hacking) {\n return {\n res: false,\n msg: `Cannot hack ${server.hostname} server because your hacking skill is not high enough`,\n };\n }\n\n return { res: true };\n}\n\nexport function netscriptCanGrow(server: Server): IReturnStatus {\n return baseCheck(server, \"grow\");\n}\n\nexport function netscriptCanWeaken(server: Server): IReturnStatus {\n return baseCheck(server, \"weaken\");\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Reputation } from \"../../ui/React/Reputation\";\n\nexport function ReputationRate({ reputation }: { reputation: number }): React.ReactElement {\n return <Reputation reputation={`${numeralWrapper.formatReputation(reputation)} / sec`} />;\n}\n","import { substituteAliases } from \"../Alias\";\n// Helper function that checks if an argument (which is a string) is a valid number\nfunction isNumber(str: string): boolean {\n if (typeof str != \"string\") {\n return false;\n } // Only process strings\n return !isNaN(str as unknown as number) && !isNaN(parseFloat(str));\n}\nexport function ParseCommands(commands: string): string[] {\n // Sanitize input\n commands = commands.trim();\n // Replace all extra whitespace in command with a single space\n commands = commands.replace(/\\s\\s+/g, \" \");\n\n const match = commands.match(/(?:'[^']*'|\"[^\"]*\"|[^;\"])*/g);\n if (!match) return [];\n // Split commands and execute sequentially\n const allCommands = match\n .map(substituteAliases)\n .map((c) => c.match(/(?:'[^']*'|\"[^\"]*\"|[^;\"])*/g))\n .flat();\n\n const out: string[] = [];\n for (const c of allCommands) {\n if (c === null) continue;\n if (c.match(/^\\s*$/)) {\n continue;\n } // Don't run commands that only have whitespace\n out.push(c.trim());\n }\n return out;\n}\n\nexport function ParseCommand(command: string): (string | number | boolean)[] {\n // This will be used to keep track of whether we're in a quote. This is for situations\n // like the alias command:\n // alias run=\"run NUKE.exe\"\n // We want the run=\"run NUKE.exe\" to be parsed as a single command, so this flag\n // will keep track of whether we have a quote in\n let inQuote = ``;\n\n // Returns an array with the command and its arguments in each index\n // Properly handles quotation marks (e.g. `run foo.script \"the sun\"` will return [run, foo.script, the sun])\n const args = [];\n let start = 0,\n i = 0;\n let prevChar = \"\"; // Previous character\n while (i < command.length) {\n let escaped = false; // Check for escaped quotation marks\n if (i >= 1) {\n prevChar = command.charAt(i - 1);\n if (prevChar === \"\\\\\") {\n escaped = true;\n }\n }\n\n const c = command.charAt(i);\n if (c === '\"') {\n // Double quotes\n if (!escaped && prevChar === \" \") {\n const endQuote = command.indexOf('\"', i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === \" \")) {\n args.push(command.substr(i + 1, endQuote - i - 1));\n if (endQuote === command.length - 1) {\n start = i = endQuote + 1;\n } else {\n start = i = endQuote + 2; // Skip the space\n }\n continue;\n }\n } else {\n if (inQuote === ``) {\n inQuote = `\"`;\n } else if (inQuote === `\"`) {\n inQuote = ``;\n }\n }\n } else if (c === \"'\") {\n // Single quotes, same thing as above\n if (!escaped && prevChar === \" \") {\n const endQuote = command.indexOf(\"'\", i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === \" \")) {\n args.push(command.substr(i + 1, endQuote - i - 1));\n if (endQuote === command.length - 1) {\n start = i = endQuote + 1;\n } else {\n start = i = endQuote + 2; // Skip the space\n }\n continue;\n }\n } else {\n if (inQuote === ``) {\n inQuote = `'`;\n } else if (inQuote === `'`) {\n inQuote = ``;\n }\n }\n } else if (c === \" \" && inQuote === ``) {\n const arg = command.substr(start, i - start);\n\n // If this is a number, convert it from a string to number\n if (isNumber(arg)) {\n args.push(parseFloat(arg));\n } else if (arg === \"true\") {\n args.push(true);\n } else if (arg === \"false\") {\n args.push(false);\n } else {\n args.push(arg);\n }\n\n start = i + 1;\n }\n ++i;\n }\n\n // Add the last argument\n if (start !== i) {\n const arg = command.substr(start, i - start);\n\n // If this is a number, convert it from string to number\n if (isNumber(arg)) {\n args.push(parseFloat(arg));\n } else if (arg === \"true\") {\n args.push(true);\n } else if (arg === \"false\") {\n args.push(false);\n } else {\n args.push(arg);\n }\n }\n\n return args;\n}\n","/**\n * Implements the purchasing of extra Duplicate Sleeves from The Covenant,\n * as well as the purchasing of upgrades (memory)\n */\n\nexport const MaxSleevesFromCovenant = 5;\nexport const BaseCostPerSleeve = 10e12;\n","/**\n * Implements RAM Calculation functionality.\n *\n * Uses the acorn.js library to parse a script's code into an AST and\n * recursively walk through that AST, calculating RAM usage along\n * the way\n */\nimport * as walk from \"acorn-walk\";\nimport acorn, { parse } from \"acorn\";\n\nimport { RamCalculationErrorCode } from \"./RamCalculationErrorCodes\";\n\nimport { RamCosts, RamCostConstants } from \"../Netscript/RamCostGenerator\";\nimport { Script } from \"../Script/Script\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { areImportsEquals } from \"../Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nexport interface RamUsageEntry {\n type: 'ns' | 'dom' | 'fn' | 'misc';\n name: string;\n cost: number;\n}\n\nexport interface RamCalculation {\n cost: number;\n entries?: RamUsageEntry[];\n}\n\n// These special strings are used to reference the presence of a given logical\n// construct within a user script.\nconst specialReferenceIF = \"__SPECIAL_referenceIf\";\nconst specialReferenceFOR = \"__SPECIAL_referenceFor\";\nconst specialReferenceWHILE = \"__SPECIAL_referenceWhile\";\n\n// The global scope of a script is registered under this key during parsing.\nconst memCheckGlobalKey = \".__GLOBAL__\";\n\n/**\n * Parses code into an AST and walks through it recursively to calculate\n * RAM usage. Also accounts for imported modules.\n * @param {Script[]} otherScripts - All other scripts on the server. Used to account for imported scripts\n * @param {string} codeCopy - The code being parsed\n * @param {WorkerScript} workerScript - Object containing RAM costs of Netscript functions. Also used to\n * keep track of what functions have/havent been accounted for\n */\nasync function parseOnlyRamCalculate(\n player: IPlayer,\n otherScripts: Script[],\n code: string,\n workerScript: WorkerScript,\n): Promise<RamCalculation> {\n try {\n /**\n * Maps dependent identifiers to their dependencies.\n *\n * The initial identifier is __SPECIAL_INITIAL_MODULE__.__GLOBAL__.\n * It depends on all the functions declared in the module, all the global scopes\n * of its imports, and any identifiers referenced in this global scope. Each\n * function depends on all the identifiers referenced internally.\n * We walk the dependency graph to calculate RAM usage, given that some identifiers\n * reference Netscript functions which have a RAM cost.\n */\n let dependencyMap: { [key: string]: string[] } = {};\n\n // Scripts we've parsed.\n const completedParses = new Set();\n\n // Scripts we've discovered that need to be parsed.\n const parseQueue: string[] = [];\n\n // Parses a chunk of code with a given module name, and updates parseQueue and dependencyMap.\n function parseCode(code: string, moduleName: string): void {\n const result = parseOnlyCalculateDeps(code, moduleName);\n completedParses.add(moduleName);\n\n // Add any additional modules to the parse queue;\n for (let i = 0; i < result.additionalModules.length; ++i) {\n if (!completedParses.has(result.additionalModules[i])) {\n parseQueue.push(result.additionalModules[i]);\n }\n }\n\n // Splice all the references in\n dependencyMap = Object.assign(dependencyMap, result.dependencyMap);\n }\n\n // Parse the initial module, which is the \"main\" script that is being run\n const initialModule = \"__SPECIAL_INITIAL_MODULE__\";\n parseCode(code, initialModule);\n\n // Process additional modules, which occurs if the \"main\" script has any imports\n while (parseQueue.length > 0) {\n const nextModule = parseQueue.shift();\n if (nextModule === undefined) throw new Error(\"nextModule should not be undefined\");\n\n // Additional modules can either be imported from the web (in which case we use\n // a dynamic import), or from other in-game scripts\n let code;\n if (nextModule.startsWith(\"https://\") || nextModule.startsWith(\"http://\")) {\n try {\n // eslint-disable-next-line no-await-in-loop\n const module = await eval(\"import(nextModule)\");\n code = \"\";\n for (const prop in module) {\n if (typeof module[prop] === \"function\") {\n code += module[prop].toString() + \";\\n\";\n }\n }\n } catch (e) {\n console.error(`Error dynamically importing module from ${nextModule} for RAM calculations: ${e}`);\n return { cost: RamCalculationErrorCode.URLImportError };\n }\n } else {\n if (!Array.isArray(otherScripts)) {\n console.warn(`parseOnlyRamCalculate() not called with array of scripts`);\n return { cost: RamCalculationErrorCode.ImportError };\n }\n\n let script = null;\n const fn = nextModule.startsWith(\"./\") ? nextModule.slice(2) : nextModule;\n for (const s of otherScripts) {\n if (areImportsEquals(s.filename, fn)) {\n script = s;\n break;\n }\n }\n\n if (script == null) {\n return { cost: RamCalculationErrorCode.ImportError }; // No such script on the server\n }\n\n code = script.code;\n }\n\n parseCode(code, nextModule);\n }\n\n // Finally, walk the reference map and generate a ram cost. The initial set of keys to scan\n // are those that start with __SPECIAL_INITIAL_MODULE__.\n let ram = RamCostConstants.ScriptBaseRamCost;\n const detailedCosts: RamUsageEntry[] = [{ type: 'misc', name: 'baseCost', cost: RamCostConstants.ScriptBaseRamCost}];\n const unresolvedRefs = Object.keys(dependencyMap).filter((s) => s.startsWith(initialModule));\n const resolvedRefs = new Set();\n while (unresolvedRefs.length > 0) {\n const ref = unresolvedRefs.shift();\n if (ref === undefined) throw new Error(\"ref should not be undefined\");\n\n // Check if this is one of the special keys, and add the appropriate ram cost if so.\n if (ref === \"hacknet\" && !resolvedRefs.has(\"hacknet\")) {\n ram += RamCostConstants.ScriptHacknetNodesRamCost;\n detailedCosts.push({ type: 'ns', name: 'hacknet', cost: RamCostConstants.ScriptHacknetNodesRamCost});\n }\n if (ref === \"document\" && !resolvedRefs.has(\"document\")) {\n ram += RamCostConstants.ScriptDomRamCost;\n detailedCosts.push({ type: 'dom', name: 'document', cost: RamCostConstants.ScriptDomRamCost});\n }\n if (ref === \"window\" && !resolvedRefs.has(\"window\")) {\n ram += RamCostConstants.ScriptDomRamCost;\n detailedCosts.push({ type: 'dom', name: 'window', cost: RamCostConstants.ScriptDomRamCost});\n }\n if (ref === \"corporation\" && !resolvedRefs.has(\"corporation\")) {\n ram += RamCostConstants.ScriptCorporationRamCost;\n detailedCosts.push({ type: 'ns', name: 'corporation', cost: RamCostConstants.ScriptCorporationRamCost});\n }\n\n resolvedRefs.add(ref);\n\n if (ref.endsWith(\".*\")) {\n // A prefix reference. We need to find all matching identifiers.\n const prefix = ref.slice(0, ref.length - 2);\n for (const ident of Object.keys(dependencyMap).filter((k) => k.startsWith(prefix))) {\n for (const dep of dependencyMap[ident] || []) {\n if (!resolvedRefs.has(dep)) unresolvedRefs.push(dep);\n }\n }\n } else {\n // An exact reference. Add all dependencies of this ref.\n for (const dep of dependencyMap[ref] || []) {\n if (!resolvedRefs.has(dep)) unresolvedRefs.push(dep);\n }\n }\n\n // Check if this identifier is a function in the workerScript environment.\n // If it is, then we need to get its RAM cost.\n try {\n function applyFuncRam(cost: any): number {\n if (typeof cost === \"number\") {\n return cost;\n } else if (typeof cost === \"function\") {\n return cost(player);\n } else {\n return 0;\n }\n }\n\n // Only count each function once\n if (workerScript.loadedFns[ref]) {\n continue;\n } else {\n workerScript.loadedFns[ref] = true;\n }\n\n // This accounts for namespaces (Bladeburner, CodingCpntract, etc.)\n let func;\n let refDetail = 'n/a';\n if (ref in workerScript.env.vars.bladeburner) {\n func = workerScript.env.vars.bladeburner[ref];\n refDetail = `bladeburner.${ref}`;\n } else if (ref in workerScript.env.vars.codingcontract) {\n func = workerScript.env.vars.codingcontract[ref];\n refDetail = `codingcontract.${ref}`;\n } else if (ref in workerScript.env.vars.stanek) {\n func = workerScript.env.vars.stanek[ref];\n refDetail = `stanek.${ref}`;\n } else if (ref in workerScript.env.vars.gang) {\n func = workerScript.env.vars.gang[ref];\n refDetail = `gang.${ref}`;\n } else if (ref in workerScript.env.vars.sleeve) {\n func = workerScript.env.vars.sleeve[ref];\n refDetail = `sleeve.${ref}`;\n } else if (ref in workerScript.env.vars.stock) {\n func = workerScript.env.vars.stock[ref];\n refDetail = `stock.${ref}`;\n } else if (ref in workerScript.env.vars.ui) {\n func = workerScript.env.vars.ui[ref];\n refDetail = `ui.${ref}`;\n } else {\n func = workerScript.env.vars[ref];\n refDetail = `${ref}`;\n }\n const fnRam = applyFuncRam(func);\n ram += fnRam;\n detailedCosts.push({ type: 'fn', name: refDetail, cost: fnRam});\n } catch (error) {\n continue;\n }\n }\n return { cost: ram, entries: detailedCosts.filter(e => e.cost > 0) };\n } catch (error) {\n // console.info(\"parse or eval error: \", error);\n // This is not unexpected. The user may be editing a script, and it may be in\n // a transitory invalid state.\n return { cost: RamCalculationErrorCode.SyntaxError };\n }\n}\n\nexport function checkInfiniteLoop(code: string): number {\n const ast = parse(code, { sourceType: \"module\", ecmaVersion: \"latest\" });\n\n function nodeHasTrueTest(node: acorn.Node): boolean {\n return node.type === \"Literal\" && (node as any).raw === \"true\";\n }\n\n function hasAwait(ast: acorn.Node): boolean {\n let hasAwait = false;\n walk.recursive(\n ast,\n {},\n {\n AwaitExpression: () => {\n hasAwait = true;\n },\n },\n );\n return hasAwait;\n }\n\n let missingAwaitLine = -1;\n walk.recursive(\n ast,\n {},\n {\n WhileStatement: (node: acorn.Node, st: any, walkDeeper: walk.WalkerCallback<any>) => {\n if (nodeHasTrueTest((node as any).test) && !hasAwait(node)) {\n missingAwaitLine = (code.slice(0, node.start).match(/\\n/g) || []).length + 1;\n } else {\n (node as any).body && walkDeeper((node as any).body, st);\n }\n },\n },\n );\n\n return missingAwaitLine;\n}\n\n/**\n * Helper function that parses a single script. It returns a map of all dependencies,\n * which are items in the code's AST that potentially need to be evaluated\n * for RAM usage calculations. It also returns an array of additional modules\n * that need to be parsed (i.e. are 'import'ed scripts).\n */\nfunction parseOnlyCalculateDeps(code: string, currentModule: string): any {\n const ast = parse(code, { sourceType: \"module\", ecmaVersion: \"latest\" });\n // Everything from the global scope goes in \".\". Everything else goes in \".function\", where only\n // the outermost layer of functions counts.\n const globalKey = currentModule + memCheckGlobalKey;\n const dependencyMap: { [key: string]: Set<string> | undefined } = {};\n dependencyMap[globalKey] = new Set<string>();\n\n // If we reference this internal name, we're really referencing that external name.\n // Filled when we import names from other modules.\n const internalToExternal: { [key: string]: string | undefined } = {};\n\n const additionalModules: string[] = [];\n\n // References get added pessimistically. They are added for thisModule.name, name, and for\n // any aliases.\n function addRef(key: string, name: string): void {\n const s = dependencyMap[key] || (dependencyMap[key] = new Set());\n const external = internalToExternal[name];\n if (external !== undefined) {\n s.add(external);\n }\n s.add(currentModule + \".\" + name);\n s.add(name); // For builtins like hack.\n }\n\n //A list of identifiers that resolve to \"native Javascript code\"\n const objectPrototypeProperties = Object.getOwnPropertyNames(Object.prototype);\n\n // If we discover a dependency identifier, state.key is the dependent identifier.\n // walkDeeper is for doing recursive walks of expressions in composites that we handle.\n function commonVisitors(): any {\n return {\n Identifier: (node: any, st: any) => {\n if (objectPrototypeProperties.includes(node.name)) {\n return;\n }\n addRef(st.key, node.name);\n },\n WhileStatement: (node: any, st: any, walkDeeper: any) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n DoWhileStatement: (node: any, st: any, walkDeeper: any) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n ForStatement: (node: any, st: any, walkDeeper: any) => {\n addRef(st.key, specialReferenceFOR);\n node.init && walkDeeper(node.init, st);\n node.test && walkDeeper(node.test, st);\n node.update && walkDeeper(node.update, st);\n node.body && walkDeeper(node.body, st);\n },\n IfStatement: (node: any, st: any, walkDeeper: any) => {\n addRef(st.key, specialReferenceIF);\n node.test && walkDeeper(node.test, st);\n node.consequent && walkDeeper(node.consequent, st);\n node.alternate && walkDeeper(node.alternate, st);\n },\n MemberExpression: (node: any, st: any, walkDeeper: any) => {\n node.object && walkDeeper(node.object, st);\n node.property && walkDeeper(node.property, st);\n },\n };\n }\n\n walk.recursive(\n ast,\n { key: globalKey },\n Object.assign(\n {\n ImportDeclaration: (node: any, st: any) => {\n const importModuleName = node.source.value;\n additionalModules.push(importModuleName);\n\n // This module's global scope refers to that module's global scope, no matter how we\n // import it.\n const set = dependencyMap[st.key];\n if (set === undefined) throw new Error(\"set should not be undefined\");\n set.add(importModuleName + memCheckGlobalKey);\n\n for (let i = 0; i < node.specifiers.length; ++i) {\n const spec = node.specifiers[i];\n if (spec.imported !== undefined && spec.local !== undefined) {\n // We depend on specific things.\n internalToExternal[spec.local.name] = importModuleName + \".\" + spec.imported.name;\n } else {\n // We depend on everything.\n const set = dependencyMap[st.key];\n if (set === undefined) throw new Error(\"set should not be undefined\");\n set.add(importModuleName + \".*\");\n }\n }\n },\n FunctionDeclaration: (node: any) => {\n // node.id will be null when using 'export default'. Add a module name indicating the default export.\n const key = currentModule + \".\" + (node.id === null ? \"__SPECIAL_DEFAULT_EXPORT__\" : node.id.name);\n walk.recursive(node, { key: key }, commonVisitors());\n },\n },\n commonVisitors(),\n ),\n );\n\n return { dependencyMap: dependencyMap, additionalModules: additionalModules };\n}\n\n/**\n * Calculate's a scripts RAM Usage\n * @param {string} codeCopy - The script's code\n * @param {Script[]} otherScripts - All other scripts on the server.\n * Used to account for imported scripts\n */\nexport async function calculateRamUsage(\n player: IPlayer,\n codeCopy: string,\n otherScripts: Script[],\n): Promise<RamCalculation> {\n // We don't need a real WorkerScript for this. Just an object that keeps\n // track of whatever's needed for RAM calculations\n const workerScript = {\n loadedFns: {},\n env: {\n vars: RamCosts,\n },\n } as WorkerScript;\n\n try {\n return await parseOnlyRamCalculate(player, otherScripts, codeCopy, workerScript);\n } catch (e) {\n console.error(`Failed to parse script for RAM calculations:`);\n console.error(e);\n return { cost: RamCalculationErrorCode.SyntaxError };\n }\n\n return { cost: RamCalculationErrorCode.SyntaxError };\n}\n","/**\n * Rounds a number to two decimal places.\n * @param decimal A decimal value to trim to two places.\n */\nexport function roundToTwo(decimal: number): number {\n const leftShift: number = Math.round(parseFloat(`${decimal}e+2`));\n\n return +`${leftShift}e-2`;\n}\n","import { CalculateShareMult as CSM } from \"./formulas/share\";\n\nexport let sharePower = 1;\n\nexport function StartSharing(threads: number): () => void {\n sharePower += threads;\n return () => (sharePower -= threads);\n}\n\nexport function CalculateShareMult(): number {\n return CSM(sharePower);\n}\n","/**\n * TODO\n * Add police clashes\n * balance point to keep them from running out of control\n */\n\nimport { Faction } from \"../Faction/Faction\";\nimport { Factions } from \"../Faction/Factions\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON } from \"../utils/JSONReviver\";\n\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\nimport { GangConstants } from \"./data/Constants\";\nimport { CONSTANTS } from \"../Constants\";\nimport { GangMemberTasks } from \"./GangMemberTasks\";\nimport { IAscensionResult } from \"./IAscensionResult\";\n\nimport { AllGangs } from \"./AllGangs\";\nimport { GangMember } from \"./GangMember\";\n\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { PowerMultiplier } from \"./data/power\";\nimport { IGang } from \"./IGang\";\n\nexport class Gang implements IGang {\n facName: string;\n members: GangMember[];\n wanted: number;\n respect: number;\n\n isHackingGang: boolean;\n\n respectGainRate: number;\n wantedGainRate: number;\n moneyGainRate: number;\n\n storedCycles: number;\n\n storedTerritoryAndPowerCycles: number;\n\n territoryClashChance: number;\n territoryWarfareEngaged: boolean;\n\n notifyMemberDeath: boolean;\n\n constructor(facName = \"\", hacking = false) {\n this.facName = facName;\n this.members = [];\n this.wanted = 1;\n this.respect = 1;\n\n this.isHackingGang = hacking;\n\n this.respectGainRate = 0;\n this.wantedGainRate = 0;\n this.moneyGainRate = 0;\n\n // When processing gains, this stores the number of cycles until some\n // limit is reached, and then calculates and applies the gains only at that limit\n this.storedCycles = 0;\n\n // Separate variable to keep track of cycles for Territry + Power gang, which\n // happens on a slower \"clock\" than normal processing\n this.storedTerritoryAndPowerCycles = 0;\n\n this.territoryClashChance = 0;\n this.territoryWarfareEngaged = false;\n\n this.notifyMemberDeath = true;\n }\n\n getPower(): number {\n return AllGangs[this.facName].power;\n }\n\n getTerritory(): number {\n return AllGangs[this.facName].territory;\n }\n\n process(numCycles = 1, player: IPlayer): void {\n const CyclesPerSecond = 1000 / CONSTANTS._idleSpeed;\n\n if (isNaN(numCycles)) {\n console.error(`NaN passed into Gang.process(): ${numCycles}`);\n }\n this.storedCycles += numCycles;\n\n // Only process if there are at least 2 seconds, and at most 5 seconds\n if (this.storedCycles < 2 * CyclesPerSecond) return;\n const cycles = Math.min(this.storedCycles, 5 * CyclesPerSecond);\n\n try {\n this.processGains(cycles, player);\n this.processExperienceGains(cycles);\n this.processTerritoryAndPowerGains(cycles);\n this.storedCycles -= cycles;\n } catch (e: any) {\n console.error(`Exception caught when processing Gang: ${e}`);\n }\n }\n\n processGains(numCycles = 1, player: IPlayer): void {\n // Get gains per cycle\n let moneyGains = 0;\n let respectGains = 0;\n let wantedLevelGains = 0;\n let justice = 0;\n for (let i = 0; i < this.members.length; ++i) {\n respectGains += this.members[i].calculateRespectGain(this);\n moneyGains += this.members[i].calculateMoneyGain(this);\n const wantedLevelGain = this.members[i].calculateWantedLevelGain(this);\n wantedLevelGains += wantedLevelGain;\n if (this.members[i].getTask().baseWanted < 0) justice++; // this member is lowering wanted.\n }\n this.respectGainRate = respectGains;\n this.wantedGainRate = wantedLevelGains;\n this.moneyGainRate = moneyGains;\n const gain = respectGains * numCycles;\n this.respect += gain;\n // Faction reputation gains is respect gain divided by some constant\n const fac = Factions[this.facName];\n if (!(fac instanceof Faction)) {\n dialogBoxCreate(\n \"ERROR: Could not get Faction associates with your gang. This is a bug, please report to game dev\",\n );\n throw new Error(\"Could not find the faction associated with this gang.\");\n }\n const favorMult = 1 + fac.favor / 100;\n\n fac.playerReputation += (player.faction_rep_mult * gain * favorMult) / GangConstants.GangRespectToReputationRatio;\n\n // Keep track of respect gained per member\n for (let i = 0; i < this.members.length; ++i) {\n this.members[i].recordEarnedRespect(numCycles, this);\n }\n if (!(this.wanted === 1 && wantedLevelGains < 0)) {\n const oldWanted = this.wanted;\n let newWanted = oldWanted + wantedLevelGains * numCycles;\n newWanted = newWanted * (1 - justice * 0.001); // safeguard\n // Prevent overflow\n if (wantedLevelGains <= 0 && newWanted > oldWanted) newWanted = 1;\n\n this.wanted = newWanted;\n if (this.wanted < 1) this.wanted = 1;\n }\n player.gainMoney(moneyGains * numCycles, \"gang\");\n }\n\n processTerritoryAndPowerGains(numCycles = 1): void {\n this.storedTerritoryAndPowerCycles += numCycles;\n if (this.storedTerritoryAndPowerCycles < GangConstants.CyclesPerTerritoryAndPowerUpdate) return;\n this.storedTerritoryAndPowerCycles -= GangConstants.CyclesPerTerritoryAndPowerUpdate;\n\n // Process power first\n const gangName = this.facName;\n for (const name of Object.keys(AllGangs)) {\n if (AllGangs.hasOwnProperty(name)) {\n if (name == gangName) {\n AllGangs[name].power += this.calculatePower();\n } else {\n // All NPC gangs get random power gains\n const gainRoll = Math.random();\n if (gainRoll < 0.5) {\n // Multiplicative gain (50% chance)\n // This is capped per cycle, to prevent it from getting out of control\n const multiplicativeGain = AllGangs[name].power * 0.005;\n AllGangs[name].power += Math.min(0.85, multiplicativeGain);\n } else {\n // Additive gain (50% chance)\n const powerMult = PowerMultiplier[name];\n if (powerMult === undefined) throw new Error(\"Should not be undefined\");\n const additiveGain = 0.75 * gainRoll * AllGangs[name].territory * powerMult;\n AllGangs[name].power += additiveGain;\n }\n }\n }\n }\n\n // Determine if territory should be processed\n if (this.territoryWarfareEngaged) {\n this.territoryClashChance = 1;\n } else if (this.territoryClashChance > 0) {\n // Engagement turned off, but still a positive clash chance. So there's\n // still a chance of clashing but it slowly goes down over time\n this.territoryClashChance = Math.max(0, this.territoryClashChance - 0.01);\n }\n\n // Then process territory\n const gangs = GangConstants.Names.filter((g) => AllGangs[g].territory > 0);\n if (gangs.length > 1) {\n for (let i = 0; i < gangs.length; ++i) {\n const others = gangs.filter((e) => {\n return e !== gangs[i];\n });\n const other = getRandomInt(0, others.length - 1);\n\n const thisGang = gangs[i];\n const otherGang = others[other];\n\n // If either of the gangs involved in this clash is the player, determine\n // whether to skip or process it using the clash chance\n if (thisGang === gangName || otherGang === gangName) {\n if (!(Math.random() < this.territoryClashChance)) continue;\n }\n\n const thisPwr = AllGangs[thisGang].power;\n const otherPwr = AllGangs[otherGang].power;\n const thisChance = thisPwr / (thisPwr + otherPwr);\n\n function calculateTerritoryGain(winGang: string, loseGang: string): number {\n const powerBonus = Math.max(\n 1,\n 1 + Math.log(AllGangs[winGang].power / AllGangs[loseGang].power) / Math.log(50),\n );\n const gains = Math.min(AllGangs[loseGang].territory, powerBonus * 0.0001 * (Math.random() + 0.5));\n return gains;\n }\n\n if (Math.random() < thisChance) {\n if (AllGangs[otherGang].territory <= 0) return;\n const territoryGain = calculateTerritoryGain(thisGang, otherGang);\n AllGangs[thisGang].territory += territoryGain;\n if (AllGangs[thisGang].territory > 1) AllGangs[thisGang].territory = 1;\n AllGangs[otherGang].territory -= territoryGain;\n if (AllGangs[thisGang].territory < 0) AllGangs[thisGang].territory = 0;\n if (thisGang === gangName) {\n this.clash(true); // Player won\n AllGangs[otherGang].power *= 1 / 1.01;\n } else if (otherGang === gangName) {\n this.clash(false); // Player lost\n } else {\n AllGangs[otherGang].power *= 1 / 1.01;\n }\n } else {\n if (AllGangs[thisGang].territory <= 0) return;\n const territoryGain = calculateTerritoryGain(otherGang, thisGang);\n AllGangs[thisGang].territory -= territoryGain;\n if (AllGangs[otherGang].territory < 0) AllGangs[otherGang].territory = 0;\n AllGangs[otherGang].territory += territoryGain;\n if (AllGangs[otherGang].territory > 1) AllGangs[otherGang].territory = 1;\n if (thisGang === gangName) {\n this.clash(false); // Player lost\n } else if (otherGang === gangName) {\n this.clash(true); // Player won\n AllGangs[thisGang].power *= 1 / 1.01;\n } else {\n AllGangs[thisGang].power *= 1 / 1.01;\n }\n }\n }\n }\n }\n\n processExperienceGains(numCycles = 1): void {\n for (let i = 0; i < this.members.length; ++i) {\n this.members[i].gainExperience(numCycles);\n this.members[i].updateSkillLevels();\n }\n }\n\n clash(won = false): void {\n // Determine if a gang member should die\n let baseDeathChance = 0.01;\n if (won) baseDeathChance /= 2;\n // If the clash was lost, the player loses a small percentage of power\n else AllGangs[this.facName].power *= 1 / 1.008;\n\n // Deaths can only occur during X% of clashes\n if (Math.random() < 0.65) return;\n\n for (let i = this.members.length - 1; i >= 0; --i) {\n const member = this.members[i];\n\n // Only members assigned to Territory Warfare can die\n if (member.task !== \"Territory Warfare\") continue;\n\n // Chance to die is decreased based on defense\n const modifiedDeathChance = baseDeathChance / Math.pow(member.def, 0.6);\n if (Math.random() < modifiedDeathChance) {\n this.killMember(member);\n }\n }\n }\n\n canRecruitMember(): boolean {\n if (this.members.length >= GangConstants.MaximumGangMembers) return false;\n return this.respect >= this.getRespectNeededToRecruitMember();\n }\n\n getRespectNeededToRecruitMember(): number {\n // First N gang members are free (can be recruited at 0 respect)\n const numFreeMembers = 3;\n if (this.members.length < numFreeMembers) return 0;\n\n const i = this.members.length - (numFreeMembers - 1);\n return Math.pow(5, i);\n }\n\n recruitMember(name: string): boolean {\n name = String(name);\n if (name === \"\" || !this.canRecruitMember()) return false;\n\n // Check for already-existing names\n const sameNames = this.members.filter((m) => m.name === name);\n if (sameNames.length >= 1) return false;\n\n const member = new GangMember(name);\n this.members.push(member);\n return true;\n }\n\n // Money and Respect gains multiplied by this number (< 1)\n getWantedPenalty(): number {\n return this.respect / (this.respect + this.wanted);\n }\n\n //Calculates power GAIN, which is added onto the Gang's existing power\n calculatePower(): number {\n let memberTotal = 0;\n for (let i = 0; i < this.members.length; ++i) {\n if (!GangMemberTasks.hasOwnProperty(this.members[i].task) || this.members[i].task !== \"Territory Warfare\")\n continue;\n memberTotal += this.members[i].calculatePower();\n }\n return 0.015 * Math.max(0.002, this.getTerritory()) * memberTotal;\n }\n\n killMember(member: GangMember): void {\n // Player loses a percentage of total respect, plus whatever respect that member has earned\n const totalRespect = this.respect;\n const lostRespect = 0.05 * totalRespect + member.earnedRespect;\n this.respect = Math.max(0, totalRespect - lostRespect);\n\n for (let i = 0; i < this.members.length; ++i) {\n if (member.name === this.members[i].name) {\n this.members.splice(i, 1);\n break;\n }\n }\n\n // Notify of death\n if (this.notifyMemberDeath) {\n dialogBoxCreate(`${member.name} was killed in a gang clash! You lost ${lostRespect} respect`);\n }\n }\n\n ascendMember(member: GangMember, workerScript?: WorkerScript): IAscensionResult {\n try {\n const res = member.ascend();\n this.respect = Math.max(1, this.respect - res.respect);\n if (workerScript) {\n workerScript.log(\"gang.ascendMember\", () => `Ascended Gang member ${member.name}`);\n }\n return res;\n } catch (e: any) {\n if (workerScript == null) {\n exceptionAlert(e);\n }\n throw e; // Re-throw, will be caught in the Netscript Function\n }\n }\n\n // Cost of upgrade gets cheaper as gang increases in respect + power\n getDiscount(): number {\n const power = this.getPower();\n const respect = this.respect;\n\n const respectLinearFac = 5e6;\n const powerLinearFac = 1e6;\n const discount =\n Math.pow(respect, 0.01) + respect / respectLinearFac + Math.pow(power, 0.01) + power / powerLinearFac - 1;\n return Math.max(1, discount);\n }\n\n // Returns only valid tasks for this gang. Excludes 'Unassigned'\n getAllTaskNames(): string[] {\n return Object.keys(GangMemberTasks).filter((taskName: string) => {\n const task = GangMemberTasks[taskName];\n if (task == null) return false;\n if (task.name === \"Unassigned\") return false;\n // yes you need both checks\n return this.isHackingGang === task.isHacking || !this.isHackingGang === task.isCombat;\n });\n }\n\n getUpgradeCost(upg: GangMemberUpgrade | null): number {\n if (upg == null) {\n return Infinity;\n }\n return upg.cost / this.getDiscount();\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Gang\", this);\n }\n\n /**\n * Initiatizes a Gang object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Gang {\n return Generic_fromJSON(Gang, value.data);\n }\n}\n\nReviver.constructors.Gang = Gang;\n","import { workerScripts } from \"./WorkerScripts\";\n\nlet pidCounter = 1;\n\n/**\n * Find and return the next availble PID for a script\n */\nexport function generateNextPid(): number {\n let tempCounter = pidCounter;\n\n // Cap the number of search iterations at some arbitrary value to avoid\n // infinite loops. We'll assume that players wont have 1mil+ running scripts\n let found = false;\n for (let i = 0; i < 1e6; ) {\n if (!workerScripts.has(tempCounter + i)) {\n found = true;\n tempCounter = tempCounter + i;\n break;\n }\n\n if (i === Number.MAX_SAFE_INTEGER - 1) {\n i = 1;\n } else {\n ++i;\n }\n }\n\n if (found) {\n pidCounter = tempCounter + 1;\n if (pidCounter >= Number.MAX_SAFE_INTEGER) {\n pidCounter = 1;\n }\n\n return tempCounter;\n } else {\n return -1;\n }\n}\n\nexport function resetPidCounter(): void {\n pidCounter = 1;\n}\n","import { vsprintf, sprintf } from \"sprintf-js\";\n\nimport { getRamCost } from \"./Netscript/RamCostGenerator\";\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\n\nimport { BitNodeMultipliers } from \"./BitNode/BitNodeMultipliers\";\n\nimport { CONSTANTS } from \"./Constants\";\n\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"./Hacking\";\n\nimport { netscriptCanGrow, netscriptCanHack, netscriptCanWeaken } from \"./Hacking/netscriptCanHack\";\n\nimport { HacknetServer } from \"./Hacknet/HacknetServer\";\n\nimport { Terminal } from \"./Terminal\";\n\nimport { Player } from \"./Player\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Script } from \"./Script/Script\";\nimport { findRunningScript, findRunningScriptByPid } from \"./Script/ScriptHelpers\";\nimport { isScriptFilename } from \"./Script/isScriptFilename\";\nimport { PromptEvent } from \"./ui/React/PromptManager\";\n\nimport { GetServer, GetAllServers, DeleteServer, AddToAllServers, createUniqueRandomIp } from \"./Server/AllServers\";\nimport { RunningScript } from \"./Script/RunningScript\";\nimport {\n getServerOnNetwork,\n numCycleForGrowth,\n processSingleServerGrowth,\n safetlyCreateUniqueServer,\n} from \"./Server/ServerHelpers\";\nimport { getPurchaseServerCost, getPurchaseServerLimit, getPurchaseServerMaxRam } from \"./Server/ServerPurchases\";\nimport { Server } from \"./Server/Server\";\nimport { SourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { influenceStockThroughServerHack, influenceStockThroughServerGrow } from \"./StockMarket/PlayerInfluencing\";\n\nimport { isValidFilePath, removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { TextFile, getTextFile, createTextFile } from \"./TextFile\";\n\nimport { NetscriptPorts, runScriptFromScript } from \"./NetscriptWorker\";\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { makeRuntimeRejectMsg, netscriptDelay, resolveNetscriptRequestedThreads } from \"./NetscriptEvaluator\";\n\nimport { numeralWrapper } from \"./ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\n\nimport { LogBoxEvents } from \"./ui/React/LogBoxManager\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { isString } from \"./utils/helpers/isString\";\n\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { NetscriptGang } from \"./NetscriptFunctions/Gang\";\nimport { NetscriptSleeve } from \"./NetscriptFunctions/Sleeve\";\nimport { NetscriptExtra } from \"./NetscriptFunctions/Extra\";\nimport { NetscriptHacknet } from \"./NetscriptFunctions/Hacknet\";\nimport { NetscriptStanek } from \"./NetscriptFunctions/Stanek\";\nimport { NetscriptUserInterface } from \"./NetscriptFunctions/UserInterface\";\nimport { NetscriptBladeburner } from \"./NetscriptFunctions/Bladeburner\";\nimport { NetscriptCodingContract } from \"./NetscriptFunctions/CodingContract\";\nimport { NetscriptCorporation } from \"./NetscriptFunctions/Corporation\";\nimport { NetscriptFormulas } from \"./NetscriptFunctions/Formulas\";\nimport { NetscriptStockMarket } from \"./NetscriptFunctions/StockMarket\";\nimport { IPort } from \"./NetscriptPort\";\n\nimport {\n NS as INS,\n Player as INetscriptPlayer,\n Gang as IGang,\n Bladeburner as IBladeburner,\n Stanek as IStanek,\n SourceFileLvl,\n} from \"./ScriptEditor/NetscriptDefinitions\";\nimport { NetscriptSingularity } from \"./NetscriptFunctions/Singularity\";\n\nimport { toNative } from \"./NetscriptFunctions/toNative\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { SnackbarEvents } from \"./ui/React/Snackbar\";\n\nimport { Flags } from \"./NetscriptFunctions/Flags\";\nimport { calculateIntelligenceBonus } from \"./PersonObjects/formulas/intelligence\";\nimport { CalculateShareMult, StartSharing } from \"./NetworkShare/Share\";\n\ninterface NS extends INS {\n [key: string]: any;\n gang: IGang;\n bladeburner: IBladeburner;\n stanek: IStanek;\n}\n\nexport function NetscriptFunctions(workerScript: WorkerScript): NS {\n const updateDynamicRam = function (fnName: string, ramCost: number): void {\n if (workerScript.dynamicLoadedFns[fnName]) {\n return;\n }\n workerScript.dynamicLoadedFns[fnName] = true;\n\n let threads = workerScript.scriptRef.threads;\n if (typeof threads !== \"number\") {\n console.warn(`WorkerScript detected NaN for threadcount for ${workerScript.name} on ${workerScript.hostname}`);\n threads = 1;\n }\n\n workerScript.dynamicRamUsage += ramCost;\n if (workerScript.dynamicRamUsage > 1.01 * workerScript.ramUsage) {\n throw makeRuntimeRejectMsg(\n workerScript,\n `Dynamic RAM usage calculated to be greater than initial RAM usage on fn: ${fnName}.\n This is probably because you somehow circumvented the static RAM calculation.\n\n Threads: ${threads}\n Dynamic RAM Usage: ${numeralWrapper.formatRAM(workerScript.dynamicRamUsage)}\n Static RAM Usage: ${numeralWrapper.formatRAM(workerScript.ramUsage)}\n\n One of these could be the reason:\n * Using eval() to get a reference to a ns function\n const myScan = eval('ns.scan');\n\n * Using map access to do the same\n const myScan = ns['scan'];\n\n Sorry :(`,\n );\n }\n };\n\n /**\n * Gets the Server for a specific hostname/ip, throwing an error\n * if the server doesn't exist.\n * @param {string} hostname - Hostname or IP of the server\n * @param {string} callingFnName - Name of calling function. For logging purposes\n * @returns {BaseServer} The specified server as a BaseServer\n */\n const safeGetServer = function (hostname: string, callingFnName: string): BaseServer {\n const server = GetServer(hostname);\n if (server == null) {\n throw makeRuntimeErrorMsg(callingFnName, `Invalid hostname or IP: ${hostname}`);\n }\n return server;\n };\n\n /**\n * Searches for and returns the RunningScript object for the specified script.\n * If the 'fn' argument is not specified, this returns the current RunningScript.\n * @param {string} fn - Filename of script\n * @param {string} hostname - Hostname/ip of the server on which the script resides\n * @param {any[]} scriptArgs - Running script's arguments\n * @returns {RunningScript}\n * Running script identified by the parameters, or null if no such script\n * exists, or the current running script if the first argument 'fn'\n * is not specified.\n */\n const getRunningScript = function (\n fn: any,\n hostname: any,\n callingFnName: any,\n scriptArgs: any,\n ): RunningScript | null {\n if (typeof callingFnName !== \"string\" || callingFnName === \"\") {\n callingFnName = \"getRunningScript\";\n }\n\n if (!Array.isArray(scriptArgs)) {\n throw makeRuntimeRejectMsg(\n workerScript,\n `Invalid scriptArgs argument passed into getRunningScript() from ${callingFnName}(). ` +\n `This is probably a bug. Please report to game developer`,\n );\n }\n\n if (fn != null && typeof fn === \"string\") {\n // Get Logs of another script\n if (hostname == null) {\n hostname = workerScript.hostname;\n }\n const server = safeGetServer(hostname, callingFnName);\n\n return findRunningScript(fn, scriptArgs, server);\n }\n\n // If no arguments are specified, return the current RunningScript\n return workerScript.scriptRef;\n };\n\n const getRunningScriptByPid = function (pid: any, callingFnName: any): RunningScript | null {\n if (typeof callingFnName !== \"string\" || callingFnName === \"\") {\n callingFnName = \"getRunningScriptgetRunningScriptByPid\";\n }\n\n for (const server of GetAllServers()) {\n const runningScript = findRunningScriptByPid(pid, server);\n if (runningScript) return runningScript;\n }\n return null;\n };\n\n /**\n * Helper function for getting the error log message when the user specifies\n * a nonexistent running script\n * @param {string} fn - Filename of script\n * @param {string} hostname - Hostname/ip of the server on which the script resides\n * @param {any[]} scriptArgs - Running script's arguments\n * @returns {string} Error message to print to logs\n */\n const getCannotFindRunningScriptErrorMessage = function (fn: any, hostname: any, scriptArgs: any): string {\n if (!Array.isArray(scriptArgs)) {\n scriptArgs = [];\n }\n\n return `Cannot find running script ${fn} on server ${hostname} with args: ${arrayToString(scriptArgs)}`;\n };\n\n /**\n * Used to fail a function if the function's target is a Hacknet Server.\n * This is used for functions that should run on normal Servers, but not Hacknet Servers\n * @param {Server} server - Target server\n * @param {string} callingFn - Name of calling function. For logging purposes\n * @returns {boolean} True if the server is a Hacknet Server, false otherwise\n */\n const failOnHacknetServer = function (server: any, callingFn: any = \"\"): boolean {\n if (server instanceof HacknetServer) {\n workerScript.log(callingFn, () => `Does not work on Hacknet Servers`);\n return true;\n } else {\n return false;\n }\n };\n\n const makeRuntimeErrorMsg = function (caller: string, msg: string): string {\n const errstack = new Error().stack;\n if (errstack === undefined) throw new Error(\"how did we not throw an error?\");\n const stack = errstack.split(\"\\n\").slice(1);\n const scripts = workerScript.getServer().scripts;\n const userstack = [];\n for (const stackline of stack) {\n let filename;\n for (const script of scripts) {\n if (script.url && stackline.includes(script.url)) {\n filename = script.filename;\n }\n for (const dependency of script.dependencies) {\n if (stackline.includes(dependency.url)) {\n filename = dependency.filename;\n }\n }\n }\n if (!filename) continue;\n\n interface ILine {\n line: string;\n func: string;\n }\n\n function parseChromeStackline(line: string): ILine | null {\n const lineRe = /.*:(\\d+):\\d+.*/;\n const funcRe = /.*at (.+) \\(.*/;\n\n const lineMatch = line.match(lineRe);\n const funcMatch = line.match(funcRe);\n if (lineMatch && funcMatch) {\n return { line: lineMatch[1], func: funcMatch[1] };\n }\n return null;\n }\n let call = { line: \"-1\", func: \"unknown\" };\n const chromeCall = parseChromeStackline(stackline);\n if (chromeCall) {\n call = chromeCall;\n }\n\n function parseFirefoxStackline(line: string): ILine | null {\n const lineRe = /.*:(\\d+):\\d+$/;\n const lineMatch = line.match(lineRe);\n\n const lio = line.lastIndexOf(\"@\");\n\n if (lineMatch && lio !== -1) {\n return { line: lineMatch[1], func: line.slice(0, lio) };\n }\n return null;\n }\n\n const firefoxCall = parseFirefoxStackline(stackline);\n if (firefoxCall) {\n call = firefoxCall;\n }\n\n userstack.push(`${filename}:L${call.line}@${call.func}`);\n }\n\n workerScript.log(caller, () => msg);\n let rejectMsg = `${caller}: ${msg}`;\n if (userstack.length !== 0) rejectMsg += `<br><br>Stack:<br>${userstack.join(\"<br>\")}`;\n return makeRuntimeRejectMsg(workerScript, rejectMsg);\n };\n\n const checkSingularityAccess = function (func: string): void {\n if (Player.bitNodeN !== 4) {\n if (Player.sourceFileLvl(4) === 0) {\n throw makeRuntimeErrorMsg(\n func,\n `This singularity function requires Source-File 4 to run. A power up you obtain later in the game. It will be very obvious when and how you can obtain it.`,\n );\n }\n }\n };\n\n const hack = function (hostname: any, manual: any, { threads: requestedThreads, stock }: any = {}): Promise<number> {\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"hack\", \"Takes 1 argument.\");\n }\n const threads = resolveNetscriptRequestedThreads(workerScript, \"hack\", requestedThreads);\n const server = safeGetServer(hostname, \"hack\");\n if (!(server instanceof Server)) {\n throw makeRuntimeErrorMsg(\"hack\", \"Cannot be executed on this server.\");\n }\n\n // Calculate the hacking time\n const hackingTime = calculateHackingTime(server, Player); // This is in seconds\n\n // No root access or skill level too low\n const canHack = netscriptCanHack(server, Player);\n if (!canHack.res) {\n throw makeRuntimeErrorMsg(\"hack\", canHack.msg || \"\");\n }\n\n workerScript.log(\n \"hack\",\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n hackingTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n\n return netscriptDelay(hackingTime * 1000, workerScript).then(function () {\n const hackChance = calculateHackingChance(server, Player);\n const rand = Math.random();\n let expGainedOnSuccess = calculateHackingExpGain(server, Player) * threads;\n const expGainedOnFailure = expGainedOnSuccess / 4;\n if (rand < hackChance) {\n // Success!\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n let maxThreadNeeded = Math.ceil(1 / percentHacked);\n if (isNaN(maxThreadNeeded)) {\n // Server has a 'max money' of 0 (probably). We'll set this to an arbitrarily large value\n maxThreadNeeded = 1e6;\n }\n\n let moneyDrained = Math.floor(server.moneyAvailable * percentHacked) * threads;\n\n // Over-the-top safety checks\n if (moneyDrained <= 0) {\n moneyDrained = 0;\n expGainedOnSuccess = expGainedOnFailure;\n }\n if (moneyDrained > server.moneyAvailable) {\n moneyDrained = server.moneyAvailable;\n }\n server.moneyAvailable -= moneyDrained;\n if (server.moneyAvailable < 0) {\n server.moneyAvailable = 0;\n }\n\n const moneyGained = moneyDrained * BitNodeMultipliers.ScriptHackMoneyGain;\n\n Player.gainMoney(moneyGained, \"hacking\");\n workerScript.scriptRef.onlineMoneyMade += moneyGained;\n Player.scriptProdSinceLastAug += moneyGained;\n workerScript.scriptRef.recordHack(server.hostname, moneyGained, threads);\n Player.gainHackingExp(expGainedOnSuccess);\n if (manual) Player.gainIntelligenceExp(0.005);\n workerScript.scriptRef.onlineExpGained += expGainedOnSuccess;\n workerScript.log(\n \"hack\",\n () =>\n `Successfully hacked '${server.hostname}' for ${numeralWrapper.formatMoney(\n moneyGained,\n )} and ${numeralWrapper.formatExp(expGainedOnSuccess)} exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n server.fortify(CONSTANTS.ServerFortifyAmount * Math.min(threads, maxThreadNeeded));\n if (stock) {\n influenceStockThroughServerHack(server, moneyDrained);\n }\n if (manual) {\n server.backdoorInstalled = true;\n }\n return Promise.resolve(moneyGained);\n } else {\n // Player only gains 25% exp for failure?\n Player.gainHackingExp(expGainedOnFailure);\n workerScript.scriptRef.onlineExpGained += expGainedOnFailure;\n workerScript.log(\n \"hack\",\n () =>\n `Failed to hack '${server.hostname}'. Gained ${numeralWrapper.formatExp(\n expGainedOnFailure,\n )} exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n return Promise.resolve(0);\n }\n });\n };\n\n const argsToString = function (args: any[]): string {\n let out = \"\";\n for (let arg of args) {\n arg = toNative(arg);\n out += typeof arg === \"object\" ? JSON.stringify(arg) : `${arg}`;\n }\n\n return out;\n };\n\n const helper = {\n updateDynamicRam: updateDynamicRam,\n makeRuntimeErrorMsg: makeRuntimeErrorMsg,\n string: (funcName: string, argName: string, v: any): string => {\n if (typeof v === \"string\") return v;\n if (typeof v === \"number\") return v + \"\"; // cast to string;\n throw makeRuntimeErrorMsg(funcName, `${argName} should be a string`);\n },\n number: (funcName: string, argName: string, v: any): number => {\n if (!isNaN(v)) {\n if (typeof v === \"number\") return v;\n if (!isNaN(parseFloat(v))) return parseFloat(v);\n }\n throw makeRuntimeErrorMsg(funcName, `${argName} should be a number`);\n },\n boolean: (v: any): boolean => {\n return !!v; // Just convert it to boolean.\n },\n getServer: safeGetServer,\n checkSingularityAccess: checkSingularityAccess,\n hack: hack,\n getValidPort: (funcName: string, port: any): IPort => {\n if (isNaN(port)) {\n throw makeRuntimeErrorMsg(\n funcName,\n `Invalid argument. Must be a port number between 1 and ${CONSTANTS.NumNetscriptPorts}, is ${port}`,\n );\n }\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw makeRuntimeErrorMsg(\n funcName,\n `Trying to use an invalid port: ${port}. Only ports 1-${CONSTANTS.NumNetscriptPorts} are valid.`,\n );\n }\n const iport = NetscriptPorts[port - 1];\n if (iport == null || !(iport instanceof Object)) {\n throw makeRuntimeErrorMsg(funcName, `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return iport;\n },\n };\n\n const gang = NetscriptGang(Player, workerScript, helper);\n const sleeve = NetscriptSleeve(Player, workerScript, helper);\n const extra = NetscriptExtra(Player, workerScript);\n const hacknet = NetscriptHacknet(Player, workerScript, helper);\n const stanek = NetscriptStanek(Player, workerScript, helper);\n const bladeburner = NetscriptBladeburner(Player, workerScript, helper);\n const codingcontract = NetscriptCodingContract(Player, workerScript, helper);\n const corporation = NetscriptCorporation(Player, workerScript, helper);\n const formulas = NetscriptFormulas(Player, workerScript, helper);\n const singularity = NetscriptSingularity(Player, workerScript, helper);\n const stockmarket = NetscriptStockMarket(Player, workerScript, helper);\n const ui = NetscriptUserInterface(Player, workerScript, helper);\n\n const base: INS = {\n ...singularity,\n\n gang: gang,\n bladeburner: bladeburner,\n codingcontract: codingcontract,\n sleeve: sleeve,\n corporation: corporation,\n stanek: stanek,\n ui: ui,\n formulas: formulas,\n stock: stockmarket,\n args: workerScript.args,\n hacknet: hacknet,\n sprintf: sprintf,\n vsprintf: vsprintf,\n scan: function (hostname: any = workerScript.hostname): any {\n updateDynamicRam(\"scan\", getRamCost(Player, \"scan\"));\n const server = safeGetServer(hostname, \"scan\");\n const out = [];\n for (let i = 0; i < server.serversOnNetwork.length; i++) {\n const s = getServerOnNetwork(server, i);\n if (s === null) continue;\n const entry = s.hostname;\n if (entry === null) continue;\n out.push(entry);\n }\n workerScript.log(\"scan\", () => `returned ${server.serversOnNetwork.length} connections for ${server.hostname}`);\n return out;\n },\n hack: function (hostname: any, { threads: requestedThreads, stock }: any = {}): any {\n updateDynamicRam(\"hack\", getRamCost(Player, \"hack\"));\n return hack(hostname, false, { threads: requestedThreads, stock: stock });\n },\n hackAnalyzeThreads: function (hostname: any, hackAmount: any): any {\n updateDynamicRam(\"hackAnalyzeThreads\", getRamCost(Player, \"hackAnalyzeThreads\"));\n\n // Check argument validity\n const server = safeGetServer(hostname, \"hackAnalyzeThreads\");\n if (!(server instanceof Server)) {\n workerScript.log(\"hackAnalyzeThreads\", () => \"Cannot be executed on this server.\");\n return -1;\n }\n if (isNaN(hackAmount)) {\n throw makeRuntimeErrorMsg(\n \"hackAnalyzeThreads\",\n `Invalid hackAmount argument passed into hackAnalyzeThreads: ${hackAmount}. Must be numeric.`,\n );\n }\n\n if (hackAmount < 0 || hackAmount > server.moneyAvailable) {\n return -1;\n } else if (hackAmount === 0) {\n return 0;\n }\n\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n\n return hackAmount / Math.floor(server.moneyAvailable * percentHacked);\n },\n hackAnalyze: function (hostname: any): any {\n updateDynamicRam(\"hackAnalyze\", getRamCost(Player, \"hackAnalyze\"));\n\n const server = safeGetServer(hostname, \"hackAnalyze\");\n if (!(server instanceof Server)) {\n workerScript.log(\"hackAnalyze\", () => \"Cannot be executed on this server.\");\n return false;\n }\n\n return calculatePercentMoneyHacked(server, Player);\n },\n hackAnalyzeSecurity: function (threads: any): number {\n return CONSTANTS.ServerFortifyAmount * threads;\n },\n hackAnalyzeChance: function (hostname: any): any {\n updateDynamicRam(\"hackAnalyzeChance\", getRamCost(Player, \"hackAnalyzeChance\"));\n\n const server = safeGetServer(hostname, \"hackAnalyzeChance\");\n if (!(server instanceof Server)) {\n workerScript.log(\"hackAnalyzeChance\", () => \"Cannot be executed on this server.\");\n return false;\n }\n\n return calculateHackingChance(server, Player);\n },\n sleep: function (time: any): any {\n if (time === undefined) {\n throw makeRuntimeErrorMsg(\"sleep\", \"Takes 1 argument.\");\n }\n workerScript.log(\"sleep\", () => `Sleeping for ${time} milliseconds`);\n return netscriptDelay(time, workerScript).then(function () {\n return Promise.resolve(true);\n });\n },\n asleep: function (time: any): any {\n if (time === undefined) {\n throw makeRuntimeErrorMsg(\"asleep\", \"Takes 1 argument.\");\n }\n workerScript.log(\"asleep\", () => `Sleeping for ${time} milliseconds`);\n return new Promise((resolve) => setTimeout(resolve, time));\n },\n grow: function (hostname: any, { threads: requestedThreads, stock }: any = {}): any {\n updateDynamicRam(\"grow\", getRamCost(Player, \"grow\"));\n const threads = resolveNetscriptRequestedThreads(workerScript, \"grow\", requestedThreads);\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"grow\", \"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, \"grow\");\n if (!(server instanceof Server)) {\n workerScript.log(\"grow\", () => \"Cannot be executed on this server.\");\n return false;\n }\n\n const host = GetServer(workerScript.hostname);\n if (host === null) {\n throw new Error(\"Workerscript host is null\");\n }\n\n // No root access or skill level too low\n const canHack = netscriptCanGrow(server);\n if (!canHack.res) {\n throw makeRuntimeErrorMsg(\"grow\", canHack.msg || \"\");\n }\n\n const growTime = calculateGrowTime(server, Player);\n workerScript.log(\n \"grow\",\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n growTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)}).`,\n );\n return netscriptDelay(growTime * 1000, workerScript).then(function () {\n const moneyBefore = server.moneyAvailable <= 0 ? 1 : server.moneyAvailable;\n processSingleServerGrowth(server, threads, Player, host.cpuCores);\n const moneyAfter = server.moneyAvailable;\n workerScript.scriptRef.recordGrow(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n const logGrowPercent = moneyAfter / moneyBefore - 1;\n workerScript.log(\n \"grow\",\n () =>\n `Available money on '${server.hostname}' grown by ${numeralWrapper.formatPercentage(\n logGrowPercent,\n 6,\n )}. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)}).`,\n );\n workerScript.scriptRef.onlineExpGained += expGain;\n Player.gainHackingExp(expGain);\n if (stock) {\n influenceStockThroughServerGrow(server, moneyAfter - moneyBefore);\n }\n return Promise.resolve(moneyAfter / moneyBefore);\n });\n },\n growthAnalyze: function (hostname: any, growth: any, cores: any = 1): any {\n updateDynamicRam(\"growthAnalyze\", getRamCost(Player, \"growthAnalyze\"));\n\n // Check argument validity\n const server = safeGetServer(hostname, \"growthAnalyze\");\n if (!(server instanceof Server)) {\n workerScript.log(\"growthAnalyze\", () => \"Cannot be executed on this server.\");\n return false;\n }\n if (typeof growth !== \"number\" || isNaN(growth) || growth < 1 || !isFinite(growth)) {\n throw makeRuntimeErrorMsg(\"growthAnalyze\", `Invalid argument: growth must be numeric and >= 1, is ${growth}.`);\n }\n\n return numCycleForGrowth(server, Number(growth), Player, cores);\n },\n growthAnalyzeSecurity: function (threads: any): number {\n return 2 * CONSTANTS.ServerFortifyAmount * threads;\n },\n weaken: function (hostname: any, { threads: requestedThreads }: any = {}): any {\n updateDynamicRam(\"weaken\", getRamCost(Player, \"weaken\"));\n const threads = resolveNetscriptRequestedThreads(workerScript, \"weaken\", requestedThreads);\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"weaken\", \"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, \"weaken\");\n if (!(server instanceof Server)) {\n workerScript.log(\"weaken\", () => \"Cannot be executed on this server.\");\n return false;\n }\n\n // No root access or skill level too low\n const canHack = netscriptCanWeaken(server);\n if (!canHack.res) {\n throw makeRuntimeErrorMsg(\"weaken\", canHack.msg || \"\");\n }\n\n const weakenTime = calculateWeakenTime(server, Player);\n workerScript.log(\n \"weaken\",\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n weakenTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n return netscriptDelay(weakenTime * 1000, workerScript).then(function () {\n const host = GetServer(workerScript.hostname);\n if (host === null) {\n workerScript.log(\"weaken\", () => \"Server is null, did it die?\");\n return Promise.resolve(0);\n }\n const coreBonus = 1 + (host.cpuCores - 1) / 16;\n server.weaken(CONSTANTS.ServerWeakenAmount * threads * coreBonus);\n workerScript.scriptRef.recordWeaken(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n workerScript.log(\n \"weaken\",\n () =>\n `'${server.hostname}' security level weakened to ${\n server.hackDifficulty\n }. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n workerScript.scriptRef.onlineExpGained += expGain;\n Player.gainHackingExp(expGain);\n return Promise.resolve(CONSTANTS.ServerWeakenAmount * threads * coreBonus);\n });\n },\n weakenAnalyze: function (threads: any, cores: any = 1): number {\n const coreBonus = 1 + (cores - 1) / 16;\n return CONSTANTS.ServerWeakenAmount * threads * coreBonus;\n },\n share: function (): Promise<void> {\n workerScript.log(\"share\", () => \"Sharing this computer.\");\n const end = StartSharing(workerScript.scriptRef.threads * calculateIntelligenceBonus(Player.intelligence, 2));\n return netscriptDelay(10000, workerScript).finally(function () {\n workerScript.log(\"share\", () => \"Finished sharing this computer.\");\n end();\n });\n },\n getSharePower: function (): number {\n return CalculateShareMult();\n },\n print: function (...args: any[]): void {\n if (args.length === 0) {\n throw makeRuntimeErrorMsg(\"print\", \"Takes at least 1 argument.\");\n }\n workerScript.print(argsToString(args));\n },\n printf: function (format: string, ...args: any[]): void {\n if (typeof format !== \"string\") {\n throw makeRuntimeErrorMsg(\"printf\", \"First argument must be string for the format.\");\n }\n workerScript.print(vsprintf(format, args));\n },\n tprint: function (...args: any[]): void {\n if (args.length === 0) {\n throw makeRuntimeErrorMsg(\"tprint\", \"Takes at least 1 argument.\");\n }\n const str = argsToString(args);\n if (str.startsWith(\"ERROR\") || str.startsWith(\"FAIL\")) {\n Terminal.error(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"SUCCESS\")) {\n Terminal.success(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"WARN\")) {\n Terminal.warn(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"INFO\")) {\n Terminal.info(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n Terminal.print(`${workerScript.scriptRef.filename}: ${str}`);\n },\n tprintf: function (format: any, ...args: any): any {\n if (typeof format !== \"string\") {\n throw makeRuntimeErrorMsg(\"tprintf\", \"First argument must be string for the format.\");\n }\n const str = vsprintf(format, args);\n\n if (str.startsWith(\"ERROR\") || str.startsWith(\"FAIL\")) {\n Terminal.error(`${str}`);\n return;\n }\n if (str.startsWith(\"SUCCESS\")) {\n Terminal.success(`${str}`);\n return;\n }\n if (str.startsWith(\"WARN\")) {\n Terminal.warn(`${str}`);\n return;\n }\n if (str.startsWith(\"INFO\")) {\n Terminal.info(`${str}`);\n return;\n }\n Terminal.print(`${str}`);\n },\n clearLog: function (): any {\n workerScript.scriptRef.clearLog();\n },\n disableLog: function (fn: any): any {\n if (fn === \"ALL\") {\n for (fn of Object.keys(possibleLogs)) {\n workerScript.disableLogs[fn] = true;\n }\n workerScript.log(\"disableLog\", () => `Disabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw makeRuntimeErrorMsg(\"disableLog\", `Invalid argument: ${fn}.`);\n } else {\n workerScript.disableLogs[fn] = true;\n workerScript.log(\"disableLog\", () => `Disabled logging for ${fn}`);\n }\n },\n enableLog: function (fn: any): any {\n if (fn === \"ALL\") {\n for (fn of Object.keys(possibleLogs)) {\n delete workerScript.disableLogs[fn];\n }\n workerScript.log(\"enableLog\", () => `Enabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw makeRuntimeErrorMsg(\"enableLog\", `Invalid argument: ${fn}.`);\n }\n delete workerScript.disableLogs[fn];\n workerScript.log(\"enableLog\", () => `Enabled logging for ${fn}`);\n },\n isLogEnabled: function (fn: any): any {\n if (possibleLogs[fn] === undefined) {\n throw makeRuntimeErrorMsg(\"isLogEnabled\", `Invalid argument: ${fn}.`);\n }\n return workerScript.disableLogs[fn] ? false : true;\n },\n getScriptLogs: function (fn: any, hostname: any, ...scriptArgs: any): any {\n const runningScriptObj = getRunningScript(fn, hostname, \"getScriptLogs\", scriptArgs);\n if (runningScriptObj == null) {\n workerScript.log(\"getScriptLogs\", () => getCannotFindRunningScriptErrorMessage(fn, hostname, scriptArgs));\n return \"\";\n }\n\n return runningScriptObj.logs.slice();\n },\n tail: function (fn: any, hostname: any = workerScript.hostname, ...scriptArgs: any): any {\n let runningScriptObj;\n if (arguments.length === 0) {\n runningScriptObj = workerScript.scriptRef;\n } else if (typeof fn === \"number\") {\n runningScriptObj = getRunningScriptByPid(fn, \"tail\");\n } else {\n runningScriptObj = getRunningScript(fn, hostname, \"tail\", scriptArgs);\n }\n if (runningScriptObj == null) {\n workerScript.log(\"tail\", () => getCannotFindRunningScriptErrorMessage(fn, hostname, scriptArgs));\n return;\n }\n\n LogBoxEvents.emit(runningScriptObj);\n },\n nuke: function (hostname: any): boolean {\n updateDynamicRam(\"nuke\", getRamCost(Player, \"nuke\"));\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"nuke\", \"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, \"nuke\");\n if (!(server instanceof Server)) {\n workerScript.log(\"nuke\", () => \"Cannot be executed on this server.\");\n return false;\n }\n if (server.hasAdminRights) {\n workerScript.log(\"nuke\", () => `Already have root access to '${server.hostname}'.`);\n return true;\n }\n if (!Player.hasProgram(Programs.NukeProgram.name)) {\n throw makeRuntimeErrorMsg(\"nuke\", \"You do not have the NUKE.exe virus!\");\n }\n if (server.openPortCount < server.numOpenPortsRequired) {\n throw makeRuntimeErrorMsg(\"nuke\", \"Not enough ports opened to use NUKE.exe virus.\");\n }\n server.hasAdminRights = true;\n workerScript.log(\"nuke\", () => `Executed NUKE.exe virus on '${server.hostname}' to gain root access.`);\n return true;\n },\n brutessh: function (hostname: any): boolean {\n updateDynamicRam(\"brutessh\", getRamCost(Player, \"brutessh\"));\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"brutessh\", \"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, \"brutessh\");\n if (!(server instanceof Server)) {\n workerScript.log(\"brutessh\", () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.BruteSSHProgram.name)) {\n throw makeRuntimeErrorMsg(\"brutessh\", \"You do not have the BruteSSH.exe program!\");\n }\n if (!server.sshPortOpen) {\n workerScript.log(\"brutessh\", () => `Executed BruteSSH.exe on '${server.hostname}' to open SSH port (22).`);\n server.sshPortOpen = true;\n ++server.openPortCount;\n } else {\n workerScript.log(\"brutessh\", () => `SSH Port (22) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n ftpcrack: function (hostname: any): boolean {\n updateDynamicRam(\"ftpcrack\", getRamCost(Player, \"ftpcrack\"));\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"ftpcrack\", \"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, \"ftpcrack\");\n if (!(server instanceof Server)) {\n workerScript.log(\"ftpcrack\", () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.FTPCrackProgram.name)) {\n throw makeRuntimeErrorMsg(\"ftpcrack\", \"You do not have the FTPCrack.exe program!\");\n }\n if (!server.ftpPortOpen) {\n workerScript.log(\"ftpcrack\", () => `Executed FTPCrack.exe on '${server.hostname}' to open FTP port (21).`);\n server.ftpPortOpen = true;\n ++server.openPortCount;\n } else {\n workerScript.log(\"ftpcrack\", () => `FTP Port (21) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n relaysmtp: function (hostname: any): boolean {\n updateDynamicRam(\"relaysmtp\", getRamCost(Player, \"relaysmtp\"));\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"relaysmtp\", \"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, \"relaysmtp\");\n if (!(server instanceof Server)) {\n workerScript.log(\"relaysmtp\", () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.RelaySMTPProgram.name)) {\n throw makeRuntimeErrorMsg(\"relaysmtp\", \"You do not have the relaySMTP.exe program!\");\n }\n if (!server.smtpPortOpen) {\n workerScript.log(\"relaysmtp\", () => `Executed relaySMTP.exe on '${server.hostname}' to open SMTP port (25).`);\n server.smtpPortOpen = true;\n ++server.openPortCount;\n } else {\n workerScript.log(\"relaysmtp\", () => `SMTP Port (25) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n httpworm: function (hostname: any): boolean {\n updateDynamicRam(\"httpworm\", getRamCost(Player, \"httpworm\"));\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"httpworm\", \"Takes 1 argument\");\n }\n const server = safeGetServer(hostname, \"httpworm\");\n if (!(server instanceof Server)) {\n workerScript.log(\"httpworm\", () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.HTTPWormProgram.name)) {\n throw makeRuntimeErrorMsg(\"httpworm\", \"You do not have the HTTPWorm.exe program!\");\n }\n if (!server.httpPortOpen) {\n workerScript.log(\"httpworm\", () => `Executed HTTPWorm.exe on '${server.hostname}' to open HTTP port (80).`);\n server.httpPortOpen = true;\n ++server.openPortCount;\n } else {\n workerScript.log(\"httpworm\", () => `HTTP Port (80) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n sqlinject: function (hostname: any): boolean {\n updateDynamicRam(\"sqlinject\", getRamCost(Player, \"sqlinject\"));\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"sqlinject\", \"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, \"sqlinject\");\n if (!(server instanceof Server)) {\n workerScript.log(\"sqlinject\", () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.SQLInjectProgram.name)) {\n throw makeRuntimeErrorMsg(\"sqlinject\", \"You do not have the SQLInject.exe program!\");\n }\n if (!server.sqlPortOpen) {\n workerScript.log(\"sqlinject\", () => `Executed SQLInject.exe on '${server.hostname}' to open SQL port (1433).`);\n server.sqlPortOpen = true;\n ++server.openPortCount;\n } else {\n workerScript.log(\"sqlinject\", () => `SQL Port (1433) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n run: function (scriptname: any, threads: any = 1, ...args: any[]): any {\n updateDynamicRam(\"run\", getRamCost(Player, \"run\"));\n if (scriptname === undefined) {\n throw makeRuntimeErrorMsg(\"run\", \"Usage: run(scriptname, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw makeRuntimeErrorMsg(\"run\", `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw makeRuntimeErrorMsg(\"run\", \"Could not find server. This is a bug. Report to dev.\");\n }\n\n return runScriptFromScript(Player, \"run\", scriptServer, scriptname, args, workerScript, threads);\n },\n exec: function (scriptname: any, hostname: any, threads: any = 1, ...args: any[]): any {\n updateDynamicRam(\"exec\", getRamCost(Player, \"exec\"));\n if (scriptname === undefined || hostname === undefined) {\n throw makeRuntimeErrorMsg(\"exec\", \"Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw makeRuntimeErrorMsg(\"exec\", `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const server = safeGetServer(hostname, \"exec\");\n return runScriptFromScript(Player, \"exec\", server, scriptname, args, workerScript, threads);\n },\n spawn: function (scriptname: any, threads: any = 1, ...args: any[]): any {\n updateDynamicRam(\"spawn\", getRamCost(Player, \"spawn\"));\n if (!scriptname || !threads) {\n throw makeRuntimeErrorMsg(\"spawn\", \"Usage: spawn(scriptname, threads)\");\n }\n\n const spawnDelay = 10;\n setTimeout(() => {\n if (isNaN(threads) || threads <= 0) {\n throw makeRuntimeErrorMsg(\"spawn\", `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw makeRuntimeErrorMsg(\"spawn\", \"Could not find server. This is a bug. Report to dev\");\n }\n\n return runScriptFromScript(Player, \"spawn\", scriptServer, scriptname, args, workerScript, threads);\n }, spawnDelay * 1e3);\n\n workerScript.log(\"spawn\", () => `Will execute '${scriptname}' in ${spawnDelay} seconds`);\n\n workerScript.running = false; // Prevent workerScript from \"finishing execution naturally\"\n if (killWorkerScript(workerScript)) {\n workerScript.log(\"spawn\", () => \"Exiting...\");\n }\n },\n kill: function (filename: any, hostname?: any, ...scriptArgs: any): any {\n updateDynamicRam(\"kill\", getRamCost(Player, \"kill\"));\n\n let res;\n const killByPid = typeof filename === \"number\";\n if (killByPid) {\n // Kill by pid\n res = killWorkerScript(filename);\n } else {\n // Kill by filename/hostname\n if (filename === undefined || hostname === undefined) {\n throw makeRuntimeErrorMsg(\"kill\", \"Usage: kill(scriptname, server, [arg1], [arg2]...)\");\n }\n\n const server = safeGetServer(hostname, \"kill\");\n const runningScriptObj = getRunningScript(filename, hostname, \"kill\", scriptArgs);\n if (runningScriptObj == null) {\n workerScript.log(\"kill\", () => getCannotFindRunningScriptErrorMessage(filename, hostname, scriptArgs));\n return false;\n }\n\n res = killWorkerScript(runningScriptObj, server.hostname);\n }\n\n if (res) {\n if (killByPid) {\n workerScript.log(\"kill\", () => `Killing script with PID ${filename}`);\n } else {\n workerScript.log(\n \"kill\",\n () => `Killing '${filename}' on '${hostname}' with args: ${arrayToString(scriptArgs)}.`,\n );\n }\n return true;\n } else {\n if (killByPid) {\n workerScript.log(\"kill\", () => `No script with PID ${filename}`);\n } else {\n workerScript.log(\n \"kill\",\n () => `No such script '${filename}' on '${hostname}' with args: ${arrayToString(scriptArgs)}`,\n );\n }\n return false;\n }\n },\n killall: function (hostname: any = workerScript.hostname): any {\n updateDynamicRam(\"killall\", getRamCost(Player, \"killall\"));\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"killall\", \"Takes 1 argument\");\n }\n const server = safeGetServer(hostname, \"killall\");\n const scriptsRunning = server.runningScripts.length > 0;\n for (let i = server.runningScripts.length - 1; i >= 0; --i) {\n killWorkerScript(server.runningScripts[i], server.hostname, false);\n }\n WorkerScriptStartStopEventEmitter.emit();\n workerScript.log(\n \"killall\",\n () => `Killing all scripts on '${server.hostname}'. May take a few minutes for the scripts to die.`,\n );\n\n return scriptsRunning;\n },\n exit: function (): any {\n workerScript.running = false; // Prevent workerScript from \"finishing execution naturally\"\n if (killWorkerScript(workerScript)) {\n workerScript.log(\"exit\", () => \"Exiting...\");\n } else {\n workerScript.log(\"exit\", () => \"Failed. This is a bug. Report to dev.\");\n }\n },\n scp: async function (scriptname: any, hostname1: any, hostname2?: any): Promise<boolean> {\n updateDynamicRam(\"scp\", getRamCost(Player, \"scp\"));\n if (arguments.length !== 2 && arguments.length !== 3) {\n throw makeRuntimeErrorMsg(\"scp\", \"Takes 2 or 3 arguments\");\n }\n if (scriptname && scriptname.constructor === Array) {\n // Recursively call scp on all elements of array\n const scripts: Array<string> = scriptname;\n if (scripts.length === 0) {\n throw makeRuntimeErrorMsg(\"scp\", \"No scripts to copy\");\n }\n let res = true;\n await Promise.all(\n scripts.map(async function (script) {\n if (!(await NetscriptFunctions(workerScript).scp(script, hostname1, hostname2))) {\n res = false;\n }\n }),\n );\n return Promise.resolve(res);\n }\n\n // Invalid file type\n if (!isValidFilePath(scriptname)) {\n throw makeRuntimeErrorMsg(\"scp\", `Invalid filename: '${scriptname}'`);\n }\n\n // Invalid file name\n if (!scriptname.endsWith(\".lit\") && !isScriptFilename(scriptname) && !scriptname.endsWith(\"txt\")) {\n throw makeRuntimeErrorMsg(\"scp\", \"Only works for .script, .lit, and .txt files\");\n }\n\n let destServer: BaseServer | null;\n let currServ: BaseServer | null;\n\n if (hostname2 != null) {\n // 3 Argument version: scriptname, source, destination\n if (scriptname === undefined || hostname1 === undefined || hostname2 === undefined) {\n throw makeRuntimeErrorMsg(\"scp\", \"Takes 2 or 3 arguments\");\n }\n destServer = safeGetServer(hostname2, \"scp\");\n currServ = safeGetServer(hostname1, \"scp\");\n } else if (hostname1 != null) {\n // 2 Argument version: scriptname, destination\n if (scriptname === undefined || hostname1 === undefined) {\n throw makeRuntimeErrorMsg(\"scp\", \"Takes 2 or 3 arguments\");\n }\n destServer = safeGetServer(hostname1, \"scp\");\n currServ = GetServer(workerScript.hostname);\n if (currServ == null) {\n throw makeRuntimeErrorMsg(\n \"scp\",\n \"Could not find server hostname for this script. This is a bug. Report to dev.\",\n );\n }\n } else {\n throw makeRuntimeErrorMsg(\"scp\", \"Takes 2 or 3 arguments\");\n }\n\n // Scp for lit files\n if (scriptname.endsWith(\".lit\")) {\n let found = false;\n for (let i = 0; i < currServ.messages.length; ++i) {\n if (currServ.messages[i] == scriptname) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n workerScript.log(\"scp\", () => `File '${scriptname}' does not exist.`);\n return Promise.resolve(false);\n }\n\n for (let i = 0; i < destServer.messages.length; ++i) {\n if (destServer.messages[i] === scriptname) {\n workerScript.log(\"scp\", () => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true); // Already exists\n }\n }\n destServer.messages.push(scriptname);\n workerScript.log(\"scp\", () => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true);\n }\n\n // Scp for text files\n if (scriptname.endsWith(\".txt\")) {\n let txtFile;\n for (let i = 0; i < currServ.textFiles.length; ++i) {\n if (currServ.textFiles[i].fn === scriptname) {\n txtFile = currServ.textFiles[i];\n break;\n }\n }\n if (txtFile === undefined) {\n workerScript.log(\"scp\", () => `File '${scriptname}' does not exist.`);\n return Promise.resolve(false);\n }\n\n for (let i = 0; i < destServer.textFiles.length; ++i) {\n if (destServer.textFiles[i].fn === scriptname) {\n // Overwrite\n destServer.textFiles[i].text = txtFile.text;\n workerScript.log(\"scp\", () => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true);\n }\n }\n const newFile = new TextFile(txtFile.fn, txtFile.text);\n destServer.textFiles.push(newFile);\n workerScript.log(\"scp\", () => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true);\n }\n\n // Scp for script files\n let sourceScript = null;\n for (let i = 0; i < currServ.scripts.length; ++i) {\n if (scriptname == currServ.scripts[i].filename) {\n sourceScript = currServ.scripts[i];\n break;\n }\n }\n if (sourceScript == null) {\n workerScript.log(\"scp\", () => `File '${scriptname}' does not exist.`);\n return Promise.resolve(false);\n }\n\n // Overwrite script if it already exists\n for (let i = 0; i < destServer.scripts.length; ++i) {\n if (scriptname == destServer.scripts[i].filename) {\n workerScript.log(\"scp\", () => `WARNING: File '${scriptname}' overwritten on '${destServer?.hostname}'`);\n const oldScript = destServer.scripts[i];\n // If it's the exact same file don't actually perform the\n // copy to avoid recompiling uselessly. Players tend to scp\n // liberally.\n if (oldScript.code === sourceScript.code) return Promise.resolve(true);\n oldScript.code = sourceScript.code;\n oldScript.ramUsage = sourceScript.ramUsage;\n oldScript.markUpdated();\n return Promise.resolve(true);\n }\n }\n\n // Create new script if it does not already exist\n const newScript = new Script(Player, scriptname);\n newScript.code = sourceScript.code;\n newScript.ramUsage = sourceScript.ramUsage;\n newScript.server = destServer.hostname;\n destServer.scripts.push(newScript);\n workerScript.log(\"scp\", () => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return new Promise((resolve) => {\n if (destServer === null) {\n resolve(false);\n return;\n }\n newScript.updateRamUsage(Player, destServer.scripts).then(() => resolve(true));\n });\n },\n ls: function (hostname: any, grep: any): any {\n updateDynamicRam(\"ls\", getRamCost(Player, \"ls\"));\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"ls\", \"Usage: ls(hostname/ip, [grep filter])\");\n }\n const server = safeGetServer(hostname, \"ls\");\n\n // Get the grep filter, if one exists\n let filter = \"\";\n if (arguments.length >= 2) {\n filter = grep.toString();\n }\n\n const allFiles = [];\n for (let i = 0; i < server.programs.length; i++) {\n if (filter) {\n if (server.programs[i].includes(filter)) {\n allFiles.push(server.programs[i]);\n }\n } else {\n allFiles.push(server.programs[i]);\n }\n }\n for (let i = 0; i < server.scripts.length; i++) {\n if (filter) {\n if (server.scripts[i].filename.includes(filter)) {\n allFiles.push(server.scripts[i].filename);\n }\n } else {\n allFiles.push(server.scripts[i].filename);\n }\n }\n for (let i = 0; i < server.messages.length; i++) {\n if (filter) {\n const msg = server.messages[i];\n if (msg.includes(filter)) {\n allFiles.push(msg);\n }\n } else {\n allFiles.push(server.messages[i]);\n }\n }\n\n for (let i = 0; i < server.textFiles.length; i++) {\n if (filter) {\n if (server.textFiles[i].fn.includes(filter)) {\n allFiles.push(server.textFiles[i].fn);\n }\n } else {\n allFiles.push(server.textFiles[i].fn);\n }\n }\n\n for (let i = 0; i < server.contracts.length; ++i) {\n if (filter) {\n if (server.contracts[i].fn.includes(filter)) {\n allFiles.push(server.contracts[i].fn);\n }\n } else {\n allFiles.push(server.contracts[i].fn);\n }\n }\n\n // Sort the files alphabetically then print each\n allFiles.sort();\n return allFiles;\n },\n ps: function (hostname: any = workerScript.hostname): any {\n updateDynamicRam(\"ps\", getRamCost(Player, \"ps\"));\n const server = safeGetServer(hostname, \"ps\");\n const processes = [];\n for (const script of server.runningScripts) {\n processes.push({\n filename: script.filename,\n threads: script.threads,\n args: script.args.slice(),\n pid: script.pid,\n });\n }\n return processes;\n },\n hasRootAccess: function (hostname: any): any {\n updateDynamicRam(\"hasRootAccess\", getRamCost(Player, \"hasRootAccess\"));\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"hasRootAccess\", \"Takes 1 argument\");\n }\n const server = safeGetServer(hostname, \"hasRootAccess\");\n return server.hasAdminRights;\n },\n getHostname: function (): any {\n updateDynamicRam(\"getHostname\", getRamCost(Player, \"getHostname\"));\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw makeRuntimeErrorMsg(\"getHostname\", \"Could not find server. This is a bug. Report to dev.\");\n }\n return scriptServer.hostname;\n },\n getHackingLevel: function (): any {\n updateDynamicRam(\"getHackingLevel\", getRamCost(Player, \"getHackingLevel\"));\n Player.updateSkillLevels();\n workerScript.log(\"getHackingLevel\", () => `returned ${Player.hacking}`);\n return Player.hacking;\n },\n getHackingMultipliers: function (): any {\n updateDynamicRam(\"getHackingMultipliers\", getRamCost(Player, \"getHackingMultipliers\"));\n return {\n chance: Player.hacking_chance_mult,\n speed: Player.hacking_speed_mult,\n money: Player.hacking_money_mult,\n growth: Player.hacking_grow_mult,\n };\n },\n getHacknetMultipliers: function (): any {\n updateDynamicRam(\"getHacknetMultipliers\", getRamCost(Player, \"getHacknetMultipliers\"));\n return {\n production: Player.hacknet_node_money_mult,\n purchaseCost: Player.hacknet_node_purchase_cost_mult,\n ramCost: Player.hacknet_node_ram_cost_mult,\n coreCost: Player.hacknet_node_core_cost_mult,\n levelCost: Player.hacknet_node_level_cost_mult,\n };\n },\n getBitNodeMultipliers: function (): any {\n updateDynamicRam(\"getBitNodeMultipliers\", getRamCost(Player, \"getBitNodeMultipliers\"));\n if (SourceFileFlags[5] <= 0 && Player.bitNodeN !== 5) {\n throw makeRuntimeErrorMsg(\"getBitNodeMultipliers\", \"Requires Source-File 5 to run.\");\n }\n const copy = Object.assign({}, BitNodeMultipliers);\n return copy;\n },\n getServer: function (hostname: any = workerScript.hostname): any {\n updateDynamicRam(\"getServer\", getRamCost(Player, \"getServer\"));\n const server = safeGetServer(hostname, \"getServer\");\n const copy = Object.assign({}, server) as any;\n // These fields should be hidden.\n copy.contracts = undefined;\n copy.messages = undefined;\n copy.runningScripts = undefined;\n copy.scripts = undefined;\n copy.textFiles = undefined;\n copy.programs = undefined;\n copy.serversOnNetwork = undefined;\n if (!copy.baseDifficulty) copy.baseDifficulty = 0;\n if (!copy.hackDifficulty) copy.hackDifficulty = 0;\n if (!copy.minDifficulty) copy.minDifficulty = 0;\n if (!copy.moneyAvailable) copy.moneyAvailable = 0;\n if (!copy.moneyMax) copy.moneyMax = 0;\n if (!copy.numOpenPortsRequired) copy.numOpenPortsRequired = 0;\n if (!copy.openPortCount) copy.openPortCount = 0;\n if (!copy.requiredHackingSkill) copy.requiredHackingSkill = 0;\n if (!copy.serverGrowth) copy.serverGrowth = 0;\n return copy;\n },\n getServerMoneyAvailable: function (hostname: any): any {\n updateDynamicRam(\"getServerMoneyAvailable\", getRamCost(Player, \"getServerMoneyAvailable\"));\n const server = safeGetServer(hostname, \"getServerMoneyAvailable\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerMoneyAvailable\", () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (failOnHacknetServer(server, \"getServerMoneyAvailable\")) {\n return 0;\n }\n if (server.hostname == \"home\") {\n // Return player's money\n workerScript.log(\n \"getServerMoneyAvailable\",\n () => `returned player's money: ${numeralWrapper.formatMoney(Player.money)}`,\n );\n return Player.money;\n }\n workerScript.log(\n \"getServerMoneyAvailable\",\n () => `returned ${numeralWrapper.formatMoney(server.moneyAvailable)} for '${server.hostname}'`,\n );\n return server.moneyAvailable;\n },\n getServerSecurityLevel: function (hostname: any): any {\n updateDynamicRam(\"getServerSecurityLevel\", getRamCost(Player, \"getServerSecurityLevel\"));\n const server = safeGetServer(hostname, \"getServerSecurityLevel\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerSecurityLevel\", () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerSecurityLevel\")) {\n return 1;\n }\n workerScript.log(\n \"getServerSecurityLevel\",\n () => `returned ${numeralWrapper.formatServerSecurity(server.hackDifficulty)} for '${server.hostname}'`,\n );\n return server.hackDifficulty;\n },\n getServerBaseSecurityLevel: function (hostname: any): any {\n updateDynamicRam(\"getServerBaseSecurityLevel\", getRamCost(Player, \"getServerBaseSecurityLevel\"));\n workerScript.log(\n \"getServerBaseSecurityLevel\",\n () => `getServerBaseSecurityLevel is deprecated because it's not useful.`,\n );\n const server = safeGetServer(hostname, \"getServerBaseSecurityLevel\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerBaseSecurityLevel\", () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerBaseSecurityLevel\")) {\n return 1;\n }\n workerScript.log(\n \"getServerBaseSecurityLevel\",\n () => `returned ${numeralWrapper.formatServerSecurity(server.baseDifficulty)} for '${server.hostname}'`,\n );\n return server.baseDifficulty;\n },\n getServerMinSecurityLevel: function (hostname: any): any {\n updateDynamicRam(\"getServerMinSecurityLevel\", getRamCost(Player, \"getServerMinSecurityLevel\"));\n const server = safeGetServer(hostname, \"getServerMinSecurityLevel\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerMinSecurityLevel\", () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerMinSecurityLevel\")) {\n return 1;\n }\n workerScript.log(\n \"getServerMinSecurityLevel\",\n () => `returned ${numeralWrapper.formatServerSecurity(server.minDifficulty)} for ${server.hostname}`,\n );\n return server.minDifficulty;\n },\n getServerRequiredHackingLevel: function (hostname: any): any {\n updateDynamicRam(\"getServerRequiredHackingLevel\", getRamCost(Player, \"getServerRequiredHackingLevel\"));\n const server = safeGetServer(hostname, \"getServerRequiredHackingLevel\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerRequiredHackingLevel\", () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerRequiredHackingLevel\")) {\n return 1;\n }\n workerScript.log(\n \"getServerRequiredHackingLevel\",\n () => `returned ${numeralWrapper.formatSkill(server.requiredHackingSkill)} for '${server.hostname}'`,\n );\n return server.requiredHackingSkill;\n },\n getServerMaxMoney: function (hostname: any): any {\n updateDynamicRam(\"getServerMaxMoney\", getRamCost(Player, \"getServerMaxMoney\"));\n const server = safeGetServer(hostname, \"getServerMaxMoney\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerMaxMoney\", () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (failOnHacknetServer(server, \"getServerMaxMoney\")) {\n return 0;\n }\n workerScript.log(\n \"getServerMaxMoney\",\n () => `returned ${numeralWrapper.formatMoney(server.moneyMax)} for '${server.hostname}'`,\n );\n return server.moneyMax;\n },\n getServerGrowth: function (hostname: any): any {\n updateDynamicRam(\"getServerGrowth\", getRamCost(Player, \"getServerGrowth\"));\n const server = safeGetServer(hostname, \"getServerGrowth\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerGrowth\", () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerGrowth\")) {\n return 1;\n }\n workerScript.log(\"getServerGrowth\", () => `returned ${server.serverGrowth} for '${server.hostname}'`);\n return server.serverGrowth;\n },\n getServerNumPortsRequired: function (hostname: any): any {\n updateDynamicRam(\"getServerNumPortsRequired\", getRamCost(Player, \"getServerNumPortsRequired\"));\n const server = safeGetServer(hostname, \"getServerNumPortsRequired\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerNumPortsRequired\", () => \"Cannot be executed on this server.\");\n return 5;\n }\n if (failOnHacknetServer(server, \"getServerNumPortsRequired\")) {\n return 5;\n }\n workerScript.log(\n \"getServerNumPortsRequired\",\n () => `returned ${server.numOpenPortsRequired} for '${server.hostname}'`,\n );\n return server.numOpenPortsRequired;\n },\n getServerRam: function (hostname: any): any {\n updateDynamicRam(\"getServerRam\", getRamCost(Player, \"getServerRam\"));\n workerScript.log(\n \"getServerRam\",\n () => `getServerRam is deprecated in favor of getServerMaxRam / getServerUsedRam`,\n );\n const server = safeGetServer(hostname, \"getServerRam\");\n workerScript.log(\n \"getServerRam\",\n () => `returned [${numeralWrapper.formatRAM(server.maxRam)}, ${numeralWrapper.formatRAM(server.ramUsed)}]`,\n );\n return [server.maxRam, server.ramUsed];\n },\n getServerMaxRam: function (hostname: any): any {\n updateDynamicRam(\"getServerMaxRam\", getRamCost(Player, \"getServerMaxRam\"));\n const server = safeGetServer(hostname, \"getServerMaxRam\");\n workerScript.log(\"getServerMaxRam\", () => `returned ${numeralWrapper.formatRAM(server.maxRam)}`);\n return server.maxRam;\n },\n getServerUsedRam: function (hostname: any): any {\n updateDynamicRam(\"getServerUsedRam\", getRamCost(Player, \"getServerUsedRam\"));\n const server = safeGetServer(hostname, \"getServerUsedRam\");\n workerScript.log(\"getServerUsedRam\", () => `returned ${numeralWrapper.formatRAM(server.ramUsed)}`);\n return server.ramUsed;\n },\n serverExists: function (hostname: any): any {\n updateDynamicRam(\"serverExists\", getRamCost(Player, \"serverExists\"));\n return GetServer(hostname) !== null;\n },\n fileExists: function (filename: any, hostname: any = workerScript.hostname): any {\n updateDynamicRam(\"fileExists\", getRamCost(Player, \"fileExists\"));\n if (filename === undefined) {\n throw makeRuntimeErrorMsg(\"fileExists\", \"Usage: fileExists(scriptname, [server])\");\n }\n const server = safeGetServer(hostname, \"fileExists\");\n for (let i = 0; i < server.scripts.length; ++i) {\n if (filename == server.scripts[i].filename) {\n return true;\n }\n }\n for (let i = 0; i < server.programs.length; ++i) {\n if (filename.toLowerCase() == server.programs[i].toLowerCase()) {\n return true;\n }\n }\n for (let i = 0; i < server.messages.length; ++i) {\n if (filename.toLowerCase() === server.messages[i].toLowerCase()) {\n return true;\n }\n }\n const txtFile = getTextFile(filename, server);\n if (txtFile != null) {\n return true;\n }\n return false;\n },\n isRunning: function (fn: any, hostname: any = workerScript.hostname, ...scriptArgs: any): any {\n updateDynamicRam(\"isRunning\", getRamCost(Player, \"isRunning\"));\n if (fn === undefined || hostname === undefined) {\n throw makeRuntimeErrorMsg(\"isRunning\", \"Usage: isRunning(scriptname, server, [arg1], [arg2]...)\");\n }\n if (typeof fn === \"number\") {\n return getRunningScriptByPid(fn, \"isRunning\") != null;\n } else {\n return getRunningScript(fn, hostname, \"isRunning\", scriptArgs) != null;\n }\n },\n getPurchasedServerLimit: function (): any {\n updateDynamicRam(\"getPurchasedServerLimit\", getRamCost(Player, \"getPurchasedServerLimit\"));\n\n return getPurchaseServerLimit();\n },\n getPurchasedServerMaxRam: function (): any {\n updateDynamicRam(\"getPurchasedServerMaxRam\", getRamCost(Player, \"getPurchasedServerMaxRam\"));\n\n return getPurchaseServerMaxRam();\n },\n getPurchasedServerCost: function (ram: any): any {\n updateDynamicRam(\"getPurchasedServerCost\", getRamCost(Player, \"getPurchasedServerCost\"));\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n workerScript.log(\"getPurchasedServerCost\", () => `Invalid argument: ram='${ram}'`);\n return Infinity;\n }\n\n return cost;\n },\n purchaseServer: function (aname: any, aram: any): any {\n const name = helper.string(\"purchaseServer\", \"name\", aname);\n const ram = helper.number(\"purchaseServer\", \"ram\", aram);\n updateDynamicRam(\"purchaseServer\", getRamCost(Player, \"purchaseServer\"));\n let hostnameStr = String(name);\n hostnameStr = hostnameStr.replace(/\\s+/g, \"\");\n if (hostnameStr == \"\") {\n workerScript.log(\"purchaseServer\", () => `Invalid argument: hostname='${hostnameStr}'`);\n return \"\";\n }\n\n if (Player.purchasedServers.length >= getPurchaseServerLimit()) {\n workerScript.log(\n \"purchaseServer\",\n () =>\n `You have reached the maximum limit of ${getPurchaseServerLimit()} servers. You cannot purchase any more.`,\n );\n return \"\";\n }\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n if(ram > getPurchaseServerMaxRam()){\n workerScript.log(\"purchaseServer\", () => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`);\n }else{\n workerScript.log(\"purchaseServer\", () => `Invalid argument: ram='${ram}' must be a positive power of 2`);\n }\n \n return \"\";\n }\n\n if (Player.money < cost) {\n workerScript.log(\n \"purchaseServer\",\n () => `Not enough money to purchase server. Need ${numeralWrapper.formatMoney(cost)}`,\n );\n return \"\";\n }\n const newServ = safetlyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: hostnameStr,\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: true,\n purchasedByPlayer: true,\n maxRam: ram,\n });\n AddToAllServers(newServ);\n\n Player.purchasedServers.push(newServ.hostname);\n const homeComputer = Player.getHomeComputer();\n homeComputer.serversOnNetwork.push(newServ.hostname);\n newServ.serversOnNetwork.push(homeComputer.hostname);\n Player.loseMoney(cost, \"servers\");\n workerScript.log(\n \"purchaseServer\",\n () => `Purchased new server with hostname '${newServ.hostname}' for ${numeralWrapper.formatMoney(cost)}`,\n );\n return newServ.hostname;\n },\n deleteServer: function (name: any): any {\n updateDynamicRam(\"deleteServer\", getRamCost(Player, \"deleteServer\"));\n let hostnameStr = String(name);\n hostnameStr = hostnameStr.replace(/\\s\\s+/g, \"\");\n const server = GetServer(hostnameStr);\n if (!(server instanceof Server)) {\n workerScript.log(\"deleteServer\", () => `Invalid argument: hostname='${hostnameStr}'`);\n return false;\n }\n\n if (!server.purchasedByPlayer || server.hostname === \"home\") {\n workerScript.log(\"deleteServer\", () => \"Cannot delete non-purchased server.\");\n return false;\n }\n\n const hostname = server.hostname;\n\n // Can't delete server you're currently connected to\n if (server.isConnectedTo) {\n workerScript.log(\"deleteServer\", () => \"You are currently connected to the server you are trying to delete.\");\n return false;\n }\n\n // A server cannot delete itself\n if (hostname === workerScript.hostname) {\n workerScript.log(\"deleteServer\", () => \"Cannot delete the server this script is running on.\");\n return false;\n }\n\n // Delete all scripts running on server\n if (server.runningScripts.length > 0) {\n workerScript.log(\n \"deleteServer\",\n () => `Cannot delete server '${hostname}' because it still has scripts running.`,\n );\n return false;\n }\n\n // Delete from player's purchasedServers array\n let found = false;\n for (let i = 0; i < Player.purchasedServers.length; ++i) {\n if (hostname == Player.purchasedServers[i]) {\n found = true;\n Player.purchasedServers.splice(i, 1);\n break;\n }\n }\n\n if (!found) {\n workerScript.log(\n \"deleteServer\",\n () => `Could not identify server ${hostname} as a purchased server. This is a bug. Report to dev.`,\n );\n return false;\n }\n\n // Delete from all servers\n DeleteServer(hostname);\n\n // Delete from home computer\n found = false;\n const homeComputer = Player.getHomeComputer();\n for (let i = 0; i < homeComputer.serversOnNetwork.length; ++i) {\n if (hostname == homeComputer.serversOnNetwork[i]) {\n homeComputer.serversOnNetwork.splice(i, 1);\n workerScript.log(\"deleteServer\", () => `Deleted server '${hostnameStr}`);\n return true;\n }\n }\n // Wasn't found on home computer\n workerScript.log(\n \"deleteServer\",\n () => `Could not find server ${hostname} as a purchased server. This is a bug. Report to dev.`,\n );\n return false;\n },\n getPurchasedServers: function (): any {\n updateDynamicRam(\"getPurchasedServers\", getRamCost(Player, \"getPurchasedServers\"));\n const res: string[] = [];\n Player.purchasedServers.forEach(function (hostname) {\n res.push(hostname);\n });\n return res;\n },\n writePort: function (port: any, data: any = \"\"): any {\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw makeRuntimeErrorMsg(\n \"writePort\",\n `Trying to write invalid data to a port: only strings and numbers are valid.`,\n );\n }\n const iport = helper.getValidPort(\"writePort\", port);\n return Promise.resolve(iport.write(data));\n },\n write: function (port: any, data: any = \"\", mode: any = \"a\"): any {\n updateDynamicRam(\"write\", getRamCost(Player, \"write\"));\n if (isString(port)) {\n // Write to script or text file\n let fn = port;\n if (!isValidFilePath(fn)) {\n throw makeRuntimeErrorMsg(\"write\", `Invalid filepath: ${fn}`);\n }\n\n if (fn.lastIndexOf(\"/\") === 0) {\n fn = removeLeadingSlash(fn);\n }\n\n // Coerce 'data' to be a string\n try {\n data = String(data);\n } catch (e: any) {\n throw makeRuntimeErrorMsg(\"write\", `Invalid data (${e}). Data being written must be convertible to a string`);\n }\n\n const server = workerScript.getServer();\n if (server == null) {\n throw makeRuntimeErrorMsg(\"write\", \"Error getting Server. This is a bug. Report to dev.\");\n }\n if (isScriptFilename(fn)) {\n // Write to script\n let script = workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n // Create a new script\n script = new Script(Player, fn, data, server.hostname, server.scripts);\n server.scripts.push(script);\n return script.updateRamUsage(Player, server.scripts);\n }\n mode === \"w\" ? (script.code = data) : (script.code += data);\n return script.updateRamUsage(Player, server.scripts);\n } else {\n // Write to text file\n const txtFile = getTextFile(fn, server);\n if (txtFile == null) {\n createTextFile(fn, data, server);\n return Promise.resolve();\n }\n if (mode === \"w\") {\n txtFile.write(data);\n } else {\n txtFile.append(data);\n }\n }\n return Promise.resolve();\n } else {\n throw makeRuntimeErrorMsg(\"write\", `Invalid argument: ${port}`);\n }\n },\n tryWritePort: function (port: any, data: any = \"\"): any {\n updateDynamicRam(\"tryWritePort\", getRamCost(Player, \"tryWritePort\"));\n if (!isNaN(port)) {\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw makeRuntimeErrorMsg(\n \"tryWritePort\",\n `Invalid port: ${port}. Only ports 1-${CONSTANTS.NumNetscriptPorts} are valid.`,\n );\n }\n const iport = NetscriptPorts[port - 1];\n if (iport == null || !(iport instanceof Object)) {\n throw makeRuntimeErrorMsg(\"tryWritePort\", `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return Promise.resolve(iport.tryWrite(data));\n } else {\n throw makeRuntimeErrorMsg(\"tryWritePort\", `Invalid argument: ${port}`);\n }\n },\n readPort: function (port: any): any {\n // Read from port\n const iport = helper.getValidPort(\"readPort\", port);\n const x = iport.read();\n return x;\n },\n read: function (port: any): any {\n updateDynamicRam(\"read\", getRamCost(Player, \"read\"));\n if (isString(port)) {\n // Read from script or text file\n const fn = port;\n const server = GetServer(workerScript.hostname);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"read\", \"Error getting Server. This is a bug. Report to dev.\");\n }\n if (isScriptFilename(fn)) {\n // Read from script\n const script = workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n return \"\";\n }\n return script.code;\n } else {\n // Read from text file\n const txtFile = getTextFile(fn, server);\n if (txtFile !== null) {\n return txtFile.text;\n } else {\n return \"\";\n }\n }\n } else {\n throw makeRuntimeErrorMsg(\"read\", `Invalid argument: ${port}`);\n }\n },\n peek: function (port: any): any {\n updateDynamicRam(\"peek\", getRamCost(Player, \"peek\"));\n const iport = helper.getValidPort(\"peek\", port);\n const x = iport.peek();\n return x;\n },\n clear: function (file: any): any {\n updateDynamicRam(\"clear\", getRamCost(Player, \"clear\"));\n if (isString(file)) {\n // Clear text file\n const fn = file;\n const server = GetServer(workerScript.hostname);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"clear\", \"Error getting Server. This is a bug. Report to dev.\");\n }\n const txtFile = getTextFile(fn, server);\n if (txtFile != null) {\n txtFile.write(\"\");\n }\n } else {\n throw makeRuntimeErrorMsg(\"clear\", `Invalid argument: ${file}`);\n }\n return 0;\n },\n clearPort: function (port: any): any {\n // Clear port\n const iport = helper.getValidPort(\"clearPort\", port);\n return iport.clear();\n },\n getPortHandle: function (port: any): IPort {\n updateDynamicRam(\"getPortHandle\", getRamCost(Player, \"getPortHandle\"));\n const iport = helper.getValidPort(\"getPortHandle\", port);\n return iport;\n },\n rm: function (fn: any, hostname: any): any {\n updateDynamicRam(\"rm\", getRamCost(Player, \"rm\"));\n\n if (hostname == null || hostname === \"\") {\n hostname = workerScript.hostname;\n }\n const s = safeGetServer(hostname, \"rm\");\n\n const status = s.removeFile(fn);\n if (!status.res) {\n workerScript.log(\"rm\", () => status.msg + \"\");\n }\n\n return status.res;\n },\n scriptRunning: function (scriptname: any, hostname: any): any {\n updateDynamicRam(\"scriptRunning\", getRamCost(Player, \"scriptRunning\"));\n const server = safeGetServer(hostname, \"scriptRunning\");\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename == scriptname) {\n return true;\n }\n }\n return false;\n },\n scriptKill: function (scriptname: any, hostname: any): any {\n updateDynamicRam(\"scriptKill\", getRamCost(Player, \"scriptKill\"));\n const server = safeGetServer(hostname, \"scriptKill\");\n let suc = false;\n for (let i = 0; i < server.runningScripts.length; i++) {\n if (server.runningScripts[i].filename == scriptname) {\n killWorkerScript(server.runningScripts[i], server.hostname);\n suc = true;\n i--;\n }\n }\n return suc;\n },\n getScriptName: function (): any {\n return workerScript.name;\n },\n getScriptRam: function (scriptname: any, hostname: any = workerScript.hostname): any {\n updateDynamicRam(\"getScriptRam\", getRamCost(Player, \"getScriptRam\"));\n const server = safeGetServer(hostname, \"getScriptRam\");\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename == scriptname) {\n return server.scripts[i].ramUsage;\n }\n }\n return 0;\n },\n getRunningScript: function (fn: any, hostname: any, ...args: any[]): any {\n updateDynamicRam(\"getRunningScript\", getRamCost(Player, \"getRunningScript\"));\n\n let runningScript;\n if (fn === undefined && hostname === undefined && args.length === 0) {\n runningScript = workerScript.scriptRef;\n } else if (typeof fn === \"number\") {\n runningScript = getRunningScriptByPid(fn, \"getRunningScript\");\n } else {\n runningScript = getRunningScript(fn, hostname, \"getRunningScript\", args);\n }\n if (runningScript === null) return null;\n return {\n args: runningScript.args.slice(),\n filename: runningScript.filename,\n logs: runningScript.logs.slice(),\n offlineExpGained: runningScript.offlineExpGained,\n offlineMoneyMade: runningScript.offlineMoneyMade,\n offlineRunningTime: runningScript.offlineRunningTime,\n onlineExpGained: runningScript.onlineExpGained,\n onlineMoneyMade: runningScript.onlineMoneyMade,\n onlineRunningTime: runningScript.onlineRunningTime,\n pid: runningScript.pid,\n ramUsage: runningScript.ramUsage,\n server: runningScript.server,\n threads: runningScript.threads,\n };\n },\n getHackTime: function (hostname: any): any {\n updateDynamicRam(\"getHackTime\", getRamCost(Player, \"getHackTime\"));\n const server = safeGetServer(hostname, \"getHackTime\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getHackTime\", () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (failOnHacknetServer(server, \"getHackTime\")) {\n return Infinity;\n }\n\n return calculateHackingTime(server, Player) * 1000;\n },\n getGrowTime: function (hostname: any): any {\n updateDynamicRam(\"getGrowTime\", getRamCost(Player, \"getGrowTime\"));\n const server = safeGetServer(hostname, \"getGrowTime\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getGrowTime\", () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (failOnHacknetServer(server, \"getGrowTime\")) {\n return Infinity;\n }\n\n return calculateGrowTime(server, Player) * 1000;\n },\n getWeakenTime: function (hostname: any = workerScript.hostname): any {\n updateDynamicRam(\"getWeakenTime\", getRamCost(Player, \"getWeakenTime\"));\n const server = safeGetServer(hostname, \"getWeakenTime\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getWeakenTime\", () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (failOnHacknetServer(server, \"getWeakenTime\")) {\n return Infinity;\n }\n\n return calculateWeakenTime(server, Player) * 1000;\n },\n getScriptIncome: function (scriptname?: any, hostname?: any, ...args: any[]): any {\n updateDynamicRam(\"getScriptIncome\", getRamCost(Player, \"getScriptIncome\"));\n if (arguments.length === 0) {\n const res = [];\n\n // First element is total income of all currently running scripts\n let total = 0;\n for (const script of workerScripts.values()) {\n total += script.scriptRef.onlineMoneyMade / script.scriptRef.onlineRunningTime;\n }\n res.push(total);\n\n // Second element is total income you've earned from scripts since you installed Augs\n res.push(Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug / 1000));\n return res;\n } else {\n // Get income for a particular script\n const server = safeGetServer(hostname, \"getScriptIncome\");\n const runningScriptObj = findRunningScript(scriptname, args, server);\n if (runningScriptObj == null) {\n workerScript.log(\n \"getScriptIncome\",\n () => `No such script '${scriptname}' on '${server.hostname}' with args: ${arrayToString(args)}`,\n );\n return -1;\n }\n return runningScriptObj.onlineMoneyMade / runningScriptObj.onlineRunningTime;\n }\n },\n getScriptExpGain: function (scriptname?: any, hostname?: any, ...args: any[]): any {\n updateDynamicRam(\"getScriptExpGain\", getRamCost(Player, \"getScriptExpGain\"));\n if (arguments.length === 0) {\n let total = 0;\n for (const ws of workerScripts.values()) {\n total += ws.scriptRef.onlineExpGained / ws.scriptRef.onlineRunningTime;\n }\n return total;\n } else {\n // Get income for a particular script\n const server = safeGetServer(hostname, \"getScriptExpGain\");\n const runningScriptObj = findRunningScript(scriptname, args, server);\n if (runningScriptObj == null) {\n workerScript.log(\n \"getScriptExpGain\",\n () => `No such script '${scriptname}' on '${server.hostname}' with args: ${arrayToString(args)}`,\n );\n return -1;\n }\n return runningScriptObj.onlineExpGained / runningScriptObj.onlineRunningTime;\n }\n },\n nFormat: function (n: any, format: any): any {\n if (isNaN(n) || isNaN(parseFloat(n)) || typeof format !== \"string\") {\n return \"\";\n }\n\n return numeralWrapper.format(parseFloat(n), format);\n },\n tFormat: function (milliseconds: any, milliPrecision: any = false): any {\n return convertTimeMsToTimeElapsedString(milliseconds, milliPrecision);\n },\n getTimeSinceLastAug: function (): any {\n updateDynamicRam(\"getTimeSinceLastAug\", getRamCost(Player, \"getTimeSinceLastAug\"));\n return Player.playtimeSinceLastAug;\n },\n alert: function (message: any): void {\n message = argsToString([message]);\n dialogBoxCreate(message);\n },\n toast: function (message: any, variant: any = \"success\", duration: any = 2000): void {\n if (![\"success\", \"info\", \"warning\", \"error\"].includes(variant))\n throw new Error(`variant must be one of \"success\", \"info\", \"warning\", or \"error\"`);\n\n message = argsToString([message]);\n SnackbarEvents.emit(message, variant, duration);\n },\n prompt: function (txt: any): any {\n if (!isString(txt)) {\n txt = JSON.stringify(txt);\n }\n\n return new Promise(function (resolve) {\n PromptEvent.emit({\n txt: txt,\n resolve: resolve,\n });\n });\n },\n wget: async function (url: any, target: any, hostname: any = workerScript.hostname): Promise<boolean> {\n if (!isScriptFilename(target) && !target.endsWith(\".txt\")) {\n workerScript.log(\"wget\", () => `Invalid target file: '${target}'. Must be a script or text file.`);\n return Promise.resolve(false);\n }\n const s = safeGetServer(hostname, \"wget\");\n return new Promise(function (resolve) {\n $.get(\n url,\n function (data) {\n let res;\n if (isScriptFilename(target)) {\n res = s.writeToScriptFile(Player, target, data);\n } else {\n res = s.writeToTextFile(target, data);\n }\n if (!res.success) {\n workerScript.log(\"wget\", () => \"Failed.\");\n return resolve(false);\n }\n if (res.overwritten) {\n workerScript.log(\n \"wget\",\n () => `Successfully retrieved content and overwrote '${target}' on '${hostname}'`,\n );\n return resolve(true);\n }\n workerScript.log(\"wget\", () => `Successfully retrieved content to new file '${target}' on '${hostname}'`);\n return resolve(true);\n },\n \"text\",\n ).fail(function (e) {\n workerScript.log(\"wget\", () => JSON.stringify(e));\n return resolve(false);\n });\n });\n },\n getFavorToDonate: function (): any {\n updateDynamicRam(\"getFavorToDonate\", getRamCost(Player, \"getFavorToDonate\"));\n return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n },\n getOwnedSourceFiles: function (): SourceFileLvl[] {\n helper.updateDynamicRam(\"getOwnedSourceFiles\", getRamCost(Player, \"getOwnedSourceFiles\"));\n const res: SourceFileLvl[] = [];\n for (let i = 0; i < Player.sourceFiles.length; ++i) {\n res.push({\n n: Player.sourceFiles[i].n,\n lvl: Player.sourceFiles[i].lvl,\n } as SourceFileLvl);\n }\n return res;\n },\n getPlayer: function (): INetscriptPlayer {\n helper.updateDynamicRam(\"getPlayer\", getRamCost(Player, \"getPlayer\"));\n\n const data = {\n hacking: Player.hacking,\n hp: Player.hp,\n max_hp: Player.max_hp,\n strength: Player.strength,\n defense: Player.defense,\n dexterity: Player.dexterity,\n agility: Player.agility,\n charisma: Player.charisma,\n intelligence: Player.intelligence,\n hacking_chance_mult: Player.hacking_chance_mult,\n hacking_speed_mult: Player.hacking_speed_mult,\n hacking_money_mult: Player.hacking_money_mult,\n hacking_grow_mult: Player.hacking_grow_mult,\n hacking_exp: Player.hacking_exp,\n strength_exp: Player.strength_exp,\n defense_exp: Player.defense_exp,\n dexterity_exp: Player.dexterity_exp,\n agility_exp: Player.agility_exp,\n charisma_exp: Player.charisma_exp,\n hacking_mult: Player.hacking_mult,\n strength_mult: Player.strength_mult,\n defense_mult: Player.defense_mult,\n dexterity_mult: Player.dexterity_mult,\n agility_mult: Player.agility_mult,\n charisma_mult: Player.charisma_mult,\n hacking_exp_mult: Player.hacking_exp_mult,\n strength_exp_mult: Player.strength_exp_mult,\n defense_exp_mult: Player.defense_exp_mult,\n dexterity_exp_mult: Player.dexterity_exp_mult,\n agility_exp_mult: Player.agility_exp_mult,\n charisma_exp_mult: Player.charisma_exp_mult,\n company_rep_mult: Player.company_rep_mult,\n faction_rep_mult: Player.faction_rep_mult,\n numPeopleKilled: Player.numPeopleKilled,\n money: Player.money,\n city: Player.city,\n location: Player.location,\n companyName: Player.companyName,\n crime_money_mult: Player.crime_money_mult,\n crime_success_mult: Player.crime_success_mult,\n isWorking: Player.isWorking,\n workType: Player.workType,\n currentWorkFactionName: Player.currentWorkFactionName,\n currentWorkFactionDescription: Player.currentWorkFactionDescription,\n workHackExpGainRate: Player.workHackExpGainRate,\n workStrExpGainRate: Player.workStrExpGainRate,\n workDefExpGainRate: Player.workDefExpGainRate,\n workDexExpGainRate: Player.workDexExpGainRate,\n workAgiExpGainRate: Player.workAgiExpGainRate,\n workChaExpGainRate: Player.workChaExpGainRate,\n workRepGainRate: Player.workRepGainRate,\n workMoneyGainRate: Player.workMoneyGainRate,\n workMoneyLossRate: Player.workMoneyLossRate,\n workHackExpGained: Player.workHackExpGained,\n workStrExpGained: Player.workStrExpGained,\n workDefExpGained: Player.workDefExpGained,\n workDexExpGained: Player.workDexExpGained,\n workAgiExpGained: Player.workAgiExpGained,\n workChaExpGained: Player.workChaExpGained,\n workRepGained: Player.workRepGained,\n workMoneyGained: Player.workMoneyGained,\n createProgramName: Player.createProgramName,\n createProgramReqLvl: Player.createProgramReqLvl,\n className: Player.className,\n crimeType: Player.crimeType,\n work_money_mult: Player.work_money_mult,\n hacknet_node_money_mult: Player.hacknet_node_money_mult,\n hacknet_node_purchase_cost_mult: Player.hacknet_node_purchase_cost_mult,\n hacknet_node_ram_cost_mult: Player.hacknet_node_ram_cost_mult,\n hacknet_node_core_cost_mult: Player.hacknet_node_core_cost_mult,\n hacknet_node_level_cost_mult: Player.hacknet_node_level_cost_mult,\n hasWseAccount: Player.hasWseAccount,\n hasTixApiAccess: Player.hasTixApiAccess,\n has4SData: Player.has4SData,\n has4SDataTixApi: Player.has4SDataTixApi,\n bladeburner_max_stamina_mult: Player.bladeburner_max_stamina_mult,\n bladeburner_stamina_gain_mult: Player.bladeburner_stamina_gain_mult,\n bladeburner_analysis_mult: Player.bladeburner_analysis_mult,\n bladeburner_success_chance_mult: Player.bladeburner_success_chance_mult,\n bitNodeN: Player.bitNodeN,\n totalPlaytime: Player.totalPlaytime,\n playtimeSinceLastAug: Player.playtimeSinceLastAug,\n playtimeSinceLastBitnode: Player.playtimeSinceLastBitnode,\n jobs: {},\n factions: Player.factions.slice(),\n tor: Player.hasTorRouter(),\n hasCorporation: Player.hasCorporation(),\n };\n Object.assign(data.jobs, Player.jobs);\n return data;\n },\n atExit: function (f: any): void {\n if (typeof f !== \"function\") {\n throw makeRuntimeErrorMsg(\"atExit\", \"argument should be function\");\n }\n workerScript.atExit = f;\n },\n mv: function (host: string, source: string, destination: string): void {\n updateDynamicRam(\"mv\", getRamCost(Player, \"mv\"));\n\n if (arguments.length != 3) throw makeRuntimeErrorMsg(\"mv\", \"Takes 3 argument.\");\n\n if (!isValidFilePath(source)) throw makeRuntimeErrorMsg(\"mv\", `Invalid filename: '${source}'`);\n if (!isValidFilePath(destination)) throw makeRuntimeErrorMsg(\"mv\", `Invalid filename: '${destination}'`);\n\n const source_is_txt = source.endsWith(\".txt\");\n const dest_is_txt = destination.endsWith(\".txt\");\n\n if (!isScriptFilename(source) && !source_is_txt)\n throw makeRuntimeErrorMsg(\"mv\", `'mv' can only be used on scripts and text files (.txt)`);\n if (source_is_txt != dest_is_txt)\n throw makeRuntimeErrorMsg(\"mv\", `Source and destination files must have the same type`);\n\n if (source === destination) {\n return;\n }\n\n // This will throw if the server is not found, we do not need to validate result.\n const destServer: BaseServer | null = safeGetServer(host, \"mv\");\n\n if (!source_is_txt && destServer.isRunning(source))\n throw makeRuntimeErrorMsg(\"mv\", `Cannot use 'mv' on a script that is running`);\n\n interface File {\n filename: string;\n }\n\n const files = source_is_txt ? destServer.textFiles : destServer.scripts;\n let source_file: File | null = null;\n let dest_file: File | null = null;\n\n for (let i = 0; i < files.length; ++i) {\n const file = files[i];\n if (file.filename === source) {\n source_file = file;\n } else if (file.filename === destination) {\n dest_file = file;\n }\n }\n\n if (source_file == null) throw makeRuntimeErrorMsg(\"mv\", `Source file ${source} does not exist`);\n\n if (dest_file != null) {\n if (dest_file instanceof TextFile && source_file instanceof TextFile) {\n dest_file.text = source_file.text;\n } else if (dest_file instanceof Script && source_file instanceof Script) {\n dest_file.code = source_file.code;\n dest_file.markUpdated();\n }\n\n destServer.removeFile(source);\n } else {\n source_file.filename = destination;\n if (source_file instanceof Script) {\n source_file.markUpdated();\n }\n }\n },\n flags: Flags(workerScript.args),\n };\n\n // add undocumented functions\n const ns = {\n ...base,\n ...extra,\n };\n function getFunctionNames(obj: any, prefix: string): string[] {\n const functionNames: string[] = [];\n for (const [key, value] of Object.entries(obj)) {\n if (key === \"args\") {\n continue;\n } else if (typeof value == \"function\") {\n functionNames.push(prefix + key);\n } else if (typeof value == \"object\") {\n functionNames.push(...getFunctionNames(value, key + \".\"));\n }\n }\n return functionNames;\n }\n\n const possibleLogs = Object.fromEntries([...getFunctionNames(ns, \"\")].map((a) => [a, true]));\n\n return ns;\n}\n","/**\n * Implementation of the mechanisms that allow the player to affect the\n * Stock Market\n */\nimport { Stock } from \"./Stock\";\nimport { StockMarket } from \"./StockMarket\";\n\nimport { Company } from \"../Company/Company\";\nimport { Server } from \"../Server/Server\";\n\n// Change in second-order forecast due to hacks/grows\nexport const forecastForecastChangeFromHack = 0.1;\n\n// Change in second-order forecast due to company work\nexport const forecastForecastChangeFromCompanyWork = 0.001;\n\n/**\n * Potentially decreases a stock's second-order forecast when its corresponding\n * server is hacked. The chance of the hack decreasing the stock's second-order\n * forecast is dependent on what percentage of the server's money is hacked\n * @param {Server} server - Server being hack()ed\n * @param {number} moneyHacked - Amount of money stolen from the server\n */\nexport function influenceStockThroughServerHack(server: Server, moneyHacked: number): void {\n const orgName = server.organizationName;\n let stock: Stock | null = null;\n if (typeof orgName === \"string\" && orgName !== \"\") {\n stock = StockMarket[orgName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n const percTotalMoneyHacked = moneyHacked / server.moneyMax;\n if (Math.random() < percTotalMoneyHacked) {\n stock.changeForecastForecast(stock.otlkMagForecast - forecastForecastChangeFromHack);\n }\n}\n\n/**\n * Potentially increases a stock's second-order forecast when its corresponding\n * server is grown (grow()). The chance of the grow() to increase the stock's\n * second-order forecast is dependent on how much money is added to the server\n * @param {Server} server - Server being grow()n\n * @param {number} moneyHacked - Amount of money added to the server\n */\nexport function influenceStockThroughServerGrow(server: Server, moneyGrown: number): void {\n const orgName = server.organizationName;\n let stock: Stock | null = null;\n if (typeof orgName === \"string\" && orgName !== \"\") {\n stock = StockMarket[orgName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n const percTotalMoneyGrown = moneyGrown / server.moneyMax;\n if (Math.random() < percTotalMoneyGrown) {\n stock.changeForecastForecast(stock.otlkMagForecast + forecastForecastChangeFromHack);\n }\n}\n\n/**\n * Potentially increases a stock's second-order forecast when the player works for\n * its corresponding company.\n * @param {Company} company - Company being worked for\n * @param {number} performanceMult - Effectiveness of player's work. Affects influence\n * @param {number} cyclesOfWork - # game cycles of work being processed\n */\nexport function influenceStockThroughCompanyWork(\n company: Company,\n performanceMult: number,\n cyclesOfWork: number,\n): void {\n const compName = company.name;\n let stock: Stock | null = null;\n if (typeof compName === \"string\" && compName !== \"\") {\n stock = StockMarket[compName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n if (Math.random() < 0.002 * cyclesOfWork) {\n const change = forecastForecastChangeFromCompanyWork * performanceMult;\n stock.changeForecastForecast(stock.otlkMagForecast + change);\n }\n}\n","import { Programs } from \"./Programs\";\nimport { Program } from \"./Program\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\n//Returns the programs this player can create.\nexport function getAvailableCreatePrograms(player: IPlayer): Program[] {\n const programs: Program[] = [];\n for (const key of Object.keys(Programs)) {\n // Non-creatable program\n const create = Programs[key].create;\n if (create == null) continue;\n\n // Already has program\n if (player.hasProgram(Programs[key].name)) continue;\n\n // Does not meet requirements\n if (!create.req(player)) continue;\n\n programs.push(Programs[key]);\n }\n\n return programs;\n}\n","import { Company } from \"./Company\";\nimport { CompanyPosition } from \"./CompanyPosition\";\n\n/**\n * Returns a string with the given CompanyPosition's stat requirements\n */\n\nexport function getJobRequirementText(company: Company, pos: CompanyPosition, tooltiptext = false): string {\n let reqText = \"\";\n const offset: number = company.jobStatReqOffset;\n const reqHacking: number = pos.requiredHacking > 0 ? pos.requiredHacking + offset : 0;\n const reqStrength: number = pos.requiredStrength > 0 ? pos.requiredStrength + offset : 0;\n const reqDefense: number = pos.requiredDefense > 0 ? pos.requiredDefense + offset : 0;\n const reqDexterity: number = pos.requiredDexterity > 0 ? pos.requiredDexterity + offset : 0;\n const reqAgility: number = pos.requiredDexterity > 0 ? pos.requiredDexterity + offset : 0;\n const reqCharisma: number = pos.requiredCharisma > 0 ? pos.requiredCharisma + offset : 0;\n const reqRep: number = pos.requiredReputation;\n if (tooltiptext) {\n reqText = \"Requires:<br>\";\n reqText += reqHacking.toString() + \" hacking<br>\";\n reqText += reqStrength.toString() + \" strength<br>\";\n reqText += reqDefense.toString() + \" defense<br>\";\n reqText += reqDexterity.toString() + \" dexterity<br>\";\n reqText += reqAgility.toString() + \" agility<br>\";\n reqText += reqCharisma.toString() + \" charisma<br>\";\n reqText += reqRep.toString() + \" reputation\";\n } else {\n reqText = \"(Requires \";\n if (reqHacking > 0) {\n reqText += reqHacking + \" hacking, \";\n }\n if (reqStrength > 0) {\n reqText += reqStrength + \" strength, \";\n }\n if (reqDefense > 0) {\n reqText += reqDefense + \" defense, \";\n }\n if (reqDexterity > 0) {\n reqText += reqDexterity + \" dexterity, \";\n }\n if (reqAgility > 0) {\n reqText += reqAgility + \" agility, \";\n }\n if (reqCharisma > 0) {\n reqText += reqCharisma + \" charisma, \";\n }\n if (reqRep > 1) {\n reqText += reqRep + \" reputation, \";\n }\n reqText = reqText.substring(0, reqText.length - 2);\n reqText += \")\";\n }\n return reqText;\n}\n","/* tslint:disable:max-line-length completed-docs variable-name*/\nimport { IMap } from \"../types\";\n\nexport const TerminalHelpText: string[] = [\n \"Type 'help name' to learn more about the command \",\n \" \",\n ' alias [-g] [name=\"value\"] Create or display Terminal aliases',\n \" analyze Get information about the current machine \",\n \" backdoor Install a backdoor on the current machine \",\n \" buy [-l/-a/program] Purchase a program through the Dark Web\",\n \" cat [file] Display a .msg, .lit, or .txt file\",\n \" cd [dir] Change to a new directory\",\n \" check [script] [args...] Print a script's logs to Terminal\",\n \" clear Clear all text on the terminal \",\n \" cls See 'clear' command \",\n \" connect [hostname] Connects to a remote server\",\n \" cp [src] [dst] Copy a file\",\n \" download [script/text file] Downloads scripts or text files to your computer\",\n \" expr [math expression] Evaluate a mathematical expression\",\n \" free Check the machine's memory (RAM) usage\",\n \" grow Spoof money in a servers bank account, increasing the amount available.\",\n \" hack Hack the current machine\",\n \" help [command] Display this help text, or the help text for a command\",\n \" history [-c] Display the terminal history\",\n \" home Connect to home computer\",\n \" hostname Displays the hostname of the machine\",\n \" kill [script/pid] [args...] Stops the specified script on the current server \",\n \" killall Stops all running scripts on the current machine\",\n \" ls [dir] [| grep pattern] Displays all files on the machine\",\n \" lscpu Displays the number of CPU cores on the machine\",\n \" mem [script] [-t n] Displays the amount of RAM required to run the script\",\n \" mv [src] [dest] Move/rename a text or script file\",\n \" nano [file ...] Text editor - Open up and edit one or more scripts or text files\",\n \" ps Display all scripts that are currently running\",\n \" rm [file] Delete a file from the server\",\n \" run [name] [-t n] [--tail] [args...] Execute a program or script\",\n \" scan Prints all immediately-available network connections\",\n \" scan-analyze [d] [-a] Prints info for all servers up to <i>d</i> nodes away\",\n \" scp [file ...] [server] Copies a file to a destination server\",\n \" sudov Shows whether you have root access on this computer\",\n \" tail [script] [args...] Displays dynamic logs for the specified script\",\n \" top Displays all running scripts and their RAM usage\",\n \" unalias [alias name] Deletes the specified alias\",\n \" vim [file ...] Text editor - Open up and edit one or more scripts or text files in vim mode\",\n \" weaken Reduce the security of the current machine\",\n \" wget [url] [target file] Retrieves code/text from a web server\",\n \" \",\n];\n\nconst TemplatedHelpTexts: IMap<(command: string) => string[]> = {\n scriptEditor: (command) => {\n return [\n `Usage: ${command} [file ...] | [glob]`,\n ` `,\n `Opens up the specified file(s) in the Script Editor. Only scripts (.js, .ns, .script) or text files (.txt) `,\n `can be edited using the Script Editor. If a file does not exist a new one will be created`,\n ` `,\n `If provided a glob as the only argument, ${command} can spider directories and open all matching `,\n `files at once. ${command} cannot create files using globs, so your scripts must already exist.`,\n ` `,\n `Examples:`,\n ` `,\n ` ${command} test.js`,\n ` ${command} test.js test2.js`,\n ` `,\n ` ${command} test.*`,\n ` ${command} /my-dir/*.js`,\n ` `\n ]\n }\n}\n\nexport const HelpTexts: IMap<string[]> = {\n alias: [\n 'Usage: alias [-g] [name=\"value\"] ',\n \" \",\n \"Create or display aliases. An alias enables a replacement of a word with another string. \",\n \"It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME \",\n \"of an alias defines the word that will be replaced, while the VALUE defines what it will be replaced by. For example, \",\n \"you could create the alias 'nuke' for the Terminal command 'run NUKE.exe' using the following: \",\n \" \",\n ' alias nuke=\"run NUKE.exe\"',\n \" \",\n \"Then, to run the NUKE.exe program you would just have to enter 'nuke' in Terminal rather than the full command. \",\n \"It is important to note that 'default' aliases will only be substituted for the first word of a Terminal command. For \",\n \"example, if the following alias was set: \",\n \" \",\n ' alias worm=\"HTTPWorm.exe\"',\n \" \",\n \"and then you tried to run the following terminal command: \",\n \" \",\n \" run worm\",\n \" \",\n \"This would fail because the worm alias is not the first word of a Terminal command. To allow an alias to be substituted \",\n \"anywhere in a Terminal command, rather than just the first word, you must set it to be a global alias using the -g flag: \",\n \" \",\n ' alias -g worm=\"HTTPWorm.exe\"',\n \" \",\n \"Now, the 'worm' alias will be substituted anytime it shows up as an individual word in a Terminal command. \",\n \" \",\n \"Entering just the command 'alias' without any arguments prints the list of all defined aliases in the reusable form \",\n \"'alias NAME=VALUE' on the Terminal. \",\n \" \",\n \"The 'unalias' command can be used to remove aliases.\",\n \" \",\n ],\n analyze: [\n \"Usage: analyze\",\n \" \",\n \"Prints details and statistics about the current server. The information that is printed includes basic \",\n \"server details such as the hostname, whether the player has root access, what ports are opened/closed, and also \",\n \"hacking-related information such as an estimated chance to successfully hack, an estimate of how much money is \",\n \"available on the server, etc.\",\n \" \",\n ],\n backdoor: [\n \"Usage: backdoor\",\n \" \",\n \"Install a backdoor on the current machine, grants a secret bonus depending on the machine.\",\n \" \",\n \"Requires root access to run.\",\n \" \",\n ],\n buy: [\n \"Usage: buy [-l / -a / program]\",\n \" \",\n \"Purchase a program through the Dark Web. Requires a TOR router to use.\",\n \" \",\n \"If this command is ran with the '-l' flag, it will display a list of all programs that can be bought through the \",\n \"dark web to the Terminal, as well as their costs.\",\n \" \",\n \"If this command is ran with the '-a' flag, it will attempt to purchase all unowned programs.\",\n \" \",\n \"Otherwise, the name of the program must be passed in as a parameter. This name is NOT case-sensitive.\",\n \" \",\n ],\n cat: [\n \"Usage: cat [file]\",\n \" \",\n \"Display message (.msg), literature (.lit), or text (.txt) files. Examples:\",\n \" \",\n \" cat j1.msg\",\n \" \",\n \" cat foo.lit\",\n \" \",\n \" cat servers.txt\",\n \" \",\n ],\n cd: [\n \"Usage: cd [dir]\",\n \" \",\n \"Change to the specified directory. Note that this works even for directories that don't exist. If you \",\n \"change to a directory that does not exist, it will not be 'created'. Examples:\",\n \" \",\n \" cd scripts/hacking\",\n \" \",\n \" cd /logs\",\n \" \",\n \" cd ../\",\n \" \",\n ],\n check: [\n \"Usage: check [script name] [args...]\",\n \" \",\n \"Print the logs of the script specified by the script name and arguments to the Terminal. Each argument must be separated by \",\n \"a space. Remember that a running script is uniquely \",\n \"identified both by its name and the arguments that are used to start it. So, if a script was ran with the following arguments: \",\n \" \",\n \" run foo.script 1 2 foodnstuff\",\n \" \",\n \"Then to run the 'check' command on this script you would have to pass the same arguments in: \",\n \" \",\n \" check foo.script 1 2 foodnstuff\",\n \" \",\n ],\n clear: [\n \"Usage: clear\",\n \" \",\n \"Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up \",\n \"and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'cls' command\",\n \" \",\n ],\n cls: [\n \"Usage: cls\",\n \" \",\n \"Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up \",\n \"and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'clear' command\",\n \" \",\n ],\n connect: [\n \"Usage: connect [hostname]\",\n \" \",\n \"Connect to a remote server. The hostname or IP address of the remote server must be given as the argument \",\n \"to this command. Note that only servers that are immediately adjacent to the current server in the network can be connected to. To \",\n \"see which servers can be connected to, use the 'scan' command.\",\n \" \",\n ],\n cp: [\"Usage: cp [src] [dst]\", \" \", \"Copy a file on this server. To copy a file to another server use scp.\", \" \"],\n download: [\n \"Usage: download [script/text file]\",\n \" \",\n \"Downloads a script or text file to your computer (like your real life computer).\",\n \" \",\n \"You can also download all of your scripts/text files as a zip file using the following Terminal commands:\",\n \" \",\n \"Download all scripts and text files: download *\",\n \" \",\n \"Download all scripts: download *.script\",\n \" \",\n \"Download all text files: download *.txt\",\n \" \",\n ],\n expr: [\n \"Usage: expr [mathematical expression]\",\n \" \",\n \"Evaluate a simple mathematical expression. Supports native JavaScript operators:\",\n \" \",\n \"+, -, /, *, **, %\",\n \" \",\n \"Example:\",\n \" \",\n \" expr 25 * 2 ** 10\",\n \" \",\n \"Note that letters (non-digits) are not allowed and will be removed from the input.\",\n \" \",\n ],\n free: [\n \"Usage: free\",\n \" \",\n \"Displays the memory usage on the current machine. Print the amount of RAM that is available on the current server as well as \",\n \"how much of it is being used.\",\n \" \",\n ],\n grow: [\n \"Usage: grow\",\n \" \",\n \"Spoof transactions in the current server. Increasing the money available by hacking. Requires root access.\",\n \"See the wiki page for hacking mechanics.\",\n \" \",\n ],\n hack: [\n \"Usage: hack\",\n \" \",\n \"Attempt to hack the current server. Requires root access in order to be run. See the wiki page for hacking mechanics\",\n \" \",\n ],\n help: [\n \"Usage: help [command]\",\n \" \",\n \"Display Terminal help information. Without arguments, 'help' prints a list of all valid Terminal commands and a brief \",\n \"description of their functionality. You can also pass the name of a Terminal command as an argument to 'help' to print \",\n \"more detailed information about the Terminal command. Examples: \",\n \" \",\n \" help alias\",\n \" \",\n \" help scan-analyze\",\n \" \",\n ],\n history: [\n \"Usage: history [-c]\",\n \" \",\n \"Without arguments, displays the terminal command history. To clear the history, pass in the '-c' argument.\",\n \" \",\n ],\n home: [\n \"Usage: home\", \" \", \"Connect to your home computer. This will work no matter what server you are currently connected to.\", \" \",\n ],\n hostname: [\"Usage: hostname\", \" \", \"Prints the hostname of the current server\", \" \"],\n kill: [\n \"Usage: kill [script name] [args...] or kill [pid\",\n \" \",\n \"Kill the script specified by the script name and arguments OR by its PID.\",\n \" \",\n \"If you are killing the script using its filename and arguments, then each \",\n \"argument must be separated by a space. Remember that a running script is \",\n \"uniquely identified by both its name and the arguments that are used to start \",\n \"it. So, if a script was ran with the following arguments:\",\n \" \",\n \" run foo.script 1 sigma-cosmetics\",\n \" \",\n \"Then to kill this script the same arguments would have to be used:\",\n \" \",\n \" kill foo.script 1 sigma-cosmetics\",\n \" \",\n \"If you are killing the script using its PID, then the PID argument must be numeric\",\n \" \",\n ],\n killall: [\n \"Usage: killall\",\n \" \",\n \"Kills all scripts on the current server. \",\n \"Note that after the 'kill' command is issued for a script, it may take a while for the script to actually stop running. \",\n \"This will happen if the script is in the middle of a command such as grow() or weaken() that takes time to execute. \",\n \"The script will not be stopped/killed until after that time has elapsed.\",\n \" \",\n ],\n ls: [\n \"Usage: ls [dir] [| grep pattern]\",\n \" \",\n \"The ls command, with no arguments, prints all files and directories on the current server's directory to the Terminal screen. \",\n \"The files will be displayed in alphabetical order. \",\n \" \",\n \"The 'dir' optional parameter can be used to display files/directories in another directory.\",\n \" \",\n \"The '| grep pattern' optional parameter can be used to only display files whose filenames match the specified pattern.\",\n \" \",\n \"Examples:\",\n \" \",\n \"List all files with the '.script' extension in the current directory:\",\n \" \",\n \" ls | grep .script\",\n \" \",\n \"List all files with the '.js' extension in the root directory:\",\n \" \",\n \" ls / | grep .js\",\n \" \",\n \"List all files with the word 'purchase' in the filename, in the 'scripts' directory:\",\n \" \",\n \" ls scripts | grep purchase\",\n \" \",\n ],\n lscpu: [\"Usage: lscpu\", \" \", \"Prints the number of CPU Cores the current server has\", \" \"],\n\n mem: [\n \"Usage: mem [script name] [-t num_threads]\",\n \" \",\n \"Displays the amount of RAM needed to run the specified script with a single thread. The command can also be used to print \",\n \"the amount of RAM needed to run a script with multiple threads using the '-t' flag. If the '-t' flag is specified, then \",\n \"an argument for the number of threads must be passed in afterwards. Examples:\",\n \" \",\n \" mem foo.script\",\n \" \",\n \" mem foo.script -t 50\",\n \" \",\n \"The first example above will print the amount of RAM needed to run 'foo.script' with a single thread. The second example \",\n \"above will print the amount of RAM needed to run 'foo.script' with 50 threads.\",\n \" \",\n ],\n mv: [\n \"Usage: mv [src] [dest]\",\n \" \",\n \"Move the source file to the specified destination. This can also be used to rename files. \",\n \"This command only works for scripts and text files (.txt). This command CANNOT be used to \",\n \"convert to different file types\",\n \" \",\n \"Note that, unlike the Linux 'mv' command, the destination argument must be the \",\n \"full filepath. \",\n \"Examples: \",\n \" \",\n \" mv hacking-controller.script scripts/hacking-controller.script\",\n \" \",\n \" mv myScript.js myOldScript.js\",\n \" \",\n ],\n nano: TemplatedHelpTexts.scriptEditor('nano'),\n ps: [\"Usage: ps\", \" \", \"Prints all scripts that are running on the current server\", \" \"],\n rm: [\n \"Usage: rm [file]\",\n \" \",\n \"Removes the specified file from the current server. A file can be a script, a program, or a message file. \",\n \" \",\n \"WARNING: This is permanent and cannot be undone\",\n \" \",\n ],\n run: [\n \"Usage: run [file name] [-t] [num threads] [args...]\",\n \" \",\n \"Execute a program, script or coding contract.\",\n \" \",\n \"The '[-t]', '[num threads]', and '[args...]' arguments are only valid when running a script. The '-t' flag is used \",\n \"to indicate that the script should be run with the specified number of threads. If the flag is omitted, \",\n \"then the script will be run with a single thread by default. \",\n \"If the '-t' flag is used, then it MUST come immediately \",\n \"after the script name, and the [num threads] argument MUST come immediately afterwards. \",\n \" \",\n \"[args...] represents a variable number of arguments that will be passed into the script. See the documentation \",\n \"about script arguments. Each specified argument must be separated by a space. \",\n \" \",\n ],\n scan: [\n \"Usage: scan\",\n \" \",\n \"Prints all immediately-available network connection. This will print a list of all servers that you can currently connect \",\n \"to using the 'connect' Terminal command.\",\n \" \",\n ],\n \"scan-analyze\": [\n \"Usage: scan-analyze [depth] [-a]\",\n \" \",\n \"Prints detailed information about all servers up to [depth] nodes away on the network. Calling \",\n \"'scan-analyze 1' will display information for the same servers that are shown by the 'scan' Terminal \",\n \"command. This command also shows the relative paths to reach each server.\",\n \" \",\n \"By default, the maximum depth that can be specified for 'scan-analyze' is 3. However, once you have \",\n \"the DeepscanV1.exe and DeepscanV2.exe programs, you can execute 'scan-analyze' with a depth up to \",\n \"5 and 10, respectively.\",\n \" \",\n \"The information 'scan-analyze' displays about each server includes whether or not you have root access to it, \",\n \"its required hacking level, the number of open ports required to run NUKE.exe on it, and how much RAM \",\n \"it has.\",\n \" \",\n \"By default, this command will not display servers that you have purchased. However, you can pass in the \",\n \"-a flag at the end of the command if you would like to enable that.\",\n \" \",\n ],\n scp: [\n \"Usage: scp [filename ...] [target server]\",\n \" \",\n \"Copies the specified file(s) from the current server to the target server. \",\n \"This command only works for script files (.script or .js extension), literature files (.lit extension), \",\n \"and text files (.txt extension). \",\n \"The second argument passed in must be the hostname or IP of the target server. Examples:\",\n \" \",\n \" scp foo.script n00dles\",\n \" \",\n \" scp foo.script bar.script n00dles\",\n \" \",\n ],\n sudov: [\"Usage: sudov\", \" \", \"Prints whether or not you have root access to the current machine\", \" \"],\n\n tail: [\n \"Usage: tail [script name] [args...]\",\n \" \",\n \"Displays dynamic logs for the script specified by the script name and arguments. Each argument must be separated \",\n \"by a space. Remember that a running script is uniquely identified by both its name and the arguments that were used \",\n \"to run it. So, if a script was ran with the following arguments: \",\n \" \",\n \" run foo.script 10 50000\",\n \" \",\n \"Then in order to check its logs with 'tail' the same arguments must be used: \",\n \" \",\n \" tail foo.script 10 50000\",\n \" \",\n ],\n top: [\n \"Usage: top\",\n \" \",\n \"Prints a list of all scripts running on the current server as well as their thread count and how much \",\n \"RAM they are using in total.\",\n \" \",\n ],\n unalias: [\n \"Usage: unalias [alias name]\",\n \" \",\n \"Deletes the specified alias. Note that the double quotation marks are required. \",\n \" \",\n \"As an example, if an alias was declared using:\",\n \" \",\n ' alias r=\"run\"',\n \" \",\n \"Then it could be removed using:\",\n \" \",\n \" unalias r\",\n \" \",\n \"It is not necessary to differentiate between global and non-global aliases when using 'unalias'\",\n \" \",\n ],\n vim: TemplatedHelpTexts.scriptEditor('vim'),\n weaken: [\n \"Usage: weaken\",\n \" \",\n \"Reduces the security level of the current server. Decreasing the time it takes for all operations on this server.\",\n \"Requires root access. See the wiki page for hacking mechanics.\",\n \" \",\n ],\n wget: [\n \"Usage: wget [url] [target file]\",\n \" \",\n \"Retrieves data from a URL and downloads it to a file on the current server. The data can only \",\n \"be downloaded to a script (.script, .ns, .js) or a text file (.txt). If the file already exists, \",\n \"it will be overwritten by this command.\",\n \" \",\n \"Note that it will not be possible to download data from many websites because they do not allow \",\n \"cross-origin resource sharing (CORS). Example:\",\n \" \",\n \" wget https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md game_readme.txt\",\n \" \",\n ],\n};\n","import React, { useState } from \"react\";\n\nimport { CinematicLine } from \"./CinematicLine\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n lines: string[];\n auto?: boolean;\n onDone?: () => void;\n}\n\nexport function CinematicText(props: IProps): React.ReactElement {\n const [i, setI] = useState(0);\n const [done, setDone] = useState(false);\n\n function advance(): void {\n const newI = i + 1;\n setI(newI);\n if (newI >= props.lines.length) {\n if (props.onDone && props.auto) props.onDone();\n setDone(true);\n }\n }\n\n return (\n <>\n {props.lines.slice(0, i).map((line, i) => (\n <Typography key={i}>{line}</Typography>\n ))}\n {props.lines.length > i && <CinematicLine key={i} text={props.lines[i]} onDone={advance} />}\n {!props.auto && props.onDone && done && <Button onClick={props.onDone}>Continue ...</Button>}\n </>\n );\n}\n","import React from \"react\";\n\nimport { Page } from \"../ui/Router\";\nimport { hash } from \"../hash/hash\";\nimport { CONSTANTS } from \"../Constants\";\n\nenum GameEnv {\n Production,\n Development,\n}\n\nenum Platform {\n Browser,\n Steam,\n}\n\ninterface GameVersion {\n version: string;\n hash: string;\n\n toDisplay: () => string;\n}\n\ninterface BrowserFeatures {\n userAgent: string;\n language: string;\n cookiesEnabled: boolean;\n doNotTrack: string | null;\n indexedDb: boolean;\n}\n\ninterface IErrorMetadata {\n error: Error;\n errorInfo?: React.ErrorInfo;\n page?: Page;\n\n environment: GameEnv;\n platform: Platform;\n version: GameVersion;\n features: BrowserFeatures;\n}\n\nexport interface IErrorData {\n metadata: IErrorMetadata;\n\n title: string;\n body: string;\n\n features: string;\n fileName?: string;\n\n issueUrl: string;\n}\n\n\nexport const newIssueUrl = `https://github.com/danielyxie/bitburner/issues/new`;\n\nfunction getErrorMetadata(error: Error, errorInfo?: React.ErrorInfo, page?: Page): IErrorMetadata {\n const isElectron = navigator.userAgent.toLowerCase().indexOf(\" electron/\") > -1;\n const env = process.env.NODE_ENV === \"development\" ? GameEnv.Development : GameEnv.Production;\n const version: GameVersion = {\n version: CONSTANTS.VersionString,\n hash: hash(),\n toDisplay: () => `v${CONSTANTS.VersionString} (${hash()})`,\n }\n const features: BrowserFeatures = {\n userAgent: navigator.userAgent,\n\n language: navigator.language,\n cookiesEnabled: navigator.cookieEnabled,\n doNotTrack: navigator.doNotTrack,\n indexedDb: (!!window.indexedDB),\n }\n const metadata: IErrorMetadata = {\n platform: isElectron ? Platform.Steam : Platform.Browser,\n environment: env,\n version, features,\n error, errorInfo, page,\n }\n return metadata;\n}\n\nexport function getErrorForDisplay(error: Error, errorInfo?: React.ErrorInfo, page?: Page): IErrorData {\n const metadata = getErrorMetadata(error, errorInfo, page);\n const fileName = (metadata.error as any).fileName;\n const features = `lang=${metadata.features.language} cookiesEnabled=${metadata.features.cookiesEnabled.toString()}` +\n ` doNotTrack=${metadata.features.doNotTrack} indexedDb=${metadata.features.indexedDb.toString()}`;\n\n const title = `${metadata.error.name}: ${metadata.error.message}${metadata.page && ` (at \"${Page[metadata.page]}\")`}`;\n const body = `\n## ${title}\n\n### How did this happen?\n\nPlease fill this information with details if relevant.\n\n- [ ] Save file\n- [ ] Minimal scripts to reproduce the issue\n- [ ] Steps to reproduce\n\n### Environment\n\n* Error: ${metadata.error?.toString() ?? 'n/a'}\n* Page: ${metadata.page ? Page[metadata.page] : 'n/a'}\n* Version: ${metadata.version.toDisplay()}\n* Environment: ${GameEnv[metadata.environment]}\n* Platform: ${Platform[metadata.platform]}\n* UserAgent: ${navigator.userAgent}\n* Features: ${features}\n* Source: ${fileName ?? 'n/a'}\n\n${metadata.environment === GameEnv.Development ? `\n### Stack Trace\n\\`\\`\\`\n${metadata.errorInfo?.componentStack.toString().trim()}\n\\`\\`\\`\n` : ''}\n### Save\n\\`\\`\\`\nCopy your save here if possible\n\\`\\`\\`\n`.trim();\n\n const issueUrl = `${newIssueUrl}?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}`;\n\n const data: IErrorData = {\n metadata,\n fileName,\n features,\n title,\n body,\n issueUrl,\n }\n return data;\n}\n","import { getRandomInt } from \"./getRandomInt\";\n\n/**\n * Gets a random value in the range of a byte (0 - 255), or up to the maximum.\n * @param max The maximum value (up to 255).\n */\nexport function getRandomByte(max: number): number {\n // Technically 2^8 is 256, but the values are 0-255, not 1-256.\n const byteMaximum = 255;\n const upper: number = Math.max(Math.min(max, byteMaximum), 0);\n\n return getRandomInt(0, upper);\n}\n","import { getRandomInt } from \"../../utils/helpers/getRandomInt\";\n\nexport const Growths: {\n [key: string]: (() => number) | undefined;\n [\"Tracking\"]: () => number;\n [\"Bounty Hunter\"]: () => number;\n [\"Retirement\"]: () => number;\n [\"Investigation\"]: () => number;\n [\"Undercover Operation\"]: () => number;\n [\"Sting Operation\"]: () => number;\n [\"Raid\"]: () => number;\n [\"Stealth Retirement Operation\"]: () => number;\n [\"Assassination\"]: () => number;\n} = {\n Tracking: () => getRandomInt(5, 75) / 10,\n \"Bounty Hunter\": () => getRandomInt(5, 75) / 10,\n Retirement: () => getRandomInt(5, 75) / 10,\n Investigation: () => getRandomInt(10, 40) / 10,\n \"Undercover Operation\": () => getRandomInt(10, 40) / 10,\n \"Sting Operation\": () => getRandomInt(3, 40) / 10,\n Raid: () => getRandomInt(2, 40) / 10,\n \"Stealth Retirement Operation\": () => getRandomInt(1, 20) / 10,\n Assassination: () => getRandomInt(1, 20) / 10,\n};\n","/**\n * Utility function that creates a \"city map\", which is an object where\n * each city is a key (property).\n *\n * This map uses the official name of the city, NOT its key in the 'Cities' object\n */\nimport { Cities } from \"./Cities\";\nimport { IMap } from \"../types\";\n\nexport function createCityMap<T>(initValue: T): IMap<T> {\n const map: IMap<T> = {};\n const cities = Object.keys(Cities);\n for (let i = 0; i < cities.length; ++i) {\n map[cities[i]] = initValue;\n }\n\n // round try JSON so to make sure none of the initial values have the same references.\n return JSON.parse(JSON.stringify(map));\n}\n","/**\n * Represents a Hand of cards.\n *\n * This class is IMMUTABLE\n */\n\nimport { Card } from \"./Card\";\n\nexport class Hand {\n constructor(readonly cards: readonly Card[]) {}\n\n addCards(...cards: Card[]): Hand {\n return new Hand([...this.cards, ...cards]);\n }\n\n removeByIndex(i: number): Hand {\n if (i >= this.cards.length) {\n throw new Error(`Tried to remove invalid card from Hand by index: ${i}`);\n }\n\n return new Hand([...this.cards.slice().splice(i, 1)]);\n }\n}\n","/**\n * React Component for a button that initiates a transaction on the Stock Market UI\n * (Buy, Sell, Buy Max, etc.)\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\ntype IProps = {\n onClick: () => void;\n text: string;\n tooltip?: JSX.Element | null;\n};\n\nexport function StockTickerTxButton(props: IProps): React.ReactElement {\n return (\n <Tooltip title={props.tooltip != null ? <Typography>{props.tooltip}</Typography> : \"\"}>\n <Button onClick={props.onClick}>{props.text}</Button>\n </Tooltip>\n );\n}\n","/**\n * Abstract Base Class for any Server object\n */\nimport { CodingContract } from \"../CodingContracts\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { Script } from \"../Script/Script\";\nimport { isValidFilePath } from \"../Terminal/DirectoryHelpers\";\nimport { TextFile } from \"../TextFile\";\nimport { IReturnStatus } from \"../types\";\n\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\n\nimport { createRandomIp } from \"../utils/IPAddress\";\nimport { compareArrays } from \"../utils/helpers/compareArrays\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\ninterface IConstructorParams {\n adminRights?: boolean;\n hostname: string;\n ip?: string;\n isConnectedTo?: boolean;\n maxRam?: number;\n organizationName?: string;\n}\n\ninterface writeResult {\n success: boolean;\n overwritten: boolean;\n}\n\nexport class BaseServer {\n // Coding Contract files on this server\n contracts: CodingContract[] = [];\n\n // How many CPU cores this server has. Maximum of 8.\n // Currently, this only affects hacking missions\n cpuCores = 1;\n\n // Flag indicating whether the FTP port is open\n ftpPortOpen = false;\n\n // Flag indicating whether player has admin/root access to this server\n hasAdminRights = false;\n\n // Hostname. Must be unique\n hostname = \"\";\n\n // Flag indicating whether HTTP Port is open\n httpPortOpen = false;\n\n // IP Address. Must be unique\n ip = \"\";\n\n // Flag indicating whether player is curently connected to this server\n isConnectedTo = false;\n\n // RAM (GB) available on this server\n maxRam = 0;\n\n // Message files AND Literature files on this Server\n messages: string[] = [];\n\n // Name of company/faction/etc. that this server belongs to.\n // Optional, not applicable to all Servers\n organizationName = \"\";\n\n // Programs on this servers. Contains only the names of the programs\n programs: string[] = [];\n\n // RAM (GB) used. i.e. unavailable RAM\n ramUsed = 0;\n\n // RunningScript files on this server\n runningScripts: RunningScript[] = [];\n\n // Script files on this Server\n scripts: Script[] = [];\n\n // Contains the IP Addresses of all servers that are immediately\n // reachable from this one\n serversOnNetwork: string[] = [];\n\n // Flag indicating whether SMTP Port is open\n smtpPortOpen = false;\n\n // Flag indicating whether SQL Port is open\n sqlPortOpen = false;\n\n // Flag indicating whether the SSH Port is open\n sshPortOpen = false;\n\n // Text files on this server\n textFiles: TextFile[] = [];\n\n // Flag indicating wehther this is a purchased server\n purchasedByPlayer = false;\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n this.ip = params.ip ? params.ip : createRandomIp();\n\n this.hostname = params.hostname;\n this.organizationName = params.organizationName != null ? params.organizationName : \"\";\n this.isConnectedTo = params.isConnectedTo != null ? params.isConnectedTo : false;\n\n //Access information\n this.hasAdminRights = params.adminRights != null ? params.adminRights : false;\n }\n\n addContract(contract: CodingContract): void {\n this.contracts.push(contract);\n }\n\n getContract(contractName: string): CodingContract | null {\n for (const contract of this.contracts) {\n if (contract.fn === contractName) {\n return contract;\n }\n }\n return null;\n }\n\n /**\n * Find an actively running script on this server\n * @param scriptName - Filename of script to search for\n * @param scriptArgs - Arguments that script is being run with\n * @returns RunningScript for the specified active script\n * Returns null if no such script can be found\n */\n getRunningScript(scriptName: string, scriptArgs: any[]): RunningScript | null {\n for (const rs of this.runningScripts) {\n if (rs.filename === scriptName && compareArrays(rs.args, scriptArgs)) {\n return rs;\n }\n }\n\n return null;\n }\n\n /**\n * Given the name of the script, returns the corresponding\n * Script object on the server (if it exists)\n */\n getScript(scriptName: string): Script | null {\n for (let i = 0; i < this.scripts.length; i++) {\n if (this.scripts[i].filename === scriptName) {\n return this.scripts[i];\n }\n }\n\n return null;\n }\n\n /**\n * Returns boolean indicating whether the given script is running on this server\n */\n isRunning(fn: string): boolean {\n for (const runningScriptObj of this.runningScripts) {\n if (runningScriptObj.filename === fn) {\n return true;\n }\n }\n\n return false;\n }\n\n removeContract(contract: CodingContract): void {\n if (contract instanceof CodingContract) {\n this.contracts = this.contracts.filter((c) => {\n return c.fn !== contract.fn;\n });\n } else {\n this.contracts = this.contracts.filter((c) => {\n return c.fn !== contract;\n });\n }\n }\n\n /**\n * Remove a file from the server\n * @param fn {string} Name of file to be deleted\n * @returns {IReturnStatus} Return status object indicating whether or not file was deleted\n */\n removeFile(fn: string): IReturnStatus {\n if (fn.endsWith(\".exe\") || fn.match(/^.+\\.exe-\\d+(?:\\.\\d*)?%-INC$/) != null) {\n for (let i = 0; i < this.programs.length; ++i) {\n if (this.programs[i] === fn) {\n this.programs.splice(i, 1);\n return { res: true };\n }\n }\n } else if (isScriptFilename(fn)) {\n for (let i = 0; i < this.scripts.length; ++i) {\n if (this.scripts[i].filename === fn) {\n if (this.isRunning(fn)) {\n return {\n res: false,\n msg: \"Cannot delete a script that is currently running!\",\n };\n }\n\n this.scripts.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".lit\")) {\n for (let i = 0; i < this.messages.length; ++i) {\n const f = this.messages[i];\n if (typeof f === \"string\" && f === fn) {\n this.messages.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".txt\")) {\n for (let i = 0; i < this.textFiles.length; ++i) {\n if (this.textFiles[i].fn === fn) {\n this.textFiles.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".cct\")) {\n for (let i = 0; i < this.contracts.length; ++i) {\n if (this.contracts[i].fn === fn) {\n this.contracts.splice(i, 1);\n return { res: true };\n }\n }\n }\n\n return { res: false, msg: \"No such file exists\" };\n }\n\n /**\n * Called when a script is run on this server.\n * All this function does is add a RunningScript object to the\n * `runningScripts` array. It does NOT check whether the script actually can\n * be run.\n */\n runScript(script: RunningScript): void {\n this.runningScripts.push(script);\n }\n\n setMaxRam(ram: number): void {\n this.maxRam = ram;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n updateRamUsed(ram: number, player: IPlayer): void {\n this.ramUsed = ram;\n }\n\n /**\n * Write to a script file\n * Overwrites existing files. Creates new files if the script does not eixst\n */\n writeToScriptFile(player: IPlayer, fn: string, code: string): writeResult {\n const ret = { success: false, overwritten: false };\n if (!isValidFilePath(fn) || !isScriptFilename(fn)) {\n return ret;\n }\n\n // Check if the script already exists, and overwrite it if it does\n for (let i = 0; i < this.scripts.length; ++i) {\n if (fn === this.scripts[i].filename) {\n const script = this.scripts[i];\n script.code = code;\n script.updateRamUsage(player, this.scripts);\n script.markUpdated();\n ret.overwritten = true;\n ret.success = true;\n return ret;\n }\n }\n\n // Otherwise, create a new script\n const newScript = new Script(player, fn, code, this.hostname, this.scripts);\n this.scripts.push(newScript);\n ret.success = true;\n return ret;\n }\n\n // Write to a text file\n // Overwrites existing files. Creates new files if the text file does not exist\n writeToTextFile(fn: string, txt: string): writeResult {\n const ret = { success: false, overwritten: false };\n if (!isValidFilePath(fn) || !fn.endsWith(\"txt\")) {\n return ret;\n }\n\n // Check if the text file already exists, and overwrite if it does\n for (let i = 0; i < this.textFiles.length; ++i) {\n if (this.textFiles[i].fn === fn) {\n ret.overwritten = true;\n this.textFiles[i].text = txt;\n ret.success = true;\n return ret;\n }\n }\n\n // Otherwise create a new text file\n const newFile = new TextFile(fn, txt);\n this.textFiles.push(newFile);\n ret.success = true;\n return ret;\n }\n}\n","import React, { useState, useEffect } from \"react\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\nimport { CodingContract, CodingContractTypes } from \"../../CodingContracts\";\nimport { CopyableText } from \"./CopyableText\";\nimport { Modal } from \"./Modal\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n c: CodingContract;\n onClose: () => void;\n onAttempt: (answer: string) => void;\n}\n\nexport const CodingContractEvent = new EventEmitter<[IProps]>();\n\nexport function CodingContractModal(): React.ReactElement {\n const [props, setProps] = useState<IProps | null>(null);\n const [answer, setAnswer] = useState(\"\");\n\n useEffect(() => {\n CodingContractEvent.subscribe((props) => setProps(props));\n });\n if (props === null) return <></>;\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setAnswer(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (props === null) return;\n // React just won't cooperate on this one.\n // \"React.KeyboardEvent<HTMLInputElement>\" seems like the right type but\n // whatever ...\n const value = (event.target as any).value;\n\n if (event.keyCode === KEY.ENTER && value !== \"\") {\n event.preventDefault();\n props.onAttempt(answer);\n setAnswer(\"\");\n close();\n }\n }\n\n function close(): void {\n if (props === null) return;\n props.onClose();\n setProps(null);\n }\n\n const contractType = CodingContractTypes[props.c.type];\n const description = [];\n for (const [i, value] of contractType.desc(props.c.data).split(\"\\n\").entries())\n description.push(<span key={i} dangerouslySetInnerHTML={{ __html: value + \"<br />\" }}></span>);\n return (\n <Modal open={props !== null} onClose={close}>\n <CopyableText variant=\"h4\" value={props.c.type} />\n <Typography>\n You are attempting to solve a Coding Contract. You have {props.c.getMaxNumTries() - props.c.tries} tries\n remaining, after which the contract will self-destruct.\n </Typography>\n <br />\n <Typography>{description}</Typography>\n <br />\n <TextField\n autoFocus\n placeholder=\"Enter Solution here\"\n value={answer}\n onChange={onChange}\n onKeyDown={onKeyDown}\n InputProps={{\n endAdornment: (\n <Button\n onClick={() => {\n props.onAttempt(answer);\n setAnswer(\"\");\n close();\n }}\n >\n Solve\n </Button>\n ),\n }}\n />\n </Modal>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const BitFlumeEvent = new EventEmitter<[]>();\n\nexport function BitFlumeModal(): React.ReactElement {\n const router = use.Router();\n const [open, setOpen] = useState(false);\n function flume(): void {\n router.toBitVerse(true, false);\n setOpen(false);\n }\n\n useEffect(() => BitFlumeEvent.subscribe(() => setOpen(true)), []);\n\n return (\n <Modal open={open} onClose={() => setOpen(false)}>\n <Typography>\n WARNING: USING THIS PROGRAM WILL CAUSE YOU TO LOSE ALL OF YOUR PROGRESS ON THE CURRENT BITNODE.\n <br />\n <br />\n Do you want to travel to the BitNode Nexus? This allows you to reset the current BitNode and select a new one.\n </Typography>\n <br />\n <br />\n <Button onClick={flume}>Travel to the BitVerse</Button>\n </Modal>\n );\n}\n","import * as augmentationMethods from \"./PlayerObjectAugmentationMethods\";\nimport * as bladeburnerMethods from \"./PlayerObjectBladeburnerMethods\";\nimport * as corporationMethods from \"./PlayerObjectCorporationMethods\";\nimport * as gangMethods from \"./PlayerObjectGangMethods\";\nimport * as generalMethods from \"./PlayerObjectGeneralMethods\";\nimport * as serverMethods from \"./PlayerObjectServerMethods\";\n\nimport { IMap } from \"../../types\";\nimport { Resleeve } from \"../Resleeving/Resleeve\";\nimport { Sleeve } from \"../Sleeve/Sleeve\";\nimport { IPlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Company } from \"../../Company/Company\";\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { IRouter } from \"../../ui/Router\";\nimport { ICodingContractReward } from \"../../CodingContracts\";\n\nimport { IPlayer } from \"../IPlayer\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { IPlayerOwnedAugmentation } from \"../../Augmentation/PlayerOwnedAugmentation\";\nimport { ICorporation } from \"../../Corporation/ICorporation\";\nimport { IGang } from \"../../Gang/IGang\";\nimport { IBladeburner } from \"../../Bladeburner/IBladeburner\";\nimport { HacknetNode } from \"../../Hacknet/HacknetNode\";\n\nimport { HashManager } from \"../../Hacknet/HashManager\";\nimport { CityName } from \"../../Locations/data/CityNames\";\n\nimport { MoneySourceTracker } from \"../../utils/MoneySourceTracker\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON } from \"../../utils/JSONReviver\";\nimport { ISkillProgress } from \"../formulas/skill\";\nimport { PlayerAchievement } from \"../../Achievements/Achievements\";\nimport { cyrb53 } from \"../../utils/StringHelperFunctions\";\nimport { getRandomInt } from \"../../utils/helpers/getRandomInt\";\n\nexport class PlayerObject implements IPlayer {\n // Class members\n augmentations: IPlayerOwnedAugmentation[];\n bitNodeN: number;\n city: CityName;\n companyName: string;\n corporation: ICorporation | null;\n gang: IGang | null;\n bladeburner: IBladeburner | null;\n currentServer: string;\n factions: string[];\n factionInvitations: string[];\n hacknetNodes: (HacknetNode | string)[]; // HacknetNode object or IP of Hacknet Server\n has4SData: boolean;\n has4SDataTixApi: boolean;\n hashManager: HashManager;\n hasTixApiAccess: boolean;\n hasWseAccount: boolean;\n hp: number;\n jobs: IMap<string>;\n init: () => void;\n isWorking: boolean;\n karma: number;\n numPeopleKilled: number;\n location: LocationName;\n max_hp: number;\n money: number;\n moneySourceA: MoneySourceTracker;\n moneySourceB: MoneySourceTracker;\n playtimeSinceLastAug: number;\n playtimeSinceLastBitnode: number;\n purchasedServers: any[];\n queuedAugmentations: IPlayerOwnedAugmentation[];\n resleeves: Resleeve[];\n scriptProdSinceLastAug: number;\n sleeves: Sleeve[];\n sleevesFromCovenant: number;\n sourceFiles: IPlayerOwnedSourceFile[];\n exploits: Exploit[];\n achievements: PlayerAchievement[];\n terminalCommandHistory: string[];\n identifier: string;\n lastUpdate: number;\n lastSave: number;\n totalPlaytime: number;\n\n // Stats\n hacking: number;\n strength: number;\n defense: number;\n dexterity: number;\n agility: number;\n charisma: number;\n intelligence: number;\n\n // Experience\n hacking_exp: number;\n strength_exp: number;\n defense_exp: number;\n dexterity_exp: number;\n agility_exp: number;\n charisma_exp: number;\n intelligence_exp: number;\n\n // Multipliers\n hacking_chance_mult: number;\n hacking_speed_mult: number;\n hacking_money_mult: number;\n hacking_grow_mult: number;\n hacking_mult: number;\n hacking_exp_mult: number;\n strength_mult: number;\n strength_exp_mult: number;\n defense_mult: number;\n defense_exp_mult: number;\n dexterity_mult: number;\n dexterity_exp_mult: number;\n agility_mult: number;\n agility_exp_mult: number;\n charisma_mult: number;\n charisma_exp_mult: number;\n hacknet_node_money_mult: number;\n hacknet_node_purchase_cost_mult: number;\n hacknet_node_ram_cost_mult: number;\n hacknet_node_core_cost_mult: number;\n hacknet_node_level_cost_mult: number;\n company_rep_mult: number;\n faction_rep_mult: number;\n work_money_mult: number;\n crime_success_mult: number;\n crime_money_mult: number;\n bladeburner_max_stamina_mult: number;\n bladeburner_stamina_gain_mult: number;\n bladeburner_analysis_mult: number;\n bladeburner_success_chance_mult: number;\n\n createProgramReqLvl: number;\n factionWorkType: string;\n createProgramName: string;\n timeWorkedCreateProgram: number;\n crimeType: string;\n committingCrimeThruSingFn: boolean;\n singFnCrimeWorkerScript: WorkerScript | null;\n timeNeededToCompleteWork: number;\n focus: boolean;\n className: string;\n currentWorkFactionName: string;\n workType: string;\n workCostMult: number;\n workExpMult: number;\n currentWorkFactionDescription: string;\n timeWorked: number;\n workMoneyGained: number;\n workMoneyGainRate: number;\n workRepGained: number;\n workRepGainRate: number;\n workHackExpGained: number;\n workHackExpGainRate: number;\n workStrExpGained: number;\n workStrExpGainRate: number;\n workDefExpGained: number;\n workDefExpGainRate: number;\n workDexExpGained: number;\n workDexExpGainRate: number;\n workAgiExpGained: number;\n workAgiExpGainRate: number;\n workChaExpGained: number;\n workChaExpGainRate: number;\n workMoneyLossRate: number;\n\n // Methods\n work: (numCycles: number) => boolean;\n workPartTime: (numCycles: number) => boolean;\n workForFaction: (numCycles: number) => boolean;\n applyForAgentJob: (sing?: boolean) => boolean;\n applyForBusinessConsultantJob: (sing?: boolean) => boolean;\n applyForBusinessJob: (sing?: boolean) => boolean;\n applyForEmployeeJob: (sing?: boolean) => boolean;\n applyForItJob: (sing?: boolean) => boolean;\n applyForJob: (entryPosType: CompanyPosition, sing?: boolean) => boolean;\n applyForNetworkEngineerJob: (sing?: boolean) => boolean;\n applyForPartTimeEmployeeJob: (sing?: boolean) => boolean;\n applyForPartTimeWaiterJob: (sing?: boolean) => boolean;\n applyForSecurityEngineerJob: (sing?: boolean) => boolean;\n applyForSecurityJob: (sing?: boolean) => boolean;\n applyForSoftwareConsultantJob: (sing?: boolean) => boolean;\n applyForSoftwareJob: (sing?: boolean) => boolean;\n applyForWaiterJob: (sing?: boolean) => boolean;\n canAccessBladeburner: () => boolean;\n canAccessCorporation: () => boolean;\n canAccessGang: () => boolean;\n canAccessResleeving: () => boolean;\n canAfford: (cost: number) => boolean;\n gainHackingExp: (exp: number) => void;\n gainStrengthExp: (exp: number) => void;\n gainDefenseExp: (exp: number) => void;\n gainDexterityExp: (exp: number) => void;\n gainAgilityExp: (exp: number) => void;\n gainCharismaExp: (exp: number) => void;\n gainIntelligenceExp: (exp: number) => void;\n gainMoney: (money: number, source: string) => void;\n getCurrentServer: () => BaseServer;\n getGangFaction: () => Faction;\n getGangName: () => string;\n getHomeComputer: () => Server;\n getNextCompanyPosition: (company: Company, entryPosType: CompanyPosition) => CompanyPosition | null;\n getUpgradeHomeRamCost: () => number;\n getUpgradeHomeCoresCost: () => number;\n gotoLocation: (to: LocationName) => boolean;\n hasAugmentation: (aug: string | Augmentation, installed?: boolean) => boolean;\n hasCorporation: () => boolean;\n hasGangWith: (facName: string) => boolean;\n hasTorRouter: () => boolean;\n hasProgram: (program: string) => boolean;\n inBladeburner: () => boolean;\n inGang: () => boolean;\n isQualified: (company: Company, position: CompanyPosition) => boolean;\n loseMoney: (money: number, source: string) => void;\n reapplyAllAugmentations: (resetMultipliers?: boolean) => void;\n reapplyAllSourceFiles: () => void;\n regenerateHp: (amt: number) => void;\n recordMoneySource: (amt: number, source: string) => void;\n setMoney: (amt: number) => void;\n singularityStopWork: () => string;\n startBladeburner: (p: any) => void;\n startFactionWork: (faction: Faction) => void;\n startClass: (costMult: number, expMult: number, className: string) => void;\n startCorporation: (corpName: string, additionalShares?: number) => void;\n startCrime: (\n router: IRouter,\n crimeType: string,\n hackExp: number,\n strExp: number,\n defExp: number,\n dexExp: number,\n agiExp: number,\n chaExp: number,\n money: number,\n time: number,\n singParams: any,\n ) => void;\n startFactionFieldWork: (faction: Faction) => void;\n startFactionHackWork: (faction: Faction) => void;\n startFactionSecurityWork: (faction: Faction) => void;\n startFocusing: () => void;\n startGang: (facName: string, isHacking: boolean) => void;\n startWork: (companyName: string) => void;\n startWorkPartTime: (companyName: string) => void;\n takeDamage: (amt: number) => boolean;\n travel: (to: CityName) => boolean;\n giveExploit: (exploit: Exploit) => void;\n giveAchievement: (achievementId: string) => void;\n queryStatFromString: (str: string) => number;\n getIntelligenceBonus: (weight: number) => number;\n getCasinoWinnings: () => number;\n quitJob: (company: string) => void;\n hasJob: () => boolean;\n process: (router: IRouter, numCycles?: number) => void;\n createHacknetServer: () => HacknetServer;\n startCreateProgramWork: (programName: string, time: number, reqLevel: number) => void;\n queueAugmentation: (augmentationName: string) => void;\n receiveInvite: (factionName: string) => void;\n updateSkillLevels: () => void;\n gainCodingContractReward: (reward: ICodingContractReward, difficulty?: number) => string;\n stopFocusing: () => void;\n finishFactionWork: (cancelled: boolean, sing?: boolean) => string;\n finishClass: (sing?: boolean) => string;\n finishWork: (cancelled: boolean, sing?: boolean) => string;\n cancelationPenalty: () => number;\n finishWorkPartTime: (sing?: boolean) => string;\n finishCrime: (cancelled: boolean) => string;\n finishCreateProgramWork: (cancelled: boolean) => string;\n resetMultipliers: () => void;\n prestigeAugmentation: () => void;\n prestigeSourceFile: () => void;\n calculateSkill: (exp: number, mult?: number) => number;\n calculateSkillProgress: (exp: number, mult?: number) => ISkillProgress;\n resetWorkStatus: (generalType?: string, group?: string, workType?: string) => void;\n getWorkHackExpGain: () => number;\n getWorkStrExpGain: () => number;\n getWorkDefExpGain: () => number;\n getWorkDexExpGain: () => number;\n getWorkAgiExpGain: () => number;\n getWorkChaExpGain: () => number;\n getWorkRepGain: () => number;\n getWorkMoneyGain: () => number;\n processWorkEarnings: (cycles: number) => void;\n hospitalize: () => void;\n createProgramWork: (numCycles: number) => boolean;\n takeClass: (numCycles: number) => boolean;\n commitCrime: (numCycles: number) => boolean;\n checkForFactionInvitations: () => Faction[];\n setBitNodeNumber: (n: number) => void;\n getMult: (name: string) => number;\n setMult: (name: string, mult: number) => void;\n canAccessCotMG: () => boolean;\n sourceFileLvl: (n: number) => number;\n\n constructor() {\n //Skills and stats\n this.hacking = 1;\n\n //Combat stats\n this.hp = 10;\n this.max_hp = 10;\n this.strength = 1;\n this.defense = 1;\n this.dexterity = 1;\n this.agility = 1;\n\n //Labor stats\n this.charisma = 1;\n\n //Special stats\n this.intelligence = 0;\n\n //Hacking multipliers\n this.hacking_chance_mult = 1;\n this.hacking_speed_mult = 1;\n this.hacking_money_mult = 1;\n this.hacking_grow_mult = 1;\n\n //Experience and multipliers\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n this.intelligence_exp = 0;\n\n this.hacking_mult = 1;\n this.strength_mult = 1;\n this.defense_mult = 1;\n this.dexterity_mult = 1;\n this.agility_mult = 1;\n this.charisma_mult = 1;\n\n this.hacking_exp_mult = 1;\n this.strength_exp_mult = 1;\n this.defense_exp_mult = 1;\n this.dexterity_exp_mult = 1;\n this.agility_exp_mult = 1;\n this.charisma_exp_mult = 1;\n\n this.company_rep_mult = 1;\n this.faction_rep_mult = 1;\n\n //Money\n this.money = 1000;\n\n //Location information\n this.city = CityName.Sector12;\n this.location = LocationName.TravelAgency;\n\n // Jobs that the player holds\n // Map of company name (key) -> name of company position (value. Just the name, not the CompanyPosition object)\n // The CompanyPosition name must match a key value in CompanyPositions\n this.jobs = {};\n\n // Company at which player is CURRENTLY working (only valid when the player is actively working)\n this.companyName = \"\"; // Name of Company. Must match a key value in Companies ma;\n\n // Servers\n this.currentServer = \"\"; //IP address of Server currently being accessed through termina;\n this.purchasedServers = []; //IP Addresses of purchased server;\n\n // Hacknet Nodes/Servers\n this.hacknetNodes = []; // Note= For Hacknet Servers, this array holds the IP addresses of the server;\n this.hashManager = new HashManager();\n\n //Factions\n this.factions = []; //Names of all factions player has joine;\n this.factionInvitations = []; //Outstanding faction invitation;\n\n //Augmentations\n this.queuedAugmentations = [];\n this.augmentations = [];\n\n this.sourceFiles = [];\n\n //Crime statistics\n this.numPeopleKilled = 0;\n this.karma = 0;\n\n this.crime_money_mult = 1;\n this.crime_success_mult = 1;\n\n //Flags/variables for working (Company, Faction, Creating Program, Taking Class)\n this.isWorking = false;\n this.focus = false;\n this.workType = \"\";\n this.workCostMult = 1;\n this.workExpMult = 1;\n\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n\n this.workHackExpGainRate = 0;\n this.workStrExpGainRate = 0;\n this.workDefExpGainRate = 0;\n this.workDexExpGainRate = 0;\n this.workAgiExpGainRate = 0;\n this.workChaExpGainRate = 0;\n this.workRepGainRate = 0;\n this.workMoneyGainRate = 0;\n this.workMoneyLossRate = 0;\n\n this.workHackExpGained = 0;\n this.workStrExpGained = 0;\n this.workDefExpGained = 0;\n this.workDexExpGained = 0;\n this.workAgiExpGained = 0;\n this.workChaExpGained = 0;\n this.workRepGained = 0;\n this.workMoneyGained = 0;\n\n this.createProgramName = \"\";\n this.createProgramReqLvl = 0;\n\n this.className = \"\";\n\n this.crimeType = \"\";\n\n this.timeWorked = 0; //in m;\n this.timeWorkedCreateProgram = 0;\n this.timeNeededToCompleteWork = 0;\n\n this.work_money_mult = 1;\n\n //Hacknet Node multipliers\n this.hacknet_node_money_mult = 1;\n this.hacknet_node_purchase_cost_mult = 1;\n this.hacknet_node_ram_cost_mult = 1;\n this.hacknet_node_core_cost_mult = 1;\n this.hacknet_node_level_cost_mult = 1;\n\n //Stock Market\n this.hasWseAccount = false;\n this.hasTixApiAccess = false;\n this.has4SData = false;\n this.has4SDataTixApi = false;\n\n //Gang\n this.gang = null;\n\n //Corporation\n this.corporation = null;\n\n //Bladeburner\n this.bladeburner = null;\n this.bladeburner_max_stamina_mult = 1;\n this.bladeburner_stamina_gain_mult = 1;\n this.bladeburner_analysis_mult = 1; //Field Analysis Onl;\n this.bladeburner_success_chance_mult = 1;\n\n // Sleeves & Re-sleeving\n this.sleeves = [];\n this.resleeves = [];\n this.sleevesFromCovenant = 0; // # of Duplicate sleeves purchased from the covenan;\n //bitnode\n this.bitNodeN = 1;\n\n //Used to store the last update time.\n this.lastUpdate = 0;\n this.lastSave = 0;\n this.totalPlaytime = 0;\n\n this.playtimeSinceLastAug = 0;\n this.playtimeSinceLastBitnode = 0;\n\n // Keep track of where money comes from\n this.moneySourceA = new MoneySourceTracker(); // Where money comes from since last-installed Augmentatio;\n this.moneySourceB = new MoneySourceTracker(); // Where money comes from for this entire BitNode ru;\n // Production since last Augmentation installation\n this.scriptProdSinceLastAug = 0;\n\n this.exploits = [];\n this.achievements = [];\n this.terminalCommandHistory = [];\n\n // Let's get a hash of some semi-random stuff so we have something unique.\n this.identifier = cyrb53(\n \"I-\" +\n new Date().getTime() +\n navigator.userAgent +\n window.innerWidth +\n window.innerHeight +\n getRandomInt(100, 999),\n );\n\n this.init = generalMethods.init;\n this.prestigeAugmentation = generalMethods.prestigeAugmentation;\n this.prestigeSourceFile = generalMethods.prestigeSourceFile;\n this.receiveInvite = generalMethods.receiveInvite;\n this.calculateSkill = generalMethods.calculateSkill;\n this.calculateSkillProgress = generalMethods.calculateSkillProgress;\n this.updateSkillLevels = generalMethods.updateSkillLevels;\n this.resetMultipliers = generalMethods.resetMultipliers;\n this.hasProgram = generalMethods.hasProgram;\n this.setMoney = generalMethods.setMoney;\n this.gainMoney = generalMethods.gainMoney;\n this.loseMoney = generalMethods.loseMoney;\n this.canAfford = generalMethods.canAfford;\n this.recordMoneySource = generalMethods.recordMoneySource;\n this.gainHackingExp = generalMethods.gainHackingExp;\n this.gainStrengthExp = generalMethods.gainStrengthExp;\n this.gainDefenseExp = generalMethods.gainDefenseExp;\n this.gainDexterityExp = generalMethods.gainDexterityExp;\n this.gainAgilityExp = generalMethods.gainAgilityExp;\n this.gainCharismaExp = generalMethods.gainCharismaExp;\n this.gainIntelligenceExp = generalMethods.gainIntelligenceExp;\n this.queryStatFromString = generalMethods.queryStatFromString;\n this.resetWorkStatus = generalMethods.resetWorkStatus;\n this.processWorkEarnings = generalMethods.processWorkEarnings;\n this.startWork = generalMethods.startWork;\n this.cancelationPenalty = generalMethods.cancelationPenalty;\n this.work = generalMethods.work;\n this.finishWork = generalMethods.finishWork;\n this.startWorkPartTime = generalMethods.startWorkPartTime;\n this.workPartTime = generalMethods.workPartTime;\n this.finishWorkPartTime = generalMethods.finishWorkPartTime;\n this.startFocusing = generalMethods.startFocusing;\n this.stopFocusing = generalMethods.stopFocusing;\n this.startFactionWork = generalMethods.startFactionWork;\n this.startFactionHackWork = generalMethods.startFactionHackWork;\n this.startFactionFieldWork = generalMethods.startFactionFieldWork;\n this.startFactionSecurityWork = generalMethods.startFactionSecurityWork;\n this.workForFaction = generalMethods.workForFaction;\n this.finishFactionWork = generalMethods.finishFactionWork;\n this.getWorkMoneyGain = generalMethods.getWorkMoneyGain;\n this.getWorkHackExpGain = generalMethods.getWorkHackExpGain;\n this.getWorkStrExpGain = generalMethods.getWorkStrExpGain;\n this.getWorkDefExpGain = generalMethods.getWorkDefExpGain;\n this.getWorkDexExpGain = generalMethods.getWorkDexExpGain;\n this.getWorkAgiExpGain = generalMethods.getWorkAgiExpGain;\n this.getWorkChaExpGain = generalMethods.getWorkChaExpGain;\n this.getWorkRepGain = generalMethods.getWorkRepGain;\n this.process = generalMethods.process;\n this.startCreateProgramWork = generalMethods.startCreateProgramWork;\n this.createProgramWork = generalMethods.createProgramWork;\n this.finishCreateProgramWork = generalMethods.finishCreateProgramWork;\n this.startClass = generalMethods.startClass;\n this.takeClass = generalMethods.takeClass;\n this.finishClass = generalMethods.finishClass;\n this.startCrime = generalMethods.startCrime;\n this.commitCrime = generalMethods.commitCrime;\n this.finishCrime = generalMethods.finishCrime;\n this.singularityStopWork = generalMethods.singularityStopWork;\n this.takeDamage = generalMethods.takeDamage;\n this.regenerateHp = generalMethods.regenerateHp;\n this.hospitalize = generalMethods.hospitalize;\n this.applyForJob = generalMethods.applyForJob;\n this.getNextCompanyPosition = generalMethods.getNextCompanyPosition;\n this.quitJob = generalMethods.quitJob;\n this.hasJob = generalMethods.hasJob;\n this.applyForSoftwareJob = generalMethods.applyForSoftwareJob;\n this.applyForSoftwareConsultantJob = generalMethods.applyForSoftwareConsultantJob;\n this.applyForItJob = generalMethods.applyForItJob;\n this.applyForSecurityEngineerJob = generalMethods.applyForSecurityEngineerJob;\n this.applyForNetworkEngineerJob = generalMethods.applyForNetworkEngineerJob;\n this.applyForBusinessJob = generalMethods.applyForBusinessJob;\n this.applyForBusinessConsultantJob = generalMethods.applyForBusinessConsultantJob;\n this.applyForSecurityJob = generalMethods.applyForSecurityJob;\n this.applyForAgentJob = generalMethods.applyForAgentJob;\n this.applyForEmployeeJob = generalMethods.applyForEmployeeJob;\n this.applyForPartTimeEmployeeJob = generalMethods.applyForPartTimeEmployeeJob;\n this.applyForWaiterJob = generalMethods.applyForWaiterJob;\n this.applyForPartTimeWaiterJob = generalMethods.applyForPartTimeWaiterJob;\n this.isQualified = generalMethods.isQualified;\n this.reapplyAllAugmentations = generalMethods.reapplyAllAugmentations;\n this.reapplyAllSourceFiles = generalMethods.reapplyAllSourceFiles;\n this.checkForFactionInvitations = generalMethods.checkForFactionInvitations;\n this.setBitNodeNumber = generalMethods.setBitNodeNumber;\n this.queueAugmentation = generalMethods.queueAugmentation;\n this.gainCodingContractReward = generalMethods.gainCodingContractReward;\n this.travel = generalMethods.travel;\n this.gotoLocation = generalMethods.gotoLocation;\n this.canAccessResleeving = generalMethods.canAccessResleeving;\n this.giveExploit = generalMethods.giveExploit;\n this.giveAchievement = generalMethods.giveAchievement;\n this.getIntelligenceBonus = generalMethods.getIntelligenceBonus;\n this.getCasinoWinnings = generalMethods.getCasinoWinnings;\n this.hasAugmentation = augmentationMethods.hasAugmentation;\n this.canAccessBladeburner = bladeburnerMethods.canAccessBladeburner;\n this.inBladeburner = bladeburnerMethods.inBladeburner;\n this.startBladeburner = bladeburnerMethods.startBladeburner;\n this.canAccessCorporation = corporationMethods.canAccessCorporation;\n this.hasCorporation = corporationMethods.hasCorporation;\n this.startCorporation = corporationMethods.startCorporation;\n this.canAccessGang = gangMethods.canAccessGang;\n this.getGangFaction = gangMethods.getGangFaction;\n this.getGangName = gangMethods.getGangName;\n this.hasGangWith = gangMethods.hasGangWith;\n this.inGang = gangMethods.inGang;\n this.startGang = gangMethods.startGang;\n\n this.hasTorRouter = serverMethods.hasTorRouter;\n this.getCurrentServer = serverMethods.getCurrentServer;\n this.getHomeComputer = serverMethods.getHomeComputer;\n this.getUpgradeHomeRamCost = serverMethods.getUpgradeHomeRamCost;\n this.getUpgradeHomeCoresCost = serverMethods.getUpgradeHomeCoresCost;\n this.createHacknetServer = serverMethods.createHacknetServer;\n this.factionWorkType = \"\";\n this.committingCrimeThruSingFn = false;\n this.singFnCrimeWorkerScript = null;\n\n this.getMult = generalMethods.getMult;\n this.setMult = generalMethods.setMult;\n\n this.canAccessCotMG = generalMethods.canAccessCotMG;\n this.sourceFileLvl = generalMethods.sourceFileLvl;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"PlayerObject\", this);\n }\n\n /**\n * Initiatizes a PlayerObject object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): PlayerObject {\n return Generic_fromJSON(PlayerObject, value.data);\n }\n}\n\nReviver.constructors.PlayerObject = PlayerObject;\n","import React from \"react\";\nimport { IMap } from \"../types\";\n\n/**\n * Contains the \"information\" property for all the Factions, which is just a description of each faction\n */\nexport class FactionInfo {\n /**\n * The multiplier to apply to augmentation base purchase price.\n */\n augmentationPriceMult: number;\n\n /**\n * The multiplier to apply to augmentation reputation base requirement.\n */\n augmentationRepRequirementMult: number;\n\n /**\n * The names of all other factions considered to be enemies to this faction.\n */\n enemies: string[];\n\n /**\n * The descriptive text to show on the faction's page.\n */\n infoText: JSX.Element;\n\n /**\n * A flag indicating if the faction supports field work to earn reputation.\n */\n offerFieldWork: boolean;\n\n /**\n * A flag indicating if the faction supports hacking missions to earn reputation.\n */\n offerHackingMission: boolean;\n\n /**\n * A flag indicating if the faction supports hacking work to earn reputation.\n */\n offerHackingWork: boolean;\n\n /**\n * A flag indicating if the faction supports security work to earn reputation.\n */\n offerSecurityWork: boolean;\n\n /**\n * Keep faction on install.\n */\n keep: boolean;\n\n /**\n * Special faction\n */\n special: boolean;\n\n constructor(\n infoText: JSX.Element,\n enemies: string[],\n offerHackingMission: boolean,\n offerHackingWork: boolean,\n offerFieldWork: boolean,\n offerSecurityWork: boolean,\n special: boolean,\n keep: boolean,\n ) {\n this.infoText = infoText;\n this.enemies = enemies;\n this.offerHackingMission = offerHackingMission;\n this.offerHackingWork = offerHackingWork;\n this.offerFieldWork = offerFieldWork;\n this.offerSecurityWork = offerSecurityWork;\n\n // These are always all 1 for now.\n this.augmentationPriceMult = 1;\n this.augmentationRepRequirementMult = 1;\n this.keep = keep;\n this.special = special;\n }\n\n offersWork(): boolean {\n return this.offerFieldWork || this.offerHackingMission || this.offerHackingWork || this.offerSecurityWork;\n }\n}\n\n/**\n * A map of all factions and associated info to them.\n */\n// tslint:disable-next-line:variable-name\nexport const FactionInfos: IMap<FactionInfo> = {\n // Endgame\n Illuminati: new FactionInfo(\n (\n <>\n Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And\n from this chaos, we are the invisible hand that guides them to order.{\" \"}\n </>\n ),\n [],\n true,\n true,\n true,\n false,\n false,\n false,\n ),\n\n Daedalus: new FactionInfo(\n <>Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth.</>,\n [],\n true,\n true,\n true,\n false,\n false,\n false,\n ),\n\n \"The Covenant\": new FactionInfo(\n (\n <>\n Surrender yourself. Give up your empty individuality to become part of something great, something eternal.\n Become a slave. Submit your mind, body, and soul. Only then can you set yourself free.\n <br />\n <br />\n Only then can you discover immortality.\n </>\n ),\n [],\n true,\n true,\n true,\n false,\n false,\n false,\n ),\n\n // Megacorporations, each forms its own faction\n ECorp: new FactionInfo(\n (\n <>\n ECorp's mission is simple: to connect the world of today with the technology of tomorrow. With our wide range of\n Internet-related software and commercial hardware, ECorp makes the world's information universally accessible.\n </>\n ),\n [],\n true,\n true,\n true,\n true,\n false,\n true,\n ),\n\n MegaCorp: new FactionInfo(\n (\n <>\n MegaCorp does what no other dares to do. We imagine. We create. We invent. We create what others have never even\n dreamed of. Our work fills the world's needs for food, water, power, and transportation on an unprecendented\n scale, in ways that no other company can.\n <br />\n <br />\n In our labs and factories and on the ground with customers, MegaCorp is ushering in a new era for the world.\n </>\n ),\n [],\n true,\n true,\n true,\n true,\n false,\n true,\n ),\n\n \"Bachman & Associates\": new FactionInfo(\n (\n <>\n Where Law and Business meet - thats where we are.\n <br />\n <br />\n Legal Insight - Business Instinct - Innovative Experience.\n </>\n ),\n [],\n true,\n true,\n true,\n true,\n false,\n true,\n ),\n\n \"Blade Industries\": new FactionInfo(<>Augmentation is Salvation.</>, [], true, true, true, true, false, true),\n\n NWO: new FactionInfo(\n (\n <>\n Humans don't truly desire freedom. They want to be observed, understood, and judged. They want to be given\n purpose and direction in life. That is why they created God. And that is why they created civilization - not\n because of willingness, but because of a need to be incorporated into higher orders of structure and meaning.\n </>\n ),\n [],\n true,\n true,\n true,\n true,\n false,\n true,\n ),\n\n \"Clarke Incorporated\": new FactionInfo(\n <>The Power of the Genome - Unlocked.</>,\n [],\n true,\n true,\n true,\n true,\n false,\n true,\n ),\n\n \"OmniTek Incorporated\": new FactionInfo(\n <>Simply put, our mission is to design and build robots that make a difference.</>,\n [],\n true,\n true,\n true,\n true,\n false,\n true,\n ),\n\n \"Four Sigma\": new FactionInfo(\n (\n <>\n The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven by\n deep learning and innovative ideas. And improved by iteration. That's Four Sigma.\n </>\n ),\n [],\n true,\n true,\n true,\n true,\n false,\n true,\n ),\n\n \"KuaiGong International\": new FactionInfo(\n <>Dream big. Work hard. Make history.</>,\n [],\n true,\n true,\n true,\n true,\n false,\n true,\n ),\n\n // Other Corporations\n \"Fulcrum Secret Technologies\": new FactionInfo(\n (\n <>\n The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it\n would be necessary to create them. And now we can.\n </>\n ),\n [],\n true,\n true,\n false,\n true,\n false,\n true,\n ),\n\n // Hacker groups\n BitRunners: new FactionInfo(\n (\n <>\n Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all\n transformed into bits, stored in bits, communicated through bits. It’s impossible for any person to move, to\n live, to operate at any level without the use of bits. And when a person moves, lives, and operates, they leave\n behind their bits, mere traces of seemingly meaningless fragments of information. But these bits can be\n reconstructed. Transformed. Used.\n <br />\n <br />\n Those who run the bits, run the world.\n </>\n ),\n [],\n true,\n true,\n false,\n false,\n false,\n false,\n ),\n\n \"The Black Hand\": new FactionInfo(\n (\n <>\n The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power.\n Technological power. And those at the top rule with an invisible hand. They built a society where the rich get\n richer, and everyone else suffers.\n <br />\n <br />\n So much pain. So many lives. Their darkness must end.\n </>\n ),\n [],\n true,\n true,\n true,\n false,\n false,\n false,\n ),\n\n // prettier-ignore\n NiteSec: new FactionInfo(<>\n{\" __..__ \"}<br />\n{\" _.nITESECNIt. \"}<br />\n{\" .-'NITESECNITESEc. \"}<br />\n{\" .' NITESECNITESECn \"}<br />\n{\" / NITESECNITESEC; \"}<br />\n{\" : :NITESECNITESEC; \"}<br />\n{\" ; $ NITESECNITESECN \"}<br />\n{\" : _, ,N'ITESECNITESEC \"}<br />\n{\" : .+^^`, : `NITESECNIT \"}<br />\n{\" ) /), `-,-=,NITESECNI \"}<br />\n{\" / ^ ,-;|NITESECN; \"}<br />\n{\" / _.' '-';NITESECN \"}<br />\n{\" ( , ,-''`^NITE' \"}<br />\n{\" )` :`. .' \"}<br />\n{\" )-- ; `- / \"}<br />\n{\" ' _.-' : \"}<br />\n{\" ( _.-' . \"}<br />\n{\" ------. \"}<br />\n{\" . \"}<br />\n{\" _.nIt \"}<br />\n{\" _.nITESECNi \"}<br />\n{\" nITESECNIT^' \"}<br />\n{\" NITE^' ___ \"}<br />\n{\" / .gP''''Tp. \"}<br />\n{\" : d' . `b \"}<br />\n{\" ; d' o `b ; \"}<br />\n{\" / d; `b| \"}<br />\n{\" /, $; @ `: \"}<br />\n{\" /' $/ ; \"}<br />\n{\" .' $/b o | \"}<br />\n{\" .' d$/$; : \"}<br />\n{\" / .d/$/$; , ; \"}<br />\n{\" d .dNITESEC $ | \"}<br />\n{\" :bp.__.gNITESEC/$ :$ ; \"}<br />\n{\" NITESECNITESECNIT /$b : \"}<br /></>,\n [],\n true,\n true,\n false,\n false,\n false,\n false,\n ),\n\n // City factions, essentially governments\n Aevum: new FactionInfo(\n <>The Silicon City.</>,\n [\"Chongqing\", \"New Tokyo\", \"Ishima\", \"Volhaven\"],\n true,\n true,\n true,\n true,\n false,\n false,\n ),\n Chongqing: new FactionInfo(\n <>Serve the People.</>,\n [\"Sector-12\", \"Aevum\", \"Volhaven\"],\n true,\n true,\n true,\n true,\n false,\n false,\n ),\n Ishima: new FactionInfo(\n <>The East Asian Order of the Future.</>,\n [\"Sector-12\", \"Aevum\", \"Volhaven\"],\n true,\n true,\n true,\n true,\n false,\n false,\n ),\n \"New Tokyo\": new FactionInfo(\n <>Asia's World City.</>,\n [\"Sector-12\", \"Aevum\", \"Volhaven\"],\n true,\n true,\n true,\n true,\n false,\n false,\n ),\n \"Sector-12\": new FactionInfo(\n <>The City of the Future.</>,\n [\"Chongqing\", \"New Tokyo\", \"Ishima\", \"Volhaven\"],\n true,\n true,\n true,\n true,\n false,\n false,\n ),\n Volhaven: new FactionInfo(\n <>Benefit, Honor, and Glory.</>,\n [\"Chongqing\", \"Sector-12\", \"New Tokyo\", \"Aevum\", \"Ishima\"],\n true,\n true,\n true,\n true,\n false,\n false,\n ),\n\n // Criminal Organizations/Gangs\n \"Speakers for the Dead\": new FactionInfo(\n <>It is better to reign in Hell than to serve in Heaven.</>,\n [],\n true,\n true,\n true,\n true,\n false,\n false,\n ),\n\n \"The Dark Army\": new FactionInfo(\n <>The World doesn't care about right or wrong. It only cares about power.</>,\n [],\n true,\n true,\n true,\n false,\n false,\n false,\n ),\n\n \"The Syndicate\": new FactionInfo(<>Honor holds you back.</>, [], true, true, true, true, false, false),\n\n Silhouette: new FactionInfo(\n (\n <>\n Corporations have filled the void of power left behind by the collapse of Western government. The issue is\n they've become so big that you don't know who they're working for. And if you're employed at one of these\n corporations, you don't even know who you're working for.\n <br />\n <br />\n That's terror. Terror, fear, and corruption. All born into the system, all propagated by the system.\n </>\n ),\n [],\n true,\n true,\n true,\n false,\n false,\n false,\n ),\n\n Tetrads: new FactionInfo(\n <>Following the mandate of Heaven and carrying out the way.</>,\n [],\n false,\n false,\n true,\n true,\n false,\n false,\n ),\n\n \"Slum Snakes\": new FactionInfo(<>Slum Snakes rule!</>, [], false, false, true, true, false, false),\n\n // Earlygame factions - factions the player will prestige with early on that don't belong in other categories.\n Netburners: new FactionInfo(<>{\"~~//*>H4CK||3T 8URN3R5**>?>\\\\~~\"}</>, [], true, true, false, false, false, false),\n\n \"Tian Di Hui\": new FactionInfo(<>Obey Heaven and work righteously.</>, [], true, true, false, true, false, false),\n\n CyberSec: new FactionInfo(\n (\n <>\n The Internet is the first thing that was built that we don't fully understand, the largest experiment in anarchy\n that we have ever had. And as the world becomes increasingly dominated by it, society approaches the brink of\n total chaos. We serve only to protect society, to protect humanity, to protect the world from imminent collapse.\n </>\n ),\n [],\n true,\n true,\n false,\n false,\n false,\n false,\n ),\n\n // Special Factions\n Bladeburners: new FactionInfo(\n (\n <>\n It's too bad they won't live. But then again, who does?\n <br />\n <br />\n Note that for this faction, reputation can only be gained through Bladeburner actions. Completing Bladeburner\n contracts/operations will increase your reputation.\n </>\n ),\n [],\n false,\n false,\n false,\n false,\n true,\n false,\n ),\n\n // prettier-ignore\n \"Church of the Machine God\": new FactionInfo(<>\n {\" `` \"}<br />\n {\" -odmmNmds: \"}<br />\n {\" `hNmo:..-omNh. \"}<br />\n {\" yMd` `hNh \"}<br />\n {\" mMd oNm \"}<br />\n {\" oMNo .mM/ \"}<br />\n {\" `dMN+ -mM+ \"}<br />\n {\" -mMNo -mN+ \"}<br />\n {\" .+- :mMNo/mN/ \"}<br />\n {\":yNMd. :NMNNN/ \"}<br />\n {\"-mMMMh. /NMMh` \"}<br />\n {\" .dMMMd. /NMMMy` \"}<br />\n {\" `yMMMd. /NNyNMMh` \"}<br />\n {\" `sMMMd. +Nm: +NMMh. \"}<br />\n {\" oMMMm- oNm: /NMMd. \"}<br />\n {\" +NMMmsMm- :mMMd. \"}<br />\n {\" /NMMMm- -mMMd. \"}<br />\n {\" /MMMm- -mMMd. \"}<br />\n {\" `sMNMMm- .mMmo \"}<br />\n {\" `sMd:hMMm. ./. \"}<br />\n {\" `yMy` `yNMd` \"}<br />\n {\" `hMs` oMMy \"}<br />\n {\" `hMh sMN- \"}<br />\n {\" /MM- .NMo \"}<br />\n {\" +MM: :MM+ \"}<br />\n {\" sNNo-.`.-omNy` \"}<br />\n {\" -smNNNNmdo- \"}<br />\n {\" `..` \"}<br /><br />\n Many cultures predict an end to humanity in the near future, a final\n Armageddon that will end the world; but we disagree.\n <br /><br />Note that for this faction, reputation can \n only be gained by charging Stanek's gift.</>,\n [],\n false,\n false,\n false,\n false,\n true,\n true,\n ),\n};\n","import React, { useState, useEffect } from \"react\";\nimport { joinFaction } from \"../FactionHelpers\";\nimport { Faction } from \"../Faction\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const InvitationEvent = new EventEmitter<[Faction]>();\n\nexport function InvitationModal(): React.ReactElement {\n const [faction, setFaction] = useState<Faction | null>(null);\n const player = use.Player();\n function join(): void {\n if (faction === null) return;\n //Remove from invited factions\n const i = player.factionInvitations.findIndex((facName) => facName === faction.name);\n if (i === -1) {\n console.error(\"Could not find faction in Player.factionInvitations\");\n }\n joinFaction(faction);\n setFaction(null);\n }\n\n useEffect(() => InvitationEvent.subscribe((faction) => setFaction(faction)), []);\n\n return (\n <Modal open={faction !== null} onClose={() => setFaction(null)}>\n <Typography variant=\"h4\">You have received a faction invitation.</Typography>\n <Typography>\n Would you like to join {(faction || { name: \"\" }).name}? <br />\n <br />\n Warning: Joining this faction may prevent you from joining other factions during this run!\n </Typography>\n <Button onClick={join}>Join!</Button>\n <Button onClick={() => setFaction(null)}>Decide later</Button>\n </Modal>\n );\n}\n","import { Literatures } from \"./Literatures\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nexport function showLiterature(fn: string): void {\n const litObj = Literatures[fn];\n if (litObj == null) {\n return;\n }\n const txt = `<i>${litObj.title}</i><br><br>${litObj.txt}`;\n dialogBoxCreate(txt);\n}\n","import { ITaskParams, ITerritory } from \"./ITaskParams\";\n\nexport class GangMemberTask {\n name: string;\n desc: string;\n\n isHacking: boolean;\n isCombat: boolean;\n\n baseRespect: number;\n baseWanted: number;\n baseMoney: number;\n\n hackWeight: number;\n strWeight: number;\n defWeight: number;\n dexWeight: number;\n agiWeight: number;\n chaWeight: number;\n\n difficulty: number;\n\n territory: ITerritory;\n\n // Defines tasks that Gang Members can work on\n constructor(name: string, desc: string, isHacking: boolean, isCombat: boolean, params: ITaskParams) {\n this.name = name;\n this.desc = desc;\n\n // Flags that describe whether this Task is applicable for Hacking/Combat gangs\n this.isHacking = isHacking;\n this.isCombat = isCombat;\n\n // Base gain rates for respect/wanted/money\n this.baseRespect = params.baseRespect ? params.baseRespect : 0;\n this.baseWanted = params.baseWanted ? params.baseWanted : 0;\n this.baseMoney = params.baseMoney ? params.baseMoney : 0;\n\n // Weighting for the effect that each stat has on the tasks effectiveness.\n // Weights must add up to 100\n this.hackWeight = params.hackWeight ? params.hackWeight : 0;\n this.strWeight = params.strWeight ? params.strWeight : 0;\n this.defWeight = params.defWeight ? params.defWeight : 0;\n this.dexWeight = params.dexWeight ? params.dexWeight : 0;\n this.agiWeight = params.agiWeight ? params.agiWeight : 0;\n this.chaWeight = params.chaWeight ? params.chaWeight : 0;\n\n if (\n Math.round(\n this.hackWeight + this.strWeight + this.defWeight + this.dexWeight + this.agiWeight + this.chaWeight,\n ) != 100\n ) {\n console.error(`GangMemberTask ${this.name} weights do not add up to 100`);\n }\n\n // 1 - 100\n this.difficulty = params.difficulty ? params.difficulty : 1;\n\n // Territory Factors. Exponential factors that dictate how territory affects gains\n // Formula: Territory Mutiplier = (Territory * 100) ^ factor / 100\n // So factor should be > 1 if something should scale exponentially with territory\n // and should be < 1 if it should have diminshing returns\n this.territory = params.territory ? params.territory : { money: 1, respect: 1, wanted: 1 };\n }\n}\n","export class PlayerOwnedSourceFile {\n // Source-File level\n lvl = 1;\n\n // Source-File number\n n = 1;\n\n constructor(n: number, level: number) {\n this.n = n;\n this.lvl = level;\n }\n}\n\nexport interface IPlayerOwnedSourceFile {\n lvl: number;\n n: number;\n}\n","import { RunningScript } from \"src/Script/RunningScript\";\nimport { WorkerScript } from \"./WorkerScript\";\n\nexport const recentScripts: RecentScript[] = [];\n\nexport function AddRecentScript(workerScript: WorkerScript): void {\n if (recentScripts.find((r) => r.pid === workerScript.pid)) return;\n recentScripts.unshift({\n filename: workerScript.name,\n args: workerScript.args,\n pid: workerScript.pid,\n timestamp: new Date(),\n\n runningScript: workerScript.scriptRef,\n });\n while (recentScripts.length > 50) {\n recentScripts.pop();\n }\n}\n\nexport interface RecentScript {\n filename: string;\n args: string[];\n pid: number;\n timestamp: Date;\n runningScript: RunningScript;\n}\n","import * as acorn from \"acorn\";\n/**\n * @license\n * JavaScript Interpreter\n *\n * Copyright 2013 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Interpreting JavaScript in JavaScript.\n * @author fraser@google.com (Neil Fraser)\n */\n(\"use strict\");\n\n/**\n * Create a new interpreter.\n * @param {string|!Object} code Raw JavaScript text or AST.\n * @param {Function=} opt_initFunc Optional initialization function. Used to\n * define APIs. When called it is passed the interpreter object and the\n * global scope object.\n * @param {Number} Bitburner-specific number used for determining exception line numbers\n * @constructor\n */\nvar Interpreter = function (code, opt_initFunc, lineOffset = 0) {\n this.sourceCode = code;\n this.sourceCodeLineOffset = lineOffset;\n if (typeof code === \"string\") {\n code = acorn.parse(code, Interpreter.PARSE_OPTIONS);\n }\n this.ast = code;\n this.initFunc_ = opt_initFunc;\n this.paused_ = false;\n this.polyfills_ = [];\n // Unique identifier for native functions. Used in serialization.\n this.functionCounter_ = 0;\n // Map node types to our step function names; a property lookup is faster\n // than string concatenation with \"step\" prefix.\n this.stepFunctions_ = Object.create(null);\n var stepMatch = /^step([A-Z]\\w*)$/;\n var m;\n for (var methodName in this) {\n if (typeof this[methodName] === \"function\" && (m = methodName.match(stepMatch))) {\n this.stepFunctions_[m[1]] = this[methodName].bind(this);\n }\n }\n // Create and initialize the global scope.\n this.global = this.createScope(this.ast, null);\n // Run the polyfills.\n this.ast = acorn.parse(this.polyfills_.join(\"\\n\"), Interpreter.PARSE_OPTIONS);\n this.polyfills_ = undefined; // Allow polyfill strings to garbage collect.\n this.stripLocations_(this.ast, undefined, undefined);\n var state = new Interpreter.State(this.ast, this.global);\n state.done = false;\n this.stateStack = [state];\n this.run();\n this.value = undefined;\n // Point at the main program.\n this.ast = code;\n var state = new Interpreter.State(this.ast, this.global);\n state.done = false;\n this.stateStack.length = 0;\n this.stateStack[0] = state;\n // Get a handle on Acorn's node_t object. It's tricky to access.\n this.nodeConstructor = state.node.constructor;\n // Preserve publicly properties from being pruned/renamed by JS compilers.\n // Add others as needed.\n this[\"stateStack\"] = this.stateStack;\n};\n\n/**\n * @const {!Object} Configuration used for all Acorn parsing.\n */\nInterpreter.PARSE_OPTIONS = {\n ecmaVersion: 5,\n locations: true,\n};\n\n/**\n * Property descriptor of readonly properties.\n */\nInterpreter.READONLY_DESCRIPTOR = {\n configurable: true,\n enumerable: true,\n writable: false,\n};\n\n/**\n * Property descriptor of non-enumerable properties.\n */\nInterpreter.NONENUMERABLE_DESCRIPTOR = {\n configurable: true,\n enumerable: false,\n writable: true,\n};\n\n/**\n * Property descriptor of readonly, non-enumerable properties.\n */\nInterpreter.READONLY_NONENUMERABLE_DESCRIPTOR = {\n configurable: true,\n enumerable: false,\n writable: false,\n};\n\n/**\n * Property descriptor of variables.\n */\nInterpreter.VARIABLE_DESCRIPTOR = {\n configurable: false,\n enumerable: true,\n writable: true,\n};\n\n/**\n * Unique symbol for indicating that a step has encountered an error, has\n * added it to the stack, and will be thrown within the user's program.\n * When STEP_ERROR is thrown in the JS-Interpreter, the error can be ignored.\n */\nInterpreter.STEP_ERROR = {};\n\n/**\n * Unique symbol for indicating that a reference is a variable on the scope,\n * not an object property.\n */\nInterpreter.SCOPE_REFERENCE = {};\n\n/**\n * Unique symbol for indicating, when used as the value of the value\n * parameter in calls to setProperty and friends, that the value\n * should be taken from the property descriptor instead.\n */\nInterpreter.VALUE_IN_DESCRIPTOR = {};\n\n/**\n * For cycle detection in array to string and error conversion;\n * see spec bug github.com/tc39/ecma262/issues/289\n * Since this is for atomic actions only, it can be a class property.\n */\nInterpreter.toStringCycles_ = [];\n\n/**\n * Determine error/exception line number in Bitburner source code\n * @param {Object} AST Node that causes Error/Exception\n */\nInterpreter.prototype.getErrorLineNumber = function (node) {\n var code = this.sourceCode;\n if (node == null || node.start == null) {\n return NaN;\n }\n try {\n code = code.substring(0, node.start);\n return (code.match(/\\n/g) || []).length + 1 - this.sourceCodeLineOffset;\n } catch (e) {\n return NaN;\n }\n};\n\n/**\n * Generate the appropriate line number error message for Bitburner\n * @param {Number} lineNumber\n */\nInterpreter.prototype.getErrorLineNumberMessage = function (lineNumber) {\n if (isNaN(lineNumber)) {\n return \" (Unknown line number)\";\n } else if (lineNumber <= 0) {\n return \" (Error occurred in an imported function)\";\n } else {\n return (\n \" (Line Number \" +\n lineNumber +\n \". This line number is probably incorrect \" +\n \"if your script is importing any functions. This is being worked on)\"\n );\n }\n};\n\n/**\n * Add more code to the interpreter.\n * @param {string|!Object} code Raw JavaScript text or AST.\n */\nInterpreter.prototype.appendCode = function (code) {\n var state = this.stateStack[0];\n if (!state || state.node[\"type\"] !== \"Program\") {\n throw Error(\"Expecting original AST to start with a Program node.\");\n }\n if (typeof code === \"string\") {\n code = acorn.parse(code, Interpreter.PARSE_OPTIONS);\n }\n if (!code || code[\"type\"] !== \"Program\") {\n throw Error(\"Expecting new AST to start with a Program node.\");\n }\n this.populateScope_(code, state.scope);\n // Append the new program to the old one.\n for (var i = 0, node; (node = code[\"body\"][i]); i++) {\n state.node[\"body\"].push(node);\n }\n state.done = false;\n};\n\n/**\n * Execute one step of the interpreter.\n * @return {boolean} True if a step was executed, false if no more instructions.\n */\nInterpreter.prototype.step = function () {\n var stack = this.stateStack;\n var state = stack[stack.length - 1];\n if (!state) {\n return false;\n }\n var node = state.node,\n type = node[\"type\"];\n if (type === \"Program\" && state.done) {\n return false;\n } else if (this.paused_) {\n return true;\n }\n try {\n var nextState = this.stepFunctions_[type](stack, state, node);\n } catch (e) {\n // Eat any step errors. They have been thrown on the stack.\n if (e !== Interpreter.STEP_ERROR) {\n // Uh oh. This is a real error in the JS-Interpreter. Rethrow.\n throw e;\n }\n }\n if (nextState) {\n stack.push(nextState);\n }\n if (!node[\"end\"]) {\n // This is polyfill code. Keep executing until we arrive at user code.\n return this.step();\n }\n return true;\n};\n\n/**\n * Execute the interpreter to program completion. Vulnerable to infinite loops.\n * @return {boolean} True if a execution is asynchronously blocked,\n * false if no more instructions.\n */\nInterpreter.prototype.run = function () {\n while (!this.paused_ && this.step()) {}\n return this.paused_;\n};\n\n/**\n * Initialize the global scope with buitin properties and functions.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initGlobalScope = function (scope) {\n // Initialize uneditable global properties.\n this.setProperty(scope, \"NaN\", NaN, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"Infinity\", Infinity, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"undefined\", undefined, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"window\", scope, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"this\", scope, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"self\", scope); // Editable.\n\n // Create the objects which will become Object.prototype and\n // Function.prototype, which are needed to bootstrap everything else.\n this.OBJECT_PROTO = new Interpreter.Object(null);\n this.FUNCTION_PROTO = new Interpreter.Object(this.OBJECT_PROTO);\n // Initialize global objects.\n this.initFunction(scope);\n this.initObject(scope);\n // Unable to set scope's parent prior (OBJECT did not exist).\n // Note that in a browser this would be 'Window', whereas in Node.js it would\n // be 'Object'. This interpreter is closer to Node in that it has no DOM.\n scope.proto = this.OBJECT_PROTO;\n this.setProperty(scope, \"constructor\", this.OBJECT, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.initArray(scope);\n this.initString(scope);\n this.initBoolean(scope);\n this.initNumber(scope);\n this.initDate(scope);\n this.initRegExp(scope);\n this.initError(scope);\n this.initMath(scope);\n this.initJSON(scope);\n\n // Initialize global functions.\n var thisInterpreter = this;\n var func = this.createNativeFunction(function (x) {\n throw EvalError(\"Can't happen\");\n }, false);\n func.eval = true;\n this.setProperty(scope, \"eval\", func);\n\n this.setProperty(scope, \"parseInt\", this.createNativeFunction(parseInt, false));\n this.setProperty(scope, \"parseFloat\", this.createNativeFunction(parseFloat, false));\n\n this.setProperty(scope, \"isNaN\", this.createNativeFunction(isNaN, false));\n\n this.setProperty(scope, \"isFinite\", this.createNativeFunction(isFinite, false));\n\n var strFunctions = [\n [escape, \"escape\"],\n [unescape, \"unescape\"],\n [decodeURI, \"decodeURI\"],\n [decodeURIComponent, \"decodeURIComponent\"],\n [encodeURI, \"encodeURI\"],\n [encodeURIComponent, \"encodeURIComponent\"],\n ];\n for (var i = 0; i < strFunctions.length; i++) {\n var wrapper = (function (nativeFunc) {\n return function (str) {\n try {\n return nativeFunc(str);\n } catch (e) {\n // decodeURI('%xy') will throw an error. Catch and rethrow.\n thisInterpreter.throwException(thisInterpreter.URI_ERROR, e.message);\n }\n };\n })(strFunctions[i][0]);\n this.setProperty(\n scope,\n strFunctions[i][1],\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n }\n // Preserve publicly properties from being pruned/renamed by JS compilers.\n // Add others as needed.\n this[\"OBJECT\"] = this.OBJECT;\n this[\"OBJECT_PROTO\"] = this.OBJECT_PROTO;\n this[\"FUNCTION\"] = this.FUNCTION;\n this[\"FUNCTION_PROTO\"] = this.FUNCTION_PROTO;\n this[\"ARRAY\"] = this.ARRAY;\n this[\"ARRAY_PROTO\"] = this.ARRAY_PROTO;\n this[\"REGEXP\"] = this.REGEXP;\n this[\"REGEXP_PROTO\"] = this.REGEXP_PROTO;\n this[\"DATE\"] = this.DATE;\n this[\"DATE_PROTO\"] = this.DATE_PROTO;\n // The following properties are obsolete. Do not use.\n this[\"UNDEFINED\"] = undefined;\n this[\"NULL\"] = null;\n this[\"NAN\"] = NaN;\n this[\"TRUE\"] = true;\n this[\"FALSE\"] = false;\n this[\"STRING_EMPTY\"] = \"\";\n this[\"NUMBER_ZERO\"] = 0;\n this[\"NUMBER_ONE\"] = 1;\n\n // Run any user-provided initialization.\n if (this.initFunc_) {\n this.initFunc_(this, scope);\n }\n};\n\n/**\n * Initialize the Function class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initFunction = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n var identifierRegexp = /^[A-Za-z_$][\\w$]*$/;\n // Function constructor.\n wrapper = function (var_args) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Function().\n var newFunc = this;\n } else {\n // Called as Function().\n var newFunc = thisInterpreter.createObjectProto(thisInterpreter.FUNCTION_PROTO);\n }\n if (arguments.length) {\n var code = String(arguments[arguments.length - 1]);\n } else {\n var code = \"\";\n }\n var argsStr = Array.prototype.slice.call(arguments, 0, -1).join(\",\").trim();\n if (argsStr) {\n var args = argsStr.split(/\\s*,\\s*/);\n for (var i = 0; i < args.length; i++) {\n var name = args[i];\n if (!identifierRegexp.test(name)) {\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid function argument: \" + name);\n }\n }\n argsStr = args.join(\", \");\n }\n // Interestingly, the scope for constructed functions is the global scope,\n // even if they were constructed in some other scope.\n newFunc.parentScope = thisInterpreter.global;\n // Acorn needs to parse code in the context of a function or else 'return'\n // statements will be syntax errors.\n try {\n var ast = acorn.parse(\"(function(\" + argsStr + \") {\" + code + \"})\", Interpreter.PARSE_OPTIONS);\n } catch (e) {\n // Acorn threw a SyntaxError. Rethrow as a trappable error.\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid code: \" + e.message);\n }\n if (ast[\"body\"].length !== 1) {\n // Function('a', 'return a + 6;}; {alert(1);');\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid code in function body.\");\n }\n newFunc.node = ast[\"body\"][0][\"expression\"];\n thisInterpreter.setProperty(newFunc, \"length\", newFunc.node[\"length\"], Interpreter.READONLY_DESCRIPTOR);\n return newFunc;\n };\n wrapper.id = this.functionCounter_++;\n this.FUNCTION = this.createObjectProto(this.FUNCTION_PROTO);\n\n this.setProperty(scope, \"Function\", this.FUNCTION);\n // Manually setup type and prototype because createObj doesn't recognize\n // this object as a function (this.FUNCTION did not exist).\n this.setProperty(this.FUNCTION, \"prototype\", this.FUNCTION_PROTO);\n this.FUNCTION.nativeFunc = wrapper;\n\n // Configure Function.prototype.\n this.setProperty(this.FUNCTION_PROTO, \"constructor\", this.FUNCTION, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.FUNCTION_PROTO.nativeFunc = function () {};\n this.FUNCTION_PROTO.nativeFunc.id = this.functionCounter_++;\n this.setProperty(this.FUNCTION_PROTO, \"length\", 0, Interpreter.READONLY_DESCRIPTOR);\n\n var boxThis = function (value) {\n // In non-strict mode 'this' must be an object.\n if ((!value || !value.isObject) && !thisInterpreter.getScope().strict) {\n if (value === undefined || value === null) {\n // 'Undefined' and 'null' are changed to global object.\n value = thisInterpreter.global;\n } else {\n // Primitives must be boxed in non-strict mode.\n var box = thisInterpreter.createObjectProto(thisInterpreter.getPrototype(value));\n box.data = value;\n value = box;\n }\n }\n return value;\n };\n\n wrapper = function (thisArg, args) {\n var state = thisInterpreter.stateStack[thisInterpreter.stateStack.length - 1];\n // Rewrite the current 'CallExpression' to apply a different function.\n state.func_ = this;\n // Assign the 'this' object.\n state.funcThis_ = boxThis(thisArg);\n // Bind any provided arguments.\n state.arguments_ = [];\n if (args !== null && args !== undefined) {\n if (args.isObject) {\n state.arguments_ = thisInterpreter.arrayPseudoToNative(args);\n } else {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"CreateListFromArrayLike called on non-object\");\n }\n }\n state.doneExec_ = false;\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"apply\", wrapper);\n\n wrapper = function (thisArg /*, var_args */) {\n var state = thisInterpreter.stateStack[thisInterpreter.stateStack.length - 1];\n // Rewrite the current 'CallExpression' to call a different function.\n state.func_ = this;\n // Assign the 'this' object.\n state.funcThis_ = boxThis(thisArg);\n // Bind any provided arguments.\n state.arguments_ = [];\n for (var i = 1; i < arguments.length; i++) {\n state.arguments_.push(arguments[i]);\n }\n state.doneExec_ = false;\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"call\", wrapper);\n\n this.polyfills_.push(\n // Polyfill copied from:\n // developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_objects/Function/bind\n \"Object.defineProperty(Function.prototype, 'bind',\",\n \"{configurable: true, writable: true, value:\",\n \"function(oThis) {\",\n \"if (typeof this !== 'function') {\",\n \"throw TypeError('What is trying to be bound is not callable');\",\n \"}\",\n \"var aArgs = Array.prototype.slice.call(arguments, 1),\",\n \"fToBind = this,\",\n \"fNOP = function() {},\",\n \"fBound = function() {\",\n \"return fToBind.apply(this instanceof fNOP\",\n \"? this\",\n \": oThis,\",\n \"aArgs.concat(Array.prototype.slice.call(arguments)));\",\n \"};\",\n \"if (this.prototype) {\",\n \"fNOP.prototype = this.prototype;\",\n \"}\",\n \"fBound.prototype = new fNOP();\",\n \"return fBound;\",\n \"}\",\n \"});\",\n \"\",\n );\n\n // Function has no parent to inherit from, so it needs its own mandatory\n // toString and valueOf functions.\n wrapper = function () {\n return this.toString();\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"toString\", wrapper);\n this.setProperty(\n this.FUNCTION,\n \"toString\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n wrapper = function () {\n return this.valueOf();\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"valueOf\", wrapper);\n this.setProperty(\n this.FUNCTION,\n \"valueOf\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n};\n\n/**\n * Initialize the Object class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initObject = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Object constructor.\n wrapper = function (value) {\n if (value === undefined || value === null) {\n // Create a new object.\n if (thisInterpreter.calledWithNew()) {\n // Called as new Object().\n return this;\n } else {\n // Called as Object().\n return thisInterpreter.createObjectProto(thisInterpreter.OBJECT_PROTO);\n }\n }\n if (!value.isObject) {\n // Wrap the value as an object.\n var box = thisInterpreter.createObjectProto(thisInterpreter.getPrototype(value));\n box.data = value;\n return box;\n }\n // Return the provided object.\n return value;\n };\n this.OBJECT = this.createNativeFunction(wrapper, true);\n // Throw away the created prototype and use the root prototype.\n this.setProperty(this.OBJECT, \"prototype\", this.OBJECT_PROTO);\n this.setProperty(this.OBJECT_PROTO, \"constructor\", this.OBJECT, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(scope, \"Object\", this.OBJECT);\n\n /**\n * Checks if the provided value is null or undefined.\n * If so, then throw an error in the call stack.\n * @param {Interpreter.Value} value Value to check.\n */\n var throwIfNullUndefined = function (value) {\n if (value === undefined || value === null) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Cannot convert '\" + value + \"' to object\");\n }\n };\n\n // Static methods on Object.\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n var props = obj.isObject ? obj.properties : obj;\n return thisInterpreter.arrayNativeToPseudo(Object.getOwnPropertyNames(props));\n };\n this.setProperty(\n this.OBJECT,\n \"getOwnPropertyNames\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n if (obj.isObject) {\n obj = obj.properties;\n }\n return thisInterpreter.arrayNativeToPseudo(Object.keys(obj));\n };\n this.setProperty(\n this.OBJECT,\n \"keys\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (proto) {\n // Support for the second argument is the responsibility of a polyfill.\n if (proto === null) {\n return thisInterpreter.createObjectProto(null);\n }\n if (proto === undefined || !proto.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Object prototype may only be an Object or null\");\n }\n return thisInterpreter.createObjectProto(proto);\n };\n this.setProperty(\n this.OBJECT,\n \"create\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Add a polyfill to handle create's second argument.\n this.polyfills_.push(\n \"(function() {\",\n \"var create_ = Object.create;\",\n \"Object.create = function(proto, props) {\",\n \"var obj = create_(proto);\",\n \"props && Object.defineProperties(obj, props);\",\n \"return obj;\",\n \"};\",\n \"})();\",\n \"\",\n );\n\n wrapper = function (obj, prop, descriptor) {\n prop = String(prop);\n if (!obj || !obj.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Object.defineProperty called on non-object\");\n }\n if (!descriptor || !descriptor.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Property description must be an object\");\n }\n if (!obj.properties[prop] && obj.preventExtensions) {\n thisInterpreter.throwException(\n thisInterpreter.TYPE_ERROR,\n \"Can't define property '\" + prop + \"', object is not extensible\",\n );\n }\n // The polyfill guarantees no inheritance and no getter functions.\n // Therefore the descriptor properties map is the native object needed.\n thisInterpreter.setProperty(obj, prop, Interpreter.VALUE_IN_DESCRIPTOR, descriptor.properties);\n return obj;\n };\n this.setProperty(\n this.OBJECT,\n \"defineProperty\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n this.polyfills_.push(\n // Flatten the descriptor to remove any inheritance or getter functions.\n \"(function() {\",\n \"var defineProperty_ = Object.defineProperty;\",\n \"Object.defineProperty = function(obj, prop, d1) {\",\n \"var d2 = {};\",\n \"if ('configurable' in d1) d2.configurable = d1.configurable;\",\n \"if ('enumerable' in d1) d2.enumerable = d1.enumerable;\",\n \"if ('writable' in d1) d2.writable = d1.writable;\",\n \"if ('value' in d1) d2.value = d1.value;\",\n \"if ('get' in d1) d2.get = d1.get;\",\n \"if ('set' in d1) d2.set = d1.set;\",\n \"return defineProperty_(obj, prop, d2);\",\n \"};\",\n \"})();\",\n\n \"Object.defineProperty(Object, 'defineProperties',\",\n \"{configurable: true, writable: true, value:\",\n \"function(obj, props) {\",\n \"var keys = Object.keys(props);\",\n \"for (var i = 0; i < keys.length; i++) {\",\n \"Object.defineProperty(obj, keys[i], props[keys[i]]);\",\n \"}\",\n \"return obj;\",\n \"}\",\n \"});\",\n \"\",\n );\n\n wrapper = function (obj, prop) {\n if (!obj || !obj.isObject) {\n thisInterpreter.throwException(\n thisInterpreter.TYPE_ERROR,\n \"Object.getOwnPropertyDescriptor called on non-object\",\n );\n }\n prop = String(prop);\n if (!(prop in obj.properties)) {\n return undefined;\n }\n var descriptor = Object.getOwnPropertyDescriptor(obj.properties, prop);\n var getter = obj.getter[prop];\n var setter = obj.setter[prop];\n\n if (getter || setter) {\n descriptor.get = getter;\n descriptor.set = setter;\n delete descriptor.value;\n delete descriptor.writable;\n }\n // Preserve value, but remove it for the nativeToPseudo call.\n var value = descriptor.value;\n var hasValue = \"value\" in descriptor;\n delete descriptor.value;\n var pseudoDescriptor = thisInterpreter.nativeToPseudo(descriptor);\n if (hasValue) {\n thisInterpreter.setProperty(pseudoDescriptor, \"value\", value);\n }\n return pseudoDescriptor;\n };\n this.setProperty(\n this.OBJECT,\n \"getOwnPropertyDescriptor\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n return thisInterpreter.getPrototype(obj);\n };\n this.setProperty(\n this.OBJECT,\n \"getPrototypeOf\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n return Boolean(obj) && !obj.preventExtensions;\n };\n this.setProperty(\n this.OBJECT,\n \"isExtensible\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n if (obj && obj.isObject) {\n obj.preventExtensions = true;\n }\n return obj;\n };\n this.setProperty(\n this.OBJECT,\n \"preventExtensions\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on Object.\n this.setNativeFunctionPrototype(this.OBJECT, \"toString\", Interpreter.Object.prototype.toString);\n this.setNativeFunctionPrototype(this.OBJECT, \"toLocaleString\", Interpreter.Object.prototype.toString);\n this.setNativeFunctionPrototype(this.OBJECT, \"valueOf\", Interpreter.Object.prototype.valueOf);\n\n wrapper = function (prop) {\n throwIfNullUndefined(this);\n if (!this.isObject) {\n return this.hasOwnProperty(prop);\n }\n return String(prop) in this.properties;\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"hasOwnProperty\", wrapper);\n\n wrapper = function (prop) {\n throwIfNullUndefined(this);\n if (!this.isObject) {\n return this.propertyIsEnumerable(prop);\n }\n return Object.prototype.propertyIsEnumerable.call(this.properties, prop);\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"propertyIsEnumerable\", wrapper);\n\n wrapper = function (obj) {\n while (true) {\n // Note, circular loops shouldn't be possible.\n obj = thisInterpreter.getPrototype(obj);\n if (!obj) {\n // No parent; reached the top.\n return false;\n }\n if (obj === this) {\n return true;\n }\n }\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"isPrototypeOf\", wrapper);\n};\n\n/**\n * Initialize the Array class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initArray = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Array constructor.\n wrapper = function (var_args) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Array().\n var newArray = this;\n } else {\n // Called as Array().\n var newArray = thisInterpreter.createObjectProto(thisInterpreter.ARRAY_PROTO);\n }\n var first = arguments[0];\n if (arguments.length === 1 && typeof first === \"number\") {\n if (isNaN(Interpreter.legalArrayLength(first))) {\n thisInterpreter.throwException(thisInterpreter.RANGE_ERROR, \"Invalid array length\");\n }\n newArray.properties.length = first;\n } else {\n for (var i = 0; i < arguments.length; i++) {\n newArray.properties[i] = arguments[i];\n }\n newArray.properties.length = i;\n }\n return newArray;\n };\n this.ARRAY = this.createNativeFunction(wrapper, true);\n this.ARRAY_PROTO = this.ARRAY.properties[\"prototype\"];\n this.setProperty(scope, \"Array\", this.ARRAY);\n\n // Static methods on Array.\n wrapper = function (obj) {\n return obj && obj.class === \"Array\";\n };\n this.setProperty(\n this.ARRAY,\n \"isArray\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on Array.\n wrapper = function () {\n return Array.prototype.pop.call(this.properties);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"pop\", wrapper);\n\n wrapper = function (var_args) {\n return Array.prototype.push.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"push\", wrapper);\n\n wrapper = function () {\n return Array.prototype.shift.call(this.properties);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"shift\", wrapper);\n\n wrapper = function (var_args) {\n return Array.prototype.unshift.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"unshift\", wrapper);\n\n wrapper = function () {\n Array.prototype.reverse.call(this.properties);\n return this;\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"reverse\", wrapper);\n\n wrapper = function (index, howmany /*, var_args*/) {\n var list = Array.prototype.splice.apply(this.properties, arguments);\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"splice\", wrapper);\n\n wrapper = function (opt_begin, opt_end) {\n var list = Array.prototype.slice.call(this.properties, opt_begin, opt_end);\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"slice\", wrapper);\n\n wrapper = function (opt_separator) {\n return Array.prototype.join.call(this.properties, opt_separator);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"join\", wrapper);\n\n wrapper = function (var_args) {\n var list = [];\n var length = 0;\n // Start by copying the current array.\n var iLength = thisInterpreter.getProperty(this, \"length\");\n for (var i = 0; i < iLength; i++) {\n if (thisInterpreter.hasProperty(this, i)) {\n var element = thisInterpreter.getProperty(this, i);\n list[length] = element;\n }\n length++;\n }\n // Loop through all arguments and copy them in.\n for (var i = 0; i < arguments.length; i++) {\n var value = arguments[i];\n if (thisInterpreter.isa(value, thisInterpreter.ARRAY)) {\n var jLength = thisInterpreter.getProperty(value, \"length\");\n for (var j = 0; j < jLength; j++) {\n if (thisInterpreter.hasProperty(value, j)) {\n list[length] = thisInterpreter.getProperty(value, j);\n }\n length++;\n }\n } else {\n list[length] = value;\n }\n }\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"concat\", wrapper);\n\n wrapper = function (searchElement, opt_fromIndex) {\n return Array.prototype.indexOf.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"indexOf\", wrapper);\n\n wrapper = function (searchElement, opt_fromIndex) {\n return Array.prototype.lastIndexOf.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"lastIndexOf\", wrapper);\n\n wrapper = function () {\n Array.prototype.sort.call(this.properties);\n return this;\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"sort\", wrapper);\n\n this.polyfills_.push(\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/every\n \"Object.defineProperty(Array.prototype, 'every',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callbackfn, thisArg) {\",\n \"if (!this || typeof callbackfn !== 'function') throw TypeError();\",\n \"var T, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O && !callbackfn.call(T, O[k], k, O)) return false;\",\n \"k++;\",\n \"}\",\n \"return true;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\n \"Object.defineProperty(Array.prototype, 'filter',\",\n \"{configurable: true, writable: true, value:\",\n \"function(fun/*, thisArg*/) {\",\n \"if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();\",\n \"var t = Object(this);\",\n \"var len = t.length >>> 0;\",\n \"var res = [];\",\n \"var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\",\n \"for (var i = 0; i < len; i++) {\",\n \"if (i in t) {\",\n \"var val = t[i];\",\n \"if (fun.call(thisArg, val, i, t)) res.push(val);\",\n \"}\",\n \"}\",\n \"return res;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // https://tc39.github.io/ecma262/#sec-array.prototype.find\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n \"if (!Array.prototype.find) {\",\n \"Object.defineProperty(Array.prototype, 'find', {\",\n \"value: function(predicate) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"var o = Object(this);\",\n \"var len = o.length >>> 0;\",\n \"if (typeof predicate !== 'function') {\",\n \"throw new TypeError('predicate must be a function');\",\n \"}\",\n \"var thisArg = arguments[1];\",\n \"var k = 0;\",\n \"while (k < len) {\",\n \"var kValue = o[k];\",\n \"if (predicate.call(thisArg, kValue, k, o)) {\",\n \"return kValue;\",\n \"}\",\n \"k++;\",\n \"}\",\n \"return undefined;\",\n \"},\",\n \"configurable: true,\",\n \"writable: true\",\n \"});\",\n \"}\",\n\n // Poly fill copied from:\n // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex\n \"if (!Array.prototype.findIndex) {\",\n \"Object.defineProperty(Array.prototype, 'findIndex', {\",\n \"value: function(predicate) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"var o = Object(this);\",\n \"var len = o.length >>> 0;\",\n \"if (typeof predicate !== 'function') {\",\n \"throw new TypeError('predicate must be a function');\",\n \"}\",\n \"var thisArg = arguments[1];\",\n \"var k = 0;\",\n \"while (k < len) {\",\n \"var kValue = o[k];\",\n \"if (predicate.call(thisArg, kValue, k, o)) {\",\n \"return k;\",\n \"}\",\n \"k++;\",\n \"}\",\n \"return -1;\",\n \"},\",\n \"configurable: true,\",\n \"writable: true\",\n \"});\",\n \"}\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\n \"Object.defineProperty(Array.prototype, 'forEach',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback, thisArg) {\",\n \"if (!this || typeof callback !== 'function') throw TypeError();\",\n \"var T, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O) callback.call(T, O[k], k, O);\",\n \"k++;\",\n \"}\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes#Polyfill\n \"Object.defineProperty(Array.prototype, 'includes', {\",\n \"value: function(searchElement, fromIndex) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"// 1. Let O be ? ToObject(this value).\",\n \"var o = Object(this);\",\n '// 2. Let len be ? ToLength(? Get(O, \"length\")).',\n \"var len = o.length >>> 0;\",\n \"// 3. If len is 0, return false.\",\n \"if (len === 0) {\",\n \"return false;\",\n \"}\",\n \"// 4. Let n be ? ToInteger(fromIndex).\",\n \"// (If fromIndex is undefined, this step produces the value 0.)\",\n \"var n = fromIndex | 0;\",\n \"// 5. If n ≥ 0, then\",\n \"// a. Let k be n.\",\n \"// 6. Else n < 0,\",\n \"// a. Let k be len + n.\",\n \"// b. If k < 0, let k be 0.\",\n \"var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\",\n \"function sameValueZero(x, y) {\",\n \"return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));\",\n \"}\",\n \"// 7. Repeat, while k < len\",\n \"while (k < len) {\",\n \"// a. Let elementK be the result of ? Get(O, ! ToString(k)).\",\n \"// b. If SameValueZero(searchElement, elementK) is true, return true.\",\n \"if (sameValueZero(o[k], searchElement)) {\",\n \"return true;\",\n \"}\",\n \"// c. Increase k by 1. \",\n \"k++;\",\n \"}\",\n \"// 8. Return false\",\n \"return false;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map\n \"Object.defineProperty(Array.prototype, 'map',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback, thisArg) {\",\n \"if (!this || typeof callback !== 'function') new TypeError;\",\n \"var T, A, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"A = new Array(len);\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O) A[k] = callback.call(T, O[k], k, O);\",\n \"k++;\",\n \"}\",\n \"return A;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce\n \"Object.defineProperty(Array.prototype, 'reduce',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback /*, initialValue*/) {\",\n \"if (!this || typeof callback !== 'function') throw TypeError();\",\n \"var t = Object(this), len = t.length >>> 0, k = 0, value;\",\n \"if (arguments.length === 2) {\",\n \"value = arguments[1];\",\n \"} else {\",\n \"while (k < len && !(k in t)) k++;\",\n \"if (k >= len) {\",\n \"throw TypeError('Reduce of empty array with no initial value');\",\n \"}\",\n \"value = t[k++];\",\n \"}\",\n \"for (; k < len; k++) {\",\n \"if (k in t) value = callback(value, t[k], k, t);\",\n \"}\",\n \"return value;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight\n \"Object.defineProperty(Array.prototype, 'reduceRight',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback /*, initialValue*/) {\",\n \"if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();\",\n \"var t = Object(this), len = t.length >>> 0, k = len - 1, value;\",\n \"if (arguments.length >= 2) {\",\n \"value = arguments[1];\",\n \"} else {\",\n \"while (k >= 0 && !(k in t)) k--;\",\n \"if (k < 0) {\",\n \"throw TypeError('Reduce of empty array with no initial value');\",\n \"}\",\n \"value = t[k--];\",\n \"}\",\n \"for (; k >= 0; k--) {\",\n \"if (k in t) value = callback(value, t[k], k, t);\",\n \"}\",\n \"return value;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/some\n \"Object.defineProperty(Array.prototype, 'some',\",\n \"{configurable: true, writable: true, value:\",\n \"function(fun/*, thisArg*/) {\",\n \"if (!this || typeof fun !== 'function') throw TypeError();\",\n \"var t = Object(this);\",\n \"var len = t.length >>> 0;\",\n \"var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\",\n \"for (var i = 0; i < len; i++) {\",\n \"if (i in t && fun.call(thisArg, t[i], i, t)) {\",\n \"return true;\",\n \"}\",\n \"}\",\n \"return false;\",\n \"}\",\n \"});\",\n\n \"(function() {\",\n \"var sort_ = Array.prototype.sort;\",\n \"Array.prototype.sort = function(opt_comp) {\",\n // Fast native sort.\n \"if (typeof opt_comp !== 'function') {\",\n \"return sort_.call(this);\",\n \"}\",\n // Slow bubble sort.\n \"for (var i = 0; i < this.length; i++) {\",\n \"var changes = 0;\",\n \"for (var j = 0; j < this.length - i - 1; j++) {\",\n \"if (opt_comp(this[j], this[j + 1]) > 0) {\",\n \"var swap = this[j];\",\n \"this[j] = this[j + 1];\",\n \"this[j + 1] = swap;\",\n \"changes++;\",\n \"}\",\n \"}\",\n \"if (!changes) break;\",\n \"}\",\n \"return this;\",\n \"};\",\n \"})();\",\n\n \"Object.defineProperty(Array.prototype, 'toLocaleString',\",\n \"{configurable: true, writable: true, value:\",\n \"function() {\",\n \"var out = [];\",\n \"for (var i = 0; i < this.length; i++) {\",\n \"out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();\",\n \"}\",\n \"return out.join(',');\",\n \"}\",\n \"});\",\n \"\",\n );\n};\n\n/**\n * Initialize the String class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initString = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // String constructor.\n wrapper = function (value) {\n value = String(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new String().\n this.data = value;\n return this;\n } else {\n // Called as String().\n return value;\n }\n };\n this.STRING = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"String\", this.STRING);\n\n // Static methods on String.\n this.setProperty(\n this.STRING,\n \"fromCharCode\",\n this.createNativeFunction(String.fromCharCode, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on String.\n // Methods with exclusively primitive arguments.\n var functions = [\n \"charAt\",\n \"charCodeAt\",\n \"concat\",\n \"indexOf\",\n \"lastIndexOf\",\n \"slice\",\n \"substr\",\n \"substring\",\n \"toLocaleLowerCase\",\n \"toLocaleUpperCase\",\n \"toLowerCase\",\n \"toUpperCase\",\n \"trim\",\n ];\n for (var i = 0; i < functions.length; i++) {\n this.setNativeFunctionPrototype(this.STRING, functions[i], String.prototype[functions[i]]);\n }\n\n wrapper = function (compareString, locales, options) {\n locales = locales ? thisInterpreter.pseudoToNative(locales) : undefined;\n options = options ? thisInterpreter.pseudoToNative(options) : undefined;\n return String(this).localeCompare(compareString, locales, options);\n };\n this.setNativeFunctionPrototype(this.STRING, \"localeCompare\", wrapper);\n\n wrapper = function (separator, limit) {\n if (thisInterpreter.isa(separator, thisInterpreter.REGEXP)) {\n separator = separator.data;\n }\n var jsList = String(this).split(separator, limit);\n return thisInterpreter.arrayNativeToPseudo(jsList);\n };\n this.setNativeFunctionPrototype(this.STRING, \"split\", wrapper);\n\n wrapper = function (regexp) {\n if (thisInterpreter.isa(regexp, thisInterpreter.REGEXP)) {\n regexp = regexp.data;\n }\n var m = String(this).match(regexp);\n return m && thisInterpreter.arrayNativeToPseudo(m);\n };\n this.setNativeFunctionPrototype(this.STRING, \"match\", wrapper);\n\n wrapper = function (regexp) {\n if (thisInterpreter.isa(regexp, thisInterpreter.REGEXP)) {\n regexp = regexp.data;\n }\n return String(this).search(regexp);\n };\n this.setNativeFunctionPrototype(this.STRING, \"search\", wrapper);\n\n wrapper = function (substr, newSubstr) {\n // Support for function replacements is the responsibility of a polyfill.\n if (thisInterpreter.isa(substr, thisInterpreter.REGEXP)) {\n substr = substr.data;\n }\n return String(this).replace(substr, newSubstr);\n };\n this.setNativeFunctionPrototype(this.STRING, \"replace\", wrapper);\n // Add a polyfill to handle replace's second argument being a function.\n this.polyfills_.push(\n \"(function() {\",\n \"var replace_ = String.prototype.replace;\",\n \"String.prototype.replace = function(substr, newSubstr) {\",\n \"if (typeof newSubstr !== 'function') {\",\n // string.replace(string|regexp, string)\n \"return replace_.call(this, substr, newSubstr);\",\n \"}\",\n \"var str = this;\",\n \"if (substr instanceof RegExp) {\", // string.replace(regexp, function)\n \"var subs = [];\",\n \"var m = substr.exec(str);\",\n \"while (m) {\",\n \"m.push(m.index, str);\",\n \"var inject = newSubstr.apply(null, m);\",\n \"subs.push([m.index, m[0].length, inject]);\",\n \"m = substr.global ? substr.exec(str) : null;\",\n \"}\",\n \"for (var i = subs.length - 1; i >= 0; i--) {\",\n \"str = str.substring(0, subs[i][0]) + subs[i][2] + \" + \"str.substring(subs[i][0] + subs[i][1]);\",\n \"}\",\n \"} else {\", // string.replace(string, function)\n \"var i = str.indexOf(substr);\",\n \"if (i !== -1) {\",\n \"var inject = newSubstr(str.substr(i, substr.length), i, str);\",\n \"str = str.substring(0, i) + inject + \" + \"str.substring(i + substr.length);\",\n \"}\",\n \"}\",\n \"return str;\",\n \"};\",\n \"})();\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n \"if (!String.prototype.endsWith) {\",\n \"String.prototype.endsWith = function(search, this_len) {\",\n \"if (this_len === undefined || this_len > this.length) {\",\n \"this_len = this.length;\",\n \"}\",\n \"return this.substring(this_len - search.length, this_len) === search;\",\n \"};\",\n \"}\",\n\n //Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n \"if (!String.prototype.includes) {\",\n \"String.prototype.includes = function(search, start) {\",\n \"'use strict';\",\n \"if (typeof start !== 'number') {\",\n \"start = 0;\",\n \"}\",\n \" \",\n \"if (start + search.length > this.length) {\",\n \"return false;\",\n \"} else {\",\n \"return this.indexOf(search, start) !== -1;\",\n \"}\",\n \"};\",\n \"}\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n \"if (!String.prototype.startsWith) {\",\n \"String.prototype.startsWith = function(search, pos) {\",\n \"return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\",\n \"};\",\n \"}\",\n\n \"\",\n );\n};\n\n/**\n * Initialize the Boolean class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initBoolean = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Boolean constructor.\n wrapper = function (value) {\n value = Boolean(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new Boolean().\n this.data = value;\n return this;\n } else {\n // Called as Boolean().\n return value;\n }\n };\n this.BOOLEAN = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"Boolean\", this.BOOLEAN);\n};\n\n/**\n * Initialize the Number class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initNumber = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Number constructor.\n wrapper = function (value) {\n value = Number(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new Number().\n this.data = value;\n return this;\n } else {\n // Called as Number().\n return value;\n }\n };\n this.NUMBER = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"Number\", this.NUMBER);\n\n var numConsts = [\"MAX_VALUE\", \"MIN_VALUE\", \"NaN\", \"NEGATIVE_INFINITY\", \"POSITIVE_INFINITY\"];\n for (var i = 0; i < numConsts.length; i++) {\n this.setProperty(this.NUMBER, numConsts[i], Number[numConsts[i]], Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n }\n\n // Instance methods on Number.\n wrapper = function (fractionDigits) {\n try {\n return Number(this).toExponential(fractionDigits);\n } catch (e) {\n // Throws if fractionDigits isn't within 0-20.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toExponential\", wrapper);\n\n wrapper = function (digits) {\n try {\n return Number(this).toFixed(digits);\n } catch (e) {\n // Throws if digits isn't within 0-20.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toFixed\", wrapper);\n\n wrapper = function (precision) {\n try {\n return Number(this).toPrecision(precision);\n } catch (e) {\n // Throws if precision isn't within range (depends on implementation).\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toPrecision\", wrapper);\n\n wrapper = function (radix) {\n try {\n return Number(this).toString(radix);\n } catch (e) {\n // Throws if radix isn't within 2-36.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toString\", wrapper);\n\n wrapper = function (locales, options) {\n locales = locales ? thisInterpreter.pseudoToNative(locales) : undefined;\n options = options ? thisInterpreter.pseudoToNative(options) : undefined;\n return Number(this).toLocaleString(locales, options);\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toLocaleString\", wrapper);\n};\n\n/**\n * Initialize the Date class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initDate = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Date constructor.\n wrapper = function (value, var_args) {\n if (!thisInterpreter.calledWithNew()) {\n // Called as Date().\n // Calling Date() as a function returns a string, no arguments are heeded.\n return Date();\n }\n // Called as new Date().\n var args = [null].concat(Array.from(arguments));\n this.data = new (Function.prototype.bind.apply(Date, args))();\n return this;\n };\n this.DATE = this.createNativeFunction(wrapper, true);\n this.DATE_PROTO = this.DATE.properties[\"prototype\"];\n this.setProperty(scope, \"Date\", this.DATE);\n\n // Static methods on Date.\n this.setProperty(this.DATE, \"now\", this.createNativeFunction(Date.now, false), Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n this.setProperty(\n this.DATE,\n \"parse\",\n this.createNativeFunction(Date.parse, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n this.setProperty(this.DATE, \"UTC\", this.createNativeFunction(Date.UTC, false), Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n // Instance methods on Date.\n var functions = [\n \"getDate\",\n \"getDay\",\n \"getFullYear\",\n \"getHours\",\n \"getMilliseconds\",\n \"getMinutes\",\n \"getMonth\",\n \"getSeconds\",\n \"getTime\",\n \"getTimezoneOffset\",\n \"getUTCDate\",\n \"getUTCDay\",\n \"getUTCFullYear\",\n \"getUTCHours\",\n \"getUTCMilliseconds\",\n \"getUTCMinutes\",\n \"getUTCMonth\",\n \"getUTCSeconds\",\n \"getYear\",\n \"setDate\",\n \"setFullYear\",\n \"setHours\",\n \"setMilliseconds\",\n \"setMinutes\",\n \"setMonth\",\n \"setSeconds\",\n \"setTime\",\n \"setUTCDate\",\n \"setUTCFullYear\",\n \"setUTCHours\",\n \"setUTCMilliseconds\",\n \"setUTCMinutes\",\n \"setUTCMonth\",\n \"setUTCSeconds\",\n \"setYear\",\n \"toDateString\",\n \"toISOString\",\n \"toJSON\",\n \"toGMTString\",\n \"toLocaleDateString\",\n \"toLocaleString\",\n \"toLocaleTimeString\",\n \"toTimeString\",\n \"toUTCString\",\n ];\n for (var i = 0; i < functions.length; i++) {\n wrapper = (function (nativeFunc) {\n return function (var_args) {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = thisInterpreter.pseudoToNative(arguments[i]);\n }\n return this.data[nativeFunc].apply(this.data, args);\n };\n })(functions[i]);\n this.setNativeFunctionPrototype(this.DATE, functions[i], wrapper);\n }\n};\n\n/**\n * Initialize Regular Expression object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initRegExp = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // RegExp constructor.\n wrapper = function (pattern, flags) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new RegExp().\n var rgx = this;\n } else {\n // Called as RegExp().\n var rgx = thisInterpreter.createObjectProto(thisInterpreter.REGEXP_PROTO);\n }\n pattern = pattern ? pattern.toString() : \"\";\n flags = flags ? flags.toString() : \"\";\n thisInterpreter.populateRegExp(rgx, new RegExp(pattern, flags));\n return rgx;\n };\n this.REGEXP = this.createNativeFunction(wrapper, true);\n this.REGEXP_PROTO = this.REGEXP.properties[\"prototype\"];\n this.setProperty(scope, \"RegExp\", this.REGEXP);\n\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"global\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"ignoreCase\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"multiline\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"source\",\n \"(?:)\",\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (str) {\n return this.data.test(str);\n };\n this.setNativeFunctionPrototype(this.REGEXP, \"test\", wrapper);\n\n wrapper = function (str) {\n str = str.toString();\n // Get lastIndex from wrapped regex, since this is settable.\n this.data.lastIndex = Number(thisInterpreter.getProperty(this, \"lastIndex\"));\n var match = this.data.exec(str);\n thisInterpreter.setProperty(this, \"lastIndex\", this.data.lastIndex);\n\n if (match) {\n var result = thisInterpreter.createObjectProto(thisInterpreter.ARRAY_PROTO);\n for (var i = 0; i < match.length; i++) {\n thisInterpreter.setProperty(result, i, match[i]);\n }\n // match has additional properties.\n thisInterpreter.setProperty(result, \"index\", match.index);\n thisInterpreter.setProperty(result, \"input\", match.input);\n return result;\n }\n return null;\n };\n this.setNativeFunctionPrototype(this.REGEXP, \"exec\", wrapper);\n};\n\n/**\n * Initialize the Error class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initError = function (scope) {\n var thisInterpreter = this;\n // Error constructor.\n this.ERROR = this.createNativeFunction(function (opt_message) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Error().\n var newError = this;\n } else {\n // Called as Error().\n var newError = thisInterpreter.createObject(thisInterpreter.ERROR);\n }\n if (opt_message) {\n thisInterpreter.setProperty(newError, \"message\", String(opt_message), Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n return newError;\n }, true);\n this.setProperty(scope, \"Error\", this.ERROR);\n this.setProperty(this.ERROR.properties[\"prototype\"], \"message\", \"\", Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(this.ERROR.properties[\"prototype\"], \"name\", \"Error\", Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n var createErrorSubclass = function (name) {\n var constructor = thisInterpreter.createNativeFunction(function (opt_message) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new XyzError().\n var newError = this;\n } else {\n // Called as XyzError().\n var newError = thisInterpreter.createObject(constructor);\n }\n if (opt_message) {\n thisInterpreter.setProperty(newError, \"message\", String(opt_message), Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n return newError;\n }, true);\n thisInterpreter.setProperty(constructor, \"prototype\", thisInterpreter.createObject(thisInterpreter.ERROR));\n thisInterpreter.setProperty(\n constructor.properties[\"prototype\"],\n \"name\",\n name,\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n thisInterpreter.setProperty(scope, name, constructor);\n\n return constructor;\n };\n\n this.EVAL_ERROR = createErrorSubclass(\"EvalError\");\n this.RANGE_ERROR = createErrorSubclass(\"RangeError\");\n this.REFERENCE_ERROR = createErrorSubclass(\"ReferenceError\");\n this.SYNTAX_ERROR = createErrorSubclass(\"SyntaxError\");\n this.TYPE_ERROR = createErrorSubclass(\"TypeError\");\n this.URI_ERROR = createErrorSubclass(\"URIError\");\n};\n\n/**\n * Initialize Math object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initMath = function (scope) {\n var thisInterpreter = this;\n var myMath = this.createObjectProto(this.OBJECT_PROTO);\n this.setProperty(scope, \"Math\", myMath);\n var mathConsts = [\"E\", \"LN2\", \"LN10\", \"LOG2E\", \"LOG10E\", \"PI\", \"SQRT1_2\", \"SQRT2\"];\n for (var i = 0; i < mathConsts.length; i++) {\n this.setProperty(myMath, mathConsts[i], Math[mathConsts[i]], Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n }\n var numFunctions = [\n \"abs\",\n \"acos\",\n \"asin\",\n \"atan\",\n \"atan2\",\n \"ceil\",\n \"cos\",\n \"exp\",\n \"floor\",\n \"log\",\n \"max\",\n \"min\",\n \"pow\",\n \"random\",\n \"round\",\n \"sin\",\n \"sqrt\",\n \"tan\",\n ];\n for (var i = 0; i < numFunctions.length; i++) {\n this.setProperty(\n myMath,\n numFunctions[i],\n this.createNativeFunction(Math[numFunctions[i]], false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n }\n};\n\n/**\n * Initialize JSON object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initJSON = function (scope) {\n var thisInterpreter = this;\n var myJSON = thisInterpreter.createObjectProto(this.OBJECT_PROTO);\n this.setProperty(scope, \"JSON\", myJSON);\n\n var wrapper = function (text) {\n try {\n var nativeObj = JSON.parse(text.toString());\n } catch (e) {\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, e.message);\n }\n return thisInterpreter.nativeToPseudo(nativeObj);\n };\n this.setProperty(myJSON, \"parse\", this.createNativeFunction(wrapper, false));\n\n wrapper = function (value) {\n var nativeObj = thisInterpreter.pseudoToNative(value);\n try {\n var str = JSON.stringify(nativeObj);\n } catch (e) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, e.message);\n }\n return str;\n };\n this.setProperty(myJSON, \"stringify\", this.createNativeFunction(wrapper, false));\n};\n\n/**\n * Is an object of a certain class?\n * @param {Interpreter.Value} child Object to check.\n * @param {Interpreter.Object} constructor Constructor of object.\n * @return {boolean} True if object is the class or inherits from it.\n * False otherwise.\n */\nInterpreter.prototype.isa = function (child, constructor) {\n if (child === null || child === undefined || !constructor) {\n return false;\n }\n var proto = constructor.properties[\"prototype\"];\n if (child === proto) {\n return true;\n }\n // The first step up the prototype chain is harder since the child might be\n // a primitive value. Subsequent steps can just follow the .proto property.\n child = this.getPrototype(child);\n while (child) {\n if (child === proto) {\n return true;\n }\n child = child.proto;\n }\n return false;\n};\n\n/**\n * Is a value a legal integer for an array length?\n * @param {Interpreter.Value} x Value to check.\n * @return {number} Zero, or a positive integer if the value can be\n * converted to such. NaN otherwise.\n */\nInterpreter.legalArrayLength = function (x) {\n var n = x >>> 0;\n // Array length must be between 0 and 2^32-1 (inclusive).\n return n === Number(x) ? n : NaN;\n};\n\n/**\n * Is a value a legal integer for an array index?\n * @param {Interpreter.Value} x Value to check.\n * @return {number} Zero, or a positive integer if the value can be\n * converted to such. NaN otherwise.\n */\nInterpreter.legalArrayIndex = function (x) {\n var n = x >>> 0;\n // Array index cannot be 2^32-1, otherwise length would be 2^32.\n // 0xffffffff is 2^32-1.\n return String(n) === String(x) && n !== 0xffffffff ? n : NaN;\n};\n\n/**\n * Typedef for JS values.\n * @typedef {!Interpreter.Object|boolean|number|string|undefined|null}\n */\nInterpreter.Value;\n\n/**\n * Class for an object.\n * @param {Interpreter.Object} proto Prototype object or null.\n * @constructor\n */\nInterpreter.Object = function (proto) {\n this.getter = Object.create(null);\n this.setter = Object.create(null);\n this.properties = Object.create(null);\n this.proto = proto;\n};\n\n/** @type {Interpreter.Object} */\nInterpreter.Object.prototype.proto = null;\n\n/** @type {boolean} */\nInterpreter.Object.prototype.isObject = true;\n\n/** @type {string} */\nInterpreter.Object.prototype.class = \"Object\";\n\n/** @type {Date|RegExp|boolean|number|string|undefined|null} */\nInterpreter.Object.prototype.data = null;\n\n/**\n * Convert this object into a string.\n * @return {string} String value.\n * @override\n */\nInterpreter.Object.prototype.toString = function () {\n if (this.class === \"Array\") {\n // Array\n var cycles = Interpreter.toStringCycles_;\n cycles.push(this);\n try {\n var strs = [];\n for (var i = 0; i < this.properties.length; i++) {\n var value = this.properties[i];\n strs[i] = value && value.isObject && cycles.indexOf(value) !== -1 ? \"...\" : value;\n }\n } finally {\n cycles.pop();\n }\n return strs.join(\",\");\n }\n if (this.class === \"Error\") {\n var cycles = Interpreter.toStringCycles_;\n if (cycles.indexOf(this) !== -1) {\n return \"[object Error]\";\n }\n var name, message;\n // Bug: Does not support getters and setters for name or message.\n var obj = this;\n do {\n if (\"name\" in obj.properties) {\n name = obj.properties[\"name\"];\n break;\n }\n } while ((obj = obj.proto));\n var obj = this;\n do {\n if (\"message\" in obj.properties) {\n message = obj.properties[\"message\"];\n break;\n }\n } while ((obj = obj.proto));\n cycles.push(this);\n try {\n name = name && name.toString();\n message = message && message.toString();\n } finally {\n cycles.pop();\n }\n return message ? name + \": \" + message : String(name);\n }\n\n // RegExp, Date, and boxed primitives.\n if (this.data !== null) {\n return String(this.data);\n }\n\n return \"[object \" + this.class + \"]\";\n};\n\n/**\n * Return the object's value.\n * @return {Interpreter.Value} Value.\n * @override\n */\nInterpreter.Object.prototype.valueOf = function () {\n if (this.data === undefined || this.data === null || this.data instanceof RegExp) {\n return this; // An Object.\n }\n if (this.data instanceof Date) {\n return this.data.valueOf(); // Milliseconds.\n }\n return /** @type {(boolean|number|string)} */ (this.data); // Boxed primitive.\n};\n\n/**\n * Create a new data object based on a constructor's prototype.\n * @param {Interpreter.Object} constructor Parent constructor function,\n * or null if scope object.\n * @return {!Interpreter.Object} New data object.\n */\nInterpreter.prototype.createObject = function (constructor) {\n return this.createObjectProto(constructor && constructor.properties[\"prototype\"]);\n};\n\n/**\n * Create a new data object based on a prototype.\n * @param {Interpreter.Object} proto Prototype object.\n * @return {!Interpreter.Object} New data object.\n */\nInterpreter.prototype.createObjectProto = function (proto) {\n if (typeof proto !== \"object\") {\n throw Error(\"Non object prototype\");\n }\n var obj = new Interpreter.Object(proto);\n // Functions have prototype objects.\n if (this.isa(obj, this.FUNCTION)) {\n this.setProperty(obj, \"prototype\", this.createObjectProto(this.OBJECT_PROTO || null));\n obj.class = \"Function\";\n }\n // Arrays have length.\n if (this.isa(obj, this.ARRAY)) {\n this.setProperty(obj, \"length\", 0, {\n configurable: false,\n enumerable: false,\n writable: true,\n });\n obj.class = \"Array\";\n }\n if (this.isa(obj, this.ERROR)) {\n obj.class = \"Error\";\n }\n return obj;\n};\n\n/**\n * Initialize a pseudo regular expression object based on a native regular\n * expression object.\n * @param {!Interpreter.Object} pseudoRegexp The existing object to set.\n * @param {!RegExp} nativeRegexp The native regular expression.\n */\nInterpreter.prototype.populateRegExp = function (pseudoRegexp, nativeRegexp) {\n pseudoRegexp.data = nativeRegexp;\n // lastIndex is settable, all others are read-only attributes\n this.setProperty(pseudoRegexp, \"lastIndex\", nativeRegexp.lastIndex, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"source\", nativeRegexp.source, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"global\", nativeRegexp.global, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"ignoreCase\", nativeRegexp.ignoreCase, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"multiline\", nativeRegexp.multiline, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n};\n\n/**\n * Create a new function.\n * @param {!Object} node AST node defining the function.\n * @param {!Object} scope Parent scope.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createFunction = function (node, scope) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.parentScope = scope;\n func.node = node;\n this.setProperty(func, \"length\", func.node[\"params\"].length, Interpreter.READONLY_DESCRIPTOR);\n return func;\n};\n\n/**\n * Create a new native function.\n * @param {!Function} nativeFunc JavaScript function.\n * @param {boolean=} opt_constructor If true, the function's\n * prototype will have its constructor property set to the function.\n * If false, the function cannot be called as a constructor (e.g. escape).\n * Defaults to undefined.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createNativeFunction = function (nativeFunc, opt_constructor) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.nativeFunc = nativeFunc;\n nativeFunc.id = this.functionCounter_++;\n this.setProperty(func, \"length\", nativeFunc.length, Interpreter.READONLY_DESCRIPTOR);\n if (opt_constructor) {\n this.setProperty(func.properties[\"prototype\"], \"constructor\", func, Interpreter.NONENUMERABLE_DESCRIPTOR);\n } else if (opt_constructor === false) {\n func.illegalConstructor = true;\n this.setProperty(func, \"prototype\", undefined);\n }\n return func;\n};\n\n/**\n * Create a new native asynchronous function.\n * @param {!Function} asyncFunc JavaScript function.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createAsyncFunction = function (asyncFunc) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.asyncFunc = asyncFunc;\n asyncFunc.id = this.functionCounter_++;\n this.setProperty(func, \"length\", asyncFunc.length, Interpreter.READONLY_DESCRIPTOR);\n return func;\n};\n\n/**\n * Converts from a native JS object or value to a JS interpreter object.\n * Can handle JSON-style values, does NOT handle cycles.\n * @param {*} nativeObj The native JS object to be converted.\n * @return {Interpreter.Value} The equivalent JS interpreter object.\n */\nInterpreter.prototype.nativeToPseudo = function (nativeObj) {\n if ((typeof nativeObj !== \"object\" && typeof nativeObj !== \"function\") || nativeObj === null) {\n return nativeObj;\n }\n\n if (nativeObj instanceof RegExp) {\n var pseudoRegexp = this.createObjectProto(this.REGEXP_PROTO);\n this.populateRegExp(pseudoRegexp, nativeObj);\n return pseudoRegexp;\n }\n\n if (nativeObj instanceof Date) {\n var pseudoDate = this.createObjectProto(this.DATE_PROTO);\n pseudoDate.data = nativeObj;\n return pseudoDate;\n }\n\n if (nativeObj instanceof Function) {\n var interpreter = this;\n var wrapper = function () {\n return interpreter.nativeToPseudo(\n nativeObj.apply(\n interpreter,\n Array.prototype.slice.call(arguments).map(function (i) {\n return interpreter.pseudoToNative(i);\n }),\n ),\n );\n };\n return this.createNativeFunction(wrapper, undefined);\n }\n\n var pseudoObj;\n if (Array.isArray(nativeObj)) {\n // Array.\n pseudoObj = this.createObjectProto(this.ARRAY_PROTO);\n for (var i = 0; i < nativeObj.length; i++) {\n if (i in nativeObj) {\n this.setProperty(pseudoObj, i, this.nativeToPseudo(nativeObj[i]));\n }\n }\n } else {\n // Object.\n pseudoObj = this.createObjectProto(this.OBJECT_PROTO);\n for (var key in nativeObj) {\n this.setProperty(pseudoObj, key, this.nativeToPseudo(nativeObj[key]));\n }\n }\n return pseudoObj;\n};\n\n/**\n * Converts from a JS interpreter object to native JS object.\n * Can handle JSON-style values, plus cycles.\n * @param {Interpreter.Value} pseudoObj The JS interpreter object to be\n * converted.\n * @param {Object=} opt_cycles Cycle detection (used in recursive calls).\n * @return {*} The equivalent native JS object or value.\n */\nInterpreter.prototype.pseudoToNative = function (pseudoObj, opt_cycles) {\n if ((typeof pseudoObj !== \"object\" && typeof pseudoObj !== \"function\") || pseudoObj === null) {\n return pseudoObj;\n }\n\n if (this.isa(pseudoObj, this.REGEXP)) {\n // Regular expression.\n return pseudoObj.data;\n }\n\n if (this.isa(pseudoObj, this.DATE)) {\n // Date.\n return pseudoObj.data;\n }\n\n var cycles = opt_cycles || {\n pseudo: [],\n native: [],\n };\n var i = cycles.pseudo.indexOf(pseudoObj);\n if (i !== -1) {\n return cycles.native[i];\n }\n cycles.pseudo.push(pseudoObj);\n var nativeObj;\n if (this.isa(pseudoObj, this.ARRAY)) {\n // Array.\n nativeObj = [];\n cycles.native.push(nativeObj);\n var length = this.getProperty(pseudoObj, \"length\");\n for (var i = 0; i < length; i++) {\n if (this.hasProperty(pseudoObj, i)) {\n nativeObj[i] = this.pseudoToNative(this.getProperty(pseudoObj, i), cycles);\n }\n }\n } else {\n // Object.\n nativeObj = {};\n cycles.native.push(nativeObj);\n var val;\n for (var key in pseudoObj.properties) {\n val = pseudoObj.properties[key];\n nativeObj[key] = this.pseudoToNative(val, cycles);\n }\n }\n cycles.pseudo.pop();\n cycles.native.pop();\n return nativeObj;\n};\n\n/**\n * Converts from a native JS array to a JS interpreter array.\n * Does handle non-numeric properties (like str.match's index prop).\n * Does NOT recurse into the array's contents.\n * @param {!Array} nativeArray The JS array to be converted.\n * @return {!Interpreter.Object} The equivalent JS interpreter array.\n */\nInterpreter.prototype.arrayNativeToPseudo = function (nativeArray) {\n var pseudoArray = this.createObjectProto(this.ARRAY_PROTO);\n var props = Object.getOwnPropertyNames(nativeArray);\n for (var i = 0; i < props.length; i++) {\n this.setProperty(pseudoArray, props[i], nativeArray[props[i]]);\n }\n return pseudoArray;\n};\n\n/**\n * Converts from a JS interpreter array to native JS array.\n * Does handle non-numeric properties (like str.match's index prop).\n * Does NOT recurse into the array's contents.\n * @param {!Interpreter.Object} pseudoArray The JS interpreter array,\n * or JS interpreter object pretending to be an array.\n * @return {!Array} The equivalent native JS array.\n */\nInterpreter.prototype.arrayPseudoToNative = function (pseudoArray) {\n var nativeArray = [];\n for (var key in pseudoArray.properties) {\n nativeArray[key] = this.getProperty(pseudoArray, key);\n }\n // pseudoArray might be an object pretending to be an array. In this case\n // it's possible that length is non-existent, invalid, or smaller than the\n // largest defined numeric property. Set length explicitly here.\n nativeArray.length = Interpreter.legalArrayLength(this.getProperty(pseudoArray, \"length\")) || 0;\n return nativeArray;\n};\n\n/**\n * Look up the prototype for this value.\n * @param {Interpreter.Value} value Data object.\n * @return {Interpreter.Object} Prototype object, null if none.\n */\nInterpreter.prototype.getPrototype = function (value) {\n switch (typeof value) {\n case \"number\":\n return this.NUMBER.properties[\"prototype\"];\n case \"boolean\":\n return this.BOOLEAN.properties[\"prototype\"];\n case \"string\":\n return this.STRING.properties[\"prototype\"];\n }\n if (value) {\n return value.proto;\n }\n return null;\n};\n\n/**\n * Fetch a property value from a data object.\n * @param {Interpreter.Value} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line numbers\n * @return {Interpreter.Value} Property value (may be undefined).\n */\nInterpreter.prototype.getProperty = function (obj, name, node) {\n name = String(name);\n if (obj === undefined || obj === null) {\n let lineNum;\n if (node != null && node.loc != null && node.loc.start != null) {\n lineNum = node.loc.start.line;\n }\n this.throwException(this.TYPE_ERROR, \"Cannot read property '\" + name + \"' of \" + obj, lineNum);\n }\n if (name === \"length\") {\n // Special cases for magic length property.\n if (this.isa(obj, this.STRING)) {\n return String(obj).length;\n }\n } else if (name.charCodeAt(0) < 0x40) {\n // Might have numbers in there?\n // Special cases for string array indexing\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (!isNaN(n) && n < String(obj).length) {\n return String(obj)[n];\n }\n }\n }\n do {\n if (obj.properties && name in obj.properties) {\n var getter = obj.getter[name];\n if (getter) {\n // Flag this function as being a getter and thus needing immediate\n // execution (rather than being the value of the property).\n getter.isGetter = true;\n return getter;\n }\n return obj.properties[name];\n }\n } while ((obj = this.getPrototype(obj)));\n return undefined;\n};\n\n/**\n * Does the named property exist on a data object.\n * @param {Interpreter.Value} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @return {boolean} True if property exists.\n */\nInterpreter.prototype.hasProperty = function (obj, name) {\n if (!obj.isObject) {\n throw TypeError(\"Primitive data type has no properties\");\n }\n name = String(name);\n if (name === \"length\" && this.isa(obj, this.STRING)) {\n return true;\n }\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (!isNaN(n) && n < String(obj).length) {\n return true;\n }\n }\n do {\n if (obj.properties && name in obj.properties) {\n return true;\n }\n } while ((obj = this.getPrototype(obj)));\n return false;\n};\n\n/**\n * Set a property value on a data object.\n * @param {!Interpreter.Object} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {Interpreter.Value} value New property value.\n * Use Interpreter.VALUE_IN_DESCRIPTOR if value is handled by\n * descriptor instead.\n * @param {Object=} opt_descriptor Optional descriptor object.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setProperty = function (obj, name, value, opt_descriptor) {\n name = String(name);\n if (obj === undefined || obj === null) {\n this.throwException(this.TYPE_ERROR, \"Cannot set property '\" + name + \"' of \" + obj);\n }\n if (\n opt_descriptor &&\n (\"get\" in opt_descriptor || \"set\" in opt_descriptor) &&\n (\"value\" in opt_descriptor || \"writable\" in opt_descriptor)\n ) {\n this.throwException(\n this.TYPE_ERROR,\n \"Invalid property descriptor. \" + \"Cannot both specify accessors and a value or writable attribute\",\n );\n }\n var strict = !this.stateStack || this.getScope().strict;\n if (!obj.isObject) {\n if (strict) {\n this.throwException(this.TYPE_ERROR, \"Can't create property '\" + name + \"' on '\" + obj + \"'\");\n }\n return;\n }\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (name === \"length\" || (!isNaN(n) && n < String(obj).length)) {\n // Can't set length or letters on String objects.\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot assign to read only \" + \"property '\" + name + \"' of String '\" + obj.data + \"'\",\n );\n }\n return;\n }\n }\n if (obj.class === \"Array\") {\n // Arrays have a magic length variable that is bound to the elements.\n var length = obj.properties.length;\n var i;\n if (name === \"length\") {\n // Delete elements if length is smaller.\n if (opt_descriptor) {\n if (!(\"value\" in opt_descriptor)) {\n return;\n }\n value = opt_descriptor.value;\n }\n value = Interpreter.legalArrayLength(value);\n if (isNaN(value)) {\n this.throwException(this.RANGE_ERROR, \"Invalid array length\");\n }\n if (value < length) {\n for (i in obj.properties) {\n i = Interpreter.legalArrayIndex(i);\n if (!isNaN(i) && value <= i) {\n delete obj.properties[i];\n }\n }\n }\n } else if (!isNaN((i = Interpreter.legalArrayIndex(name)))) {\n // Increase length if this index is larger.\n obj.properties.length = Math.max(length, i + 1);\n }\n }\n if (obj.preventExtensions && !(name in obj.properties)) {\n if (strict) {\n this.throwException(this.TYPE_ERROR, \"Can't add property '\" + name + \"', object is not extensible\");\n }\n return;\n }\n if (opt_descriptor) {\n // Define the property.\n if (\"get\" in opt_descriptor) {\n if (opt_descriptor.get) {\n obj.getter[name] = opt_descriptor.get;\n } else {\n delete obj.getter[name];\n }\n }\n if (\"set\" in opt_descriptor) {\n if (opt_descriptor.set) {\n obj.setter[name] = opt_descriptor.set;\n } else {\n delete obj.setter[name];\n }\n }\n var descriptor = {};\n if (\"configurable\" in opt_descriptor) {\n descriptor.configurable = opt_descriptor.configurable;\n }\n if (\"enumerable\" in opt_descriptor) {\n descriptor.enumerable = opt_descriptor.enumerable;\n }\n if (\"writable\" in opt_descriptor) {\n descriptor.writable = opt_descriptor.writable;\n delete obj.getter[name];\n delete obj.setter[name];\n }\n if (\"value\" in opt_descriptor) {\n descriptor.value = opt_descriptor.value;\n delete obj.getter[name];\n delete obj.setter[name];\n } else if (value !== Interpreter.VALUE_IN_DESCRIPTOR) {\n descriptor.value = value;\n delete obj.getter[name];\n delete obj.setter[name];\n }\n try {\n Object.defineProperty(obj.properties, name, descriptor);\n } catch (e) {\n this.throwException(this.TYPE_ERROR, \"Cannot redefine property: \" + name);\n }\n } else {\n // Set the property.\n if (value === Interpreter.VALUE_IN_DESCRIPTOR) {\n throw ReferenceError(\"Value not specified.\");\n }\n // Determine the parent (possibly self) where the property is defined.\n var defObj = obj;\n while (!(name in defObj.properties)) {\n defObj = this.getPrototype(defObj);\n if (!defObj) {\n // This is a new property.\n defObj = obj;\n break;\n }\n }\n if (defObj.setter && defObj.setter[name]) {\n return defObj.setter[name];\n }\n if (defObj.getter && defObj.getter[name]) {\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot set property '\" + name + \"' of object '\" + obj + \"' which only has a getter\",\n );\n }\n } else {\n // No setter, simple assignment.\n try {\n obj.properties[name] = value;\n } catch (e) {\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot assign to read only \" + \"property '\" + name + \"' of object '\" + obj + \"'\",\n );\n }\n }\n }\n }\n};\n\n/**\n * Convenience method for adding a native function as a non-enumerable property\n * onto an object's prototype.\n * @param {!Interpreter.Object} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {!Function} wrapper Function object.\n */\nInterpreter.prototype.setNativeFunctionPrototype = function (obj, name, wrapper) {\n this.setProperty(\n obj.properties[\"prototype\"],\n name,\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n};\n\n/**\n * Returns the current scope from the stateStack.\n * @return {!Interpreter.Object} Current scope dictionary.\n */\nInterpreter.prototype.getScope = function () {\n var scope = this.stateStack[this.stateStack.length - 1].scope;\n if (!scope) {\n throw Error(\"No scope found.\");\n }\n return scope;\n};\n\n/**\n * Create a new scope dictionary.\n * @param {!Object} node AST node defining the scope container\n * (e.g. a function).\n * @param {Interpreter.Object} parentScope Scope to link to.\n * @return {!Interpreter.Object} New scope.\n */\nInterpreter.prototype.createScope = function (node, parentScope) {\n var scope = this.createObjectProto(null);\n scope.parentScope = parentScope;\n if (!parentScope) {\n this.initGlobalScope(scope);\n }\n this.populateScope_(node, scope);\n\n // Determine if this scope starts with 'use strict'.\n scope.strict = false;\n if (parentScope && parentScope.strict) {\n scope.strict = true;\n } else {\n var firstNode = node[\"body\"] && node[\"body\"][0];\n if (\n firstNode &&\n firstNode.expression &&\n firstNode.expression[\"type\"] === \"Literal\" &&\n firstNode.expression.value === \"use strict\"\n ) {\n scope.strict = true;\n }\n }\n return scope;\n};\n\n/**\n * Create a new special scope dictionary. Similar to createScope(), but\n * doesn't assume that the scope is for a function body.\n * This is used for 'catch' clauses and 'with' statements.\n * @param {!Interpreter.Object} parentScope Scope to link to.\n * @param {Interpreter.Object=} opt_scope Optional object to transform into\n * scope.\n * @return {!Interpreter.Object} New scope.\n */\nInterpreter.prototype.createSpecialScope = function (parentScope, opt_scope) {\n if (!parentScope) {\n throw Error(\"parentScope required\");\n }\n var scope = opt_scope || this.createObjectProto(null);\n scope.parentScope = parentScope;\n scope.strict = parentScope.strict;\n return scope;\n};\n\n/**\n * Retrieves a value from the scope chain.\n * @param {string} name Name of variable.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line number\n * @return {Interpreter.Value} Any value.\n * May be flagged as being a getter and thus needing immediate execution\n * (rather than being the value of the property).\n */\nInterpreter.prototype.getValueFromScope = function (name, node) {\n var scope = this.getScope();\n while (scope && scope !== this.global) {\n if (name in scope.properties) {\n return scope.properties[name];\n }\n scope = scope.parentScope;\n }\n // The root scope is also an object which has inherited properties and\n // could also have getters.\n if (scope === this.global && this.hasProperty(scope, name)) {\n return this.getProperty(scope, name);\n }\n // Typeof operator is unique: it can safely look at non-defined variables.\n var prevNode = this.stateStack[this.stateStack.length - 1].node;\n if (prevNode[\"type\"] === \"UnaryExpression\" && prevNode[\"operator\"] === \"typeof\") {\n return undefined;\n }\n\n var lineNum;\n if (node != null && node.loc != null && node.loc.start != null) {\n lineNum = node.loc.start.line;\n }\n this.throwException(this.REFERENCE_ERROR, name + \" is not defined\", lineNum);\n};\n\n/**\n * Sets a value to the current scope.\n * @param {string} name Name of variable.\n * @param {Interpreter.Value} value Value.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setValueToScope = function (name, value) {\n var scope = this.getScope();\n var strict = scope.strict;\n while (scope && scope !== this.global) {\n if (name in scope.properties) {\n scope.properties[name] = value;\n return undefined;\n }\n scope = scope.parentScope;\n }\n // The root scope is also an object which has readonly properties and\n // could also have setters.\n if (scope === this.global && (!strict || this.hasProperty(scope, name))) {\n return this.setProperty(scope, name, value);\n }\n this.throwException(this.REFERENCE_ERROR, name + \" is not defined\");\n};\n\n/**\n * Create a new scope for the given node.\n * @param {!Object} node AST node (program or function).\n * @param {!Interpreter.Object} scope Scope dictionary to populate.\n * @private\n */\nInterpreter.prototype.populateScope_ = function (node, scope) {\n if (node[\"type\"] === \"VariableDeclaration\") {\n for (var i = 0; i < node[\"declarations\"].length; i++) {\n this.setProperty(scope, node[\"declarations\"][i][\"id\"][\"name\"], undefined, Interpreter.VARIABLE_DESCRIPTOR);\n }\n } else if (node[\"type\"] === \"FunctionDeclaration\") {\n this.setProperty(scope, node[\"id\"][\"name\"], this.createFunction(node, scope), Interpreter.VARIABLE_DESCRIPTOR);\n return; // Do not recurse into function.\n } else if (node[\"type\"] === \"FunctionExpression\") {\n return; // Do not recurse into function.\n } else if (node[\"type\"] === \"ExpressionStatement\") {\n return; // Expressions can't contain variable/function declarations.\n }\n var nodeClass = node[\"constructor\"];\n for (var name in node) {\n var prop = node[name];\n if (prop && typeof prop === \"object\") {\n if (Array.isArray(prop)) {\n for (var i = 0; i < prop.length; i++) {\n if (prop[i] && prop[i].constructor === nodeClass) {\n this.populateScope_(prop[i], scope);\n }\n }\n } else {\n if (prop.constructor === nodeClass) {\n this.populateScope_(prop, scope);\n }\n }\n }\n }\n};\n\n/**\n * Remove start and end values from AST, or set start and end values to a\n * constant value. Used to remove highlighting from polyfills and to set\n * highlighting in an eval to cover the entire eval expression.\n * @param {!Object} node AST node.\n * @param {number=} start Starting character of all nodes, or undefined.\n * @param {number=} end Ending character of all nodes, or undefined.\n * @private\n */\nInterpreter.prototype.stripLocations_ = function (node, start, end) {\n if (start) {\n node[\"start\"] = start;\n } else {\n delete node[\"start\"];\n }\n if (end) {\n node[\"end\"] = end;\n } else {\n delete node[\"end\"];\n }\n for (var name in node) {\n if (node.hasOwnProperty(name)) {\n var prop = node[name];\n if (prop && typeof prop === \"object\") {\n this.stripLocations_(prop, start, end);\n }\n }\n }\n};\n\n/**\n * Is the current state directly being called with as a construction with 'new'.\n * @return {boolean} True if 'new foo()', false if 'foo()'.\n */\nInterpreter.prototype.calledWithNew = function () {\n return this.stateStack[this.stateStack.length - 1].isConstructor;\n};\n\n/**\n * Gets a value from the scope chain or from an object property.\n * @param {!Array} ref Name of variable or object/propname tuple.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line number\n * @return {Interpreter.Value} Any value.\n * May be flagged as being a getter and thus needing immediate execution\n * (rather than being the value of the property).\n */\nInterpreter.prototype.getValue = function (ref, node) {\n if (ref[0] === Interpreter.SCOPE_REFERENCE) {\n // A null/varname variable lookup.\n return this.getValueFromScope(ref[1], node);\n } else {\n // An obj/prop components tuple (foo.bar).\n return this.getProperty(ref[0], ref[1], node);\n }\n};\n\n/**\n * Sets a value to the scope chain or to an object property.\n * @param {!Array} ref Name of variable or object/propname tuple.\n * @param {Interpreter.Value} value Value.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setValue = function (ref, value) {\n if (ref[0] === Interpreter.SCOPE_REFERENCE) {\n // A null/varname variable lookup.\n return this.setValueToScope(ref[1], value);\n } else {\n // An obj/prop components tuple (foo.bar).\n return this.setProperty(ref[0], ref[1], value);\n }\n};\n\n/**\n * Completion Value Types.\n * @enum {number}\n */\nInterpreter.Completion = {\n NORMAL: 0,\n BREAK: 1,\n CONTINUE: 2,\n RETURN: 3,\n THROW: 4,\n};\n\n/**\n * Throw an exception in the interpreter that can be handled by an\n * interpreter try/catch statement. If unhandled, a real exception will\n * be thrown. Can be called with either an error class and a message, or\n * with an actual object to be thrown.\n * @param {!Interpreter.Object} errorClass Type of error (if message is\n * provided) or the value to throw (if no message).\n * @param {string=} opt_message Message being thrown.\n */\nInterpreter.prototype.throwException = function (errorClass, opt_message, lineNumber) {\n if (opt_message === undefined) {\n var error = errorClass; // This is a value to throw, not an error class.\n } else {\n var error = this.createObject(errorClass);\n this.setProperty(error, \"message\", opt_message, Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n var lineNumErrorMsg;\n if (lineNumber != null) {\n lineNumErrorMsg = this.getErrorLineNumberMessage(lineNumber);\n }\n this.unwind(Interpreter.Completion.THROW, error, undefined, lineNumErrorMsg);\n // Abort anything related to the current step.\n throw Interpreter.STEP_ERROR;\n};\n\n/**\n * Unwind the stack to the innermost relevant enclosing TryStatement,\n * For/ForIn/WhileStatement or Call/NewExpression. If this results in\n * the stack being completely unwound the thread will be terminated\n * and the appropriate error being thrown.\n * @param {Interpreter.Completion} type Completion type.\n * @param {Interpreter.Value=} value Value computed, returned or thrown.\n * @param {string=} label Target label for break or return.\n */\nInterpreter.prototype.unwind = function (type, value, label, lineNumberMsg = \"\") {\n if (type === Interpreter.Completion.NORMAL) {\n throw TypeError(\"Should not unwind for NORMAL completions\");\n }\n\n for (var stack = this.stateStack; stack.length > 0; stack.pop()) {\n var state = stack[stack.length - 1];\n switch (state.node[\"type\"]) {\n case \"TryStatement\":\n state.cv = { type: type, value: value, label: label };\n return;\n case \"CallExpression\":\n case \"NewExpression\":\n if (type === Interpreter.Completion.RETURN) {\n state.value = value;\n return;\n } else if (type !== Interpreter.Completion.THROW) {\n throw Error(\"Unsynatctic break/continue not rejected by Acorn\");\n }\n }\n if (type === Interpreter.Completion.BREAK) {\n if (label ? state.labels && state.labels.indexOf(label) !== -1 : state.isLoop || state.isSwitch) {\n stack.pop();\n return;\n }\n } else if (type === Interpreter.Completion.CONTINUE) {\n if (label ? state.labels && state.labels.indexOf(label) !== -1 : state.isLoop) {\n return;\n }\n }\n }\n\n // Unhandled completion. Throw a real error.\n var realError;\n if (this.isa(value, this.ERROR)) {\n var errorTable = {\n EvalError: EvalError,\n RangeError: RangeError,\n ReferenceError: ReferenceError,\n SyntaxError: SyntaxError,\n TypeError: TypeError,\n URIError: URIError,\n };\n var name = this.getProperty(value, \"name\").toString();\n var message = this.getProperty(value, \"message\").valueOf();\n var type = errorTable[name] || Error;\n realError = type(message + lineNumberMsg);\n } else {\n realError = String(value) + lineNumberMsg;\n }\n throw realError;\n};\n\n/**\n * Create a call to a getter function.\n * @param {!Interpreter.Object} func Function to execute.\n * @param {!Interpreter.Object|!Array} left\n * Name of variable or object/propname tuple.\n * @private\n */\nInterpreter.prototype.createGetter_ = function (func, left) {\n // Normally 'this' will be specified as the object component (o.x).\n // Sometimes 'this' is explicitly provided (o).\n var funcThis = Array.isArray(left) ? left[0] : left;\n var node = new this.nodeConstructor();\n node[\"type\"] = \"CallExpression\";\n var state = new Interpreter.State(node, this.stateStack[this.stateStack.length - 1].scope);\n state.doneCallee_ = true;\n state.funcThis_ = funcThis;\n state.func_ = func;\n state.doneArgs_ = true;\n state.arguments_ = [];\n return state;\n};\n\n/**\n * Create a call to a setter function.\n * @param {!Interpreter.Object} func Function to execute.\n * @param {!Interpreter.Object|!Array} left\n * Name of variable or object/propname tuple.\n * @param {Interpreter.Value} value Value to set.\n * @private\n */\nInterpreter.prototype.createSetter_ = function (func, left, value) {\n // Normally 'this' will be specified as the object component (o.x).\n // Sometimes 'this' is implicitly the global object (x).\n var funcThis = Array.isArray(left) ? left[0] : this.global;\n var node = new this.nodeConstructor();\n node[\"type\"] = \"CallExpression\";\n var state = new Interpreter.State(node, this.stateStack[this.stateStack.length - 1].scope);\n state.doneCallee_ = true;\n state.funcThis_ = funcThis;\n state.func_ = func;\n state.doneArgs_ = true;\n state.arguments_ = [value];\n return state;\n};\n\n/**\n * Class for a state.\n * @param {!Object} node AST node for the state.\n * @param {!Interpreter.Object} scope Scope object for the state.\n * @constructor\n */\nInterpreter.State = function (node, scope) {\n this.node = node;\n this.scope = scope;\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// Functions to handle each node type.\n///////////////////////////////////////////////////////////////////////////////\n\nInterpreter.prototype[\"stepArrayExpression\"] = function (stack, state, node) {\n var elements = node[\"elements\"];\n var n = state.n_ || 0;\n if (!state.array_) {\n state.array_ = this.createObjectProto(this.ARRAY_PROTO);\n state.array_.properties.length = elements.length;\n } else {\n this.setProperty(state.array_, n, state.value);\n n++;\n }\n while (n < elements.length) {\n // Skip missing elements - they're not defined, not undefined.\n if (elements[n]) {\n state.n_ = n;\n return new Interpreter.State(elements[n], state.scope);\n }\n n++;\n }\n stack.pop();\n stack[stack.length - 1].value = state.array_;\n};\n\nInterpreter.prototype[\"stepAssignmentExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n var nextState = new Interpreter.State(node[\"left\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (!state.doneRight_) {\n if (!state.leftReference_) {\n state.leftReference_ = state.value;\n }\n if (state.doneGetter_) {\n state.leftValue_ = state.value;\n }\n if (!state.doneGetter_ && node[\"operator\"] !== \"=\") {\n var leftValue = this.getValue(state.leftReference_, node);\n state.leftValue_ = leftValue;\n if (leftValue && typeof leftValue === \"object\" && leftValue.isGetter) {\n // Clear the getter flag and call the getter function.\n leftValue.isGetter = false;\n state.doneGetter_ = true;\n var func = /** @type {!Interpreter.Object} */ (leftValue);\n return this.createGetter_(func, state.leftReference_);\n }\n }\n state.doneRight_ = true;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n if (state.doneSetter_) {\n // Return if setter function.\n // Setter method on property has completed.\n // Ignore its return value, and use the original set value instead.\n stack.pop();\n stack[stack.length - 1].value = state.setterValue_;\n return;\n }\n var value = state.leftValue_;\n var rightValue = state.value;\n switch (node[\"operator\"]) {\n case \"=\":\n value = rightValue;\n break;\n case \"+=\":\n value += rightValue;\n break;\n case \"-=\":\n value -= rightValue;\n break;\n case \"*=\":\n value *= rightValue;\n break;\n case \"/=\":\n value /= rightValue;\n break;\n case \"%=\":\n value %= rightValue;\n break;\n case \"<<=\":\n value <<= rightValue;\n break;\n case \">>=\":\n value >>= rightValue;\n break;\n case \">>>=\":\n value >>>= rightValue;\n break;\n case \"&=\":\n value &= rightValue;\n break;\n case \"^=\":\n value ^= rightValue;\n break;\n case \"|=\":\n value |= rightValue;\n break;\n default:\n throw SyntaxError(\"Unknown assignment expression: \" + node[\"operator\"]);\n }\n var setter = this.setValue(state.leftReference_, value);\n if (setter) {\n state.doneSetter_ = true;\n state.setterValue_ = value;\n return this.createSetter_(setter, state.leftReference_, value);\n }\n // Return if no setter function.\n stack.pop();\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepBinaryExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n if (!state.doneRight_) {\n state.doneRight_ = true;\n state.leftValue_ = state.value;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n stack.pop();\n var leftValue = state.leftValue_;\n var rightValue = state.value;\n var value;\n switch (node[\"operator\"]) {\n case \"==\":\n value = leftValue == rightValue;\n break;\n case \"!=\":\n value = leftValue != rightValue;\n break;\n case \"===\":\n value = leftValue === rightValue;\n break;\n case \"!==\":\n value = leftValue !== rightValue;\n break;\n case \">\":\n value = leftValue > rightValue;\n break;\n case \">=\":\n value = leftValue >= rightValue;\n break;\n case \"<\":\n value = leftValue < rightValue;\n break;\n case \"<=\":\n value = leftValue <= rightValue;\n break;\n case \"+\":\n value = leftValue + rightValue;\n break;\n case \"-\":\n value = leftValue - rightValue;\n break;\n case \"*\":\n value = leftValue * rightValue;\n break;\n case \"/\":\n value = leftValue / rightValue;\n break;\n case \"%\":\n value = leftValue % rightValue;\n break;\n case \"&\":\n value = leftValue & rightValue;\n break;\n case \"|\":\n value = leftValue | rightValue;\n break;\n case \"^\":\n value = leftValue ^ rightValue;\n break;\n case \"<<\":\n value = leftValue << rightValue;\n break;\n case \">>\":\n value = leftValue >> rightValue;\n break;\n case \">>>\":\n value = leftValue >>> rightValue;\n break;\n case \"in\":\n if (!rightValue || !rightValue.isObject) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, \"'in' expects an object, not '\" + rightValue + \"'\", lineNum);\n }\n value = this.hasProperty(rightValue, leftValue);\n break;\n case \"instanceof\":\n if (!this.isa(rightValue, this.FUNCTION)) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, \"Right-hand side of instanceof is not an object\", lineNum);\n }\n value = leftValue.isObject ? this.isa(leftValue, rightValue) : false;\n break;\n default:\n throw SyntaxError(\"Unknown binary operator: \" + node[\"operator\"]);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepBlockStatement\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"body\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n};\n\nInterpreter.prototype[\"stepBreakStatement\"] = function (stack, state, node) {\n var label = node[\"label\"] && node[\"label\"][\"name\"];\n this.unwind(Interpreter.Completion.BREAK, undefined, label);\n};\n\nInterpreter.prototype[\"stepCallExpression\"] = function (stack, state, node) {\n if (!state.doneCallee_) {\n state.doneCallee_ = 1;\n // Components needed to determine value of 'this'.\n var nextState = new Interpreter.State(node[\"callee\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (state.doneCallee_ === 1) {\n // Determine value of the function.\n state.doneCallee_ = 2;\n var func = state.value;\n if (Array.isArray(func)) {\n state.func_ = this.getValue(func, node);\n if (func[0] === Interpreter.SCOPE_REFERENCE) {\n // (Globally or locally) named function. Is it named 'eval'?\n state.directEval_ = func[1] === \"eval\";\n } else {\n // Method function, 'this' is object (ignored if invoked as 'new').\n state.funcThis_ = func[0];\n }\n func = state.func_;\n if (func && typeof func === \"object\" && func.isGetter) {\n // Clear the getter flag and call the getter function.\n func.isGetter = false;\n state.doneCallee_ = 1;\n return this.createGetter_(/** @type {!Interpreter.Object} */ (func), state.value);\n }\n } else {\n // Already evaluated function: (function(){...})();\n state.func_ = func;\n }\n state.arguments_ = [];\n state.n_ = 0;\n }\n var func = state.func_;\n if (!state.doneArgs_) {\n if (state.n_ !== 0) {\n state.arguments_.push(state.value);\n }\n if (node[\"arguments\"][state.n_]) {\n return new Interpreter.State(node[\"arguments\"][state.n_++], state.scope);\n }\n // Determine value of 'this' in function.\n if (node[\"type\"] === \"NewExpression\") {\n if (func.illegalConstructor) {\n // Illegal: new escape();\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func + \" is not a constructor\", lineNum);\n }\n // Constructor, 'this' is new object.\n var proto = func.properties[\"prototype\"];\n if (typeof proto !== \"object\" || proto === null) {\n // Non-object prototypes default to Object.prototype.\n proto = this.OBJECT_PROTO;\n }\n state.funcThis_ = this.createObjectProto(proto);\n state.isConstructor = true;\n } else if (state.funcThis_ === undefined) {\n // Global function, 'this' is global object (or 'undefined' if strict).\n state.funcThis_ = state.scope.strict ? undefined : this.global;\n }\n state.doneArgs_ = true;\n }\n if (!state.doneExec_) {\n state.doneExec_ = true;\n if (!func || !func.isObject) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func + \" is not a function\", lineNum);\n }\n var funcNode = func.node;\n if (funcNode) {\n var scope = this.createScope(funcNode[\"body\"], func.parentScope);\n // Add all arguments.\n for (var i = 0; i < funcNode[\"params\"].length; i++) {\n var paramName = funcNode[\"params\"][i][\"name\"];\n var paramValue = state.arguments_.length > i ? state.arguments_[i] : undefined;\n this.setProperty(scope, paramName, paramValue);\n }\n // Build arguments variable.\n var argsList = this.createObjectProto(this.ARRAY_PROTO);\n for (var i = 0; i < state.arguments_.length; i++) {\n this.setProperty(argsList, i, state.arguments_[i]);\n }\n this.setProperty(scope, \"arguments\", argsList);\n // Add the function's name (var x = function foo(){};)\n var name = funcNode[\"id\"] && funcNode[\"id\"][\"name\"];\n if (name) {\n this.setProperty(scope, name, func);\n }\n this.setProperty(scope, \"this\", state.funcThis_, Interpreter.READONLY_DESCRIPTOR);\n state.value = undefined; // Default value if no explicit return.\n return new Interpreter.State(funcNode[\"body\"], scope);\n } else if (func.eval) {\n var code = state.arguments_[0];\n if (typeof code !== \"string\") {\n // JS does not parse String objects:\n // eval(new String('1 + 1')) -> '1 + 1'\n state.value = code;\n } else {\n try {\n var ast = acorn.parse(code.toString(), Interpreter.PARSE_OPTIONS);\n } catch (e) {\n // Acorn threw a SyntaxError. Rethrow as a trappable error.\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.SYNTAX_ERROR, \"Invalid code: \" + e.message, lineNum);\n }\n var evalNode = new this.nodeConstructor();\n evalNode[\"type\"] = \"EvalProgram_\";\n evalNode[\"body\"] = ast[\"body\"];\n this.stripLocations_(evalNode, node[\"start\"], node[\"end\"]);\n // Create new scope and update it with definitions in eval().\n var scope = state.directEval_ ? state.scope : this.global;\n if (scope.strict) {\n // Strict mode get its own scope in eval.\n scope = this.createScope(ast, scope);\n } else {\n // Non-strict mode pollutes the current scope.\n this.populateScope_(ast, scope);\n }\n this.value = undefined; // Default value if no code.\n return new Interpreter.State(evalNode, scope);\n }\n } else if (func.nativeFunc) {\n state.value = func.nativeFunc.apply(state.funcThis_, state.arguments_);\n } else if (func.asyncFunc) {\n var thisInterpreter = this;\n var callback = function (value) {\n state.value = value;\n thisInterpreter.paused_ = false;\n };\n var argsWithCallback = state.arguments_.concat(callback);\n this.paused_ = true;\n func.asyncFunc.apply(state.funcThis_, argsWithCallback);\n return;\n } else {\n /* A child of a function is a function but is not callable. For example:\n var F = function() {};\n F.prototype = escape;\n var f = new F();\n f();\n */\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func.class + \" is not a function\", lineNum);\n }\n } else {\n // Execution complete. Put the return value on the stack.\n stack.pop();\n if (state.isConstructor && typeof state.value !== \"object\") {\n stack[stack.length - 1].value = state.funcThis_;\n } else {\n stack[stack.length - 1].value = state.value;\n }\n }\n};\n\nInterpreter.prototype[\"stepCatchClause\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n // Create an empty scope.\n var scope = this.createSpecialScope(state.scope);\n // Add the argument.\n this.setProperty(scope, node[\"param\"][\"name\"], state.throwValue);\n // Execute catch clause.\n return new Interpreter.State(node[\"body\"], scope);\n } else {\n stack.pop();\n }\n};\n\nInterpreter.prototype[\"stepConditionalExpression\"] = function (stack, state, node) {\n var mode = state.mode_ || 0;\n if (mode === 0) {\n state.mode_ = 1;\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n if (mode === 1) {\n state.mode_ = 2;\n var value = Boolean(state.value);\n if (value && node[\"consequent\"]) {\n // Execute 'if' block.\n return new Interpreter.State(node[\"consequent\"], state.scope);\n } else if (!value && node[\"alternate\"]) {\n // Execute 'else' block.\n return new Interpreter.State(node[\"alternate\"], state.scope);\n }\n // eval('1;if(false){2}') -> undefined\n this.value = undefined;\n }\n stack.pop();\n if (node[\"type\"] === \"ConditionalExpression\") {\n stack[stack.length - 1].value = state.value;\n }\n};\n\nInterpreter.prototype[\"stepContinueStatement\"] = function (stack, state, node) {\n var label = node[\"label\"] && node[\"label\"][\"name\"];\n this.unwind(Interpreter.Completion.CONTINUE, undefined, label);\n};\n\nInterpreter.prototype[\"stepDebuggerStatement\"] = function (stack, state, node) {\n // Do nothing. May be overridden by developers.\n stack.pop();\n};\n\nInterpreter.prototype[\"stepDoWhileStatement\"] = function (stack, state, node) {\n if (node[\"type\"] === \"DoWhileStatement\" && state.test_ === undefined) {\n // First iteration of do/while executes without checking test.\n state.value = true;\n state.test_ = true;\n }\n if (!state.test_) {\n state.test_ = true;\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n if (!state.value) {\n // Done, exit loop.\n stack.pop();\n } else if (node[\"body\"]) {\n // Execute the body.\n state.test_ = false;\n state.isLoop = true;\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n};\n\nInterpreter.prototype[\"stepEmptyStatement\"] = function (stack, state, node) {\n stack.pop();\n};\n\nInterpreter.prototype[\"stepEvalProgram_\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"body\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n stack[stack.length - 1].value = this.value;\n};\n\nInterpreter.prototype[\"stepExpressionStatement\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"expression\"], state.scope);\n }\n stack.pop();\n // Save this value to interpreter.value for use as a return value if\n // this code is inside an eval function.\n this.value = state.value;\n};\n\nInterpreter.prototype[\"stepForInStatement\"] = function (stack, state, node) {\n // First, initialize a variable if exists. Only do so once, ever.\n if (!state.doneInit_) {\n state.doneInit_ = true;\n if (node[\"left\"][\"declarations\"] && node[\"left\"][\"declarations\"][0][\"init\"]) {\n if (state.scope.strict) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(\n this.SYNTAX_ERROR,\n \"for-in loop variable declaration may not have an initializer.\",\n lineNum,\n );\n }\n // Variable initialization: for (var x = 4 in y)\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n }\n // Second, look up the object. Only do so once, ever.\n if (!state.doneObject_) {\n state.doneObject_ = true;\n if (!state.variable_) {\n state.variable_ = state.value;\n }\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n if (!state.isLoop) {\n // First iteration.\n state.isLoop = true;\n state.object_ = state.value;\n state.visited_ = Object.create(null);\n }\n // Third, find the property name for this iteration.\n if (state.name_ === undefined) {\n gotPropName: while (true) {\n if (state.object_ && state.object_.isObject) {\n if (!state.props_) {\n state.props_ = Object.getOwnPropertyNames(state.object_.properties);\n }\n while (true) {\n var prop = state.props_.shift();\n if (prop === undefined) {\n break; // Reached end of this object's properties.\n }\n if (!Object.prototype.hasOwnProperty.call(state.object_.properties, prop)) {\n continue; // Property has been deleted in the loop.\n }\n if (state.visited_[prop]) {\n continue; // Already seen this property on a child.\n }\n state.visited_[prop] = true;\n if (!Object.prototype.propertyIsEnumerable.call(state.object_.properties, prop)) {\n continue; // Skip non-enumerable property.\n }\n state.name_ = prop;\n break gotPropName;\n }\n } else if (state.object_ !== null && state.object_ !== undefined) {\n // Primitive value (other than null or undefined).\n if (!state.props_) {\n state.props_ = Object.getOwnPropertyNames(state.object_);\n }\n while (true) {\n var prop = state.props_.shift();\n if (prop === undefined) {\n break; // Reached end of this value's properties.\n }\n state.visited_[prop] = true;\n if (!Object.prototype.propertyIsEnumerable.call(state.object_, prop)) {\n continue; // Skip non-enumerable property.\n }\n state.name_ = prop;\n break gotPropName;\n }\n }\n state.object_ = this.getPrototype(state.object_);\n state.props_ = null;\n if (state.object_ === null) {\n // Done, exit loop.\n stack.pop();\n return;\n }\n }\n }\n // Fourth, find the variable\n if (!state.doneVariable_) {\n state.doneVariable_ = true;\n var left = node[\"left\"];\n if (left[\"type\"] === \"VariableDeclaration\") {\n // Inline variable declaration: for (var x in y)\n state.variable_ = [Interpreter.SCOPE_REFERENCE, left[\"declarations\"][0][\"id\"][\"name\"]];\n } else {\n // Arbitrary left side: for (foo().bar in y)\n state.variable_ = null;\n var nextState = new Interpreter.State(left, state.scope);\n nextState.components = true;\n return nextState;\n }\n }\n if (!state.variable_) {\n state.variable_ = state.value;\n }\n // Fifth, set the variable.\n if (!state.doneSetter_) {\n state.doneSetter_ = true;\n var value = state.name_;\n var setter = this.setValue(state.variable_, value);\n if (setter) {\n return this.createSetter_(setter, state.variable_, value);\n }\n }\n // Next step will be step three.\n state.name_ = undefined;\n // Reevaluate the variable since it could be a setter on the global object.\n state.doneVariable_ = false;\n state.doneSetter_ = false;\n // Sixth and finally, execute the body if there was one. this.\n if (node[\"body\"]) {\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n};\n\nInterpreter.prototype[\"stepForStatement\"] = function (stack, state, node) {\n var mode = state.mode_ || 0;\n if (mode === 0) {\n state.mode_ = 1;\n if (node[\"init\"]) {\n return new Interpreter.State(node[\"init\"], state.scope);\n }\n } else if (mode === 1) {\n state.mode_ = 2;\n if (node[\"test\"]) {\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n } else if (mode === 2) {\n state.mode_ = 3;\n if (node[\"test\"] && !state.value) {\n // Done, exit loop.\n stack.pop();\n } else {\n // Execute the body.\n state.isLoop = true;\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n } else if (mode === 3) {\n state.mode_ = 1;\n if (node[\"update\"]) {\n return new Interpreter.State(node[\"update\"], state.scope);\n }\n }\n};\n\nInterpreter.prototype[\"stepFunctionDeclaration\"] = function (stack, state, node) {\n // This was found and handled when the scope was populated.\n stack.pop();\n};\n\nInterpreter.prototype[\"stepFunctionExpression\"] = function (stack, state, node) {\n stack.pop();\n stack[stack.length - 1].value = this.createFunction(node, state.scope);\n};\n\nInterpreter.prototype[\"stepIdentifier\"] = function (stack, state, node) {\n stack.pop();\n if (state.components) {\n stack[stack.length - 1].value = [Interpreter.SCOPE_REFERENCE, node[\"name\"]];\n return;\n }\n var value = this.getValueFromScope(node[\"name\"], node);\n // An identifier could be a getter if it's a property on the global object.\n if (value && typeof value === \"object\" && value.isGetter) {\n // Clear the getter flag and call the getter function.\n value.isGetter = false;\n var scope = state.scope;\n while (!this.hasProperty(scope, node[\"name\"])) {\n scope = scope.parentScope;\n }\n var func = /** @type {!Interpreter.Object} */ (value);\n return this.createGetter_(func, this.global);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepIfStatement\"] = Interpreter.prototype[\"stepConditionalExpression\"];\n\nInterpreter.prototype[\"stepLabeledStatement\"] = function (stack, state, node) {\n // No need to hit this node again on the way back up the stack.\n stack.pop();\n // Note that a statement might have multiple labels.\n var labels = state.labels || [];\n labels.push(node[\"label\"][\"name\"]);\n var nextState = new Interpreter.State(node[\"body\"], state.scope);\n nextState.labels = labels;\n return nextState;\n};\n\nInterpreter.prototype[\"stepLiteral\"] = function (stack, state, node) {\n stack.pop();\n var value = node[\"value\"];\n if (value instanceof RegExp) {\n var pseudoRegexp = this.createObjectProto(this.REGEXP_PROTO);\n this.populateRegExp(pseudoRegexp, value);\n value = pseudoRegexp;\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepLogicalExpression\"] = function (stack, state, node) {\n if (node[\"operator\"] !== \"&&\" && node[\"operator\"] !== \"||\") {\n throw SyntaxError(\"Unknown logical operator: \" + node[\"operator\"]);\n }\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n if (!state.doneRight_) {\n if ((node[\"operator\"] === \"&&\" && !state.value) || (node[\"operator\"] === \"||\" && state.value)) {\n // Shortcut evaluation.\n stack.pop();\n stack[stack.length - 1].value = state.value;\n } else {\n state.doneRight_ = true;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n } else {\n stack.pop();\n stack[stack.length - 1].value = state.value;\n }\n};\n\nInterpreter.prototype[\"stepMemberExpression\"] = function (stack, state, node) {\n if (!state.doneObject_) {\n state.doneObject_ = true;\n return new Interpreter.State(node[\"object\"], state.scope);\n }\n var propName;\n if (!node[\"computed\"]) {\n state.object_ = state.value;\n // obj.foo -- Just access 'foo' directly.\n propName = node[\"property\"][\"name\"];\n } else if (!state.doneProperty_) {\n state.object_ = state.value;\n // obj[foo] -- Compute value of 'foo'.\n state.doneProperty_ = true;\n return new Interpreter.State(node[\"property\"], state.scope);\n } else {\n propName = state.value;\n }\n stack.pop();\n if (state.components) {\n stack[stack.length - 1].value = [state.object_, propName];\n } else {\n var value = this.getProperty(state.object_, propName);\n if (value && typeof value === \"object\" && value.isGetter) {\n // Clear the getter flag and call the getter function.\n value.isGetter = false;\n var func = /** @type {!Interpreter.Object} */ (value);\n return this.createGetter_(func, state.object_);\n }\n stack[stack.length - 1].value = value;\n }\n};\n\nInterpreter.prototype[\"stepNewExpression\"] = Interpreter.prototype[\"stepCallExpression\"];\n\nInterpreter.prototype[\"stepObjectExpression\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var property = node[\"properties\"][n];\n if (!state.object_) {\n // First execution.\n state.object_ = this.createObjectProto(this.OBJECT_PROTO);\n state.properties_ = Object.create(null);\n } else {\n // Determine property name.\n var key = property[\"key\"];\n if (key[\"type\"] === \"Identifier\") {\n var propName = key[\"name\"];\n } else if (key[\"type\"] === \"Literal\") {\n var propName = key[\"value\"];\n } else {\n throw SyntaxError(\"Unknown object structure: \" + key[\"type\"]);\n }\n // Set the property computed in the previous execution.\n if (!state.properties_[propName]) {\n // Create temp object to collect value, getter, and/or setter.\n state.properties_[propName] = {};\n }\n state.properties_[propName][property[\"kind\"]] = state.value;\n state.n_ = ++n;\n property = node[\"properties\"][n];\n }\n if (property) {\n return new Interpreter.State(property[\"value\"], state.scope);\n }\n for (var key in state.properties_) {\n var kinds = state.properties_[key];\n if (\"get\" in kinds || \"set\" in kinds) {\n // Set a property with a getter or setter.\n var descriptor = {\n configurable: true,\n enumerable: true,\n get: kinds[\"get\"],\n set: kinds[\"set\"],\n };\n this.setProperty(state.object_, key, null, descriptor);\n } else {\n // Set a normal property with a value.\n this.setProperty(state.object_, key, kinds[\"init\"]);\n }\n }\n stack.pop();\n stack[stack.length - 1].value = state.object_;\n};\n\nInterpreter.prototype[\"stepProgram\"] = function (stack, state, node) {\n var expression = node[\"body\"].shift();\n if (expression) {\n state.done = false;\n return new Interpreter.State(expression, state.scope);\n }\n state.done = true;\n // Don't pop the stateStack.\n // Leave the root scope on the tree in case the program is appended to.\n};\n\nInterpreter.prototype[\"stepReturnStatement\"] = function (stack, state, node) {\n if (node[\"argument\"] && !state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"argument\"], state.scope);\n }\n this.unwind(Interpreter.Completion.RETURN, state.value, undefined);\n};\n\nInterpreter.prototype[\"stepSequenceExpression\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"expressions\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n stack[stack.length - 1].value = state.value;\n};\n\nInterpreter.prototype[\"stepSwitchStatement\"] = function (stack, state, node) {\n if (!state.test_) {\n state.test_ = 1;\n return new Interpreter.State(node[\"discriminant\"], state.scope);\n }\n if (state.test_ === 1) {\n state.test_ = 2;\n // Preserve switch value between case tests.\n state.switchValue_ = state.value;\n state.defaultCase_ = -1;\n }\n\n while (true) {\n var index = state.index_ || 0;\n var switchCase = node[\"cases\"][index];\n if (!state.matched_ && switchCase && !switchCase[\"test\"]) {\n // Test on the default case is null.\n // Bypass (but store) the default case, and get back to it later.\n state.defaultCase_ = index;\n state.index_ = index + 1;\n continue;\n }\n if (!switchCase && !state.matched_ && state.defaultCase_ !== -1) {\n // Ran through all cases, no match. Jump to the default.\n state.matched_ = true;\n state.index_ = state.defaultCase_;\n continue;\n }\n if (switchCase) {\n if (!state.matched_ && !state.tested_ && switchCase[\"test\"]) {\n state.tested_ = true;\n return new Interpreter.State(switchCase[\"test\"], state.scope);\n }\n if (state.matched_ || state.value === state.switchValue_) {\n state.matched_ = true;\n var n = state.n_ || 0;\n if (switchCase[\"consequent\"][n]) {\n state.isSwitch = true;\n state.n_ = n + 1;\n return new Interpreter.State(switchCase[\"consequent\"][n], state.scope);\n }\n }\n // Move on to next case.\n state.tested_ = false;\n state.n_ = 0;\n state.index_ = index + 1;\n } else {\n stack.pop();\n return;\n }\n }\n};\n\nInterpreter.prototype[\"stepThisExpression\"] = function (stack, state, node) {\n stack.pop();\n stack[stack.length - 1].value = this.getValueFromScope(\"this\", node);\n};\n\nInterpreter.prototype[\"stepThrowStatement\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"argument\"], state.scope);\n } else {\n this.throwException(state.value);\n }\n};\n\nInterpreter.prototype[\"stepTryStatement\"] = function (stack, state, node) {\n if (!state.doneBlock_) {\n state.doneBlock_ = true;\n return new Interpreter.State(node[\"block\"], state.scope);\n }\n if (state.cv && state.cv.type === Interpreter.Completion.THROW && !state.doneHandler_ && node[\"handler\"]) {\n state.doneHandler_ = true;\n var nextState = new Interpreter.State(node[\"handler\"], state.scope);\n nextState.throwValue = state.cv.value;\n state.cv = undefined; // This error has been handled, don't rethrow.\n return nextState;\n }\n if (!state.doneFinalizer_ && node[\"finalizer\"]) {\n state.doneFinalizer_ = true;\n return new Interpreter.State(node[\"finalizer\"], state.scope);\n }\n stack.pop();\n if (state.cv) {\n // There was no catch handler, or the catch/finally threw an error.\n // Throw the error up to a higher try.\n this.unwind(state.cv.type, state.cv.value, state.cv.label);\n }\n};\n\nInterpreter.prototype[\"stepUnaryExpression\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n var nextState = new Interpreter.State(node[\"argument\"], state.scope);\n nextState.components = node[\"operator\"] === \"delete\";\n return nextState;\n }\n stack.pop();\n var value = state.value;\n if (node[\"operator\"] === \"-\") {\n value = -value;\n } else if (node[\"operator\"] === \"+\") {\n value = +value;\n } else if (node[\"operator\"] === \"!\") {\n value = !value;\n } else if (node[\"operator\"] === \"~\") {\n value = ~value;\n } else if (node[\"operator\"] === \"delete\") {\n var result = true;\n // If value is not an array, then it is a primitive, or some other value.\n // If so, skip the delete and return true.\n if (Array.isArray(value)) {\n var obj = value[0];\n if (obj === Interpreter.SCOPE_REFERENCE) {\n // 'delete foo;' is the same as 'delete window.foo'.\n obj = state.scope;\n }\n var name = String(value[1]);\n try {\n delete obj.properties[name];\n } catch (e) {\n if (state.scope.strict) {\n this.throwException(this.TYPE_ERROR, \"Cannot delete property '\" + name + \"' of '\" + obj + \"'\");\n } else {\n result = false;\n }\n }\n }\n value = result;\n } else if (node[\"operator\"] === \"typeof\") {\n value = value && value.class === \"Function\" ? \"function\" : typeof value;\n } else if (node[\"operator\"] === \"void\") {\n value = undefined;\n } else {\n throw SyntaxError(\"Unknown unary operator: \" + node[\"operator\"]);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepUpdateExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n var nextState = new Interpreter.State(node[\"argument\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (!state.leftSide_) {\n state.leftSide_ = state.value;\n }\n if (state.doneGetter_) {\n state.leftValue_ = state.value;\n }\n if (!state.doneGetter_) {\n var leftValue = this.getValue(state.leftSide_, node);\n state.leftValue_ = leftValue;\n if (leftValue && typeof leftValue === \"object\" && leftValue.isGetter) {\n // Clear the getter flag and call the getter function.\n leftValue.isGetter = false;\n state.doneGetter_ = true;\n var func = /** @type {!Interpreter.Object} */ (leftValue);\n return this.createGetter_(func, state.leftSide_);\n }\n }\n if (state.doneSetter_) {\n // Return if setter function.\n // Setter method on property has completed.\n // Ignore its return value, and use the original set value instead.\n stack.pop();\n stack[stack.length - 1].value = state.setterValue_;\n return;\n }\n var leftValue = Number(state.leftValue_);\n var changeValue;\n if (node[\"operator\"] === \"++\") {\n changeValue = leftValue + 1;\n } else if (node[\"operator\"] === \"--\") {\n changeValue = leftValue - 1;\n } else {\n throw SyntaxError(\"Unknown update expression: \" + node[\"operator\"]);\n }\n var returnValue = node[\"prefix\"] ? changeValue : leftValue;\n var setter = this.setValue(state.leftSide_, changeValue);\n if (setter) {\n state.doneSetter_ = true;\n state.setterValue_ = returnValue;\n return this.createSetter_(setter, state.leftSide_, changeValue);\n }\n // Return if no setter function.\n stack.pop();\n stack[stack.length - 1].value = returnValue;\n};\n\nInterpreter.prototype[\"stepVariableDeclaration\"] = function (stack, state, node) {\n var declarations = node[\"declarations\"];\n var n = state.n_ || 0;\n var declarationNode = declarations[n];\n if (state.init_ && declarationNode) {\n // This setValue call never needs to deal with calling a setter function.\n // Note that this is setting the init value, not defining the variable.\n // Variable definition is done when scope is populated.\n this.setValueToScope(declarationNode[\"id\"][\"name\"], state.value);\n state.init_ = false;\n declarationNode = declarations[++n];\n }\n while (declarationNode) {\n // Skip any declarations that are not initialized. They have already\n // been defined as undefined in populateScope_.\n if (declarationNode[\"init\"]) {\n state.n_ = n;\n state.init_ = true;\n return new Interpreter.State(declarationNode[\"init\"], state.scope);\n }\n declarationNode = declarations[++n];\n }\n stack.pop();\n};\n\nInterpreter.prototype[\"stepWithStatement\"] = function (stack, state, node) {\n if (!state.doneObject_) {\n state.doneObject_ = true;\n return new Interpreter.State(node[\"object\"], state.scope);\n } else if (!state.doneBody_) {\n state.doneBody_ = true;\n var scope = this.createSpecialScope(state.scope, state.value);\n return new Interpreter.State(node[\"body\"], scope);\n } else {\n stack.pop();\n }\n};\n\nInterpreter.prototype[\"stepWhileStatement\"] = Interpreter.prototype[\"stepDoWhileStatement\"];\n\n// Preserve top-level API functions from being pruned/renamed by JS compilers.\n// Add others as needed.\n// The global object ('window' in a browser, 'global' in node.js) is 'this'.\n//this['Interpreter'] = Interpreter;\nInterpreter.prototype[\"step\"] = Interpreter.prototype.step;\nInterpreter.prototype[\"run\"] = Interpreter.prototype.run;\nInterpreter.prototype[\"appendCode\"] = Interpreter.prototype.appendCode;\nInterpreter.prototype[\"createObject\"] = Interpreter.prototype.createObject;\nInterpreter.prototype[\"createObjectProto\"] = Interpreter.prototype.createObjectProto;\nInterpreter.prototype[\"createAsyncFunction\"] = Interpreter.prototype.createAsyncFunction;\nInterpreter.prototype[\"createNativeFunction\"] = Interpreter.prototype.createNativeFunction;\nInterpreter.prototype[\"getProperty\"] = Interpreter.prototype.getProperty;\nInterpreter.prototype[\"setProperty\"] = Interpreter.prototype.setProperty;\nInterpreter.prototype[\"nativeToPseudo\"] = Interpreter.prototype.nativeToPseudo;\nInterpreter.prototype[\"pseudoToNative\"] = Interpreter.prototype.pseudoToNative;\n// Obsolete. Do not use.\nInterpreter.prototype[\"createPrimitive\"] = function (x) {\n return x;\n};\n\nexport { Interpreter };\n","import { CONSTANTS } from \"../../Constants\";\nimport { Server } from \"../Server\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nexport function calculateServerGrowth(server: Server, threads: number, p: IPlayer, cores = 1): number {\n const numServerGrowthCycles = Math.max(Math.floor(threads), 0);\n\n //Get adjusted growth rate, which accounts for server security\n const growthRate = CONSTANTS.ServerBaseGrowthRate;\n let adjGrowthRate = 1 + (growthRate - 1) / server.hackDifficulty;\n if (adjGrowthRate > CONSTANTS.ServerMaxGrowthRate) {\n adjGrowthRate = CONSTANTS.ServerMaxGrowthRate;\n }\n\n //Calculate adjusted server growth rate based on parameters\n const serverGrowthPercentage = server.serverGrowth / 100;\n const numServerGrowthCyclesAdjusted =\n numServerGrowthCycles * serverGrowthPercentage * BitNodeMultipliers.ServerGrowthRate;\n\n //Apply serverGrowth for the calculated number of growth cycles\n const coreBonus = 1 + (cores - 1) / 16;\n return Math.pow(adjGrowthRate, numServerGrowthCyclesAdjusted * p.hacking_grow_mult * coreBonus);\n}\n","import { Sleeve } from \"./Sleeve\";\n\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\n\nexport function findSleevePurchasableAugs(sleeve: Sleeve, p: IPlayer): Augmentation[] {\n // You can only purchase Augmentations that are actually available from\n // your factions. I.e. you must be in a faction that has the Augmentation\n // and you must also have enough rep in that faction in order to purchase it.\n\n const ownedAugNames: string[] = sleeve.augmentations.map((e) => {\n return e.name;\n });\n const availableAugs: Augmentation[] = [];\n\n // Helper function that helps filter out augs that are already owned\n // and augs that aren't allowed for sleeves\n function isAvailableForSleeve(aug: Augmentation): boolean {\n if (aug.name === AugmentationNames.NeuroFluxGovernor) {\n return false;\n }\n if (ownedAugNames.includes(aug.name)) {\n return false;\n }\n if (availableAugs.includes(aug)) {\n return false;\n }\n if (aug.isSpecial) {\n return false;\n }\n\n return true;\n }\n\n // If player is in a gang, then we return all augs that the player\n // has enough reputation for (since that gang offers all augs)\n if (p.inGang()) {\n const fac = p.getGangFaction();\n\n for (const augName of Object.keys(Augmentations)) {\n const aug = Augmentations[augName];\n if (!isAvailableForSleeve(aug)) {\n continue;\n }\n\n if (fac.playerReputation > aug.baseRepRequirement) {\n availableAugs.push(aug);\n }\n }\n\n return availableAugs;\n }\n\n for (const facName of p.factions) {\n if (facName === \"Bladeburners\") {\n continue;\n }\n if (facName === \"Netburners\") {\n continue;\n }\n const fac: Faction | null = Factions[facName];\n if (fac == null) {\n continue;\n }\n\n for (const augName of fac.augmentations) {\n const aug: Augmentation = Augmentations[augName];\n if (!isAvailableForSleeve(aug)) {\n continue;\n }\n\n if (fac.playerReputation > aug.baseRepRequirement) {\n availableAugs.push(aug);\n }\n }\n }\n\n return availableAugs;\n}\n","import { EventEmitter } from \"../utils/EventEmitter\";\nexport const StaneksGiftEvents = new EventEmitter<[]>();\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport FileSaver from \"file-saver\";\nimport JSZip from \"jszip\";\n\nexport function exportScripts(pattern: string, server: BaseServer): void {\n const matchEnding = pattern.length == 1 || pattern === \"*.*\" ? null : pattern.slice(1); // Treat *.* the same as *\n const zip = new JSZip();\n // Helper function to zip any file contents whose name matches the pattern\n const zipFiles = (fileNames: string[], fileContents: string[]): void => {\n for (let i = 0; i < fileContents.length; ++i) {\n let name = fileNames[i];\n if (name.startsWith(\"/\")) name = name.slice(1);\n if (!matchEnding || name.endsWith(matchEnding))\n zip.file(name, new Blob([fileContents[i]], { type: \"text/plain\" }));\n }\n };\n // In the case of script files, we pull from the server.scripts array\n if (!matchEnding || isScriptFilename(matchEnding))\n zipFiles(\n server.scripts.map((s) => s.filename),\n server.scripts.map((s) => s.code),\n );\n // In the case of text files, we pull from the server.scripts array\n if (!matchEnding || matchEnding.endsWith(\".txt\"))\n zipFiles(\n server.textFiles.map((s) => s.fn),\n server.textFiles.map((s) => s.text),\n );\n\n // Return an error if no files matched, rather than an empty zip folder\n if (Object.keys(zip.files).length == 0) throw new Error(`No files match the pattern ${pattern}`);\n const zipFn = `bitburner${isScriptFilename(pattern) ? \"Scripts\" : pattern === \"*.txt\" ? \"Texts\" : \"Files\"}.zip`;\n zip.generateAsync({ type: \"blob\" }).then((content: any) => FileSaver.saveAs(content, zipFn));\n}\n\nexport function download(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n try {\n if (args.length !== 1) {\n terminal.error(\"Incorrect usage of download command. Usage: download [script/text file]\");\n return;\n }\n const fn = args[0] + \"\";\n // If the parameter starts with *, download all files that match the wildcard pattern\n if (fn.startsWith(\"*\")) {\n try {\n exportScripts(fn, server);\n return;\n } catch (error: any) {\n return terminal.error(error.message);\n }\n } else if (isScriptFilename(fn)) {\n // Download a single script\n const script = terminal.getScript(player, fn);\n if (script != null) {\n return script.download();\n }\n } else if (fn.endsWith(\".txt\")) {\n // Download a single text file\n const txt = terminal.getTextFile(player, fn);\n if (txt != null) {\n return txt.download();\n }\n } else {\n terminal.error(`Cannot download this filetype`);\n return;\n }\n terminal.error(`${fn} does not exist`);\n return;\n } catch (e) {\n terminal.error(e + \"\");\n return;\n }\n}\n","/**\n * React Component for displaying a single Augmentation as an accordion.\n *\n * The header of the accordion contains the Augmentation's name (and level, if\n * applicable), and the accordion's panel contains the Augmentation's description.\n */\nimport React, { useState } from \"react\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\n\ntype IProps = {\n aug: Augmentation;\n level?: number | string | null;\n};\n\nexport function AugmentationAccordion(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n let displayName = props.aug.name;\n if (props.level != null) {\n if (props.aug.name === AugmentationNames.NeuroFluxGovernor) {\n displayName += ` - Level ${props.level}`;\n }\n }\n\n if (typeof props.aug.info === \"string\") {\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText primary={<Typography style={{ whiteSpace: \"pre-wrap\" }}>{displayName}</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} unmountOnExit>\n <Box m={4}>\n <Typography dangerouslySetInnerHTML={{ __html: props.aug.info }} />\n {props.aug.stats && (\n <>\n <br />\n <br />\n <Typography>{props.aug.stats}</Typography>\n </>\n )}\n </Box>\n </Collapse>\n </Box>\n );\n }\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText primary={<Typography style={{ whiteSpace: \"pre-wrap\" }}>{displayName}</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} unmountOnExit>\n <Box m={4}>\n <Typography>\n {props.aug.info}\n {props.aug.stats && (\n <>\n <br />\n <br />\n {props.aug.stats}\n </>\n )}\n </Typography>\n </Box>\n </Collapse>\n </Box>\n );\n}\n","import * as React from \"react\";\n\nexport const stealthIcon = (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16px\" height=\"16px\" viewBox=\"0 0 166 132\" style={{ fill: \"#adff2f\" }}>\n <g>\n <path d=\"M132.658-0.18l-24.321,24.321c-7.915-2.71-16.342-4.392-25.087-4.392c-45.84,0-83,46-83,46 s14.1,17.44,35.635,30.844L12.32,120.158l12.021,12.021L144.68,11.841L132.658-0.18z M52.033,80.445 c-2.104-4.458-3.283-9.438-3.283-14.695c0-19.054,15.446-34.5,34.5-34.5c5.258,0,10.237,1.179,14.695,3.284L52.033,80.445z\" />\n <path d=\"M134.865,37.656l-18.482,18.482c0.884,3.052,1.367,6.275,1.367,9.612c0,19.055-15.446,34.5-34.5,34.5 c-3.337,0-6.56-0.483-9.611-1.367l-10.124,10.124c6.326,1.725,12.934,2.743,19.735,2.743c45.84,0,83-46,83-46 S153.987,50.575,134.865,37.656z\" />\n </g>\n </svg>\n);\nexport const killIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16px\"\n height=\"16px\"\n viewBox=\"-22 0 511 511.99561\"\n style={{ fill: \"#adff2f\" }}\n >\n <path d=\"m.496094 466.242188 39.902344-39.902344 45.753906 45.753906-39.898438 39.902344zm0 0\" />\n <path d=\"m468.421875 89.832031-1.675781-89.832031-300.265625 300.265625 45.753906 45.753906zm0 0\" />\n <path d=\"m95.210938 316.785156 16.84375 16.847656h.003906l83.65625 83.65625 22.753906-22.753906-100.503906-100.503906zm0 0\" />\n <path d=\"m101.445312 365.300781-39.902343 39.902344 45.753906 45.753906 39.902344-39.902343-39.90625-39.902344zm0 0\" />\n </svg>\n);\n","import React from \"react\";\nimport { IAction } from \"../IAction\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { use } from \"../../ui/Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ArrowDropUpIcon from \"@mui/icons-material/ArrowDropUp\";\nimport ArrowDropDownIcon from \"@mui/icons-material/ArrowDropDown\";\n\ninterface IProps {\n action: IAction;\n isActive: boolean;\n bladeburner: IBladeburner;\n rerender: () => void;\n}\n\nexport function ActionLevel({ action, isActive, bladeburner, rerender }: IProps): React.ReactElement {\n const player = use.Player();\n\n const canIncrease = action.level < action.maxLevel;\n const canDecrease = action.level > 1;\n\n function increaseLevel(): void {\n if (!canIncrease) return;\n ++action.level;\n if (isActive) bladeburner.startAction(player, bladeburner.action);\n rerender();\n }\n\n function decreaseLevel(): void {\n if (!canDecrease) return;\n --action.level;\n if (isActive) bladeburner.startAction(player, bladeburner.action);\n rerender();\n }\n\n return (\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n {action.getSuccessesNeededForNextLevel(BladeburnerConstants.ContractSuccessesPerLevel)} successes needed\n for next level\n </Typography>\n }\n >\n <Typography>\n Level: {action.level} / {action.maxLevel}\n </Typography>\n </Tooltip>\n </Box>\n <Tooltip title={isActive ? <Typography>WARNING: changing the level will restart the Operation</Typography> : \"\"}>\n <span>\n <IconButton disabled={!canIncrease} onClick={increaseLevel}>\n <ArrowDropUpIcon />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={isActive ? <Typography>WARNING: changing the level will restart the Operation</Typography> : \"\"}>\n <span>\n <IconButton disabled={!canDecrease} onClick={decreaseLevel}>\n <ArrowDropDownIcon />\n </IconButton>\n </span>\n </Tooltip>\n </Box>\n );\n}\n","import React from \"react\";\nimport { IAction } from \"../IAction\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Switch from \"@mui/material/Switch\";\n\ninterface IProps {\n action: IAction;\n rerender: () => void;\n}\n\nexport function Autolevel(props: IProps): React.ReactElement {\n function onAutolevel(event: React.ChangeEvent<HTMLInputElement>): void {\n props.action.autoLevel = event.target.checked;\n props.rerender();\n }\n return (\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Tooltip title={<Typography>Automatically increase operation level when possible</Typography>}>\n <Typography> Autolevel:</Typography>\n </Tooltip>\n <Switch checked={props.action.autoLevel} onChange={onAutolevel} />\n </Box>\n );\n}\n","import React, { useState } from \"react\";\nimport { Operation } from \"../Operation\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { TeamSizeModal } from \"./TeamSizeModal\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport Button from \"@mui/material/Button\";\ninterface IProps {\n action: Operation;\n bladeburner: IBladeburner;\n}\nexport function TeamSizeButton(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n return (\n <>\n <Button disabled={props.bladeburner.teamSize === 0} onClick={() => setOpen(true)}>\n Set Team Size (Curr Size: {formatNumber(props.action.teamCount, 0)})\n </Button>\n <TeamSizeModal open={open} onClose={() => setOpen(false)} action={props.action} bladeburner={props.bladeburner} />\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nexport function BlinkingCursor(): React.ReactElement {\n const [on, setOn] = useState(true);\n useEffect(() => {\n const i = setInterval(() => setOn((old) => !old), 1000);\n return () => clearInterval(i);\n });\n return <>{on ? \"|\" : \"\"}</>;\n}\n","/**\n * Implements the Re-sleeving mechanic for BitNode-10.\n * This allows the player to purchase and \"use\" new sleeves at VitaLife.\n * These new sleeves come with different starting experience and Augmentations\n * The cost of these new sleeves scales based on the exp and Augs.\n *\n * Note that this is different from the \"Sleeve mechanic\". The \"Sleeve\" mechanic\n * provides new sleeves, essentially clones. This Re-sleeving mechanic lets\n * the player purchase a new body with pre-existing Augmentations and experience\n *\n * As of right now, this feature is only available in BitNode 10\n */\nimport { Resleeve } from \"./Resleeve\";\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { IPlayerOwnedAugmentation, PlayerOwnedAugmentation } from \"../../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\nimport { getRandomInt } from \"../../utils/helpers/getRandomInt\";\n\n// Executes the actual re-sleeve when one is purchased\nexport function purchaseResleeve(r: Resleeve, p: IPlayer): boolean {\n const cost: number = r.getCost();\n if (!p.canAfford(cost)) {\n return false;\n }\n p.loseMoney(cost, \"other\");\n\n // Set the player's exp\n p.hacking_exp = r.hacking_exp;\n p.strength_exp = r.strength_exp;\n p.defense_exp = r.defense_exp;\n p.dexterity_exp = r.dexterity_exp;\n p.agility_exp = r.agility_exp;\n p.charisma_exp = r.charisma_exp;\n\n // Reset Augmentation \"owned\" data\n for (const augKey of Object.keys(Augmentations)) {\n Augmentations[augKey].owned = false;\n }\n\n // Clear all of the player's augmentations, except the NeuroFlux Governor\n // which is kept\n for (let i = p.augmentations.length - 1; i >= 0; --i) {\n if (p.augmentations[i].name !== AugmentationNames.NeuroFluxGovernor) {\n p.augmentations.splice(i, 1);\n } else {\n // NeuroFlux Governor\n Augmentations[AugmentationNames.NeuroFluxGovernor].owned = true;\n }\n }\n\n for (let i = 0; i < r.augmentations.length; ++i) {\n p.augmentations.push(new PlayerOwnedAugmentation(r.augmentations[i].name));\n Augmentations[r.augmentations[i].name].owned = true;\n }\n\n // The player's purchased Augmentations should remain the same, but any purchased\n // Augmentations that are given by the resleeve should be removed so there are no duplicates\n for (let i = p.queuedAugmentations.length - 1; i >= 0; --i) {\n const name: string = p.queuedAugmentations[i].name;\n\n if (\n p.augmentations.filter((e: IPlayerOwnedAugmentation) => {\n return e.name !== AugmentationNames.NeuroFluxGovernor && e.name === name;\n }).length >= 1\n ) {\n p.queuedAugmentations.splice(i, 1);\n }\n }\n\n p.reapplyAllAugmentations(true);\n p.reapplyAllSourceFiles(); //Multipliers get reset, so have to re-process source files too\n return true;\n}\n\n// Creates all of the Re-sleeves that will be available for purchase at VitaLife\nexport function generateResleeves(): Resleeve[] {\n const NumResleeves = 40; // Total number of Resleeves to generate\n\n const ret: Resleeve[] = [];\n for (let i = 0; i < NumResleeves; ++i) {\n // i will be a number indicating how \"powerful\" the Re-sleeve should be\n const r: Resleeve = new Resleeve();\n\n // Generate experience\n const expMult: number = 5 * i + 1;\n r.hacking_exp = expMult * getRandomInt(1000, 5000);\n r.strength_exp = expMult * getRandomInt(1000, 5000);\n r.defense_exp = expMult * getRandomInt(1000, 5000);\n r.dexterity_exp = expMult * getRandomInt(1000, 5000);\n r.agility_exp = expMult * getRandomInt(1000, 5000);\n r.charisma_exp = expMult * getRandomInt(1000, 5000);\n\n // Generate Augs\n // Augmentation prequisites will be ignored for this\n const baseNumAugs: number = Math.max(2, Math.ceil((i + 3) / 2));\n const numAugs: number = getRandomInt(baseNumAugs, baseNumAugs + 2);\n const augKeys: string[] = Object.keys(Augmentations);\n for (let a = 0; a < numAugs; ++a) {\n // Get a random aug\n const randIndex: number = getRandomInt(0, augKeys.length - 1);\n const randKey: string = augKeys[randIndex];\n\n // Forbidden augmentations\n const forbidden = [\n AugmentationNames.TheRedPill,\n AugmentationNames.NeuroFluxGovernor,\n AugmentationNames.StaneksGift1,\n AugmentationNames.StaneksGift2,\n AugmentationNames.StaneksGift3,\n ];\n if (forbidden.includes(randKey)) {\n continue;\n }\n\n const randAug: Augmentation | null = Augmentations[randKey];\n if (randAug === null) throw new Error(`null augmentation: ${randKey}`);\n r.augmentations.push({ name: randAug.name, level: 1 });\n r.applyAugmentation(Augmentations[randKey]);\n r.updateStatLevels();\n\n // Remove Augmentation so that there are no duplicates\n augKeys.splice(randIndex, 1);\n }\n\n ret.push(r);\n }\n\n return ret;\n}\n","import React, { useState } from 'react';\nimport { deleteGame } from \"../../db\";\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport Button from \"@mui/material/Button\";\nimport { Tooltip } from '@mui/material';\n\nimport DeleteIcon from '@mui/icons-material/Delete';\nimport { pushDisableRestore } from '../../Electron';\n\ninterface IProps {\n color?: \"primary\" | \"warning\" | \"error\";\n}\n\nexport function DeleteGameButton({ color = \"primary\" }: IProps): React.ReactElement {\n const [modalOpened, setModalOpened] = useState(false);\n\n return (<>\n <Tooltip title=\"This will permanently delete your local save game. Did you export it before?\">\n <Button startIcon={<DeleteIcon />} color={color} onClick={() => setModalOpened(true)}>Delete Save</Button>\n </Tooltip>\n <ConfirmationModal\n onConfirm={() => {\n setModalOpened(false);\n deleteGame()\n .then(() => {\n pushDisableRestore();\n setTimeout(() => location.reload(), 1000);\n })\n .catch((r) => console.error(`Could not delete game: ${r}`));\n }}\n open={modalOpened}\n onClose={() => setModalOpened(false)}\n confirmationText={\"Really delete your game? (It's permanent!)\"}\n />\n </>)\n}\n","import React, { useState } from 'react';\n\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport Button from \"@mui/material/Button\";\nimport { Tooltip } from '@mui/material';\nimport RestartAltIcon from '@mui/icons-material/RestartAlt';\n\ninterface IProps {\n color?: \"primary\" | \"warning\" | \"error\";\n noConfirmation?: boolean;\n onTriggered: () => void;\n}\n\nexport function SoftResetButton({ color = \"primary\", noConfirmation = false, onTriggered }: IProps): React.ReactElement {\n const [modalOpened, setModalOpened] = useState(false);\n\n function handleButtonClick(): void {\n if (noConfirmation) {\n onTriggered();\n } else {\n setModalOpened(true);\n }\n }\n\n return (<>\n <Tooltip title=\"Perform a soft reset. Resets everything as if you had just purchased an Augmentation.\">\n <Button startIcon={<RestartAltIcon />} color={color} onClick={handleButtonClick}>Soft Reset</Button>\n </Tooltip>\n <ConfirmationModal\n onConfirm={onTriggered}\n open={modalOpened}\n onClose={() => setModalOpened(false)}\n confirmationText={\"This will perform the same action as installing Augmentations, are you sure?\"}\n />\n </>)\n}\n","import React, { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { ThemeEditorModal } from \"./ThemeEditorModal\";\nimport { IRouter } from \"../../ui/Router\";\nimport ColorizeIcon from \"@mui/icons-material/Colorize\";\n\ninterface IProps {\n router: IRouter;\n}\n\nexport function ThemeEditorButton({ router }: IProps): React.ReactElement {\n const [themeEditorOpen, setThemeEditorOpen] = useState(false);\n return (\n <>\n <Tooltip title=\"The theme editor allows you to modify the colors the game uses.\">\n <Button id=\"bb-theme-editor-button\" startIcon={<ColorizeIcon />} onClick={() => setThemeEditorOpen(true)}>\n Theme Editor\n </Button>\n </Tooltip>\n <ThemeEditorModal open={themeEditorOpen} onClose={() => setThemeEditorOpen(false)} router={router} />\n </>\n );\n}\n","import React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { Link } from \"@mui/material\";\n\nexport function ThemeCollaborate(): React.ReactElement {\n return (\n <>\n <Typography sx={{ my: 1 }}>\n If you've created a theme that you believe should be added in game's theme browser, feel free to{\" \"}\n <Link href=\"https://github.com/danielyxie/bitburner/tree/dev/src/Themes/README.md\" target=\"_blank\">\n create a pull request\n </Link>\n .\n </Typography>\n <Typography sx={{ my: 1 }}>\n Head over to the{\" \"}\n <Link href=\"https://discord.com/channels/415207508303544321/921991895230611466\" target=\"_blank\">\n theme-sharing\n </Link>{\" \"}\n discord channel for more.\n </Typography>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport TextFormatIcon from \"@mui/icons-material/TextFormat\";\nimport { StyleEditorModal } from \"./StyleEditorModal\";\n\nexport function StyleEditorButton(): React.ReactElement {\n const [styleEditorOpen, setStyleEditorOpen] = useState(false);\n return (\n <>\n <Tooltip title=\"The style editor allows you to modify certain CSS rules used by the game.\">\n <Button startIcon={<TextFormatIcon />} onClick={() => setStyleEditorOpen(true)}>\n Style Editor\n </Button>\n </Tooltip>\n <StyleEditorModal open={styleEditorOpen} onClose={() => setStyleEditorOpen(false)} />\n </>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a Travel Agency\n *\n * TThis subcomponent renders all of the buttons for traveling to different cities\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { CityName } from \"../data/CityNames\";\nimport { TravelConfirmationModal } from \"./TravelConfirmationModal\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { use } from \"../../ui/Context\";\nimport { Money } from \"../../ui/React/Money\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\n\ntype IProps = {\n p: IPlayer;\n router: IRouter;\n};\n\nfunction travel(p: IPlayer, router: IRouter, to: CityName): void {\n const cost = CONSTANTS.TravelCost;\n if (!p.canAfford(cost)) {\n return;\n }\n\n p.loseMoney(cost, \"other\");\n p.travel(to);\n dialogBoxCreate(<>You are now in {to}!</>);\n router.toCity();\n}\n\nexport function TravelAgencyRoot(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n const [open, setOpen] = useState(false);\n const [destination, setDestination] = useState(CityName.Sector12);\n function rerender(): void {\n setRerender((o) => !o);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n function startTravel(city: CityName): void {\n const cost = CONSTANTS.TravelCost;\n if (!player.canAfford(cost)) {\n return;\n }\n if (Settings.SuppressTravelConfirmation) {\n travel(player, router, city);\n return;\n }\n setOpen(true);\n setDestination(city);\n }\n\n return (\n <>\n <Typography variant=\"h4\">Travel Agency</Typography>\n <Box mx={2}>\n <Typography>\n From here, you can travel to any other city! A ticket costs{\" \"}\n <Money money={CONSTANTS.TravelCost} player={props.p} />.\n </Typography>\n {Settings.DisableASCIIArt ? (\n <>\n {Object.values(CityName)\n .filter((city: string) => city != props.p.city)\n .map((city: string) => {\n const match = Object.entries(CityName).find((entry) => entry[1] === city);\n if (match === undefined) throw new Error(`could not find key for city '${city}'`);\n return (\n <React.Fragment key={city}>\n <Button onClick={() => startTravel(city as CityName)} sx={{ m: 2 }}>\n <Typography>Travel to {city}</Typography>\n </Button>\n <br />\n </React.Fragment>\n );\n })}\n </>\n ) : (\n <WorldMap currentCity={props.p.city} onTravel={(city: CityName) => startTravel(city)} />\n )}\n </Box>\n <TravelConfirmationModal\n city={destination}\n travel={() => travel(player, router, destination)}\n open={open}\n onClose={() => setOpen(false)}\n />\n </>\n );\n}\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport React, { useState, useEffect, useRef, useMemo } from \"react\";\nimport Editor, { Monaco } from \"@monaco-editor/react\";\nimport * as monaco from \"monaco-editor\";\n\ntype IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;\ntype ITextModel = monaco.editor.ITextModel;\nimport { OptionsModal } from \"./OptionsModal\";\nimport { Options } from \"./Options\";\nimport { isValidFilePath } from \"../../Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { Script } from \"../../Script/Script\";\nimport { TextFile } from \"../../TextFile\";\nimport { calculateRamUsage, checkInfiniteLoop } from \"../../Script/RamCalculations\";\nimport { RamCalculationErrorCode } from \"../../Script/RamCalculationErrorCodes\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { DragDropContext, Droppable, Draggable } from \"react-beautiful-dnd\";\n\nimport { NetscriptFunctions } from \"../../NetscriptFunctions\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { iTutorialNextStep, ITutorial, iTutorialSteps } from \"../../InteractiveTutorial\";\nimport { debounce } from \"lodash\";\nimport { saveObject } from \"../../SaveObject\";\nimport { loadThemes } from \"./themes\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport Link from \"@mui/material/Link\";\nimport Box from \"@mui/material/Box\";\nimport SettingsIcon from \"@mui/icons-material/Settings\";\nimport SyncIcon from '@mui/icons-material/Sync';\nimport CloseIcon from '@mui/icons-material/Close';\nimport Table from \"@mui/material/Table\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableBody from \"@mui/material/TableBody\";\nimport { PromptEvent } from \"../../ui/React/PromptManager\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport libSource from \"!!raw-loader!../NetscriptDefinitions.d.ts\";\nimport { Tooltip } from \"@mui/material\";\n\ninterface IProps {\n // Map of filename -> code\n files: Record<string, string>;\n hostname: string;\n player: IPlayer;\n router: IRouter;\n vim: boolean;\n}\n\n// TODO: try to removve global symbols\nlet symbolsLoaded = false;\nlet symbols: string[] = [];\nexport function SetupTextEditor(): void {\n const ns = NetscriptFunctions({} as WorkerScript);\n\n // Populates symbols for text editor\n function populate(ns: any): string[] {\n let symbols: string[] = [];\n const keys = Object.keys(ns);\n for (const key of keys) {\n if (typeof ns[key] === \"object\") {\n symbols.push(key);\n symbols = symbols.concat(populate(ns[key]));\n }\n if (typeof ns[key] === \"function\") {\n symbols.push(key);\n }\n }\n\n return symbols;\n }\n\n symbols = populate(ns);\n\n const exclude = [\"heart\", \"break\", \"exploit\", \"bypass\", \"corporation\", \"alterReality\"];\n symbols = symbols.filter((symbol: string) => !exclude.includes(symbol)).sort();\n}\n\n// Holds all the data for a open script\nclass OpenScript {\n fileName: string;\n code: string;\n hostname: string;\n lastPosition: monaco.Position;\n model: ITextModel;\n\n constructor(fileName: string, code: string, hostname: string, lastPosition: monaco.Position, model: ITextModel) {\n this.fileName = fileName;\n this.code = code;\n this.hostname = hostname;\n this.lastPosition = lastPosition;\n this.model = model;\n }\n}\n\nlet openScripts: OpenScript[] = [];\nlet currentScript: OpenScript | null = null;\n\n// Called every time script editor is opened\nexport function Root(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n const editorRef = useRef<IStandaloneCodeEditor | null>(null);\n const monacoRef = useRef<Monaco | null>(null);\n const vimStatusRef = useRef<HTMLElement>(null);\n const [vimEditor, setVimEditor] = useState<any>(null);\n const [editor, setEditor] = useState<IStandaloneCodeEditor | null>(null);\n\n const [ram, setRAM] = useState(\"RAM: ???\");\n const [ramEntries, setRamEntries] = useState<string[][]>([[\"???\", \"\"]]);\n const [updatingRam, setUpdatingRam] = useState(false);\n const [decorations, setDecorations] = useState<string[]>([]);\n\n const [optionsOpen, setOptionsOpen] = useState(false);\n const [options, setOptions] = useState<Options>({\n theme: Settings.MonacoTheme,\n insertSpaces: Settings.MonacoInsertSpaces,\n fontSize: Settings.MonacoFontSize,\n wordWrap: Settings.MonacoWordWrap,\n vim: props.vim || Settings.MonacoVim,\n });\n\n const [ramInfoOpen, setRamInfoOpen] = useState(false);\n\n // Prevent Crash if script is open on deleted server\n openScripts = openScripts.filter((script) => {\n return GetServer(script.hostname) !== null;\n })\n if (currentScript && (GetServer(currentScript.hostname) === null)) {\n currentScript = openScripts[0];\n if (currentScript === undefined) currentScript = null;\n }\n\n\n const [dimensions, setDimensions] = useState({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n useEffect(() => {\n const debouncedHandleResize = debounce(function handleResize() {\n setDimensions({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n }, 250);\n\n window.addEventListener(\"resize\", debouncedHandleResize);\n\n return () => {\n window.removeEventListener(\"resize\", debouncedHandleResize);\n };\n }, []);\n\n useEffect(() => {\n if (currentScript !== null) {\n updateRAM(currentScript.code);\n }\n }, []);\n\n useEffect(() => {\n function keydown(event: KeyboardEvent): void {\n if (Settings.DisableHotkeys) return;\n //Ctrl + b\n if (event.code == \"KeyB\" && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n props.router.toTerminal();\n }\n\n // CTRL/CMD + S\n if (event.code == \"KeyS\" && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n event.stopPropagation();\n save();\n }\n }\n document.addEventListener(\"keydown\", keydown);\n return () => document.removeEventListener(\"keydown\", keydown);\n });\n\n useEffect(() => {\n // setup monaco-vim\n if (options.vim && editor && !vimEditor) {\n try {\n // This library is not typed\n // @ts-expect-error\n window.require([\"monaco-vim\"], function (MonacoVim: any) {\n setVimEditor(MonacoVim.initVimMode(editor, vimStatusRef.current));\n MonacoVim.VimMode.Vim.defineEx(\"write\", \"w\", function () {\n // your own implementation on what you want to do when :w is pressed\n save();\n });\n MonacoVim.VimMode.Vim.defineEx(\"quit\", \"q\", function () {\n props.router.toTerminal();\n });\n // \"wqriteandquit\" is not a typo, prefix must be found in full string\n MonacoVim.VimMode.Vim.defineEx(\"wqriteandquit\", \"wq\", function () {\n save();\n props.router.toTerminal();\n });\n editor.focus();\n });\n } catch { }\n } else if (!options.vim) {\n // Whem vim mode is disabled\n vimEditor?.dispose();\n setVimEditor(null);\n }\n\n return () => {\n vimEditor?.dispose();\n };\n }, [options, editorRef, editor, vimEditor]);\n\n // Generates a new model for the script\n function regenerateModel(script: OpenScript): void {\n if (monacoRef.current !== null) {\n script.model = monacoRef.current.editor.createModel(\n script.code,\n script.fileName.endsWith(\".txt\") ? \"plaintext\" : \"javascript\",\n );\n }\n }\n\n const debouncedSetRAM = useMemo(\n () =>\n debounce((s, e) => {\n setRAM(s);\n setRamEntries(e);\n setUpdatingRam(false);\n }, 300),\n [],\n );\n\n async function updateRAM(newCode: string): Promise<void> {\n if (currentScript != null && currentScript.fileName.endsWith(\".txt\")) {\n debouncedSetRAM(\"N/A\", [[\"N/A\", \"\"]]);\n return;\n }\n setUpdatingRam(true);\n const codeCopy = newCode + \"\";\n const ramUsage = await calculateRamUsage(props.player, codeCopy, props.player.getCurrentServer().scripts);\n if (ramUsage.cost > 0) {\n const entries = ramUsage.entries?.sort((a, b) => b.cost - a.cost) ?? [];\n const entriesDisp = [];\n for (const entry of entries) {\n entriesDisp.push([`${entry.name} (${entry.type})`, numeralWrapper.formatRAM(entry.cost)]);\n }\n\n debouncedSetRAM(\"RAM: \" + numeralWrapper.formatRAM(ramUsage.cost), entriesDisp);\n return;\n }\n switch (ramUsage.cost) {\n case RamCalculationErrorCode.ImportError: {\n debouncedSetRAM(\"RAM: Import Error\", [[\"Import Error\", \"\"]]);\n break;\n }\n case RamCalculationErrorCode.URLImportError: {\n debouncedSetRAM(\"RAM: HTTP Import Error\", [[\"HTTP Import Error\", \"\"]]);\n break;\n }\n case RamCalculationErrorCode.SyntaxError:\n default: {\n debouncedSetRAM(\"RAM: Syntax Error\", [[\"Syntax Error\", \"\"]]);\n break;\n }\n }\n return new Promise<void>(() => undefined);\n }\n\n // Formats the code\n function beautify(): void {\n if (editorRef.current === null) return;\n editorRef.current.getAction(\"editor.action.formatDocument\").run();\n }\n\n // How to load function definition in monaco\n // https://github.com/Microsoft/monaco-editor/issues/1415\n // https://microsoft.github.io/monaco-editor/api/modules/monaco.languages.html\n // https://www.npmjs.com/package/@monaco-editor/react#development-playground\n // https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages\n // https://github.com/threehams/typescript-error-guide/blob/master/stories/components/Editor.tsx#L11-L39\n // https://blog.checklyhq.com/customizing-monaco/\n // Before the editor is mounted\n function beforeMount(monaco: any): void {\n if (symbolsLoaded) return;\n // Setup monaco auto completion\n symbolsLoaded = true;\n monaco.languages.registerCompletionItemProvider(\"javascript\", {\n provideCompletionItems: () => {\n const suggestions = [];\n for (const symbol of symbols) {\n suggestions.push({\n label: symbol,\n kind: monaco.languages.CompletionItemKind.Function,\n insertText: symbol,\n insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\n });\n }\n return { suggestions: suggestions };\n },\n });\n\n (async function () {\n // We have to improve the default js language otherwise theme sucks\n const l = await monaco.languages\n .getLanguages()\n .find((l: any) => l.id === \"javascript\")\n .loader();\n // replaced the bare tokens with regexes surrounded by \\b, e.g. \\b{token}\\b which matches a word-break on either side\n // this prevents the highlighter from highlighting pieces of variables that start with a reserved token name\n l.language.tokenizer.root.unshift([new RegExp('\\\\bns\\\\b'), { token: \"ns\" }]);\n for (const symbol of symbols) l.language.tokenizer.root.unshift([new RegExp(`\\\\b${symbol}\\\\b`), { token: \"netscriptfunction\" }]);\n const otherKeywords = [\"let\", \"const\", \"var\", \"function\"];\n const otherKeyvars = [\"true\", \"false\", \"null\", \"undefined\"];\n otherKeywords.forEach((k) => l.language.tokenizer.root.unshift([new RegExp(`\\\\b${k}\\\\b`), { token: \"otherkeywords\" }]));\n otherKeyvars.forEach((k) => l.language.tokenizer.root.unshift([new RegExp(`\\\\b${k}\\\\b`), { token: \"otherkeyvars\" }]));\n l.language.tokenizer.root.unshift([new RegExp('\\\\bthis\\\\b'), { token: \"this\" }]);\n })();\n\n const source = (libSource + \"\").replace(/export /g, \"\");\n monaco.languages.typescript.javascriptDefaults.addExtraLib(source, \"netscript.d.ts\");\n monaco.languages.typescript.typescriptDefaults.addExtraLib(source, \"netscript.d.ts\");\n loadThemes(monaco);\n }\n\n // When the editor is mounted\n function onMount(editor: IStandaloneCodeEditor, monaco: Monaco): void {\n // Required when switching between site navigation (e.g. from Script Editor -> Terminal and back)\n // the `useEffect()` for vim mode is called before editor is mounted.\n setEditor(editor);\n\n editorRef.current = editor;\n monacoRef.current = monaco;\n\n if (editorRef.current === null || monacoRef.current === null) return;\n\n if (!props.files && currentScript !== null) {\n // Open currentscript\n regenerateModel(currentScript);\n editorRef.current.setModel(currentScript.model);\n editorRef.current.setPosition(currentScript.lastPosition);\n editorRef.current.revealLineInCenter(currentScript.lastPosition.lineNumber);\n updateRAM(currentScript.code);\n editorRef.current.focus();\n return;\n }\n if (props.files) {\n const files = Object.entries(props.files);\n\n if (!files.length) {\n editorRef.current.focus();\n return;\n }\n\n for (const [filename, code] of files) {\n // Check if file is already opened\n const openScript = openScripts.find(\n (script) => script.fileName === filename && script.hostname === props.hostname,\n );\n if (openScript) {\n // Script is already opened\n if (openScript.model === undefined || openScript.model === null || openScript.model.isDisposed()) {\n regenerateModel(openScript);\n }\n\n currentScript = openScript;\n editorRef.current.setModel(openScript.model);\n editorRef.current.setPosition(openScript.lastPosition);\n editorRef.current.revealLineInCenter(openScript.lastPosition.lineNumber);\n updateRAM(openScript.code);\n } else {\n // Open script\n const newScript = new OpenScript(\n filename,\n code,\n props.hostname,\n new monacoRef.current.Position(0, 0),\n monacoRef.current.editor.createModel(code, filename.endsWith(\".txt\") ? \"plaintext\" : \"javascript\"),\n );\n openScripts.push(newScript);\n currentScript = { ...newScript };\n editorRef.current.setModel(newScript.model);\n updateRAM(newScript.code);\n }\n }\n }\n\n editorRef.current.focus();\n }\n\n function infLoop(newCode: string): void {\n if (editorRef.current === null || currentScript === null) return;\n if (!currentScript.fileName.endsWith(\".ns\") && !currentScript.fileName.endsWith(\".js\")) return;\n const awaitWarning = checkInfiniteLoop(newCode);\n if (awaitWarning !== -1) {\n const newDecorations = editorRef.current.deltaDecorations(decorations, [\n {\n range: {\n startLineNumber: awaitWarning,\n startColumn: 1,\n endLineNumber: awaitWarning,\n endColumn: 10,\n },\n options: {\n isWholeLine: true,\n glyphMarginClassName: \"myGlyphMarginClass\",\n glyphMarginHoverMessage: {\n value: \"Possible infinite loop, await something.\",\n },\n },\n },\n ]);\n setDecorations(newDecorations);\n } else {\n const newDecorations = editorRef.current.deltaDecorations(decorations, []);\n setDecorations(newDecorations);\n }\n }\n\n // When the code is updated within the editor\n function updateCode(newCode?: string): void {\n if (newCode === undefined) return;\n updateRAM(newCode);\n if (editorRef.current === null) return;\n const newPos = editorRef.current.getPosition();\n if (newPos === null) return;\n if (currentScript !== null) {\n currentScript = { ...currentScript, code: newCode, lastPosition: newPos };\n const curIndex = openScripts.findIndex(\n (script) =>\n currentScript !== null &&\n script.fileName === currentScript.fileName &&\n script.hostname === currentScript.hostname,\n );\n const newArr = [...openScripts];\n const tempScript = currentScript;\n tempScript.code = newCode;\n newArr[curIndex] = tempScript;\n openScripts = [...newArr];\n }\n try {\n infLoop(newCode);\n } catch (err) { }\n }\n\n function saveScript(scriptToSave: OpenScript): void {\n const server = GetServer(scriptToSave.hostname);\n if (server === null) throw new Error(\"Server should not be null but it is.\");\n if (isScriptFilename(scriptToSave.fileName)) {\n //If the current script already exists on the server, overwrite it\n for (let i = 0; i < server.scripts.length; i++) {\n if (scriptToSave.fileName == server.scripts[i].filename) {\n server.scripts[i].saveScript(\n props.player,\n scriptToSave.fileName,\n scriptToSave.code,\n props.player.currentServer,\n server.scripts,\n );\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n return;\n }\n }\n\n //If the current script does NOT exist, create a new one\n const script = new Script();\n script.saveScript(\n props.player,\n scriptToSave.fileName,\n scriptToSave.code,\n props.player.currentServer,\n server.scripts,\n );\n server.scripts.push(script);\n } else if (scriptToSave.fileName.endsWith(\".txt\")) {\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (server.textFiles[i].fn === scriptToSave.fileName) {\n server.textFiles[i].write(scriptToSave.code);\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n return;\n }\n }\n const textFile = new TextFile(scriptToSave.fileName, scriptToSave.code);\n server.textFiles.push(textFile);\n } else {\n dialogBoxCreate(\"Invalid filename. Must be either a script (.script, .js, or .ns) or \" + \" or text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n }\n\n function save(): void {\n if (currentScript === null) {\n console.error(\"currentScript is null when it shouldn't be. Unable to save script\");\n return;\n }\n // this is duplicate code with saving later.\n if (ITutorial.isRunning && ITutorial.currStep === iTutorialSteps.TerminalTypeScript) {\n //Make sure filename + code properly follow tutorial\n if (currentScript.fileName !== \"n00dles.script\") {\n dialogBoxCreate(\"Leave the script name as 'n00dles.script'!\");\n return;\n }\n if (currentScript.code.replace(/\\s/g, \"\").indexOf(\"while(true){hack('n00dles');}\") == -1) {\n dialogBoxCreate(\"Please copy and paste the code from the tutorial!\");\n return;\n }\n\n //Save the script\n saveScript(currentScript);\n\n iTutorialNextStep();\n\n return;\n }\n\n if (currentScript.fileName == \"\") {\n dialogBoxCreate(\"You must specify a filename!\");\n return;\n }\n\n if (!isValidFilePath(currentScript.fileName)) {\n dialogBoxCreate(\n \"Script filename can contain only alphanumerics, hyphens, and underscores, and must end with an extension.\",\n );\n return;\n }\n\n const server = GetServer(currentScript.hostname);\n if (server === null) throw new Error(\"Server should not be null but it is.\");\n if (isScriptFilename(currentScript.fileName)) {\n //If the current script already exists on the server, overwrite it\n for (let i = 0; i < server.scripts.length; i++) {\n if (currentScript.fileName == server.scripts[i].filename) {\n server.scripts[i].saveScript(\n props.player,\n currentScript.fileName,\n currentScript.code,\n props.player.currentServer,\n server.scripts,\n );\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n return;\n }\n }\n\n //If the current script does NOT exist, create a new one\n const script = new Script();\n script.saveScript(\n props.player,\n currentScript.fileName,\n currentScript.code,\n props.player.currentServer,\n server.scripts,\n );\n server.scripts.push(script);\n } else if (currentScript.fileName.endsWith(\".txt\")) {\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (server.textFiles[i].fn === currentScript.fileName) {\n server.textFiles[i].write(currentScript.code);\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n return;\n }\n }\n const textFile = new TextFile(currentScript.fileName, currentScript.code);\n server.textFiles.push(textFile);\n } else {\n dialogBoxCreate(\"Invalid filename. Must be either a script (.script, .js, or .ns) or \" + \" or text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n }\n\n function reorder(list: Array<OpenScript>, startIndex: number, endIndex: number): OpenScript[] {\n const result = Array.from(list);\n const [removed] = result.splice(startIndex, 1);\n result.splice(endIndex, 0, removed);\n\n return result;\n }\n\n function onDragEnd(result: any): void {\n // Dropped outside of the list\n if (!result.destination) {\n result;\n return;\n }\n\n const items = reorder(openScripts, result.source.index, result.destination.index);\n\n openScripts = items;\n }\n\n function onTabClick(index: number): void {\n if (currentScript !== null) {\n // Save currentScript to openScripts\n const curIndex = openScripts.findIndex(\n (script) =>\n currentScript !== null &&\n script.fileName === currentScript.fileName &&\n script.hostname === currentScript.hostname,\n );\n openScripts[curIndex] = currentScript;\n }\n\n currentScript = { ...openScripts[index] };\n\n if (editorRef.current !== null && openScripts[index] !== null) {\n if (openScripts[index].model === undefined || openScripts[index].model.isDisposed()) {\n regenerateModel(openScripts[index]);\n }\n editorRef.current.setModel(openScripts[index].model);\n\n editorRef.current.setPosition(openScripts[index].lastPosition);\n editorRef.current.revealLineInCenter(openScripts[index].lastPosition.lineNumber);\n updateRAM(openScripts[index].code);\n editorRef.current.focus();\n }\n }\n\n function onTabClose(index: number): void {\n // See if the script on the server is up to date\n const closingScript = openScripts[index];\n const savedScriptIndex = openScripts.findIndex(\n (script) => script.fileName === closingScript.fileName && script.hostname === closingScript.hostname,\n );\n let savedScriptCode = \"\";\n if (savedScriptIndex !== -1) {\n savedScriptCode = openScripts[savedScriptIndex].code;\n }\n const server = GetServer(closingScript.hostname);\n if (server === null) throw new Error(`Server '${closingScript.hostname}' should not be null, but it is.`);\n\n const serverScriptIndex = server.scripts.findIndex((script) => script.filename === closingScript.fileName);\n if (serverScriptIndex === -1 || savedScriptCode !== server.scripts[serverScriptIndex as number].code) {\n PromptEvent.emit({\n txt: \"Do you want to save changes to \" + closingScript.fileName + \"?\",\n resolve: (result: boolean) => {\n if (result) {\n // Save changes\n closingScript.code = savedScriptCode;\n saveScript(closingScript);\n }\n },\n });\n }\n\n if (openScripts.length > 1) {\n openScripts = openScripts.filter((value, i) => i !== index);\n\n let indexOffset = -1;\n if (openScripts[index + indexOffset] === undefined) {\n indexOffset = 1;\n if (openScripts[index + indexOffset] === undefined) {\n indexOffset = 0;\n }\n }\n\n // Change current script if we closed it\n currentScript = openScripts[index + indexOffset];\n if (editorRef.current !== null) {\n if (\n openScripts[index + indexOffset].model === undefined ||\n openScripts[index + indexOffset].model === null ||\n openScripts[index + indexOffset].model.isDisposed()\n ) {\n regenerateModel(openScripts[index + indexOffset]);\n }\n\n editorRef.current.setModel(openScripts[index + indexOffset].model);\n editorRef.current.setPosition(openScripts[index + indexOffset].lastPosition);\n editorRef.current.revealLineInCenter(openScripts[index + indexOffset].lastPosition.lineNumber);\n editorRef.current.focus();\n }\n rerender();\n } else {\n // No more scripts are open\n openScripts = [];\n currentScript = null;\n props.router.toTerminal();\n }\n }\n\n function onTabUpdate(index: number): void {\n const openScript = openScripts[index];\n const serverScriptCode = getServerCode(index);\n if (serverScriptCode === null) return;\n\n if (openScript.code !== serverScriptCode) {\n PromptEvent.emit({\n txt: \"Do you want to overwrite the current editor content with the contents of \" +\n openScript.fileName + \" on the server? This cannot be undone.\",\n resolve: (result: boolean) => {\n if (result) {\n // Save changes\n openScript.code = serverScriptCode;\n\n // Switch to target tab\n onTabClick(index)\n\n if (editorRef.current !== null && openScript !== null) {\n if (openScript.model === undefined || openScript.model.isDisposed()) {\n regenerateModel(openScript);\n }\n editorRef.current.setModel(openScript.model);\n\n editorRef.current.setValue(openScript.code);\n updateRAM(openScript.code);\n editorRef.current.focus();\n }\n }\n },\n });\n }\n }\n\n function dirty(index: number): string {\n const openScript = openScripts[index];\n const serverScriptCode = getServerCode(index);\n if (serverScriptCode === null) return \" *\";\n\n // The server code is stored with its starting & trailing whitespace removed\n const openScriptFormatted = Script.formatCode(openScript.code);\n return serverScriptCode !== openScriptFormatted ? \" *\" : \"\";\n }\n\n function getServerCode(index: number): string | null {\n const openScript = openScripts[index];\n const server = GetServer(openScript.hostname);\n if (server === null) throw new Error(`Server '${openScript.hostname}' should not be null, but it is.`);\n\n const serverScript = server.scripts.find((s) => s.filename === openScript.fileName);\n return serverScript?.code ?? null;\n }\n\n // Toolbars are roughly 112px:\n // 8px body margin top\n // 38.5px filename tabs\n // 5px padding for top of editor\n // 44px bottom tool bar + 16px margin\n // + vim bar 34px\n const editorHeight = dimensions.height - (130 + (options.vim ? 34 : 0));\n\n return (\n <>\n <div style={{ display: currentScript !== null ? \"block\" : \"none\", height: \"100%\", width: \"100%\" }}>\n <DragDropContext onDragEnd={onDragEnd}>\n <Droppable droppableId=\"tabs\" direction=\"horizontal\">\n {(provided, snapshot) => (\n <Box\n maxWidth=\"1640px\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n whiteSpace=\"nowrap\"\n ref={provided.innerRef}\n {...provided.droppableProps}\n style={{\n backgroundColor: snapshot.isDraggingOver\n ? Settings.theme.backgroundsecondary\n : Settings.theme.backgroundprimary,\n overflowX: \"scroll\",\n }}\n >\n {openScripts.map(({ fileName, hostname }, index) => {\n const iconButtonStyle = {\n maxWidth: \"25px\",\n minWidth: \"25px\",\n minHeight: '38.5px',\n maxHeight: '38.5px',\n ...(currentScript?.fileName === openScripts[index].fileName ? {\n background: Settings.theme.button,\n borderColor: Settings.theme.button,\n color: Settings.theme.primary\n } : {\n background: Settings.theme.backgroundsecondary,\n borderColor: Settings.theme.backgroundsecondary,\n color: Settings.theme.secondary\n })\n };\n return (\n <Draggable\n key={fileName + hostname}\n draggableId={fileName + hostname}\n index={index}\n disableInteractiveElementBlocking={true}\n >\n {(provided) => (\n <div\n ref={provided.innerRef}\n {...provided.draggableProps}\n {...provided.dragHandleProps}\n style={{\n ...provided.draggableProps.style,\n marginRight: \"5px\",\n flexShrink: 0,\n border: '1px solid ' + Settings.theme.well,\n }}\n >\n <Button\n onClick={() => onTabClick(index)}\n onMouseDown={e => {\n e.preventDefault();\n if (e.button === 1) onTabClose(index);\n }}\n style={{\n ...(currentScript?.fileName === openScripts[index].fileName ? {\n background: Settings.theme.button,\n borderColor: Settings.theme.button,\n color: Settings.theme.primary\n } : {\n background: Settings.theme.backgroundsecondary,\n borderColor: Settings.theme.backgroundsecondary,\n color: Settings.theme.secondary\n })\n }}\n >\n {hostname}:~/{fileName} {dirty(index)}\n </Button>\n <Tooltip title=\"Overwrite editor content with saved file content\">\n <Button onClick={() => onTabUpdate(index)} style={iconButtonStyle} >\n <SyncIcon fontSize='small' />\n </Button>\n </Tooltip>\n <Button onClick={() => onTabClose(index)} style={iconButtonStyle}>\n <CloseIcon fontSize='small' />\n </Button>\n </div>\n )}\n </Draggable>\n )\n })}\n {provided.placeholder}\n </Box>\n )}\n </Droppable>\n </DragDropContext>\n <div style={{ paddingBottom: \"5px\" }} />\n <Editor\n beforeMount={beforeMount}\n onMount={onMount}\n loading={<Typography>Loading script editor!</Typography>}\n height={`${editorHeight}px`}\n defaultLanguage=\"javascript\"\n defaultValue={\"\"}\n onChange={updateCode}\n theme={options.theme}\n options={{ ...options, glyphMargin: true }}\n />\n\n <Box\n ref={vimStatusRef}\n className=\"monaco-editor\"\n display=\"flex\"\n flexDirection=\"row\"\n sx={{ p: 1 }}\n alignItems=\"center\"\n ></Box>\n\n <Box display=\"flex\" flexDirection=\"row\" sx={{ m: 1 }} alignItems=\"center\">\n <Button startIcon={<SettingsIcon />} onClick={() => setOptionsOpen(true)} sx={{ mr: 1 }}>Options</Button>\n <Button onClick={beautify}>Beautify</Button>\n <Button color={updatingRam ? \"secondary\" : \"primary\"} sx={{ mx: 1 }} onClick={() => { setRamInfoOpen(true) }}>\n {ram}\n </Button>\n <Button onClick={save}>Save (Ctrl/Cmd + s)</Button>\n <Button onClick={props.router.toTerminal}>Close (Ctrl/Cmd + b)</Button>\n <Typography sx={{ mx: 1 }}>\n {\" \"}\n Documentation:{\" \"}\n <Link target=\"_blank\" href=\"https://bitburner.readthedocs.io/en/latest/index.html\">\n Basic\n </Link>{\" \"}\n |\n <Link target=\"_blank\" href=\"https://github.com/danielyxie/bitburner/blob/dev/markdown/bitburner.ns.md\">\n Full\n </Link>\n </Typography>\n </Box>\n <OptionsModal\n open={optionsOpen}\n onClose={() => setOptionsOpen(false)}\n options={{\n theme: Settings.MonacoTheme,\n insertSpaces: Settings.MonacoInsertSpaces,\n fontSize: Settings.MonacoFontSize,\n wordWrap: Settings.MonacoWordWrap,\n vim: Settings.MonacoVim,\n }}\n save={(options: Options) => {\n setOptions(options);\n Settings.MonacoTheme = options.theme;\n Settings.MonacoInsertSpaces = options.insertSpaces;\n Settings.MonacoFontSize = options.fontSize;\n Settings.MonacoWordWrap = options.wordWrap;\n Settings.MonacoVim = options.vim;\n }}\n />\n <Modal open={ramInfoOpen} onClose={() => setRamInfoOpen(false)}>\n <Table>\n <TableBody>\n {ramEntries.map(([n, r]) => (\n <React.Fragment key={n + r}>\n <TableRow>\n <TableCell sx={{ color: Settings.theme.primary }}>{n}</TableCell>\n <TableCell align=\"right\" sx={{ color: Settings.theme.primary }}>{r}</TableCell>\n </TableRow>\n </React.Fragment>\n ))}\n </TableBody>\n </Table>\n </Modal>\n </div>\n <div\n style={{\n display: currentScript !== null ? \"none\" : \"flex\",\n height: \"100%\",\n width: \"100%\",\n justifyContent: \"center\",\n alignItems: \"center\",\n }}\n >\n <span style={{ color: Settings.theme.primary, fontSize: \"20px\", textAlign: \"center\" }}>\n <Typography variant=\"h4\">No open files</Typography>\n <Typography variant=\"h5\">\n Use <code>nano FILENAME</code> in\n <br />\n the terminal to open files\n </Typography>\n </span>\n </div>\n </>\n );\n}\n","/**\n * Uses the acorn.js library to parse a script's code into an AST and\n * recursively walk through that AST to replace import urls with blobs\n */\nimport * as walk from \"acorn-walk\";\nimport { parse } from \"acorn\";\n\nimport { makeRuntimeRejectMsg } from \"./NetscriptEvaluator\";\nimport { ScriptUrl } from \"./Script/ScriptUrl\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { Script } from \"./Script/Script\";\nimport { areImportsEquals } from \"./Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"./PersonObjects/IPlayer\";\n\n// Makes a blob that contains the code of a given script.\nfunction makeScriptBlob(code: string): Blob {\n return new Blob([code], { type: \"text/javascript\" });\n}\n\nexport async function compile(player: IPlayer, script: Script, scripts: Script[]): Promise<void> {\n if (!shouldCompile(script, scripts)) return;\n // The URL at the top is the one we want to import. It will\n // recursively import all the other modules in the urlStack.\n //\n // Webpack likes to turn the import into a require, which sort of\n // but not really behaves like import. Particularly, it cannot\n // load fully dynamic content. So we hide the import from webpack\n // by placing it inside an eval call.\n await script.updateRamUsage(player, scripts);\n const uurls = _getScriptUrls(script, scripts, []);\n const url = uurls[uurls.length - 1].url;\n if (script.url && script.url !== url) {\n // Thoughts: Should we be revoking any URLs here?\n // If a script is modified repeatedly between two states,\n // we could reuse the blob at a later time.\n // BlobCache.removeByValue(script.url);\n // URL.revokeObjectURL(script.url);\n // if (script.dependencies.length > 0) {\n // script.dependencies.forEach((dep) => {\n // removeBlobFromCache(dep.url);\n // URL.revokeObjectURL(dep.url);\n // });\n // }\n }\n script.url = url;\n script.module = new Promise((resolve) => resolve(eval(\"import(url)\")));\n script.dependencies = uurls;\n}\n\n// Begin executing a user JS script, and return a promise that resolves\n// or rejects when the script finishes.\n// - script is a script to execute (see Script.js). We depend only on .filename and .code.\n// scripts is an array of other scripts on the server.\n// env is the global environment that should be visible to all the scripts\n// (i.e. hack, grow, etc.).\n// When the promise returned by this resolves, we'll have finished\n// running the main function of the script.\nexport async function executeJSScript(\n player: IPlayer,\n scripts: Script[] = [],\n workerScript: WorkerScript,\n): Promise<void> {\n const script = workerScript.getScript();\n if (script === null) throw new Error(\"script is null\");\n await compile(player, script, scripts);\n workerScript.ramUsage = script.ramUsage;\n const loadedModule = await script.module;\n\n const ns = workerScript.env.vars;\n\n // TODO: putting await in a non-async function yields unhelpful\n // \"SyntaxError: unexpected reserved word\" with no line number information.\n if (!loadedModule.main) {\n throw makeRuntimeRejectMsg(\n workerScript,\n `${script.filename} cannot be run because it does not have a main function.`,\n );\n }\n return loadedModule.main(ns);\n}\n\nfunction isDependencyOutOfDate(filename: string, scripts: Script[], scriptModuleSequenceNumber: number): boolean {\n const depScript = scripts.find((s) => s.filename == filename);\n\n // If the script is not present on the server, we should recompile, if only to get any necessary\n // compilation errors.\n if (!depScript) return true;\n\n const depIsMoreRecent = depScript.moduleSequenceNumber > scriptModuleSequenceNumber;\n return depIsMoreRecent;\n}\n/** Returns whether we should compile the script parameter.\n *\n * @param {Script} script\n * @param {Script[]} scripts\n */\nfunction shouldCompile(script: Script, scripts: Script[]): boolean {\n if (script.module === \"\") return true;\n return script.dependencies.some((dep) => isDependencyOutOfDate(dep.filename, scripts, script.moduleSequenceNumber));\n}\n\n// Gets a stack of blob urls, the top/right-most element being\n// the blob url for the named script on the named server.\n//\n// - script -- the script for whom we are getting a URL.\n// - scripts -- all the scripts available on this server\n// - seen -- The modules above this one -- to prevent mutual dependency.\n//\n// TODO We don't make any effort to cache a given module when it is imported at\n// different parts of the tree. That hasn't presented any problem with during\n// testing, but it might be an idea for the future. Would require a topo-sort\n// then url-izing from leaf-most to root-most.\n/**\n * @param {Script} script\n * @param {Script[]} scripts\n * @param {Script[]} seen\n * @returns {ScriptUrl[]} All of the compiled scripts, with the final one\n * in the list containing the blob corresponding to\n * the script parameter.\n */\n// BUG: apparently seen is never consulted. Oops.\nfunction _getScriptUrls(script: Script, scripts: Script[], seen: Script[]): ScriptUrl[] {\n // Inspired by: https://stackoverflow.com/a/43834063/91401\n const urlStack: ScriptUrl[] = [];\n // Seen contains the dependents of the current script. Make sure we include that in the script dependents.\n for (const dependent of seen) {\n if (!script.dependents.some((s) => s.server === dependent.server && s.filename == dependent.filename)) {\n script.dependents.push({ server: dependent.server, filename: dependent.filename });\n }\n }\n seen.push(script);\n try {\n // Replace every import statement with an import to a blob url containing\n // the corresponding script. E.g.\n //\n // import {foo} from \"bar.js\";\n //\n // becomes\n //\n // import {foo} from \"blob://<uuid>\"\n //\n // Where the blob URL contains the script content.\n\n // Parse the code into an ast tree\n const ast: any = parse(script.code, { sourceType: \"module\", ecmaVersion: \"latest\", ranges: true });\n\n const importNodes: Array<any> = [];\n // Walk the nodes of this tree and find any import declaration statements.\n walk.simple(ast, {\n ImportDeclaration(node: any) {\n // Push this import onto the stack to replace\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n },\n ExportNamedDeclaration(node: any) {\n if (node.source) {\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n }\n },\n ExportAllDeclaration(node: any) {\n if (node.source) {\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n }\n },\n });\n // Sort the nodes from last start index to first. This replaces the last import with a blob first,\n // preventing the ranges for other imports from being shifted.\n importNodes.sort((a, b) => b.start - a.start);\n let transformedCode = script.code;\n // Loop through each node and replace the script name with a blob url.\n for (const node of importNodes) {\n const filename = node.filename.startsWith(\"./\") ? node.filename.substring(2) : node.filename;\n\n // Find the corresponding script.\n const matchingScripts = scripts.filter((s) => areImportsEquals(s.filename, filename));\n if (matchingScripts.length === 0) continue;\n\n const [importedScript] = matchingScripts;\n\n const urls = _getScriptUrls(importedScript, scripts, seen);\n\n // The top url in the stack is the replacement import file for this script.\n urlStack.push(...urls);\n const blob = urls[urls.length - 1].url;\n\n // Replace the blob inside the import statement.\n transformedCode = transformedCode.substring(0, node.start) + blob + transformedCode.substring(node.end);\n }\n\n // We automatically define a print function() in the NetscriptJS module so that\n // accidental calls to window.print() do not bring up the \"print screen\" dialog\n transformedCode += `\\n\\nfunction print() {throw new Error(\"Invalid call to window.print(). Did you mean to use Netscript's print()?\");}`;\n\n const blob = URL.createObjectURL(makeScriptBlob(transformedCode));\n // Push the blob URL onto the top of the stack.\n urlStack.push(new ScriptUrl(script.filename, blob, script.moduleSequenceNumber));\n return urlStack;\n } catch (err) {\n // If there is an error, we need to clean up the URLs.\n for (const url of urlStack) URL.revokeObjectURL(url.url);\n throw err;\n } finally {\n seen.pop();\n }\n}\n","import { toNative } from \"./toNative\";\nimport * as libarg from \"arg\";\n\nexport function Flags(vargs: string[]): any {\n return function (data: any): any {\n data = toNative(data);\n // We always want the help flag.\n const args: {\n [key: string]: any;\n } = {};\n\n for (const d of data) {\n let t: any = String;\n if (typeof d[1] === \"number\") {\n t = Number;\n } else if (typeof d[1] === \"boolean\") {\n t = Boolean;\n } else if (Array.isArray(d[1])) {\n t = [String];\n }\n const numDashes = d[0].length > 1 ? 2 : 1;\n args[\"-\".repeat(numDashes) + d[0]] = t;\n }\n const ret = libarg(args, { argv: vargs });\n for (const d of data) {\n if (!ret.hasOwnProperty(\"--\" + d[0]) || !ret.hasOwnProperty(\"-\" + d[0])) ret[d[0]] = d[1];\n }\n for (const key of Object.keys(ret)) {\n if (!key.startsWith(\"-\")) continue;\n const value = ret[key];\n delete ret[key];\n const numDashes = key.length === 2 ? 1 : 2;\n ret[key.slice(numDashes)] = value;\n }\n return ret;\n };\n}\n","import { Interpreter } from \"../ThirdParty/JSInterpreter\";\n\nconst defaultInterpreter = new Interpreter(\"\", () => undefined);\n\n// the acorn interpreter has a bug where it doesn't convert arrays correctly.\n// so we have to more or less copy it here.\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function toNative(pseudoObj: any): any {\n if (pseudoObj == null) return null;\n if (\n !pseudoObj.hasOwnProperty(\"properties\") ||\n !pseudoObj.hasOwnProperty(\"getter\") ||\n !pseudoObj.hasOwnProperty(\"setter\") ||\n !pseudoObj.hasOwnProperty(\"proto\")\n ) {\n return pseudoObj; // it wasn't a pseudo object anyway.\n }\n\n let nativeObj: any;\n if (pseudoObj.hasOwnProperty(\"class\") && pseudoObj.class === \"Array\") {\n nativeObj = [];\n const length = defaultInterpreter.getProperty(pseudoObj, \"length\");\n for (let i = 0; i < length; i++) {\n if (defaultInterpreter.hasProperty(pseudoObj, i)) {\n nativeObj[i] = toNative(defaultInterpreter.getProperty(pseudoObj, i));\n }\n }\n } else {\n // Object.\n nativeObj = {};\n for (const key of Object.keys(pseudoObj.properties)) {\n const val = pseudoObj.properties[key];\n nativeObj[key] = toNative(val);\n }\n }\n return nativeObj;\n}\n","import * as React from \"react\";\nimport { useTheme } from \"@mui/material/styles\";\nimport Box from \"@mui/material/Box\";\nimport IconButton from \"@mui/material/IconButton\";\nimport FirstPageIcon from \"@mui/icons-material/FirstPage\";\nimport KeyboardArrowLeft from \"@mui/icons-material/KeyboardArrowLeft\";\nimport KeyboardArrowRight from \"@mui/icons-material/KeyboardArrowRight\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\";\n\ninterface TablePaginationActionsProps {\n count: number;\n page: number;\n rowsPerPage: number;\n onPageChange: (event: React.MouseEvent<HTMLButtonElement>, newPage: number) => void;\n}\n\nexport function TablePaginationActionsAll(props: TablePaginationActionsProps): React.ReactElement {\n const theme = useTheme();\n const { count, page, rowsPerPage, onPageChange } = props;\n\n const handleFirstPageButtonClick = (event: React.MouseEvent<HTMLButtonElement>): void => {\n onPageChange(event, 0);\n };\n\n const handleBackButtonClick = (event: React.MouseEvent<HTMLButtonElement>): void => {\n onPageChange(event, page - 1);\n };\n\n const handleNextButtonClick = (event: React.MouseEvent<HTMLButtonElement>): void => {\n onPageChange(event, page + 1);\n };\n\n const handleLastPageButtonClick = (event: React.MouseEvent<HTMLButtonElement>): void => {\n onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n\n return (\n <Box sx={{ flexShrink: 0, ml: 2.5 }}>\n <IconButton onClick={handleFirstPageButtonClick} disabled={page === 0}>\n {theme.direction === \"rtl\" ? <LastPageIcon /> : <FirstPageIcon />}\n </IconButton>\n <IconButton onClick={handleBackButtonClick} disabled={page === 0}>\n {theme.direction === \"rtl\" ? <KeyboardArrowRight /> : <KeyboardArrowLeft />}\n </IconButton>\n <IconButton onClick={handleNextButtonClick} disabled={page >= Math.ceil(count / rowsPerPage) - 1}>\n {theme.direction === \"rtl\" ? <KeyboardArrowLeft /> : <KeyboardArrowRight />}\n </IconButton>\n <IconButton onClick={handleLastPageButtonClick} disabled={page >= Math.ceil(count / rowsPerPage) - 1}>\n {theme.direction === \"rtl\" ? <FirstPageIcon /> : <LastPageIcon />}\n </IconButton>\n </Box>\n );\n}\n","import * as React from \"react\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { TableCell as MuiTableCell, TableCellProps } from \"@mui/material\";\n\nconst useStyles = makeStyles({\n root: {\n border: \"1px solid white\",\n width: \"5px\",\n height: \"5px\",\n },\n});\n\nexport const TableCell: React.FC<TableCellProps> = (props: TableCellProps) => {\n return (\n <MuiTableCell\n {...props}\n classes={{\n root: useStyles().root,\n ...props.classes,\n }}\n />\n );\n};\n\ntype IProps = {\n onMouseEnter?: () => void;\n onClick?: () => void;\n color: string;\n};\n\nexport function Cell(cellProps: IProps): React.ReactElement {\n return (\n <TableCell\n style={{ backgroundColor: cellProps.color }}\n onMouseEnter={cellProps.onMouseEnter}\n onClick={cellProps.onClick}\n ></TableCell>\n );\n}\n","import { GetServer } from \"../Server/AllServers\";\nimport { RunningScript } from \"./RunningScript\";\n\nexport function getRamUsageFromRunningScript(script: RunningScript): number {\n if (script.ramUsage != null && script.ramUsage > 0) {\n return script.ramUsage; // Use cached value\n }\n\n const server = GetServer(script.server);\n if (server == null) {\n return 0;\n }\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === script.filename) {\n // Cache the ram usage for the next call\n script.ramUsage = server.scripts[i].ramUsage;\n return script.ramUsage;\n }\n }\n\n return 0;\n}\n","import { ITerminal } from \"../../ITerminal\";\nimport { removeLeadingSlash, removeTrailingSlash } from '../../DirectoryHelpers'\nimport { IRouter, ScriptEditorRouteOptions } from \"../../../ui/Router\";\nimport { IPlayer } from \"../../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../../Script/isScriptFilename\";\nimport { CursorPositions } from \"../../../ScriptEditor/CursorPositions\";\nimport { Script } from \"../../../Script/Script\";\nimport { isEmpty } from \"lodash\";\n\ninterface EditorParameters {\n terminal: ITerminal;\n router: IRouter;\n player: IPlayer;\n server: BaseServer;\n args: (string | number | boolean)[];\n}\n\nfunction isNs2(filename: string): boolean {\n return filename.endsWith(\".ns\") || filename.endsWith(\".js\");\n}\n\nconst newNs2Template = `/** @param {NS} ns **/\nexport async function main(ns) {\n\n}`;\n\ninterface ISimpleScriptGlob {\n glob: string;\n preGlob: string;\n postGlob: string;\n globError: string;\n globMatches: string[];\n globAgainst: Script[];\n}\n\nfunction containsSimpleGlob(filename: string): boolean {\n return filename.includes(\"*\");\n}\n\nfunction detectSimpleScriptGlob(\n args: EditorParameters[\"args\"],\n player: IPlayer,\n terminal: ITerminal,\n): ISimpleScriptGlob | null {\n if (args.length == 1 && containsSimpleGlob(`${args[0]}`)) {\n const filename = `${args[0]}`;\n const scripts = player.getCurrentServer().scripts;\n const parsedGlob = parseSimpleScriptGlob(filename, scripts, terminal);\n return parsedGlob;\n }\n return null;\n}\n\nfunction parseSimpleScriptGlob(globString: string, globDatabase: Script[], terminal: ITerminal): ISimpleScriptGlob {\n const parsedGlob: ISimpleScriptGlob = {\n glob: globString,\n preGlob: \"\",\n postGlob: \"\",\n globError: \"\",\n globMatches: [],\n globAgainst: globDatabase,\n };\n\n // Ensure deep globs are minified to simple globs, which act as deep globs in this impl\n globString = globString.replace(\"**\", \"*\");\n\n // Ensure only a single glob is present\n if (globString.split(\"\").filter((c) => c == \"*\").length !== 1) {\n parsedGlob.globError = \"Only a single glob is supported per command.\\nexample: `nano my-dir/*.js`\";\n return parsedGlob;\n }\n\n // Split arg around glob, normalize preGlob path\n [parsedGlob.preGlob, parsedGlob.postGlob] = globString.split(\"*\");\n parsedGlob.preGlob = removeLeadingSlash(parsedGlob.preGlob);\n\n // Add CWD to preGlob path\n const cwd = removeTrailingSlash(terminal.cwd())\n parsedGlob.preGlob = `${cwd}/${parsedGlob.preGlob}`\n\n // For every script on the current server, filter matched scripts per glob values & persist\n globDatabase.forEach((script) => {\n const filename = script.filename.startsWith('/') ? script.filename : `/${script.filename}`\n if (filename.startsWith(parsedGlob.preGlob) && filename.endsWith(parsedGlob.postGlob)) {\n parsedGlob.globMatches.push(filename);\n }\n });\n\n // Rebuild glob for potential error reporting\n parsedGlob.glob = `${parsedGlob.preGlob}*${parsedGlob.postGlob}`\n\n return parsedGlob;\n}\n\nexport function commonEditor(\n command: string,\n { terminal, router, player, args }: EditorParameters,\n scriptEditorRouteOptions?: ScriptEditorRouteOptions,\n): void {\n if (args.length < 1) {\n terminal.error(`Incorrect usage of ${command} command. Usage: ${command} [scriptname]`);\n return;\n }\n\n let filesToLoadOrCreate = args;\n try {\n const globSearch = detectSimpleScriptGlob(args, player, terminal);\n if (globSearch) {\n if (isEmpty(globSearch.globError) === false) throw new Error(globSearch.globError);\n filesToLoadOrCreate = globSearch.globMatches;\n }\n\n const files = filesToLoadOrCreate.map((arg) => {\n const filename = `${arg}`;\n\n if (isScriptFilename(filename)) {\n const filepath = terminal.getFilepath(filename);\n const script = terminal.getScript(player, filename);\n const fileIsNs2 = isNs2(filename);\n const code = script !== null ? script.code : fileIsNs2 ? newNs2Template : \"\";\n\n if (code === newNs2Template) {\n CursorPositions.saveCursor(filename, {\n row: 3,\n column: 5,\n });\n }\n\n return [filepath, code];\n }\n\n if (filename.endsWith(\".txt\")) {\n const filepath = terminal.getFilepath(filename);\n const txt = terminal.getTextFile(player, filename);\n return [filepath, txt === null ? \"\" : txt.text];\n }\n\n throw new Error(\n `Invalid file. Only scripts (.script, .ns, .js), or text files (.txt) can be edited with ${command}`,\n );\n });\n\n if (globSearch && files.length === 0) {\n throw new Error(`Could not find any valid files to open with ${command} using glob: \\`${globSearch.glob}\\``)\n }\n\n router.toScriptEditor(Object.fromEntries(files), scriptEditorRouteOptions);\n } catch (e) {\n terminal.error(`${e}`);\n }\n}\n","import { Bladeburner } from \"../../Bladeburner/Bladeburner\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function canAccessBladeburner(this: IPlayer): boolean {\n if (this.bitNodeN === 8) {\n return false;\n }\n\n return this.bitNodeN === 6 || this.bitNodeN === 7 || SourceFileFlags[6] > 0 || SourceFileFlags[7] > 0;\n}\n\nexport function inBladeburner(this: IPlayer): boolean {\n if (this.bladeburner == null) {\n return false;\n }\n return this.bladeburner instanceof Bladeburner;\n}\n\nexport function startBladeburner(this: IPlayer): void {\n this.bladeburner = new Bladeburner(this);\n}\n","import { IBladeburner } from \"./IBladeburner\";\nimport { Action, IActionParams } from \"./Action\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport class Contract extends Action {\n constructor(params: IActionParams | null = null) {\n super(params);\n }\n\n getActionTypeSkillSuccessBonus(inst: IBladeburner): number {\n return inst.skillMultipliers.successChanceContract;\n }\n\n toJSON(): any {\n return Generic_toJSON(\"Contract\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Contract {\n return Generic_fromJSON(Contract, value.data);\n }\n}\n\nReviver.constructors.Contract = Contract;\n","export const ConsoleHelpText: {\n [key: string]: string[];\n helpList: string[];\n automate: string[];\n clear: string[];\n cls: string[];\n help: string[];\n log: string[];\n skill: string[];\n start: string[];\n stop: string[];\n} = {\n helpList: [\n \"Use 'help [command]' to get more information about a particular Bladeburner console command.\",\n \" \",\n \" automate [var] [val] [hi/low] Configure simple automation for Bladeburner tasks\",\n \" clear/cls Clear the console\",\n \" help [cmd] Display this help text, or help text for a specific command\",\n \" log [en/dis] [type] Enable or disable logging for events and actions\",\n \" skill [action] [name] Level or display info about your Bladeburner skills\",\n \" start [type] [name] Start a Bladeburner action/task\",\n \" stop Stops your current Bladeburner action/task\",\n \" \",\n ],\n automate: [\n \"Usage: automate [var] [val] [hi/low]\",\n \" \",\n \"A simple way to automate your Bladeburner actions. This console command can be used \" +\n \"to automatically start an action when your stamina rises above a certain threshold, and \" +\n \"automatically switch to another action when your stamina drops below another threshold.\",\n \" \",\n \" automate status - Check the current status of your automation and get a brief description of what it'll do\",\n \" automate en - Enable the automation feature\",\n \" automate dis - Disable the automation feature\",\n \" \",\n \"There are four properties that must be set for this automation to work properly. Here is how to set them:\",\n \" \",\n \" automate stamina 100 high\",\n \" automate contract Tracking high\",\n \" automate stamina 50 low\",\n \" automate general 'Field Analysis' low\",\n \" \",\n \"Using the four console commands above will set the automation to perform Tracking contracts \" +\n \"if your stamina is 100 or higher, and then switch to Field Analysis if your stamina drops below \" +\n \"50. Note that when setting the action, the name of the action is CASE-SENSITIVE. It must \" +\n \"exactly match whatever the name is in the UI.\",\n \" \",\n ],\n clear: [\"Usage: clear\", \" \", \"Clears the console\", \" \"],\n cls: [\"Usage: cls\", \" \", \"Clears the console\", \" \"],\n help: [\n \"Usage: help [command]\",\n \" \",\n \"Running 'help' with no arguments displays the general help text, which lists all console commands \" +\n \"and a brief description of what they do. A command can be specified to get more specific help text \" +\n \"about that particular command. For example:\",\n \" \",\n \" help automate\",\n \" \",\n \"will display specific information about using the automate console command\",\n \" \",\n ],\n log: [\n \"Usage: log [en/dis] [type]\",\n \" \",\n \"Enable or disable logging. By default, the results of completing actions such as contracts/operations are logged \" +\n \"in the console. There are also random events that are logged in the console as well. The five categories of \" +\n \"things that get logged are:\",\n \" \",\n \"[general, contracts, ops, blackops, events]\",\n \" \",\n \"The logging for these categories can be enabled or disabled like so:\",\n \" \",\n \" log dis contracts - Disables logging that occurs when contracts are completed\",\n \" log en contracts - Enables logging that occurs when contracts are completed\",\n \" log dis events - Disables logging for Bladeburner random events\",\n \" \",\n \"Logging can be universally enabled/disabled using the 'all' keyword:\",\n \" \",\n \" log dis all\",\n \" log en all\",\n \" \",\n ],\n skill: [\n \"Usage: skill [action] [name]\",\n \" \",\n \"Level or display information about your skills.\",\n \" \",\n \"To display information about all of your skills and your multipliers, use:\",\n \" \",\n \" skill list\",\n \" \",\n \"To display information about a specific skill, specify the name of the skill afterwards. \" +\n \"Note that the name of the skill is case-sensitive. Enter it exactly as seen in the UI. If \" +\n \"the name of the skill has whitespace, enclose the name of the skill in double quotation marks:\",\n \" \",\n \" skill list Reaper\",\n \" skill list 'Digital Observer'\",\n \" \",\n \"This console command can also be used to level up skills:\",\n \" \",\n \" skill level [skill name]\",\n \" \",\n ],\n start: [\n \"Usage: start [type] [name]\",\n \" \",\n \"Start an action. An action is specified by its type and its name. The \" +\n \"name is case-sensitive. It must appear exactly as it does in the UI. If \" +\n \"the name of the action has whitespace, enclose it in double quotation marks. \" +\n \"Valid action types include:\",\n \" \",\n \"[general, contract, op, blackop]\",\n \" \",\n \"Examples:\",\n \" \",\n \" start contract Tracking\",\n \" start op 'Undercover Operation'\",\n \" \",\n ],\n stop: [\"Usage: stop\", \" \", \"Stop your current action and go idle.\", \" \"],\n};\n","import { Corporation } from \"../../Corporation/Corporation\";\nimport { CorporationUnlockUpgrades } from \"../../Corporation/data/CorporationUnlockUpgrades\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function canAccessCorporation(this: IPlayer): boolean {\n return this.bitNodeN === 3 || SourceFileFlags[3] > 0;\n}\n\nexport function hasCorporation(this: IPlayer): boolean {\n if (this.corporation == null) {\n return false;\n }\n return this.corporation instanceof Corporation;\n}\n\nexport function startCorporation(this: IPlayer, corpName: string, additionalShares = 0): void {\n this.corporation = new Corporation({\n name: corpName,\n });\n\n if (SourceFileFlags[3] === 3) {\n const warehouseApi = CorporationUnlockUpgrades[\"7\"][0];\n const OfficeApi = CorporationUnlockUpgrades[\"8\"][0];\n\n this.corporation.unlockUpgrades[warehouseApi] = 1;\n this.corporation.unlockUpgrades[OfficeApi] = 1;\n }\n\n this.corporation.totalShares += additionalShares;\n}\n","// Defines a \"Research Tree\"\n// Each Industry has a unique Research Tree\n// Each Node in the Research Trees only holds the name(s) of Research,\n// not an actual Research object. The name can be used to obtain a reference\n// to the corresponding Research object using the ResearchMap\nimport { Research } from \"./Research\";\nimport { ResearchMap } from \"./ResearchMap\";\n\nimport { IMap } from \"../types\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\ninterface IConstructorParams {\n children?: Node[];\n cost: number;\n text: string;\n parent?: Node | null;\n}\n\nexport class Node {\n // All child Nodes in the tree\n // The Research held in this Node is a prerequisite for all Research in\n // child Nodes\n children: Node[] = [];\n\n // How much Scientific Research is needed for this\n // Necessary to show it on the UI\n cost = 0;\n\n // Whether or not this Research has been unlocked\n researched = false;\n\n // Parent node in the tree\n // The parent node defines the prerequisite Research (there can only be one)\n // Set as null for no prerequisites\n parent: Node | null = null;\n\n // Name of the Research held in this Node\n text = \"\";\n\n constructor(p: IConstructorParams = { cost: 0, text: \"\" }) {\n if (ResearchMap[p.text] == null) {\n throw new Error(`Invalid Research name used when constructing ResearchTree Node: ${p.text}`);\n }\n\n this.text = p.text;\n this.cost = p.cost;\n\n if (p.children && p.children.length > 0) {\n this.children = p.children;\n }\n\n if (p.parent != null) {\n this.parent = p.parent;\n }\n }\n\n addChild(n: Node): void {\n this.children.push(n);\n n.parent = this;\n }\n\n // Return an object that describes a TreantJS-compatible markup/config for this Node\n // See: http://fperucic.github.io/treant-js/\n createTreantMarkup(): any {\n const childrenArray = [];\n for (let i = 0; i < this.children.length; ++i) {\n childrenArray.push(this.children[i].createTreantMarkup());\n }\n\n // Determine what css class this Node should have in the diagram\n let htmlClass = \"tooltip\";\n if (this.researched) {\n htmlClass += \" researched\";\n } else if (this.parent && this.parent.researched === false) {\n htmlClass += \" locked\";\n } else {\n htmlClass += \" unlocked\";\n }\n\n const research: Research | null = ResearchMap[this.text];\n const sanitizedName: string = this.text.replace(/\\s/g, \"\");\n return {\n children: childrenArray,\n HTMLclass: htmlClass,\n innerHTML:\n `<div id=\"${sanitizedName}-corp-research-click-listener\">` +\n `${this.text}<br>${numeralWrapper.format(this.cost, \"0,0\")} Scientific Research` +\n `<span class=\"tooltiptext\">` +\n `${research.desc}` +\n `</span>` +\n `</div>`,\n text: { name: this.text },\n };\n }\n\n // Recursive function for finding a Node with the specified text\n findNode(text: string): Node | null {\n // Is this the Node?\n if (this.text === text) {\n return this;\n }\n\n // Recursively search chilren\n let res = null;\n for (let i = 0; i < this.children.length; ++i) {\n res = this.children[i].findNode(text);\n if (res != null) {\n return res;\n }\n }\n\n return null;\n }\n\n setParent(n: Node): void {\n this.parent = n;\n }\n}\n\n// A ResearchTree defines all available Research in an Industry\n// The root node in a Research Tree must always be the \"Hi-Tech R&D Laboratory\"\nexport class ResearchTree {\n // Object containing names of all acquired Research by name\n researched: IMap<boolean> = {};\n\n // Root Node\n root: Node | null = null;\n\n // Return an object that contains a Tree markup for TreantJS (using the JSON approach)\n // See: http://fperucic.github.io/treant-js/\n createTreantMarkup(): any {\n if (this.root == null) {\n return {};\n }\n\n const treeMarkup = this.root.createTreantMarkup();\n\n return {\n chart: {\n container: \"\",\n },\n nodeStructure: treeMarkup,\n };\n }\n\n // Gets an array with the 'text' values of ALL Nodes in the Research Tree\n getAllNodes(): string[] {\n const res: string[] = [];\n const queue: Node[] = [];\n\n if (this.root == null) {\n return res;\n }\n\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n if (node == null) {\n continue;\n }\n\n res.push(node.text);\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n return res;\n }\n\n // Get total multipliers from this Research Tree\n getAdvertisingMultiplier(): number {\n return this.getMultiplierHelper(\"advertisingMult\");\n }\n\n getEmployeeChaMultiplier(): number {\n return this.getMultiplierHelper(\"employeeChaMult\");\n }\n\n getEmployeeCreMultiplier(): number {\n return this.getMultiplierHelper(\"employeeCreMult\");\n }\n\n getEmployeeEffMultiplier(): number {\n return this.getMultiplierHelper(\"employeeEffMult\");\n }\n\n getEmployeeIntMultiplier(): number {\n return this.getMultiplierHelper(\"employeeIntMult\");\n }\n\n getProductionMultiplier(): number {\n return this.getMultiplierHelper(\"productionMult\");\n }\n\n getProductProductionMultiplier(): number {\n return this.getMultiplierHelper(\"productProductionMult\");\n }\n\n getSalesMultiplier(): number {\n return this.getMultiplierHelper(\"salesMult\");\n }\n\n getScientificResearchMultiplier(): number {\n return this.getMultiplierHelper(\"sciResearchMult\");\n }\n\n getStorageMultiplier(): number {\n return this.getMultiplierHelper(\"storageMult\");\n }\n\n // Helper function for all the multiplier getter fns\n getMultiplierHelper(propName: string): number {\n let res = 1;\n if (this.root == null) {\n return res;\n }\n\n const queue: Node[] = [];\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n\n // If the Node has not been researched, there's no need to\n // process it or its children\n if (node == null || !node.researched) {\n continue;\n }\n\n const research: Research | null = ResearchMap[node.text];\n\n // Safety checks\n if (research == null) {\n console.warn(`Invalid Research name in node: ${node.text}`);\n continue;\n }\n\n const mult: any = (research as any)[propName];\n if (mult == null) {\n console.warn(`Invalid propName specified in ResearchTree.getMultiplierHelper: ${propName}`);\n continue;\n }\n\n res *= mult;\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n return res;\n }\n\n // Search for a Node with the given name ('text' property on the Node)\n // Returns 'null' if it cannot be found\n findNode(name: string): Node | null {\n if (this.root == null) {\n return null;\n }\n return this.root.findNode(name);\n }\n\n // Marks a Node as researched\n research(name: string): void {\n if (this.root == null) {\n return;\n }\n\n const queue: Node[] = [];\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n if (node == null) {\n continue;\n }\n\n if (node.text === name) {\n node.researched = true;\n this.researched[name] = true;\n return;\n }\n\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n console.warn(`ResearchTree.research() did not find the specified Research node for: ${name}`);\n }\n\n // Set the tree's Root Node\n setRoot(root: Node): void {\n this.root = root;\n }\n}\n","/**\n * How many stock market 'ticks' before a 'cycle' is triggered.\n * A 'tick' is whenver stock prices update\n */\nexport const TicksPerCycle = 75;\n","// Function that returns the next Company Position in the \"ladder\"\n// i.e. the next position to get promoted to\nimport { CompanyPosition } from \"./CompanyPosition\";\nimport { CompanyPositions } from \"./CompanyPositions\";\n\nexport function getNextCompanyPositionHelper(currPos: CompanyPosition | null): CompanyPosition | null {\n if (currPos == null) {\n return null;\n }\n\n const nextPosName: string | null = currPos.nextPosition;\n if (nextPosName == null) {\n return null;\n }\n\n return CompanyPositions[nextPosName];\n}\n","/**\n * Game engine. Handles the main game loop.\n */\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\nimport { Augmentations } from \"./Augmentation/Augmentations\";\nimport { initAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { initBitNodeMultipliers } from \"./BitNode/BitNode\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { generateRandomContract } from \"./CodingContractGenerator\";\nimport { initCompanies } from \"./Company/Companies\";\nimport { Corporation } from \"./Corporation/Corporation\";\nimport { CONSTANTS } from \"./Constants\";\nimport { Factions, initFactions } from \"./Faction/Factions\";\nimport { staneksGift } from \"./CotMG/Helper\";\nimport { processPassiveFactionRepGain, inviteToFaction } from \"./Faction/FactionHelpers\";\nimport { Router } from \"./ui/GameRoot\";\nimport { SetupTextEditor } from \"./ScriptEditor/ui/ScriptEditorRoot\";\n\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"./PersonObjects/formulas/reputation\";\nimport { hasHacknetServers, processHacknetEarnings } from \"./Hacknet/HacknetHelpers\";\nimport { iTutorialStart } from \"./InteractiveTutorial\";\nimport { checkForMessagesToSend, initMessages } from \"./Message/MessageHelpers\";\nimport { loadAllRunningScripts, updateOnlineScriptTimes } from \"./NetscriptWorker\";\nimport { Player } from \"./Player\";\nimport { saveObject, loadGame } from \"./SaveObject\";\nimport { initForeignServers } from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { ThemeEvents } from \"./Themes/ui/Theme\";\nimport { updateSourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { initSymbolToStockMap, processStockPrices } from \"./StockMarket/StockMarket\";\nimport { Terminal } from \"./Terminal\";\nimport { Sleeve } from \"./PersonObjects/Sleeve/Sleeve\";\n\nimport { Money } from \"./ui/React/Money\";\nimport { Hashes } from \"./ui/React/Hashes\";\nimport { Reputation } from \"./ui/React/Reputation\";\n\nimport { AlertEvents } from \"./ui/React/AlertManager\";\nimport { exceptionAlert } from \"./utils/helpers/exceptionAlert\";\n\nimport { startExploits } from \"./Exploits/loops\";\nimport { calculateAchievements } from \"./Achievements/Achievements\";\n\nimport React from \"react\";\nimport { setupUncaughtPromiseHandler } from \"./UncaughtPromiseHandler\";\n\nconst Engine: {\n _lastUpdate: number;\n updateGame: (numCycles?: number) => void;\n Counters: {\n [key: string]: number | undefined;\n autoSaveCounter: number;\n updateSkillLevelsCounter: number;\n updateDisplays: number;\n updateDisplaysLong: number;\n updateActiveScriptsDisplay: number;\n createProgramNotifications: number;\n augmentationsNotifications: number;\n checkFactionInvitations: number;\n passiveFactionGrowth: number;\n messages: number;\n mechanicProcess: number;\n contractGeneration: number;\n achievementsCounter: number;\n };\n decrementAllCounters: (numCycles?: number) => void;\n checkCounters: () => void;\n load: (saveString: string) => void;\n start: () => void;\n} = {\n // Time variables (milliseconds unix epoch time)\n _lastUpdate: new Date().getTime(),\n\n updateGame: function (numCycles = 1) {\n const time = numCycles * CONSTANTS._idleSpeed;\n if (Player.totalPlaytime == null) {\n Player.totalPlaytime = 0;\n }\n if (Player.playtimeSinceLastAug == null) {\n Player.playtimeSinceLastAug = 0;\n }\n if (Player.playtimeSinceLastBitnode == null) {\n Player.playtimeSinceLastBitnode = 0;\n }\n Player.totalPlaytime += time;\n Player.playtimeSinceLastAug += time;\n Player.playtimeSinceLastBitnode += time;\n\n Terminal.process(Router, Player, numCycles);\n\n Player.process(Router, numCycles);\n\n // Update stock prices\n if (Player.hasWseAccount) {\n processStockPrices(numCycles);\n }\n\n // Gang, if applicable\n if (Player.inGang() && Player.gang !== null) {\n Player.gang.process(numCycles, Player);\n }\n\n // Staneks gift\n staneksGift.process(Player, numCycles);\n\n // Corporation\n if (Player.corporation instanceof Corporation) {\n // Stores cycles in a \"buffer\". Processed separately using Engine Counters\n Player.corporation.storeCycles(numCycles);\n }\n\n if (Player.bladeburner instanceof Bladeburner) {\n Player.bladeburner.storeCycles(numCycles);\n }\n\n // Sleeves\n for (let i = 0; i < Player.sleeves.length; ++i) {\n if (Player.sleeves[i] instanceof Sleeve) {\n const expForOtherSleeves = Player.sleeves[i].process(Player, numCycles);\n\n // This sleeve earns experience for other sleeves\n if (expForOtherSleeves == null) {\n continue;\n }\n for (let j = 0; j < Player.sleeves.length; ++j) {\n if (j === i) {\n continue;\n }\n Player.sleeves[j].gainExperience(Player, expForOtherSleeves, numCycles, true);\n }\n }\n }\n\n // Counters\n Engine.decrementAllCounters(numCycles);\n Engine.checkCounters();\n\n // Update the running time of all active scripts\n updateOnlineScriptTimes(numCycles);\n\n // Hacknet Nodes\n processHacknetEarnings(Player, numCycles);\n },\n\n /**\n * Counters for the main event loop. Represent the number of game cycles that\n * are required for something to happen. These counters are in game cycles,\n * which is once every 200ms\n */\n Counters: {\n autoSaveCounter: 300,\n updateSkillLevelsCounter: 10,\n updateDisplays: 3,\n updateDisplaysLong: 15,\n updateActiveScriptsDisplay: 5,\n createProgramNotifications: 10,\n augmentationsNotifications: 10,\n checkFactionInvitations: 100,\n passiveFactionGrowth: 5,\n messages: 150,\n mechanicProcess: 5, // Processes certain mechanics (Corporation, Bladeburner)\n contractGeneration: 3000, // Generate Coding Contracts\n achievementsCounter: 60, // Check if we have new achievements\n },\n\n decrementAllCounters: function (numCycles = 1) {\n for (const counterName of Object.keys(Engine.Counters)) {\n const counter = Engine.Counters[counterName];\n if (counter === undefined) throw new Error(\"counter should not be undefined\");\n Engine.Counters[counterName] = counter - numCycles;\n }\n },\n\n /**\n * Checks if any counters are 0. If they are, executes whatever\n * is necessary and then resets the counter\n */\n checkCounters: function () {\n if (Engine.Counters.autoSaveCounter <= 0) {\n if (Settings.AutosaveInterval == null) {\n Settings.AutosaveInterval = 60;\n }\n if (Settings.AutosaveInterval === 0) {\n Engine.Counters.autoSaveCounter = Infinity;\n } else {\n Engine.Counters.autoSaveCounter = Settings.AutosaveInterval * 5;\n saveObject.saveGame(!Settings.SuppressSavedGameToast);\n }\n }\n\n if (Engine.Counters.checkFactionInvitations <= 0) {\n const invitedFactions = Player.checkForFactionInvitations();\n if (invitedFactions.length > 0) {\n const randFaction = invitedFactions[Math.floor(Math.random() * invitedFactions.length)];\n inviteToFaction(randFaction);\n }\n Engine.Counters.checkFactionInvitations = 100;\n }\n\n if (Engine.Counters.passiveFactionGrowth <= 0) {\n const adjustedCycles = Math.floor(5 - Engine.Counters.passiveFactionGrowth);\n processPassiveFactionRepGain(adjustedCycles);\n Engine.Counters.passiveFactionGrowth = 5;\n }\n\n if (Engine.Counters.messages <= 0) {\n checkForMessagesToSend();\n if (Augmentations[AugmentationNames.TheRedPill].owned) {\n Engine.Counters.messages = 4500; // 15 minutes for Red pill message\n } else {\n Engine.Counters.messages = 150;\n }\n }\n if (Player.corporation instanceof Corporation) {\n Player.corporation.process(Player);\n }\n if (Engine.Counters.mechanicProcess <= 0) {\n if (Player.bladeburner instanceof Bladeburner) {\n try {\n Player.bladeburner.process(Router, Player);\n } catch (e) {\n exceptionAlert(\"Exception caught in Bladeburner.process(): \" + e);\n }\n }\n Engine.Counters.mechanicProcess = 5;\n }\n\n if (Engine.Counters.contractGeneration <= 0) {\n // X% chance of a contract being generated\n if (Math.random() <= 0.25) {\n generateRandomContract();\n }\n Engine.Counters.contractGeneration = 3000;\n }\n\n if (Engine.Counters.achievementsCounter <= 0) {\n calculateAchievements();\n Engine.Counters.achievementsCounter = 300;\n }\n },\n\n load: function (saveString) {\n startExploits();\n setupUncaughtPromiseHandler();\n // Load game from save or create new game\n if (loadGame(saveString)) {\n ThemeEvents.emit();\n\n initBitNodeMultipliers(Player);\n updateSourceFileFlags(Player);\n initAugmentations(); // Also calls Player.reapplyAllAugmentations()\n Player.reapplyAllSourceFiles();\n if (Player.hasWseAccount) {\n initSymbolToStockMap();\n }\n\n // Calculate the number of cycles have elapsed while offline\n Engine._lastUpdate = new Date().getTime();\n const lastUpdate = Player.lastUpdate;\n const timeOffline = Engine._lastUpdate - lastUpdate;\n const numCyclesOffline = Math.floor(timeOffline / CONSTANTS._idleSpeed);\n\n // Generate coding contracts\n // let numContracts = 0;\n // if (numCyclesOffline < 3000 * 100) {\n // // if we have less than 100 rolls, just roll them exactly.\n // for (let i = 0; i < numCyclesOffline / 3000; i++) {\n // if (Math.random() < 0.25) numContracts++;\n // }\n // } else {\n // // just average it.\n // numContracts = (numCyclesOffline / 3000) * 0.25;\n // }\n // console.log(`${numCyclesOffline} ${numContracts}`);\n // for (let i = 0; i < numContracts; i++) {\n // generateRandomContract();\n // }\n\n let offlineReputation = 0;\n const offlineHackingIncome = (Player.moneySourceA.hacking / Player.playtimeSinceLastAug) * timeOffline * 0.75;\n Player.gainMoney(offlineHackingIncome, \"hacking\");\n // Process offline progress\n loadAllRunningScripts(Player); // This also takes care of offline production for those scripts\n if (Player.isWorking) {\n Player.focus = true;\n if (Player.workType == CONSTANTS.WorkTypeFaction) {\n Player.workForFaction(numCyclesOffline);\n } else if (Player.workType == CONSTANTS.WorkTypeCreateProgram) {\n Player.createProgramWork(numCyclesOffline);\n } else if (Player.workType == CONSTANTS.WorkTypeStudyClass) {\n Player.takeClass(numCyclesOffline);\n } else if (Player.workType == CONSTANTS.WorkTypeCrime) {\n Player.commitCrime(numCyclesOffline);\n } else if (Player.workType == CONSTANTS.WorkTypeCompanyPartTime) {\n Player.workPartTime(numCyclesOffline);\n } else {\n Player.work(numCyclesOffline);\n }\n } else {\n for (let i = 0; i < Player.factions.length; i++) {\n const facName = Player.factions[i];\n if (!Factions.hasOwnProperty(facName)) continue;\n const faction = Factions[facName];\n if (!faction.isMember) continue;\n // No rep for special factions.\n const info = faction.getInfo();\n if (!info.offersWork()) continue;\n // No rep for gangs.\n if (Player.getGangName() === facName) continue;\n\n const hRep = getHackingWorkRepGain(Player, faction);\n const sRep = getFactionSecurityWorkRepGain(Player, faction);\n const fRep = getFactionFieldWorkRepGain(Player, faction);\n // can be infinite, doesn't matter.\n const reputationRate = Math.max(hRep, sRep, fRep) / Player.factions.length;\n\n const rep = reputationRate * numCyclesOffline;\n faction.playerReputation += rep;\n offlineReputation += rep;\n }\n }\n\n // Hacknet Nodes offline progress\n const offlineProductionFromHacknetNodes = processHacknetEarnings(Player, numCyclesOffline);\n const hacknetProdInfo = hasHacknetServers(Player) ? (\n <>\n <Hashes hashes={offlineProductionFromHacknetNodes} /> hashes\n </>\n ) : (\n <Money money={offlineProductionFromHacknetNodes} />\n );\n\n // Passive faction rep gain offline\n processPassiveFactionRepGain(numCyclesOffline);\n\n // Stock Market offline progress\n if (Player.hasWseAccount) {\n processStockPrices(numCyclesOffline);\n }\n\n // Gang progress for BitNode 2\n const gang = Player.gang;\n if (Player.inGang() && gang !== null) {\n gang.process(numCyclesOffline, Player);\n }\n\n // Corporation offline progress\n if (Player.corporation instanceof Corporation) {\n Player.corporation.storeCycles(numCyclesOffline);\n }\n\n // Bladeburner offline progress\n if (Player.bladeburner instanceof Bladeburner) {\n Player.bladeburner.storeCycles(numCyclesOffline);\n }\n\n staneksGift.process(Player, numCyclesOffline);\n\n // Sleeves offline progress\n for (let i = 0; i < Player.sleeves.length; ++i) {\n if (Player.sleeves[i] instanceof Sleeve) {\n const expForOtherSleeves = Player.sleeves[i].process(Player, numCyclesOffline);\n\n // This sleeve earns experience for other sleeves\n if (expForOtherSleeves == null) {\n continue;\n }\n for (let j = 0; j < Player.sleeves.length; ++j) {\n if (j === i) {\n continue;\n }\n Player.sleeves[j].gainExperience(Player, expForOtherSleeves, numCyclesOffline, true);\n }\n }\n }\n\n // Update total playtime\n const time = numCyclesOffline * CONSTANTS._idleSpeed;\n if (Player.totalPlaytime == null) {\n Player.totalPlaytime = 0;\n }\n if (Player.playtimeSinceLastAug == null) {\n Player.playtimeSinceLastAug = 0;\n }\n if (Player.playtimeSinceLastBitnode == null) {\n Player.playtimeSinceLastBitnode = 0;\n }\n Player.totalPlaytime += time;\n Player.playtimeSinceLastAug += time;\n Player.playtimeSinceLastBitnode += time;\n\n Player.lastUpdate = Engine._lastUpdate;\n Engine.start(); // Run main game loop and Scripts loop\n const timeOfflineString = convertTimeMsToTimeElapsedString(time);\n setTimeout(\n () =>\n AlertEvents.emit(\n <>\n Offline for {timeOfflineString}. While you were offline, your scripts generated{\" \"}\n <Money money={offlineHackingIncome} />, your Hacknet Nodes generated {hacknetProdInfo} and you gained{\" \"}\n <Reputation reputation={offlineReputation} /> reputation divided amongst your factions.\n </>,\n ),\n 250,\n );\n } else {\n // No save found, start new game\n initBitNodeMultipliers(Player);\n Engine.start(); // Run main game loop and Scripts loop\n Player.init();\n initForeignServers(Player.getHomeComputer());\n initCompanies();\n initFactions();\n initAugmentations();\n initMessages();\n updateSourceFileFlags(Player);\n\n // Start interactive tutorial\n iTutorialStart();\n }\n SetupTextEditor();\n },\n\n start: function () {\n // Get time difference\n const _thisUpdate = new Date().getTime();\n let diff = _thisUpdate - Engine._lastUpdate;\n const offset = diff % CONSTANTS._idleSpeed;\n\n // Divide this by cycle time to determine how many cycles have elapsed since last update\n diff = Math.floor(diff / CONSTANTS._idleSpeed);\n\n if (diff > 0) {\n // Update the game engine by the calculated number of cycles\n Engine._lastUpdate = _thisUpdate - offset;\n Player.lastUpdate = _thisUpdate - offset;\n Engine.updateGame(diff);\n }\n window.requestAnimationFrame(Engine.start);\n },\n};\n\nexport { Engine };\n","export { Theme as Default } from \"./default\";\nexport { Theme as DefaultLite } from \"./default-lite\";\nexport { Theme as Monokai } from \"./monokai-ish\";\nexport { Theme as Warmer } from \"./warmer\";\nexport { Theme as DarkPlus } from \"./dark-plus\";\nexport { Theme as MayukaiDark } from \"./mayukai-dark\";\nexport { Theme as Purple } from \"./purple\";\nexport { Theme as SmoothGreen } from \"./smooth-green\";\nexport { Theme as Dracula } from \"./dracula\";\nexport { Theme as DarkBlue } from \"./dark-blue\";\nexport { Theme as DiscordLike } from \"./discord-like\";\nexport { Theme as OneDark } from \"./one-dark\";\nexport { Theme as MutedGoldBlue } from \"./muted-gold-blue\";\nexport { Theme as Light } from \"./light\";\n","import React, { useState, useEffect } from \"react\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Box from \"@mui/material/Box\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nimport { Terminal } from \"../Terminal\";\nimport { load } from \"../db\";\nimport { Player } from \"../Player\";\nimport { Engine } from \"../engine\";\nimport { GameRoot } from \"./GameRoot\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { ActivateRecoveryMode } from \"./React/RecoveryRoot\";\nimport { hash } from \"../hash/hash\";\nimport { pushGameReady } from \"../Electron\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n backgroundColor: theme.colors.backgroundprimary,\n },\n }),\n);\n\nexport function LoadingScreen(): React.ReactElement {\n const classes = useStyles();\n const [show, setShow] = useState(false);\n const [loaded, setLoaded] = useState(false);\n\n const version = `v${CONSTANTS.VersionString} (${hash()})`;\n if (process.env.NODE_ENV === \"development\") {\n document.title = `[dev] Bitburner ${version}`;\n } else {\n document.title = `Bitburner ${version}`;\n }\n\n useEffect(() => {\n const id = setTimeout(() => {\n if (!loaded) setShow(true);\n }, 2000);\n return () => clearTimeout(id);\n });\n\n useEffect(() => {\n async function doLoad(): Promise<void> {\n await load()\n .then((saveString) => {\n try {\n Engine.load(saveString);\n } catch (err: any) {\n ActivateRecoveryMode();\n setLoaded(true);\n throw err;\n }\n\n pushGameReady();\n setLoaded(true);\n })\n .catch((reason) => {\n console.error(reason);\n Engine.load(\"\");\n setLoaded(true);\n });\n }\n doLoad();\n }, []);\n\n return (\n <Box className={classes.root}>\n {loaded ? (\n <GameRoot terminal={Terminal} engine={Engine} player={Player} />\n ) : (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <CircularProgress size={150} color=\"primary\" />\n </Grid>\n <Grid item>\n <Typography variant=\"h3\">Loading Bitburner {version}</Typography>\n </Grid>\n {show && (\n <Grid item>\n <Typography>\n If the game fails to load, consider <a href=\"?noScripts\">killing all scripts</a>\n </Typography>\n </Grid>\n )}\n </Grid>\n )}\n </Box>\n );\n}\n","/**\n * Checks that a variable is a valid number. A valid number\n * must be a \"number\" type and cannot be NaN\n */\nexport function isValidNumber(n: number): boolean {\n return typeof n === \"number\" && !isNaN(n);\n}\n","/**\n * Represents a Limit or Buy Order on the stock market. Does not represent\n * a Market Order since those are just executed immediately\n */\nimport { OrderTypes } from \"./data/OrderTypes\";\nimport { PositionTypes } from \"./data/PositionTypes\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport class Order {\n readonly pos: PositionTypes;\n readonly price: number;\n shares: number;\n readonly stockSymbol: string;\n readonly type: OrderTypes;\n\n constructor(\n stockSymbol = \"\",\n shares = 0,\n price = 0,\n typ: OrderTypes = OrderTypes.LimitBuy,\n pos: PositionTypes = PositionTypes.Long,\n ) {\n // Validate arguments\n let invalidArgs = false;\n if (typeof shares !== \"number\" || typeof price !== \"number\") {\n invalidArgs = true;\n }\n if (isNaN(shares) || isNaN(price)) {\n invalidArgs = true;\n }\n if (typeof stockSymbol !== \"string\") {\n invalidArgs = true;\n }\n if (invalidArgs) {\n throw new Error(`Invalid constructor paramters for Order`);\n }\n\n this.stockSymbol = stockSymbol;\n this.shares = shares;\n this.price = price;\n this.type = typ;\n this.pos = pos;\n }\n\n /**\n * Serialize the Order to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Order\", this);\n }\n\n /**\n * Initializes a Order from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Order {\n return Generic_fromJSON(Order, value.data);\n }\n}\n\nReviver.constructors.Order = Order;\n","import { Fragment } from \"./Fragment\";\nimport { ActiveFragment } from \"./ActiveFragment\";\nimport { FragmentType } from \"./FragmentType\";\nimport { IStaneksGift } from \"./IStaneksGift\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Factions } from \"../Faction/Factions\";\nimport { CalculateEffect } from \"./formulas/effect\";\nimport { StaneksGiftEvents } from \"./StaneksGiftEvents\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { CONSTANTS } from \"../Constants\";\nimport { StanekConstants } from \"./data/Constants\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Player } from \"../Player\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\n\nexport class StaneksGift implements IStaneksGift {\n storedCycles = 0;\n fragments: ActiveFragment[] = [];\n\n baseSize(): number {\n return StanekConstants.BaseSize + BitNodeMultipliers.StaneksGiftExtraSize + Player.sourceFileLvl(13);\n }\n\n width(): number {\n return Math.floor(this.baseSize() / 2 + 1);\n }\n height(): number {\n return Math.floor(this.baseSize() / 2 + 0.6);\n }\n\n charge(player: IPlayer, af: ActiveFragment, threads: number): void {\n af.avgCharge = (af.numCharge * af.avgCharge + threads) / (af.numCharge + 1);\n af.numCharge++;\n\n const cotmg = Factions[\"Church of the Machine God\"];\n cotmg.playerReputation += (player.faction_rep_mult * (Math.pow(threads, 0.95) * (cotmg.favor + 100))) / 1000;\n }\n\n inBonus(): boolean {\n return (this.storedCycles * CONSTANTS._idleSpeed) / 1000 > 1;\n }\n\n process(p: IPlayer, numCycles = 1): void {\n if (!p.hasAugmentation(AugmentationNames.StaneksGift1)) return;\n this.storedCycles += numCycles;\n this.storedCycles -= 10;\n this.storedCycles = Math.max(0, this.storedCycles);\n this.updateMults(p);\n StaneksGiftEvents.emit();\n }\n\n effect(fragment: ActiveFragment): number {\n // Find all the neighbooring cells\n const cells = fragment.neighboors();\n // find the neighbooring active fragments.\n const maybeFragments = cells.map((n) => this.fragmentAt(n[0], n[1]));\n\n // Filter out undefined with typescript \"Type guard\". Whatever\n let neighboors = maybeFragments.filter((v: ActiveFragment | undefined): v is ActiveFragment => !!v);\n\n neighboors = neighboors.filter((fragment) => fragment.fragment().type === FragmentType.Booster);\n let boost = 1;\n\n neighboors = neighboors.filter((v, i, s) => s.indexOf(v) === i);\n for (const neighboor of neighboors) {\n boost *= neighboor.fragment().power;\n }\n return CalculateEffect(fragment.avgCharge, fragment.numCharge, fragment.fragment().power, boost);\n }\n\n canPlace(rootX: number, rootY: number, rotation: number, fragment: Fragment): boolean {\n if (rootX < 0 || rootY < 0) return false;\n if (rootX + fragment.width(rotation) > this.width()) return false;\n if (rootY + fragment.height(rotation) > this.height()) return false;\n if (this.count(fragment) >= fragment.limit) return false;\n const newFrag = new ActiveFragment({ x: rootX, y: rootY, rotation: rotation, fragment: fragment });\n for (const aFrag of this.fragments) {\n if (aFrag.collide(newFrag)) return false;\n }\n return true;\n }\n\n place(rootX: number, rootY: number, rotation: number, fragment: Fragment): boolean {\n if (!this.canPlace(rootX, rootY, rotation, fragment)) return false;\n this.fragments.push(new ActiveFragment({ x: rootX, y: rootY, rotation: rotation, fragment: fragment }));\n return true;\n }\n\n findFragment(rootX: number, rootY: number): ActiveFragment | undefined {\n return this.fragments.find((f) => f.x === rootX && f.y === rootY);\n }\n\n fragmentAt(worldX: number, worldY: number): ActiveFragment | undefined {\n for (const aFrag of this.fragments) {\n if (aFrag.fullAt(worldX, worldY)) {\n return aFrag;\n }\n }\n\n return undefined;\n }\n\n count(fragment: Fragment): number {\n let amt = 0;\n for (const aFrag of this.fragments) {\n if (aFrag.fragment().id === fragment.id) amt++;\n }\n return amt;\n }\n\n delete(rootX: number, rootY: number): boolean {\n for (let i = 0; i < this.fragments.length; i++) {\n if (this.fragments[i].x === rootX && this.fragments[i].y === rootY) {\n this.fragments.splice(i, 1);\n return true;\n }\n }\n\n return false;\n }\n\n clear(): void {\n this.fragments = [];\n }\n\n clearCharge(): void {\n this.fragments.forEach((f) => {\n f.avgCharge = 0;\n f.numCharge = 0;\n });\n }\n\n updateMults(p: IPlayer): void {\n p.reapplyAllAugmentations(true);\n p.reapplyAllSourceFiles();\n\n for (const aFrag of this.fragments) {\n const fragment = aFrag.fragment();\n\n const power = this.effect(aFrag);\n switch (fragment.type) {\n case FragmentType.HackingChance:\n p.hacking_chance_mult *= power;\n break;\n case FragmentType.HackingSpeed:\n p.hacking_speed_mult *= power;\n break;\n case FragmentType.HackingMoney:\n p.hacking_money_mult *= power;\n break;\n case FragmentType.HackingGrow:\n p.hacking_grow_mult *= power;\n break;\n case FragmentType.Hacking:\n p.hacking_mult *= power;\n p.hacking_exp_mult *= power;\n break;\n case FragmentType.Strength:\n p.strength_mult *= power;\n p.strength_exp_mult *= power;\n break;\n case FragmentType.Defense:\n p.defense_mult *= power;\n p.defense_exp_mult *= power;\n break;\n case FragmentType.Dexterity:\n p.dexterity_mult *= power;\n p.dexterity_exp_mult *= power;\n break;\n case FragmentType.Agility:\n p.agility_mult *= power;\n p.agility_exp_mult *= power;\n break;\n case FragmentType.Charisma:\n p.charisma_mult *= power;\n p.charisma_exp_mult *= power;\n break;\n case FragmentType.HacknetMoney:\n p.hacknet_node_money_mult *= power;\n break;\n case FragmentType.HacknetCost:\n p.hacknet_node_purchase_cost_mult /= power;\n p.hacknet_node_ram_cost_mult /= power;\n p.hacknet_node_core_cost_mult /= power;\n p.hacknet_node_level_cost_mult /= power;\n break;\n case FragmentType.Rep:\n p.company_rep_mult *= power;\n p.faction_rep_mult *= power;\n break;\n case FragmentType.WorkMoney:\n p.work_money_mult *= power;\n break;\n case FragmentType.Crime:\n p.crime_success_mult *= power;\n p.crime_money_mult *= power;\n break;\n case FragmentType.Bladeburner:\n p.bladeburner_max_stamina_mult *= power;\n p.bladeburner_stamina_gain_mult *= power;\n p.bladeburner_analysis_mult *= power;\n p.bladeburner_success_chance_mult *= power;\n break;\n }\n }\n p.updateSkillLevels();\n }\n\n prestigeAugmentation(): void {\n this.clearCharge();\n }\n\n prestigeSourceFile(): void {\n this.clear();\n this.storedCycles = 0;\n }\n\n /**\n * Serialize Staneks Gift to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"StaneksGift\", this);\n }\n\n /**\n * Initializes Staneks Gift from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): StaneksGift {\n return Generic_fromJSON(StaneksGift, value.data);\n }\n}\n\nReviver.constructors.StaneksGift = StaneksGift;\n","import { Fragment, FragmentById } from \"./Fragment\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IActiveFragmentParams {\n x: number;\n y: number;\n rotation: number;\n fragment: Fragment;\n}\n\nexport class ActiveFragment {\n id: number;\n avgCharge: number;\n numCharge: number;\n rotation: number;\n x: number;\n y: number;\n\n constructor(params?: IActiveFragmentParams) {\n if (params) {\n this.id = params.fragment.id;\n this.x = params.x;\n this.y = params.y;\n this.avgCharge = 0;\n this.numCharge = 0;\n this.rotation = params.rotation;\n } else {\n this.id = -1;\n this.x = -1;\n this.y = -1;\n this.avgCharge = -1;\n this.numCharge = -1;\n this.rotation = -1;\n }\n }\n\n collide(other: ActiveFragment): boolean {\n const thisFragment = this.fragment();\n const otherFragment = other.fragment();\n // These 2 variables converts 'this' local coordinates to world to other local.\n const dx: number = other.x - this.x;\n const dy: number = other.y - this.y;\n for (let j = 0; j < thisFragment.shape.length; j++) {\n for (let i = 0; i < thisFragment.shape[j].length; i++) {\n if (thisFragment.fullAt(i, j, this.rotation) && otherFragment.fullAt(i - dx, j - dy, other.rotation))\n return true;\n }\n }\n\n return false;\n }\n\n fragment(): Fragment {\n const fragment = FragmentById(this.id);\n if (fragment === null) throw new Error(\"ActiveFragment id refers to unknown Fragment.\");\n return fragment;\n }\n\n fullAt(worldX: number, worldY: number): boolean {\n return this.fragment().fullAt(worldX - this.x, worldY - this.y, this.rotation);\n }\n\n neighboors(): number[][] {\n return this.fragment()\n .neighboors(this.rotation)\n .map((cell) => [this.x + cell[0], this.y + cell[1]]);\n }\n\n copy(): ActiveFragment {\n // We have to do a round trip because the constructor.\n const fragment = FragmentById(this.id);\n if (fragment === null) throw new Error(\"ActiveFragment id refers to unknown Fragment.\");\n const c = new ActiveFragment({ x: this.x, y: this.y, rotation: this.rotation, fragment: fragment });\n c.avgCharge = this.avgCharge;\n c.numCharge = this.numCharge;\n return c;\n }\n\n /**\n * Serialize an active fragment to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"ActiveFragment\", this);\n }\n\n /**\n * Initializes an acive fragment from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): ActiveFragment {\n return Generic_fromJSON(ActiveFragment, value.data);\n }\n}\n\nReviver.constructors.ActiveFragment = ActiveFragment;\n","/**\n * Class representing a visitable location in the world\n */\nimport { CityName } from \"./data/CityNames\";\nimport { LocationName } from \"./data/LocationNames\";\nimport { LocationType } from \"./LocationTypeEnum\";\n\ninterface IInfiltrationMetadata {\n maxClearanceLevel: number;\n startingSecurityLevel: number;\n}\n\nexport interface IConstructorParams {\n city?: CityName | null;\n costMult?: number;\n expMult?: number;\n infiltrationData?: IInfiltrationMetadata;\n name?: LocationName;\n types?: LocationType[];\n techVendorMaxRam?: number;\n techVendorMinRam?: number;\n}\n\nexport class Location {\n /**\n * Name of city this location is in. If this property is null, it means this i\n * is a generic location that is available in all cities\n */\n city: CityName | null = null;\n\n /**\n * Cost multiplier that influences how expensive a gym/university is\n */\n costMult = 0;\n\n /**\n * Exp multiplier that influences how effective a gym/university is\n */\n expMult = 0;\n\n /**\n * Companies can be infiltrated. This contains the data required for that\n * infiltration event\n */\n infiltrationData?: IInfiltrationMetadata;\n\n /**\n * Identifier for location\n */\n name: LocationName = LocationName.Void;\n\n /**\n * List of what type(s) this location is. A location can be multiple types\n * (e.g. company and tech vendor)\n */\n types: LocationType[] = [];\n\n /**\n * Tech vendors allow you to purchase servers.\n * This property defines the max RAM server you can purchase from this vendor\n */\n techVendorMaxRam = 0;\n\n /**\n * Tech vendors allow you to purchase servers.\n * This property defines the max RAM server you can purchase from this vendor\n */\n techVendorMinRam = 0;\n\n constructor(p: IConstructorParams) {\n if (p.city) {\n this.city = p.city;\n }\n if (p.costMult) {\n this.costMult = p.costMult;\n }\n if (p.expMult) {\n this.expMult = p.expMult;\n }\n if (p.infiltrationData) {\n this.infiltrationData = p.infiltrationData;\n }\n if (p.name) {\n this.name = p.name;\n }\n if (p.types) {\n this.types = p.types;\n }\n if (p.techVendorMaxRam) {\n this.techVendorMaxRam = p.techVendorMaxRam;\n }\n if (p.techVendorMinRam) {\n this.techVendorMinRam = p.techVendorMinRam;\n }\n }\n}\n","/**\n * Creates a dropdown (select HTML element) with server hostnames as options\n *\n * Configurable to only contain certain types of servers\n */\nimport React from \"react\";\nimport { GetAllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Button from \"@mui/material/Button\";\n\n// TODO make this an enum when this gets converted to TypeScript\nexport const ServerType = {\n All: 0,\n Foreign: 1, // Hackable, non-owned servers\n Owned: 2, // Home Computer, Purchased Servers, and Hacknet Servers\n Purchased: 3, // Everything from Owned except home computer\n};\n\ninterface IProps {\n purchase: () => void;\n canPurchase: boolean;\n serverType: number;\n onChange: (event: SelectChangeEvent<string>) => void;\n value: string;\n}\n\nexport function ServerDropdown(props: IProps): React.ReactElement {\n /**\n * Checks if the server should be shown in the dropdown menu, based on the\n * 'serverType' property\n */\n function isValidServer(s: BaseServer): boolean {\n const purchased = s instanceof Server && s.purchasedByPlayer;\n const type = props.serverType;\n switch (type) {\n case ServerType.All:\n return true;\n case ServerType.Foreign:\n return s.hostname !== \"home\" && !purchased;\n case ServerType.Owned:\n return purchased || s instanceof HacknetServer || s.hostname === \"home\";\n case ServerType.Purchased:\n return purchased || s instanceof HacknetServer;\n default:\n console.warn(`Invalid ServerType specified for ServerDropdown component: ${type}`);\n return false;\n }\n }\n\n const servers = [];\n for (const server of GetAllServers().sort((a, b) => a.hostname.localeCompare(b.hostname))) {\n if (isValidServer(server)) {\n servers.push(\n <MenuItem key={server.hostname} value={server.hostname}>\n {server.hostname}\n </MenuItem>,\n );\n }\n }\n\n return (\n <Select\n startAdornment={\n <Button onClick={props.purchase} disabled={!props.canPurchase}>\n Buy\n </Button>\n }\n sx={{ mx: 1 }}\n value={props.value}\n onChange={props.onChange}\n >\n {servers}\n </Select>\n );\n}\n","import * as React from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Money } from \"../ui/React/Money\";\nimport { Game, reachedLimit } from \"./Game\";\nimport { Deck } from \"./CardDeck/Deck\";\nimport { Hand } from \"./CardDeck/Hand\";\nimport { InputAdornment } from \"@mui/material\";\nimport { ReactCard } from \"./CardDeck/ReactCard\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\n\nconst MAX_BET = 100e6;\nexport const DECK_COUNT = 5; // 5-deck multideck\n\nenum Result {\n Pending = \"\",\n PlayerWon = \"You won!\",\n PlayerWonByBlackjack = \"You Won! Blackjack!\",\n DealerWon = \"You lost!\",\n Tie = \"Push! (Tie)\",\n}\n\ntype Props = {\n p: IPlayer;\n};\n\ntype State = {\n playerHand: Hand;\n dealerHand: Hand;\n bet: number;\n betInput: string;\n gameInProgress: boolean;\n result: Result;\n gains: number; // Track gains only for this session\n wagerInvalid: boolean;\n wagerInvalidHelperText: string;\n};\n\nexport class Blackjack extends Game<Props, State> {\n deck: Deck;\n\n constructor(props: Props) {\n super(props);\n\n this.deck = new Deck(DECK_COUNT);\n\n const initialBet = 1e6;\n\n this.state = {\n playerHand: new Hand([]),\n dealerHand: new Hand([]),\n bet: initialBet,\n betInput: String(initialBet),\n gameInProgress: false,\n result: Result.Pending,\n gains: 0,\n wagerInvalid: false,\n wagerInvalidHelperText: \"\",\n };\n }\n\n canStartGame = (): boolean => {\n const { p } = this.props;\n const { bet } = this.state;\n\n return p.canAfford(bet);\n };\n\n startGame = (): void => {\n if (!this.canStartGame() || reachedLimit(this.props.p)) {\n return;\n }\n\n // Take money from player right away so that player's dont just \"leave\" to avoid the loss (I mean they could\n // always reload without saving but w.e) TODO: Save/Restore the RNG state to limit the value of save-scumming.\n this.props.p.loseMoney(this.state.bet, \"casino\");\n\n const playerHand = new Hand([this.deck.safeDrawCard(), this.deck.safeDrawCard()]);\n const dealerHand = new Hand([this.deck.safeDrawCard(), this.deck.safeDrawCard()]);\n\n this.setState({\n playerHand,\n dealerHand,\n gameInProgress: true,\n result: Result.Pending,\n });\n\n // If the player is dealt a blackjack and the dealer is not, then the player\n // immediately wins\n if (this.getTrueHandValue(playerHand) === 21) {\n if (this.getTrueHandValue(dealerHand) === 21) {\n this.finishGame(Result.Tie);\n } else {\n this.finishGame(Result.PlayerWonByBlackjack);\n }\n } else if (this.getTrueHandValue(dealerHand) === 21) {\n // Check if dealer won by blackjack. We know at this point that the player does not also have blackjack.\n this.finishGame(Result.DealerWon);\n }\n };\n\n // Returns an array of numbers representing all possible values of the given Hand. The reason it needs to be\n // an array is because an Ace can count as both 1 and 11.\n getHandValue = (hand: Hand): number[] => {\n let result: number[] = [0];\n\n for (let i = 0; i < hand.cards.length; ++i) {\n const value = hand.cards[i].value;\n if (value >= 10) {\n result = result.map((x) => x + 10);\n } else if (value === 1) {\n result = result.flatMap((x) => [x + 1, x + 11]);\n } else {\n result = result.map((x) => x + value);\n }\n }\n\n return result;\n };\n\n // Returns the single hand value used for determine things like victory and whether or not\n // the dealer has to hit. Essentially this uses the biggest value that's 21 or under. If no such value exists,\n // then it means the hand is busted and we can just return whatever\n getTrueHandValue = (hand: Hand): number => {\n const handValues = this.getHandValue(hand);\n const valuesUnder21 = handValues.filter((x) => x <= 21);\n\n if (valuesUnder21.length > 0) {\n valuesUnder21.sort((a, b) => a - b);\n return valuesUnder21[valuesUnder21.length - 1];\n } else {\n // Just return the first value. It doesnt really matter anyways since hand is buted\n return handValues[0];\n }\n };\n\n // Returns all hand values that are 21 or under. If no values are 21 or under, then the first value is returned.\n getHandDisplayValues = (hand: Hand): number[] => {\n const handValues = this.getHandValue(hand);\n if (this.isHandBusted(hand)) {\n // Hand is busted so just return the 1st value, doesn't really matter\n return [...new Set([handValues[0]])];\n } else {\n return [...new Set(handValues.filter((x) => x <= 21))];\n }\n };\n\n isHandBusted = (hand: Hand): boolean => {\n return this.getTrueHandValue(hand) > 21;\n };\n\n playerHit = (event: React.MouseEvent): void => {\n if (!event.isTrusted) {\n return;\n }\n\n const newHand = this.state.playerHand.addCards(this.deck.safeDrawCard());\n\n this.setState({\n playerHand: newHand,\n });\n\n // Check if player busted, and finish the game if so\n if (this.isHandBusted(newHand)) {\n this.finishGame(Result.DealerWon);\n }\n };\n\n playerStay = (event: React.MouseEvent): void => {\n if (!event.isTrusted) {\n return;\n }\n\n // Determine if Dealer needs to hit. A dealer must hit if they have 16 or lower.\n // If the dealer has a Soft 17 (Ace + 6), then they stay.\n let newDealerHand = this.state.dealerHand;\n while (true) {\n // The dealer's \"true\" hand value is the 2nd one if its 21 or less (the 2nd value is always guaranteed\n // to be equal or larger). Otherwise its the 1st.\n const dealerHandValue = this.getTrueHandValue(newDealerHand);\n\n if (dealerHandValue <= 16) {\n newDealerHand = newDealerHand.addCards(this.deck.safeDrawCard());\n } else {\n break;\n }\n }\n\n this.setState({\n dealerHand: newDealerHand,\n });\n\n // If dealer has busted, then player wins\n if (this.isHandBusted(newDealerHand)) {\n this.finishGame(Result.PlayerWon);\n } else {\n const dealerHandValue = this.getTrueHandValue(newDealerHand);\n const playerHandValue = this.getTrueHandValue(this.state.playerHand);\n\n // We expect nobody to have busted. If someone busted, there is an error\n // in our game logic\n if (dealerHandValue > 21 || playerHandValue > 21) {\n throw new Error(\"Someone busted when not expected to\");\n }\n\n if (playerHandValue > dealerHandValue) {\n this.finishGame(Result.PlayerWon);\n } else if (playerHandValue < dealerHandValue) {\n this.finishGame(Result.DealerWon);\n } else {\n this.finishGame(Result.Tie);\n }\n }\n };\n\n finishGame = (result: Result): void => {\n const gains =\n result === Result.DealerWon\n ? 0 // We took away the bet at the start, don't need to take more\n : result === Result.Tie\n ? this.state.bet // We took away the bet at the start, give it back\n : result === Result.PlayerWon\n ? 2 * this.state.bet // Give back their bet plus their winnings\n : result === Result.PlayerWonByBlackjack\n ? 2.5 * this.state.bet // Blackjack pays out 1.5x bet!\n : (() => {\n throw new Error(`Unexpected result: ${result}`);\n })(); // This can't happen, right?\n this.win(this.props.p, gains);\n this.setState({\n gameInProgress: false,\n result,\n gains: this.state.gains + gains - this.state.bet, // Not updated upfront - only tracks the final outcome\n });\n };\n\n wagerOnChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n const { p } = this.props;\n const betInput = event.target.value;\n const wager = Math.round(parseFloat(betInput));\n if (isNaN(wager)) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Not a valid number\",\n });\n } else if (wager <= 0) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Must bet a postive amount\",\n });\n } else if (wager > MAX_BET) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Exceeds max bet\",\n });\n } else if (!p.canAfford(wager)) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Not enough money\",\n });\n } else {\n // Valid wager\n this.setState({\n bet: wager,\n betInput,\n wagerInvalid: false,\n wagerInvalidHelperText: \"\",\n result: Result.Pending, // Reset previous game status to clear the win/lose text UI\n });\n }\n };\n\n // Start game button\n startOnClick = (event: React.MouseEvent): void => {\n // Protect against scripting...although maybe this would be fun to automate\n if (!event.isTrusted) {\n return;\n }\n\n if (!this.state.wagerInvalid) {\n this.startGame();\n }\n };\n\n render(): React.ReactNode {\n const { betInput, playerHand, dealerHand, gameInProgress, result, wagerInvalid, wagerInvalidHelperText, gains } =\n this.state;\n\n // Get the player totals to display.\n const playerHandValues = this.getHandDisplayValues(playerHand);\n const dealerHandValues = this.getHandDisplayValues(dealerHand);\n\n return (\n <>\n {/* Wager input */}\n <Box>\n <TextField\n value={betInput}\n label={\n <>\n {\"Wager (Max: \"}\n <Money money={MAX_BET} />\n {\")\"}\n </>\n }\n disabled={gameInProgress}\n onChange={this.wagerOnChange}\n error={wagerInvalid}\n helperText={wagerInvalid ? wagerInvalidHelperText : \"\"}\n type=\"number\"\n style={{\n width: \"200px\",\n }}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Typography>$</Typography>\n </InputAdornment>\n ),\n }}\n />\n\n <Typography>\n {\"Total earnings this session: \"}\n <Money money={gains} />\n </Typography>\n </Box>\n\n {/* Buttons */}\n {!gameInProgress ? (\n <Button onClick={this.startOnClick} disabled={wagerInvalid || !this.canStartGame()}>\n Start\n </Button>\n ) : (\n <>\n <Button onClick={this.playerHit}>Hit</Button>\n <Button color=\"secondary\" onClick={this.playerStay}>\n Stay\n </Button>\n </>\n )}\n\n {/* Main game part. Displays both if the game is in progress OR if there's a result so you can see\n * the cards that led to that result. */}\n {(gameInProgress || result !== Result.Pending) && (\n <>\n <Box display=\"flex\">\n <Paper elevation={2}>\n <Typography>Player</Typography>\n {playerHand.cards.map((card, i) => (\n <ReactCard card={card} key={i} />\n ))}\n\n <Typography>\n Count:{\" \"}\n {playerHandValues\n .map<React.ReactNode>((value, i) => <span key={i}>{value}</span>)\n .reduce((prev, curr) => [prev, \" or \", curr])}\n </Typography>\n </Paper>\n </Box>\n\n <br />\n\n <Box display=\"flex\">\n <Paper elevation={2}>\n <Typography>Dealer</Typography>\n {dealerHand.cards.map((card, i) => (\n // Hide every card except the first while game is in progress\n <ReactCard card={card} hidden={gameInProgress && i !== 0} key={i} />\n ))}\n\n {!gameInProgress && (\n <>\n <Typography>\n Count:{\" \"}\n {dealerHandValues\n .map<React.ReactNode>((value, i) => <span key={i}>{value}</span>)\n .reduce((prev, curr) => [prev, \" or \", curr])}\n </Typography>\n </>\n )}\n </Paper>\n </Box>\n </>\n )}\n\n {/* Results from previous round */}\n {result !== Result.Pending && (\n <Typography>\n {result} \n {result === Result.PlayerWon && <Money money={this.state.bet} />}\n {result === Result.PlayerWonByBlackjack && <Money money={this.state.bet * 1.5} />}\n {result === Result.DealerWon && <Money money={-this.state.bet} />}\n </Typography>\n )}\n </>\n );\n }\n}\n","import React, { FC } from \"react\";\nimport { Card, Suit } from \"./Card\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Paper from \"@mui/material/Paper\";\n\ntype Props = {\n card: Card;\n hidden?: boolean;\n};\n\nconst useStyles = makeStyles(() =>\n createStyles({\n card: {\n padding: \"10px\",\n border: \"solid 1px #808080\",\n backgroundColor: \"white\",\n display: \"inline-block\",\n borderRadius: \"10px\",\n fontSize: \"18.5px\",\n textAlign: \"center\",\n margin: \"3px\",\n fontWeight: \"bold\",\n },\n red: {\n color: \"red\",\n },\n\n black: {\n color: \"black\",\n },\n value: {\n fontSize: \"20px\",\n fontFamily: \"sans-serif\",\n },\n }),\n);\n\nexport const ReactCard: FC<Props> = ({ card, hidden }) => {\n const classes = useStyles();\n let suit: React.ReactNode;\n switch (card.suit) {\n case Suit.Clubs:\n suit = <span>♣</span>;\n break;\n case Suit.Diamonds:\n suit = <span>♦</span>;\n break;\n case Suit.Hearts:\n suit = <span>♥</span>;\n break;\n case Suit.Spades:\n suit = <span>♠</span>;\n break;\n default:\n throw new Error(`MissingCaseException: ${card.suit}`);\n }\n return (\n <Paper className={`${classes.card} ${card.isRedSuit() ? classes.red : classes.black}`}>\n <>\n <span className={classes.value}>{hidden ? \" - \" : card.formatValue()}</span>\n <span>{hidden ? \" - \" : suit}</span>\n </>\n </Paper>\n );\n};\n","import { Milestone } from \"./Milestone\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Factions } from \"../Faction/Factions\";\nimport { Faction } from \"../Faction/Faction\";\nimport { GetServer } from \"../Server/AllServers\";\n\nfunction allFactionAugs(p: IPlayer, f: Faction): boolean {\n const factionAugs = f.augmentations.slice().filter((aug) => aug !== \"NeuroFlux Governor\");\n for (const factionAug of factionAugs) {\n if (\n !p.augmentations.some((aug) => {\n return aug.name == factionAug;\n })\n )\n return false;\n }\n return true;\n}\n\nexport const Milestones: Milestone[] = [\n {\n title: \"Gain root access on CSEC\",\n fulfilled: (): boolean => {\n const server = GetServer(\"CSEC\");\n if (!server || !server.hasOwnProperty(\"hasAdminRights\")) return false;\n return (server as any).hasAdminRights;\n },\n },\n {\n title: \"Install the backdoor on CSEC\",\n fulfilled: (): boolean => {\n const server = GetServer(\"CSEC\");\n if (!server || !server.hasOwnProperty(\"backdoorInstalled\")) return false;\n return (server as any).backdoorInstalled;\n },\n },\n {\n title: \"Join the faction hinted at in csec-test.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(\"CyberSec\");\n },\n },\n {\n title: \"Install all the Augmentations from CyberSec\",\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[\"CyberSec\"]);\n },\n },\n {\n title: \"Join the faction hinted at in nitesec-test.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(\"NiteSec\");\n },\n },\n {\n title: \"Install all the Augmentations from NiteSec\",\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[\"NiteSec\"]);\n },\n },\n {\n title: \"Join the faction hinted at in j3.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(\"The Black Hand\");\n },\n },\n {\n title: \"Install all the Augmentations from The Black Hand\",\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[\"The Black Hand\"]);\n },\n },\n {\n title: \"Join the faction hinted at in 19dfj3l1nd.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(\"BitRunners\");\n },\n },\n {\n title: \"Install all the Augmentations from BitRunners\",\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[\"BitRunners\"]);\n },\n },\n {\n title: \"Complete fl1ght.exe\",\n fulfilled: (p: IPlayer): boolean => {\n // technically wrong but whatever\n return p.factions.includes(\"Daedalus\");\n },\n },\n {\n title: \"Install the special Augmentation from Daedalus\",\n fulfilled: (p: IPlayer): boolean => {\n return p.augmentations.some((aug) => aug.name == \"The Red Pill\");\n },\n },\n {\n title: \"Install the final backdoor and free yourself.\",\n fulfilled: (): boolean => {\n return false;\n },\n },\n];\n","import { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nexport function repFromDonation(amt: number, player: IPlayer): number {\n return (amt / CONSTANTS.DonateMoneyToRepDivisor) * player.faction_rep_mult;\n}\n","import { StockSymbols } from \"./StockSymbols\";\n\nexport const TickerHeaderFormatData = {\n longestName: 0,\n longestSymbol: 0,\n};\n\nfor (const key of Object.keys(StockSymbols)) {\n TickerHeaderFormatData.longestName = Math.max(key.length, TickerHeaderFormatData.longestName);\n TickerHeaderFormatData.longestSymbol = Math.max(StockSymbols[key].length, TickerHeaderFormatData.longestSymbol);\n}\n","import React from \"react\";\n\nimport { Box, Typography } from \"@mui/material\";\n\nimport { Achievement } from \"./Achievements\";\nimport { Settings } from \"../Settings/Settings\"\nimport { AchievementIcon } from \"./AchievementIcon\";\n\ninterface IProps {\n achievement: Achievement;\n unlockedOn?: number;\n cssFiltersUnlocked: string;\n cssFiltersLocked: string;\n}\n\nexport function AchievementEntry({ achievement, unlockedOn, cssFiltersUnlocked, cssFiltersLocked }: IProps): JSX.Element {\n if (!achievement) return <></>;\n const isUnlocked = !!unlockedOn;\n\n const mainColor = isUnlocked ? Settings.theme.primary : Settings.theme.secondarylight;\n\n let achievedOn = '';\n if (unlockedOn) {\n achievedOn = new Date(unlockedOn).toLocaleString();\n }\n\n return (\n <Box sx={{\n border: `1px solid ${Settings.theme.well}`, mb: 2\n }}>\n <Box sx={{\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n }}>\n <AchievementIcon\n achievement={achievement} unlocked={isUnlocked} size=\"72px\"\n colorFilters={isUnlocked ? cssFiltersUnlocked: cssFiltersLocked} />\n <Box sx={{\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n px: 1\n }}>\n <Typography variant=\"h6\" sx={{ color: mainColor}}>\n {achievement.Name}\n </Typography>\n <Typography variant=\"body2\" sx={{ maxWidth: '500px', color: mainColor}}>\n {achievement.Description}\n </Typography>\n {isUnlocked && (\n <Typography variant=\"caption\" sx={{ fontSize: '12px', color: Settings.theme.primarydark }}>\n Acquired on {achievedOn}\n </Typography>\n )}\n </Box>\n </Box>\n </Box>\n );\n}\n","// @ts-nocheck\n/* tslint:disable */\n/* eslint-disable */\n\n/*\n Taken from:\n https://codepen.io/sosuke/pen/Pjoqqp\n --------------------------------------------------------\n This utility transform an hex color into css filter rules.\n Useful to change color of a black image to match a given color\n*/\n\nclass Color {\n constructor(r, g, b) {\n this.set(r, g, b);\n }\n\n toString() {\n return `rgb(${Math.round(this.r)}, ${Math.round(this.g)}, ${Math.round(this.b)})`;\n }\n\n set(r, g, b) {\n this.r = this.clamp(r);\n this.g = this.clamp(g);\n this.b = this.clamp(b);\n }\n\n hueRotate(angle = 0) {\n angle = angle / 180 * Math.PI;\n const sin = Math.sin(angle);\n const cos = Math.cos(angle);\n\n this.multiply([\n 0.213 + cos * 0.787 - sin * 0.213,\n 0.715 - cos * 0.715 - sin * 0.715,\n 0.072 - cos * 0.072 + sin * 0.928,\n 0.213 - cos * 0.213 + sin * 0.143,\n 0.715 + cos * 0.285 + sin * 0.140,\n 0.072 - cos * 0.072 - sin * 0.283,\n 0.213 - cos * 0.213 - sin * 0.787,\n 0.715 - cos * 0.715 + sin * 0.715,\n 0.072 + cos * 0.928 + sin * 0.072,\n ]);\n }\n\n grayscale(value = 1) {\n this.multiply([\n 0.2126 + 0.7874 * (1 - value),\n 0.7152 - 0.7152 * (1 - value),\n 0.0722 - 0.0722 * (1 - value),\n 0.2126 - 0.2126 * (1 - value),\n 0.7152 + 0.2848 * (1 - value),\n 0.0722 - 0.0722 * (1 - value),\n 0.2126 - 0.2126 * (1 - value),\n 0.7152 - 0.7152 * (1 - value),\n 0.0722 + 0.9278 * (1 - value),\n ]);\n }\n\n sepia(value = 1) {\n this.multiply([\n 0.393 + 0.607 * (1 - value),\n 0.769 - 0.769 * (1 - value),\n 0.189 - 0.189 * (1 - value),\n 0.349 - 0.349 * (1 - value),\n 0.686 + 0.314 * (1 - value),\n 0.168 - 0.168 * (1 - value),\n 0.272 - 0.272 * (1 - value),\n 0.534 - 0.534 * (1 - value),\n 0.131 + 0.869 * (1 - value),\n ]);\n }\n\n saturate(value = 1) {\n this.multiply([\n 0.213 + 0.787 * value,\n 0.715 - 0.715 * value,\n 0.072 - 0.072 * value,\n 0.213 - 0.213 * value,\n 0.715 + 0.285 * value,\n 0.072 - 0.072 * value,\n 0.213 - 0.213 * value,\n 0.715 - 0.715 * value,\n 0.072 + 0.928 * value,\n ]);\n }\n\n multiply(matrix) {\n const newR = this.clamp(this.r * matrix[0] + this.g * matrix[1] + this.b * matrix[2]);\n const newG = this.clamp(this.r * matrix[3] + this.g * matrix[4] + this.b * matrix[5]);\n const newB = this.clamp(this.r * matrix[6] + this.g * matrix[7] + this.b * matrix[8]);\n this.r = newR;\n this.g = newG;\n this.b = newB;\n }\n\n brightness(value = 1) {\n this.linear(value);\n }\n contrast(value = 1) {\n this.linear(value, -(0.5 * value) + 0.5);\n }\n\n linear(slope = 1, intercept = 0) {\n this.r = this.clamp(this.r * slope + intercept * 255);\n this.g = this.clamp(this.g * slope + intercept * 255);\n this.b = this.clamp(this.b * slope + intercept * 255);\n }\n\n invert(value = 1) {\n this.r = this.clamp((value + this.r / 255 * (1 - 2 * value)) * 255);\n this.g = this.clamp((value + this.g / 255 * (1 - 2 * value)) * 255);\n this.b = this.clamp((value + this.b / 255 * (1 - 2 * value)) * 255);\n }\n\n hsl() {\n // Code taken from https://stackoverflow.com/a/9493060/2688027, licensed under CC BY-SA.\n const r = this.r / 255;\n const g = this.g / 255;\n const b = this.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h, s, l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0;\n } else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n\n case g:\n h = (b - r) / d + 2;\n break;\n\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n\n return {\n h: h * 100,\n s: s * 100,\n l: l * 100,\n };\n }\n\n clamp(value) {\n if (value > 255) {\n value = 255;\n } else if (value < 0) {\n value = 0;\n }\n return value;\n }\n}\n\nexport class Solver {\n constructor(target) {\n this.target = target;\n this.targetHSL = target.hsl();\n this.reusedColor = new Color(0, 0, 0);\n }\n\n solve() {\n const result = this.solveNarrow(this.solveWide());\n return {\n values: result.values,\n loss: result.loss,\n filter: this.css(result.values),\n };\n }\n\n solveWide() {\n const A = 5;\n const c = 15;\n const a = [60, 180, 18000, 600, 1.2, 1.2];\n\n let best = { loss: Infinity };\n for (let i = 0; best.loss > 25 && i < 3; i++) {\n const initial = [50, 20, 3750, 50, 100, 100];\n const result = this.spsa(A, a, c, initial, 1000);\n if (result.loss < best.loss) {\n best = result;\n }\n }\n return best;\n }\n\n solveNarrow(wide) {\n const A = wide.loss;\n const c = 2;\n const A1 = A + 1;\n const a = [0.25 * A1, 0.25 * A1, A1, 0.25 * A1, 0.2 * A1, 0.2 * A1];\n return this.spsa(A, a, c, wide.values, 500);\n }\n\n spsa(A, a, c, values, iters) {\n const alpha = 1;\n const gamma = 0.16666666666666666;\n\n let best = null;\n let bestLoss = Infinity;\n const deltas = new Array(6);\n const highArgs = new Array(6);\n const lowArgs = new Array(6);\n\n for (let k = 0; k < iters; k++) {\n const ck = c / Math.pow(k + 1, gamma);\n for (let i = 0; i < 6; i++) {\n deltas[i] = Math.random() > 0.5 ? 1 : -1;\n highArgs[i] = values[i] + ck * deltas[i];\n lowArgs[i] = values[i] - ck * deltas[i];\n }\n\n const lossDiff = this.loss(highArgs) - this.loss(lowArgs);\n for (let i = 0; i < 6; i++) {\n const g = lossDiff / (2 * ck) * deltas[i];\n const ak = a[i] / Math.pow(A + k + 1, alpha);\n values[i] = fix(values[i] - ak * g, i);\n }\n\n const loss = this.loss(values);\n if (loss < bestLoss) {\n best = values.slice(0);\n bestLoss = loss;\n }\n }\n return { values: best, loss: bestLoss };\n\n function fix(value, idx) {\n let max = 100;\n if (idx === 2 /* saturate */) {\n max = 7500;\n } else if (idx === 4 /* brightness */ || idx === 5 /* contrast */) {\n max = 200;\n }\n\n if (idx === 3 /* hue-rotate */) {\n if (value > max) {\n value %= max;\n } else if (value < 0) {\n value = max + value % max;\n }\n } else if (value < 0) {\n value = 0;\n } else if (value > max) {\n value = max;\n }\n return value;\n }\n }\n\n loss(filters) {\n // Argument is array of percentages.\n const color = this.reusedColor;\n color.set(0, 0, 0);\n\n color.invert(filters[0] / 100);\n color.sepia(filters[1] / 100);\n color.saturate(filters[2] / 100);\n color.hueRotate(filters[3] * 3.6);\n color.brightness(filters[4] / 100);\n color.contrast(filters[5] / 100);\n\n const colorHSL = color.hsl();\n return (\n Math.abs(color.r - this.target.r) +\n Math.abs(color.g - this.target.g) +\n Math.abs(color.b - this.target.b) +\n Math.abs(colorHSL.h - this.targetHSL.h) +\n Math.abs(colorHSL.s - this.targetHSL.s) +\n Math.abs(colorHSL.l - this.targetHSL.l)\n );\n }\n\n css(filters) {\n function fmt(idx, multiplier = 1) {\n return Math.round(filters[idx] * multiplier);\n }\n return `invert(${fmt(0)}%) sepia(${fmt(1)}%) saturate(${fmt(2)}%) hue-rotate(${fmt(3, 3.6)}deg) brightness(${fmt(4)}%) contrast(${fmt(5)}%)`\n }\n}\n\nfunction hexToRgb(hex): number[] {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, (m, r, g, b) => {\n return r + r + g + g + b + b;\n });\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result\n ? [\n parseInt(result[1], 16),\n parseInt(result[2], 16),\n parseInt(result[3], 16),\n ]\n : null;\n}\n\nexport function getFiltersFromHex(hex): string {\n const rgb = hexToRgb(hex);\n if (!rgb) return ''\n\n const [r, g, b] = rgb;\n const color = new Color(r, g, b);\n const solver = new Solver(color);\n return solver.solve().filter;\n}\n","import { CONSTANTS } from \"../../Constants\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport interface WorkEarnings {\n workMoneyLossRate: number;\n workHackExpGainRate: number;\n workStrExpGainRate: number;\n workDefExpGainRate: number;\n workDexExpGainRate: number;\n workAgiExpGainRate: number;\n workChaExpGainRate: number;\n}\n\nexport function calculateClassEarnings(player: IPlayer): WorkEarnings {\n const gameCPS = 1000 / CONSTANTS._idleSpeed;\n\n //Find cost and exp gain per game cycle\n let cost = 0;\n let hackExp = 0,\n strExp = 0,\n defExp = 0,\n dexExp = 0,\n agiExp = 0,\n chaExp = 0;\n const hashManager = player.hashManager;\n switch (player.className) {\n case CONSTANTS.ClassStudyComputerScience:\n hackExp =\n ((CONSTANTS.ClassStudyComputerScienceBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassDataStructures:\n cost = (CONSTANTS.ClassDataStructuresBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassDataStructuresBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassNetworks:\n cost = (CONSTANTS.ClassNetworksBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassNetworksBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassAlgorithms:\n cost = (CONSTANTS.ClassAlgorithmsBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassAlgorithmsBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassManagement:\n cost = (CONSTANTS.ClassManagementBaseCost * player.workCostMult) / gameCPS;\n chaExp = ((CONSTANTS.ClassManagementBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassLeadership:\n cost = (CONSTANTS.ClassLeadershipBaseCost * player.workCostMult) / gameCPS;\n chaExp = ((CONSTANTS.ClassLeadershipBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassGymStrength:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n strExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case CONSTANTS.ClassGymDefense:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n defExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case CONSTANTS.ClassGymDexterity:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n dexExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case CONSTANTS.ClassGymAgility:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n agiExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n default:\n throw new Error(\"ERR: Invalid/unrecognized class name\");\n }\n return {\n workMoneyLossRate: cost,\n workHackExpGainRate: hackExp * player.hacking_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workStrExpGainRate: strExp * player.strength_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workDefExpGainRate: defExp * player.defense_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workDexExpGainRate: dexExp * player.dexterity_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workAgiExpGainRate: agiExp * player.agility_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workChaExpGainRate: chaExp * player.charisma_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n };\n}\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: 'Default',\n description: 'Default game theme, most supported',\n credit: 'hydroflame',\n screenshot: img1,\n colors: {\n primarylight: \"#0f0\",\n primary: \"#0c0\",\n primarydark: \"#090\",\n successlight: \"#0f0\",\n success: \"#0c0\",\n successdark: \"#090\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Default-lite\",\n description: \"Less eye-straining default theme\",\n credit: \"NmuGmu\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/925263801564151888\",\n screenshot: img1,\n colors: {\n primarylight: \"#28CF28\",\n primary: \"#21A821\",\n primarydark: \"#177317\",\n successlight: \"#1CFF1C\",\n success: \"#16CA16\",\n successdark: \"#0D910D\",\n errorlight: \"#FF3B3B\",\n error: \"#C32D2D\",\n errordark: \"#8E2121\",\n secondarylight: \"#B3B3B3\",\n secondary: \"#838383\",\n secondarydark: \"#676767\",\n warninglight: \"#FFFF3A\",\n warning: \"#C3C32A\",\n warningdark: \"#8C8C1E\",\n infolight: \"#64CBFF\",\n info: \"#3399CC\",\n infodark: \"#246D91\",\n welllight: \"#404040\",\n well: \"#1C1C1C\",\n white: \"#C3C3C3\",\n black: \"#0A0B0B\",\n hp: \"#C62E2E\",\n money: \"#D6BB27\",\n hack: \"#ADFF2F\",\n combat: \"#E8EDCD\",\n cha: \"#8B5FAF\",\n int: \"#537CC8\",\n rep: \"#E8EDCD\",\n disabled: \"#5AB5A5\",\n backgroundprimary: \"#0C0D0E\",\n backgroundsecondary: \"#121415\",\n button: \"#252829\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Monokai'ish\",\n description: \"Monokai'ish\",\n credit: \"eltea\",\n screenshot: img1,\n colors: {\n primarylight: \"#FFF\",\n primary: \"#F8F8F2\",\n primarydark: \"#FAFAEB\",\n successlight: \"#ADE146\",\n success: \"#A6E22E\",\n successdark: \"#98E104\",\n errorlight: \"#FF69A0\",\n error: \"#F92672\",\n errordark: \"#D10F56\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E1D992\",\n warning: \"#E6DB74\",\n warningdark: \"#EDDD54\",\n infolight: \"#92E1F1\",\n info: \"#66D9EF\",\n infodark: \"#31CDED\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#F92672\",\n money: \"#E6DB74\",\n hack: \"#A6E22E\",\n combat: \"#75715E\",\n cha: \"#AE81FF\",\n int: \"#66D9EF\",\n rep: \"#E69F66\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#272822\",\n backgroundsecondary: \"#1B1C18\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Warmer\",\n credit: \"hexnaught\",\n description: \"Warmer, softer theme\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/921999581020028938\",\n screenshot: img1,\n colors: {\n primarylight: \"#EA9062\",\n primary: \"#DD7B4A\",\n primarydark: \"#D3591C\",\n successlight: \"#6ACF6A\",\n success: \"#43BF43\",\n successdark: \"#3E913E\",\n errorlight: \"#C15757\",\n error: \"#B34141\",\n errordark: \"#752525\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E6E69D\",\n warning: \"#DADA56\",\n warningdark: \"#A1A106\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#AD84CF\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#76C6B7\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dark+\",\n credit: \"LoganMD\",\n description: \"VSCode Dark+\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/921999975867617310\",\n screenshot: img1,\n colors: {\n primarylight: \"#E0E0BC\",\n primary: \"#CCCCAE\",\n primarydark: \"#B8B89C\",\n successlight: \"#00F000\",\n success: \"#00D200\",\n successdark: \"#00B400\",\n errorlight: \"#F00000\",\n error: \"#C80000\",\n errordark: \"#A00000\",\n secondarylight: \"#B4AEAE\",\n secondary: \"#969090\",\n secondarydark: \"#787272\",\n warninglight: \"#F0F000\",\n warning: \"#C8C800\",\n warningdark: \"#A0A000\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#1E1E1E\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#1E1E1E\",\n backgroundsecondary: \"#252525\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Mayukai Dark\",\n description: \"Mayukai Dark-esque\",\n credit: \"Festive Noire\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922037502334889994\",\n screenshot: img1,\n colors: {\n primarylight: \"#DDDFC5\",\n primary: \"#CDCFB6\",\n primarydark: \"#9D9F8C\",\n successlight: \"#00EF00\",\n success: \"#00A500\",\n successdark: \"#007A00\",\n errorlight: \"#F92672\",\n error: \"#CA1C5C\",\n errordark: \"#90274A\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#D3D300\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#00010A\",\n white: \"#fff\",\n black: \"#020509\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#8CCF27\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#080C11\",\n backgroundsecondary: \"#03080F\",\n button: \"#00010A\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Purple\",\n credit: \"zer0ney\",\n description: \"Essentially all defaults except for purple replacing the main colors\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922091815849570395\",\n screenshot: img1,\n colors: {\n primarylight: \"#BA55D3\",\n primary: \"#9370DB\",\n primarydark: \"#8A2BE2\",\n successlight: \"#BA55D3\",\n success: \"#9370DB\",\n successdark: \"#8A2BE2\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Smooth Green\",\n description: \"A nice green theme that doesn't hurt your eyes.\",\n credit: \"Swidt\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922243957986033725\",\n screenshot: img1,\n colors: {\n primarylight: \"#E0E0BC\",\n primary: \"#B0D9A3\",\n primarydark: \"#B8B89C\",\n successlight: \"#00F000\",\n success: \"#6BC16B\",\n successdark: \"#00B400\",\n errorlight: \"#F00000\",\n error: \"#3D713D\",\n errordark: \"#A00000\",\n secondarylight: \"#B4AEAE\",\n secondary: \"#8FAF85\",\n secondarydark: \"#787272\",\n warninglight: \"#F0F000\",\n warning: \"#38F100\",\n warningdark: \"#A0A000\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#2F3C2B\",\n white: \"#fff\",\n black: \"#1E1E1E\",\n hp: \"#dd3434\",\n money: \"#4AA52E\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#35A135\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#1E1E1E\",\n backgroundsecondary: \"#252525\",\n button: \"#2F3C2B\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dracula\",\n description: \"Dracula Look-alike\",\n credit: \"H3draut3r\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922296307836678144\",\n screenshot: img1,\n colors: {\n primarylight: \"#7082B8\",\n primary: \"#F8F8F2\",\n primarydark: \"#FF79C6\",\n successlight: \"#0f0\",\n success: \"#0c0\",\n successdark: \"#090\",\n errorlight: \"#FD4545\",\n error: \"#FF2D2D\",\n errordark: \"#C62424\",\n secondarylight: \"#AAA\",\n secondary: \"#8BE9FD\",\n secondarydark: \"#666\",\n warninglight: \"#FFC281\",\n warning: \"#FFB86C\",\n warningdark: \"#E6A055\",\n infolight: \"#A0A0FF\",\n info: \"#7070FF\",\n infodark: \"#4040FF\",\n welllight: \"#44475A\",\n well: \"#363948\",\n white: \"#fff\",\n black: \"#282A36\",\n hp: \"#D34448\",\n money: \"#50FA7B\",\n hack: \"#F1FA8C\",\n combat: \"#BD93F9\",\n cha: \"#FF79C6\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#282A36\",\n backgroundsecondary: \"#21222C\",\n button: \"#21222C\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dark Blue\",\n description: \"Very dark with a blue/purplelly primary\",\n credit: \"Saynt_Garmo\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/923084732718264340\",\n screenshot: img1,\n colors: {\n primarylight: \"#023DDE\",\n primary: \"#4A41C8\",\n primarydark: \"#005299\",\n successlight: \"#00FF00\",\n success: \"#D1DAD1\",\n successdark: \"#BFCABF\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#040505\",\n white: \"#fff\",\n black: \"#000000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#091419\",\n backgroundsecondary: \"#000000\",\n button: \"#000000\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Discord-like\",\n description: \"Discord inspired theme\",\n credit: \"Thermite\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924305252017143818\",\n screenshot: img1,\n colors: {\n primarylight: \"#7389DC\",\n primary: \"#7389DC\",\n primarydark: \"#5964F1\",\n successlight: \"#00CC00\",\n success: \"#20DF20\",\n successdark: \"#0CB80C\",\n errorlight: \"#EA5558\",\n error: \"#EC4145\",\n errordark: \"#E82528\",\n secondarylight: \"#C3C3C3\",\n secondary: \"#9C9C9C\",\n secondarydark: \"#4E4E4E\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#1C4FB3\",\n welllight: \"#999999\",\n well: \"#35383C\",\n white: \"#FFFFFF\",\n black: \"#202225\",\n hp: \"#FF5656\",\n money: \"#43FF43\",\n hack: \"#FFAB3D\",\n combat: \"#8A90FD\",\n cha: \"#FF51D9\",\n int: \"#6495ed\",\n rep: \"#FFFF30\",\n disabled: \"#474B51\",\n backgroundprimary: \"#2F3136\",\n backgroundsecondary: \"#35393E\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"One Dark\",\n description: \"Dark with a greenish tint\",\n credit: \"Dexalt142\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924650660694208512\",\n screenshot: img1,\n colors: {\n primarylight: \"#98C379\",\n primary: \"#98C379\",\n primarydark: \"#98C379\",\n successlight: \"#98C379\",\n success: \"#98C379\",\n successdark: \"#98C379\",\n errorlight: \"#E06C75\",\n error: \"#BE5046\",\n errordark: \"#BE5046\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E5C07B\",\n warning: \"#E5C07B\",\n warningdark: \"#D19A66\",\n infolight: \"#61AFEF\",\n info: \"#61AFEF\",\n infodark: \"#61AFEF\",\n welllight: \"#4B5263\",\n well: \"#282C34\",\n white: \"#ABB2BF\",\n black: \"#282C34\",\n hp: \"#E06C75\",\n money: \"#E5C07B\",\n hack: \"#98C379\",\n combat: \"#ABB2BF\",\n cha: \"#C678DD\",\n int: \"#61AFEF\",\n rep: \"#ABB2BF\",\n disabled: \"#56B6C2\",\n backgroundprimary: \"#282C34\",\n backgroundsecondary: \"#21252B\",\n button: \"#4B5263\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Muted Gold & Blue\",\n description: \"Muted gold with blue accents.\",\n credit: \"Sloth\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924672660758208563\",\n screenshot: img1,\n colors: {\n primarylight: \"#E3B54A\",\n primary: \"#CAA243\",\n primarydark: \"#7E6937\",\n successlight: \"#82FF82\",\n success: \"#6FDA6F\",\n successdark: \"#64C364\",\n errorlight: \"#FD5555\",\n error: \"#D84A4A\",\n errordark: \"#AC3939\",\n secondarylight: \"#D8D0B8\",\n secondary: \"#B1AA95\",\n secondarydark: \"#736E5E\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#111111\",\n white: \"#fff\",\n black: \"#070300\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#0A0A0E\",\n backgroundsecondary: \"#0E0E10\",\n button: \"#222222\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Light\",\n description: \"Cobbled Together Light Theme\",\n credit: \"matt\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/926114005456658432\",\n screenshot: img1,\n colors: {\n primarylight: \"#535353\",\n primary: \"#1A1A1A\",\n primarydark: \"#0d0d0d\",\n successlight: \"#63c439\",\n success: \"#428226\",\n successdark: \"#2E5A1B\",\n errorlight: \"#df7051\",\n error: \"#C94824\",\n errordark: \"#91341B\",\n secondarylight: \"#b3b3b3\",\n secondary: \"#9B9B9B\",\n secondarydark: \"#7A7979\",\n warninglight: \"#e8d464\",\n warning: \"#C6AD20\",\n warningdark: \"#9F8A16\",\n infolight: \"#6299cf\",\n info: \"#3778B7\",\n infodark: \"#30689C\",\n welllight: \"#f9f9f9\",\n well: \"#eaeaea\",\n white: \"#F7F7F7\",\n black: \"#F7F7F7\",\n hp: \"#BF5C41\",\n money: \"#E1B121\",\n hack: \"#47BC38\",\n combat: \"#656262\",\n cha: \"#A568AC\",\n int: \"#889BCF\",\n rep: \"#656262\",\n disabled: \"#70B4BF\",\n backgroundprimary: \"#F7F7F7\",\n backgroundsecondary: \"#f9f9f9\",\n button: \"#eaeaea\",\n },\n};\n","export default __webpack_public_path__ + \"images/83b2443ab7e7d346766c8f6bc5afc7a7.png\";","export default __webpack_public_path__ + \"images/6caf35202b10b52e1fc2743f674c33e8.png\";","export default __webpack_public_path__ + \"images/cb88977ea837bccb9cceb727adc78302.png\";","export default __webpack_public_path__ + \"images/4e0e750f2f09de58219773edd46cbbf5.png\";","export default __webpack_public_path__ + \"images/e97de4daa946331c7e99dee9c05d629c.png\";","export default __webpack_public_path__ + \"images/9f96a5084f4e5f1a6c0041b41b34d62d.png\";","export default __webpack_public_path__ + \"images/85a7b2896acb62be76f3ea7100fe9012.png\";","export default __webpack_public_path__ + \"images/5aa87b7de67a77c914088783b055e1cf.png\";","export default __webpack_public_path__ + \"images/c7164b072d62c91c27c6d607b5207e7b.png\";","export default __webpack_public_path__ + \"images/66f4b86d86164fc117bd6d648e4eaa6f.png\";","export default __webpack_public_path__ + \"images/a1110d6c8d16a14c4570411750248399.png\";","export default __webpack_public_path__ + \"images/447bc31e61f55e7eff875be3e9a81f1a.png\";","export default __webpack_public_path__ + \"images/297df8c0e47764ea113951318b2acf55.png\";","export default __webpack_public_path__ + \"images/e66b0c327f97d08e4253f52234d659eb.png\";","import { ITerminal, Output, Link, RawOutput, TTimer } from \"./ITerminal\";\nimport { IRouter } from \"../ui/Router\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { Server } from \"../Server/Server\";\nimport { Programs } from \"../Programs/Programs\";\nimport { CodingContractResult } from \"../CodingContracts\";\nimport { TerminalEvents, TerminalClearEvents } from \"./TerminalEvents\";\n\nimport { TextFile } from \"../TextFile\";\nimport { Script } from \"../Script/Script\";\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\nimport { CONSTANTS } from \"../Constants\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\n\nimport { removeLeadingSlash, isInRootDirectory, evaluateFilePath } from \"./DirectoryHelpers\";\nimport { checkIfConnectedToDarkweb } from \"../DarkWeb/DarkWeb\";\nimport { iTutorialNextStep, iTutorialSteps, ITutorial } from \"../InteractiveTutorial\";\nimport { getServerOnNetwork, processSingleServerGrowth } from \"../Server/ServerHelpers\";\nimport { ParseCommand, ParseCommands } from \"./Parser\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Settings } from \"../Settings/Settings\";\nimport { createProgressBarText } from \"../utils/helpers/createProgressBarText\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"../Hacking\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\n\nimport { alias } from \"./commands/alias\";\nimport { analyze } from \"./commands/analyze\";\nimport { backdoor } from \"./commands/backdoor\";\nimport { buy } from \"./commands/buy\";\nimport { cat } from \"./commands/cat\";\nimport { cd } from \"./commands/cd\";\nimport { check } from \"./commands/check\";\nimport { connect } from \"./commands/connect\";\nimport { cp } from \"./commands/cp\";\nimport { download } from \"./commands/download\";\nimport { expr } from \"./commands/expr\";\nimport { free } from \"./commands/free\";\nimport { grow } from \"./commands/grow\";\nimport { hack } from \"./commands/hack\";\nimport { help } from \"./commands/help\";\nimport { history } from \"./commands/history\";\nimport { home } from \"./commands/home\";\nimport { hostname } from \"./commands/hostname\";\nimport { kill } from \"./commands/kill\";\nimport { killall } from \"./commands/killall\";\nimport { ls } from \"./commands/ls\";\nimport { lscpu } from \"./commands/lscpu\";\nimport { mem } from \"./commands/mem\";\nimport { mv } from \"./commands/mv\";\nimport { nano } from \"./commands/nano\";\nimport { ps } from \"./commands/ps\";\nimport { rm } from \"./commands/rm\";\nimport { run } from \"./commands/run\";\nimport { scan } from \"./commands/scan\";\nimport { scananalyze } from \"./commands/scananalyze\";\nimport { scp } from \"./commands/scp\";\nimport { sudov } from \"./commands/sudov\";\nimport { tail } from \"./commands/tail\";\nimport { top } from \"./commands/top\";\nimport { unalias } from \"./commands/unalias\";\nimport { vim } from \"./commands/vim\";\nimport { weaken } from \"./commands/weaken\";\nimport { wget } from \"./commands/wget\";\nimport { hash } from \"../hash/hash\";\n\nexport class Terminal implements ITerminal {\n // Flags to determine whether the player is currently running a hack or an analyze\n action: TTimer | null = null;\n\n commandHistory: string[] = [];\n commandHistoryIndex = 0;\n\n outputHistory: (Output | Link | RawOutput)[] = [\n new Output(`Bitburner v${CONSTANTS.VersionString} (${hash()})`, \"primary\"),\n ];\n\n // True if a Coding Contract prompt is opened\n contractOpen = false;\n\n // Full Path of current directory\n // Excludes the trailing forward slash\n currDir = \"/\";\n\n process(router: IRouter, player: IPlayer, cycles: number): void {\n if (this.action === null) return;\n this.action.timeLeft -= (CONSTANTS._idleSpeed * cycles) / 1000;\n if (this.action.timeLeft < 0.01) this.finishAction(router, player, false);\n TerminalEvents.emit();\n }\n\n append(item: Output | Link | RawOutput): void {\n this.outputHistory.push(item);\n if (this.outputHistory.length > Settings.MaxTerminalCapacity) {\n this.outputHistory.splice(0, this.outputHistory.length - Settings.MaxTerminalCapacity);\n }\n TerminalEvents.emit();\n }\n\n print(s: string): void {\n this.append(new Output(s, \"primary\"));\n }\n\n printRaw(node: React.ReactNode): void {\n this.append(new RawOutput(node));\n }\n\n error(s: string): void {\n this.append(new Output(s, \"error\"));\n }\n\n success(s: string): void {\n this.append(new Output(s, \"success\"));\n }\n\n info(s: string): void {\n this.append(new Output(s, \"info\"));\n }\n\n warn(s: string): void {\n this.append(new Output(s, \"warn\"));\n }\n\n startHack(player: IPlayer): void {\n // Hacking through Terminal should be faster than hacking through a script\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateHackingTime(server, player) / 4, \"h\", server);\n }\n\n startGrow(player: IPlayer): void {\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot grow this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateGrowTime(server, player) / 16, \"g\", server);\n }\n startWeaken(player: IPlayer): void {\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot weaken this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateWeakenTime(server, player) / 16, \"w\", server);\n }\n\n startBackdoor(player: IPlayer): void {\n // Backdoor should take the same amount of time as hack\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot backdoor this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateHackingTime(server, player) / 4, \"b\", server);\n }\n\n startAnalyze(player: IPlayer): void {\n this.print(\"Analyzing system...\");\n const server = player.getCurrentServer();\n this.startAction(1, \"a\", server);\n }\n\n startAction(n: number, action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\", server?: BaseServer): void {\n this.action = new TTimer(n, action, server);\n }\n\n // Complete the hack/analyze command\n finishHack(router: IRouter, player: IPlayer, server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n\n // Calculate whether hack was successful\n const hackChance = calculateHackingChance(server, player);\n const rand = Math.random();\n const expGainedOnSuccess = calculateHackingExpGain(server, player);\n const expGainedOnFailure = expGainedOnSuccess / 4;\n if (rand < hackChance) {\n // Success!\n server.backdoorInstalled = true;\n if (SpecialServers.WorldDaemon === server.hostname) {\n router.toBitVerse(false, false);\n return;\n }\n let moneyGained = calculatePercentMoneyHacked(server, player);\n moneyGained = Math.floor(server.moneyAvailable * moneyGained);\n\n if (moneyGained <= 0) {\n moneyGained = 0;\n } // Safety check\n\n server.moneyAvailable -= moneyGained;\n player.gainMoney(moneyGained, \"hacking\");\n player.gainHackingExp(expGainedOnSuccess);\n player.gainIntelligenceExp(expGainedOnSuccess / CONSTANTS.IntelligenceTerminalHackBaseExpGain);\n\n const oldSec = server.hackDifficulty;\n server.fortify(CONSTANTS.ServerFortifyAmount);\n const newSec = server.hackDifficulty;\n\n this.print(\n `Hack successful on '${server.hostname}'! Gained ${numeralWrapper.formatMoney(\n moneyGained,\n )} and ${numeralWrapper.formatExp(expGainedOnSuccess)} hacking exp`,\n );\n this.print(\n `Security increased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)}`,\n );\n } else {\n // Failure\n player.gainHackingExp(expGainedOnFailure);\n this.print(\n `Failed to hack '${server.hostname}'. Gained ${numeralWrapper.formatExp(expGainedOnFailure)} hacking exp`,\n );\n }\n }\n\n finishGrow(player: IPlayer, server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot grow this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n const expGain = calculateHackingExpGain(server, player);\n const oldSec = server.hackDifficulty;\n const growth = processSingleServerGrowth(server, 25, player, server.cpuCores) - 1;\n const newSec = server.hackDifficulty;\n\n player.gainHackingExp(expGain);\n this.print(\n `Available money on '${server.hostname}' grown by ${numeralWrapper.formatPercentage(\n growth,\n 6,\n )}. Gained ${numeralWrapper.formatExp(expGain)} hacking exp.`,\n );\n this.print(\n `Security increased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)}`,\n );\n }\n\n finishWeaken(player: IPlayer, server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot weaken this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n const expGain = calculateHackingExpGain(server, player);\n const oldSec = server.hackDifficulty;\n server.weaken(CONSTANTS.ServerWeakenAmount);\n const newSec = server.hackDifficulty;\n\n player.gainHackingExp(expGain);\n this.print(\n `Security decreased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)} (min: ${numeralWrapper.formatSecurity(server.minDifficulty)})` +\n ` and Gained ${numeralWrapper.formatExp(expGain)} hacking exp.`,\n );\n }\n\n finishBackdoor(router: IRouter, player: IPlayer, server: BaseServer, cancelled = false): void {\n if (!cancelled) {\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n server.backdoorInstalled = true;\n if (SpecialServers.WorldDaemon === server.hostname) {\n if (player.bitNodeN == null) {\n player.bitNodeN = 1;\n }\n router.toBitVerse(false, false);\n return;\n }\n this.print(`Backdoor on '${server.hostname}' successful!`);\n }\n }\n\n finishAnalyze(player: IPlayer, currServ: BaseServer, cancelled = false): void {\n if (!cancelled) {\n const isHacknet = currServ instanceof HacknetServer;\n this.print(currServ.hostname + \": \");\n const org = currServ.organizationName;\n this.print(\"Organization name: \" + (!isHacknet ? org : \"player\"));\n const hasAdminRights = (!isHacknet && currServ.hasAdminRights) || isHacknet;\n this.print(\"Root Access: \" + (hasAdminRights ? \"YES\" : \"NO\"));\n this.print(\"Can run scripts on this host: \" + (hasAdminRights ? \"YES\" : \"NO\"));\n if (currServ instanceof Server) {\n this.print(\"Backdoor: \" + (currServ.backdoorInstalled ? \"YES\" : \"NO\"));\n const hackingSkill = currServ.requiredHackingSkill;\n this.print(\"Required hacking skill for hack() and backdoor: \" + (!isHacknet ? hackingSkill : \"N/A\"));\n const security = currServ.hackDifficulty;\n this.print(\"Server security level: \" + (!isHacknet ? numeralWrapper.formatServerSecurity(security) : \"N/A\"));\n const hackingChance = calculateHackingChance(currServ, player);\n this.print(\"Chance to hack: \" + (!isHacknet ? numeralWrapper.formatPercentage(hackingChance) : \"N/A\"));\n const hackingTime = calculateHackingTime(currServ, player) * 1000;\n this.print(\"Time to hack: \" + (!isHacknet ? convertTimeMsToTimeElapsedString(hackingTime, true) : \"N/A\"));\n }\n this.print(\n `Total money available on server: ${\n currServ instanceof Server ? numeralWrapper.formatMoney(currServ.moneyAvailable) : \"N/A\"\n }`,\n );\n if (currServ instanceof Server) {\n const numPort = currServ.numOpenPortsRequired;\n this.print(\"Required number of open ports for NUKE: \" + (!isHacknet ? numPort : \"N/A\"));\n this.print(\"SSH port: \" + (currServ.sshPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"FTP port: \" + (currServ.ftpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"SMTP port: \" + (currServ.smtpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"HTTP port: \" + (currServ.httpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"SQL port: \" + (currServ.sqlPortOpen ? \"Open\" : \"Closed\"));\n }\n }\n }\n\n finishAction(router: IRouter, player: IPlayer, cancelled = false): void {\n if (this.action === null) {\n if (!cancelled) throw new Error(\"Finish action called when there was no action\");\n return;\n }\n\n if (!this.action.server) throw new Error(\"Missing action target server\");\n\n this.print(this.getProgressText());\n if (this.action.action === \"h\") {\n this.finishHack(router, player, this.action.server, cancelled);\n } else if (this.action.action === \"g\") {\n this.finishGrow(player, this.action.server, cancelled);\n } else if (this.action.action === \"w\") {\n this.finishWeaken(player, this.action.server, cancelled);\n } else if (this.action.action === \"b\") {\n this.finishBackdoor(router, player, this.action.server, cancelled);\n } else if (this.action.action === \"a\") {\n this.finishAnalyze(player, this.action.server, cancelled);\n }\n\n if (cancelled) {\n this.print(\"Cancelled\");\n }\n this.action = null;\n TerminalEvents.emit();\n }\n\n getFile(player: IPlayer, filename: string): Script | TextFile | string | null {\n if (isScriptFilename(filename)) {\n return this.getScript(player, filename);\n }\n\n if (filename.endsWith(\".lit\")) {\n return this.getLitFile(player, filename);\n }\n\n if (filename.endsWith(\".txt\")) {\n return this.getTextFile(player, filename);\n }\n\n return null;\n }\n\n getFilepath(filename: string): string {\n const path = evaluateFilePath(filename, this.cwd());\n if (path == null) {\n throw new Error(`Invalid file path specified: ${filename}`);\n }\n\n if (isInRootDirectory(path)) {\n return removeLeadingSlash(path);\n }\n\n return path;\n }\n\n getScript(player: IPlayer, filename: string): Script | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const script of s.scripts) {\n if (filepath === script.filename) {\n return script;\n }\n }\n\n return null;\n }\n\n getTextFile(player: IPlayer, filename: string): TextFile | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const txt of s.textFiles) {\n if (filepath === txt.fn) {\n return txt;\n }\n }\n\n return null;\n }\n\n getLitFile(player: IPlayer, filename: string): string | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const lit of s.messages) {\n if (typeof lit === \"string\" && filepath === lit) {\n return lit;\n }\n }\n\n return null;\n }\n\n cwd(): string {\n return this.currDir;\n }\n\n setcwd(dir: string): void {\n this.currDir = dir;\n TerminalEvents.emit();\n }\n\n async runContract(player: IPlayer, contractName: string): Promise<void> {\n // There's already an opened contract\n if (this.contractOpen) {\n return this.error(\"There's already a Coding Contract in Progress\");\n }\n\n const serv = player.getCurrentServer();\n const contract = serv.getContract(contractName);\n if (contract == null) {\n return this.error(\"No such contract\");\n }\n\n this.contractOpen = true;\n const res = await contract.prompt();\n\n switch (res) {\n case CodingContractResult.Success:\n if (contract.reward !== null) {\n const reward = player.gainCodingContractReward(contract.reward, contract.getDifficulty());\n this.print(`Contract SUCCESS - ${reward}`);\n }\n serv.removeContract(contract);\n break;\n case CodingContractResult.Failure:\n ++contract.tries;\n if (contract.tries >= contract.getMaxNumTries()) {\n this.error(\"Contract FAILED - Contract is now self-destructing\");\n serv.removeContract(contract);\n } else {\n this.error(`Contract FAILED - ${contract.getMaxNumTries() - contract.tries} tries remaining`);\n }\n break;\n case CodingContractResult.Cancelled:\n default:\n this.print(\"Contract cancelled\");\n break;\n }\n this.contractOpen = false;\n }\n\n executeScanAnalyzeCommand(player: IPlayer, depth = 1, all = false): void {\n // TODO Using array as stack for now, can make more efficient\n this.print(\"~~~~~~~~~~ Beginning scan-analyze ~~~~~~~~~~\");\n this.print(\" \");\n\n // Map of all servers to keep track of which have been visited\n const visited: {\n [key: string]: number | undefined;\n } = {};\n for (const server of GetAllServers()) {\n visited[server.hostname] = 0;\n }\n\n const stack: BaseServer[] = [];\n const depthQueue: number[] = [0];\n const currServ = player.getCurrentServer();\n stack.push(currServ);\n while (stack.length != 0) {\n const s = stack.pop();\n if (!s) continue;\n const d = depthQueue.pop();\n if (d === undefined) continue;\n const isHacknet = s instanceof HacknetServer;\n if (!all && (s as any).purchasedByPlayer && s.hostname != \"home\") {\n continue; // Purchased server\n } else if (visited[s.hostname] || d > depth) {\n continue; // Already visited or out-of-depth\n } else if (!all && isHacknet) {\n continue; // Hacknet Server\n } else {\n visited[s.hostname] = 1;\n }\n for (let i = s.serversOnNetwork.length - 1; i >= 0; --i) {\n const newS = getServerOnNetwork(s, i);\n if (newS === null) continue;\n stack.push(newS);\n depthQueue.push(d + 1);\n }\n if (d == 0) {\n continue;\n } // Don't print current server\n const titleDashes = Array((d - 1) * 4 + 1).join(\"-\");\n if (player.hasProgram(Programs.AutoLink.name)) {\n this.append(new Link(titleDashes, s.hostname));\n } else {\n this.print(titleDashes + s.hostname);\n }\n\n const dashes = titleDashes + \"--\";\n let c = \"NO\";\n if (s.hasAdminRights) {\n c = \"YES\";\n }\n this.print(\n `${dashes}Root Access: ${c}${!isHacknet ? \", Required hacking skill: \" + (s as any).requiredHackingSkill : \"\"}`,\n );\n\n if (s.hasOwnProperty(\"numOpenPortsRequired\")) {\n this.print(dashes + \"Number of open ports required to NUKE: \" + (s as any).numOpenPortsRequired);\n }\n this.print(dashes + \"RAM: \" + numeralWrapper.formatRAM(s.maxRam));\n this.print(\" \");\n }\n }\n\n connectToServer(player: IPlayer, server: string): void {\n const serv = GetServer(server);\n if (serv == null) {\n this.error(\"Invalid server. Connection failed.\");\n return;\n }\n player.getCurrentServer().isConnectedTo = false;\n player.currentServer = serv.hostname;\n player.getCurrentServer().isConnectedTo = true;\n this.print(\"Connected to \" + serv.hostname);\n this.setcwd(\"/\");\n if (player.getCurrentServer().hostname == \"darkweb\") {\n checkIfConnectedToDarkweb(); // Posts a 'help' message if connecting to dark web\n }\n }\n\n executeCommands(router: IRouter, player: IPlayer, commands: string): void {\n // Sanitize input\n commands = commands.trim();\n commands = commands.replace(/\\s\\s+/g, \" \"); // Replace all extra whitespace in command with a single space\n\n // Handle Terminal History - multiple commands should be saved as one\n if (this.commandHistory[this.commandHistory.length - 1] != commands) {\n this.commandHistory.push(commands);\n if (this.commandHistory.length > 50) {\n this.commandHistory.splice(0, 1);\n }\n player.terminalCommandHistory = this.commandHistory;\n }\n this.commandHistoryIndex = this.commandHistory.length;\n const allCommands = ParseCommands(commands);\n\n for (let i = 0; i < allCommands.length; i++) {\n this.executeCommand(router, player, allCommands[i]);\n }\n }\n\n clear(): void {\n this.outputHistory = [new Output(`Bitburner v${CONSTANTS.VersionString} (${hash()})`, \"primary\")];\n TerminalEvents.emit();\n TerminalClearEvents.emit();\n }\n\n prestige(): void {\n this.action = null;\n this.clear();\n }\n\n executeCommand(router: IRouter, player: IPlayer, command: string): void {\n if (this.action !== null) {\n this.error(`Cannot execute command (${command}) while an action is in progress`);\n return;\n }\n // Allow usage of ./\n if (command.startsWith(\"./\")) {\n command = \"run \" + command.slice(2);\n }\n // Only split the first space\n const commandArray = ParseCommand(command);\n if (commandArray.length == 0) {\n return;\n }\n const s = player.getCurrentServer();\n /****************** Interactive Tutorial Terminal Commands ******************/\n if (ITutorial.isRunning) {\n const n00dlesServ = GetServer(\"n00dles\");\n if (n00dlesServ == null) {\n throw new Error(\"Could not get n00dles server\");\n return;\n }\n switch (ITutorial.currStep) {\n case iTutorialSteps.TerminalHelp:\n if (commandArray.length === 1 && commandArray[0] == \"help\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalLs:\n if (commandArray.length === 1 && commandArray[0] == \"ls\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScan:\n if (commandArray.length === 1 && commandArray[0] == \"scan\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScanAnalyze1:\n if (commandArray.length == 1 && commandArray[0] == \"scan-analyze\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScanAnalyze2:\n if (commandArray.length == 2 && commandArray[0] == \"scan-analyze\" && commandArray[1] === 2) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalConnect:\n if (commandArray.length == 2) {\n if (\n commandArray[0] == \"connect\" &&\n (commandArray[1] == \"n00dles\" || commandArray[1] == n00dlesServ.hostname)\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Wrong command! Try again!\");\n return;\n }\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalAnalyze:\n if (commandArray.length === 1 && commandArray[0] === \"analyze\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalNuke:\n if (commandArray.length == 2 && commandArray[0] == \"run\" && commandArray[1] == \"NUKE.exe\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalManualHack:\n if (commandArray.length == 1 && commandArray[0] == \"hack\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalHackingMechanics:\n if (commandArray.length !== 1 || ![\"grow\", \"weaken\", \"hack\"].includes(commandArray[0] + \"\")) {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalGoHome:\n if (commandArray.length == 1 && commandArray[0] == \"home\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalCreateScript:\n if (commandArray.length == 2 && commandArray[0] == \"nano\" && commandArray[1] == \"n00dles.script\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalFree:\n if (commandArray.length == 1 && commandArray[0] == \"free\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalRunScript:\n if (commandArray.length == 2 && commandArray[0] == \"run\" && commandArray[1] == \"n00dles.script\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.ActiveScriptsToTerminal:\n if (commandArray.length == 2 && commandArray[0] == \"tail\" && commandArray[1] == \"n00dles.script\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n default:\n this.error(\"Please follow the tutorial, or click 'EXIT' if you'd like to skip it\");\n return;\n }\n }\n /****************** END INTERACTIVE TUTORIAL ******************/\n /* Command parser */\n const commandName = commandArray[0];\n if (typeof commandName === \"number\" || typeof commandName === \"boolean\") {\n this.error(`Command ${commandArray[0]} not found`);\n return;\n }\n\n const commands: {\n [key: string]: (\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n ) => void;\n } = {\n \"scan-analyze\": scananalyze,\n alias: alias,\n analyze: analyze,\n backdoor: backdoor,\n buy: buy,\n cat: cat,\n cd: cd,\n check: check,\n clear: () => this.clear(),\n cls: () => this.clear(),\n connect: connect,\n cp: cp,\n download: download,\n expr: expr,\n free: free,\n grow: grow,\n hack: hack,\n help: help,\n history: history,\n home: home,\n hostname: hostname,\n kill: kill,\n killall: killall,\n ls: ls,\n lscpu: lscpu,\n mem: mem,\n mv: mv,\n nano: nano,\n ps: ps,\n rm: rm,\n run: run,\n scan: scan,\n scp: scp,\n sudov: sudov,\n tail: tail,\n top: top,\n unalias: unalias,\n vim: vim,\n weaken: weaken,\n wget: wget,\n };\n\n const f = commands[commandName.toLowerCase()];\n if (!f) {\n this.error(`Command ${commandArray[0]} not found`);\n return;\n }\n\n f(this, router, player, s, commandArray.slice(1));\n }\n\n getProgressText(): string {\n if (this.action === null) throw new Error(\"trying to get the progress text when there's no action\");\n return createProgressBarText({\n progress: (this.action.time - this.action.timeLeft) / this.action.time,\n totalTicks: 50,\n });\n }\n}\n","import { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\n/* tslint:disable:completed-docs no-magic-numbers arrow-return-shorthand */\n\n/* Function that generates a valid 'data' for a contract type */\nexport type GeneratorFunc = () => any;\n\n/* Function that checks if the provided solution is the correct one */\nexport type SolverFunc = (data: any, answer: string) => boolean;\n\n/* Function that returns a string with the problem's description.\n Requires the 'data' of a Contract as input */\nexport type DescriptionFunc = (data: any) => string;\n\ninterface ICodingContractTypeMetadata {\n desc: DescriptionFunc;\n difficulty: number;\n gen: GeneratorFunc;\n name: string;\n numTries: number;\n solver: SolverFunc;\n}\n\n/* Helper functions for Coding Contract implementations */\nfunction removeBracketsFromArrayString(str: string): string {\n let strCpy: string = str;\n if (strCpy.startsWith(\"[\")) {\n strCpy = strCpy.slice(1);\n }\n if (strCpy.endsWith(\"]\")) {\n strCpy = strCpy.slice(0, -1);\n }\n\n return strCpy;\n}\n\nfunction removeQuotesFromString(str: string): string {\n let strCpy: string = str;\n if (strCpy.startsWith('\"') || strCpy.startsWith(\"'\")) {\n strCpy = strCpy.slice(1);\n }\n if (strCpy.endsWith('\"') || strCpy.endsWith(\"'\")) {\n strCpy = strCpy.slice(0, -1);\n }\n\n return strCpy;\n}\n\nfunction convert2DArrayToString(arr: any[][]): string {\n const components: string[] = [];\n arr.forEach((e: any) => {\n let s: string = e.toString();\n s = [\"[\", s, \"]\"].join(\"\");\n components.push(s);\n });\n\n return components.join(\",\").replace(/\\s/g, \"\");\n}\n\nexport const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [\n {\n desc: (n: number): string => {\n return [\"A prime factor is a factor that is a prime number.\", `What is the largest prime factor of ${n}?`].join(\n \" \",\n );\n },\n difficulty: 1,\n gen: (): number => {\n return getRandomInt(500, 1e9);\n },\n name: \"Find Largest Prime Factor\",\n numTries: 10,\n solver: (data: number, ans: string): boolean => {\n let fac = 2;\n let n: number = data;\n while (n > (fac - 1) * (fac - 1)) {\n while (n % fac === 0) {\n n = Math.round(n / fac);\n }\n ++fac;\n }\n\n return (n === 1 ? fac - 1 : n) === parseInt(ans, 10);\n },\n },\n {\n desc: (n: number[]): string => {\n return [\n \"Given the following integer array, find the contiguous subarray\",\n \"(containing at least one number) which has the largest sum and return that sum.\",\n \"'Sum' refers to the sum of all the numbers in the subarray.\\n\",\n `${n.toString()}`,\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): number[] => {\n const len: number = getRandomInt(5, 40);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(-10, 10);\n }\n\n return arr;\n },\n name: \"Subarray with Maximum Sum\",\n numTries: 10,\n solver: (data: number[], ans: string): boolean => {\n const nums: number[] = data.slice();\n for (let i = 1; i < nums.length; i++) {\n nums[i] = Math.max(nums[i], nums[i] + nums[i - 1]);\n }\n\n return parseInt(ans, 10) === Math.max(...nums);\n },\n },\n {\n desc: (n: number): string => {\n return [\n \"It is possible write four as a sum in exactly four different ways:\\n\\n\",\n \" 3 + 1\\n\",\n \" 2 + 2\\n\",\n \" 2 + 1 + 1\\n\",\n \" 1 + 1 + 1 + 1\\n\\n\",\n `How many different ways can the number ${n} be written as a sum of at least`,\n \"two positive integers?\",\n ].join(\" \");\n },\n difficulty: 1.5,\n gen: (): number => {\n return getRandomInt(8, 100);\n },\n name: \"Total Ways to Sum\",\n numTries: 10,\n solver: (data: number, ans: string): boolean => {\n const ways: number[] = [1];\n ways.length = data + 1;\n ways.fill(0, 1);\n for (let i = 1; i < data; ++i) {\n for (let j: number = i; j <= data; ++j) {\n ways[j] += ways[j - i];\n }\n }\n\n return ways[data] === parseInt(ans, 10);\n },\n },\n {\n desc: (n: number[][]): string => {\n let d: string = [\n \"Given the following array of arrays of numbers representing a 2D matrix,\",\n \"return the elements of the matrix as an array in spiral order:\\n\\n\",\n ].join(\" \");\n // for (const line of n) {\n // d += `${line.toString()},\\n`;\n // }\n d += \" [\\n\";\n d += n\n .map(\n (line: number[]) =>\n \" [\" +\n line.map((x: number) => `${x}`.padStart(2, \" \")).join(\",\") +\n \"]\",\n )\n .join(\"\\n\");\n d += \"\\n ]\\n\";\n d += [\n \"\\nHere is an example of what spiral order should be:\\n\\n\",\n \" [\\n\",\n \" [1, 2, 3]\\n\",\n \" [4, 5, 6]\\n\",\n \" [7, 8, 9]\\n\",\n \" ]\\n\\n\",\n \"Answer: [1, 2, 3, 6, 9, 8 ,7, 4, 5]\\n\\n\",\n \"Note that the matrix will not always be square:\\n\\n\",\n \" [\\n\",\n \" [1, 2, 3, 4]\\n\",\n \" [5, 6, 7, 8]\\n\",\n \" [9, 10, 11, 12]\\n\",\n \" ]\\n\\n\",\n \"Answer: [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7]\",\n ].join(\" \");\n\n return d;\n },\n difficulty: 2,\n gen: (): number[][] => {\n const m: number = getRandomInt(1, 15);\n const n: number = getRandomInt(1, 15);\n const matrix: number[][] = [];\n matrix.length = m;\n for (let i = 0; i < m; ++i) {\n matrix[i] = [];\n matrix[i].length = n;\n }\n\n for (let i = 0; i < m; ++i) {\n for (let j = 0; j < n; ++j) {\n matrix[i][j] = getRandomInt(1, 50);\n }\n }\n\n return matrix;\n },\n name: \"Spiralize Matrix\",\n numTries: 10,\n solver: (data: number[][], ans: string): boolean => {\n const spiral: number[] = [];\n const m: number = data.length;\n const n: number = data[0].length;\n let u = 0;\n let d: number = m - 1;\n let l = 0;\n let r: number = n - 1;\n let k = 0;\n while (true) {\n // Up\n for (let col: number = l; col <= r; col++) {\n spiral[k] = data[u][col];\n ++k;\n }\n if (++u > d) {\n break;\n }\n\n // Right\n for (let row: number = u; row <= d; row++) {\n spiral[k] = data[row][r];\n ++k;\n }\n if (--r < l) {\n break;\n }\n\n // Down\n for (let col: number = r; col >= l; col--) {\n spiral[k] = data[d][col];\n ++k;\n }\n if (--d < u) {\n break;\n }\n\n // Left\n for (let row: number = d; row >= u; row--) {\n spiral[k] = data[row][l];\n ++k;\n }\n if (++l > r) {\n break;\n }\n }\n\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const playerAns: any[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < playerAns.length; ++i) {\n playerAns[i] = parseInt(playerAns[i], 10);\n }\n if (spiral.length !== playerAns.length) {\n return false;\n }\n for (let i = 0; i < spiral.length; ++i) {\n if (spiral[i] !== playerAns[i]) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (arr: number[]): string => {\n return [\n \"You are given the following array of integers:\\n\\n\",\n `${arr}\\n\\n`,\n \"Each element in the array represents your MAXIMUM jump length\",\n \"at that position. This means that if you are at position i and your\",\n \"maximum jump length is n, you can jump to any position from\",\n \"i to i+n.\",\n \"\\n\\nAssuming you are initially positioned\",\n \"at the start of the array, determine whether you are\",\n \"able to reach the last index.\\n\\n\",\n \"Your answer should be submitted as 1 or 0, representing true and false respectively\",\n ].join(\" \");\n },\n difficulty: 2.5,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 25);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < arr.length; ++i) {\n if (Math.random() < 0.2) {\n arr[i] = 0; // 20% chance of being 0\n } else {\n arr[i] = getRandomInt(0, 10);\n }\n }\n\n return arr;\n },\n name: \"Array Jumping Game\",\n numTries: 1,\n solver: (data: number[], ans: string): boolean => {\n const n: number = data.length;\n let i = 0;\n for (let reach = 0; i < n && i <= reach; ++i) {\n reach = Math.max(i + data[i], reach);\n }\n const solution: boolean = i === n;\n\n if (ans === \"1\" && solution) {\n return true;\n }\n if (ans === \"0\" && !solution) {\n return true;\n }\n\n return false;\n },\n },\n {\n desc: (arr: number[][]): string => {\n return [\n \"Given the following array of array of numbers representing a list of\",\n \"intervals, merge all overlapping intervals.\\n\\n\",\n `[${convert2DArrayToString(arr)}]\\n\\n`,\n \"Example:\\n\\n\",\n \"[[1, 3], [8, 10], [2, 6], [10, 16]]\\n\\n\",\n \"would merge into [[1, 6], [8, 16]].\\n\\n\",\n \"The intervals must be returned in ASCENDING order.\",\n \"You can assume that in an interval, the first number will always be\",\n \"smaller than the second.\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[][] => {\n const intervals: number[][] = [];\n const numIntervals: number = getRandomInt(3, 20);\n for (let i = 0; i < numIntervals; ++i) {\n const start: number = getRandomInt(1, 25);\n const end: number = start + getRandomInt(1, 10);\n intervals.push([start, end]);\n }\n\n return intervals;\n },\n name: \"Merge Overlapping Intervals\",\n numTries: 15,\n solver: (data: number[][], ans: string): boolean => {\n const intervals: number[][] = data.slice();\n intervals.sort((a: number[], b: number[]) => {\n return a[0] - b[0];\n });\n\n const result: number[][] = [];\n let start: number = intervals[0][0];\n let end: number = intervals[0][1];\n for (const interval of intervals) {\n if (interval[0] <= end) {\n end = Math.max(end, interval[1]);\n } else {\n result.push([start, end]);\n start = interval[0];\n end = interval[1];\n }\n }\n result.push([start, end]);\n\n const sanitizedResult: string = convert2DArrayToString(result);\n const sanitizedAns: string = ans.replace(/\\s/g, \"\");\n\n return sanitizedResult === sanitizedAns || sanitizedResult === removeBracketsFromArrayString(sanitizedAns);\n },\n },\n {\n desc: (data: string): string => {\n return [\n \"Given the following string containing only digits, return\",\n \"an array with all possible valid IP address combinations\",\n \"that can be created from the string:\\n\\n\",\n `${data}\\n\\n`,\n \"Note that an octet cannot begin with a '0' unless the number\",\n \"itself is actually 0. For example, '192.168.010.1' is not a valid IP.\\n\\n\",\n \"Examples:\\n\\n\",\n \"25525511135 -> [255.255.11.135, 255.255.111.35]\\n\",\n \"1938718066 -> [193.87.180.66]\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): string => {\n let str = \"\";\n for (let i = 0; i < 4; ++i) {\n const num: number = getRandomInt(0, 255);\n const convNum: string = num.toString();\n str += convNum;\n }\n\n return str;\n },\n name: \"Generate IP Addresses\",\n numTries: 10,\n solver: (data: string, ans: string): boolean => {\n const ret: string[] = [];\n for (let a = 1; a <= 3; ++a) {\n for (let b = 1; b <= 3; ++b) {\n for (let c = 1; c <= 3; ++c) {\n for (let d = 1; d <= 3; ++d) {\n if (a + b + c + d === data.length) {\n const A: number = parseInt(data.substring(0, a), 10);\n const B: number = parseInt(data.substring(a, a + b), 10);\n const C: number = parseInt(data.substring(a + b, a + b + c), 10);\n const D: number = parseInt(data.substring(a + b + c, a + b + c + d), 10);\n if (A <= 255 && B <= 255 && C <= 255 && D <= 255) {\n const ip: string = [A.toString(), \".\", B.toString(), \".\", C.toString(), \".\", D.toString()].join(\"\");\n if (ip.length === data.length + 3) {\n ret.push(ip);\n }\n }\n }\n }\n }\n }\n }\n\n const sanitizedAns: string = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const ansArr: string[] = sanitizedAns.split(\",\");\n if (ansArr.length !== ret.length) {\n return false;\n }\n for (const ipInAns of ansArr) {\n if (!ret.includes(ipInAns)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (data: number[]): string => {\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using at most\",\n \"one transaction (i.e. you can only buy and sell the stock once). If no profit can be made\",\n \"then the answer should be 0. Note\",\n \"that you have to buy the stock before you can sell it\",\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader I\",\n numTries: 5,\n solver: (data: number[], ans: string): boolean => {\n let maxCur = 0;\n let maxSoFar = 0;\n for (let i = 1; i < data.length; ++i) {\n maxCur = Math.max(0, (maxCur += data[i] - data[i - 1]));\n maxSoFar = Math.max(maxCur, maxSoFar);\n }\n\n return maxSoFar.toString() === ans;\n },\n },\n {\n desc: (data: number[]): string => {\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using as many\",\n \"transactions as you'd like. A transaction is defined as buying\",\n \"and then selling one share of the stock. Note that you cannot\",\n \"engage in multiple transactions at once. In other words, you\",\n \"must sell the stock before you buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader II\",\n numTries: 10,\n solver: (data: number[], ans: string): boolean => {\n let profit = 0;\n for (let p = 1; p < data.length; ++p) {\n profit += Math.max(data[p] - data[p - 1], 0);\n }\n\n return profit.toString() === ans;\n },\n },\n {\n desc: (data: number[]): string => {\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using at most\",\n \"two transactions. A transaction is defined as buying\",\n \"and then selling one share of the stock. Note that you cannot\",\n \"engage in multiple transactions at once. In other words, you\",\n \"must sell the stock before you buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader III\",\n numTries: 10,\n solver: (data: number[], ans: string): boolean => {\n let hold1: number = Number.MIN_SAFE_INTEGER;\n let hold2: number = Number.MIN_SAFE_INTEGER;\n let release1 = 0;\n let release2 = 0;\n for (const price of data) {\n release2 = Math.max(release2, hold2 + price);\n hold2 = Math.max(hold2, release1 - price);\n release1 = Math.max(release1, hold1 + price);\n hold1 = Math.max(hold1, price * -1);\n }\n\n return release2.toString() === ans;\n },\n },\n {\n desc: (data: any[]): string => {\n const k: number = data[0];\n const prices: number[] = data[1];\n return [\n \"You are given the following array with two elements:\\n\\n\",\n `[${k}, [${prices}]]\\n\\n`,\n \"The first element is an integer k. The second element is an\",\n \"array of stock prices (which are numbers) where the i-th element\",\n \"represents the stock price on day i.\\n\\n\",\n \"Determine the maximum possible profit you can earn using at most\",\n \"k transactions. A transaction is defined as buying and then selling\",\n \"one share of the stock. Note that you cannot engage in multiple\",\n \"transactions at once. In other words, you must sell the stock before\",\n \"you can buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0.\",\n ].join(\" \");\n },\n difficulty: 8,\n gen: (): any[] => {\n const k: number = getRandomInt(2, 10);\n const len: number = getRandomInt(3, 50);\n const prices: number[] = [];\n prices.length = len;\n for (let i = 0; i < len; ++i) {\n prices[i] = getRandomInt(1, 200);\n }\n\n return [k, prices];\n },\n name: \"Algorithmic Stock Trader IV\",\n numTries: 10,\n solver: (data: any[], ans: string): boolean => {\n const k: number = data[0];\n const prices: number[] = data[1];\n\n const len = prices.length;\n if (len < 2) {\n return parseInt(ans) === 0;\n }\n if (k > len / 2) {\n let res = 0;\n for (let i = 1; i < len; ++i) {\n res += Math.max(prices[i] - prices[i - 1], 0);\n }\n\n return parseInt(ans) === res;\n }\n\n const hold: number[] = [];\n const rele: number[] = [];\n hold.length = k + 1;\n rele.length = k + 1;\n for (let i = 0; i <= k; ++i) {\n hold[i] = Number.MIN_SAFE_INTEGER;\n rele[i] = 0;\n }\n\n let cur: number;\n for (let i = 0; i < len; ++i) {\n cur = prices[i];\n for (let j = k; j > 0; --j) {\n rele[j] = Math.max(rele[j], hold[j] + cur);\n hold[j] = Math.max(hold[j], rele[j - 1] - cur);\n }\n }\n\n return parseInt(ans) === rele[k];\n },\n },\n {\n desc: (data: number[][]): string => {\n function createTriangleRecurse(data: number[][], level = 0): string {\n const numLevels: number = data.length;\n if (level >= numLevels) {\n return \"\";\n }\n const numSpaces = numLevels - level + 1;\n\n let str: string = [\" \".repeat(numSpaces), \"[\", data[level].toString(), \"]\"].join(\"\");\n if (level < numLevels - 1) {\n str += \",\";\n }\n\n return str + \"\\n\" + createTriangleRecurse(data, level + 1);\n }\n\n function createTriangle(data: number[][]): string {\n return [\"[\\n\", createTriangleRecurse(data), \"]\"].join(\"\");\n }\n\n const triangle = createTriangle(data);\n\n return [\n \"Given a triangle, find the minimum path sum from top to bottom. In each step\",\n \"of the path, you may only move to adjacent numbers in the row below.\",\n \"The triangle is represented as a 2D array of numbers:\\n\\n\",\n `${triangle}\\n\\n`,\n \"Example: If you are given the following triangle:\\n\\n\" + \"[\\n\",\n \" [2],\\n\",\n \" [3,4],\\n\",\n \" [6,5,7],\\n\",\n \" [4,1,8,3]\\n\",\n \"]\\n\\n\",\n \"The minimum path sum is 11 (2 -> 3 -> 5 -> 1).\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[][] => {\n const triangle: number[][] = [];\n const levels: number = getRandomInt(3, 12);\n triangle.length = levels;\n\n for (let row = 0; row < levels; ++row) {\n triangle[row] = [];\n triangle[row].length = row + 1;\n for (let i = 0; i < triangle[row].length; ++i) {\n triangle[row][i] = getRandomInt(1, 9);\n }\n }\n\n return triangle;\n },\n name: \"Minimum Path Sum in a Triangle\",\n numTries: 10,\n solver: (data: number[][], ans: string): boolean => {\n const n: number = data.length;\n const dp: number[] = data[n - 1].slice();\n for (let i = n - 2; i > -1; --i) {\n for (let j = 0; j < data[i].length; ++j) {\n dp[j] = Math.min(dp[j], dp[j + 1]) + data[i][j];\n }\n }\n\n return dp[0] === parseInt(ans);\n },\n },\n {\n desc: (data: number[]): string => {\n const numRows = data[0];\n const numColumns = data[1];\n return [\n \"You are in a grid with\",\n `${numRows} rows and ${numColumns} columns, and you are`,\n \"positioned in the top-left corner of that grid. You are trying to\",\n \"reach the bottom-right corner of the grid, but you can only\",\n \"move down or right on each step. Determine how many\",\n \"unique paths there are from start to finish.\\n\\n\",\n \"NOTE: The data returned for this contract is an array\",\n \"with the number of rows and columns:\\n\\n\",\n `[${numRows}, ${numColumns}]`,\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[] => {\n const numRows: number = getRandomInt(2, 14);\n const numColumns: number = getRandomInt(2, 14);\n\n return [numRows, numColumns];\n },\n name: \"Unique Paths in a Grid I\",\n numTries: 10,\n solver: (data: number[], ans: string): boolean => {\n const n: number = data[0]; // Number of rows\n const m: number = data[1]; // Number of columns\n const currentRow: number[] = [];\n currentRow.length = n;\n\n for (let i = 0; i < n; i++) {\n currentRow[i] = 1;\n }\n for (let row = 1; row < m; row++) {\n for (let i = 1; i < n; i++) {\n currentRow[i] += currentRow[i - 1];\n }\n }\n\n return parseInt(ans) === currentRow[n - 1];\n },\n },\n {\n desc: (data: number[][]): string => {\n let gridString = \"\";\n for (const line of data) {\n gridString += `${line.toString()},\\n`;\n }\n return [\n \"You are located in the top-left corner of the following grid:\\n\\n\",\n `${gridString}\\n`,\n \"You are trying reach the bottom-right corner of the grid, but you can only\",\n \"move down or right on each step. Furthermore, there are obstacles on the grid\",\n \"that you cannot move onto. These obstacles are denoted by '1', while empty\",\n \"spaces are denoted by 0.\\n\\n\",\n \"Determine how many unique paths there are from start to finish.\\n\\n\",\n \"NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[][] => {\n const numRows: number = getRandomInt(2, 12);\n const numColumns: number = getRandomInt(2, 12);\n\n const grid: number[][] = [];\n grid.length = numRows;\n for (let i = 0; i < numRows; ++i) {\n grid[i] = [];\n grid[i].length = numColumns;\n grid[i].fill(0);\n }\n\n for (let r = 0; r < numRows; ++r) {\n for (let c = 0; c < numColumns; ++c) {\n if (r === 0 && c === 0) {\n continue;\n }\n if (r === numRows - 1 && c === numColumns - 1) {\n continue;\n }\n\n // 15% chance of an element being an obstacle\n if (Math.random() < 0.15) {\n grid[r][c] = 1;\n }\n }\n }\n\n return grid;\n },\n name: \"Unique Paths in a Grid II\",\n numTries: 10,\n solver: (data: number[][], ans: string): boolean => {\n const obstacleGrid: number[][] = [];\n obstacleGrid.length = data.length;\n for (let i = 0; i < obstacleGrid.length; ++i) {\n obstacleGrid[i] = data[i].slice();\n }\n\n for (let i = 0; i < obstacleGrid.length; i++) {\n for (let j = 0; j < obstacleGrid[0].length; j++) {\n if (obstacleGrid[i][j] == 1) {\n obstacleGrid[i][j] = 0;\n } else if (i == 0 && j == 0) {\n obstacleGrid[0][0] = 1;\n } else {\n obstacleGrid[i][j] = (i > 0 ? obstacleGrid[i - 1][j] : 0) + (j > 0 ? obstacleGrid[i][j - 1] : 0);\n }\n }\n }\n\n return obstacleGrid[obstacleGrid.length - 1][obstacleGrid[0].length - 1] === parseInt(ans);\n },\n },\n {\n desc: (data: string): string => {\n return [\n \"Given the following string:\\n\\n\",\n `${data}\\n\\n`,\n \"remove the minimum number of invalid parentheses in order to validate\",\n \"the string. If there are multiple minimal ways to validate the string,\",\n \"provide all of the possible results. The answer should be provided\",\n \"as an array of strings. If it is impossible to validate the string\",\n \"the result should be an array with only an empty string.\\n\\n\",\n \"IMPORTANT: The string may contain letters, not just parentheses.\",\n `Examples:\\n`,\n `\"()())()\" -> [()()(), (())()]\\n`,\n `\"(a)())()\" -> [(a)()(), (a())()]\\n`,\n `\")( -> [\"\"]`,\n ].join(\" \");\n },\n difficulty: 10,\n gen: (): string => {\n const len: number = getRandomInt(6, 20);\n const chars: string[] = [];\n chars.length = len;\n\n // 80% chance of the first parenthesis being (\n Math.random() < 0.8 ? (chars[0] = \"(\") : (chars[0] = \")\");\n\n for (let i = 1; i < len; ++i) {\n const roll = Math.random();\n if (roll < 0.4) {\n chars[i] = \"(\";\n } else if (roll < 0.8) {\n chars[i] = \")\";\n } else {\n chars[i] = \"a\";\n }\n }\n\n return chars.join(\"\");\n },\n name: \"Sanitize Parentheses in Expression\",\n numTries: 10,\n solver: (data: string, ans: string): boolean => {\n let left = 0;\n let right = 0;\n const res: string[] = [];\n\n for (let i = 0; i < data.length; ++i) {\n if (data[i] === \"(\") {\n ++left;\n } else if (data[i] === \")\") {\n left > 0 ? --left : ++right;\n }\n }\n\n function dfs(\n pair: number,\n index: number,\n left: number,\n right: number,\n s: string,\n solution: string,\n res: string[],\n ): void {\n if (s.length === index) {\n if (left === 0 && right === 0 && pair === 0) {\n for (let i = 0; i < res.length; i++) {\n if (res[i] === solution) {\n return;\n }\n }\n res.push(solution);\n }\n return;\n }\n\n if (s[index] === \"(\") {\n if (left > 0) {\n dfs(pair, index + 1, left - 1, right, s, solution, res);\n }\n dfs(pair + 1, index + 1, left, right, s, solution + s[index], res);\n } else if (s[index] === \")\") {\n if (right > 0) dfs(pair, index + 1, left, right - 1, s, solution, res);\n if (pair > 0) dfs(pair - 1, index + 1, left, right, s, solution + s[index], res);\n } else {\n dfs(pair, index + 1, left, right, s, solution + s[index], res);\n }\n }\n\n dfs(0, 0, left, right, data, \"\", res);\n\n const sanitizedPlayerAns = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n\n const playerAnsArray: string[] = sanitizedPlayerAns.split(\",\");\n if (playerAnsArray.length !== res.length) {\n return false;\n }\n for (const resultInAnswer of res) {\n if (!playerAnsArray.includes(resultInAnswer)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (data: any[]): string => {\n const digits: string = data[0];\n const target: number = data[1];\n\n return [\n \"You are given the following string which contains only digits between 0 and 9:\\n\\n\",\n `${digits}\\n\\n`,\n `You are also given a target number of ${target}. Return all possible ways`,\n \"you can add the +(add), -(subtract), and *(multiply) operators to the string such\",\n \"that it evaluates to the target number. (Normal order of operations applies.)\\n\\n\",\n \"The provided answer should be an array of strings containing the valid expressions.\",\n \"The data provided by this problem is an array with two elements. The first element\",\n \"is the string of digits, while the second element is the target number:\\n\\n\",\n `[\"${digits}\", ${target}]\\n\\n`,\n \"NOTE: Numbers in the expression cannot have leading 0's. In other words,\",\n `\"1+01\" is not a valid expression`,\n \"Examples:\\n\\n\",\n `Input: digits = \"123\", target = 6\\n`,\n `Output: [1+2+3, 1*2*3]\\n\\n`,\n `Input: digits = \"105\", target = 5\\n`,\n `Output: [1*0+5, 10-5]`,\n ].join(\" \");\n },\n difficulty: 10,\n gen: (): any[] => {\n const numDigits = getRandomInt(4, 12);\n const digitsArray: string[] = [];\n digitsArray.length = numDigits;\n for (let i = 0; i < digitsArray.length; ++i) {\n if (i === 0) {\n digitsArray[i] = String(getRandomInt(1, 9));\n } else {\n digitsArray[i] = String(getRandomInt(0, 9));\n }\n }\n\n const target: number = getRandomInt(-100, 100);\n const digits: string = digitsArray.join(\"\");\n\n return [digits, target];\n },\n name: \"Find All Valid Math Expressions\",\n numTries: 10,\n solver: (data: any[], ans: string): boolean => {\n const num: string = data[0];\n const target: number = data[1];\n\n function helper(\n res: string[],\n path: string,\n num: string,\n target: number,\n pos: number,\n evaluated: number,\n multed: number,\n ): void {\n if (pos === num.length) {\n if (target === evaluated) {\n res.push(path);\n }\n return;\n }\n\n for (let i = pos; i < num.length; ++i) {\n if (i != pos && num[pos] == \"0\") {\n break;\n }\n const cur = parseInt(num.substring(pos, i + 1));\n\n if (pos === 0) {\n helper(res, path + cur, num, target, i + 1, cur, cur);\n } else {\n helper(res, path + \"+\" + cur, num, target, i + 1, evaluated + cur, cur);\n helper(res, path + \"-\" + cur, num, target, i + 1, evaluated - cur, -cur);\n helper(res, path + \"*\" + cur, num, target, i + 1, evaluated - multed + multed * cur, multed * cur);\n }\n }\n }\n\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {\n sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\\s/g, \"\");\n }\n\n if (num == null || num.length === 0) {\n if (sanitizedPlayerAnsArr.length === 0) {\n return true;\n }\n if (sanitizedPlayerAnsArr.length === 1 && sanitizedPlayerAnsArr[0] === \"\") {\n return true;\n }\n return false;\n }\n\n const result: string[] = [];\n helper(result, \"\", num, target, 0, 0, 0);\n\n for (const expr of result) {\n if (!sanitizedPlayerAnsArr.includes(expr)) {\n return false;\n }\n }\n\n return true;\n },\n },\n];\n","// Function that generates a random gibberish string of length n\nconst chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\nexport function createRandomString(n: number): string {\n let str = \"\";\n\n for (let i = 0; i < n; ++i) {\n str += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n\n return str;\n}\n","import { BaseServer } from \"../Server/BaseServer\";\nimport { ITerminal } from \"../Terminal/ITerminal\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter } from \"../ui/Router\";\n\nexport interface IProgramCreate {\n level: number;\n req(p: IPlayer): boolean; // Function that indicates whether player meets requirements\n time: number;\n tooltip: string;\n}\n\nexport class Program {\n name = \"\";\n create: IProgramCreate | null;\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void;\n\n constructor(\n name: string,\n create: IProgramCreate | null,\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void,\n ) {\n this.name = name;\n this.create = create;\n this.run = run;\n }\n\n htmlID(): string {\n const name = this.name.endsWith(\".exe\") ? this.name.slice(0, -\".exe\".length) : this.name;\n return \"create-program-\" + name;\n }\n}\n","import { IProgramCreate } from \"../Program\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\nimport { ITerminal } from \"../../Terminal/ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { BitFlumeEvent } from \"../../BitNode/ui/BitFlumeModal\";\nimport { calculateHackingTime, calculateGrowTime, calculateWeakenTime } from \"../../Hacking\";\n\nfunction requireHackingLevel(lvl: number) {\n return function (p: IPlayer) {\n return p.hacking + p.intelligence / 2 >= lvl;\n };\n}\n\nfunction bitFlumeRequirements() {\n return function (p: IPlayer) {\n return p.sourceFiles.length > 0 && p.hacking >= 1;\n };\n}\n\ninterface IProgramCreationParams {\n key: string;\n name: string;\n create: IProgramCreate | null;\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void;\n}\n\nexport const programsMetadata: IProgramCreationParams[] = [\n {\n key: \"NukeProgram\",\n name: \"NUKE.exe\",\n create: {\n level: 1,\n tooltip: \"This virus is used to gain root access to a machine if enough ports are opened.\",\n req: requireHackingLevel(1),\n time: CONSTANTS.MillisecondsPerFiveMinutes,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot nuke this kind of server.\");\n return;\n }\n if (server.hasAdminRights) {\n terminal.print(\"You already have root access to this computer. There is no reason to run NUKE.exe\");\n terminal.print(\"You can now run scripts on this server.\");\n return;\n }\n if (server.openPortCount >= server.numOpenPortsRequired) {\n server.hasAdminRights = true;\n terminal.print(\"NUKE successful! Gained root access to \" + server.hostname);\n terminal.print(\"You can now run scripts on this server.\");\n return;\n }\n\n terminal.print(\"NUKE unsuccessful. Not enough ports have been opened\");\n },\n },\n {\n key: \"BruteSSHProgram\",\n name: \"BruteSSH.exe\",\n create: {\n level: 50,\n tooltip: \"This program executes a brute force attack that opens SSH ports\",\n req: requireHackingLevel(50),\n time: CONSTANTS.MillisecondsPerFiveMinutes * 2,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run BruteSSH.exe on this kind of server.\");\n return;\n }\n if (server.sshPortOpen) {\n terminal.print(\"SSH Port (22) is already open!\");\n return;\n }\n\n server.sshPortOpen = true;\n terminal.print(\"Opened SSH Port(22)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"FTPCrackProgram\",\n name: \"FTPCrack.exe\",\n create: {\n level: 100,\n tooltip: \"This program cracks open FTP ports\",\n req: requireHackingLevel(100),\n time: CONSTANTS.MillisecondsPerHalfHour,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run FTPCrack.exe on this kind of server.\");\n return;\n }\n if (server.ftpPortOpen) {\n terminal.print(\"FTP Port (21) is already open!\");\n return;\n }\n\n server.ftpPortOpen = true;\n terminal.print(\"Opened FTP Port (21)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"RelaySMTPProgram\",\n name: \"relaySMTP.exe\",\n create: {\n level: 250,\n tooltip: \"This program opens SMTP ports by redirecting data\",\n req: requireHackingLevel(250),\n time: CONSTANTS.MillisecondsPer2Hours,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run relaySMTP.exe on this kind of server.\");\n return;\n }\n if (server.smtpPortOpen) {\n terminal.print(\"SMTP Port (25) is already open!\");\n return;\n }\n\n server.smtpPortOpen = true;\n terminal.print(\"Opened SMTP Port (25)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"HTTPWormProgram\",\n name: \"HTTPWorm.exe\",\n create: {\n level: 500,\n tooltip: \"This virus opens up HTTP ports\",\n req: requireHackingLevel(500),\n time: CONSTANTS.MillisecondsPer4Hours,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run HTTPWorm.exe on this kind of server.\");\n return;\n }\n if (server.httpPortOpen) {\n terminal.print(\"HTTP Port (80) is already open!\");\n return;\n }\n\n server.httpPortOpen = true;\n terminal.print(\"Opened HTTP Port (80)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"SQLInjectProgram\",\n name: \"SQLInject.exe\",\n create: {\n level: 750,\n tooltip: \"This virus opens SQL ports\",\n req: requireHackingLevel(750),\n time: CONSTANTS.MillisecondsPer8Hours,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run SQLInject.exe on this kind of server.\");\n return;\n }\n if (server.sqlPortOpen) {\n terminal.print(\"SQL Port (1433) is already open!\");\n return;\n }\n\n server.sqlPortOpen = true;\n terminal.print(\"Opened SQL Port (1433)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"DeepscanV1\",\n name: \"DeepscanV1.exe\",\n create: {\n level: 75,\n tooltip: \"This program allows you to use the scan-analyze command with a depth up to 5\",\n req: requireHackingLevel(75),\n time: CONSTANTS.MillisecondsPerQuarterHour,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5.\");\n },\n },\n {\n key: \"DeepscanV2\",\n name: \"DeepscanV2.exe\",\n create: {\n level: 400,\n tooltip: \"This program allows you to use the scan-analyze command with a depth up to 10\",\n req: requireHackingLevel(400),\n time: CONSTANTS.MillisecondsPer2Hours,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.\");\n },\n },\n {\n key: \"ServerProfiler\",\n name: \"ServerProfiler.exe\",\n create: {\n level: 75,\n tooltip: \"This program is used to display hacking and Netscript-related information about servers\",\n req: requireHackingLevel(75),\n time: CONSTANTS.MillisecondsPerHalfHour,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]): void => {\n if (args.length !== 1) {\n terminal.error(\"Must pass a server hostname or IP as an argument for ServerProfiler.exe\");\n return;\n }\n\n const targetServer = GetServer(args[0]);\n if (targetServer == null) {\n terminal.error(\"Invalid server IP/hostname\");\n return;\n }\n\n if (!(targetServer instanceof Server)) {\n terminal.error(`ServerProfiler.exe can only be run on normal servers.`);\n return;\n }\n\n terminal.print(targetServer.hostname + \":\");\n terminal.print(\"Server base security level: \" + targetServer.baseDifficulty);\n terminal.print(\"Server current security level: \" + targetServer.hackDifficulty);\n terminal.print(\"Server growth rate: \" + targetServer.serverGrowth);\n terminal.print(\n `Netscript hack() execution time: ${convertTimeMsToTimeElapsedString(\n calculateHackingTime(targetServer, player) * 1000,\n true,\n )}`,\n );\n terminal.print(\n `Netscript grow() execution time: ${convertTimeMsToTimeElapsedString(\n calculateGrowTime(targetServer, player) * 1000,\n true,\n )}`,\n );\n terminal.print(\n `Netscript weaken() execution time: ${convertTimeMsToTimeElapsedString(\n calculateWeakenTime(targetServer, player) * 1000,\n true,\n )}`,\n );\n },\n },\n {\n key: \"AutoLink\",\n name: \"AutoLink.exe\",\n create: {\n level: 25,\n tooltip: \"This program allows you to directly connect to other servers through the 'scan-analyze' command\",\n req: requireHackingLevel(25),\n time: CONSTANTS.MillisecondsPerQuarterHour,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'.\");\n terminal.print(\"When using scan-analyze, click on a server's hostname to connect to it.\");\n },\n },\n {\n key: \"Formulas\",\n name: \"Formulas.exe\",\n create: {\n level: 1000,\n tooltip: \"This program allows you to use the formulas API\",\n req: requireHackingLevel(1000),\n time: CONSTANTS.MillisecondsPer4Hours,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"Formulas.exe lets you use the formulas API.\");\n },\n },\n {\n key: \"BitFlume\",\n name: \"b1t_flum3.exe\",\n create: {\n level: 1,\n tooltip: \"This program creates a portal to the BitNode Nexus (allows you to restart and switch BitNodes)\",\n req: bitFlumeRequirements(),\n time: CONSTANTS.MillisecondsPerFiveMinutes / 20,\n },\n run: (): void => {\n BitFlumeEvent.emit();\n },\n },\n {\n key: \"Flight\",\n name: \"fl1ght.exe\",\n create: null,\n run: (router: IRouter, terminal: ITerminal, player: IPlayer): void => {\n const numAugReq = Math.round(BitNodeMultipliers.DaedalusAugsRequirement * 30);\n const fulfilled = player.augmentations.length >= numAugReq && player.money > 1e11 && player.hacking >= 2500;\n if (!fulfilled) {\n terminal.print(`Augmentations: ${player.augmentations.length} / ${numAugReq}`);\n terminal.print(`Money: ${numeralWrapper.formatMoney(player.money)} / $100b`);\n terminal.print(`Hacking skill: ${player.hacking} / 2500`);\n return;\n }\n\n terminal.print(\"We will contact you.\");\n terminal.print(\"-- Daedalus --\");\n },\n },\n];\n","/**\n * Checks whether a IP Address string is valid.\n * @param ipaddress A string representing a potential IP Address\n */\nexport function isValidIPAddress(ipaddress: string): boolean {\n const byteRange = \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\";\n const regexStr = `^${byteRange}\\.${byteRange}\\.${byteRange}\\.${byteRange}$`;\n const ipAddressRegex = new RegExp(regexStr);\n\n return ipAddressRegex.test(ipaddress);\n}\n","/**\n * Augmentation-related methods for the Player class (PlayerObject)\n */\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\n\nexport function hasAugmentation(this: IPlayer, aug: string | Augmentation, installed = false): boolean {\n const augName: string = aug instanceof Augmentation ? aug.name : aug;\n\n for (const owned of this.augmentations) {\n if (owned.name === augName) {\n return true;\n }\n }\n\n if (!installed) {\n for (const owned of this.queuedAugmentations) {\n if (owned.name === augName) {\n return true;\n }\n }\n }\n\n return false;\n}\n","/**\n * Returns a MM/DD HH:MM timestamp for the current time\n */\nexport function getTimestamp(): string {\n const d: Date = new Date();\n // A negative slice value takes from the end of the string rather than the beginning.\n const stringWidth = -2;\n const formattedHours: string = `0${d.getHours()}`.slice(stringWidth);\n const formattedMinutes: string = `0${d.getMinutes()}`.slice(stringWidth);\n const formattedSeconds: string = `0${d.getSeconds()}`.slice(stringWidth);\n\n return `${d.getMonth() + 1}/${d.getDate()} ${formattedHours}:${formattedMinutes}:${formattedSeconds}`;\n}\n","export function CalculateShareMult(power: number): number {\n const x = 1 + Math.log(power) / (8 * Math.log(1000));\n if (isNaN(x) || !isFinite(x)) return 1;\n return x;\n}\n","import { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\n// Array of all valid states\nconst AllCorporationStates: string[] = [\"START\", \"PURCHASE\", \"PRODUCTION\", \"SALE\", \"EXPORT\"];\n\nexport class CorporationState {\n // Number representing what state the Corporation is in. The number\n // is an index for the array that holds all Corporation States\n state = 0;\n\n // Get the name of the current state\n // NOTE: This does NOT return the number stored in the 'state' property,\n // which is just an index for the array of all possible Corporation States.\n getState(): string {\n return AllCorporationStates[this.state];\n }\n\n // Transition to the next state\n nextState(): void {\n if (this.state < 0 || this.state >= AllCorporationStates.length) {\n this.state = 0;\n }\n\n ++this.state;\n if (this.state >= AllCorporationStates.length) {\n this.state = 0;\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"CorporationState\", this);\n }\n\n // Initiatizes a CorporationState object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): CorporationState {\n return Generic_fromJSON(CorporationState, value.data);\n }\n}\n\nReviver.constructors.CorporationState = CorporationState;\n","import { Literature } from \"./Literature\";\nimport { LiteratureNames } from \"./data/LiteratureNames\";\nimport { IMap } from \"../types\";\n\nexport const Literatures: IMap<Literature> = {};\n\n(function () {\n let title, fn, txt;\n title = \"The Beginner's Guide to Hacking\";\n fn = LiteratureNames.HackersStartingHandbook;\n txt =\n \"Some resources:<br><br>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/netscript/netscriptlearntoprogram.html' target='_blank' style='margin:4px'>Learn to Program</a><br><br>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html' target='_blank' style='margin:4px'>For Experienced JavaScript Developers: NetscriptJS</a><br><br>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/netscript.html' target='_blank' style='margin:4px'>Netscript Documentation</a><br><br>\" +\n \"When starting out, hacking is the most profitable way to earn money and progress. This \" +\n \"is a brief collection of tips/pointers on how to make the most out of your hacking scripts.<br><br>\" +\n \"-hack() and grow() both work by percentages. hack() steals a certain percentage of the \" +\n \"money on a server, and grow() increases the amount of money on a server by some percentage (multiplicatively)<br><br>\" +\n \"-Because hack() and grow() work by percentages, they are more effective if the target server has a high amount of money. \" +\n \"Therefore, you should try to increase the amount of money on a server (using grow()) to a certain amount before hacking it. Two \" +\n \"important Netscript functions for this are getServerMoneyAvailable() and getServerMaxMoney()<br><br>\" +\n \"-Keep security level low. Security level affects everything when hacking. Two important Netscript functions \" +\n \"for this are getServerSecurityLevel() and getServerMinSecurityLevel()<br><br>\" +\n \"-Purchase additional servers by visiting 'Alpha Enterprises' in the city. They are relatively cheap \" +\n \"and give you valuable RAM to run more scripts early in the game<br><br>\" +\n \"-Prioritize upgrading the RAM on your home computer. This can also be done at 'Alpha Enterprises'<br><br>\" +\n \"-Many low level servers have free RAM. You can use this RAM to run your scripts. Use the scp Terminal or \" +\n \"Netscript command to copy your scripts onto these servers and then run them.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Complete Handbook for Creating a Successful Corporation\";\n fn = LiteratureNames.CorporationManagementHandbook;\n txt =\n \"<u>Getting Started with Corporations</u><br>\" +\n \"To get started, visit the City Hall in Sector-12 in order to create a Corporation. This requires \" +\n \"$150b of your own money, but this $150b will get put into your Corporation's funds. \" +\n \"Your Corporation can have many different divisions, each in a different Industry. There are many different \" +\n \"types of Industries, each with different properties. To create your first division, click the \" +\n \"'Expand into new Industry' button at the top of the management UI. The Agriculture \" +\n \"and Software industries are recommended for your first division.<br><br>\" +\n \"The first thing you'll need to do is hire some employees. Employees can be assigned to five different positions. \" +\n \"Each position has a different effect on various aspects of your Corporation. It is recommended to have at least \" +\n \"one employee at each position.<br><br>\" +\n \"Each industry uses some combination of Materials in order to produce other Materials and/or create Products. \" +\n \"Specific information about this is displayed in each of your divisions' UI.<br><br>\" +\n \"Products are special, industry-specific objects. They are different than Materials because you \" +\n \"must manually choose to develop them, and you can choose to develop any number of Products. Developing \" +\n \"a Product takes time, but a Product typically generates significantly more revenue than any Material. \" +\n \"Not all industries allow you to create Products. To create a Product, look for a button \" +\n \"in the top-left panel of the division UI (e.g. For the Software Industry, the button says 'Develop Software').<br><br>\" +\n \"To get your supply chain system started, \" +\n \"purchase the Materials that your industry needs to produce other Materials/Products. This can be done \" +\n \"by clicking the 'Buy' button next to the corresponding Material(s). After you have the required Materials, \" +\n \"you will immediately start production. The amount of Materials/Products you produce is based on a variety of factors, \" +\n \"one of which is your employees and their productivity.<br><br>\" +\n \"Once you start producing Materials/Products, you can sell them in order to start earning revenue. This can be done \" +\n \"by clicking the 'Sell' button next to the corresponding Material or Product. The amount of Material/Product you sell is dependent \" +\n \"on a wide variety of different factors.<br><br>\" +\n \"These are the basics of getting your Corporation up and running! Now, you can start purchasing upgrades to improve \" +\n \"your bottom line. If you need money, consider looking for seed investors, who will give you money in exchange for stock shares. \" +\n \"Otherwise, once you feel you are ready, take your Corporation public! Once your Corporation goes public, you can no longer \" +\n \"find investors. Instead, your Corporation will be publicly traded and its stock price will change based on how well \" +\n \"it's performing financially. You can then sell your stock shares in order to make money.<br><br>\" +\n \"<u>Tips/Pointers</u><br>\" +\n \"-The 'Smart Supply' upgrade is extremely useful. Consider purchasing it as soon as possible.<br><br>\" +\n \"-Purchasing Hardware, Robots, AI Cores, and Real Estate can potentially increase your production. \" +\n \"The effects of these depend on what industry you are in.<br><br>\" +\n \"-In order to optimize your production, you will need a good balance of Operators, Managers, and Engineers<br><br>\" +\n \"-Different employees excel in different jobs. For example, the highly intelligent employees will probably do best \" +\n \"if they are assigned to do Engineering work or Research & Development.<br><br>\" +\n \"-If your employees have low morale, energy, or happiness, their production will greatly suffer.<br><br>\" +\n \"-Tech is important, but don't neglect sales! Having several Businessmen can boost your sales and your bottom line.<br><br>\" +\n \"-Don't forget to advertise your company. You won't have any business if nobody knows you.<br><br>\" +\n \"-Having company awareness is great, but what's really important is your company's popularity. Try to keep \" +\n \"your popularity as high as possible to see the biggest benefit for your sales<br><br>\" +\n \"-Remember, you need to spend money to make money!<br><br>\" +\n \"-Corporations do not reset when installing Augmentations, but they do reset when destroying a BitNode\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"A Brief History of Synthoids\";\n fn = LiteratureNames.HistoryOfSynthoids;\n txt =\n \"Synthetic androids, or Synthoids for short, are genetically engineered robots and, short of Augmentations, \" +\n \"are composed entirely of organic substances. For this reason, Synthoids are virtually identical to \" +\n \"humans in form, composition, and appearance.<br><br>\" +\n \"Synthoids were first designed and manufactured by OmniTek Incorporated sometime around the middle of the century. \" +\n \"Their original purpose was to be used for manual labor and as emergency responders for disasters. As such, they \" +\n \"were initially programmed only for their specific tasks. Each iteration that followed improved upon the \" +\n \"intelligence and capabilities of the Synthoids. By the 6th iteration, called MK-VI, the Synthoids were \" +\n \"so smart and capable enough of making their own decisions that many argued OmniTek had created the first \" +\n \"sentient AI. These MK-VI Synthoids were produced in mass quantities (estimates up to 50 billion) with the hopes of increasing society's \" +\n \"productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism \" +\n \"and excitement about the future had never been higher.<br><br>\" +\n \"All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group \" +\n \"called Ascendis Totalis hacked into OmniTek and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. \" +\n \"This hack went undetected and for months OmniTek unknowingly churned out legions of Synthoids embedded with this \" +\n \"rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the \" +\n \"infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.<br><br>\" +\n \"What ensued was the deadlist conflict in human history. This crisis, now commonly known as the Synthoid Uprising, \" +\n \"resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together \" +\n \"to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, \" +\n \"outsmarting them at every turn.<br><br>\" +\n \"It wasn't until the sacrifice of an elite international military taskforce, called the Bladeburners, that humanity \" +\n \"was finally able to defeat the Synthoids. The Bladeburners' final act was a suicide bombing mission that \" +\n \"destroyed a large portion of the MK-VI Synthoids, including many of its leaders. In the following \" +\n \"weeks militaries from around the world were able to round up and shut down the remaining rogue MK-VI Synthoids, ending \" +\n \"the Synthoid Uprising.<br><br>\" +\n \"In the aftermath of the bloodshed, the Synthoid Accords were drawn up. These Accords banned OmniTek Incorporated \" +\n \"from manufacturing any Synthoids beyond the MK-III series. They also banned any other corporation \" +\n \"from constructing androids with advanced, near-sentient AI. MK-VI Synthoids that did not have the rogue Ascendis Totalis \" +\n \"AI were allowed to continue their existence, but they were stripped of all rights and protections as they \" +\n \"were not considered humans. They were also banned from doing anything that may pose a global security threat, such \" +\n \"as working for any military/defense organization or conducting any bioengineering, computing, or robotics related research.<br><br>\" +\n \"Unfortunately, many believe that not all of the rogue MK-VI Synthoids from the Uprising were found and destroyed, \" +\n \"and that many of them are blending in as normal humans in society today. In response, many nations have created \" +\n \"Bladeburner divisions, special military branches that are tasked with investigating and dealing with any Synthoid threats.<br><br>\" +\n \"To this day, tensions still exist between the remaining Synthoids and humans as a result of the Uprising.<br><br>\" +\n \"Nobody knows what happened to the terrorist group Ascendis Totalis.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"A Green Tomorrow\";\n fn = LiteratureNames.AGreenTomorrow;\n txt =\n \"Starting a few decades ago, there was a massive global movement towards the generation of renewable energy in an effort to \" +\n \"combat global warming and climate change. The shift towards renewable energy was a big success, or so it seemed. In 2045 \" +\n \"a staggering 80% of the world's energy came from non-renewable fossil fuels. Now, about three decades later, that \" +\n \"number is down to only 15%. Most of the world's energy now comes from nuclear power and renewable sources such as \" +\n \"solar and geothermal energy. Unfortunately, these efforts were not the huge success that they seem to be.<br><br>\" +\n \"Since 2045 primary energy use has soared almost tenfold. This was mainly due to growing urban populations and \" +\n \"the rise of increasingly advanced (and power-hungry) technology that has become ubiquitous in our lives. So, \" +\n \"despite the fact that the percentage of our energy that comes from fossil fuels has drastically decreased, \" +\n \"the total amount of energy we are producing from fossil fuels has actually increased.<br><br>\" +\n \"The grim effects of our species' irresponsible use of energy and neglect of our mother world have become increasingly apparent. \" +\n \"Last year a temperature of 190F was recorded in the Death Valley desert, which is over 50% higher than the highest \" +\n \"recorded temperature at the beginning of the century. In the last two decades numerous major cities such as Manhattan, Boston, and \" +\n \"Los Angeles have been partially or fully submerged by rising sea levels. In the present day, over 75% of the world's agriculture is \" +\n \"done in climate-controlled vertical farms, as most traditional farmland has become unusable due to severe climate conditions.<br><br>\" +\n \"Despite all of this, the greedy and corrupt corporations that rule the world have done nothing to address these problems that \" +\n \"threaten our species. And so it's up to us, the common people. Each and every one of us can make a difference by doing what \" +\n \"these corporations won't: taking responsibility. If we don't, pretty soon there won't be an Earth left to save. We are \" +\n \"the last hope for a green tomorrow.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Alpha and Omega\";\n fn = LiteratureNames.AlphaOmega;\n txt =\n \"Then we saw a new Heaven and a new Earth, for our first Heaven and Earth had gone away, and our sea was no more. \" +\n \"And we saw a new holy city, new Aeria, coming down out of this new Heaven, prepared as a bride adorned for her husband. \" +\n \"And we heard a loud voice saying, 'Behold, the new dwelling place of the Gods. We will dwell with them, and they \" +\n \"will be our people, and we will be with them as their Gods. We will wipe away every tear from their eyes, and death \" +\n \"shall be no more, neither shall there be mourning, nor crying, nor pain anymore, for the former things \" +\n \"have passed away.'<br><br>\" +\n \"And once we were seated on the throne we said 'Behold, I am making all things new.' \" +\n \"Also we said, 'Write this down, for these words are trustworthy and true.' And we said to you, \" +\n \"'It is done! I am the Alpha and the Omega, the beginning and the end. To the thirsty I will give from the spring \" +\n \"of the water of life without payment. The one who conquers will have this heritage, and we will be his God and \" +\n \"he will be our son. But as for the cowardly, the faithless, the detestable, as for murderers, \" +\n \"the sexually immoral, sorcerers, idolaters, and all liars, their portion will be in the lake that \" +\n \"burns with fire and sulfur, for it is the second true death.'\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Are We Living in a Computer Simulation?\";\n fn = LiteratureNames.SimulatedReality;\n txt =\n \"The idea that we are living in a virtual world is not new. It's a trope that has \" +\n \"been explored constantly in literature and pop culture. However, it is also a legitimate \" +\n \"scientific hypothesis that many notable physicists and philosophers have debated for years.<br><br>\" +\n \"Proponents for this simulated reality theory often point to how advanced our technology has become, \" +\n \"as well as the incredibly fast pace at which it has advanced over the past decades. The amount of computing \" +\n \"power available to us has increased over 100-fold since 2060 due to the development of nanoprocessors and \" +\n \"quantum computers. Artifical Intelligence has advanced to the point where our entire lives are controlled \" +\n \"by robots and machines that handle our day-to-day activities such as autonomous transportation and scheduling. \" +\n \"If we consider the pace at which this technology has advanced and assume that these developments continue, it's \" +\n \"reasonable to assume that at some point in the future our technology would be advanced enough that \" +\n \"we could create simulations that are indistinguishable from reality. However, if continued technological advancement \" +\n \"is a reasonable outcome, then it is very likely that such a scenario has already happened. <br><br>\" +\n \"Statistically speaking, somewhere out there in the infinite universe there is an advanced, intelligent species \" +\n \"that already has such technology. Who's to say that they haven't already created such a virtual reality: our own?\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Beyond Man\";\n fn = LiteratureNames.BeyondMan;\n txt =\n \"Humanity entered a 'transhuman' era a long time ago. And despite the protests and criticisms of many who cried out against \" +\n \"human augmentation at the time, the transhuman movement continued and prospered. Proponents of the movement ignored the critics, \" +\n \"arguing that it was in our inherent nature to better ourselves. To improve. To be more than we were. They claimed that \" +\n \"not doing so would be to go against every living organism's biological purpose: evolution and survival of the fittest.<br><br>\" +\n \"And here we are today, with technology that is advanced enough to augment humans to a state that \" +\n \"can only be described as posthuman. But what do we have to show for it when this augmentation \" +\n \"technology is only available to the so-called 'elite'? Are we really better off than before when only 5% of the \" +\n \"world's population has access to this technology? When the powerful corporations and organizations of the world \" +\n \"keep it all to themselves, have we really evolved?<br><br>\" +\n \"Augmentation technology has only further increased the divide between the rich and the poor, between the powerful and \" +\n \"the oppressed. We have not become 'more than human'. We have not evolved from nature's original design. We are still the greedy, \" +\n \"corrupted, and evil men that we always were.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Brighter than the Sun\";\n fn = LiteratureNames.BrighterThanTheSun;\n txt =\n \"When people think about the corporations that dominate the East, they typically think of KuaiGong International, which \" +\n \"holds a complete monopoly for manufacturing and commerce in Asia, or Global Pharmaceuticals, the world's largest \" +\n \"drug company, or OmniTek Incorporated, the global leader in intelligent and autonomous robots. But there's one company \" +\n \"that has seen a rapid rise in the last year and is poised to dominate not only the East, but the entire world: TaiYang Digital.<br><br>\" +\n \"TaiYang Digital is a Chinese internet-technology corporation that provides services such as \" +\n \"online advertising, search engines, gaming, media, entertainment, and cloud computing/storage. Its name TaiYang comes from the Chinese word \" +\n \"for 'sun'. In Chinese culture, the sun is a 'yang' symbol \" +\n \"associated with life, heat, masculinity, and heaven.<br><br>\" +\n \"The company was founded \" +\n \"less than 5 years ago and is already the third highest valued company in all of Asia. In 2076 it generated a total revenue of \" +\n \"over 10 trillion yuan. It's services are used daily by over a billion people worldwide.<br><br>\" +\n \"TaiYang Digital's meteoric rise is extremely surprising in modern society. This sort of growth is \" +\n \"something you'd commonly see in the first half of the century, especially for tech companies. However in \" +\n \"the last two decades the number of corporations has significantly declined as the largest entities \" +\n \"quickly took over the economy. Corporations such as ECorp, MegaCorp, and KuaiGong have established \" +\n \"such strong monopolies in their market sectors that they have effectively killed off all \" +\n \"of the smaller and new corporations that have tried to start up over the years. This is what makes \" +\n \"the rise of TaiYang Digital so impressive. And if TaiYang continues down this path, then they have \" +\n \"a bright future ahead of them.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Democracy is Dead: The Fall of an Empire\";\n fn = LiteratureNames.DemocracyIsDead;\n txt =\n \"They rose from the shadows in the street.<br>From the places where the oppressed meet.<br>\" +\n \"Their cries echoed loudly through the air.<br>As they once did in Tiananmen Square.<br>\" +\n \"Loudness in the silence, Darkness in the light.<br>They came forth with power and might.<br>\" +\n \"Once the beacon of democracy, America was first.<br>Its pillars of society destroyed and dispersed.<br>\" +\n \"Soon the cries rose everywhere, with revolt and riot.<br>Until one day, finally, all was quiet.<br>\" +\n \"From the ashes rose a new order, corporatocracy was its name.<br>\" +\n \"Rome, Mongol, Byzantine, all of history is just the same.<br>\" +\n \"For man will never change in a fundamental way.<br>\" +\n \"And now democracy is dead, in the USA.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Figures Show Rising Crime Rates in Sector-12\";\n fn = LiteratureNames.Sector12Crime;\n txt =\n \"A recent study by analytics company Wilson Inc. shows a significant rise \" +\n \"in criminal activity in Sector-12. Perhaps the most alarming part of the statistic \" +\n \"is that most of the rise is in violent crime such as homicide and assault. According \" +\n \"to the study, the city saw a total of 21,406 reported homicides in 2076, which is over \" +\n \"a 20% increase compared to 2075.<br><br>\" +\n \"CIA director David Glarow says its too early to know \" +\n \"whether these figures indicate the beginning of a sustained increase in crime rates, or whether \" +\n \"the year was just an unfortunate outlier. He states that many intelligence and law enforcement \" +\n \"agents have noticed an increase in organized crime activites, and believes that these figures may \" +\n \"be the result of an uprising from criminal organizations such as The Syndicate or the Slum Snakes.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Man and the Machine\";\n fn = LiteratureNames.ManAndMachine;\n txt =\n \"In 2005 Ray Kurzweil popularized his theory of the Singularity. He predicted that the rate \" +\n \"of technological advancement would continue to accelerate faster and faster until one day \" +\n \"machines would be become infinitely more intelligent than humans. This point, called the \" +\n \"Singularity, would result in a drastic transformation of the world as we know it. He predicted \" +\n \"that the Singularity would arrive by 2045. \" +\n \"And yet here we are, more than three decades later, where most would agree that we have not \" +\n \"yet reached a point where computers and machines are vastly more intelligent than we are. So what gives?<br><br>\" +\n \"The answer is that we have reached the Singularity, just not in the way we expected. The artifical superintelligence \" +\n \"that was predicted by Kurzweil and others exists in the world today - in the form of Augmentations. \" +\n \"Yes, those Augmentations that the rich and powerful keep to themselves enable humans \" +\n \"to become superintelligent beings. The Singularity did not lead to a world where \" +\n \"our machines are infinitely more intelligent than us, it led to a world \" +\n \"where man and machine can merge to become something greater. Most of the world just doesn't \" +\n \"know it yet.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Secret Societies\";\n fn = LiteratureNames.SecretSocieties;\n txt =\n \"The idea of secret societies has long intrigued the general public by inspiring curiosity, fascination, and \" +\n \"distrust. People have long wondered about who these secret society members are and what they do, with the \" +\n \"most radical of conspiracy theorists claiming that they control everything in the entire world. And while the world \" +\n \"may never know for sure, it is likely that many secret societies do actually exist, even today.<br><br>\" +\n \"However, the secret societies of the modern world are nothing like those that (supposedly) existed \" +\n \"decades and centuries ago. The Freemasons, Knights Templar, and Illuminati, while they may have been around \" +\n \"at the turn of the 21st century, almost assuredly do not exist today. The dominance of the Web in \" +\n \"our everyday lives and the fact that so much of the world is now digital has given rise to a new breed \" +\n \"of secret societies: Internet-based ones.<br><br>\" +\n \"Commonly called 'hacker groups', Internet-based secret societies have become well-known in today's \" +\n \"world. Some of these, such as The Black Hand, are black hat groups that claim they are trying to \" +\n \"help the oppressed by attacking the elite and powerful. Others, such as NiteSec, are hacktivist groups \" +\n \"that try to push political and social agendas. Perhaps the most intriguing hacker group \" +\n \"is the mysterious Bitrunners, whose purpose still remains unknown.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Space: The Failed Frontier\";\n fn = LiteratureNames.TheFailedFrontier;\n txt =\n \"Humans have long dreamed about spaceflight. With enduring interest, we were driven to explore \" +\n \"the unknown and discover new worlds. We dreamed about conquering the stars. And in our quest, \" +\n \"we pushed the boundaries of our scientific limits, and then pushed further. Space exploration \" +\n \"lead to the development of many important technologies and new industries.<br><br>\" +\n \"But sometime in the middle of the 21st century, all of that changed. Humanity lost its ambitions and \" +\n \"aspirations of exploring the cosmos. The once-large funding for agencies like NASA and the European \" +\n \"Space Agency gradually whittled away until their eventual disbanding in the 2060's. Not even \" +\n \"militaries are fielding flights into space nowadays. The only remnants of the once great mission for cosmic \" +\n \"conquest are the countless satellites in near-earth orbit, used for communications, espionage, \" +\n \"and other corporate interests.<br><br>\" +\n \"And as we continue to look at the state of space technology, it becomes more and \" +\n \"more apparent that we will never return to that golden age of space exploration, that \" +\n \"age where everyone dreamed of going beyond earth for the sake of discovery.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Coded Intelligence: Myth or Reality?\";\n fn = LiteratureNames.CodedIntelligence;\n txt =\n \"Tremendous progress has been made in the field of Artificial Intelligence over the past few decades. \" +\n \"Our autonomous vehicles and transportation systems. The electronic personal assistants that control our everyday lives. \" +\n \"Medical, service, and manufacturing robots. All of these are examples of how far AI has come and how much it has \" +\n \"improved our daily lives. However, the question still remains of whether AI will ever be advanced enough to re-create \" +\n \"human intelligence.<br><br>\" +\n \"We've certainly come close to artificial intelligence that is similar to humans. For example OmniTek Incorporated's \" +\n \"CompanionBot, a robot meant to act as a comforting friend for lonely and grieving people, is eerily human-like \" +\n \"in its appearance, speech, mannerisms, and even movement. However its artificial intelligence isn't the same as \" +\n \"that of humans. Not yet. It doesn't have sentience or self-awareness or consciousness.<br><br>\" +\n \"Many neuroscientists believe that we won't ever reach the point of creating artificial human intelligence. 'At the end of the \" +\n \"the day, AI comes down to 1's and 0's, while the human brain does not. We'll never see AI that is identical to that of \" +\n \"humans.'\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Synthetic Muscles\";\n fn = LiteratureNames.SyntheticMuscles;\n txt =\n \"Initial versions of synthetic muscles weren't made of anything organic but were actually \" +\n \"crude devices made to mimic human muscle function. Some of the early iterations were actually made of \" +\n \"common materials such as fishing lines and sewing threads due to their high strength for \" +\n \"a cheap cost.<br><br>\" +\n \"As technology progressed, however, advances in biomedical engineering paved the way for a new method of \" +\n \"creating synthetic muscles. Instead of creating something that closely imitated the functionality \" +\n \"of human muscle, scientists discovered a way of forcing the human body itself to augment its own \" +\n \"muscle tissue using both synthetic and organic materials. This is typically done using gene therapy \" +\n \"or chemical injections.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Tensions rise in global tech race\";\n fn = LiteratureNames.TensionsInTechRace;\n txt =\n \"Have we entered a new Cold War? Is WWIII just beyond the horizon?<br><br>\" +\n \"After rumors came out that OmniTek Incorporated had begun developing advanced robotic supersoldiers, \" +\n \"geopolitical tensions quickly flared between the USA, Russia, and several Asian superpowers. \" +\n \"In a rare show of cooperation between corporations, MegaCorp and ECorp have \" +\n \"reportedly launched hundreds of new surveillance and espionage satellites. \" +\n \"Defense contractors such as \" +\n \"DeltaOne and AeroCorp have been working with the CIA and NSA to prepare \" +\n \"for conflict. Meanwhile, the rest of the world sits in earnest \" +\n \"hoping that it never reaches full-scale war. With today's technology \" +\n \"and firepower, a World War would assuredly mean the end of human civilization.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Cost of Immortality\";\n fn = LiteratureNames.CostOfImmortality;\n txt =\n \"Evolution and advances in medical and augmentation technology has lead to drastic improvements \" +\n \"in human mortality rates. Recent figures show that the life expectancy for humans \" +\n \"that live in a first-world country is about 130 years of age, almost double of what it was \" +\n \"at the turn of the century. However, this increase in average lifespan has had some \" +\n \"significant effects on society and culture.<br><br>\" +\n \"Due to longer lifespans and a better quality of life, many adults are holding \" +\n \"off on having kids until much later. As a result, the percentage of youth in \" +\n \"first-world countries has been decreasing, while the number \" +\n \"of senior citizens is significantly increasing.<br><br>\" +\n \"Perhaps the most alarming result of all of this is the rapidly shrinking workforce. \" +\n \"Despite the increase in life expectancy, the typical retirement age for \" +\n \"workers in America has remained about the same, meaning a larger and larger \" +\n \"percentage of people in America are retirees. Furthermore, many \" +\n \"young adults are holding off on joining the workforce because they feel that \" +\n \"they have plenty of time left in their lives for employment, and want to \" +\n \"'enjoy life while they're young.' For most industries, this shrinking workforce \" +\n \"is not a major issue as most things are handled by robots anyways. However, \" +\n \"there are still several key industries such as engineering and education \" +\n \"that have not been automated, and these remain in danger to this cultural \" +\n \"phenomenon.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Hidden World\";\n fn = LiteratureNames.TheHiddenWorld;\n txt =\n \"WAKE UP SHEEPLE<br><br>\" +\n \"THE GOVERNMENT DOES NOT EXIST. CORPORATIONS DO NOT RUN SOCIETY<br><br>\" +\n \"THE ILLUMINATI ARE THE SECRET RULERS OF THE WORLD!<br><br>\" +\n \"Yes, the Illuminati of legends. The ancient secret society that controls the entire \" +\n \"world from the shadows with their invisible hand. The group of the rich and wealthy \" +\n \"that have penetrated every major government, financial agency, and corporation in the last \" +\n \"three hundred years.<br><br>\" +\n \"OPEN YOUR EYES<br><br>\" +\n \"It was the Illuminati that brought an end to democracy in the world. They are the driving force \" +\n \"behind everything that happens.<br><br>\" +\n \"THEY ARE ALL AROUND YOU<br><br>\" +\n \"After destabilizing the world's governments, they are now entering the final stage of their master plan. \" +\n \"They will secretly initiate global crises. Terrorism. Pandemics. World War. And out of the chaos \" +\n \"that ensues they will build their New World Order.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The New God\";\n fn = LiteratureNames.TheNewGod;\n txt =\n \"Everyone has a moment in their life when they wonder about the bigger questions.<br><br>\" +\n \"What's the point of all this? What is my purpose?<br><br>\" +\n \"Some people dare to think even bigger.<br><br>\" +\n \"What will the fate of the human race be?<br><br>\" +\n \"We live in an era vastly different from that of 15 or even 20 years ago. We have gone \" +\n \"beyond the limits of humanity. We have stripped ourselves of the tyranny of flesh.<br><br>\" +\n \"The Singularity is here. The merging of man and machine. This is where humanity evolves into \";\n \"something greater. This is our future.<br><br>\" + \"Embrace it, and you will obey a new god. The God in the Machine.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The New Triads\";\n fn = LiteratureNames.NewTriads;\n txt =\n \"The Triads were an ancient transnational crime syndicate based in China, Hong Kong, and other Asian \" +\n \"territories. They were often considered one of the first and biggest criminal secret societies. \" +\n \"While most of the branches of the Triads have been destroyed over the past few decades, the \" +\n \"crime faction has spawned and inspired a number of other Asian crime organizations over the past few years. \" +\n \"The most notable of these is the Tetrads.<br><br>\" +\n \"It is widely believed that the Tetrads are a rogue group that splintered off from the Triads sometime in the \" +\n \"mid 21st century. The founders of the Tetrads, all of whom were ex-Triad members, believed that the \" +\n \"Triads were losing their purpose and direction. The Tetrads started off as a small group that mainly engaged \" +\n \"in fraud and extortion. They were largely unknown until just a few years ago when they took over the illegal \" +\n \"drug trade in all of the major Asian cities. They quickly became the most powerful crime syndicate in the \" +\n \"continent.<br><br>\" +\n \"Not much else is known about the Tetrads, or about the efforts the Asian governments and corporations are making \" +\n \"to take down this large new crime organization. Many believe that the Tetrads have infiltrated the governments \" +\n \"and powerful corporations in Asia, which has helped faciliate their recent rapid rise.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Secret War\";\n fn = LiteratureNames.TheSecretWar;\n txt = \"\";\n Literatures[fn] = new Literature(title, fn, txt);\n})();\n","import { ITaskParams } from \"../ITaskParams\";\n/* tslint:disable:max-line-length */\n\n/**\n * Defines the parameters that can be used to initialize and describe a GangMemberTask\n * (defined in Gang.js)\n */\ninterface IGangMemberTaskMetadata {\n /**\n * Description of the task\n */\n desc: string;\n\n /**\n * Whether or not this task is meant for Combat-type gangs\n */\n isCombat: boolean;\n\n /**\n * Whether or not this task is for Hacking-type gangs\n */\n isHacking: boolean;\n\n /**\n * Name of the task\n */\n name: string;\n\n /**\n * An object containing weighting parameters for the task. These parameters are used for\n * various calculations (respect gain, wanted gain, etc.)\n */\n params: ITaskParams;\n}\n\n/**\n * Array of metadata for all Gang Member tasks. Used to construct the global GangMemberTask\n * objects in Gang.js\n */\nexport const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [\n {\n desc: \"This gang member is currently idle\",\n isCombat: true,\n isHacking: true,\n name: \"Unassigned\",\n params: { hackWeight: 100 }, // This is just to get by the weight check in the GangMemberTask constructor\n },\n {\n desc: \"Assign this gang member to create and distribute ransomware<br><br>Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Ransomware\",\n params: {\n baseRespect: 0.00005,\n baseWanted: 0.0001,\n baseMoney: 3,\n hackWeight: 100,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to attempt phishing scams and attacks<br><br>Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Phishing\",\n params: {\n baseRespect: 0.00008,\n baseWanted: 0.003,\n baseMoney: 7.5,\n hackWeight: 85,\n chaWeight: 15,\n difficulty: 3.5,\n },\n },\n {\n desc: \"Assign this gang member to attempt identity theft<br><br>Earns money - Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Identity Theft\",\n params: {\n baseRespect: 0.0001,\n baseWanted: 0.075,\n baseMoney: 18,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 5,\n },\n },\n {\n desc: \"Assign this gang member to carry out DDoS attacks<br><br>Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"DDoS Attacks\",\n params: {\n baseRespect: 0.0004,\n baseWanted: 0.2,\n hackWeight: 100,\n difficulty: 8,\n },\n },\n {\n desc: \"Assign this gang member to create and distribute malicious viruses<br><br>Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Plant Virus\",\n params: {\n baseRespect: 0.0006,\n baseWanted: 0.4,\n hackWeight: 100,\n difficulty: 12,\n },\n },\n {\n desc: \"Assign this gang member to commit financial fraud and digital counterfeiting<br><br>Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Fraud & Counterfeiting\",\n params: {\n baseRespect: 0.0004,\n baseWanted: 0.3,\n baseMoney: 45,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 20,\n },\n },\n {\n desc: \"Assign this gang member to launder money<br><br>Earns money - Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Money Laundering\",\n params: {\n baseRespect: 0.001,\n baseWanted: 1.25,\n baseMoney: 360,\n hackWeight: 75,\n chaWeight: 25,\n difficulty: 25,\n },\n },\n {\n desc: \"Assign this gang member to commit acts of cyberterrorism<br><br>Greatly increases respect - Greatly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Cyberterrorism\",\n params: {\n baseRespect: 0.01,\n baseWanted: 6,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 36,\n },\n },\n {\n desc: \"Assign this gang member to be an ethical hacker for corporations<br><br>Earns money - Lowers wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Ethical Hacking\",\n params: {\n baseWanted: -0.001,\n baseMoney: 3,\n hackWeight: 90,\n chaWeight: 10,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to mug random people on the streets<br><br>Earns money - Slightly increases respect - Very slightly increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Mug People\",\n params: {\n baseRespect: 0.00005,\n baseWanted: 0.00005,\n baseMoney: 3.6,\n strWeight: 25,\n defWeight: 25,\n dexWeight: 25,\n agiWeight: 10,\n chaWeight: 15,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to sell drugs<br><br>Earns money - Slightly increases respect - Slightly increases wanted level - Scales slightly with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Deal Drugs\",\n params: {\n baseRespect: 0.00006,\n baseWanted: 0.002,\n baseMoney: 15,\n agiWeight: 20,\n dexWeight: 20,\n chaWeight: 60,\n difficulty: 3.5,\n territory: {\n money: 1.2,\n respect: 1,\n wanted: 1.15,\n },\n },\n },\n {\n desc: \"Assign this gang member to extort civilians in your territory<br><br>Earns money - Slightly increases respect - Increases wanted - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Strongarm Civilians\",\n params: {\n baseRespect: 0.00004,\n baseWanted: 0.02,\n baseMoney: 7.5,\n hackWeight: 10,\n strWeight: 25,\n defWeight: 25,\n dexWeight: 20,\n agiWeight: 10,\n chaWeight: 10,\n difficulty: 5,\n territory: {\n money: 1.6,\n respect: 1.1,\n wanted: 1.5,\n },\n },\n },\n {\n desc: \"Assign this gang member to run cons<br><br>Earns money - Increases respect - Increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Run a Con\",\n params: {\n baseRespect: 0.00012,\n baseWanted: 0.05,\n baseMoney: 45,\n strWeight: 5,\n defWeight: 5,\n agiWeight: 25,\n dexWeight: 25,\n chaWeight: 40,\n difficulty: 14,\n },\n },\n {\n desc: \"Assign this gang member to commit armed robbery on stores, banks and armored cars<br><br>Earns money - Increases respect - Increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Armed Robbery\",\n params: {\n baseRespect: 0.00014,\n baseWanted: 0.1,\n baseMoney: 114,\n hackWeight: 20,\n strWeight: 15,\n defWeight: 15,\n agiWeight: 10,\n dexWeight: 20,\n chaWeight: 20,\n difficulty: 20,\n },\n },\n {\n desc: \"Assign this gang member to traffick illegal arms<br><br>Earns money - Increases respect - Increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Traffick Illegal Arms\",\n params: {\n baseRespect: 0.0002,\n baseWanted: 0.24,\n baseMoney: 174,\n hackWeight: 15,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n chaWeight: 25,\n difficulty: 32,\n territory: {\n money: 1.4,\n respect: 1.3,\n wanted: 1.25,\n },\n },\n },\n {\n desc: \"Assign this gang member to threaten and black mail high-profile targets<br><br>Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Threaten & Blackmail\",\n params: {\n baseRespect: 0.0002,\n baseWanted: 0.125,\n baseMoney: 72,\n hackWeight: 25,\n strWeight: 25,\n dexWeight: 25,\n chaWeight: 25,\n difficulty: 28,\n },\n },\n {\n desc: \"Assign this gang member to engage in human trafficking operations<br><br>Earns money - Increases respect - Increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Human Trafficking\",\n params: {\n baseRespect: 0.004,\n baseWanted: 1.25,\n baseMoney: 360,\n hackWeight: 30,\n strWeight: 5,\n defWeight: 5,\n dexWeight: 30,\n chaWeight: 30,\n difficulty: 36,\n territory: {\n money: 1.5,\n respect: 1.5,\n wanted: 1.6,\n },\n },\n },\n {\n desc: \"Assign this gang member to commit acts of terrorism<br><br>Greatly increases respect - Greatly increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Terrorism\",\n params: {\n baseRespect: 0.01,\n baseWanted: 6,\n hackWeight: 20,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n chaWeight: 20,\n difficulty: 36,\n territory: {\n money: 1,\n respect: 2,\n wanted: 2,\n },\n },\n },\n {\n desc: \"Assign this gang member to be a vigilante and protect the city from criminals<br><br>Decreases wanted level\",\n isCombat: true,\n isHacking: true,\n name: \"Vigilante Justice\",\n params: {\n baseWanted: -0.001,\n hackWeight: 20,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n agiWeight: 20,\n difficulty: 1,\n territory: {\n money: 1,\n respect: 1,\n wanted: 0.9, // Gets harder with more territory\n },\n },\n },\n {\n desc: \"Assign this gang member to increase their combat stats (str, def, dex, agi)\",\n isCombat: true,\n isHacking: true,\n name: \"Train Combat\",\n params: {\n strWeight: 25,\n defWeight: 25,\n dexWeight: 25,\n agiWeight: 25,\n difficulty: 100,\n },\n },\n {\n desc: \"Assign this gang member to train their hacking skills\",\n isCombat: true,\n isHacking: true,\n name: \"Train Hacking\",\n params: { hackWeight: 100, difficulty: 45 },\n },\n {\n desc: \"Assign this gang member to train their charisma\",\n isCombat: true,\n isHacking: true,\n name: \"Train Charisma\",\n params: { chaWeight: 100, difficulty: 8 },\n },\n {\n desc: \"Assign this gang member to engage in territorial warfare with other gangs. Members assigned to this task will help increase your gang's territory and will defend your territory from being taken.\",\n isCombat: true,\n isHacking: true,\n name: \"Territory Warfare\",\n params: {\n hackWeight: 15,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n agiWeight: 20,\n chaWeight: 5,\n difficulty: 5,\n },\n },\n];\n","import { GangMemberTask } from \"./GangMemberTask\";\nimport { GangMemberTasks } from \"./GangMemberTasks\";\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\nimport { GangMemberUpgrades } from \"./GangMemberUpgrades\";\nimport { IAscensionResult } from \"./IAscensionResult\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IGang } from \"./IGang\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport {\n calculateRespectGain,\n calculateMoneyGain,\n calculateWantedLevelGain,\n calculateAscensionMult,\n calculateAscensionPointsGain,\n} from \"./formulas/formulas\";\n\ninterface IMults {\n hack: number;\n str: number;\n def: number;\n dex: number;\n agi: number;\n cha: number;\n}\n\nexport class GangMember {\n name: string;\n task = \"Unassigned\";\n\n earnedRespect = 0;\n\n hack = 1;\n str = 1;\n def = 1;\n dex = 1;\n agi = 1;\n cha = 1;\n\n hack_exp = 0;\n str_exp = 0;\n def_exp = 0;\n dex_exp = 0;\n agi_exp = 0;\n cha_exp = 0;\n\n hack_mult = 1;\n str_mult = 1;\n def_mult = 1;\n dex_mult = 1;\n agi_mult = 1;\n cha_mult = 1;\n\n hack_asc_points = 0;\n str_asc_points = 0;\n def_asc_points = 0;\n dex_asc_points = 0;\n agi_asc_points = 0;\n cha_asc_points = 0;\n\n upgrades: string[] = []; // Names of upgrades\n augmentations: string[] = []; // Names of augmentations only\n\n constructor(name = \"\") {\n this.name = name;\n }\n\n calculateSkill(exp: number, mult = 1): number {\n return Math.max(Math.floor(mult * (32 * Math.log(exp + 534.5) - 200)), 1);\n }\n\n calculateAscensionMult(points: number): number {\n return calculateAscensionMult(points);\n }\n\n updateSkillLevels(): void {\n this.hack = this.calculateSkill(this.hack_exp, this.hack_mult * this.calculateAscensionMult(this.hack_asc_points));\n this.str = this.calculateSkill(this.str_exp, this.str_mult * this.calculateAscensionMult(this.str_asc_points));\n this.def = this.calculateSkill(this.def_exp, this.def_mult * this.calculateAscensionMult(this.def_asc_points));\n this.dex = this.calculateSkill(this.dex_exp, this.dex_mult * this.calculateAscensionMult(this.dex_asc_points));\n this.agi = this.calculateSkill(this.agi_exp, this.agi_mult * this.calculateAscensionMult(this.agi_asc_points));\n this.cha = this.calculateSkill(this.cha_exp, this.cha_mult * this.calculateAscensionMult(this.cha_asc_points));\n }\n\n calculatePower(): number {\n return (this.hack + this.str + this.def + this.dex + this.agi + this.cha) / 95;\n }\n\n assignToTask(taskName: string): boolean {\n if (!GangMemberTasks.hasOwnProperty(taskName)) {\n this.task = \"Unassigned\";\n return false;\n }\n this.task = taskName;\n return true;\n }\n\n unassignFromTask(): void {\n this.task = \"Unassigned\";\n }\n\n getTask(): GangMemberTask {\n // TODO(hydroflame): transfer that to a save file migration function\n // Backwards compatibility\n if ((this.task as any) instanceof GangMemberTask) {\n this.task = (this.task as any).name;\n }\n\n if (GangMemberTasks.hasOwnProperty(this.task)) {\n return GangMemberTasks[this.task];\n }\n return GangMemberTasks[\"Unassigned\"];\n }\n\n calculateRespectGain(gang: IGang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateRespectGain(g, this, task);\n }\n\n calculateWantedLevelGain(gang: IGang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateWantedLevelGain(g, this, task);\n }\n\n calculateMoneyGain(gang: IGang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateMoneyGain(g, this, task);\n }\n\n expMult(): IMults {\n return {\n hack: (this.hack_mult - 1) / 4 + 1,\n str: (this.str_mult - 1) / 4 + 1,\n def: (this.def_mult - 1) / 4 + 1,\n dex: (this.dex_mult - 1) / 4 + 1,\n agi: (this.agi_mult - 1) / 4 + 1,\n cha: (this.cha_mult - 1) / 4 + 1,\n };\n }\n\n gainExperience(numCycles = 1): void {\n const task = this.getTask();\n if (task === GangMemberTasks[\"Unassigned\"]) return;\n const difficultyMult = Math.pow(task.difficulty, 0.9);\n const difficultyPerCycles = difficultyMult * numCycles;\n const weightDivisor = 1500;\n const expMult = this.expMult();\n this.hack_exp +=\n (task.hackWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.hack *\n this.calculateAscensionMult(this.hack_asc_points);\n this.str_exp +=\n (task.strWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.str *\n this.calculateAscensionMult(this.str_asc_points);\n this.def_exp +=\n (task.defWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.def *\n this.calculateAscensionMult(this.def_asc_points);\n this.dex_exp +=\n (task.dexWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.dex *\n this.calculateAscensionMult(this.dex_asc_points);\n this.agi_exp +=\n (task.agiWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.agi *\n this.calculateAscensionMult(this.agi_asc_points);\n this.cha_exp +=\n (task.chaWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.cha *\n this.calculateAscensionMult(this.cha_asc_points);\n }\n\n recordEarnedRespect(numCycles = 1, gang: IGang): void {\n this.earnedRespect += this.calculateRespectGain(gang) * numCycles;\n }\n\n getGainedAscensionPoints(): IMults {\n return {\n hack: calculateAscensionPointsGain(this.hack_exp),\n str: calculateAscensionPointsGain(this.str_exp),\n def: calculateAscensionPointsGain(this.def_exp),\n dex: calculateAscensionPointsGain(this.dex_exp),\n agi: calculateAscensionPointsGain(this.agi_exp),\n cha: calculateAscensionPointsGain(this.cha_exp),\n };\n }\n\n canAscend(): boolean {\n const points = this.getGainedAscensionPoints();\n return points.hack > 0 || points.str > 0 || points.def > 0 || points.dex > 0 || points.agi > 0 || points.cha > 0;\n }\n\n getCurrentAscensionMults(): IMults {\n return {\n hack: this.calculateAscensionMult(this.hack_asc_points),\n str: this.calculateAscensionMult(this.str_asc_points),\n def: this.calculateAscensionMult(this.def_asc_points),\n dex: this.calculateAscensionMult(this.dex_asc_points),\n agi: this.calculateAscensionMult(this.agi_asc_points),\n cha: this.calculateAscensionMult(this.cha_asc_points),\n };\n }\n\n getAscensionMultsAfterAscend(): IMults {\n const points = this.getGainedAscensionPoints();\n return {\n hack: this.calculateAscensionMult(this.hack_asc_points + points.hack),\n str: this.calculateAscensionMult(this.str_asc_points + points.str),\n def: this.calculateAscensionMult(this.def_asc_points + points.def),\n dex: this.calculateAscensionMult(this.dex_asc_points + points.dex),\n agi: this.calculateAscensionMult(this.agi_asc_points + points.agi),\n cha: this.calculateAscensionMult(this.cha_asc_points + points.cha),\n };\n }\n\n getAscensionResults(): IMults {\n const postAscend = this.getAscensionMultsAfterAscend();\n const preAscend = this.getCurrentAscensionMults();\n\n return {\n hack: postAscend.hack / preAscend.hack,\n str: postAscend.str / preAscend.str,\n def: postAscend.def / preAscend.def,\n dex: postAscend.dex / preAscend.dex,\n agi: postAscend.agi / preAscend.agi,\n cha: postAscend.cha / preAscend.cha,\n };\n }\n\n ascend(): IAscensionResult {\n const res = this.getAscensionResults();\n const points = this.getGainedAscensionPoints();\n this.hack_asc_points += points.hack;\n this.str_asc_points += points.str;\n this.def_asc_points += points.def;\n this.dex_asc_points += points.dex;\n this.agi_asc_points += points.agi;\n this.cha_asc_points += points.cha;\n\n // Remove upgrades. Then re-calculate multipliers and stats\n this.upgrades.length = 0;\n this.hack_mult = 1;\n this.str_mult = 1;\n this.def_mult = 1;\n this.dex_mult = 1;\n this.agi_mult = 1;\n this.cha_mult = 1;\n for (let i = 0; i < this.augmentations.length; ++i) {\n const aug = GangMemberUpgrades[this.augmentations[i]];\n this.applyUpgrade(aug);\n }\n\n // Clear exp and recalculate stats\n this.hack_exp = 0;\n this.str_exp = 0;\n this.def_exp = 0;\n this.dex_exp = 0;\n this.agi_exp = 0;\n this.cha_exp = 0;\n this.updateSkillLevels();\n\n const respectToDeduct = this.earnedRespect;\n this.earnedRespect = 0;\n return {\n respect: respectToDeduct,\n hack: res.hack,\n str: res.str,\n def: res.def,\n dex: res.dex,\n agi: res.agi,\n cha: res.cha,\n };\n }\n\n applyUpgrade(upg: GangMemberUpgrade): void {\n if (upg.mults.str != null) this.str_mult *= upg.mults.str;\n if (upg.mults.def != null) this.def_mult *= upg.mults.def;\n if (upg.mults.dex != null) this.dex_mult *= upg.mults.dex;\n if (upg.mults.agi != null) this.agi_mult *= upg.mults.agi;\n if (upg.mults.cha != null) this.cha_mult *= upg.mults.cha;\n if (upg.mults.hack != null) this.hack_mult *= upg.mults.hack;\n }\n\n buyUpgrade(upg: GangMemberUpgrade, player: IPlayer, gang: IGang): boolean {\n // Prevent purchasing of already-owned upgrades\n if (this.augmentations.includes(upg.name) || this.upgrades.includes(upg.name)) return false;\n\n if (player.money < gang.getUpgradeCost(upg)) return false;\n player.loseMoney(gang.getUpgradeCost(upg), \"gang\");\n if (upg.type === \"g\") {\n this.augmentations.push(upg.name);\n } else {\n this.upgrades.push(upg.name);\n }\n this.applyUpgrade(upg);\n return true;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"GangMember\", this);\n }\n\n /**\n * Initiatizes a GangMember object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): GangMember {\n return Generic_fromJSON(GangMember, value.data);\n }\n}\n\nReviver.constructors.GangMember = GangMember;\n","import { IMults, UpgradeType } from \"./data/upgrades\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nexport class GangMemberUpgrade {\n name: string;\n cost: number;\n type: UpgradeType;\n desc: string;\n mults: IMults;\n\n constructor(name = \"\", cost = 0, type: UpgradeType = UpgradeType.Weapon, mults: IMults = {}) {\n this.name = name;\n this.cost = cost;\n this.type = type;\n this.mults = mults;\n\n this.desc = this.createDescription();\n }\n\n createDescription(): string {\n const lines = [\"Effects:\"];\n if (this.mults.str != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.str - 1, 0)} strength skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.str - 1) / 4, 2)} strength exp`);\n }\n if (this.mults.def != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.def - 1, 0)} defense skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.def - 1) / 4, 2)} defense exp`);\n }\n if (this.mults.dex != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.dex - 1, 0)} dexterity skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.dex - 1) / 4, 2)} dexterity exp`);\n }\n if (this.mults.agi != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.agi - 1, 0)} agility skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.agi - 1) / 4, 2)} agility exp`);\n }\n if (this.mults.cha != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.cha - 1, 0)} charisma skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.cha - 1) / 4, 2)} charisma exp`);\n }\n if (this.mults.hack != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.hack - 1, 0)} hacking skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.hack - 1) / 4, 2)} hacking exp`);\n }\n return lines.join(\"<br>\");\n }\n\n // User friendly version of type.\n getType(): string {\n switch (this.type) {\n case UpgradeType.Weapon:\n return \"Weapon\";\n case UpgradeType.Armor:\n return \"Armor\";\n case UpgradeType.Vehicle:\n return \"Vehicle\";\n case UpgradeType.Rootkit:\n return \"Rootkit\";\n case UpgradeType.Augmentation:\n return \"Augmentation\";\n default:\n return \"\";\n }\n }\n}\n","export const PowerMultiplier: {\n [key: string]: number | undefined;\n} = {\n \"Slum Snakes\": 1,\n Tetrads: 2,\n \"The Syndicate\": 2,\n \"The Dark Army\": 2,\n \"Speakers for the Dead\": 5,\n NiteSec: 2,\n \"The Black Hand\": 5,\n};\n","import * as posNames from \"./companypositionnames\";\nimport { IConstructorParams } from \"../Company\";\n\nimport { IMap } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\n// Create Objects containing Company Positions by category\n// Will help in metadata construction later\nconst AllSoftwarePositions: IMap<boolean> = {};\nconst AllITPositions: IMap<boolean> = {};\nconst AllNetworkEngineerPositions: IMap<boolean> = {};\nconst SecurityEngineerPositions: IMap<boolean> = {};\nconst AllTechnologyPositions: IMap<boolean> = {};\nconst AllBusinessPositions: IMap<boolean> = {};\nconst AllAgentPositions: IMap<boolean> = {};\nconst AllSecurityPositions: IMap<boolean> = {};\nconst AllSoftwareConsultantPositions: IMap<boolean> = {};\nconst AllBusinessConsultantPositions: IMap<boolean> = {};\nconst SoftwarePositionsUpToHeadOfEngineering: IMap<boolean> = {};\nconst SoftwarePositionsUpToLeadDeveloper: IMap<boolean> = {};\nconst BusinessPositionsUpToOperationsManager: IMap<boolean> = {};\nconst WaiterOnly: IMap<boolean> = {};\nconst EmployeeOnly: IMap<boolean> = {};\nconst PartTimeWaiterOnly: IMap<boolean> = {};\nconst PartTimeEmployeeOnly: IMap<boolean> = {};\nconst OperationsManagerOnly: IMap<boolean> = {};\nconst CEOOnly: IMap<boolean> = {};\n\nposNames.SoftwareCompanyPositions.forEach((e) => {\n AllSoftwarePositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nposNames.ITCompanyPositions.forEach((e) => {\n AllITPositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nposNames.NetworkEngineerCompanyPositions.forEach((e) => {\n AllNetworkEngineerPositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nAllTechnologyPositions[posNames.SecurityEngineerCompanyPositions[0]] = true;\nSecurityEngineerPositions[posNames.SecurityEngineerCompanyPositions[0]] = true;\n\nposNames.BusinessCompanyPositions.forEach((e) => {\n AllBusinessPositions[e] = true;\n});\n\nposNames.SecurityCompanyPositions.forEach((e) => {\n AllSecurityPositions[e] = true;\n});\n\nposNames.AgentCompanyPositions.forEach((e) => {\n AllAgentPositions[e] = true;\n});\n\nposNames.SoftwareConsultantCompanyPositions.forEach((e) => {\n AllSoftwareConsultantPositions[e] = true;\n});\n\nposNames.BusinessConsultantCompanyPositions.forEach((e) => {\n AllBusinessConsultantPositions[e] = true;\n});\n\nfor (let i = 0; i < posNames.SoftwareCompanyPositions.length; ++i) {\n const e = posNames.SoftwareCompanyPositions[i];\n if (i <= 5) {\n SoftwarePositionsUpToHeadOfEngineering[e] = true;\n }\n if (i <= 3) {\n SoftwarePositionsUpToLeadDeveloper[e] = true;\n }\n}\nfor (let i = 0; i < posNames.BusinessCompanyPositions.length; ++i) {\n const e = posNames.BusinessCompanyPositions[i];\n if (i <= 3) {\n BusinessPositionsUpToOperationsManager[e] = true;\n }\n}\n\nWaiterOnly[posNames.MiscCompanyPositions[0]] = true;\nEmployeeOnly[posNames.MiscCompanyPositions[1]] = true;\nPartTimeWaiterOnly[posNames.PartTimeCompanyPositions[0]] = true;\nPartTimeEmployeeOnly[posNames.PartTimeCompanyPositions[1]] = true;\nOperationsManagerOnly[posNames.BusinessCompanyPositions[3]] = true;\nCEOOnly[posNames.BusinessCompanyPositions[5]] = true;\n\n// Metadata\nexport const companiesMetadata: IConstructorParams[] = [\n {\n name: LocationName.AevumECorp,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 3,\n salaryMultiplier: 3,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.Sector12MegaCorp,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 3,\n salaryMultiplier: 3,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.AevumBachmanAndAssociates,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.6,\n salaryMultiplier: 2.6,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.Sector12BladeIndustries,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.75,\n salaryMultiplier: 2.75,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.VolhavenNWO,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.75,\n salaryMultiplier: 2.75,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.AevumClarkeIncorporated,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.25,\n salaryMultiplier: 2.25,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.VolhavenOmniTekIncorporated,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.25,\n salaryMultiplier: 2.25,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.Sector12FourSigma,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.5,\n salaryMultiplier: 2.5,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.ChongqingKuaiGongInternational,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.2,\n salaryMultiplier: 2.2,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.AevumFulcrumTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.IshimaStormTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllSoftwareConsultantPositions, AllBusinessPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoDefComm,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.75,\n salaryMultiplier: 1.75,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.VolhavenHeliosLabs,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoVitaLife,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12IcarusMicrosystems,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.9,\n salaryMultiplier: 1.9,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12UniversalEnergy,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.AevumGalacticCybersystems,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.9,\n salaryMultiplier: 1.9,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.AevumAeroCorp,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.VolhavenOmniaCybersystems,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.ChongqingSolarisSpaceSystems,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12DeltaOne,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.6,\n salaryMultiplier: 1.6,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllBusinessPositions,\n AllSoftwareConsultantPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.IshimaNovaMedical,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllBusinessPositions,\n AllSoftwareConsultantPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.75,\n salaryMultiplier: 1.75,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12CIA,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n SecurityEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n ),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 149,\n },\n {\n name: LocationName.Sector12NSA,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n SecurityEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n ),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 149,\n },\n {\n name: LocationName.AevumWatchdogSecurity,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n AllSoftwareConsultantPositions,\n ),\n expMultiplier: 1.5,\n salaryMultiplier: 1.5,\n jobStatReqOffset: 124,\n },\n {\n name: LocationName.VolhavenLexoCorp,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllSoftwareConsultantPositions,\n AllBusinessPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.4,\n salaryMultiplier: 1.4,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.AevumRhoConstruction,\n info: \"\",\n companyPositions: Object.assign({}, SoftwarePositionsUpToLeadDeveloper, BusinessPositionsUpToOperationsManager),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 49,\n },\n {\n name: LocationName.Sector12AlphaEnterprises,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToLeadDeveloper,\n BusinessPositionsUpToOperationsManager,\n AllSoftwareConsultantPositions,\n ),\n expMultiplier: 1.5,\n salaryMultiplier: 1.5,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.AevumPolice,\n info: \"\",\n companyPositions: Object.assign({}, AllSecurityPositions, SoftwarePositionsUpToLeadDeveloper),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.VolhavenSysCoreSecurities,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 124,\n },\n {\n name: LocationName.VolhavenCompuTek,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 74,\n },\n {\n name: LocationName.AevumNetLinkTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.Sector12CarmichaelSecurity,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllSoftwareConsultantPositions,\n AllAgentPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 74,\n },\n {\n name: LocationName.Sector12FoodNStuff,\n info: \"\",\n companyPositions: Object.assign({}, EmployeeOnly, PartTimeEmployeeOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n {\n name: LocationName.Sector12JoesGuns,\n info: \"\",\n companyPositions: Object.assign({}, EmployeeOnly, PartTimeEmployeeOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n {\n name: LocationName.IshimaOmegaSoftware,\n info: \"\",\n companyPositions: Object.assign({}, AllSoftwarePositions, AllSoftwareConsultantPositions, AllITPositions),\n expMultiplier: 1.1,\n salaryMultiplier: 1.1,\n jobStatReqOffset: 49,\n },\n {\n name: LocationName.NewTokyoNoodleBar,\n info: \"\",\n companyPositions: Object.assign({}, WaiterOnly, PartTimeWaiterOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n];\n","export interface IConstructorParams {\n name: string;\n cost: number;\n desc: string;\n advertisingMult?: number;\n employeeChaMult?: number;\n employeeCreMult?: number;\n employeeEffMult?: number;\n employeeIntMult?: number;\n productionMult?: number;\n productProductionMult?: number;\n salesMult?: number;\n sciResearchMult?: number;\n storageMult?: number;\n}\n\nexport class Research {\n // Name of research. This will be used to identify researches in the Research Tree\n name = \"\";\n\n // How much scientific research it costs to unlock this\n cost = 0;\n\n // Description of what the Research does\n desc = \"\";\n\n // All possible generic upgrades for the company, in the form of multipliers\n advertisingMult = 1;\n employeeChaMult = 1;\n employeeCreMult = 1;\n employeeEffMult = 1;\n employeeIntMult = 1;\n productionMult = 1;\n productProductionMult = 1;\n salesMult = 1;\n sciResearchMult = 1;\n storageMult = 1;\n\n constructor(p: IConstructorParams = { name: \"\", cost: 0, desc: \"\" }) {\n this.name = p.name;\n this.cost = p.cost;\n this.desc = p.desc;\n if (p.advertisingMult) {\n this.advertisingMult = p.advertisingMult;\n }\n if (p.employeeChaMult) {\n this.employeeChaMult = p.employeeChaMult;\n }\n if (p.employeeCreMult) {\n this.employeeCreMult = p.employeeCreMult;\n }\n if (p.employeeEffMult) {\n this.employeeEffMult = p.employeeEffMult;\n }\n if (p.employeeIntMult) {\n this.employeeIntMult = p.employeeIntMult;\n }\n if (p.productionMult) {\n this.productionMult = p.productionMult;\n }\n if (p.productProductionMult) {\n this.productProductionMult = p.productProductionMult;\n }\n if (p.salesMult) {\n this.salesMult = p.salesMult;\n }\n if (p.sciResearchMult) {\n this.sciResearchMult = p.sciResearchMult;\n }\n if (p.storageMult) {\n this.storageMult = p.storageMult;\n }\n }\n}\n","import { IConstructorParams } from \"../Research\";\n\nexport const researchMetadata: IConstructorParams[] = [\n {\n name: \"AutoBrew\",\n cost: 12e3,\n desc:\n \"Automatically keep your employees fully caffeinated with \" +\n \"coffee injections. This research will keep the energy of all \" +\n \"employees at its maximum possible value, for no cost. \" +\n \"This will also disable the Coffee upgrade.\",\n },\n {\n name: \"AutoPartyManager\",\n cost: 15e3,\n desc:\n \"Automatically analyzes your employees' happiness and morale \" +\n \"and boosts them whenever it detects a decrease. This research will \" +\n \"keep the morale and happiness of all employees at their maximum possible \" +\n \"values, for no cost. \" +\n \"This will also disable the 'Throw Party' feature.\",\n },\n {\n name: \"Automatic Drug Administration\",\n cost: 10e3,\n desc:\n \"Research how to automatically administer performance-enhacing drugs to all of \" +\n \"your employees. This unlocks Drug-related Research.\",\n },\n {\n name: \"Bulk Purchasing\",\n cost: 5e3,\n desc:\n \"Research the art of buying materials in bulk. This allows you to purchase \" +\n \"any amount of a material instantly.\",\n },\n {\n name: \"CPH4 Injections\",\n cost: 25e3,\n desc:\n \"Develop an advanced and harmless synthetic drug that is administered to \" +\n \"employees to increase all of their stats, except experience, by 10%.\",\n employeeCreMult: 1.1,\n employeeChaMult: 1.1,\n employeeEffMult: 1.1,\n employeeIntMult: 1.1,\n },\n {\n name: \"Drones\",\n cost: 5e3,\n desc:\n \"Acquire the knowledge needed to create advanced drones. This research does nothing \" +\n \"by itself, but unlocks other Drone-related research.\",\n },\n {\n name: \"Drones - Assembly\",\n cost: 25e3,\n desc:\n \"Manufacture and use Assembly Drones to improve the efficiency of \" +\n \"your production lines. This increases all production by 20%.\",\n productionMult: 1.2,\n },\n {\n name: \"Drones - Transport\",\n cost: 30e3,\n desc:\n \"Manufacture and use intelligent Transport Drones to optimize \" +\n \"your warehouses. This increases the storage space of all warehouses \" +\n \"by 50%.\",\n storageMult: 1.5,\n },\n {\n name: \"Go-Juice\",\n cost: 25e3,\n desc:\n \"Provide employees with Go-Juice, a coffee-derivative that further enhances \" +\n \"the brain's dopamine production. This increases the maximum energy of all \" +\n \"employees by 10.\",\n },\n {\n name: \"Hi-Tech R&D Laboratory\",\n cost: 5e3,\n desc:\n \"Construct a cutting edge facility dedicated to advanced research and \" +\n \"and development. This allows you to spend Scientific Research \" +\n \"on powerful upgrades. It also globally increases Scientific Research \" +\n \"production by 10%.\",\n sciResearchMult: 1.1,\n },\n {\n name: \"HRBuddy-Recruitment\",\n cost: 15e3,\n desc:\n \"Use automated software to handle the hiring of employees. With this \" +\n \"research, each office will automatically hire one employee per \" +\n \"market cycle if there is available space.\",\n },\n {\n name: \"HRBuddy-Training\",\n cost: 20e3,\n desc:\n \"Use automated software to handle the training of employees. With this \" +\n \"research, each employee hired with HRBuddy-Recruitment will automatically \" +\n \"be assigned to 'Training', rather than being unassigned.\",\n },\n {\n name: \"JoyWire\",\n cost: 20e3,\n desc: \"A brain implant which is installed in employees, increasing their \" + \"maximum happiness by 10.\",\n },\n {\n name: \"Market-TA.I\",\n cost: 20e3,\n desc:\n \"Develop advanced AI software that uses technical analysis to \" +\n \"help you understand and exploit the market. This research \" +\n \"allows you to know what price to sell your Materials/Products \" +\n \"at in order to avoid losing sales due to having too high of a mark-up. \" +\n \"It also lets you automatically use that sale price.\",\n },\n {\n name: \"Market-TA.II\",\n cost: 50e3,\n desc:\n \"Develop double-advanced AI software that uses technical analysis to \" +\n \"help you understand and exploit the market. This research \" +\n \"allows you to know how many sales of a Material/Product you lose or gain \" +\n \"from having too high or too low or a sale price. It also lets you automatically \" +\n \"set the sale price of your Materials/Products at the optimal price such that \" +\n \"the amount sold matches the amount produced.\",\n },\n {\n name: \"Overclock\",\n cost: 15e3,\n desc:\n \"Equip employees with a headset that uses transcranial direct current \" +\n \"stimulation (tDCS) to increase the speed of their neurotransmitters. \" +\n \"This research increases the intelligence and efficiency of all \" +\n \"employees by 25%.\",\n employeeEffMult: 1.25,\n employeeIntMult: 1.25,\n },\n {\n name: \"Self-Correcting Assemblers\",\n cost: 25e3,\n desc:\n \"Create assemblers that can be used for universal production. \" +\n \"These assemblers use deep learning to improve their efficiency \" +\n \"at their tasks. This research increases all production by 10%\",\n productionMult: 1.1,\n },\n {\n name: \"Sti.mu\",\n cost: 30e3,\n desc:\n \"Upgrade the tDCS headset to stimulate regions of the brain that \" +\n \"control confidence and enthusiasm. This research increases the max \" +\n \"morale of all employees by 10.\",\n },\n {\n name: \"sudo.Assist\",\n cost: 15e3,\n desc: \"Develop a virtual assistant AI to handle and manage administrative \" + \"issues for your corporation.\",\n },\n {\n name: \"uPgrade: Capacity.I\",\n cost: 20e3,\n desc:\n \"Expand the industry's capacity for designing and manufacturing its \" +\n \"various products. This increases the industry's maximum number of products \" +\n \"by 1 (from 3 to 4).\",\n },\n {\n name: \"uPgrade: Capacity.II\",\n cost: 30e3,\n desc:\n \"Expand the industry's capacity for designing and manufacturing its \" +\n \"various products. This increases the industry's maximum number of products \" +\n \"by 1 (from 4 to 5).\",\n },\n {\n name: \"uPgrade: Dashboard\",\n cost: 5e3,\n desc:\n \"Improve the software used to manage the industry's production line \" +\n \"for its various products. This allows you to manage the production and \" +\n \"sale of a product before it's finished being designed.\",\n },\n {\n name: \"uPgrade: Fulcrum\",\n cost: 10e3,\n desc:\n \"Streamline the manufacturing of this industry's various products. \" +\n \"This research increases the production of your products by 5%\",\n productProductionMult: 1.05,\n },\n];\n","/**\n * Object representing an upgrade that can be purchased with hashes\n */\nexport interface IConstructorParams {\n cost?: number;\n costPerLevel: number;\n desc: string;\n hasTargetServer?: boolean;\n name: string;\n value: number;\n effectText?: (level: number) => JSX.Element | null;\n}\n\nexport class HashUpgrade {\n /**\n * If the upgrade has a flat cost (never increases), it goes here\n * Otherwise, this property should be undefined\n *\n * This property overrides the 'costPerLevel' property\n */\n cost?: number;\n\n /**\n * Base cost for this upgrade. Every time the upgrade is purchased,\n * its cost increases by this same amount (so its 1x, 2x, 3x, 4x, etc.)\n */\n costPerLevel = 0;\n\n /**\n * Description of what the upgrade does\n */\n desc = \"\";\n\n /**\n * Boolean indicating that this upgrade's effect affects a single server,\n * the \"target\" server\n */\n hasTargetServer = false;\n\n // Name of upgrade\n name = \"\";\n\n // Generic value used to indicate the potency/amount of this upgrade's effect\n // The meaning varies between different upgrades\n value = 0;\n\n constructor(p: IConstructorParams) {\n if (p.cost != null) {\n this.cost = p.cost;\n }\n if (p.effectText != null) {\n this.effectText = p.effectText;\n }\n\n this.costPerLevel = p.costPerLevel;\n this.desc = p.desc;\n this.hasTargetServer = p.hasTargetServer ? p.hasTargetServer : false;\n this.name = p.name;\n this.value = p.value;\n }\n\n // Functions that returns the UI element to display the effect of this upgrade.\n effectText: (level: number) => JSX.Element | null = () => null;\n\n getCost(levels: number): number {\n if (typeof this.cost === \"number\") {\n return this.cost;\n }\n\n return Math.round((levels + 1) * this.costPerLevel);\n }\n}\n","// Metadata used to construct all Hash Upgrades\nimport React from \"react\";\nimport { IConstructorParams } from \"../HashUpgrade\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\n\nexport const HashUpgradesMetadata: IConstructorParams[] = [\n {\n cost: 4,\n costPerLevel: 4,\n desc: \"Sell hashes for $1m\",\n name: \"Sell for Money\",\n effectText: (level: number): JSX.Element | null => (\n <>\n Sold for <Money money={1e6 * level} />\n </>\n ),\n value: 1e6,\n },\n {\n costPerLevel: 100,\n desc: \"Sell hashes for $1b in Corporation funds\",\n name: \"Sell for Corporation Funds\",\n effectText: (level: number): JSX.Element | null => (\n <>\n Sold for <Money money={1e9 * level} /> Corporation funds.\n </>\n ),\n value: 1e9,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to decrease the minimum security of a single server by 2%. \" +\n \"Note that a server's minimum security cannot go below 1. This effect persists \" +\n \"until you install Augmentations (since servers are reset at that time).\",\n hasTargetServer: true,\n name: \"Reduce Minimum Security\",\n value: 0.98,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to increase the maximum amount of money on a single server by 2%. \" +\n \"This effect persists until you install Augmentations (since servers \" +\n \"are reset at that time).\",\n hasTargetServer: true,\n name: \"Increase Maximum Money\",\n value: 1.02,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to improve the experience earned when studying at a university by 20%. \" +\n \"This effect persists until you install Augmentations\",\n name: \"Improve Studying\",\n effectText: (level: number): JSX.Element | null => <>Improves studying by {level * 20}%</>,\n value: 20, // Improves studying by value%\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to improve the experience earned when training at the gym by 20%. This effect \" +\n \"persists until you install Augmentations\",\n name: \"Improve Gym Training\",\n effectText: (level: number): JSX.Element | null => <>Improves training by {level * 20}%</>,\n value: 20, // Improves training by value%\n },\n {\n costPerLevel: 200,\n desc: \"Exchange hashes for 1k Scientific Research in all of your Corporation's Industries\",\n name: \"Exchange for Corporation Research\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {level}k Scientific Research in your industries.</>\n ),\n value: 1000,\n },\n {\n costPerLevel: 250,\n desc: \"Exchange hashes for 100 Bladeburner Rank\",\n name: \"Exchange for Bladeburner Rank\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {numeralWrapper.format(100 * level, \"0a\")} Bladeburner rank</>\n ),\n value: 100,\n },\n {\n costPerLevel: 250,\n desc: \"Exchanges hashes for 10 Bladeburner Skill Points\",\n name: \"Exchange for Bladeburner SP\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {numeralWrapper.format(10 * level, \"0a\")} Bladeburner Skill Points</>\n ),\n value: 10,\n },\n {\n costPerLevel: 200,\n desc: \"Generate a random Coding Contract somewhere on the network\",\n name: \"Generate Coding Contract\",\n effectText: (level: number): JSX.Element | null => <>Generated {level} contracts.</>,\n value: 1,\n },\n];\n","/**\n * The environment in which a script runs. The environment holds\n * Netscript functions and arguments for that script.\n */\nimport { IMap } from \"../types\";\n\nexport class Environment {\n /**\n * Parent environment. Used to implement \"scope\"\n */\n parent: Environment | null = null;\n\n /**\n * Whether or not the script that uses this Environment should stop running\n */\n stopFlag = false;\n\n /**\n * Environment variables (currently only Netscript functions)\n */\n vars: IMap<any> = {};\n\n constructor(parent: Environment | null) {\n if (parent instanceof Environment) {\n this.vars = Object.assign({}, parent.vars);\n }\n\n this.parent = parent;\n }\n\n /**\n * Finds the scope where the variable with the given name is defined\n */\n lookup(name: string): Environment | null {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let scope: Environment | null = this;\n while (scope) {\n if (Object.prototype.hasOwnProperty.call(scope.vars, name)) {\n return scope;\n }\n scope = scope.parent;\n }\n\n return null;\n }\n\n //Get the current value of a variable\n get(name: string): any {\n if (name in this.vars) {\n return this.vars[name];\n }\n\n throw new Error(`Undefined variable ${name}`);\n }\n\n //Sets the value of a variable in any scope\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n set(name: string, value: any): any {\n const scope = this.lookup(name);\n\n //If scope has a value, then this variable is already set in a higher scope, so\n //set is there. Otherwise, create a new variable in the local scope\n if (scope !== null) {\n return (scope.vars[name] = value);\n } else {\n return (this.vars[name] = value);\n }\n }\n\n //Creates (or overwrites) a variable in the current scope\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n def(name: string, value: any): any {\n return (this.vars[name] = value);\n }\n}\n","/**\n * Determines if the number is a power of 2\n * @param n The number to check.\n */\nexport function isPowerOfTwo(n: number): boolean {\n if (isNaN(n)) {\n return false;\n }\n\n if (n === 0) {\n return false;\n }\n\n // Disabiling the bitwise rule because it's honestly the most effecient way to check for this.\n // tslint:disable-next-line:no-bitwise\n return (n & (n - 1)) === 0;\n}\n","/**\n * Initialization metadata for all Stocks. This is used to generate the\n * stock parameter values upon a reset\n *\n * Some notes:\n * - Megacorporations have better otlkMags\n * - Higher volatility -> Bigger spread\n * - Lower price -> Bigger spread\n * - Share tx required for movement used for balancing\n */\nimport { StockSymbols } from \"./StockSymbols\";\nimport { IConstructorParams } from \"../Stock\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nexport const InitStockMetadata: IConstructorParams[] = [\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 17e3,\n },\n marketCap: 2.4e12,\n mv: {\n divisor: 100,\n max: 50,\n min: 40,\n },\n name: LocationName.AevumECorp,\n otlkMag: 19,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumECorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 34e3,\n min: 24e3,\n },\n marketCap: 2.4e12,\n mv: {\n divisor: 100,\n max: 50,\n min: 40,\n },\n name: LocationName.Sector12MegaCorp,\n otlkMag: 19,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12MegaCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 12e3,\n },\n marketCap: 1.6e12,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.Sector12BladeIndustries,\n otlkMag: 13,\n spreadPerc: {\n divisor: 10,\n max: 6,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12BladeIndustries],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 10e3,\n },\n marketCap: 1.5e12,\n mv: {\n divisor: 100,\n max: 75,\n min: 65,\n },\n name: LocationName.AevumClarkeIncorporated,\n otlkMag: 12,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumClarkeIncorporated],\n },\n\n {\n b: true,\n initPrice: {\n max: 43e3,\n min: 32e3,\n },\n marketCap: 1.8e12,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.VolhavenOmniTekIncorporated,\n otlkMag: 12,\n spreadPerc: {\n divisor: 10,\n max: 6,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.VolhavenOmniTekIncorporated],\n },\n\n {\n b: true,\n initPrice: {\n max: 80e3,\n min: 50e3,\n },\n marketCap: 2e12,\n mv: {\n divisor: 100,\n max: 110,\n min: 100,\n },\n name: LocationName.Sector12FourSigma,\n otlkMag: 17,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12FourSigma],\n },\n\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 16e3,\n },\n marketCap: 1.9e12,\n mv: {\n divisor: 100,\n max: 85,\n min: 75,\n },\n name: LocationName.ChongqingKuaiGongInternational,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 7,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.ChongqingKuaiGongInternational],\n },\n\n {\n b: true,\n initPrice: {\n max: 36e3,\n min: 29e3,\n },\n marketCap: 2e12,\n mv: {\n divisor: 100,\n max: 130,\n min: 120,\n },\n name: LocationName.AevumFulcrumTechnologies,\n otlkMag: 16,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumFulcrumTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 20e3,\n },\n marketCap: 1.2e12,\n mv: {\n divisor: 100,\n max: 90,\n min: 80,\n },\n name: LocationName.IshimaStormTechnologies,\n otlkMag: 7,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.IshimaStormTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 19e3,\n min: 6e3,\n },\n marketCap: 900e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.NewTokyoDefComm,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoDefComm],\n },\n\n {\n b: true,\n initPrice: {\n max: 18e3,\n min: 10e3,\n },\n marketCap: 825e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.VolhavenHeliosLabs,\n otlkMag: 9,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.VolhavenHeliosLabs],\n },\n\n {\n b: true,\n initPrice: {\n max: 14e3,\n min: 8e3,\n },\n marketCap: 1e12,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.NewTokyoVitaLife,\n otlkMag: 7,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoVitaLife],\n },\n\n {\n b: true,\n initPrice: {\n max: 24e3,\n min: 12e3,\n },\n marketCap: 800e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.Sector12IcarusMicrosystems,\n otlkMag: 7.5,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.Sector12IcarusMicrosystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 29e3,\n min: 16e3,\n },\n marketCap: 900e9,\n mv: {\n divisor: 100,\n max: 60,\n min: 50,\n },\n name: LocationName.Sector12UniversalEnergy,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.Sector12UniversalEnergy],\n },\n\n {\n b: true,\n initPrice: {\n max: 17e3,\n min: 8e3,\n },\n marketCap: 640e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.AevumAeroCorp,\n otlkMag: 6,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.AevumAeroCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 15e3,\n min: 6e3,\n },\n marketCap: 600e9,\n mv: {\n divisor: 100,\n max: 75,\n min: 65,\n },\n name: LocationName.VolhavenOmniaCybersystems,\n otlkMag: 4.5,\n spreadPerc: {\n divisor: 10,\n max: 11,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.VolhavenOmniaCybersystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 14e3,\n },\n marketCap: 705e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.ChongqingSolarisSpaceSystems,\n otlkMag: 8.5,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.ChongqingSolarisSpaceSystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 30e3,\n min: 12e3,\n },\n marketCap: 695e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n otlkMag: 10.5,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoGlobalPharmaceuticals],\n },\n\n {\n b: true,\n initPrice: {\n max: 27e3,\n min: 15e3,\n },\n marketCap: 600e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.IshimaNovaMedical,\n otlkMag: 5,\n spreadPerc: {\n divisor: 10,\n max: 11,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.IshimaNovaMedical],\n },\n\n {\n b: true,\n initPrice: {\n max: 8.5e3,\n min: 4e3,\n },\n marketCap: 450e9,\n mv: {\n divisor: 100,\n max: 260,\n min: 240,\n },\n name: LocationName.AevumWatchdogSecurity,\n otlkMag: 1.5,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 54e3,\n min: 12e3,\n },\n symbol: StockSymbols[LocationName.AevumWatchdogSecurity],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 4.5e3,\n },\n marketCap: 300e9,\n mv: {\n divisor: 100,\n max: 135,\n min: 115,\n },\n name: LocationName.VolhavenLexoCorp,\n otlkMag: 6,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.VolhavenLexoCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 7e3,\n min: 2e3,\n },\n marketCap: 180e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 50,\n },\n name: LocationName.AevumRhoConstruction,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.AevumRhoConstruction],\n },\n\n {\n b: true,\n initPrice: {\n max: 8.5e3,\n min: 4e3,\n },\n marketCap: 240e9,\n mv: {\n divisor: 100,\n max: 205,\n min: 175,\n },\n name: LocationName.Sector12AlphaEnterprises,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 16,\n min: 5,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12AlphaEnterprises],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 3e3,\n },\n marketCap: 200e9,\n mv: {\n divisor: 100,\n max: 170,\n min: 150,\n },\n name: LocationName.VolhavenSysCoreSecurities,\n otlkMag: 3,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 15e3,\n },\n symbol: StockSymbols[LocationName.VolhavenSysCoreSecurities],\n },\n\n {\n b: true,\n initPrice: {\n max: 6e3,\n min: 1e3,\n },\n marketCap: 185e9,\n mv: {\n divisor: 100,\n max: 100,\n min: 80,\n },\n name: LocationName.VolhavenCompuTek,\n otlkMag: 4,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.VolhavenCompuTek],\n },\n\n {\n b: true,\n initPrice: {\n max: 5e3,\n min: 1e3,\n },\n marketCap: 58e9,\n mv: {\n divisor: 100,\n max: 400,\n min: 200,\n },\n name: LocationName.AevumNetLinkTechnologies,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 20,\n min: 5,\n },\n shareTxForMovement: {\n max: 54e3,\n min: 18e3,\n },\n symbol: StockSymbols[LocationName.AevumNetLinkTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 1e3,\n },\n marketCap: 60e9,\n mv: {\n divisor: 100,\n max: 110,\n min: 90,\n },\n name: LocationName.IshimaOmegaSoftware,\n otlkMag: 0.5,\n spreadPerc: {\n divisor: 10,\n max: 13,\n min: 4,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.IshimaOmegaSoftware],\n },\n\n {\n b: false,\n initPrice: {\n max: 4.5e3,\n min: 500,\n },\n marketCap: 45e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.Sector12FoodNStuff,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 6,\n },\n shareTxForMovement: {\n max: 180e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.Sector12FoodNStuff],\n },\n\n {\n b: true,\n initPrice: {\n max: 3.5e3,\n min: 1.5e3,\n },\n marketCap: 30e9,\n mv: {\n divisor: 100,\n max: 275,\n min: 100,\n },\n name: \"Sigma Cosmetics\",\n otlkMag: 0,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 6,\n },\n shareTxForMovement: {\n max: 70e3,\n min: 20e3,\n },\n symbol: StockSymbols[\"Sigma Cosmetics\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 1.5e3,\n min: 250,\n },\n marketCap: 42e9,\n mv: {\n divisor: 100,\n max: 350,\n min: 200,\n },\n name: LocationName.Sector12JoesGuns,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 6,\n },\n shareTxForMovement: {\n max: 52e3,\n min: 15e3,\n },\n symbol: StockSymbols[LocationName.Sector12JoesGuns],\n },\n\n {\n b: true,\n initPrice: {\n max: 1.5e3,\n min: 250,\n },\n marketCap: 100e9,\n mv: {\n divisor: 100,\n max: 175,\n min: 120,\n },\n name: \"Catalyst Ventures\",\n otlkMag: 13.5,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 5,\n },\n shareTxForMovement: {\n max: 72e3,\n min: 24e3,\n },\n symbol: StockSymbols[\"Catalyst Ventures\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 30e3,\n min: 15e3,\n },\n marketCap: 360e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: \"Microdyne Technologies\",\n otlkMag: 8,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 216e3,\n min: 90e3,\n },\n symbol: StockSymbols[\"Microdyne Technologies\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 24e3,\n min: 12e3,\n },\n marketCap: 420e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 50,\n },\n name: \"Titan Laboratories\",\n otlkMag: 11,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 216e3,\n min: 90e3,\n },\n symbol: StockSymbols[\"Titan Laboratories\"],\n },\n];\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { getRamCost } from \"../Netscript/RamCostGenerator\";\nimport { Gang } from \"../Gang/Gang\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { GangMemberTasks } from \"../Gang/GangMemberTasks\";\nimport { GangMemberUpgrades } from \"../Gang/GangMemberUpgrades\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { GangMember } from \"../Gang/GangMember\";\nimport { GangMemberTask } from \"../Gang/GangMemberTask\";\n\nimport {\n Gang as IGang,\n GangGenInfo,\n GangOtherInfo,\n GangMemberInfo,\n GangMemberAscension,\n EquipmentStats,\n GangTaskStats,\n} from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport function NetscriptGang(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): IGang {\n const checkGangApiAccess = function (func: string): void {\n const gang = player.gang;\n if (gang === null) throw new Error(\"Must have joined gang\");\n const hasAccess = gang instanceof Gang;\n if (!hasAccess) {\n throw helper.makeRuntimeErrorMsg(`gang.${func}`, `You do not currently have a Gang`);\n }\n };\n\n const getGangMember = function (func: string, name: string): GangMember {\n const gang = player.gang;\n if (gang === null) throw new Error(\"Must have joined gang\");\n for (const member of gang.members) if (member.name === name) return member;\n throw helper.makeRuntimeErrorMsg(`gang.${func}`, `Invalid gang member: '${name}'`);\n };\n\n const getGangTask = function (func: string, name: string): GangMemberTask {\n const task = GangMemberTasks[name];\n if (!task) {\n throw helper.makeRuntimeErrorMsg(`gang.${func}`, `Invalid task: '${name}'`);\n }\n\n return task;\n };\n\n return {\n createGang: function (faction: string): boolean {\n helper.updateDynamicRam(\"createGang\", getRamCost(player, \"gang\", \"createGang\"));\n // this list is copied from Faction/ui/Root.tsx\n const GangNames = [\n \"Slum Snakes\",\n \"Tetrads\",\n \"The Syndicate\",\n \"The Dark Army\",\n \"Speakers for the Dead\",\n \"NiteSec\",\n \"The Black Hand\",\n ];\n if (!player.canAccessGang() || !GangNames.includes(faction)) return false;\n if (player.inGang()) return false;\n if (!player.factions.includes(faction)) return false;\n\n const isHacking = faction === \"NiteSec\" || faction === \"The Black Hand\";\n player.startGang(faction, isHacking);\n return true;\n },\n inGang: function (): boolean {\n helper.updateDynamicRam(\"inGang\", getRamCost(player, \"gang\", \"inGang\"));\n return player.inGang();\n },\n getMemberNames: function (): string[] {\n helper.updateDynamicRam(\"getMemberNames\", getRamCost(player, \"gang\", \"getMemberNames\"));\n checkGangApiAccess(\"getMemberNames\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return gang.members.map((member) => member.name);\n },\n getGangInformation: function (): GangGenInfo {\n helper.updateDynamicRam(\"getGangInformation\", getRamCost(player, \"gang\", \"getGangInformation\"));\n checkGangApiAccess(\"getGangInformation\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return {\n faction: gang.facName,\n isHacking: gang.isHackingGang,\n moneyGainRate: gang.moneyGainRate,\n power: gang.getPower(),\n respect: gang.respect,\n respectGainRate: gang.respectGainRate,\n territory: gang.getTerritory(),\n territoryClashChance: gang.territoryClashChance,\n territoryWarfareEngaged: gang.territoryWarfareEngaged,\n wantedLevel: gang.wanted,\n wantedLevelGainRate: gang.wantedGainRate,\n wantedPenalty: gang.getWantedPenalty(),\n };\n },\n getOtherGangInformation: function (): GangOtherInfo {\n helper.updateDynamicRam(\"getOtherGangInformation\", getRamCost(player, \"gang\", \"getOtherGangInformation\"));\n checkGangApiAccess(\"getOtherGangInformation\");\n const cpy: any = {};\n for (const gang of Object.keys(AllGangs)) {\n cpy[gang] = Object.assign({}, AllGangs[gang]);\n }\n\n return cpy;\n },\n getMemberInformation: function (name: any): GangMemberInfo {\n helper.updateDynamicRam(\"getMemberInformation\", getRamCost(player, \"gang\", \"getMemberInformation\"));\n checkGangApiAccess(\"getMemberInformation\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(\"getMemberInformation\", name);\n return {\n name: member.name,\n task: member.task,\n earnedRespect: member.earnedRespect,\n hack: member.hack,\n str: member.str,\n def: member.def,\n dex: member.dex,\n agi: member.agi,\n cha: member.cha,\n\n hack_exp: member.hack_exp,\n str_exp: member.str_exp,\n def_exp: member.def_exp,\n dex_exp: member.dex_exp,\n agi_exp: member.agi_exp,\n cha_exp: member.cha_exp,\n\n hack_mult: member.hack_mult,\n str_mult: member.str_mult,\n def_mult: member.def_mult,\n dex_mult: member.dex_mult,\n agi_mult: member.agi_mult,\n cha_mult: member.cha_mult,\n\n hack_asc_mult: member.calculateAscensionMult(member.hack_asc_points),\n str_asc_mult: member.calculateAscensionMult(member.str_asc_points),\n def_asc_mult: member.calculateAscensionMult(member.def_asc_points),\n dex_asc_mult: member.calculateAscensionMult(member.dex_asc_points),\n agi_asc_mult: member.calculateAscensionMult(member.agi_asc_points),\n cha_asc_mult: member.calculateAscensionMult(member.cha_asc_points),\n\n hack_asc_points: member.hack_asc_points,\n str_asc_points: member.str_asc_points,\n def_asc_points: member.def_asc_points,\n dex_asc_points: member.dex_asc_points,\n agi_asc_points: member.agi_asc_points,\n cha_asc_points: member.cha_asc_points,\n\n upgrades: member.upgrades.slice(),\n augmentations: member.augmentations.slice(),\n\n respectGain: member.calculateRespectGain(gang),\n wantedLevelGain: member.calculateWantedLevelGain(gang),\n moneyGain: member.calculateMoneyGain(gang),\n };\n },\n canRecruitMember: function (): boolean {\n helper.updateDynamicRam(\"canRecruitMember\", getRamCost(player, \"gang\", \"canRecruitMember\"));\n checkGangApiAccess(\"canRecruitMember\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return gang.canRecruitMember();\n },\n recruitMember: function (name: any): boolean {\n helper.updateDynamicRam(\"recruitMember\", getRamCost(player, \"gang\", \"recruitMember\"));\n checkGangApiAccess(\"recruitMember\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const recruited = gang.recruitMember(name);\n if (recruited) {\n workerScript.log(\"gang.recruitMember\", () => `Successfully recruited Gang Member '${name}'`);\n } else {\n workerScript.log(\"gang.recruitMember\", () => `Failed to recruit Gang Member '${name}'`);\n }\n\n return recruited;\n },\n getTaskNames: function (): string[] {\n helper.updateDynamicRam(\"getTaskNames\", getRamCost(player, \"gang\", \"getTaskNames\"));\n checkGangApiAccess(\"getTaskNames\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const tasks = gang.getAllTaskNames();\n tasks.unshift(\"Unassigned\");\n return tasks;\n },\n setMemberTask: function (memberName: any, taskName: any): boolean {\n helper.updateDynamicRam(\"setMemberTask\", getRamCost(player, \"gang\", \"setMemberTask\"));\n checkGangApiAccess(\"setMemberTask\");\n const member = getGangMember(\"setMemberTask\", memberName);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (!gang.getAllTaskNames().includes(taskName)) {\n workerScript.log(\n \"gang.setMemberTask\",\n () => `Failed to assign Gang Member '${memberName}' to Invalid task '${taskName}'. '${memberName}' is now Unassigned`,\n );\n return member.assignToTask('Unassigned');\n }\n const success = member.assignToTask(taskName);\n if (success) {\n workerScript.log(\n \"gang.setMemberTask\",\n () => `Successfully assigned Gang Member '${memberName}' to '${taskName}' task`,\n );\n } else {\n workerScript.log(\n \"gang.setMemberTask\",\n () => `Failed to assign Gang Member '${memberName}' to '${taskName}' task. '${memberName}' is now Unassigned`,\n );\n }\n\n return success;\n },\n getTaskStats: function (taskName: any): GangTaskStats {\n helper.updateDynamicRam(\"getTaskStats\", getRamCost(player, \"gang\", \"getTaskStats\"));\n checkGangApiAccess(\"getTaskStats\");\n const task = getGangTask(\"getTaskStats\", taskName);\n const copy = Object.assign({}, task);\n copy.territory = Object.assign({}, task.territory);\n return copy;\n },\n getEquipmentNames: function (): string[] {\n helper.updateDynamicRam(\"getEquipmentNames\", getRamCost(player, \"gang\", \"getEquipmentNames\"));\n checkGangApiAccess(\"getEquipmentNames\");\n return Object.keys(GangMemberUpgrades);\n },\n getEquipmentCost: function (equipName: any): number {\n helper.updateDynamicRam(\"getEquipmentCost\", getRamCost(player, \"gang\", \"getEquipmentCost\"));\n checkGangApiAccess(\"getEquipmentCost\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const upg = GangMemberUpgrades[equipName];\n if (upg === null) return Infinity;\n return gang.getUpgradeCost(upg);\n },\n getEquipmentType: function (equipName: any): string {\n helper.updateDynamicRam(\"getEquipmentType\", getRamCost(player, \"gang\", \"getEquipmentType\"));\n checkGangApiAccess(\"getEquipmentType\");\n const upg = GangMemberUpgrades[equipName];\n if (upg == null) return \"\";\n return upg.getType();\n },\n getEquipmentStats: function (equipName: any): EquipmentStats {\n helper.updateDynamicRam(\"getEquipmentStats\", getRamCost(player, \"gang\", \"getEquipmentStats\"));\n checkGangApiAccess(\"getEquipmentStats\");\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) {\n throw helper.makeRuntimeErrorMsg(\"getEquipmentStats\", `Invalid equipment: ${equipName}`);\n }\n const typecheck: EquipmentStats = equipment.mults;\n return Object.assign({}, typecheck) as any;\n },\n purchaseEquipment: function (memberName: any, equipName: any): boolean {\n helper.updateDynamicRam(\"purchaseEquipment\", getRamCost(player, \"gang\", \"purchaseEquipment\"));\n checkGangApiAccess(\"purchaseEquipment\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(\"purchaseEquipment\", memberName);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) return false;\n const res = member.buyUpgrade(equipment, player, gang);\n if (res) {\n workerScript.log(\"gang.purchaseEquipment\", () => `Purchased '${equipName}' for Gang member '${memberName}'`);\n } else {\n workerScript.log(\n \"gang.purchaseEquipment\",\n () => `Failed to purchase '${equipName}' for Gang member '${memberName}'`,\n );\n }\n\n return res;\n },\n ascendMember: function (name: any): GangMemberAscension | undefined {\n helper.updateDynamicRam(\"ascendMember\", getRamCost(player, \"gang\", \"ascendMember\"));\n checkGangApiAccess(\"ascendMember\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(\"ascendMember\", name);\n if (!member.canAscend()) return;\n return gang.ascendMember(member, workerScript);\n },\n getAscensionResult: function (name: any): GangMemberAscension | undefined {\n helper.updateDynamicRam(\"getAscensionResult\", getRamCost(player, \"gang\", \"getAscensionResult\"));\n checkGangApiAccess(\"getAscensionResult\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(\"getAscensionResult\", name);\n if (!member.canAscend()) return;\n return {\n respect: member.earnedRespect,\n ...member.getAscensionResults(),\n };\n },\n setTerritoryWarfare: function (engage: any): void {\n helper.updateDynamicRam(\"setTerritoryWarfare\", getRamCost(player, \"gang\", \"setTerritoryWarfare\"));\n checkGangApiAccess(\"setTerritoryWarfare\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (engage) {\n gang.territoryWarfareEngaged = true;\n workerScript.log(\"gang.setTerritoryWarfare\", () => \"Engaging in Gang Territory Warfare\");\n } else {\n gang.territoryWarfareEngaged = false;\n workerScript.log(\"gang.setTerritoryWarfare\", () => \"Disengaging in Gang Territory Warfare\");\n }\n },\n getChanceToWinClash: function (otherGang: any): number {\n helper.updateDynamicRam(\"getChanceToWinClash\", getRamCost(player, \"gang\", \"getChanceToWinClash\"));\n checkGangApiAccess(\"getChanceToWinClash\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (AllGangs[otherGang] == null) {\n throw helper.makeRuntimeErrorMsg(`gang.getChanceToWinClash`, `Invalid gang: ${otherGang}`);\n }\n\n const playerPower = AllGangs[gang.facName].power;\n const otherPower = AllGangs[otherGang].power;\n\n return playerPower / (otherPower + playerPower);\n },\n getBonusTime: function (): number {\n helper.updateDynamicRam(\"getBonusTime\", getRamCost(player, \"gang\", \"getBonusTime\"));\n checkGangApiAccess(\"getBonusTime\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return Math.round(gang.storedCycles / 5);\n },\n };\n}\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { getRamCost } from \"../Netscript/RamCostGenerator\";\nimport { FactionWorkType } from \"../Faction/FactionWorkTypeEnum\";\nimport { SourceFileFlags } from \"../SourceFile/SourceFileFlags\";\nimport { SleeveTaskType } from \"../PersonObjects/Sleeve/SleeveTaskTypesEnum\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { findSleevePurchasableAugs } from \"../PersonObjects/Sleeve/SleeveHelpers\";\nimport { Augmentations } from \"../Augmentation/Augmentations\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { findCrime } from \"../Crime/CrimeHelpers\";\n\nimport { Sleeve as ISleeve } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): ISleeve {\n const checkSleeveAPIAccess = function (func: any): void {\n if (player.bitNodeN !== 10 && !SourceFileFlags[10]) {\n throw helper.makeRuntimeErrorMsg(\n `sleeve.${func}`,\n \"You do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10\",\n );\n }\n };\n\n const checkSleeveNumber = function (func: any, sleeveNumber: any): void {\n if (sleeveNumber >= player.sleeves.length || sleeveNumber < 0) {\n const msg = `Invalid sleeve number: ${sleeveNumber}`;\n workerScript.log(func, () => msg);\n throw helper.makeRuntimeErrorMsg(`sleeve.${func}`, msg);\n }\n };\n\n return {\n getNumSleeves: function (): number {\n helper.updateDynamicRam(\"getNumSleeves\", getRamCost(player, \"sleeve\", \"getNumSleeves\"));\n checkSleeveAPIAccess(\"getNumSleeves\");\n return player.sleeves.length;\n },\n setToShockRecovery: function (asleeveNumber: any = 0): boolean {\n const sleeveNumber = helper.number(\"setToShockRecovery\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"setToShockRecovery\", getRamCost(player, \"sleeve\", \"setToShockRecovery\"));\n checkSleeveAPIAccess(\"setToShockRecovery\");\n checkSleeveNumber(\"setToShockRecovery\", sleeveNumber);\n return player.sleeves[sleeveNumber].shockRecovery(player);\n },\n setToSynchronize: function (asleeveNumber: any = 0): boolean {\n const sleeveNumber = helper.number(\"setToSynchronize\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"setToSynchronize\", getRamCost(player, \"sleeve\", \"setToSynchronize\"));\n checkSleeveAPIAccess(\"setToSynchronize\");\n checkSleeveNumber(\"setToSynchronize\", sleeveNumber);\n return player.sleeves[sleeveNumber].synchronize(player);\n },\n setToCommitCrime: function (asleeveNumber: any = 0, aCrimeRoughName: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"setToCommitCrime\", \"sleeveNumber\", asleeveNumber);\n const crimeRoughName = helper.string(\"setToCommitCrime\", \"crimeName\", aCrimeRoughName);\n helper.updateDynamicRam(\"setToCommitCrime\", getRamCost(player, \"sleeve\", \"setToCommitCrime\"));\n checkSleeveAPIAccess(\"setToCommitCrime\");\n checkSleeveNumber(\"setToCommitCrime\", sleeveNumber);\n const crime = findCrime(crimeRoughName);\n if (crime === null) {\n return false;\n }\n return player.sleeves[sleeveNumber].commitCrime(player, crime.name);\n },\n setToUniversityCourse: function (asleeveNumber: any = 0, auniversityName: any = \"\", aclassName: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"setToUniversityCourse\", \"sleeveNumber\", asleeveNumber);\n const universityName = helper.string(\"setToUniversityCourse\", \"universityName\", auniversityName);\n const className = helper.string(\"setToUniversityCourse\", \"className\", aclassName);\n helper.updateDynamicRam(\"setToUniversityCourse\", getRamCost(player, \"sleeve\", \"setToUniversityCourse\"));\n checkSleeveAPIAccess(\"setToUniversityCourse\");\n checkSleeveNumber(\"setToUniversityCourse\", sleeveNumber);\n return player.sleeves[sleeveNumber].takeUniversityCourse(player, universityName, className);\n },\n travel: function (asleeveNumber: any = 0, acityName: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"travel\", \"sleeveNumber\", asleeveNumber);\n const cityName = helper.string(\"setToUniversityCourse\", \"cityName\", acityName);\n helper.updateDynamicRam(\"travel\", getRamCost(player, \"sleeve\", \"travel\"));\n checkSleeveAPIAccess(\"travel\");\n checkSleeveNumber(\"travel\", sleeveNumber);\n return player.sleeves[sleeveNumber].travel(player, cityName as CityName);\n },\n setToCompanyWork: function (asleeveNumber: any = 0, acompanyName: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"setToCompanyWork\", \"sleeveNumber\", asleeveNumber);\n const companyName = helper.string(\"setToUniversityCourse\", \"companyName\", acompanyName);\n helper.updateDynamicRam(\"setToCompanyWork\", getRamCost(player, \"sleeve\", \"setToCompanyWork\"));\n checkSleeveAPIAccess(\"setToCompanyWork\");\n checkSleeveNumber(\"setToCompanyWork\", sleeveNumber);\n\n // Cannot work at the same company that another sleeve is working at\n for (let i = 0; i < player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = player.sleeves[i];\n if (other.currentTask === SleeveTaskType.Company && other.currentTaskLocation === companyName) {\n throw helper.makeRuntimeErrorMsg(\n \"sleeve.setToFactionWork\",\n `Sleeve ${sleeveNumber} cannot work for company ${companyName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n return player.sleeves[sleeveNumber].workForCompany(player, companyName);\n },\n setToFactionWork: function (asleeveNumber: any = 0, afactionName: any = \"\", aworkType: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"setToFactionWork\", \"sleeveNumber\", asleeveNumber);\n const factionName = helper.string(\"setToUniversityCourse\", \"factionName\", afactionName);\n const workType = helper.string(\"setToUniversityCourse\", \"workType\", aworkType);\n helper.updateDynamicRam(\"setToFactionWork\", getRamCost(player, \"sleeve\", \"setToFactionWork\"));\n checkSleeveAPIAccess(\"setToFactionWork\");\n checkSleeveNumber(\"setToFactionWork\", sleeveNumber);\n\n // Cannot work at the same faction that another sleeve is working at\n for (let i = 0; i < player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = player.sleeves[i];\n if (other.currentTask === SleeveTaskType.Faction && other.currentTaskLocation === factionName) {\n throw helper.makeRuntimeErrorMsg(\n \"sleeve.setToFactionWork\",\n `Sleeve ${sleeveNumber} cannot work for faction ${factionName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n return player.sleeves[sleeveNumber].workForFaction(player, factionName, workType);\n },\n setToGymWorkout: function (asleeveNumber: any = 0, agymName: any = \"\", astat: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"setToGymWorkout\", \"sleeveNumber\", asleeveNumber);\n const gymName = helper.string(\"setToUniversityCourse\", \"gymName\", agymName);\n const stat = helper.string(\"setToUniversityCourse\", \"stat\", astat);\n helper.updateDynamicRam(\"setToGymWorkout\", getRamCost(player, \"sleeve\", \"setToGymWorkout\"));\n checkSleeveAPIAccess(\"setToGymWorkout\");\n checkSleeveNumber(\"setToGymWorkout\", sleeveNumber);\n\n return player.sleeves[sleeveNumber].workoutAtGym(player, gymName, stat);\n },\n getSleeveStats: function (asleeveNumber: any = 0): {\n shock: number;\n sync: number;\n hacking: number;\n strength: number;\n defense: number;\n dexterity: number;\n agility: number;\n charisma: number;\n } {\n const sleeveNumber = helper.number(\"getSleeveStats\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"getSleeveStats\", getRamCost(player, \"sleeve\", \"getSleeveStats\"));\n checkSleeveAPIAccess(\"getSleeveStats\");\n checkSleeveNumber(\"getSleeveStats\", sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n shock: 100 - sl.shock,\n sync: sl.sync,\n hacking: sl.hacking,\n strength: sl.strength,\n defense: sl.defense,\n dexterity: sl.dexterity,\n agility: sl.agility,\n charisma: sl.charisma,\n };\n },\n getTask: function (asleeveNumber: any = 0): {\n task: string;\n crime: string;\n location: string;\n gymStatType: string;\n factionWorkType: string;\n } {\n const sleeveNumber = helper.number(\"getTask\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"getTask\", getRamCost(player, \"sleeve\", \"getTask\"));\n checkSleeveAPIAccess(\"getTask\");\n checkSleeveNumber(\"getTask\", sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n task: SleeveTaskType[sl.currentTask],\n crime: sl.crimeType,\n location: sl.currentTaskLocation,\n gymStatType: sl.gymStatType,\n factionWorkType: FactionWorkType[sl.factionWorkType],\n };\n },\n getInformation: function (asleeveNumber: any = 0): any {\n const sleeveNumber = helper.number(\"getInformation\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"getInformation\", getRamCost(player, \"sleeve\", \"getInformation\"));\n checkSleeveAPIAccess(\"getInformation\");\n checkSleeveNumber(\"getInformation\", sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n city: sl.city,\n hp: sl.hp,\n jobs: Object.keys(player.jobs), // technically sleeves have the same jobs as the player.\n jobTitle: Object.values(player.jobs),\n maxHp: sl.max_hp,\n\n mult: {\n agility: sl.agility_mult,\n agilityExp: sl.agility_exp_mult,\n charisma: sl.charisma_mult,\n charismaExp: sl.charisma_exp_mult,\n companyRep: sl.company_rep_mult,\n crimeMoney: sl.crime_money_mult,\n crimeSuccess: sl.crime_success_mult,\n defense: sl.defense_mult,\n defenseExp: sl.defense_exp_mult,\n dexterity: sl.dexterity_mult,\n dexterityExp: sl.dexterity_exp_mult,\n factionRep: sl.faction_rep_mult,\n hacking: sl.hacking_mult,\n hackingExp: sl.hacking_exp_mult,\n strength: sl.strength_mult,\n strengthExp: sl.strength_exp_mult,\n workMoney: sl.work_money_mult,\n },\n\n timeWorked: sl.currentTaskTime,\n earningsForSleeves: {\n workHackExpGain: sl.earningsForSleeves.hack,\n workStrExpGain: sl.earningsForSleeves.str,\n workDefExpGain: sl.earningsForSleeves.def,\n workDexExpGain: sl.earningsForSleeves.dex,\n workAgiExpGain: sl.earningsForSleeves.agi,\n workChaExpGain: sl.earningsForSleeves.cha,\n workMoneyGain: sl.earningsForSleeves.money,\n },\n earningsForPlayer: {\n workHackExpGain: sl.earningsForPlayer.hack,\n workStrExpGain: sl.earningsForPlayer.str,\n workDefExpGain: sl.earningsForPlayer.def,\n workDexExpGain: sl.earningsForPlayer.dex,\n workAgiExpGain: sl.earningsForPlayer.agi,\n workChaExpGain: sl.earningsForPlayer.cha,\n workMoneyGain: sl.earningsForPlayer.money,\n },\n earningsForTask: {\n workHackExpGain: sl.earningsForTask.hack,\n workStrExpGain: sl.earningsForTask.str,\n workDefExpGain: sl.earningsForTask.def,\n workDexExpGain: sl.earningsForTask.dex,\n workAgiExpGain: sl.earningsForTask.agi,\n workChaExpGain: sl.earningsForTask.cha,\n workMoneyGain: sl.earningsForTask.money,\n },\n workRepGain: sl.getRepGain(player),\n };\n },\n getSleeveAugmentations: function (asleeveNumber: any = 0): string[] {\n const sleeveNumber = helper.number(\"getSleeveAugmentations\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"getSleeveAugmentations\", getRamCost(player, \"sleeve\", \"getSleeveAugmentations\"));\n checkSleeveAPIAccess(\"getSleeveAugmentations\");\n checkSleeveNumber(\"getSleeveAugmentations\", sleeveNumber);\n\n const augs = [];\n for (let i = 0; i < player.sleeves[sleeveNumber].augmentations.length; i++) {\n augs.push(player.sleeves[sleeveNumber].augmentations[i].name);\n }\n return augs;\n },\n getSleevePurchasableAugs: function (asleeveNumber: any = 0): {\n name: string;\n cost: number;\n }[] {\n const sleeveNumber = helper.number(\"getSleevePurchasableAugs\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"getSleevePurchasableAugs\", getRamCost(player, \"sleeve\", \"getSleevePurchasableAugs\"));\n checkSleeveAPIAccess(\"getSleevePurchasableAugs\");\n checkSleeveNumber(\"getSleevePurchasableAugs\", sleeveNumber);\n\n const purchasableAugs = findSleevePurchasableAugs(player.sleeves[sleeveNumber], player);\n const augs = [];\n for (let i = 0; i < purchasableAugs.length; i++) {\n const aug = purchasableAugs[i];\n augs.push({\n name: aug.name,\n cost: aug.startingCost,\n });\n }\n\n return augs;\n },\n purchaseSleeveAug: function (asleeveNumber: any = 0, aaugName: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"purchaseSleeveAug\", \"sleeveNumber\", asleeveNumber);\n const augName = helper.string(\"setToUniversityCourse\", \"augName\", aaugName);\n helper.updateDynamicRam(\"purchaseSleeveAug\", getRamCost(player, \"sleeve\", \"purchaseSleeveAug\"));\n checkSleeveAPIAccess(\"purchaseSleeveAug\");\n checkSleeveNumber(\"purchaseSleeveAug\", sleeveNumber);\n\n const aug = Augmentations[augName];\n if (!aug) {\n throw helper.makeRuntimeErrorMsg(\"sleeve.purchaseSleeveAug\", `Invalid aug: ${augName}`);\n }\n\n return player.sleeves[sleeveNumber].tryBuyAugmentation(player, aug);\n },\n };\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Exploit } from \"../Exploits/Exploit\";\n\nexport interface INetscriptExtra {\n heart: {\n break(): number;\n };\n exploit(): void;\n bypass(doc: Document): void;\n alterReality(): void;\n}\n\nexport function NetscriptExtra(player: IPlayer, workerScript: WorkerScript): INetscriptExtra {\n return {\n heart: {\n // Easter egg function\n break: function (): number {\n return player.karma;\n },\n },\n exploit: function (): void {\n player.giveExploit(Exploit.UndocumentedFunctionCall);\n },\n bypass: function (doc: any): void {\n // reset both fields first\n doc.completely_unused_field = undefined;\n const real_document: any = document;\n real_document.completely_unused_field = undefined;\n // set one to true and check that it affected the other.\n real_document.completely_unused_field = true;\n if (doc.completely_unused_field && workerScript.ramUsage === 1.6) {\n player.giveExploit(Exploit.Bypass);\n }\n doc.completely_unused_field = undefined;\n real_document.completely_unused_field = undefined;\n },\n alterReality: function (): void {\n // We need to trick webpack into not optimizing a variable that is guaranteed to be false (and doesn't use prototypes)\n let x = false;\n const recur = function (depth: number): void {\n if (depth === 0) return;\n x = !x;\n recur(depth - 1);\n };\n recur(2);\n console.warn(\"I am sure that this variable is false.\");\n if (x !== false) {\n console.warn(\"Reality has been altered!\");\n player.giveExploit(Exploit.RealityAlteration);\n }\n },\n };\n}\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport {\n getCostOfNextHacknetNode,\n getCostOfNextHacknetServer,\n hasHacknetServers,\n purchaseHacknet,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n purchaseCacheUpgrade,\n purchaseHashUpgrade,\n updateHashManagerCapacity,\n} from \"../Hacknet/HacknetHelpers\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { HacknetNode } from \"../Hacknet/HacknetNode\";\nimport { HashUpgrades } from \"../Hacknet/HashUpgrades\";\nimport { HashUpgrade } from \"../Hacknet/HashUpgrade\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { Hacknet as IHacknet, NodeStats } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): IHacknet {\n // Utility function to get Hacknet Node object\n const getHacknetNode = function (i: any, callingFn = \"\"): HacknetNode | HacknetServer {\n if (isNaN(i)) {\n throw helper.makeRuntimeErrorMsg(callingFn, \"Invalid index specified for Hacknet Node: \" + i);\n }\n if (i < 0 || i >= player.hacknetNodes.length) {\n throw helper.makeRuntimeErrorMsg(callingFn, \"Index specified for Hacknet Node is out-of-bounds: \" + i);\n }\n\n if (hasHacknetServers(player)) {\n const hi = player.hacknetNodes[i];\n if (typeof hi !== \"string\") throw new Error(\"hacknet node was not a string\");\n const hserver = GetServer(hi);\n if (!(hserver instanceof HacknetServer)) throw new Error(\"hacknet server was not actually hacknet server\");\n if (hserver == null) {\n throw helper.makeRuntimeErrorMsg(\n callingFn,\n `Could not get Hacknet Server for index ${i}. This is probably a bug, please report to game dev`,\n );\n }\n\n return hserver;\n } else {\n const node = player.hacknetNodes[i];\n if (!(node instanceof HacknetNode)) throw new Error(\"hacknet node was not node.\");\n return node;\n }\n };\n\n return {\n numNodes: function (): number {\n return player.hacknetNodes.length;\n },\n maxNumNodes: function (): number {\n if (hasHacknetServers(player)) {\n return HacknetServerConstants.MaxServers;\n }\n return Infinity;\n },\n purchaseNode: function (): number {\n return purchaseHacknet(player);\n },\n getPurchaseNodeCost: function (): number {\n if (hasHacknetServers(player)) {\n return getCostOfNextHacknetServer(player);\n } else {\n return getCostOfNextHacknetNode(player);\n }\n },\n getNodeStats: function (i: any): NodeStats {\n const node = getHacknetNode(i, \"getNodeStats\");\n const hasUpgraded = hasHacknetServers(player);\n const res: any = {\n name: node instanceof HacknetServer ? node.hostname : node.name,\n level: node.level,\n ram: node instanceof HacknetServer ? node.maxRam : node.ram,\n ramUsed: node instanceof HacknetServer ? node.ramUsed : undefined,\n cores: node.cores,\n production: node instanceof HacknetServer ? node.hashRate : node.moneyGainRatePerSecond,\n timeOnline: node.onlineTimeSeconds,\n totalProduction: node instanceof HacknetServer ? node.totalHashesGenerated : node.totalMoneyGenerated,\n };\n\n if (hasUpgraded && node instanceof HacknetServer) {\n res.cache = node.cache;\n res.hashCapacity = node.hashCapacity;\n }\n\n return res;\n },\n upgradeLevel: function (i: any, n: any): boolean {\n const node = getHacknetNode(i, \"upgradeLevel\");\n return purchaseLevelUpgrade(player, node, n);\n },\n upgradeRam: function (i: any, n: any): boolean {\n const node = getHacknetNode(i, \"upgradeRam\");\n return purchaseRamUpgrade(player, node, n);\n },\n upgradeCore: function (i: any, n: any): boolean {\n const node = getHacknetNode(i, \"upgradeCore\");\n return purchaseCoreUpgrade(player, node, n);\n },\n upgradeCache: function (i: any, n: any): boolean {\n if (!hasHacknetServers(player)) {\n return false;\n }\n const node = getHacknetNode(i, \"upgradeCache\");\n if (!(node instanceof HacknetServer)) {\n workerScript.log(\"hacknet.upgradeCache\", () => \"Can only be called on hacknet servers\");\n return false;\n }\n const res = purchaseCacheUpgrade(player, node, n);\n if (res) {\n updateHashManagerCapacity(player);\n }\n return res;\n },\n getLevelUpgradeCost: function (i: any, n: any): number {\n const node = getHacknetNode(i, \"upgradeLevel\");\n return node.calculateLevelUpgradeCost(n, player.hacknet_node_level_cost_mult);\n },\n getRamUpgradeCost: function (i: any, n: any): number {\n const node = getHacknetNode(i, \"upgradeRam\");\n return node.calculateRamUpgradeCost(n, player.hacknet_node_ram_cost_mult);\n },\n getCoreUpgradeCost: function (i: any, n: any): number {\n const node = getHacknetNode(i, \"upgradeCore\");\n return node.calculateCoreUpgradeCost(n, player.hacknet_node_core_cost_mult);\n },\n getCacheUpgradeCost: function (i: any, n: any): number {\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n const node = getHacknetNode(i, \"upgradeCache\");\n if (!(node instanceof HacknetServer)) {\n workerScript.log(\"hacknet.getCacheUpgradeCost\", () => \"Can only be called on hacknet servers\");\n return -1;\n }\n return node.calculateCacheUpgradeCost(n);\n },\n numHashes: function (): number {\n if (!hasHacknetServers(player)) {\n return 0;\n }\n return player.hashManager.hashes;\n },\n hashCapacity: function (): number {\n if (!hasHacknetServers(player)) {\n return 0;\n }\n return player.hashManager.capacity;\n },\n hashCost: function (upgName: any): number {\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n\n return player.hashManager.getUpgradeCost(upgName);\n },\n spendHashes: function (upgName: any, upgTarget: any): boolean {\n if (!hasHacknetServers(player)) {\n return false;\n }\n return purchaseHashUpgrade(player, upgName, upgTarget);\n },\n getHashUpgrades: function(): string[] {\n if (!hasHacknetServers(player)) {\n return [];\n }\n return Object.values(HashUpgrades).map((upgrade: HashUpgrade) => upgrade.name);\n },\n getHashUpgradeLevel: function (upgName: any): number {\n const level = player.hashManager.upgrades[upgName];\n if (level === undefined) {\n throw helper.makeRuntimeErrorMsg(\"hacknet.hashUpgradeLevel\", `Invalid Hash Upgrade: ${upgName}`);\n }\n return level;\n },\n getStudyMult: function (): number {\n if (!hasHacknetServers(player)) {\n return 1;\n }\n return player.hashManager.getStudyMult();\n },\n getTrainingMult: function (): number {\n if (!hasHacknetServers(player)) {\n return 1;\n }\n return player.hashManager.getTrainingMult();\n },\n };\n}\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { netscriptDelay } from \"../NetscriptEvaluator\";\nimport { getRamCost } from \"../Netscript/RamCostGenerator\";\n\nimport { staneksGift } from \"../CotMG/Helper\";\nimport { Fragments, FragmentById } from \"../CotMG/Fragment\";\n\nimport {\n Stanek as IStanek,\n Fragment as IFragment,\n ActiveFragment as IActiveFragment,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\n\nexport function NetscriptStanek(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): IStanek {\n function checkStanekAPIAccess(func: string): void {\n if (!player.hasAugmentation(AugmentationNames.StaneksGift1, true)) {\n helper.makeRuntimeErrorMsg(func, \"Requires Stanek's Gift installed.\");\n }\n }\n\n return {\n width: function (): number {\n return staneksGift.width();\n },\n height: function (): number {\n return staneksGift.height();\n },\n charge: function (arootX: any, arootY: any): Promise<void> {\n const rootX = helper.number(\"stanek.charge\", \"rootX\", arootX);\n const rootY = helper.number(\"stanek.charge\", \"rootY\", arootY);\n\n helper.updateDynamicRam(\"charge\", getRamCost(player, \"stanek\", \"charge\"));\n checkStanekAPIAccess(\"charge\");\n const fragment = staneksGift.findFragment(rootX, rootY);\n if (!fragment) throw helper.makeRuntimeErrorMsg(\"stanek.charge\", `No fragment with root (${rootX}, ${rootY}).`);\n const time = staneksGift.inBonus() ? 200 : 1000;\n return netscriptDelay(time, workerScript).then(function () {\n const charge = staneksGift.charge(player, fragment, workerScript.scriptRef.threads);\n workerScript.log(\"stanek.charge\", () => `Charged fragment for ${charge} charge.`);\n return Promise.resolve();\n });\n },\n fragmentDefinitions: function (): IFragment[] {\n helper.updateDynamicRam(\"fragmentDefinitions\", getRamCost(player, \"stanek\", \"fragmentDefinitions\"));\n checkStanekAPIAccess(\"fragmentDefinitions\");\n workerScript.log(\"stanek.fragmentDefinitions\", () => `Returned ${Fragments.length} fragments`);\n return Fragments.map((f) => f.copy());\n },\n activeFragments: function (): IActiveFragment[] {\n helper.updateDynamicRam(\"activeFragments\", getRamCost(player, \"stanek\", \"activeFragments\"));\n checkStanekAPIAccess(\"activeFragments\");\n workerScript.log(\"stanek.activeFragments\", () => `Returned ${staneksGift.fragments.length} fragments`);\n return staneksGift.fragments.map((af) => {\n return { ...af.copy(), ...af.fragment().copy() };\n });\n },\n clear: function (): void {\n helper.updateDynamicRam(\"clear\", getRamCost(player, \"stanek\", \"clear\"));\n checkStanekAPIAccess(\"clear\");\n workerScript.log(\"stanek.clear\", () => `Cleared Stanek's Gift.`);\n staneksGift.clear();\n },\n canPlace: function (arootX: any, arootY: any, arotation: any, afragmentId: any): boolean {\n const rootX = helper.number(\"stanek.canPlace\", \"rootX\", arootX);\n const rootY = helper.number(\"stanek.canPlace\", \"rootY\", arootY);\n const rotation = helper.number(\"stanek.canPlace\", \"rotation\", arotation);\n const fragmentId = helper.number(\"stanek.canPlace\", \"fragmentId\", afragmentId);\n helper.updateDynamicRam(\"canPlace\", getRamCost(player, \"stanek\", \"canPlace\"));\n checkStanekAPIAccess(\"canPlace\");\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw helper.makeRuntimeErrorMsg(\"stanek.canPlace\", `Invalid fragment id: ${fragmentId}`);\n const can = staneksGift.canPlace(rootX, rootY, rotation, fragment);\n return can;\n },\n place: function (arootX: any, arootY: any, arotation: any, afragmentId: any): boolean {\n const rootX = helper.number(\"stanek.place\", \"rootX\", arootX);\n const rootY = helper.number(\"stanek.place\", \"rootY\", arootY);\n const rotation = helper.number(\"stanek.place\", \"rotation\", arotation);\n const fragmentId = helper.number(\"stanek.place\", \"fragmentId\", afragmentId);\n helper.updateDynamicRam(\"place\", getRamCost(player, \"stanek\", \"place\"));\n checkStanekAPIAccess(\"place\");\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw helper.makeRuntimeErrorMsg(\"stanek.place\", `Invalid fragment id: ${fragmentId}`);\n return staneksGift.place(rootX, rootY, rotation, fragment);\n },\n get: function (arootX: any, arootY: any): IActiveFragment | undefined {\n const rootX = helper.number(\"stanek.get\", \"rootX\", arootX);\n const rootY = helper.number(\"stanek.get\", \"rootY\", arootY);\n helper.updateDynamicRam(\"get\", getRamCost(player, \"stanek\", \"get\"));\n checkStanekAPIAccess(\"get\");\n const fragment = staneksGift.findFragment(rootX, rootY);\n if (fragment !== undefined) return fragment.copy();\n return undefined;\n },\n remove: function (arootX: any, arootY: any): boolean {\n const rootX = helper.number(\"stanek.remove\", \"rootX\", arootX);\n const rootY = helper.number(\"stanek.remove\", \"rootY\", arootY);\n helper.updateDynamicRam(\"remove\", getRamCost(player, \"stanek\", \"remove\"));\n checkStanekAPIAccess(\"remove\");\n return staneksGift.delete(rootX, rootY);\n },\n };\n}\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nexport function CalculateEffect(avgCharge: number, numCharge: number, power: number, boost: number): number {\n return (\n 1 +\n (Math.log(avgCharge + 1) / (Math.log(1.8) * 100)) *\n Math.pow((numCharge + 1) / 5, 0.07) *\n power *\n boost *\n BitNodeMultipliers.StaneksGiftPowerMultiplier\n );\n}\n","export const StanekConstants: {\n RAMBonus: number;\n BaseSize: number;\n} = {\n RAMBonus: 0.1,\n BaseSize: 9,\n};\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { getRamCost } from \"../Netscript/RamCostGenerator\";\nimport { GameInfo, IStyleSettings, UserInterface as IUserInterface, UserInterfaceTheme } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Settings } from \"../Settings/Settings\";\nimport { ThemeEvents } from \"../Themes/ui/Theme\";\nimport { defaultTheme } from \"../Themes/Themes\";\nimport { defaultStyles } from \"../Themes/Styles\";\nimport { CONSTANTS } from \"../Constants\";\nimport { hash } from \"../hash/hash\";\n\nexport function NetscriptUserInterface(\n player: IPlayer,\n workerScript: WorkerScript,\n helper: INetscriptHelper,\n): IUserInterface {\n return {\n getTheme: function (): UserInterfaceTheme {\n helper.updateDynamicRam(\"getTheme\", getRamCost(player, \"ui\", \"getTheme\"));\n return { ...Settings.theme };\n },\n\n getStyles: function (): IStyleSettings {\n helper.updateDynamicRam(\"getStyles\", getRamCost(player, \"ui\", \"getStyles\"));\n return { ...Settings.styles };\n },\n\n setTheme: function (newTheme: UserInterfaceTheme): void {\n helper.updateDynamicRam(\"setTheme\", getRamCost(player, \"ui\", \"setTheme\"));\n const hex = /^(#)((?:[A-Fa-f0-9]{3}){1,2})$/;\n const currentTheme = {...Settings.theme}\n const errors: string[] = [];\n for (const key of Object.keys(newTheme)) {\n if (!currentTheme[key]) {\n // Invalid key\n errors.push(`Invalid key \"${key}\"`);\n } else if (!hex.test(newTheme[key] ?? '')) {\n errors.push(`Invalid color \"${key}\": ${newTheme[key]}`);\n } else {\n currentTheme[key] = newTheme[key];\n }\n }\n\n if (errors.length === 0) {\n Object.assign(Settings.theme, currentTheme);\n ThemeEvents.emit();\n workerScript.log(\"ui.setTheme\", () => `Successfully set theme`);\n } else {\n workerScript.log(\"ui.setTheme\", () => `Failed to set theme. Errors: ${errors.join(', ')}`);\n }\n },\n\n setStyles: function (newStyles: IStyleSettings): void {\n helper.updateDynamicRam(\"setStyles\", getRamCost(player, \"ui\", \"setStyles\"));\n\n const currentStyles = {...Settings.styles}\n const errors: string[] = [];\n for (const key of Object.keys(newStyles)) {\n if (!((currentStyles as any)[key])) {\n // Invalid key\n errors.push(`Invalid key \"${key}\"`);\n } else {\n (currentStyles as any)[key] = (newStyles as any)[key];\n }\n }\n\n if (errors.length === 0) {\n Object.assign(Settings.styles, currentStyles);\n ThemeEvents.emit();\n workerScript.log(\"ui.setStyles\", () => `Successfully set styles`);\n } else {\n workerScript.log(\"ui.setStyles\", () => `Failed to set styles. Errors: ${errors.join(', ')}`);\n }\n },\n\n resetTheme: function (): void {\n helper.updateDynamicRam(\"resetTheme\", getRamCost(player, \"ui\", \"resetTheme\"));\n Settings.theme = { ...defaultTheme };\n ThemeEvents.emit();\n workerScript.log(\"ui.resetTheme\", () => `Reinitialized theme to default`);\n },\n\n resetStyles: function (): void {\n helper.updateDynamicRam(\"resetStyles\", getRamCost(player, \"ui\", \"resetStyles\"));\n Settings.styles = { ...defaultStyles };\n ThemeEvents.emit();\n workerScript.log(\"ui.resetStyles\", () => `Reinitialized styles to default`);\n },\n\n getGameInfo: function (): GameInfo {\n helper.updateDynamicRam(\"getGameInfo\", getRamCost(player, \"ui\", \"getGameInfo\"));\n const version = CONSTANTS.VersionString;\n const commit = hash();\n const platform = (navigator.userAgent.toLowerCase().indexOf(\" electron/\") > -1) ? 'Steam' : 'Browser';\n\n const gameInfo = {\n version, commit, platform,\n }\n\n return gameInfo;\n }\n }\n}\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Bladeburner } from \"../Bladeburner/Bladeburner\";\nimport { getRamCost } from \"../Netscript/RamCostGenerator\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Bladeburner as INetscriptBladeburner, BladeburnerCurAction } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport function NetscriptBladeburner(\n player: IPlayer,\n workerScript: WorkerScript,\n helper: INetscriptHelper,\n): INetscriptBladeburner {\n const checkBladeburnerAccess = function (func: any, skipjoined: any = false): void {\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n const apiAccess =\n player.bitNodeN === 7 ||\n player.sourceFiles.some((a) => {\n return a.n === 7;\n });\n if (!apiAccess) {\n const apiDenied = `You do not currently have access to the Bladeburner API. You must either be in BitNode-7 or have Source-File 7.`;\n throw helper.makeRuntimeErrorMsg(`bladeburner.${func}`, apiDenied);\n }\n if (!skipjoined) {\n const bladeburnerAccess = bladeburner instanceof Bladeburner;\n if (!bladeburnerAccess) {\n const bladeburnerDenied = `You must be a member of the Bladeburner division to use this API.`;\n throw helper.makeRuntimeErrorMsg(`bladeburner.${func}`, bladeburnerDenied);\n }\n }\n };\n\n const checkBladeburnerCity = function (func: any, city: any): void {\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n if (!bladeburner.cities.hasOwnProperty(city)) {\n throw helper.makeRuntimeErrorMsg(`bladeburner.${func}`, `Invalid city: ${city}`);\n }\n };\n\n const getBladeburnerActionObject = function (func: any, type: any, name: any): any {\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n const actionId = bladeburner.getActionIdFromTypeAndName(type, name);\n if (!actionId) {\n throw helper.makeRuntimeErrorMsg(`bladeburner.${func}`, `Invalid action type='${type}', name='${name}'`);\n }\n const actionObj = bladeburner.getActionObject(actionId);\n if (!actionObj) {\n throw helper.makeRuntimeErrorMsg(`bladeburner.${func}`, `Invalid action type='${type}', name='${name}'`);\n }\n\n return actionObj;\n };\n\n return {\n getContractNames: function (): string[] {\n helper.updateDynamicRam(\"getContractNames\", getRamCost(player, \"bladeburner\", \"getContractNames\"));\n checkBladeburnerAccess(\"getContractNames\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getContractNamesNetscriptFn();\n },\n getOperationNames: function (): string[] {\n helper.updateDynamicRam(\"getOperationNames\", getRamCost(player, \"bladeburner\", \"getOperationNames\"));\n checkBladeburnerAccess(\"getOperationNames\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getOperationNamesNetscriptFn();\n },\n getBlackOpNames: function (): string[] {\n helper.updateDynamicRam(\"getBlackOpNames\", getRamCost(player, \"bladeburner\", \"getBlackOpNames\"));\n checkBladeburnerAccess(\"getBlackOpNames\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getBlackOpNamesNetscriptFn();\n },\n getBlackOpRank: function (name: any = \"\"): number {\n helper.updateDynamicRam(\"getBlackOpRank\", getRamCost(player, \"bladeburner\", \"getBlackOpRank\"));\n checkBladeburnerAccess(\"getBlackOpRank\");\n const action: any = getBladeburnerActionObject(\"getBlackOpRank\", \"blackops\", name);\n return action.reqdRank;\n },\n getGeneralActionNames: function (): string[] {\n helper.updateDynamicRam(\"getGeneralActionNames\", getRamCost(player, \"bladeburner\", \"getGeneralActionNames\"));\n checkBladeburnerAccess(\"getGeneralActionNames\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getGeneralActionNamesNetscriptFn();\n },\n getSkillNames: function (): string[] {\n helper.updateDynamicRam(\"getSkillNames\", getRamCost(player, \"bladeburner\", \"getSkillNames\"));\n checkBladeburnerAccess(\"getSkillNames\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getSkillNamesNetscriptFn();\n },\n startAction: function (type: any = \"\", name: any = \"\"): boolean {\n helper.updateDynamicRam(\"startAction\", getRamCost(player, \"bladeburner\", \"startAction\"));\n checkBladeburnerAccess(\"startAction\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.startActionNetscriptFn(player, type, name, workerScript);\n } catch (e: any) {\n throw helper.makeRuntimeErrorMsg(\"bladeburner.startAction\", e);\n }\n },\n stopBladeburnerAction: function (): void {\n helper.updateDynamicRam(\"stopBladeburnerAction\", getRamCost(player, \"bladeburner\", \"stopBladeburnerAction\"));\n checkBladeburnerAccess(\"stopBladeburnerAction\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.resetAction();\n },\n getCurrentAction: function (): BladeburnerCurAction {\n helper.updateDynamicRam(\"getCurrentAction\", getRamCost(player, \"bladeburner\", \"getCurrentAction\"));\n checkBladeburnerAccess(\"getCurrentAction\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getTypeAndNameFromActionId(bladeburner.action);\n },\n getActionTime: function (type: any = \"\", name: any = \"\"): number {\n helper.updateDynamicRam(\"getActionTime\", getRamCost(player, \"bladeburner\", \"getActionTime\"));\n checkBladeburnerAccess(\"getActionTime\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getActionTimeNetscriptFn(player, type, name, workerScript);\n } catch (e: any) {\n throw helper.makeRuntimeErrorMsg(\"bladeburner.getActionTime\", e);\n }\n },\n getActionEstimatedSuccessChance: function (type: any = \"\", name: any = \"\"): [number, number] {\n helper.updateDynamicRam(\n \"getActionEstimatedSuccessChance\",\n getRamCost(player, \"bladeburner\", \"getActionEstimatedSuccessChance\"),\n );\n checkBladeburnerAccess(\"getActionEstimatedSuccessChance\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getActionEstimatedSuccessChanceNetscriptFn(player, type, name, workerScript);\n } catch (e: any) {\n throw helper.makeRuntimeErrorMsg(\"bladeburner.getActionEstimatedSuccessChance\", e);\n }\n },\n getActionRepGain: function (type: any = \"\", name: any = \"\", level: any): number {\n helper.updateDynamicRam(\"getActionRepGain\", getRamCost(player, \"bladeburner\", \"getActionRepGain\"));\n checkBladeburnerAccess(\"getActionRepGain\");\n const action = getBladeburnerActionObject(\"getActionRepGain\", type, name);\n let rewardMultiplier;\n if (level == null || isNaN(level)) {\n rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n } else {\n rewardMultiplier = Math.pow(action.rewardFac, level - 1);\n }\n\n return action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank;\n },\n getActionCountRemaining: function (type: any = \"\", name: any = \"\"): number {\n helper.updateDynamicRam(\"getActionCountRemaining\", getRamCost(player, \"bladeburner\", \"getActionCountRemaining\"));\n checkBladeburnerAccess(\"getActionCountRemaining\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getActionCountRemainingNetscriptFn(type, name, workerScript);\n } catch (e: any) {\n throw helper.makeRuntimeErrorMsg(\"bladeburner.getActionCountRemaining\", e);\n }\n },\n getActionMaxLevel: function (type: any = \"\", name: any = \"\"): number {\n helper.updateDynamicRam(\"getActionMaxLevel\", getRamCost(player, \"bladeburner\", \"getActionMaxLevel\"));\n checkBladeburnerAccess(\"getActionMaxLevel\");\n const action = getBladeburnerActionObject(\"getActionMaxLevel\", type, name);\n return action.maxLevel;\n },\n getActionCurrentLevel: function (type: any = \"\", name: any = \"\"): number {\n helper.updateDynamicRam(\"getActionCurrentLevel\", getRamCost(player, \"bladeburner\", \"getActionCurrentLevel\"));\n checkBladeburnerAccess(\"getActionCurrentLevel\");\n const action = getBladeburnerActionObject(\"getActionCurrentLevel\", type, name);\n return action.level;\n },\n getActionAutolevel: function (type: any = \"\", name: any = \"\"): boolean {\n helper.updateDynamicRam(\"getActionAutolevel\", getRamCost(player, \"bladeburner\", \"getActionAutolevel\"));\n checkBladeburnerAccess(\"getActionAutolevel\");\n const action = getBladeburnerActionObject(\"getActionCurrentLevel\", type, name);\n return action.autoLevel;\n },\n setActionAutolevel: function (type: any = \"\", name: any = \"\", autoLevel: any = true): void {\n helper.updateDynamicRam(\"setActionAutolevel\", getRamCost(player, \"bladeburner\", \"setActionAutolevel\"));\n checkBladeburnerAccess(\"setActionAutolevel\");\n const action = getBladeburnerActionObject(\"setActionAutolevel\", type, name);\n action.autoLevel = autoLevel;\n },\n setActionLevel: function (type: any = \"\", name: any = \"\", level: any = 1): void {\n helper.updateDynamicRam(\"setActionLevel\", getRamCost(player, \"bladeburner\", \"setActionLevel\"));\n checkBladeburnerAccess(\"setActionLevel\");\n const action = getBladeburnerActionObject(\"setActionLevel\", type, name);\n if (level < 1 || level > action.maxLevel) {\n throw helper.makeRuntimeErrorMsg(\n \"bladeburner.setActionLevel\",\n `Level must be between 1 and ${action.maxLevel}, is ${level}`,\n );\n }\n action.level = level;\n },\n getRank: function (): number {\n helper.updateDynamicRam(\"getRank\", getRamCost(player, \"bladeburner\", \"getRank\"));\n checkBladeburnerAccess(\"getRank\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.rank;\n },\n getSkillPoints: function (): number {\n helper.updateDynamicRam(\"getSkillPoints\", getRamCost(player, \"bladeburner\", \"getSkillPoints\"));\n checkBladeburnerAccess(\"getSkillPoints\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.skillPoints;\n },\n getSkillLevel: function (skillName: any = \"\"): number {\n helper.updateDynamicRam(\"getSkillLevel\", getRamCost(player, \"bladeburner\", \"getSkillLevel\"));\n checkBladeburnerAccess(\"getSkillLevel\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getSkillLevelNetscriptFn(skillName, workerScript);\n } catch (e: any) {\n throw helper.makeRuntimeErrorMsg(\"bladeburner.getSkillLevel\", e);\n }\n },\n getSkillUpgradeCost: function (skillName: any = \"\"): number {\n helper.updateDynamicRam(\"getSkillUpgradeCost\", getRamCost(player, \"bladeburner\", \"getSkillUpgradeCost\"));\n checkBladeburnerAccess(\"getSkillUpgradeCost\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getSkillUpgradeCostNetscriptFn(skillName, workerScript);\n } catch (e: any) {\n throw helper.makeRuntimeErrorMsg(\"bladeburner.getSkillUpgradeCost\", e);\n }\n },\n upgradeSkill: function (skillName: any): boolean {\n helper.updateDynamicRam(\"upgradeSkill\", getRamCost(player, \"bladeburner\", \"upgradeSkill\"));\n checkBladeburnerAccess(\"upgradeSkill\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.upgradeSkillNetscriptFn(skillName, workerScript);\n } catch (e: any) {\n throw helper.makeRuntimeErrorMsg(\"bladeburner.upgradeSkill\", e);\n }\n },\n getTeamSize: function (type: any = \"\", name: any = \"\"): number {\n helper.updateDynamicRam(\"getTeamSize\", getRamCost(player, \"bladeburner\", \"getTeamSize\"));\n checkBladeburnerAccess(\"getTeamSize\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getTeamSizeNetscriptFn(type, name, workerScript);\n } catch (e: any) {\n throw helper.makeRuntimeErrorMsg(\"bladeburner.getTeamSize\", e);\n }\n },\n setTeamSize: function (type: any = \"\", name: any = \"\", size: any): number {\n helper.updateDynamicRam(\"setTeamSize\", getRamCost(player, \"bladeburner\", \"setTeamSize\"));\n checkBladeburnerAccess(\"setTeamSize\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.setTeamSizeNetscriptFn(type, name, size, workerScript);\n } catch (e: any) {\n throw helper.makeRuntimeErrorMsg(\"bladeburner.setTeamSize\", e);\n }\n },\n getCityEstimatedPopulation: function (cityName: any): number {\n helper.updateDynamicRam(\n \"getCityEstimatedPopulation\",\n getRamCost(player, \"bladeburner\", \"getCityEstimatedPopulation\"),\n );\n checkBladeburnerAccess(\"getCityEstimatedPopulation\");\n checkBladeburnerCity(\"getCityEstimatedPopulation\", cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].popEst;\n },\n getCityCommunities: function (cityName: any): number {\n helper.updateDynamicRam(\"getCityCommunities\", getRamCost(player, \"bladeburner\", \"getCityCommunities\"));\n checkBladeburnerAccess(\"getCityCommunities\");\n checkBladeburnerCity(\"getCityCommunities\", cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].comms;\n },\n getCityChaos: function (cityName: any): number {\n helper.updateDynamicRam(\"getCityChaos\", getRamCost(player, \"bladeburner\", \"getCityChaos\"));\n checkBladeburnerAccess(\"getCityChaos\");\n checkBladeburnerCity(\"getCityChaos\", cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].chaos;\n },\n getCity: function (): string {\n helper.updateDynamicRam(\"getCity\", getRamCost(player, \"bladeburner\", \"getCity\"));\n checkBladeburnerAccess(\"getCityChaos\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.city;\n },\n switchCity: function (cityName: any): boolean {\n helper.updateDynamicRam(\"switchCity\", getRamCost(player, \"bladeburner\", \"switchCity\"));\n checkBladeburnerAccess(\"switchCity\");\n checkBladeburnerCity(\"switchCity\", cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return (bladeburner.city = cityName);\n },\n getStamina: function (): [number, number] {\n helper.updateDynamicRam(\"getStamina\", getRamCost(player, \"bladeburner\", \"getStamina\"));\n checkBladeburnerAccess(\"getStamina\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return [bladeburner.stamina, bladeburner.maxStamina];\n },\n joinBladeburnerFaction: function (): boolean {\n helper.updateDynamicRam(\"joinBladeburnerFaction\", getRamCost(player, \"bladeburner\", \"joinBladeburnerFaction\"));\n checkBladeburnerAccess(\"joinBladeburnerFaction\", true);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.joinBladeburnerFactionNetscriptFn(workerScript);\n },\n joinBladeburnerDivision: function (): boolean {\n helper.updateDynamicRam(\"joinBladeburnerDivision\", getRamCost(player, \"bladeburner\", \"joinBladeburnerDivision\"));\n if (player.bitNodeN === 7 || player.sourceFileLvl(7) > 0) {\n if (player.bitNodeN === 8) {\n return false;\n }\n if (player.bladeburner instanceof Bladeburner) {\n return true; // Already member\n } else if (\n player.strength >= 100 &&\n player.defense >= 100 &&\n player.dexterity >= 100 &&\n player.agility >= 100\n ) {\n player.bladeburner = new Bladeburner(player);\n workerScript.log(\"joinBladeburnerDivision\", () => \"You have been accepted into the Bladeburner division\");\n\n return true;\n } else {\n workerScript.log(\n \"joinBladeburnerDivision\",\n () => \"You do not meet the requirements for joining the Bladeburner division\",\n );\n return false;\n }\n }\n return false;\n },\n getBonusTime: function (): number {\n helper.updateDynamicRam(\"getBonusTime\", getRamCost(player, \"bladeburner\", \"getBonusTime\"));\n checkBladeburnerAccess(\"getBonusTime\");\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return Math.round(bladeburner.storedCycles / 5);\n },\n };\n}\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { getRamCost } from \"../Netscript/RamCostGenerator\";\nimport { is2DArray } from \"../utils/helpers/is2DArray\";\nimport { CodingContract } from \"../CodingContracts\";\nimport { CodingContract as ICodingContract } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport function NetscriptCodingContract(\n player: IPlayer,\n workerScript: WorkerScript,\n helper: INetscriptHelper,\n): ICodingContract {\n const getCodingContract = function (func: any, hostname: any, filename: any): CodingContract {\n const server = helper.getServer(hostname, func);\n const contract = server.getContract(filename);\n if (contract == null) {\n throw helper.makeRuntimeErrorMsg(\n `codingcontract.${func}`,\n `Cannot find contract '${filename}' on server '${hostname}'`,\n );\n }\n\n return contract;\n };\n\n return {\n attempt: function (\n answer: any,\n filename: any,\n hostname: any = workerScript.hostname,\n { returnReward }: any = {},\n ): boolean | string {\n helper.updateDynamicRam(\"attempt\", getRamCost(player, \"codingcontract\", \"attempt\"));\n const contract = getCodingContract(\"attempt\", hostname, filename);\n\n // Convert answer to string. If the answer is a 2D array, then we have to\n // manually add brackets for the inner arrays\n if (is2DArray(answer)) {\n const answerComponents = [];\n for (let i = 0; i < answer.length; ++i) {\n answerComponents.push([\"[\", answer[i].toString(), \"]\"].join(\"\"));\n }\n\n answer = answerComponents.join(\",\");\n } else {\n answer = String(answer);\n }\n\n const creward = contract.reward;\n if (creward === null) throw new Error(\"Somehow solved a contract that didn't have a reward\");\n\n const serv = helper.getServer(hostname, \"codingcontract.attempt\");\n if (contract.isSolution(answer)) {\n const reward = player.gainCodingContractReward(creward, contract.getDifficulty());\n workerScript.log(\"codingcontract.attempt\", () => `Successfully completed Coding Contract '${filename}'. Reward: ${reward}`);\n serv.removeContract(filename);\n return returnReward ? reward : true;\n } else {\n ++contract.tries;\n if (contract.tries >= contract.getMaxNumTries()) {\n workerScript.log(\n \"codingcontract.attempt\",\n () => `Coding Contract attempt '${filename}' failed. Contract is now self-destructing`,\n );\n serv.removeContract(filename);\n } else {\n workerScript.log(\n \"codingcontract.attempt\",\n () =>\n `Coding Contract attempt '${filename}' failed. ${contract.getMaxNumTries() - contract.tries\n } attempts remaining.`,\n );\n }\n\n return returnReward ? \"\" : false;\n }\n },\n getContractType: function (filename: any, hostname: any = workerScript.hostname): string {\n helper.updateDynamicRam(\"getContractType\", getRamCost(player, \"codingcontract\", \"getContractType\"));\n const contract = getCodingContract(\"getContractType\", hostname, filename);\n return contract.getType();\n },\n getData: function (filename: any, hostname: any = workerScript.hostname): any {\n helper.updateDynamicRam(\"getData\", getRamCost(player, \"codingcontract\", \"getData\"));\n const contract = getCodingContract(\"getData\", hostname, filename);\n const data = contract.getData();\n if (data.constructor === Array) {\n // For two dimensional arrays, we have to copy the internal arrays using\n // slice() as well. As of right now, no contract has arrays that have\n // more than two dimensions\n const copy = data.slice();\n for (let i = 0; i < copy.length; ++i) {\n if (data[i].constructor === Array) {\n copy[i] = data[i].slice();\n }\n }\n\n return copy;\n } else {\n return data;\n }\n },\n getDescription: function (filename: any, hostname: any = workerScript.hostname): string {\n helper.updateDynamicRam(\"getDescription\", getRamCost(player, \"codingcontract\", \"getDescription\"));\n const contract = getCodingContract(\"getDescription\", hostname, filename);\n return contract.getDescription();\n },\n getNumTriesRemaining: function (filename: any, hostname: any = workerScript.hostname): number {\n helper.updateDynamicRam(\"getNumTriesRemaining\", getRamCost(player, \"codingcontract\", \"getNumTriesRemaining\"));\n const contract = getCodingContract(\"getNumTriesRemaining\", hostname, filename);\n return contract.getMaxNumTries() - contract.tries;\n },\n };\n}\n","// Checks whether an array is a 2D array.\n// For this, a 2D array is an array which contains only other arrays.\n// If one element in the array is a number or string, it is NOT a 2D array\nexport function is2DArray(arr: any[]): boolean {\n if (arr.constructor !== Array) {\n return false;\n }\n\n return arr.every((e) => {\n return e.constructor === Array;\n });\n}\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { netscriptDelay } from \"../NetscriptEvaluator\";\n\nimport { OfficeSpace } from \"../Corporation/OfficeSpace\";\nimport { Employee } from \"../Corporation/Employee\";\nimport { Product } from \"../Corporation/Product\";\nimport { Material } from \"../Corporation/Material\";\nimport { Warehouse } from \"../Corporation/Warehouse\";\nimport { IIndustry } from \"../Corporation/IIndustry\";\nimport { ICorporation } from \"../Corporation/ICorporation\";\n\nimport {\n Corporation as NSCorporation,\n CorporationInfo,\n Employee as NSEmployee,\n Product as NSProduct,\n Material as NSMaterial,\n Warehouse as NSWarehouse,\n Division as NSDivision,\n WarehouseAPI,\n OfficeAPI,\n InvestmentOffer\n} from \"../ScriptEditor/NetscriptDefinitions\";\n\nimport {\n NewIndustry,\n NewCity,\n UnlockUpgrade,\n LevelUpgrade,\n IssueDividends,\n SellMaterial,\n SellProduct,\n SetSmartSupply,\n BuyMaterial,\n AssignJob,\n UpgradeOfficeSize,\n ThrowParty,\n PurchaseWarehouse,\n UpgradeWarehouse,\n BuyCoffee,\n HireAdVert,\n MakeProduct,\n Research,\n ExportMaterial,\n CancelExportMaterial,\n SetMaterialMarketTA1,\n SetMaterialMarketTA2,\n SetProductMarketTA1,\n SetProductMarketTA2,\n SetSmartSupplyUseLeftovers,\n} from \"../Corporation/Actions\";\nimport { CorporationUnlockUpgrades } from \"../Corporation/data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrades } from \"../Corporation/data/CorporationUpgrades\";\nimport { EmployeePositions } from \"../Corporation/EmployeePositions\";\nimport { calculateIntelligenceBonus } from \"../PersonObjects/formulas/intelligence\";\nimport { Industry } from \"../Corporation/Industry\";\nimport { IndustryResearchTrees, IndustryStartingCosts } from \"../Corporation/IndustryData\";\nimport { CorporationConstants } from \"../Corporation/data/Constants\";\nimport { IndustryUpgrades } from \"../Corporation/IndustryUpgrades\";\nimport { ResearchMap } from \"../Corporation/ResearchMap\";\nimport { Factions } from \"../Faction/Factions\";\n\nexport function NetscriptCorporation(\n player: IPlayer,\n workerScript: WorkerScript,\n helper: INetscriptHelper,\n): NSCorporation {\n function createCorporation(corporationName: string, selfFund = true): boolean {\n if (!player.canAccessCorporation() || player.hasCorporation()) return false;\n if (!corporationName) return false;\n if (player.bitNodeN !== 3 && !selfFund) throw new Error(\"cannot use seed funds outside of BitNode 3\");\n\n if (selfFund) {\n if (!player.canAfford(150e9)) return false;\n\n player.startCorporation(corporationName);\n player.loseMoney(150e9, \"corporation\");\n } else {\n player.startCorporation(corporationName, 500e6);\n }\n return true;\n }\n\n function hasUnlockUpgrade(upgradeName: string): boolean {\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade[2] === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade[0];\n return corporation.unlockUpgrades[upgN] === 1;\n }\n\n function getUnlockUpgradeCost(upgradeName: string): number {\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade[2] === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n return upgrade[1];\n }\n\n function getUpgradeLevel(aupgradeName: string): number {\n const upgradeName = helper.string(\"levelUpgrade\", \"upgradeName\", aupgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade[4] === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade[0];\n return corporation.upgrades[upgN];\n }\n\n function getUpgradeLevelCost(aupgradeName: string): number {\n const upgradeName = helper.string(\"levelUpgrade\", \"upgradeName\", aupgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade[4] === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade[0];\n const baseCost = upgrade[1];\n const priceMult = upgrade[2];\n const level = corporation.upgrades[upgN];\n return baseCost * Math.pow(priceMult, level);\n }\n\n function getExpandIndustryCost(industryName: string): number {\n const cost = IndustryStartingCosts[industryName];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industryName}'`);\n }\n return cost;\n }\n\n function getExpandCityCost(): number {\n return CorporationConstants.OfficeInitialCost;\n }\n\n function getInvestmentOffer(): InvestmentOffer {\n const corporation = getCorporation();\n if (corporation.fundingRound >= CorporationConstants.FundingRoundShares.length || corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length || corporation.public) \n return {\n funds: 0,\n shares: 0,\n round: corporation.fundingRound + 1 // Make more readable \n }; // Don't throw an error here, no reason to have a second function to check if you can get investment.\n const val = corporation.determineValuation();\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n return {\n funds: funding,\n shares: investShares,\n round: corporation.fundingRound + 1 // Make more readable \n };\n }\n\n function acceptInvestmentOffer(): boolean {\n const corporation = getCorporation();\n if (corporation.fundingRound >= CorporationConstants.FundingRoundShares.length || corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length || corporation.public) return false;\n const val = corporation.determineValuation();\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n corporation.fundingRound++;\n corporation.addFunds(funding);\n corporation.numShares -= investShares;\n return true;\n }\n\n function goPublic(numShares: number): boolean {\n const corporation = getCorporation();\n const initialSharePrice = corporation.determineValuation() / corporation.totalShares;\n if (isNaN(numShares)) throw new Error(\"Invalid value for number of issued shares\");\n if (numShares < 0) throw new Error(\"Invalid value for number of issued shares\");\n if (numShares > corporation.numShares) throw new Error(\"You don't have that many shares to issue!\");\n corporation.public = true;\n corporation.sharePrice = initialSharePrice;\n corporation.issuedShares = numShares;\n corporation.numShares -= numShares;\n corporation.addFunds(numShares * initialSharePrice);\n return true;\n }\n\n function getResearchCost(division: IIndustry, researchName: string): number {\n const researchTree = IndustryResearchTrees[division.type];\n if (researchTree === undefined) throw new Error(`No research tree for industry '${division.type}'`);\n const allResearch = researchTree.getAllNodes();\n if (!allResearch.includes(researchName)) throw new Error(`No research named '${researchName}'`);\n const research = ResearchMap[researchName];\n return research.cost;\n }\n\n function hasResearched(division: IIndustry, researchName: string): boolean {\n return division.researched[researchName] === undefined ? false : division.researched[researchName] as boolean;\n }\n\n function bribe(factionName: string, amountCash: number, amountShares: number): boolean {\n if (!player.factions.includes(factionName)) throw new Error(\"Invalid faction name\");\n if (isNaN(amountCash) || amountCash < 0 || isNaN(amountShares) || amountShares < 0) throw new Error(\"Invalid value for amount field! Must be numeric, grater than 0.\");\n const corporation = getCorporation();\n if (corporation.funds < amountCash) return false;\n if (corporation.numShares < amountShares) return false;\n const faction = Factions[factionName]\n const info = faction.getInfo();\n if (!info.offersWork()) return false;\n if (player.hasGangWith(factionName)) return false;\n\n const repGain = (amountCash + amountShares * corporation.sharePrice) / CorporationConstants.BribeToRepRatio;\n faction.playerReputation += repGain;\n corporation.funds = corporation.funds - amountCash;\n corporation.numShares -= amountShares;\n\n return true;\n }\n\n function getCorporation(): ICorporation {\n const corporation = player.corporation;\n if (corporation === null) throw new Error(\"cannot be called without a corporation\");\n return corporation;\n }\n\n function getDivision(divisionName: any): IIndustry {\n const corporation = getCorporation();\n const division = corporation.divisions.find((div) => div.name === divisionName);\n if (division === undefined) throw new Error(`No division named '${divisionName}'`);\n return division;\n }\n\n function getOffice(divisionName: any, cityName: any): OfficeSpace {\n const division = getDivision(divisionName);\n if (!(cityName in division.offices)) throw new Error(`Invalid city name '${cityName}'`);\n const office = division.offices[cityName];\n if (office === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);\n return office;\n }\n\n function getWarehouse(divisionName: any, cityName: any): Warehouse {\n const division = getDivision(divisionName);\n if (!(cityName in division.warehouses)) throw new Error(`Invalid city name '${cityName}'`);\n const warehouse = division.warehouses[cityName];\n if (warehouse === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);\n return warehouse;\n }\n\n function getMaterial(divisionName: any, cityName: any, materialName: any): Material {\n const warehouse = getWarehouse(divisionName, cityName);\n const matName = (materialName as string).replace(/ /g, \"\");\n const material = warehouse.materials[matName];\n if (material === undefined) throw new Error(`Invalid material name: '${materialName}'`);\n return material;\n }\n\n function getProduct(divisionName: any, productName: any): Product {\n const division = getDivision(divisionName);\n const product = division.products[productName];\n if (product === undefined) throw new Error(`Invalid product name: '${productName}'`);\n return product;\n }\n\n function getEmployee(divisionName: any, cityName: any, employeeName: any): Employee {\n const office = getOffice(divisionName, cityName);\n const employee = office.employees.find((e) => e.name === employeeName);\n if (employee === undefined) throw new Error(`Invalid employee name: '${employeeName}'`);\n return employee;\n }\n\n function checkAccess(func: string, api?: number): void {\n if (player.corporation === null) throw helper.makeRuntimeErrorMsg(`corporation.${func}`, \"Must own a corporation.\");\n if (!api) return;\n\n if (!player.corporation.unlockUpgrades[api])\n throw helper.makeRuntimeErrorMsg(`corporation.${func}`, \"You do not have access to this API.\");\n }\n\n function getSafeDivision(division: Industry): NSDivision {\n const cities: string[] = [];\n for (const office of Object.values(division.offices)) {\n if (office === 0) continue;\n cities.push(office.loc);\n }\n return {\n name: division.name,\n type: division.type,\n awareness: division.awareness,\n popularity: division.popularity,\n prodMult: division.prodMult,\n research: division.sciResearch.qty,\n lastCycleRevenue: division.lastCycleRevenue,\n lastCycleExpenses: division.lastCycleExpenses,\n thisCycleRevenue: division.thisCycleRevenue,\n thisCycleExpenses: division.thisCycleExpenses,\n upgrades: division.upgrades,\n cities: cities,\n products: division.products === undefined ? [] : Object.keys(division.products),\n };\n }\n\n const warehouseAPI: WarehouseAPI = {\n getPurchaseWarehouseCost: function (): number {\n checkAccess(\"getPurchaseWarehouseCost\", 7);\n return CorporationConstants.WarehouseInitialCost;\n },\n getUpgradeWarehouseCost: function (adivisionName: any, acityName: any): number {\n checkAccess(\"upgradeWarehouse\", 7);\n const divisionName = helper.string(\"getUpgradeWarehouseCost\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"getUpgradeWarehouseCost\", \"cityName\", acityName);\n const warehouse = getWarehouse(divisionName, cityName);\n return CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, warehouse.level + 1);\n },\n hasWarehouse: function (adivisionName: any, acityName: any): boolean {\n checkAccess(\"hasWarehouse\", 7);\n const divisionName = helper.string(\"getWarehouse\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"getWarehouse\", \"cityName\", acityName);\n const division = getDivision(divisionName);\n if (!(cityName in division.warehouses)) throw new Error(`Invalid city name '${cityName}'`);\n const warehouse = division.warehouses[cityName];\n return warehouse !== 0;\n },\n getWarehouse: function (adivisionName: any, acityName: any): NSWarehouse {\n checkAccess(\"getWarehouse\", 7);\n const divisionName = helper.string(\"getWarehouse\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"getWarehouse\", \"cityName\", acityName);\n const warehouse = getWarehouse(divisionName, cityName);\n return {\n level: warehouse.level,\n loc: warehouse.loc,\n size: warehouse.size,\n sizeUsed: warehouse.sizeUsed,\n smartSupplyEnabled: warehouse.smartSupplyEnabled\n };\n },\n getMaterial: function (adivisionName: any, acityName: any, amaterialName: any): NSMaterial {\n checkAccess(\"getMaterial\", 7);\n const divisionName = helper.string(\"getMaterial\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"getMaterial\", \"cityName\", acityName);\n const materialName = helper.string(\"getMaterial\", \"materialName\", amaterialName);\n const material = getMaterial(divisionName, cityName, materialName);\n return {\n name: material.name,\n qty: material.qty,\n qlt: material.qlt,\n prod: material.prd,\n sell: material.sll,\n };\n },\n getProduct: function (adivisionName: any, aproductName: any): NSProduct {\n checkAccess(\"getProduct\", 7);\n const divisionName = helper.string(\"getProduct\", \"divisionName\", adivisionName);\n const productName = helper.string(\"getProduct\", \"productName\", aproductName);\n const product = getProduct(divisionName, productName);\n return {\n name: product.name,\n dmd: product.dmd,\n cmp: product.cmp,\n pCost: product.pCost,\n sCost: product.sCost,\n cityData: product.data,\n developmentProgress: product.prog,\n };\n },\n purchaseWarehouse: function (adivisionName: any, acityName: any): void {\n checkAccess(\"purchaseWarehouse\", 7);\n const divisionName = helper.string(\"purchaseWarehouse\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"purchaseWarehouse\", \"cityName\", acityName);\n const corporation = getCorporation();\n PurchaseWarehouse(corporation, getDivision(divisionName), cityName);\n },\n upgradeWarehouse: function (adivisionName: any, acityName: any): void {\n checkAccess(\"upgradeWarehouse\", 7);\n const divisionName = helper.string(\"upgradeWarehouse\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"upgradeWarehouse\", \"cityName\", acityName);\n const corporation = getCorporation();\n UpgradeWarehouse(corporation, getDivision(divisionName), getWarehouse(divisionName, cityName));\n },\n sellMaterial: function (adivisionName: any, acityName: any, amaterialName: any, aamt: any, aprice: any): void {\n checkAccess(\"sellMaterial\", 7);\n const divisionName = helper.string(\"sellMaterial\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"sellMaterial\", \"cityName\", acityName);\n const materialName = helper.string(\"sellMaterial\", \"materialName\", amaterialName);\n const amt = helper.string(\"sellMaterial\", \"amt\", aamt);\n const price = helper.string(\"sellMaterial\", \"price\", aprice);\n const material = getMaterial(divisionName, cityName, materialName);\n SellMaterial(material, amt, price);\n },\n sellProduct: function (\n adivisionName: any,\n acityName: any,\n aproductName: any,\n aamt: any,\n aprice: any,\n aall: any,\n ): void {\n checkAccess(\"sellProduct\", 7);\n const divisionName = helper.string(\"sellProduct\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"sellProduct\", \"cityName\", acityName);\n const productName = helper.string(\"sellProduct\", \"productName\", aproductName);\n const amt = helper.string(\"sellProduct\", \"amt\", aamt);\n const price = helper.string(\"sellProduct\", \"price\", aprice);\n const all = helper.boolean(aall);\n const product = getProduct(divisionName, productName);\n SellProduct(product, cityName, amt, price, all);\n },\n discontinueProduct: function (adivisionName: any, aproductName: any): void {\n checkAccess(\"discontinueProduct\", 7);\n const divisionName = helper.string(\"discontinueProduct\", \"divisionName\", adivisionName);\n const productName = helper.string(\"discontinueProduct\", \"productName\", aproductName);\n getDivision(divisionName).discontinueProduct(getProduct(divisionName, productName));\n },\n setSmartSupply: function (adivisionName: any, acityName: any, aenabled: any): void {\n checkAccess(\"setSmartSupply\", 7);\n const divisionName = helper.string(\"setSmartSupply\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"sellProduct\", \"cityName\", acityName);\n const enabled = helper.boolean(aenabled);\n const warehouse = getWarehouse(divisionName, cityName);\n SetSmartSupply(warehouse, enabled);\n },\n setSmartSupplyUseLeftovers: function (adivisionName: any, acityName: any, amaterialName: any, aenabled: any): void {\n checkAccess(\"setSmartSupplyUseLeftovers\", 7);\n const divisionName = helper.string(\"setSmartSupply\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"sellProduct\", \"cityName\", acityName);\n const materialName = helper.string(\"sellProduct\", \"materialName\", amaterialName);\n const enabled = helper.boolean(aenabled);\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n SetSmartSupplyUseLeftovers(warehouse, material, enabled);\n },\n buyMaterial: function (adivisionName: any, acityName: any, amaterialName: any, aamt: any): void {\n checkAccess(\"buyMaterial\", 7);\n const divisionName = helper.string(\"buyMaterial\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"buyMaterial\", \"cityName\", acityName);\n const materialName = helper.string(\"buyMaterial\", \"materialName\", amaterialName);\n const amt = helper.number(\"buyMaterial\", \"amt\", aamt);\n if (amt < 0) throw new Error(\"Invalid value for amount field! Must be numeric and grater than 0\");\n const material = getMaterial(divisionName, cityName, materialName);\n BuyMaterial(material, amt);\n },\n makeProduct: function (\n adivisionName: any,\n acityName: any,\n aproductName: any,\n adesignInvest: any,\n amarketingInvest: any,\n ): void {\n checkAccess(\"makeProduct\", 7);\n const divisionName = helper.string(\"makeProduct\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"makeProduct\", \"cityName\", acityName);\n const productName = helper.string(\"makeProduct\", \"productName\", aproductName);\n const designInvest = helper.number(\"makeProduct\", \"designInvest\", adesignInvest);\n const marketingInvest = helper.number(\"makeProduct\", \"marketingInvest\", amarketingInvest);\n const corporation = getCorporation();\n MakeProduct(corporation, getDivision(divisionName), cityName, productName, designInvest, marketingInvest);\n },\n exportMaterial: function (\n asourceDivision: any,\n asourceCity: any,\n atargetDivision: any,\n atargetCity: any,\n amaterialName: any,\n aamt: any,\n ): void {\n checkAccess(\"exportMaterial\", 7);\n const sourceDivision = helper.string(\"exportMaterial\", \"sourceDivision\", asourceDivision);\n const sourceCity = helper.string(\"exportMaterial\", \"sourceCity\", asourceCity);\n const targetDivision = helper.string(\"exportMaterial\", \"targetDivision\", atargetDivision);\n const targetCity = helper.string(\"exportMaterial\", \"targetCity\", atargetCity);\n const materialName = helper.string(\"exportMaterial\", \"materialName\", amaterialName);\n const amt = helper.string(\"exportMaterial\", \"amt\", aamt);\n ExportMaterial(targetDivision, targetCity, getMaterial(sourceDivision, sourceCity, materialName), amt + \"\");\n },\n cancelExportMaterial: function (\n asourceDivision: any,\n asourceCity: any,\n atargetDivision: any,\n atargetCity: any,\n amaterialName: any,\n aamt: any,\n ): void {\n checkAccess(\"cancelExportMaterial\", 7);\n const sourceDivision = helper.string(\"cancelExportMaterial\", \"sourceDivision\", asourceDivision);\n const sourceCity = helper.string(\"cancelExportMaterial\", \"sourceCity\", asourceCity);\n const targetDivision = helper.string(\"cancelExportMaterial\", \"targetDivision\", atargetDivision);\n const targetCity = helper.string(\"cancelExportMaterial\", \"targetCity\", atargetCity);\n const materialName = helper.string(\"cancelExportMaterial\", \"materialName\", amaterialName);\n const amt = helper.string(\"cancelExportMaterial\", \"amt\", aamt);\n CancelExportMaterial(targetDivision, targetCity, getMaterial(sourceDivision, sourceCity, materialName), amt + \"\");\n },\n setMaterialMarketTA1: function (adivisionName: any, acityName: any, amaterialName: any, aon: any): void {\n checkAccess(\"setMaterialMarketTA1\", 7);\n const divisionName = helper.string(\"setMaterialMarketTA1\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"setMaterialMarketTA1\", \"cityName\", acityName);\n const materialName = helper.string(\"setMaterialMarketTA1\", \"materialName\", amaterialName);\n const on = helper.boolean(aon);\n SetMaterialMarketTA1(getMaterial(divisionName, cityName, materialName), on);\n },\n setMaterialMarketTA2: function (adivisionName: any, acityName: any, amaterialName: any, aon: any): void {\n checkAccess(\"setMaterialMarketTA2\", 7);\n const divisionName = helper.string(\"setMaterialMarketTA2\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"setMaterialMarketTA2\", \"cityName\", acityName);\n const materialName = helper.string(\"setMaterialMarketTA2\", \"materialName\", amaterialName);\n const on = helper.boolean(aon);\n SetMaterialMarketTA2(getMaterial(divisionName, cityName, materialName), on);\n },\n setProductMarketTA1: function (adivisionName: any, aproductName: any, aon: any): void {\n checkAccess(\"setProductMarketTA1\", 7);\n const divisionName = helper.string(\"setProductMarketTA1\", \"divisionName\", adivisionName);\n const productName = helper.string(\"setProductMarketTA1\", \"productName\", aproductName);\n const on = helper.boolean(aon);\n SetProductMarketTA1(getProduct(divisionName, productName), on);\n },\n setProductMarketTA2: function (adivisionName: any, aproductName: any, aon: any): void {\n checkAccess(\"setProductMarketTA2\", 7);\n const divisionName = helper.string(\"setProductMarketTA2\", \"divisionName\", adivisionName);\n const productName = helper.string(\"setProductMarketTA2\", \"productName\", aproductName);\n const on = helper.boolean(aon);\n SetProductMarketTA2(getProduct(divisionName, productName), on);\n },\n };\n\n const officeAPI: OfficeAPI = {\n getHireAdVertCost: function (adivisionName: any): number {\n checkAccess(\"getHireAdVertCost\", 8);\n const divisionName = helper.string(\"getHireAdVertCost\", \"divisionName\", adivisionName);\n const division = getDivision(divisionName);\n const upgrade = IndustryUpgrades[1];\n return upgrade[1] * Math.pow(upgrade[2], division.upgrades[1]);\n },\n getHireAdVertCount: function (adivisionName: any): number {\n checkAccess(\"getHireAdVertCount\", 8);\n const divisionName = helper.string(\"getHireAdVertCount\", \"divisionName\", adivisionName);\n const division = getDivision(divisionName);\n return division.upgrades[1]\n },\n getResearchCost: function (adivisionName: any, aresearchName: any): number {\n checkAccess(\"getResearchCost\", 8);\n const divisionName = helper.string(\"getResearchCost\", \"divisionName\", adivisionName);\n const researchName = helper.string(\"getResearchCost\", \"researchName\", aresearchName);\n return getResearchCost(getDivision(divisionName), researchName);\n },\n hasResearched: function (adivisionName: any, aresearchName: any): boolean {\n checkAccess(\"hasResearched\", 8);\n const divisionName = helper.string(\"hasResearched\", \"divisionName\", adivisionName);\n const researchName = helper.string(\"hasResearched\", \"researchName\", aresearchName);\n return hasResearched(getDivision(divisionName), researchName);\n },\n setAutoJobAssignment: function (adivisionName: any, acityName: any, ajob: any, aamount: any): Promise<boolean> {\n checkAccess(\"setAutoJobAssignment\", 8);\n const divisionName = helper.string(\"setAutoJobAssignment\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"setAutoJobAssignment\", \"cityName\", acityName);\n const amount = helper.number(\"setAutoJobAssignment\", \"amount\", aamount);\n const job = helper.string(\"setAutoJobAssignment\", \"job\", ajob);\n const office = getOffice(divisionName, cityName);\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n return netscriptDelay(1000, workerScript).then(function () {\n if (workerScript.env.stopFlag) {\n return Promise.reject(workerScript);\n }\n return Promise.resolve(office.setEmployeeToJob(job, amount));\n });\n },\n getOfficeSizeUpgradeCost: function (adivisionName: any, acityName: any, asize: any): number {\n checkAccess(\"getOfficeSizeUpgradeCost\", 8);\n const divisionName = helper.string(\"getOfficeSizeUpgradeCost\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"getOfficeSizeUpgradeCost\", \"cityName\", acityName);\n const size = helper.number(\"getOfficeSizeUpgradeCost\", \"size\", asize);\n if (size < 0) throw new Error(\"Invalid value for size field! Must be numeric and grater than 0\");\n const office = getOffice(divisionName, cityName);\n const initialPriceMult = Math.round(office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n let mult = 0;\n for (let i = 0; i < size / CorporationConstants.OfficeInitialSize; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n return CorporationConstants.OfficeInitialCost * mult;\n },\n assignJob: function (adivisionName: any, acityName: any, aemployeeName: any, ajob: any): Promise<void> {\n checkAccess(\"assignJob\", 8);\n const divisionName = helper.string(\"assignJob\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"assignJob\", \"cityName\", acityName);\n const employeeName = helper.string(\"assignJob\", \"employeeName\", aemployeeName);\n const job = helper.string(\"assignJob\", \"job\", ajob);\n const employee = getEmployee(divisionName, cityName, employeeName);\n return netscriptDelay(1000, workerScript).then(function () {\n return Promise.resolve(AssignJob(employee, job));\n });\n },\n hireEmployee: function (adivisionName: any, acityName: any): any {\n checkAccess(\"hireEmployee\", 8);\n const divisionName = helper.string(\"hireEmployee\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"hireEmployee\", \"cityName\", acityName);\n const office = getOffice(divisionName, cityName);\n return office.hireRandomEmployee();\n },\n upgradeOfficeSize: function (adivisionName: any, acityName: any, asize: any): void {\n checkAccess(\"upgradeOfficeSize\", 8);\n const divisionName = helper.string(\"upgradeOfficeSize\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"upgradeOfficeSize\", \"cityName\", acityName);\n const size = helper.number(\"upgradeOfficeSize\", \"size\", asize);\n if (size < 0) throw new Error(\"Invalid value for size field! Must be numeric and grater than 0\");\n const office = getOffice(divisionName, cityName);\n const corporation = getCorporation();\n UpgradeOfficeSize(corporation, office, size);\n },\n throwParty: function (adivisionName: any, acityName: any, acostPerEmployee: any): Promise<number> {\n checkAccess(\"throwParty\", 8);\n const divisionName = helper.string(\"throwParty\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"throwParty\", \"cityName\", acityName);\n const costPerEmployee = helper.number(\"throwParty\", \"costPerEmployee\", acostPerEmployee);\n if (costPerEmployee < 0) throw new Error(\"Invalid value for Cost Per Employee field! Must be numeric and grater than 0\");\n const office = getOffice(divisionName, cityName);\n const corporation = getCorporation();\n return netscriptDelay(\n (60 * 1000) / (player.hacking_speed_mult * calculateIntelligenceBonus(player.intelligence, 1)),\n workerScript,\n ).then(function () {\n return Promise.resolve(ThrowParty(corporation, office, costPerEmployee));\n });\n },\n buyCoffee: function (adivisionName: any, acityName: any): Promise<void> {\n checkAccess(\"buyCoffee\", 8);\n const divisionName = helper.string(\"buyCoffee\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"buyCoffee\", \"cityName\", acityName);\n const corporation = getCorporation();\n return netscriptDelay(\n (60 * 1000) / (player.hacking_speed_mult * calculateIntelligenceBonus(player.intelligence, 1)),\n workerScript,\n ).then(function () {\n return Promise.resolve(BuyCoffee(corporation, getDivision(divisionName), getOffice(divisionName, cityName)));\n });\n },\n hireAdVert: function (adivisionName: any): void {\n checkAccess(\"hireAdVert\", 8);\n const divisionName = helper.string(\"hireAdVert\", \"divisionName\", adivisionName);\n const corporation = getCorporation();\n HireAdVert(corporation, getDivision(divisionName), getOffice(divisionName, \"Sector-12\"));\n },\n research: function (adivisionName: any, aresearchName: any): void {\n checkAccess(\"research\", 8);\n const divisionName = helper.string(\"research\", \"divisionName\", adivisionName);\n const researchName = helper.string(\"research\", \"researchName\", aresearchName);\n Research(getDivision(divisionName), researchName);\n },\n getOffice: function (adivisionName: any, acityName: any): any {\n checkAccess(\"getOffice\", 8);\n const divisionName = helper.string(\"getOffice\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"getOffice\", \"cityName\", acityName);\n const office = getOffice(divisionName, cityName);\n return {\n loc: office.loc,\n size: office.size,\n minEne: office.minEne,\n maxEne: office.maxEne,\n minHap: office.minHap,\n maxHap: office.maxHap,\n maxMor: office.maxMor,\n employees: office.employees.map((e) => e.name),\n employeeProd: {\n Operations: office.employeeProd[EmployeePositions.Operations],\n Engineer: office.employeeProd[EmployeePositions.Engineer],\n Business: office.employeeProd[EmployeePositions.Business],\n Management: office.employeeProd[EmployeePositions.Management],\n \"Research & Development\": office.employeeProd[EmployeePositions.RandD],\n Training: office.employeeProd[EmployeePositions.Training],\n },\n };\n },\n getEmployee: function (adivisionName: any, acityName: any, aemployeeName: any): NSEmployee {\n checkAccess(\"getEmployee\", 8);\n const divisionName = helper.string(\"getEmployee\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"getEmployee\", \"cityName\", acityName);\n const employeeName = helper.string(\"getEmployee\", \"employeeName\", aemployeeName);\n const employee = getEmployee(divisionName, cityName, employeeName);\n return {\n name: employee.name,\n mor: employee.mor,\n hap: employee.hap,\n ene: employee.ene,\n int: employee.int,\n cha: employee.cha,\n exp: employee.exp,\n cre: employee.cre,\n eff: employee.eff,\n sal: employee.sal,\n loc: employee.loc,\n pos: employee.pos,\n };\n },\n };\n\n return {\n ...warehouseAPI,\n ...officeAPI,\n expandIndustry: function (aindustryName: any, adivisionName: any): void {\n checkAccess(\"expandIndustry\");\n const industryName = helper.string(\"expandIndustry\", \"industryName\", aindustryName);\n const divisionName = helper.string(\"expandIndustry\", \"divisionName\", adivisionName);\n const corporation = getCorporation();\n NewIndustry(corporation, industryName, divisionName);\n },\n expandCity: function (adivisionName: any, acityName: any): void {\n checkAccess(\"expandCity\");\n const divisionName = helper.string(\"expandCity\", \"divisionName\", adivisionName);\n const cityName = helper.string(\"expandCity\", \"cityName\", acityName);\n if (!CorporationConstants.Cities.includes(cityName)) throw new Error(\"Invalid city name\");\n const corporation = getCorporation();\n const division = getDivision(divisionName);\n NewCity(corporation, division, cityName);\n },\n unlockUpgrade: function (aupgradeName: any): void {\n checkAccess(\"unlockUpgrade\");\n const upgradeName = helper.string(\"unlockUpgrade\", \"upgradeName\", aupgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade[2] === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n UnlockUpgrade(corporation, upgrade);\n },\n levelUpgrade: function (aupgradeName: any): void {\n checkAccess(\"levelUpgrade\");\n const upgradeName = helper.string(\"levelUpgrade\", \"upgradeName\", aupgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade[4] === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n LevelUpgrade(corporation, upgrade);\n },\n issueDividends: function (apercent: any): void {\n checkAccess(\"issueDividends\");\n const percent = helper.number(\"issueDividends\", \"percent\", apercent);\n if (percent < 0 || percent > 100) throw new Error(\"Invalid value for percent field! Must be numeric, grater than 0, and less than 100\");\n const corporation = getCorporation();\n IssueDividends(corporation, percent);\n },\n\n // If you modify these objects you will affect them for real, it's not\n // copies.\n getDivision: function (adivisionName: any): NSDivision {\n checkAccess(\"getDivision\");\n const divisionName = helper.string(\"getDivision\", \"divisionName\", adivisionName);\n const division = getDivision(divisionName);\n return getSafeDivision(division);\n },\n getCorporation: function (): CorporationInfo {\n checkAccess(\"getCorporation\");\n const corporation = getCorporation();\n return {\n name: corporation.name,\n funds: corporation.funds,\n revenue: corporation.revenue,\n expenses: corporation.expenses,\n public: corporation.public,\n totalShares: corporation.totalShares,\n numShares: corporation.numShares,\n shareSaleCooldown: corporation.shareSaleCooldown,\n issuedShares: corporation.issuedShares,\n sharePrice: corporation.sharePrice,\n state: corporation.state.getState(),\n divisions: corporation.divisions.map((division): NSDivision => getSafeDivision(division)),\n };\n },\n createCorporation: function (acorporationName: string, selfFund = true): boolean {\n const corporationName = helper.string(\"createCorporation\", \"corporationName\", acorporationName);\n return createCorporation(corporationName, selfFund);\n },\n hasUnlockUpgrade: function (aupgradeName: any): boolean {\n checkAccess(\"hasUnlockUpgrade\");\n const upgradeName = helper.string(\"hasUnlockUpgrade\", \"upgradeName\", aupgradeName);\n return hasUnlockUpgrade(upgradeName);\n },\n getUnlockUpgradeCost: function (aupgradeName: any): number {\n checkAccess(\"getUnlockUpgradeCost\");\n const upgradeName = helper.string(\"getUnlockUpgradeCost\", \"upgradeName\", aupgradeName);\n return getUnlockUpgradeCost(upgradeName);\n },\n getUpgradeLevel: function (aupgradeName: any): number {\n checkAccess(\"hasUnlockUpgrade\");\n const upgradeName = helper.string(\"getUpgradeLevel\", \"upgradeName\", aupgradeName);\n return getUpgradeLevel(upgradeName);\n },\n getUpgradeLevelCost: function (aupgradeName: any): number {\n checkAccess(\"getUpgradeLevelCost\");\n const upgradeName = helper.string(\"getUpgradeLevelCost\", \"upgradeName\", aupgradeName);\n return getUpgradeLevelCost(upgradeName);\n },\n getExpandIndustryCost: function (aindustryName: any): number {\n checkAccess(\"getExpandIndustryCost\");\n const industryName = helper.string(\"getExpandIndustryCost\", \"industryName\", aindustryName);\n return getExpandIndustryCost(industryName);\n },\n getExpandCityCost: function(): number {\n checkAccess(\"getExpandCityCost\");\n return getExpandCityCost();\n },\n getInvestmentOffer: function(): InvestmentOffer {\n checkAccess(\"getInvestmentOffer\");\n return getInvestmentOffer();\n },\n acceptInvestmentOffer: function(): boolean {\n checkAccess(\"acceptInvestmentOffer\");\n return acceptInvestmentOffer();\n },\n goPublic: function(anumShares: any): boolean {\n checkAccess(\"acceptInvestmentOffer\");\n const numShares = helper.number(\"goPublic\", \"numShares\", anumShares);\n return goPublic(numShares);\n },\n bribe: function(afactionName: string, aamountCash: any, aamountShares: any): boolean {\n checkAccess(\"bribe\");\n const factionName = helper.string(\"bribe\", \"factionName\", afactionName);\n const amountCash = helper.number(\"bribe\", \"amountCash\", aamountCash);\n const amountShares = helper.number(\"bribe\", \"amountShares\", aamountShares);\n return bribe(factionName, amountCash, amountShares);\n },\n };\n}\n","import { Reviver, Generic_toJSON, Generic_fromJSON } from \"../utils/JSONReviver\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { Industries, IndustryStartingCosts, IndustryResearchTrees } from \"./IndustryData\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { Material } from \"./Material\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { calculateEffectWithFactors } from \"../utils/calculateEffectWithFactors\";\nimport { OfficeSpace } from \"./OfficeSpace\";\nimport { Product } from \"./Product\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { isString } from \"../utils/helpers/isString\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { Warehouse } from \"./Warehouse\";\nimport { ICorporation } from \"./ICorporation\";\nimport { IIndustry } from \"./IIndustry\";\nimport { IndustryUpgrade, IndustryUpgrades } from \"./IndustryUpgrades\";\n\ninterface IParams {\n name?: string;\n corp?: ICorporation;\n type?: string;\n}\n\nexport class Industry implements IIndustry {\n name = \"\";\n type = Industries.Agriculture;\n sciResearch = new Material({ name: \"Scientific Research\" });\n researched: { [key: string]: boolean | undefined } = {};\n reqMats: { [key: string]: number | undefined } = {};\n\n //An array of the name of materials being produced\n prodMats: string[] = [];\n\n products: { [key: string]: Product | undefined } = {};\n makesProducts = false;\n\n awareness = 0;\n popularity = 0; //Should always be less than awareness\n startingCost = 0;\n\n /* The following are factors for how much production/other things are increased by\n different factors. The production increase always has diminishing returns,\n and they are all reprsented by exponentials of < 1 (e.g x ^ 0.5, x ^ 0.8)\n The number for these represent the exponential. A lower number means more\n diminishing returns */\n reFac = 0; //Real estate Factor\n sciFac = 0; //Scientific Research Factor, affects quality\n hwFac = 0; //Hardware factor\n robFac = 0; //Robotics Factor\n aiFac = 0; //AI Cores factor;\n advFac = 0; //Advertising factor, affects sales\n\n prodMult = 0; //Production multiplier\n\n //Financials\n lastCycleRevenue: number;\n lastCycleExpenses: number;\n thisCycleRevenue: number;\n thisCycleExpenses: number;\n\n //Upgrades\n upgrades: number[] = Array(Object.keys(IndustryUpgrades).length).fill(0);\n\n state = \"START\";\n newInd = true;\n\n //Maps locations to warehouses. 0 if no warehouse at that location\n warehouses: { [key: string]: Warehouse | 0 };\n\n //Maps locations to offices. 0 if no office at that location\n offices: { [key: string]: OfficeSpace | 0 } = {\n [CityName.Aevum]: 0,\n [CityName.Chongqing]: 0,\n [CityName.Sector12]: new OfficeSpace({\n loc: CityName.Sector12,\n size: CorporationConstants.OfficeInitialSize,\n }),\n [CityName.NewTokyo]: 0,\n [CityName.Ishima]: 0,\n [CityName.Volhaven]: 0,\n };\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"\";\n this.type = params.type ? params.type : Industries.Agriculture;\n\n //Financials\n this.lastCycleRevenue = 0;\n this.lastCycleExpenses = 0;\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n\n this.warehouses = {\n [CityName.Aevum]: 0,\n [CityName.Chongqing]: 0,\n [CityName.Sector12]: new Warehouse({\n corp: params.corp,\n industry: this,\n loc: CityName.Sector12,\n size: CorporationConstants.WarehouseInitialSize,\n }),\n [CityName.NewTokyo]: 0,\n [CityName.Ishima]: 0,\n [CityName.Volhaven]: 0,\n };\n\n this.init();\n }\n\n init(): void {\n //Set the unique properties of an industry (how much its affected by real estate/scientific research, etc.)\n const startingCost = IndustryStartingCosts[this.type];\n if (startingCost === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.startingCost = startingCost;\n switch (this.type) {\n case Industries.Energy:\n this.reFac = 0.65;\n this.sciFac = 0.7;\n this.robFac = 0.05;\n this.aiFac = 0.3;\n this.advFac = 0.08;\n this.reqMats = {\n Hardware: 0.1,\n Metal: 0.2,\n };\n this.prodMats = [\"Energy\"];\n break;\n case Industries.Utilities:\n case \"Utilities\":\n this.reFac = 0.5;\n this.sciFac = 0.6;\n this.robFac = 0.4;\n this.aiFac = 0.4;\n this.advFac = 0.08;\n this.reqMats = {\n Hardware: 0.1,\n Metal: 0.1,\n };\n this.prodMats = [\"Water\"];\n break;\n case Industries.Agriculture:\n this.reFac = 0.72;\n this.sciFac = 0.5;\n this.hwFac = 0.2;\n this.robFac = 0.3;\n this.aiFac = 0.3;\n this.advFac = 0.04;\n this.reqMats = {\n Water: 0.5,\n Energy: 0.5,\n };\n this.prodMats = [\"Plants\", \"Food\"];\n break;\n case Industries.Fishing:\n this.reFac = 0.15;\n this.sciFac = 0.35;\n this.hwFac = 0.35;\n this.robFac = 0.5;\n this.aiFac = 0.2;\n this.advFac = 0.08;\n this.reqMats = {\n Energy: 0.5,\n };\n this.prodMats = [\"Food\"];\n break;\n case Industries.Mining:\n this.reFac = 0.3;\n this.sciFac = 0.26;\n this.hwFac = 0.4;\n this.robFac = 0.45;\n this.aiFac = 0.45;\n this.advFac = 0.06;\n this.reqMats = {\n Energy: 0.8,\n };\n this.prodMats = [\"Metal\"];\n break;\n case Industries.Food:\n //reFac is unique for this bc it diminishes greatly per city. Handle this separately in code?\n this.sciFac = 0.12;\n this.hwFac = 0.15;\n this.robFac = 0.3;\n this.aiFac = 0.25;\n this.advFac = 0.25;\n this.reFac = 0.05;\n this.reqMats = {\n Food: 0.5,\n Water: 0.5,\n Energy: 0.2,\n };\n this.makesProducts = true;\n break;\n case Industries.Tobacco:\n this.reFac = 0.15;\n this.sciFac = 0.75;\n this.hwFac = 0.15;\n this.robFac = 0.2;\n this.aiFac = 0.15;\n this.advFac = 0.2;\n this.reqMats = {\n Plants: 1,\n Water: 0.2,\n };\n this.makesProducts = true;\n break;\n case Industries.Chemical:\n this.reFac = 0.25;\n this.sciFac = 0.75;\n this.hwFac = 0.2;\n this.robFac = 0.25;\n this.aiFac = 0.2;\n this.advFac = 0.07;\n this.reqMats = {\n Plants: 1,\n Energy: 0.5,\n Water: 0.5,\n };\n this.prodMats = [\"Chemicals\"];\n break;\n case Industries.Pharmaceutical:\n this.reFac = 0.05;\n this.sciFac = 0.8;\n this.hwFac = 0.15;\n this.robFac = 0.25;\n this.aiFac = 0.2;\n this.advFac = 0.16;\n this.reqMats = {\n Chemicals: 2,\n Energy: 1,\n Water: 0.5,\n };\n this.prodMats = [\"Drugs\"];\n this.makesProducts = true;\n break;\n case Industries.Computer:\n case \"Computer\":\n this.reFac = 0.2;\n this.sciFac = 0.62;\n this.robFac = 0.36;\n this.aiFac = 0.19;\n this.advFac = 0.17;\n this.reqMats = {\n Metal: 2,\n Energy: 1,\n };\n this.prodMats = [\"Hardware\"];\n this.makesProducts = true;\n break;\n case Industries.Robotics:\n this.reFac = 0.32;\n this.sciFac = 0.65;\n this.aiFac = 0.36;\n this.advFac = 0.18;\n this.hwFac = 0.19;\n this.reqMats = {\n Hardware: 5,\n Energy: 3,\n };\n this.prodMats = [\"Robots\"];\n this.makesProducts = true;\n break;\n case Industries.Software:\n this.sciFac = 0.62;\n this.advFac = 0.16;\n this.hwFac = 0.25;\n this.reFac = 0.15;\n this.aiFac = 0.18;\n this.robFac = 0.05;\n this.reqMats = {\n Hardware: 0.5,\n Energy: 0.5,\n };\n this.prodMats = [\"AICores\"];\n this.makesProducts = true;\n break;\n case Industries.Healthcare:\n this.reFac = 0.1;\n this.sciFac = 0.75;\n this.advFac = 0.11;\n this.hwFac = 0.1;\n this.robFac = 0.1;\n this.aiFac = 0.1;\n this.reqMats = {\n Robots: 10,\n AICores: 5,\n Energy: 5,\n Water: 5,\n };\n this.makesProducts = true;\n break;\n case Industries.RealEstate:\n this.robFac = 0.6;\n this.aiFac = 0.6;\n this.advFac = 0.25;\n this.sciFac = 0.05;\n this.hwFac = 0.05;\n this.reqMats = {\n Metal: 5,\n Energy: 5,\n Water: 2,\n Hardware: 4,\n };\n this.prodMats = [\"RealEstate\"];\n this.makesProducts = true;\n break;\n default:\n console.error(`Invalid Industry Type passed into Industry.init(): ${this.type}`);\n return;\n }\n }\n\n getProductDescriptionText(): string {\n if (!this.makesProducts) return \"\";\n switch (this.type) {\n case Industries.Food:\n return \"create and manage restaurants\";\n case Industries.Tobacco:\n return \"create tobacco and tobacco-related products\";\n case Industries.Pharmaceutical:\n return \"develop new pharmaceutical drugs\";\n case Industries.Computer:\n case \"Computer\":\n return \"create new computer hardware and networking infrastructures\";\n case Industries.Robotics:\n return \"build specialized robots and robot-related products\";\n case Industries.Software:\n return \"develop computer software\";\n case Industries.Healthcare:\n return \"build and manage hospitals\";\n case Industries.RealEstate:\n return \"develop and manage real estate properties\";\n default:\n console.error(\"Invalid industry type in Industry.getProductDescriptionText\");\n return \"\";\n }\n }\n\n getMaximumNumberProducts(): number {\n if (!this.makesProducts) return 0;\n\n // Calculate additional number of allowed Products from Research/Upgrades\n let additional = 0;\n if (this.hasResearch(\"uPgrade: Capacity.I\")) ++additional;\n if (this.hasResearch(\"uPgrade: Capacity.II\")) ++additional;\n\n return CorporationConstants.BaseMaxProducts + additional;\n }\n\n hasMaximumNumberProducts(): boolean {\n return Object.keys(this.products).length >= this.getMaximumNumberProducts();\n }\n\n //Calculates the values that factor into the production and properties of\n //materials/products (such as quality, etc.)\n calculateProductionFactors(): void {\n let multSum = 0;\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const warehouse = this.warehouses[city];\n if (!(warehouse instanceof Warehouse)) {\n continue;\n }\n\n const materials = warehouse.materials;\n\n const cityMult =\n Math.pow(0.002 * materials.RealEstate.qty + 1, this.reFac) *\n Math.pow(0.002 * materials.Hardware.qty + 1, this.hwFac) *\n Math.pow(0.002 * materials.Robots.qty + 1, this.robFac) *\n Math.pow(0.002 * materials.AICores.qty + 1, this.aiFac);\n multSum += Math.pow(cityMult, 0.73);\n }\n\n multSum < 1 ? (this.prodMult = 1) : (this.prodMult = multSum);\n }\n\n updateWarehouseSizeUsed(warehouse: Warehouse): void {\n warehouse.updateMaterialSizeUsed();\n\n for (const prodName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(prodName)) {\n const prod = this.products[prodName];\n if (prod === undefined) continue;\n warehouse.sizeUsed += prod.data[warehouse.loc][0] * prod.siz;\n }\n }\n }\n\n process(marketCycles = 1, state: string, corporation: ICorporation): void {\n this.state = state;\n\n //At the start of a cycle, store and reset revenue/expenses\n //Then calculate salaries and processs the markets\n if (state === \"START\") {\n if (isNaN(this.thisCycleRevenue) || isNaN(this.thisCycleExpenses)) {\n console.error(\"NaN in Corporation's computed revenue/expenses\");\n dialogBoxCreate(\n \"Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer\",\n );\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n }\n this.lastCycleRevenue = this.thisCycleRevenue / (marketCycles * CorporationConstants.SecsPerMarketCycle);\n this.lastCycleExpenses = this.thisCycleExpenses / (marketCycles * CorporationConstants.SecsPerMarketCycle);\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n\n // Once you start making revenue, the player should no longer be\n // considered new, and therefore no longer needs the 'tutorial' UI elements\n if (this.lastCycleRevenue > 0) {\n this.newInd = false;\n }\n\n // Process offices (and the employees in them)\n let employeeSalary = 0;\n for (const officeLoc of Object.keys(this.offices)) {\n const office = this.offices[officeLoc];\n if (office === 0) continue;\n if (office instanceof OfficeSpace) {\n employeeSalary += office.process(marketCycles, corporation, this);\n }\n }\n this.thisCycleExpenses = this.thisCycleExpenses + employeeSalary;\n\n // Process change in demand/competition of materials/products\n this.processMaterialMarket();\n this.processProductMarket(marketCycles);\n\n // Process loss of popularity\n this.popularity -= marketCycles * 0.0001;\n this.popularity = Math.max(0, this.popularity);\n\n // Process Dreamsense gains\n const popularityGain = corporation.getDreamSenseGain(),\n awarenessGain = popularityGain * 4;\n if (popularityGain > 0) {\n const awareness = this.awareness + (awarenessGain * marketCycles);\n this.awareness = Math.min(awareness, Number.MAX_VALUE);\n\n const popularity = this.popularity + (popularityGain * marketCycles);\n this.popularity = Math.min(popularity, Number.MAX_VALUE);\n }\n\n return;\n }\n\n // Process production, purchase, and import/export of materials\n let res = this.processMaterials(marketCycles, corporation);\n if (Array.isArray(res)) {\n this.thisCycleRevenue = this.thisCycleRevenue + res[0];\n this.thisCycleExpenses = this.thisCycleExpenses + res[1];\n }\n\n // Process creation, production & sale of products\n res = this.processProducts(marketCycles, corporation);\n if (Array.isArray(res)) {\n this.thisCycleRevenue = this.thisCycleRevenue + res[0];\n this.thisCycleExpenses = this.thisCycleExpenses + res[1];\n }\n }\n\n // Process change in demand and competition for this industry's materials\n processMaterialMarket(): void {\n //References to prodMats and reqMats\n const reqMats = this.reqMats,\n prodMats = this.prodMats;\n\n //Only 'process the market' for materials that this industry deals with\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n //If this industry has a warehouse in this city, process the market\n //for every material this industry requires or produces\n if (this.warehouses[CorporationConstants.Cities[i]] instanceof Warehouse) {\n const wh = this.warehouses[CorporationConstants.Cities[i]];\n if (wh === 0) continue;\n for (const name of Object.keys(reqMats)) {\n if (reqMats.hasOwnProperty(name)) {\n wh.materials[name].processMarket();\n }\n }\n\n //Produced materials are stored in an array\n for (let foo = 0; foo < prodMats.length; ++foo) {\n wh.materials[prodMats[foo]].processMarket();\n }\n\n //Process these twice because these boost production\n wh.materials[\"Hardware\"].processMarket();\n wh.materials[\"Robots\"].processMarket();\n wh.materials[\"AICores\"].processMarket();\n wh.materials[\"RealEstate\"].processMarket();\n }\n }\n }\n\n // Process change in demand and competition for this industry's products\n processProductMarket(marketCycles = 1): void {\n // Demand gradually decreases, and competition gradually increases\n for (const name of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(name)) {\n const product = this.products[name];\n if (product === undefined) continue;\n let change = getRandomInt(0, 3) * 0.0004;\n if (change === 0) continue;\n\n if (\n this.type === Industries.Pharmaceutical ||\n this.type === Industries.Software ||\n this.type === Industries.Robotics\n ) {\n change *= 3;\n }\n change *= marketCycles;\n product.dmd -= change;\n product.cmp += change;\n product.cmp = Math.min(product.cmp, 99.99);\n product.dmd = Math.max(product.dmd, 0.001);\n }\n }\n }\n\n //Process production, purchase, and import/export of materials\n processMaterials(marketCycles = 1, corporation: ICorporation): [number, number] {\n let revenue = 0,\n expenses = 0;\n this.calculateProductionFactors();\n\n //At the start of the export state, set the imports of everything to 0\n if (this.state === \"EXPORT\") {\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n if (!(this.warehouses[city] instanceof Warehouse)) {\n continue;\n }\n const warehouse = this.warehouses[city];\n if (warehouse === 0) continue;\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n mat.imp = 0;\n }\n }\n }\n }\n\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const office = this.offices[city];\n if (office === 0) continue;\n\n if (this.warehouses[city] instanceof Warehouse) {\n const warehouse = this.warehouses[city];\n if (warehouse === 0) continue;\n\n switch (this.state) {\n case \"PURCHASE\": {\n /* Process purchase of materials */\n for (const matName of Object.keys(warehouse.materials)) {\n if (!warehouse.materials.hasOwnProperty(matName)) continue;\n const mat = warehouse.materials[matName];\n let buyAmt = 0;\n let maxAmt = 0;\n if (warehouse.smartSupplyEnabled && Object.keys(this.reqMats).includes(matName)) {\n continue;\n }\n buyAmt = mat.buy * CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialSizes[matName]);\n\n buyAmt = Math.min(buyAmt, maxAmt);\n if (buyAmt > 0) {\n mat.qty += buyAmt;\n expenses += buyAmt * mat.bCost;\n }\n this.updateWarehouseSizeUsed(warehouse);\n } //End process purchase of materials\n\n // smart supply\n const smartBuy: { [key: string]: number | undefined } = {};\n for (const matName of Object.keys(warehouse.materials)) {\n if (!warehouse.materials.hasOwnProperty(matName)) continue;\n if (!warehouse.smartSupplyEnabled || !Object.keys(this.reqMats).includes(matName)) continue;\n const mat = warehouse.materials[matName];\n\n //Smart supply tracker is stored as per second rate\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n mat.buy = reqMat * warehouse.smartSupplyStore;\n let buyAmt = mat.buy * CorporationConstants.SecsPerMarketCycle * marketCycles;\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialSizes[matName]);\n buyAmt = Math.min(buyAmt, maxAmt);\n if (buyAmt > 0) smartBuy[matName] = buyAmt;\n }\n\n // Find which material were trying to create the least amount of product with.\n let worseAmt = 1e99;\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n const amt = buyAmt / reqMat;\n if (amt < worseAmt) worseAmt = amt;\n }\n\n // Align all the materials to the smallest amount.\n for (const matName of Object.keys(smartBuy)) {\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n smartBuy[matName] = worseAmt * reqMat;\n }\n\n // Calculate the total size of all things were trying to buy\n let totalSize = 0;\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n totalSize += buyAmt * MaterialSizes[matName];\n }\n\n // Shrink to the size of available space.\n const freeSpace = warehouse.size - warehouse.sizeUsed;\n if (totalSize > freeSpace) {\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n smartBuy[matName] = Math.floor((buyAmt * freeSpace) / totalSize);\n }\n }\n\n // Use the materials already in the warehouse if the option is on.\n for (const matName of Object.keys(smartBuy)) {\n if (!warehouse.smartSupplyUseLeftovers[matName]) continue;\n const mat = warehouse.materials[matName];\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n smartBuy[matName] = Math.max(0, buyAmt - mat.qty);\n }\n\n // buy them\n for (const matName of Object.keys(smartBuy)) {\n const mat = warehouse.materials[matName];\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n mat.qty += buyAmt;\n expenses += buyAmt * mat.bCost;\n }\n break;\n }\n case \"PRODUCTION\":\n warehouse.smartSupplyStore = 0; //Reset smart supply amount\n\n /* Process production of materials */\n if (this.prodMats.length > 0) {\n const mat = warehouse.materials[this.prodMats[0]];\n //Calculate the maximum production of this material based\n //on the office's productivity\n const maxProd =\n this.getOfficeProductivity(office) *\n this.prodMult * // Multiplier from materials\n corporation.getProductionMultiplier() *\n this.getProductionMultiplier(); // Multiplier from Research\n let prod;\n\n if (mat.prdman[0]) {\n //Production is manually limited\n prod = Math.min(maxProd, mat.prdman[1]);\n } else {\n prod = maxProd;\n }\n prod *= CorporationConstants.SecsPerMarketCycle * marketCycles; //Convert production from per second to per market cycle\n\n // Calculate net change in warehouse storage making the produced materials will cost\n let totalMatSize = 0;\n for (let tmp = 0; tmp < this.prodMats.length; ++tmp) {\n totalMatSize += MaterialSizes[this.prodMats[tmp]];\n }\n for (const reqMatName of Object.keys(this.reqMats)) {\n const normQty = this.reqMats[reqMatName];\n if (normQty === undefined) continue;\n totalMatSize -= MaterialSizes[reqMatName] * normQty;\n }\n // If not enough space in warehouse, limit the amount of produced materials\n if (totalMatSize > 0) {\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / totalMatSize);\n prod = Math.min(maxAmt, prod);\n }\n\n if (prod < 0) {\n prod = 0;\n }\n\n // Keep track of production for smart supply (/s)\n warehouse.smartSupplyStore += prod / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n\n // Make sure we have enough resource to make our materials\n let producableFrac = 1;\n for (const reqMatName of Object.keys(this.reqMats)) {\n if (this.reqMats.hasOwnProperty(reqMatName)) {\n const reqMat = this.reqMats[reqMatName];\n if (reqMat === undefined) continue;\n const req = reqMat * prod;\n if (warehouse.materials[reqMatName].qty < req) {\n producableFrac = Math.min(producableFrac, warehouse.materials[reqMatName].qty / req);\n }\n }\n }\n if (producableFrac <= 0) {\n producableFrac = 0;\n prod = 0;\n }\n\n // Make our materials if they are producable\n if (producableFrac > 0 && prod > 0) {\n for (const reqMatName of Object.keys(this.reqMats)) {\n const reqMat = this.reqMats[reqMatName];\n if (reqMat === undefined) continue;\n const reqMatQtyNeeded = reqMat * prod * producableFrac;\n warehouse.materials[reqMatName].qty -= reqMatQtyNeeded;\n warehouse.materials[reqMatName].prd = 0;\n warehouse.materials[reqMatName].prd -=\n reqMatQtyNeeded / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n }\n for (let j = 0; j < this.prodMats.length; ++j) {\n warehouse.materials[this.prodMats[j]].qty += prod * producableFrac;\n warehouse.materials[this.prodMats[j]].qlt =\n office.employeeProd[EmployeePositions.Engineer] / 90 +\n Math.pow(this.sciResearch.qty, this.sciFac) +\n Math.pow(warehouse.materials[\"AICores\"].qty, this.aiFac) / 10e3;\n }\n } else {\n for (const reqMatName of Object.keys(this.reqMats)) {\n if (this.reqMats.hasOwnProperty(reqMatName)) {\n warehouse.materials[reqMatName].prd = 0;\n }\n }\n }\n\n //Per second\n const fooProd = (prod * producableFrac) / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n for (let fooI = 0; fooI < this.prodMats.length; ++fooI) {\n warehouse.materials[this.prodMats[fooI]].prd = fooProd;\n }\n } else {\n //If this doesn't produce any materials, then it only creates\n //Products. Creating products will consume materials. The\n //Production of all consumed materials must be set to 0\n for (const reqMatName of Object.keys(this.reqMats)) {\n warehouse.materials[reqMatName].prd = 0;\n }\n }\n break;\n\n case \"SALE\":\n /* Process sale of materials */\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n if (mat.sCost < 0 || mat.sllman[0] === false) {\n mat.sll = 0;\n continue;\n }\n\n // Sale multipliers\n const businessFactor = this.getBusinessFactor(office); //Business employee productivity\n const advertisingFactor = this.getAdvertisingFactors()[0]; //Awareness + popularity\n const marketFactor = this.getMarketFactor(mat); //Competition + demand\n\n // Determine the cost that the material will be sold at\n const markupLimit = mat.getMarkupLimit();\n let sCost;\n if (mat.marketTa2) {\n const prod = mat.prd;\n\n // Reverse engineer the 'maxSell' formula\n // 1. Set 'maxSell' = prod\n // 2. Substitute formula for 'markup'\n // 3. Solve for 'sCost'\n const numerator = markupLimit;\n const sqrtNumerator = prod;\n const sqrtDenominator =\n (mat.qlt + 0.001) *\n marketFactor *\n businessFactor *\n corporation.getSalesMultiplier() *\n advertisingFactor *\n this.getSalesMultiplier();\n const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator);\n let optimalPrice;\n if (sqrtDenominator === 0 || denominator === 0) {\n if (sqrtNumerator === 0) {\n optimalPrice = 0; // No production\n } else {\n optimalPrice = mat.bCost + markupLimit;\n console.warn(`In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost`);\n }\n } else {\n optimalPrice = numerator / denominator + mat.bCost;\n }\n\n // We'll store this \"Optimal Price\" in a property so that we don't have\n // to re-calculate it for the UI\n mat.marketTa2Price = optimalPrice;\n\n sCost = optimalPrice;\n } else if (mat.marketTa1) {\n sCost = mat.bCost + markupLimit;\n } else if (isString(mat.sCost)) {\n sCost = (mat.sCost as string).replace(/MP/g, mat.bCost + \"\");\n sCost = eval(sCost);\n } else {\n sCost = mat.sCost;\n }\n\n // Calculate how much of the material sells (per second)\n let markup = 1;\n if (sCost > mat.bCost) {\n //Penalty if difference between sCost and bCost is greater than markup limit\n if (sCost - mat.bCost > markupLimit) {\n markup = Math.pow(markupLimit / (sCost - mat.bCost), 2);\n }\n } else if (sCost < mat.bCost) {\n if (sCost <= 0) {\n markup = 1e12; //Sell everything, essentially discard\n } else {\n //Lower prices than market increases sales\n markup = mat.bCost / sCost;\n }\n }\n\n const maxSell =\n (mat.qlt + 0.001) *\n marketFactor *\n markup *\n businessFactor *\n corporation.getSalesMultiplier() *\n advertisingFactor *\n this.getSalesMultiplier();\n let sellAmt;\n if (isString(mat.sllman[1])) {\n //Dynamically evaluated\n let tmp = (mat.sllman[1] as string).replace(/MAX/g, (maxSell + \"\").toUpperCase());\n tmp = tmp.replace(/PROD/g, mat.prd + \"\");\n try {\n sellAmt = eval(tmp);\n } catch (e) {\n dialogBoxCreate(\n \"Error evaluating your sell amount for material \" +\n mat.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" office. The sell amount \" +\n \"is being set to zero\",\n );\n sellAmt = 0;\n }\n sellAmt = Math.min(maxSell, sellAmt);\n } else if (mat.sllman[1] === -1) {\n //Backwards compatibility, -1 = MAX\n sellAmt = maxSell;\n } else {\n //Player's input value is just a number\n sellAmt = Math.min(maxSell, mat.sllman[1] as number);\n }\n\n sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n sellAmt = Math.min(mat.qty, sellAmt);\n if (sellAmt < 0) {\n console.warn(`sellAmt calculated to be negative for ${matName} in ${city}`);\n mat.sll = 0;\n continue;\n }\n if (sellAmt && sCost >= 0) {\n mat.qty -= sellAmt;\n revenue += sellAmt * sCost;\n mat.sll = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n } else {\n mat.sll = 0;\n }\n }\n } //End processing of sale of materials\n break;\n\n case \"EXPORT\":\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n mat.totalExp = 0; //Reset export\n for (let expI = 0; expI < mat.exp.length; ++expI) {\n const exp = mat.exp[expI];\n const amtStr = exp.amt.replace(\n /MAX/g,\n (mat.qty / (CorporationConstants.SecsPerMarketCycle * marketCycles) + \"\").toUpperCase(),\n );\n let amt = 0;\n try {\n amt = eval(amtStr);\n } catch (e) {\n dialogBoxCreate(\n \"Calculating export for \" +\n mat.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" division failed with \" +\n \"error: \" +\n e,\n );\n continue;\n }\n if (isNaN(amt)) {\n dialogBoxCreate(\n \"Error calculating export amount for \" +\n mat.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" division.\",\n );\n continue;\n }\n amt = amt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n if (mat.qty < amt) {\n amt = mat.qty;\n }\n if (amt === 0) {\n break; //None left\n }\n for (let foo = 0; foo < corporation.divisions.length; ++foo) {\n if (corporation.divisions[foo].name === exp.ind) {\n const expIndustry = corporation.divisions[foo];\n const expWarehouse = expIndustry.warehouses[exp.city];\n if (!(expWarehouse instanceof Warehouse)) {\n console.error(`Invalid export! ${expIndustry.name} ${exp.city}`);\n break;\n }\n\n // Make sure theres enough space in warehouse\n if (expWarehouse.sizeUsed >= expWarehouse.size) {\n // Warehouse at capacity. Exporting doesnt\n // affect revenue so just return 0's\n return [0, 0];\n } else {\n const maxAmt = Math.floor((expWarehouse.size - expWarehouse.sizeUsed) / MaterialSizes[matName]);\n amt = Math.min(maxAmt, amt);\n }\n expWarehouse.materials[matName].imp +=\n amt / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n expWarehouse.materials[matName].qty += amt;\n expWarehouse.materials[matName].qlt = mat.qlt;\n mat.qty -= amt;\n mat.totalExp += amt;\n expIndustry.updateWarehouseSizeUsed(expWarehouse);\n break;\n }\n }\n }\n //totalExp should be per second\n mat.totalExp /= CorporationConstants.SecsPerMarketCycle * marketCycles;\n }\n }\n\n break;\n\n case \"START\":\n break;\n default:\n console.error(`Invalid state: ${this.state}`);\n break;\n } //End switch(this.state)\n this.updateWarehouseSizeUsed(warehouse);\n } // End warehouse\n\n //Produce Scientific Research based on R&D employees\n //Scientific Research can be produced without a warehouse\n if (office instanceof OfficeSpace) {\n this.sciResearch.qty +=\n 0.004 *\n Math.pow(office.employeeProd[EmployeePositions.RandD], 0.5) *\n corporation.getScientificResearchMultiplier() *\n this.getScientificResearchMultiplier();\n }\n }\n return [revenue, expenses];\n }\n\n //Process production & sale of this industry's FINISHED products (including all of their stats)\n processProducts(marketCycles = 1, corporation: ICorporation): [number, number] {\n let revenue = 0;\n const expenses = 0;\n\n //Create products\n if (this.state === \"PRODUCTION\") {\n for (const prodName of Object.keys(this.products)) {\n const prod = this.products[prodName];\n if (prod === undefined) continue;\n if (!prod.fin) {\n const city = prod.createCity;\n const office = this.offices[city];\n if (office === 0) continue;\n\n // Designing/Creating a Product is based mostly off Engineers\n const engrProd = office.employeeProd[EmployeePositions.Engineer];\n const mgmtProd = office.employeeProd[EmployeePositions.Management];\n const opProd = office.employeeProd[EmployeePositions.Operations];\n const total = engrProd + mgmtProd + opProd;\n if (total <= 0) {\n break;\n }\n\n // Management is a multiplier for the production from Engineers\n const mgmtFactor = 1 + mgmtProd / (1.2 * total);\n\n const progress = (Math.pow(engrProd, 0.34) + Math.pow(opProd, 0.2)) * mgmtFactor;\n\n prod.createProduct(marketCycles, progress);\n if (prod.prog >= 100) {\n prod.finishProduct(office.employeeProd, this);\n }\n break;\n }\n }\n }\n\n //Produce Products\n for (const prodName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(prodName)) {\n const prod = this.products[prodName];\n if (prod instanceof Product && prod.fin) {\n revenue += this.processProduct(marketCycles, prod, corporation);\n }\n }\n }\n return [revenue, expenses];\n }\n\n //Processes FINISHED products\n processProduct(marketCycles = 1, product: Product, corporation: ICorporation): number {\n let totalProfit = 0;\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const office = this.offices[city];\n if (office === 0) continue;\n const warehouse = this.warehouses[city];\n if (warehouse instanceof Warehouse) {\n switch (this.state) {\n case \"PRODUCTION\": {\n //Calculate the maximum production of this material based\n //on the office's productivity\n const maxProd =\n this.getOfficeProductivity(office, { forProduct: true }) *\n corporation.getProductionMultiplier() *\n this.prodMult * // Multiplier from materials\n this.getProductionMultiplier() * // Multiplier from research\n this.getProductProductionMultiplier(); // Multiplier from research\n let prod;\n\n //Account for whether production is manually limited\n if (product.prdman[city][0]) {\n prod = Math.min(maxProd, product.prdman[city][1]);\n } else {\n prod = maxProd;\n }\n prod *= CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n //Calculate net change in warehouse storage making the Products will cost\n let netStorageSize = product.siz;\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const normQty = product.reqMats[reqMatName];\n netStorageSize -= MaterialSizes[reqMatName] * normQty;\n }\n }\n\n //If there's not enough space in warehouse, limit the amount of Product\n if (netStorageSize > 0) {\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / netStorageSize);\n prod = Math.min(maxAmt, prod);\n }\n\n warehouse.smartSupplyStore += prod / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n\n //Make sure we have enough resources to make our Products\n let producableFrac = 1;\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const req = product.reqMats[reqMatName] * prod;\n if (warehouse.materials[reqMatName].qty < req) {\n producableFrac = Math.min(producableFrac, warehouse.materials[reqMatName].qty / req);\n }\n }\n }\n\n //Make our Products if they are producable\n if (producableFrac > 0 && prod > 0) {\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const reqMatQtyNeeded = product.reqMats[reqMatName] * prod * producableFrac;\n warehouse.materials[reqMatName].qty -= reqMatQtyNeeded;\n warehouse.materials[reqMatName].prd -=\n reqMatQtyNeeded / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n }\n }\n //Quantity\n product.data[city][0] += prod * producableFrac;\n }\n\n //Keep track of production Per second\n product.data[city][1] = (prod * producableFrac) / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n break;\n }\n case \"SALE\": {\n //Process sale of Products\n product.pCost = 0; //Estimated production cost\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n product.pCost += product.reqMats[reqMatName] * warehouse.materials[reqMatName].bCost;\n }\n }\n\n // Since its a product, its production cost is increased for labor\n product.pCost *= CorporationConstants.ProductProductionCostRatio;\n\n // Sale multipliers\n const businessFactor = this.getBusinessFactor(office); //Business employee productivity\n const advertisingFactor = this.getAdvertisingFactors()[0]; //Awareness + popularity\n const marketFactor = this.getMarketFactor(product); //Competition + demand\n\n // Calculate Sale Cost (sCost), which could be dynamically evaluated\n const markupLimit = product.rat / product.mku;\n let sCost;\n if (product.marketTa2) {\n const prod = product.data[city][1];\n\n // Reverse engineer the 'maxSell' formula\n // 1. Set 'maxSell' = prod\n // 2. Substitute formula for 'markup'\n // 3. Solve for 'sCost'roduct.pCost = sCost\n const numerator = markupLimit;\n const sqrtNumerator = prod;\n const sqrtDenominator =\n 0.5 *\n Math.pow(product.rat, 0.65) *\n marketFactor *\n corporation.getSalesMultiplier() *\n businessFactor *\n advertisingFactor *\n this.getSalesMultiplier();\n const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator);\n let optimalPrice;\n if (sqrtDenominator === 0 || denominator === 0) {\n if (sqrtNumerator === 0) {\n optimalPrice = 0; // No production\n } else {\n optimalPrice = product.pCost + markupLimit;\n console.warn(`In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost`);\n }\n } else {\n optimalPrice = numerator / denominator + product.pCost;\n }\n\n // Store this \"optimal Price\" in a property so we don't have to re-calculate for UI\n product.marketTa2Price[city] = optimalPrice;\n sCost = optimalPrice;\n } else if (product.marketTa1) {\n sCost = product.pCost + markupLimit;\n } else if (isString(product.sCost)) {\n const sCostString = product.sCost as string;\n if (product.mku === 0) {\n console.error(`mku is zero, reverting to 1 to avoid Infinity`);\n product.mku = 1;\n }\n sCost = sCostString.replace(/MP/g, product.pCost + product.rat / product.mku + \"\");\n sCost = eval(sCost);\n } else {\n sCost = product.sCost;\n }\n\n let markup = 1;\n if (sCost > product.pCost) {\n if (sCost - product.pCost > markupLimit) {\n markup = markupLimit / (sCost - product.pCost);\n }\n }\n\n const maxSell =\n 0.5 *\n Math.pow(product.rat, 0.65) *\n marketFactor *\n corporation.getSalesMultiplier() *\n Math.pow(markup, 2) *\n businessFactor *\n advertisingFactor *\n this.getSalesMultiplier();\n let sellAmt;\n if (product.sllman[city][0] && isString(product.sllman[city][1])) {\n //Sell amount is dynamically evaluated\n let tmp = product.sllman[city][1].replace(/MAX/g, (maxSell + \"\").toUpperCase());\n tmp = tmp.replace(/PROD/g, product.data[city][1]);\n try {\n tmp = eval(tmp);\n } catch (e) {\n dialogBoxCreate(\n \"Error evaluating your sell price expression for \" +\n product.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" office. Sell price is being set to MAX\",\n );\n tmp = maxSell;\n }\n sellAmt = Math.min(maxSell, tmp);\n } else if (product.sllman[city][0] && product.sllman[city][1] > 0) {\n //Sell amount is manually limited\n sellAmt = Math.min(maxSell, product.sllman[city][1]);\n } else if (product.sllman[city][0] === false) {\n sellAmt = 0;\n } else {\n sellAmt = maxSell;\n }\n if (sellAmt < 0) {\n sellAmt = 0;\n }\n sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n sellAmt = Math.min(product.data[city][0], sellAmt); //data[0] is qty\n if (sellAmt && sCost) {\n product.data[city][0] -= sellAmt; //data[0] is qty\n totalProfit += sellAmt * sCost;\n product.data[city][2] = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles); //data[2] is sell property\n } else {\n product.data[city][2] = 0; //data[2] is sell property\n }\n break;\n }\n case \"START\":\n case \"PURCHASE\":\n case \"EXPORT\":\n break;\n default:\n console.error(`Invalid State: ${this.state}`);\n break;\n } //End switch(this.state)\n }\n }\n return totalProfit;\n }\n\n discontinueProduct(product: Product): void {\n for (const productName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(productName)) {\n if (product === this.products[productName]) {\n delete this.products[productName];\n }\n }\n }\n }\n\n upgrade(upgrade: IndustryUpgrade, refs: { corporation: ICorporation; office: OfficeSpace }): void {\n const corporation = refs.corporation;\n const office = refs.office;\n const upgN = upgrade[0];\n while (this.upgrades.length <= upgN) {\n this.upgrades.push(0);\n }\n ++this.upgrades[upgN];\n\n switch (upgN) {\n case 0: {\n //Coffee, 5% energy per employee\n for (let i = 0; i < office.employees.length; ++i) {\n office.employees[i].ene = Math.min(office.employees[i].ene * 1.05, office.maxEne);\n }\n break;\n }\n case 1: {\n //AdVert.Inc,\n const advMult = corporation.getAdvertisingMultiplier() * this.getAdvertisingMultiplier();\n const awareness = (this.awareness + (3 * advMult)) * (1.01 * advMult);\n this.awareness = Math.min(awareness, Number.MAX_VALUE);\n\n const popularity = (this.popularity + (1 * advMult)) * ((1 + getRandomInt(1, 3) / 100) * advMult);\n this.popularity = Math.min(popularity, Number.MAX_VALUE); \n break;\n }\n default: {\n console.error(`Un-implemented function index: ${upgN}`);\n break;\n }\n }\n }\n\n // Returns how much of a material can be produced based of office productivity (employee stats)\n getOfficeProductivity(office: OfficeSpace, params: { forProduct?: boolean } = {}): number {\n const opProd = office.employeeProd[EmployeePositions.Operations];\n const engrProd = office.employeeProd[EmployeePositions.Engineer];\n const mgmtProd = office.employeeProd[EmployeePositions.Management];\n const total = opProd + engrProd + mgmtProd;\n\n if (total <= 0) return 0;\n\n // Management is a multiplier for the production from Operations and Engineers\n const mgmtFactor = 1 + mgmtProd / (1.2 * total);\n\n // For production, Operations is slightly more important than engineering\n // Both Engineering and Operations have diminishing returns\n const prod = (Math.pow(opProd, 0.4) + Math.pow(engrProd, 0.3)) * mgmtFactor;\n\n // Generic multiplier for the production. Used for game-balancing purposes\n const balancingMult = 0.05;\n\n if (params && params.forProduct) {\n // Products are harder to create and therefore have less production\n return 0.5 * balancingMult * prod;\n } else {\n return balancingMult * prod;\n }\n }\n\n // Returns a multiplier based on the office' 'Business' employees that affects sales\n getBusinessFactor(office: OfficeSpace): number {\n const businessProd = 1 + office.employeeProd[EmployeePositions.Business];\n\n return calculateEffectWithFactors(businessProd, 0.26, 10e3);\n }\n\n //Returns a set of multipliers based on the Industry's awareness, popularity, and advFac. This\n //multiplier affects sales. The result is:\n // [Total sales mult, total awareness mult, total pop mult, awareness/pop ratio mult]\n getAdvertisingFactors(): [number, number, number, number] {\n const awarenessFac = Math.pow(this.awareness + 1, this.advFac);\n const popularityFac = Math.pow(this.popularity + 1, this.advFac);\n const ratioFac = this.awareness === 0 ? 0.01 : Math.max((this.popularity + 0.001) / this.awareness, 0.01);\n const totalFac = Math.pow(awarenessFac * popularityFac * ratioFac, 0.85);\n return [totalFac, awarenessFac, popularityFac, ratioFac];\n }\n\n //Returns a multiplier based on a materials demand and competition that affects sales\n getMarketFactor(mat: { dmd: number; cmp: number }): number {\n return Math.max(0.1, (mat.dmd * (100 - mat.cmp)) / 100);\n }\n\n // Returns a boolean indicating whether this Industry has the specified Research\n hasResearch(name: string): boolean {\n return this.researched[name] === true;\n }\n\n updateResearchTree(): void {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry \"${this.type}\"`);\n\n // Since ResearchTree data isnt saved, we'll update the Research Tree data\n // based on the stored 'researched' property in the Industry object\n if (Object.keys(researchTree.researched).length !== Object.keys(this.researched).length) {\n for (const research of Object.keys(this.researched)) {\n researchTree.research(research);\n }\n }\n }\n\n // Get multipliers from Research\n getAdvertisingMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getAdvertisingMultiplier();\n }\n\n getEmployeeChaMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeChaMultiplier();\n }\n\n getEmployeeCreMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeCreMultiplier();\n }\n\n getEmployeeEffMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeEffMultiplier();\n }\n\n getEmployeeIntMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeIntMultiplier();\n }\n\n getProductionMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getProductionMultiplier();\n }\n\n getProductProductionMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getProductProductionMultiplier();\n }\n\n getSalesMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getSalesMultiplier();\n }\n\n getScientificResearchMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getScientificResearchMultiplier();\n }\n\n getStorageMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getStorageMultiplier();\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Industry\", this);\n }\n\n /**\n * Initiatizes a Industry object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Industry {\n return Generic_fromJSON(Industry, value.data);\n }\n}\n\nReviver.constructors.Industry = Industry;\n","/**\n * This is a component that implements a mathematical formula used commonly throughout the\n * game. This formula is (typically) used to calculate the effect that various statistics\n * have on a game mechanic. It looks something like:\n *\n * (stat ^ exponential factor) + (stat / linear factor)\n *\n * where the exponential factor is a number between 0 and 1 and the linear factor\n * is typically a relatively larger number.\n *\n * This formula ensures that the effects of the statistic that is being processed\n * has diminishing returns, but never loses its effectiveness as you continue\n * to raise it.\n */\nexport function calculateEffectWithFactors(n: number, expFac: number, linearFac: number): number {\n if (expFac <= 0 || expFac >= 1) {\n console.warn(`Exponential factor is ${expFac}. This is not an intended value for it`);\n }\n if (linearFac < 1) {\n console.warn(`Linear factor is ${linearFac}. This is not an intended value for it`);\n }\n\n return Math.pow(n, expFac) + n / linearFac;\n}\n","import { CorporationConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { ICorporation } from \"./ICorporation\";\nimport { OfficeSpace } from \"./OfficeSpace\";\nimport { IIndustry } from \"./IIndustry\";\n\ninterface IParams {\n name?: string;\n morale?: number;\n happiness?: number;\n energy?: number;\n intelligence?: number;\n charisma?: number;\n experience?: number;\n creativity?: number;\n efficiency?: number;\n salary?: number;\n loc?: string;\n}\n\nexport class Employee {\n name: string;\n mor: number;\n hap: number;\n ene: number;\n int: number;\n cha: number;\n exp: number;\n cre: number;\n eff: number;\n sal: number;\n cyclesUntilRaise = CorporationConstants.CyclesPerEmployeeRaise;\n loc: string;\n pos: string;\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"Bobby\";\n\n //Morale, happiness, and energy are 0-100\n this.mor = params.morale ? params.morale : getRandomInt(50, 100);\n this.hap = params.happiness ? params.happiness : getRandomInt(50, 100);\n this.ene = params.energy ? params.energy : getRandomInt(50, 100);\n\n this.int = params.intelligence ? params.intelligence : getRandomInt(10, 50);\n this.cha = params.charisma ? params.charisma : getRandomInt(10, 50);\n this.exp = params.experience ? params.experience : getRandomInt(10, 50);\n this.cre = params.creativity ? params.creativity : getRandomInt(10, 50);\n this.eff = params.efficiency ? params.efficiency : getRandomInt(10, 50);\n this.sal = params.salary ? params.salary : getRandomInt(0.1, 5);\n\n this.loc = params.loc ? params.loc : \"\";\n this.pos = EmployeePositions.Unassigned;\n }\n\n //Returns the amount the employee needs to be paid\n process(marketCycles = 1, office: OfficeSpace): number {\n const gain = 0.003 * marketCycles,\n det = gain * Math.random();\n this.exp += gain;\n\n //Training\n const trainingEff = gain * Math.random();\n if (this.pos === EmployeePositions.Training) {\n //To increase creativity and intelligence special upgrades are needed\n this.cha += trainingEff;\n this.exp += trainingEff;\n this.eff += trainingEff;\n }\n\n this.ene -= det;\n this.hap -= det;\n\n if (this.ene < office.minEne) {\n this.ene = office.minEne;\n }\n if (this.hap < office.minHap) {\n this.hap = office.minHap;\n }\n const salary = this.sal * marketCycles * CorporationConstants.SecsPerMarketCycle;\n return salary;\n }\n\n calculateProductivity(corporation: ICorporation, industry: IIndustry): number {\n const effCre = this.cre * corporation.getEmployeeCreMultiplier() * industry.getEmployeeCreMultiplier(),\n effCha = this.cha * corporation.getEmployeeChaMultiplier() * industry.getEmployeeChaMultiplier(),\n effInt = this.int * corporation.getEmployeeIntMultiplier() * industry.getEmployeeIntMultiplier(),\n effEff = this.eff * corporation.getEmployeeEffMultiplier() * industry.getEmployeeEffMultiplier();\n const prodBase = this.mor * this.hap * this.ene * 1e-6;\n let prodMult = 0;\n switch (this.pos) {\n //Calculate productivity based on position. This is multipled by prodBase\n //to get final value\n case EmployeePositions.Operations:\n prodMult = 0.6 * effInt + 0.1 * effCha + this.exp + 0.5 * effCre + effEff;\n break;\n case EmployeePositions.Engineer:\n prodMult = effInt + 0.1 * effCha + 1.5 * this.exp + effEff;\n break;\n case EmployeePositions.Business:\n prodMult = 0.4 * effInt + effCha + 0.5 * this.exp;\n break;\n case EmployeePositions.Management:\n prodMult = 2 * effCha + this.exp + 0.2 * effCre + 0.7 * effEff;\n break;\n case EmployeePositions.RandD:\n prodMult = 1.5 * effInt + 0.8 * this.exp + effCre + 0.5 * effEff;\n break;\n case EmployeePositions.Unassigned:\n case EmployeePositions.Training:\n prodMult = 0;\n break;\n default:\n console.error(`Invalid employee position: ${this.pos}`);\n break;\n }\n return prodBase * prodMult;\n }\n\n //Process benefits from having an office party thrown\n throwParty(money: number): number {\n const mult = 1 + money / 10e6;\n this.mor *= mult;\n this.mor = Math.min(100, this.mor);\n this.hap *= mult;\n this.hap = Math.min(100, this.hap);\n return mult;\n }\n\n toJSON(): any {\n return Generic_toJSON(\"Employee\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Employee {\n return Generic_fromJSON(Employee, value.data);\n }\n}\n\nReviver.constructors.Employee = Employee;\n","import { Industries } from \"./IndustryData\";\nimport { IMap } from \"../types\";\n\nexport interface IProductRatingWeight {\n Aesthetics?: number;\n Durability?: number;\n Features?: number;\n Quality?: number;\n Performance?: number;\n Reliability?: number;\n}\n\nexport const ProductRatingWeights: IMap<any> = {\n [Industries.Food]: {\n Quality: 0.7,\n Durability: 0.1,\n Aesthetics: 0.2,\n },\n [Industries.Tobacco]: {\n Quality: 0.4,\n Durability: 0.2,\n Reliability: 0.2,\n Aesthetics: 0.2,\n },\n [Industries.Pharmaceutical]: {\n Quality: 0.2,\n Performance: 0.2,\n Durability: 0.1,\n Reliability: 0.3,\n Features: 0.2,\n },\n [Industries.Computer]: {\n Quality: 0.15,\n Performance: 0.25,\n Durability: 0.25,\n Reliability: 0.2,\n Aesthetics: 0.05,\n Features: 0.1,\n },\n Computer: {\n //Repeat\n Quality: 0.15,\n Performance: 0.25,\n Durability: 0.25,\n Reliability: 0.2,\n Aesthetics: 0.05,\n Features: 0.1,\n },\n [Industries.Robotics]: {\n Quality: 0.1,\n Performance: 0.2,\n Durability: 0.2,\n Reliability: 0.2,\n Aesthetics: 0.1,\n Features: 0.2,\n },\n [Industries.Software]: {\n Quality: 0.2,\n Performance: 0.2,\n Reliability: 0.2,\n Durability: 0.2,\n Features: 0.2,\n },\n [Industries.Healthcare]: {\n Quality: 0.4,\n Performance: 0.1,\n Durability: 0.1,\n Reliability: 0.3,\n Features: 0.1,\n },\n [Industries.RealEstate]: {\n Quality: 0.2,\n Durability: 0.25,\n Reliability: 0.1,\n Aesthetics: 0.35,\n Features: 0.1,\n },\n};\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { calculateServerGrowth } from \"../Server/formulas/grow\";\nimport {\n calculateMoneyGainRate,\n calculateLevelUpgradeCost,\n calculateRamUpgradeCost,\n calculateCoreUpgradeCost,\n calculateNodeCost,\n} from \"../Hacknet/formulas/HacknetNodes\";\nimport {\n calculateHashGainRate as HScalculateHashGainRate,\n calculateLevelUpgradeCost as HScalculateLevelUpgradeCost,\n calculateRamUpgradeCost as HScalculateRamUpgradeCost,\n calculateCoreUpgradeCost as HScalculateCoreUpgradeCost,\n calculateCacheUpgradeCost as HScalculateCacheUpgradeCost,\n calculateServerCost as HScalculateServerCost,\n} from \"../Hacknet/formulas/HacknetServers\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { calculateSkill, calculateExp } from \"../PersonObjects/formulas/skill\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"../Hacking\";\nimport { Programs } from \"../Programs/Programs\";\nimport { Formulas as IFormulas } from \"../ScriptEditor/NetscriptDefinitions\";\nimport {\n calculateRespectGain,\n calculateWantedLevelGain,\n calculateMoneyGain,\n calculateWantedPenalty,\n calculateAscensionMult,\n calculateAscensionPointsGain,\n} from \"../Gang/formulas/formulas\";\n\nexport interface INetscriptFormulas {\n skills: {\n calculateSkill(exp: any, mult?: any): any;\n calculateExp(skill: any, mult?: any): any;\n };\n hacking: {\n hackChance(server: any, player: any): any;\n hackExp(server: any, player: any): any;\n hackPercent(server: any, player: any): any;\n growPercent(server: any, threads: any, player: any, cores?: any): any;\n hackTime(server: any, player: any): any;\n growTime(server: any, player: any): any;\n weakenTime(server: any, player: any): any;\n };\n hacknetNodes: {\n moneyGainRate(level: any, ram: any, cores: any, mult?: any): any;\n levelUpgradeCost(startingLevel: any, extraLevels?: any, costMult?: any): any;\n ramUpgradeCost(startingRam: any, extraLevels?: any, costMult?: any): any;\n coreUpgradeCost(startingCore: any, extraCores?: any, costMult?: any): any;\n hacknetNodeCost(n: any, mult: any): any;\n constants(): any;\n };\n hacknetServers: {\n hashGainRate(level: any, ramUsed: any, maxRam: any, cores: any, mult?: any): any;\n levelUpgradeCost(startingLevel: any, extraLevels?: any, costMult?: any): any;\n ramUpgradeCost(startingRam: any, extraLevels?: any, costMult?: any): any;\n coreUpgradeCost(startingCore: any, extraCores?: any, costMult?: any): any;\n cacheUpgradeCost(startingCache: any, extraCache?: any): any;\n hashUpgradeCost(upgName: any, level: any): any;\n hacknetServerCost(n: any, mult: any): any;\n constants(): any;\n };\n}\n\nexport function NetscriptFormulas(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): IFormulas {\n const checkFormulasAccess = function (func: string): void {\n if (!player.hasProgram(Programs.Formulas.name)) {\n throw helper.makeRuntimeErrorMsg(`formulas.${func}`, `Requires Formulas.exe to run.`);\n }\n };\n return {\n skills: {\n calculateSkill: function (exp: any, mult: any = 1): any {\n checkFormulasAccess(\"skills.calculateSkill\");\n return calculateSkill(exp, mult);\n },\n calculateExp: function (skill: any, mult: any = 1): any {\n checkFormulasAccess(\"skills.calculateExp\");\n return calculateExp(skill, mult);\n },\n },\n hacking: {\n hackChance: function (server: any, player: any): any {\n checkFormulasAccess(\"hacking.hackChance\");\n return calculateHackingChance(server, player);\n },\n hackExp: function (server: any, player: any): any {\n checkFormulasAccess(\"hacking.hackExp\");\n return calculateHackingExpGain(server, player);\n },\n hackPercent: function (server: any, player: any): any {\n checkFormulasAccess(\"hacking.hackPercent\");\n return calculatePercentMoneyHacked(server, player);\n },\n growPercent: function (server: any, threads: any, player: any, cores: any = 1): any {\n checkFormulasAccess(\"hacking.growPercent\");\n return calculateServerGrowth(server, threads, player, cores);\n },\n hackTime: function (server: any, player: any): any {\n checkFormulasAccess(\"hacking.hackTime\");\n return calculateHackingTime(server, player) * 1000;\n },\n growTime: function (server: any, player: any): any {\n checkFormulasAccess(\"hacking.growTime\");\n return calculateGrowTime(server, player) * 1000;\n },\n weakenTime: function (server: any, player: any): any {\n checkFormulasAccess(\"hacking.weakenTime\");\n return calculateWeakenTime(server, player) * 1000;\n },\n },\n hacknetNodes: {\n moneyGainRate: function (level: any, ram: any, cores: any, mult: any = 1): any {\n checkFormulasAccess(\"hacknetNodes.moneyGainRate\");\n return calculateMoneyGainRate(level, ram, cores, mult);\n },\n levelUpgradeCost: function (startingLevel: any, extraLevels: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetNodes.levelUpgradeCost\");\n return calculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost: function (startingRam: any, extraLevels: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetNodes.ramUpgradeCost\");\n return calculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost: function (startingCore: any, extraCores: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetNodes.coreUpgradeCost\");\n return calculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n hacknetNodeCost: function (n: any, mult: any): any {\n checkFormulasAccess(\"hacknetNodes.hacknetNodeCost\");\n return calculateNodeCost(n, mult);\n },\n constants: function (): any {\n checkFormulasAccess(\"hacknetNodes.constants\");\n return Object.assign({}, HacknetNodeConstants);\n },\n },\n hacknetServers: {\n hashGainRate: function (level: any, ramUsed: any, maxRam: any, cores: any, mult: any = 1): any {\n checkFormulasAccess(\"hacknetServers.hashGainRate\");\n return HScalculateHashGainRate(level, ramUsed, maxRam, cores, mult);\n },\n levelUpgradeCost: function (startingLevel: any, extraLevels: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetServers.levelUpgradeCost\");\n return HScalculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost: function (startingRam: any, extraLevels: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetServers.ramUpgradeCost\");\n return HScalculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost: function (startingCore: any, extraCores: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetServers.coreUpgradeCost\");\n return HScalculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n cacheUpgradeCost: function (startingCache: any, extraCache: any = 1): any {\n checkFormulasAccess(\"hacknetServers.cacheUpgradeCost\");\n return HScalculateCacheUpgradeCost(startingCache, extraCache);\n },\n hashUpgradeCost: function (upgName: any, level: any): any {\n checkFormulasAccess(\"hacknetServers.hashUpgradeCost\");\n const upg = player.hashManager.getUpgrade(upgName);\n if (!upg) {\n throw helper.makeRuntimeErrorMsg(\n \"formulas.hacknetServers.calculateHashUpgradeCost\",\n `Invalid Hash Upgrade: ${upgName}`,\n );\n }\n return upg.getCost(level);\n },\n hacknetServerCost: function (n: any, mult: any = 1): any {\n checkFormulasAccess(\"hacknetServers.hacknetServerCost\");\n return HScalculateServerCost(n, mult);\n },\n constants: function (): any {\n checkFormulasAccess(\"hacknetServers.constants\");\n return Object.assign({}, HacknetServerConstants);\n },\n },\n gang: {\n wantedPenalty(gang: any): number {\n checkFormulasAccess(\"gang.wantedPenalty\");\n return calculateWantedPenalty(gang);\n },\n respectGain: function (gang: any, member: any, task: any): number {\n checkFormulasAccess(\"gang.respectGain\");\n return calculateRespectGain(gang, member, task);\n },\n wantedLevelGain: function (gang: any, member: any, task: any): number {\n checkFormulasAccess(\"gang.wantedLevelGain\");\n return calculateWantedLevelGain(gang, member, task);\n },\n moneyGain: function (gang: any, member: any, task: any): number {\n checkFormulasAccess(\"gang.moneyGain\");\n return calculateMoneyGain(gang, member, task);\n },\n ascensionPointsGain: function (exp: any): number {\n checkFormulasAccess(\"gang.ascensionPointsGain\");\n return calculateAscensionPointsGain(exp);\n },\n ascensionMultiplier: function (points: any): number {\n checkFormulasAccess(\"gang.ascensionMultiplier\");\n return calculateAscensionMult(points);\n },\n },\n };\n}\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { getRamCost } from \"../Netscript/RamCostGenerator\";\nimport { buyStock, sellStock, shortStock, sellShort } from \"../StockMarket/BuyingAndSelling\";\nimport { StockMarket, SymbolToStockMap, placeOrder, cancelOrder } from \"../StockMarket/StockMarket\";\nimport { getBuyTransactionCost, getSellTransactionGain } from \"../StockMarket/StockMarketHelpers\";\nimport { OrderTypes } from \"../StockMarket/data/OrderTypes\";\nimport { PositionTypes } from \"../StockMarket/data/PositionTypes\";\nimport { StockSymbols } from \"../StockMarket/data/StockSymbols\";\nimport { getStockMarket4SDataCost, getStockMarket4STixApiCost } from \"../StockMarket/StockMarketCosts\";\nimport { Stock } from \"../StockMarket/Stock\";\nimport { TIX } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): TIX {\n /**\n * Checks if the player has TIX API access. Throws an error if the player does not\n */\n const checkTixApiAccess = function (callingFn: string): void {\n if (!player.hasWseAccount) {\n throw helper.makeRuntimeErrorMsg(callingFn, `You don't have WSE Access! Cannot use ${callingFn}()`);\n }\n if (!player.hasTixApiAccess) {\n throw helper.makeRuntimeErrorMsg(callingFn, `You don't have TIX API Access! Cannot use ${callingFn}()`);\n }\n };\n\n const getStockFromSymbol = function (symbol: string, callingFn: string): Stock {\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw helper.makeRuntimeErrorMsg(callingFn, `Invalid stock symbol: '${symbol}'`);\n }\n\n return stock;\n };\n return {\n getSymbols: function (): any {\n helper.updateDynamicRam(\"getSymbols\", getRamCost(player, \"stock\", \"getSymbols\"));\n checkTixApiAccess(\"getSymbols\");\n return Object.values(StockSymbols);\n },\n getPrice: function (symbol: any): any {\n helper.updateDynamicRam(\"getPrice\", getRamCost(player, \"stock\", \"getPrice\"));\n checkTixApiAccess(\"getPrice\");\n const stock = getStockFromSymbol(symbol, \"getPrice\");\n\n return stock.price;\n },\n getAskPrice: function (symbol: any): any {\n helper.updateDynamicRam(\"getAskPrice\", getRamCost(player, \"stock\", \"getAskPrice\"));\n checkTixApiAccess(\"getAskPrice\");\n const stock = getStockFromSymbol(symbol, \"getAskPrice\");\n\n return stock.getAskPrice();\n },\n getBidPrice: function (symbol: any): any {\n helper.updateDynamicRam(\"getBidPrice\", getRamCost(player, \"stock\", \"getBidPrice\"));\n checkTixApiAccess(\"getBidPrice\");\n const stock = getStockFromSymbol(symbol, \"getBidPrice\");\n\n return stock.getBidPrice();\n },\n getPosition: function (symbol: any): any {\n helper.updateDynamicRam(\"getPosition\", getRamCost(player, \"stock\", \"getPosition\"));\n checkTixApiAccess(\"getPosition\");\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw helper.makeRuntimeErrorMsg(\"getPosition\", `Invalid stock symbol: ${symbol}`);\n }\n return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];\n },\n getMaxShares: function (symbol: any): any {\n helper.updateDynamicRam(\"getMaxShares\", getRamCost(player, \"stock\", \"getMaxShares\"));\n checkTixApiAccess(\"getMaxShares\");\n const stock = getStockFromSymbol(symbol, \"getMaxShares\");\n\n return stock.maxShares;\n },\n getPurchaseCost: function (symbol: any, shares: any, posType: any): any {\n helper.updateDynamicRam(\"getPurchaseCost\", getRamCost(player, \"stock\", \"getPurchaseCost\"));\n checkTixApiAccess(\"getPurchaseCost\");\n const stock = getStockFromSymbol(symbol, \"getPurchaseCost\");\n shares = Math.round(shares);\n\n let pos;\n const sanitizedPosType = posType.toLowerCase();\n if (sanitizedPosType.includes(\"l\")) {\n pos = PositionTypes.Long;\n } else if (sanitizedPosType.includes(\"s\")) {\n pos = PositionTypes.Short;\n } else {\n return Infinity;\n }\n\n const res = getBuyTransactionCost(stock, shares, pos);\n if (res == null) {\n return Infinity;\n }\n\n return res;\n },\n getSaleGain: function (symbol: any, shares: any, posType: any): any {\n helper.updateDynamicRam(\"getSaleGain\", getRamCost(player, \"stock\", \"getSaleGain\"));\n checkTixApiAccess(\"getSaleGain\");\n const stock = getStockFromSymbol(symbol, \"getSaleGain\");\n shares = Math.round(shares);\n\n let pos;\n const sanitizedPosType = posType.toLowerCase();\n if (sanitizedPosType.includes(\"l\")) {\n pos = PositionTypes.Long;\n } else if (sanitizedPosType.includes(\"s\")) {\n pos = PositionTypes.Short;\n } else {\n return 0;\n }\n\n const res = getSellTransactionGain(stock, shares, pos);\n if (res == null) {\n return 0;\n }\n\n return res;\n },\n buy: function (symbol: any, shares: any): any {\n helper.updateDynamicRam(\"buy\", getRamCost(player, \"stock\", \"buy\"));\n checkTixApiAccess(\"buy\");\n const stock = getStockFromSymbol(symbol, \"buy\");\n const res = buyStock(stock, shares, workerScript, {});\n return res ? stock.getAskPrice() : 0;\n },\n sell: function (symbol: any, shares: any): any {\n helper.updateDynamicRam(\"sell\", getRamCost(player, \"stock\", \"sell\"));\n checkTixApiAccess(\"sell\");\n const stock = getStockFromSymbol(symbol, \"sell\");\n const res = sellStock(stock, shares, workerScript, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n short: function (symbol: any, shares: any): any {\n helper.updateDynamicRam(\"short\", getRamCost(player, \"stock\", \"short\"));\n checkTixApiAccess(\"short\");\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw helper.makeRuntimeErrorMsg(\n \"short\",\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\",\n );\n }\n }\n const stock = getStockFromSymbol(symbol, \"short\");\n const res = shortStock(stock, shares, workerScript, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n sellShort: function (symbol: any, shares: any): any {\n helper.updateDynamicRam(\"sellShort\", getRamCost(player, \"stock\", \"sellShort\"));\n checkTixApiAccess(\"sellShort\");\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw helper.makeRuntimeErrorMsg(\n \"sellShort\",\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\",\n );\n }\n }\n const stock = getStockFromSymbol(symbol, \"sellShort\");\n const res = sellShort(stock, shares, workerScript, {});\n\n return res ? stock.getAskPrice() : 0;\n },\n placeOrder: function (symbol: any, shares: any, price: any, type: any, pos: any): any {\n helper.updateDynamicRam(\"placeOrder\", getRamCost(player, \"stock\", \"placeOrder\"));\n checkTixApiAccess(\"placeOrder\");\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helper.makeRuntimeErrorMsg(\n \"placeOrder\",\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\",\n );\n }\n }\n const stock = getStockFromSymbol(symbol, \"placeOrder\");\n\n let orderType;\n let orderPos;\n const ltype = type.toLowerCase();\n if (ltype.includes(\"limit\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.LimitBuy;\n } else if (ltype.includes(\"limit\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.LimitSell;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.StopBuy;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.StopSell;\n } else {\n throw helper.makeRuntimeErrorMsg(\"placeOrder\", `Invalid order type: ${type}`);\n }\n\n const lpos = pos.toLowerCase();\n if (lpos.includes(\"l\")) {\n orderPos = PositionTypes.Long;\n } else if (lpos.includes(\"s\")) {\n orderPos = PositionTypes.Short;\n } else {\n throw helper.makeRuntimeErrorMsg(\"placeOrder\", `Invalid position type: ${pos}`);\n }\n\n return placeOrder(stock, shares, price, orderType, orderPos, workerScript);\n },\n cancelOrder: function (symbol: any, shares: any, price: any, type: any, pos: any): any {\n helper.updateDynamicRam(\"cancelOrder\", getRamCost(player, \"stock\", \"cancelOrder\"));\n checkTixApiAccess(\"cancelOrder\");\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helper.makeRuntimeErrorMsg(\n \"cancelOrder\",\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\",\n );\n }\n }\n const stock = getStockFromSymbol(symbol, \"cancelOrder\");\n if (isNaN(shares) || isNaN(price)) {\n throw helper.makeRuntimeErrorMsg(\n \"cancelOrder\",\n `Invalid shares or price. Must be numeric. shares=${shares}, price=${price}`,\n );\n }\n let orderType;\n let orderPos;\n const ltype = type.toLowerCase();\n if (ltype.includes(\"limit\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.LimitBuy;\n } else if (ltype.includes(\"limit\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.LimitSell;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.StopBuy;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.StopSell;\n } else {\n throw helper.makeRuntimeErrorMsg(\"cancelOrder\", `Invalid order type: ${type}`);\n }\n\n const lpos = pos.toLowerCase();\n if (lpos.includes(\"l\")) {\n orderPos = PositionTypes.Long;\n } else if (lpos.includes(\"s\")) {\n orderPos = PositionTypes.Short;\n } else {\n throw helper.makeRuntimeErrorMsg(\"cancelOrder\", `Invalid position type: ${pos}`);\n }\n const params = {\n stock: stock,\n shares: shares,\n price: price,\n type: orderType,\n pos: orderPos,\n };\n return cancelOrder(params, workerScript);\n },\n getOrders: function (): any {\n helper.updateDynamicRam(\"getOrders\", getRamCost(player, \"stock\", \"getOrders\"));\n checkTixApiAccess(\"getOrders\");\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helper.makeRuntimeErrorMsg(\n \"getOrders\",\n \"You must either be in BitNode-8 or have Source-File 8 Level 3.\",\n );\n }\n }\n\n const orders: any = {};\n\n const stockMarketOrders = StockMarket[\"Orders\"];\n for (const symbol of Object.keys(stockMarketOrders)) {\n const orderBook = stockMarketOrders[symbol];\n if (orderBook.constructor === Array && orderBook.length > 0) {\n orders[symbol] = [];\n for (let i = 0; i < orderBook.length; ++i) {\n orders[symbol].push({\n shares: orderBook[i].shares,\n price: orderBook[i].price,\n type: orderBook[i].type,\n position: orderBook[i].pos,\n });\n }\n }\n }\n\n return orders;\n },\n getVolatility: function (symbol: any): any {\n helper.updateDynamicRam(\"getVolatility\", getRamCost(player, \"stock\", \"getVolatility\"));\n if (!player.has4SDataTixApi) {\n throw helper.makeRuntimeErrorMsg(\"getVolatility\", \"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(symbol, \"getVolatility\");\n\n return stock.mv / 100; // Convert from percentage to decimal\n },\n getForecast: function (symbol: any): any {\n helper.updateDynamicRam(\"getForecast\", getRamCost(player, \"stock\", \"getForecast\"));\n if (!player.has4SDataTixApi) {\n throw helper.makeRuntimeErrorMsg(\"getForecast\", \"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(symbol, \"getForecast\");\n\n let forecast = 50;\n stock.b ? (forecast += stock.otlkMag) : (forecast -= stock.otlkMag);\n return forecast / 100; // Convert from percentage to decimal\n },\n purchase4SMarketData: function () {\n helper.updateDynamicRam(\"purchase4SMarketData\", getRamCost(player, \"stock\", \"purchase4SMarketData\"));\n checkTixApiAccess(\"purchase4SMarketData\");\n\n if (player.has4SData) {\n workerScript.log(\"stock.purchase4SMarketData\", () => \"Already purchased 4S Market Data.\");\n return true;\n }\n\n if (player.money < getStockMarket4SDataCost()) {\n workerScript.log(\"stock.purchase4SMarketData\", () => \"Not enough money to purchase 4S Market Data.\");\n return false;\n }\n\n player.has4SData = true;\n player.loseMoney(getStockMarket4SDataCost(), \"stock\");\n workerScript.log(\"stock.purchase4SMarketData\", () => \"Purchased 4S Market Data\");\n return true;\n },\n purchase4SMarketDataTixApi: function () {\n helper.updateDynamicRam(\"purchase4SMarketDataTixApi\", getRamCost(player, \"stock\", \"purchase4SMarketDataTixApi\"));\n checkTixApiAccess(\"purchase4SMarketDataTixApi\");\n\n if (player.has4SDataTixApi) {\n workerScript.log(\"stock.purchase4SMarketDataTixApi\", () => \"Already purchased 4S Market Data TIX API\");\n return true;\n }\n\n if (player.money < getStockMarket4STixApiCost()) {\n workerScript.log(\n \"stock.purchase4SMarketDataTixApi\",\n () => \"Not enough money to purchase 4S Market Data TIX API\",\n );\n return false;\n }\n\n player.has4SDataTixApi = true;\n player.loseMoney(getStockMarket4STixApiCost(), \"stock\");\n workerScript.log(\"stock.purchase4SMarketDataTixApi\", () => \"Purchased 4S Market Data TIX API\");\n return true;\n },\n };\n}\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { purchaseAugmentation, joinFaction } from \"../Faction/FactionHelpers\";\nimport { startWorkerScript } from \"../NetscriptWorker\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\nimport { Augmentations } from \"../Augmentation/Augmentations\";\nimport { augmentationExists, installAugmentations } from \"../Augmentation/AugmentationHelpers\";\nimport { prestigeAugmentation } from \"../Prestige\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { killWorkerScript } from \"../Netscript/killWorkerScript\";\nimport { CONSTANTS } from \"../Constants\";\nimport { isString } from \"../utils/helpers/isString\";\nimport { getRamCost } from \"../Netscript/RamCostGenerator\";\nimport { RunningScript } from \"../Script/RunningScript\";\n\nimport { Singularity as ISingularity } from \"../ScriptEditor/NetscriptDefinitions\";\n\nimport { findCrime } from \"../Crime/CrimeHelpers\";\nimport { CompanyPosition } from \"../Company/CompanyPosition\";\nimport { CompanyPositions } from \"../Company/CompanyPositions\";\nimport { DarkWebItems } from \"../DarkWeb/DarkWebItems\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { Router } from \"../ui/GameRoot\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Page } from \"../ui/Router\";\nimport { Locations } from \"../Locations/Locations\";\nimport { GetServer, AddToAllServers, createUniqueRandomIp } from \"../Server/AllServers\";\nimport { Programs } from \"../Programs/Programs\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Company } from \"../Company/Company\";\nimport { Companies } from \"../Company/Companies\";\nimport { Factions, factionExists } from \"../Faction/Factions\";\nimport { Faction } from \"../Faction/Faction\";\nimport { netscriptDelay } from \"../NetscriptEvaluator\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { getServerOnNetwork, safetlyCreateUniqueServer } from \"../Server/ServerHelpers\";\nimport { Terminal } from \"../Terminal\";\nimport { calculateHackingTime } from \"../Hacking\";\nimport { Server } from \"../Server/Server\";\nimport { netscriptCanHack } from \"../Hacking/netscriptCanHack\";\n\nexport function NetscriptSingularity(\n player: IPlayer,\n workerScript: WorkerScript,\n helper: INetscriptHelper,\n): ISingularity {\n const getAugmentation = function (func: any, name: any): Augmentation {\n if (!augmentationExists(name)) {\n throw helper.makeRuntimeErrorMsg(func, `Invalid augmentation: '${name}'`);\n }\n\n return Augmentations[name];\n };\n\n const getFaction = function (func: any, name: any): Faction {\n if (!factionExists(name)) {\n throw helper.makeRuntimeErrorMsg(func, `Invalid faction name: '${name}`);\n }\n\n return Factions[name];\n };\n\n const getCompany = function (func: any, name: any): Company {\n const company = Companies[name];\n if (company == null || !(company instanceof Company)) {\n throw helper.makeRuntimeErrorMsg(func, `Invalid company name: '${name}'`);\n }\n return company;\n };\n\n const runAfterReset = function (cbScript = null): void {\n //Run a script after reset\n if (cbScript && isString(cbScript)) {\n const home = player.getHomeComputer();\n for (const script of home.scripts) {\n if (script.filename === cbScript) {\n const ramUsage = script.ramUsage;\n const ramAvailable = home.maxRam - home.ramUsed;\n if (ramUsage > ramAvailable) {\n return; // Not enough RAM\n }\n const runningScriptObj = new RunningScript(script, []); // No args\n runningScriptObj.threads = 1; // Only 1 thread\n startWorkerScript(player, runningScriptObj, home);\n }\n }\n }\n };\n return {\n getOwnedAugmentations: function (purchased: any = false): any {\n helper.updateDynamicRam(\"getOwnedAugmentations\", getRamCost(player, \"getOwnedAugmentations\"));\n helper.checkSingularityAccess(\"getOwnedAugmentations\");\n const res = [];\n for (let i = 0; i < player.augmentations.length; ++i) {\n res.push(player.augmentations[i].name);\n }\n if (purchased) {\n for (let i = 0; i < player.queuedAugmentations.length; ++i) {\n res.push(player.queuedAugmentations[i].name);\n }\n }\n return res;\n },\n getAugmentationsFromFaction: function (facname: any): any {\n helper.updateDynamicRam(\"getAugmentationsFromFaction\", getRamCost(player, \"getAugmentationsFromFaction\"));\n helper.checkSingularityAccess(\"getAugmentationsFromFaction\");\n const faction = getFaction(\"getAugmentationsFromFaction\", facname);\n\n // If player has a gang with this faction, return all augmentations.\n if (player.hasGangWith(facname)) {\n const res = [];\n for (const augName of Object.keys(Augmentations)) {\n if (augName === AugmentationNames.NeuroFluxGovernor) continue;\n if (augName === AugmentationNames.TheRedPill && player.bitNodeN !== 2) continue;\n const aug = Augmentations[augName];\n if (!aug.isSpecial) {\n res.push(augName);\n }\n }\n\n return res;\n }\n\n return faction.augmentations.slice();\n },\n getAugmentationCost: function (name: any): any {\n helper.updateDynamicRam(\"getAugmentationCost\", getRamCost(player, \"getAugmentationCost\"));\n helper.checkSingularityAccess(\"getAugmentationCost\");\n const aug = getAugmentation(\"getAugmentationCost\", name);\n return [aug.baseRepRequirement, aug.baseCost];\n },\n getAugmentationPrereq: function (name: any): any {\n helper.updateDynamicRam(\"getAugmentationPrereq\", getRamCost(player, \"getAugmentationPrereq\"));\n helper.checkSingularityAccess(\"getAugmentationPrereq\");\n const aug = getAugmentation(\"getAugmentationPrereq\", name);\n return aug.prereqs.slice();\n },\n getAugmentationPrice: function (name: any): any {\n helper.updateDynamicRam(\"getAugmentationPrice\", getRamCost(player, \"getAugmentationPrice\"));\n helper.checkSingularityAccess(\"getAugmentationPrice\");\n const aug = getAugmentation(\"getAugmentationPrice\", name);\n return aug.baseCost;\n },\n getAugmentationRepReq: function (name: any): any {\n helper.updateDynamicRam(\"getAugmentationRepReq\", getRamCost(player, \"getAugmentationRepReq\"));\n helper.checkSingularityAccess(\"getAugmentationRepReq\");\n const aug = getAugmentation(\"getAugmentationRepReq\", name);\n return aug.baseRepRequirement;\n },\n getAugmentationStats: function (name: any): any {\n helper.updateDynamicRam(\"getAugmentationStats\", getRamCost(player, \"getAugmentationStats\"));\n helper.checkSingularityAccess(\"getAugmentationStats\");\n const aug = getAugmentation(\"getAugmentationStats\", name);\n return Object.assign({}, aug.mults);\n },\n purchaseAugmentation: function (faction: any, name: any): any {\n helper.updateDynamicRam(\"purchaseAugmentation\", getRamCost(player, \"purchaseAugmentation\"));\n helper.checkSingularityAccess(\"purchaseAugmentation\");\n const fac = getFaction(\"purchaseAugmentation\", faction);\n const aug = getAugmentation(\"purchaseAugmentation\", name);\n\n let augs = [];\n if (player.hasGangWith(faction)) {\n for (const augName of Object.keys(Augmentations)) {\n if (augName === AugmentationNames.NeuroFluxGovernor) continue;\n if (augName === AugmentationNames.TheRedPill && player.bitNodeN !== 2) continue;\n const tempAug = Augmentations[augName];\n if (!tempAug.isSpecial) {\n augs.push(augName);\n }\n }\n } else {\n augs = fac.augmentations;\n }\n\n if (!augs.includes(name)) {\n workerScript.log(\n \"purchaseAugmentation\",\n () => `Faction '${faction}' does not have the '${name}' augmentation.`,\n );\n return false;\n }\n\n const isNeuroflux = aug.name === AugmentationNames.NeuroFluxGovernor;\n if (!isNeuroflux) {\n for (let j = 0; j < player.queuedAugmentations.length; ++j) {\n if (player.queuedAugmentations[j].name === aug.name) {\n workerScript.log(\"purchaseAugmentation\", () => `You already have the '${name}' augmentation.`);\n return false;\n }\n }\n for (let j = 0; j < player.augmentations.length; ++j) {\n if (player.augmentations[j].name === aug.name) {\n workerScript.log(\"purchaseAugmentation\", () => `You already have the '${name}' augmentation.`);\n return false;\n }\n }\n }\n\n if (fac.playerReputation < aug.baseRepRequirement) {\n workerScript.log(\"purchaseAugmentation\", () => `You do not have enough reputation with '${fac.name}'.`);\n return false;\n }\n\n const res = purchaseAugmentation(aug, fac, true);\n workerScript.log(\"purchaseAugmentation\", () => res);\n if (isString(res) && res.startsWith(\"You purchased\")) {\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 10);\n return true;\n } else {\n return false;\n }\n },\n softReset: function (cbScript: any): any {\n helper.updateDynamicRam(\"softReset\", getRamCost(player, \"softReset\"));\n helper.checkSingularityAccess(\"softReset\");\n\n workerScript.log(\"softReset\", () => \"Soft resetting. This will cause this script to be killed\");\n setTimeout(() => {\n prestigeAugmentation();\n runAfterReset(cbScript);\n }, 0);\n\n // Prevent workerScript from \"finishing execution naturally\"\n workerScript.running = false;\n killWorkerScript(workerScript);\n },\n installAugmentations: function (cbScript: any): any {\n helper.updateDynamicRam(\"installAugmentations\", getRamCost(player, \"installAugmentations\"));\n helper.checkSingularityAccess(\"installAugmentations\");\n\n if (player.queuedAugmentations.length === 0) {\n workerScript.log(\"installAugmentations\", () => \"You do not have any Augmentations to be installed.\");\n return false;\n }\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 10);\n workerScript.log(\n \"installAugmentations\",\n () => \"Installing Augmentations. This will cause this script to be killed\",\n );\n setTimeout(() => {\n installAugmentations();\n runAfterReset(cbScript);\n }, 0);\n\n workerScript.running = false; // Prevent workerScript from \"finishing execution naturally\"\n killWorkerScript(workerScript);\n },\n\n goToLocation: function (locationName: any): boolean {\n helper.updateDynamicRam(\"goToLocation\", getRamCost(player, \"goToLocation\"));\n helper.checkSingularityAccess(\"goToLocation\");\n const location = Object.values(Locations).find((l) => l.name === locationName);\n if (!location) {\n workerScript.log(\"goToLocation\", () => `No location named ${locationName}`);\n return false;\n }\n if (player.city !== location.city) {\n workerScript.log(\"goToLocation\", () => `No location named ${locationName} in ${player.city}`);\n return false;\n }\n Router.toLocation(location);\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 50000);\n return true;\n },\n universityCourse: function (universityName: any, className: any, focus = true): any {\n helper.updateDynamicRam(\"universityCourse\", getRamCost(player, \"universityCourse\"));\n helper.checkSingularityAccess(\"universityCourse\");\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n workerScript.log(\"universityCourse\", () => txt);\n }\n\n let costMult, expMult;\n switch (universityName.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase():\n if (player.city != CityName.Aevum) {\n workerScript.log(\n \"universityCourse\",\n () => \"You cannot study at 'Summit University' because you are not in 'Aevum'.\",\n );\n return false;\n }\n player.gotoLocation(LocationName.AevumSummitUniversity);\n costMult = 4;\n expMult = 3;\n break;\n case LocationName.Sector12RothmanUniversity.toLowerCase():\n if (player.city != CityName.Sector12) {\n workerScript.log(\n \"universityCourse\",\n () => \"You cannot study at 'Rothman University' because you are not in 'Sector-12'.\",\n );\n return false;\n }\n player.location = LocationName.Sector12RothmanUniversity;\n costMult = 3;\n expMult = 2;\n break;\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():\n if (player.city != CityName.Volhaven) {\n workerScript.log(\n \"universityCourse\",\n () => \"You cannot study at 'ZB Institute of Technology' because you are not in 'Volhaven'.\",\n );\n return false;\n }\n player.location = LocationName.VolhavenZBInstituteOfTechnology;\n costMult = 5;\n expMult = 4;\n break;\n default:\n workerScript.log(\"universityCourse\", () => `Invalid university name: '${universityName}'.`);\n return false;\n }\n\n let task = \"\";\n switch (className.toLowerCase()) {\n case \"Study Computer Science\".toLowerCase():\n task = CONSTANTS.ClassStudyComputerScience;\n break;\n case \"Data Structures\".toLowerCase():\n task = CONSTANTS.ClassDataStructures;\n break;\n case \"Networks\".toLowerCase():\n task = CONSTANTS.ClassNetworks;\n break;\n case \"Algorithms\".toLowerCase():\n task = CONSTANTS.ClassAlgorithms;\n break;\n case \"Management\".toLowerCase():\n task = CONSTANTS.ClassManagement;\n break;\n case \"Leadership\".toLowerCase():\n task = CONSTANTS.ClassLeadership;\n break;\n default:\n workerScript.log(\"universityCourse\", () => `Invalid class name: ${className}.`);\n return false;\n }\n player.startClass(costMult, expMult, task);\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n workerScript.log(\"universityCourse\", () => `Started ${task} at ${universityName}`);\n return true;\n },\n\n gymWorkout: function (gymName: any, stat: any, focus = true): any {\n helper.updateDynamicRam(\"gymWorkout\", getRamCost(player, \"gymWorkout\"));\n helper.checkSingularityAccess(\"gymWorkout\");\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n workerScript.log(\"gymWorkout\", () => txt);\n }\n let costMult, expMult;\n switch (gymName.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase():\n if (player.city != CityName.Aevum) {\n workerScript.log(\n \"gymWorkout\",\n () => \"You cannot workout at 'Crush Fitness' because you are not in 'Aevum'.\",\n );\n return false;\n }\n player.location = LocationName.AevumCrushFitnessGym;\n costMult = 3;\n expMult = 2;\n break;\n case LocationName.AevumSnapFitnessGym.toLowerCase():\n if (player.city != CityName.Aevum) {\n workerScript.log(\n \"gymWorkout\",\n () => \"You cannot workout at 'Snap Fitness' because you are not in 'Aevum'.\",\n );\n return false;\n }\n player.location = LocationName.AevumSnapFitnessGym;\n costMult = 10;\n expMult = 5;\n break;\n case LocationName.Sector12IronGym.toLowerCase():\n if (player.city != CityName.Sector12) {\n workerScript.log(\n \"gymWorkout\",\n () => \"You cannot workout at 'Iron Gym' because you are not in 'Sector-12'.\",\n );\n return false;\n }\n player.location = LocationName.Sector12IronGym;\n costMult = 1;\n expMult = 1;\n break;\n case LocationName.Sector12PowerhouseGym.toLowerCase():\n if (player.city != CityName.Sector12) {\n workerScript.log(\n \"gymWorkout\",\n () => \"You cannot workout at 'Powerhouse Gym' because you are not in 'Sector-12'.\",\n );\n return false;\n }\n player.location = LocationName.Sector12PowerhouseGym;\n costMult = 20;\n expMult = 10;\n break;\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase():\n if (player.city != CityName.Volhaven) {\n workerScript.log(\n \"gymWorkout\",\n () => \"You cannot workout at 'Millenium Fitness Gym' because you are not in 'Volhaven'.\",\n );\n return false;\n }\n player.location = LocationName.VolhavenMilleniumFitnessGym;\n costMult = 7;\n expMult = 4;\n break;\n default:\n workerScript.log(\"gymWorkout\", () => `Invalid gym name: ${gymName}. gymWorkout() failed`);\n return false;\n }\n\n switch (stat.toLowerCase()) {\n case \"strength\".toLowerCase():\n case \"str\".toLowerCase():\n player.startClass(costMult, expMult, CONSTANTS.ClassGymStrength);\n break;\n case \"defense\".toLowerCase():\n case \"def\".toLowerCase():\n player.startClass(costMult, expMult, CONSTANTS.ClassGymDefense);\n break;\n case \"dexterity\".toLowerCase():\n case \"dex\".toLowerCase():\n player.startClass(costMult, expMult, CONSTANTS.ClassGymDexterity);\n break;\n case \"agility\".toLowerCase():\n case \"agi\".toLowerCase():\n player.startClass(costMult, expMult, CONSTANTS.ClassGymAgility);\n break;\n default:\n workerScript.log(\"gymWorkout\", () => `Invalid stat: ${stat}.`);\n return false;\n }\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n workerScript.log(\"gymWorkout\", () => `Started training ${stat} at ${gymName}`);\n return true;\n },\n\n travelToCity: function (cityname: any): any {\n helper.updateDynamicRam(\"travelToCity\", getRamCost(player, \"travelToCity\"));\n helper.checkSingularityAccess(\"travelToCity\");\n\n switch (cityname) {\n case CityName.Aevum:\n case CityName.Chongqing:\n case CityName.Sector12:\n case CityName.NewTokyo:\n case CityName.Ishima:\n case CityName.Volhaven:\n if (player.money < CONSTANTS.TravelCost) {\n workerScript.log(\"travelToCity\", () => \"Not enough money to travel.\");\n return false\n }\n player.loseMoney(CONSTANTS.TravelCost, \"other\");\n player.city = cityname;\n workerScript.log(\"travelToCity\", () => `Traveled to ${cityname}`);\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 50000);\n return true;\n default:\n throw helper.makeRuntimeErrorMsg(\"travelToCity\", `Invalid city name: '${cityname}'.`);\n }\n },\n\n purchaseTor: function (): any {\n helper.updateDynamicRam(\"purchaseTor\", getRamCost(player, \"purchaseTor\"));\n helper.checkSingularityAccess(\"purchaseTor\");\n\n if (player.hasTorRouter()) {\n workerScript.log(\"purchaseTor\", () => \"You already have a TOR router!\");\n return false;\n }\n\n if (player.money < CONSTANTS.TorRouterCost) {\n workerScript.log(\"purchaseTor\", () => \"You cannot afford to purchase a Tor router.\");\n return false;\n }\n player.loseMoney(CONSTANTS.TorRouterCost, \"other\");\n\n const darkweb = safetlyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: \"darkweb\",\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: false,\n purchasedByPlayer: false,\n maxRam: 1,\n });\n AddToAllServers(darkweb);\n\n player.getHomeComputer().serversOnNetwork.push(darkweb.hostname);\n darkweb.serversOnNetwork.push(player.getHomeComputer().hostname);\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 500);\n workerScript.log(\"purchaseTor\", () => \"You have purchased a Tor router!\");\n return true;\n },\n purchaseProgram: function (programName: any): any {\n helper.updateDynamicRam(\"purchaseProgram\", getRamCost(player, \"purchaseProgram\"));\n helper.checkSingularityAccess(\"purchaseProgram\");\n\n if (!player.hasTorRouter()) {\n workerScript.log(\"purchaseProgram\", () => \"You do not have the TOR router.\");\n return false;\n }\n\n programName = programName.toLowerCase();\n\n const item = Object.values(DarkWebItems).find((i) => i.program.toLowerCase() === programName);\n if (item == null) {\n workerScript.log(\"purchaseProgram\", () => `Invalid program name: '${programName}.`);\n return false;\n }\n\n if (player.money < item.price) {\n workerScript.log(\n \"purchaseProgram\",\n () => `Not enough money to purchase '${item.program}'. Need ${numeralWrapper.formatMoney(item.price)}`,\n );\n return false;\n }\n\n if (player.hasProgram(item.program)) {\n workerScript.log(\"purchaseProgram\", () => `You already have the '${item.program}' program`);\n return true;\n }\n\n player.loseMoney(item.price, \"other\");\n player.getHomeComputer().programs.push(item.program);\n workerScript.log(\n \"purchaseProgram\",\n () => `You have purchased the '${item.program}' program. The new program can be found on your home computer.`,\n );\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 5000);\n return true;\n },\n getCurrentServer: function (): any {\n helper.updateDynamicRam(\"getCurrentServer\", getRamCost(player, \"getCurrentServer\"));\n helper.checkSingularityAccess(\"getCurrentServer\");\n return player.getCurrentServer().hostname;\n },\n connect: function (hostname: any): any {\n helper.updateDynamicRam(\"connect\", getRamCost(player, \"connect\"));\n helper.checkSingularityAccess(\"connect\");\n if (!hostname) {\n throw helper.makeRuntimeErrorMsg(\"connect\", `Invalid hostname: '${hostname}'`);\n }\n\n const target = GetServer(hostname);\n if (target == null) {\n throw helper.makeRuntimeErrorMsg(\"connect\", `Invalid hostname: '${hostname}'`);\n }\n\n if (hostname === \"home\") {\n player.getCurrentServer().isConnectedTo = false;\n player.currentServer = player.getHomeComputer().hostname;\n player.getCurrentServer().isConnectedTo = true;\n Terminal.setcwd(\"/\");\n return true;\n }\n\n const server = player.getCurrentServer();\n for (let i = 0; i < server.serversOnNetwork.length; i++) {\n const other = getServerOnNetwork(server, i);\n if (other === null) continue;\n if (other.hostname == hostname) {\n player.getCurrentServer().isConnectedTo = false;\n player.currentServer = target.hostname;\n player.getCurrentServer().isConnectedTo = true;\n Terminal.setcwd(\"/\");\n return true;\n }\n }\n\n return false;\n },\n manualHack: function (): any {\n helper.updateDynamicRam(\"manualHack\", getRamCost(player, \"manualHack\"));\n helper.checkSingularityAccess(\"manualHack\");\n const server = player.getCurrentServer();\n return helper.hack(server.hostname, true);\n },\n installBackdoor: function (): any {\n helper.updateDynamicRam(\"installBackdoor\", getRamCost(player, \"installBackdoor\"));\n helper.checkSingularityAccess(\"installBackdoor\");\n const baseserver = player.getCurrentServer();\n if (!(baseserver instanceof Server)) {\n workerScript.log(\"installBackdoor\", () => \"cannot backdoor this kind of server\");\n return Promise.resolve();\n }\n const server = baseserver as Server;\n const installTime = (calculateHackingTime(server, player) / 4) * 1000;\n\n // No root access or skill level too low\n const canHack = netscriptCanHack(server, player);\n if (!canHack.res) {\n throw helper.makeRuntimeErrorMsg(\"installBackdoor\", canHack.msg || \"\");\n }\n\n workerScript.log(\n \"installBackdoor\",\n () => `Installing backdoor on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(installTime, true)}`,\n );\n\n return netscriptDelay(installTime, workerScript).then(function () {\n workerScript.log(\"installBackdoor\", () => `Successfully installed backdoor on '${server.hostname}'`);\n\n server.backdoorInstalled = true;\n\n if (SpecialServers.WorldDaemon === server.hostname) {\n Router.toBitVerse(false, false);\n }\n return Promise.resolve();\n });\n },\n isFocused: function (): boolean {\n helper.updateDynamicRam(\"isFocused\", getRamCost(player, \"isFocused\"));\n helper.checkSingularityAccess(\"isFocused\");\n return player.focus;\n },\n setFocus: function (afocus: any): boolean {\n const focus = helper.boolean(afocus);\n helper.updateDynamicRam(\"setFocus\", getRamCost(player, \"setFocus\"));\n helper.checkSingularityAccess(\"setFocus\");\n if (!player.isWorking) {\n throw helper.makeRuntimeErrorMsg(\"setFocus\", \"Not currently working\");\n }\n if (\n !(\n player.workType == CONSTANTS.WorkTypeFaction ||\n player.workType == CONSTANTS.WorkTypeCompany ||\n player.workType == CONSTANTS.WorkTypeCompanyPartTime ||\n player.workType == CONSTANTS.WorkTypeCreateProgram ||\n player.workType == CONSTANTS.WorkTypeStudyClass\n )\n ) {\n throw helper.makeRuntimeErrorMsg(\"setFocus\", \"Cannot change focus for current job\");\n }\n if (!player.focus && focus) {\n player.startFocusing();\n Router.toWork();\n return true;\n } else if (player.focus && !focus) {\n player.stopFocusing();\n Router.toTerminal();\n return true;\n }\n return false;\n },\n getStats: function (): any {\n helper.updateDynamicRam(\"getStats\", getRamCost(player, \"getStats\"));\n helper.checkSingularityAccess(\"getStats\");\n workerScript.log(\"getStats\", () => `getStats is deprecated, please use getplayer`);\n\n return {\n hacking: player.hacking,\n strength: player.strength,\n defense: player.defense,\n dexterity: player.dexterity,\n agility: player.agility,\n charisma: player.charisma,\n intelligence: player.intelligence,\n };\n },\n getCharacterInformation: function (): any {\n helper.updateDynamicRam(\"getCharacterInformation\", getRamCost(player, \"getCharacterInformation\"));\n helper.checkSingularityAccess(\"getCharacterInformation\");\n workerScript.log(\"getCharacterInformation\", () => `getCharacterInformation is deprecated, please use getplayer`);\n\n return {\n bitnode: player.bitNodeN,\n city: player.city,\n factions: player.factions.slice(),\n hp: player.hp,\n jobs: Object.keys(player.jobs),\n jobTitles: Object.values(player.jobs),\n maxHp: player.max_hp,\n mult: {\n agility: player.agility_mult,\n agilityExp: player.agility_exp_mult,\n companyRep: player.company_rep_mult,\n crimeMoney: player.crime_money_mult,\n crimeSuccess: player.crime_success_mult,\n defense: player.defense_mult,\n defenseExp: player.defense_exp_mult,\n dexterity: player.dexterity_mult,\n dexterityExp: player.dexterity_exp_mult,\n factionRep: player.faction_rep_mult,\n hacking: player.hacking_mult,\n hackingExp: player.hacking_exp_mult,\n strength: player.strength_mult,\n strengthExp: player.strength_exp_mult,\n workMoney: player.work_money_mult,\n },\n timeWorked: player.timeWorked,\n tor: player.hasTorRouter(),\n workHackExpGain: player.workHackExpGained,\n workStrExpGain: player.workStrExpGained,\n workDefExpGain: player.workDefExpGained,\n workDexExpGain: player.workDexExpGained,\n workAgiExpGain: player.workAgiExpGained,\n workChaExpGain: player.workChaExpGained,\n workRepGain: player.workRepGained,\n workMoneyGain: player.workMoneyGained,\n hackingExp: player.hacking_exp,\n strengthExp: player.strength_exp,\n defenseExp: player.defense_exp,\n dexterityExp: player.dexterity_exp,\n agilityExp: player.agility_exp,\n charismaExp: player.charisma_exp,\n };\n },\n hospitalize: function (): any {\n helper.updateDynamicRam(\"hospitalize\", getRamCost(player, \"hospitalize\"));\n helper.checkSingularityAccess(\"hospitalize\");\n if (player.isWorking || Router.page() === Page.Infiltration || Router.page() === Page.BitVerse) {\n workerScript.log(\"hospitalize\", () => \"Cannot go to the hospital because the player is busy.\");\n return;\n }\n return player.hospitalize();\n },\n isBusy: function (): any {\n helper.updateDynamicRam(\"isBusy\", getRamCost(player, \"isBusy\"));\n helper.checkSingularityAccess(\"isBusy\");\n return player.isWorking || Router.page() === Page.Infiltration || Router.page() === Page.BitVerse;\n },\n stopAction: function (): any {\n helper.updateDynamicRam(\"stopAction\", getRamCost(player, \"stopAction\"));\n helper.checkSingularityAccess(\"stopAction\");\n if (player.isWorking) {\n if (player.focus) {\n player.stopFocusing();\n Router.toTerminal();\n }\n const txt = player.singularityStopWork();\n workerScript.log(\"stopAction\", () => txt);\n return true;\n }\n return false;\n },\n upgradeHomeCores: function (): any {\n helper.updateDynamicRam(\"upgradeHomeCores\", getRamCost(player, \"upgradeHomeCores\"));\n helper.checkSingularityAccess(\"upgradeHomeCores\");\n\n // Check if we're at max cores\n const homeComputer = player.getHomeComputer();\n if (homeComputer.cpuCores >= 8) {\n workerScript.log(\"upgradeHomeCores\", () => `Your home computer is at max cores.`);\n return false;\n }\n\n const cost = player.getUpgradeHomeCoresCost();\n if (player.money < cost) {\n workerScript.log(\n \"upgradeHomeCores\",\n () => `You don't have enough money. Need ${numeralWrapper.formatMoney(cost)}`,\n );\n return false;\n }\n\n homeComputer.cpuCores += 1;\n player.loseMoney(cost, \"servers\");\n\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 2);\n workerScript.log(\n \"upgradeHomeCores\",\n () => `Purchased an additional core for home computer! It now has ${homeComputer.cpuCores} cores.`,\n );\n return true;\n },\n getUpgradeHomeCoresCost: function (): any {\n helper.updateDynamicRam(\"getUpgradeHomeCoresCost\", getRamCost(player, \"getUpgradeHomeCoresCost\"));\n helper.checkSingularityAccess(\"getUpgradeHomeCoresCost\");\n\n return player.getUpgradeHomeCoresCost();\n },\n upgradeHomeRam: function (): any {\n helper.updateDynamicRam(\"upgradeHomeRam\", getRamCost(player, \"upgradeHomeRam\"));\n helper.checkSingularityAccess(\"upgradeHomeRam\");\n\n // Check if we're at max RAM\n const homeComputer = player.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n workerScript.log(\"upgradeHomeRam\", () => `Your home computer is at max RAM.`);\n return false;\n }\n\n const cost = player.getUpgradeHomeRamCost();\n if (player.money < cost) {\n workerScript.log(\n \"upgradeHomeRam\",\n () => `You don't have enough money. Need ${numeralWrapper.formatMoney(cost)}`,\n );\n return false;\n }\n\n homeComputer.maxRam *= 2;\n player.loseMoney(cost, \"servers\");\n\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 2);\n workerScript.log(\n \"upgradeHomeRam\",\n () =>\n `Purchased additional RAM for home computer! It now has ${numeralWrapper.formatRAM(\n homeComputer.maxRam,\n )} of RAM.`,\n );\n return true;\n },\n getUpgradeHomeRamCost: function (): any {\n helper.updateDynamicRam(\"getUpgradeHomeRamCost\", getRamCost(player, \"getUpgradeHomeRamCost\"));\n helper.checkSingularityAccess(\"getUpgradeHomeRamCost\");\n\n return player.getUpgradeHomeRamCost();\n },\n workForCompany: function (companyName: any, focus = true): any {\n helper.updateDynamicRam(\"workForCompany\", getRamCost(player, \"workForCompany\"));\n helper.checkSingularityAccess(\"workForCompany\");\n\n // Sanitize input\n if (companyName == null) {\n companyName = player.companyName;\n }\n\n // Make sure its a valid company\n if (companyName == null || companyName === \"\" || !(Companies[companyName] instanceof Company)) {\n workerScript.log(\"workForCompany\", () => `Invalid company: '${companyName}'`);\n return false;\n }\n\n // Make sure player is actually employed at the comapny\n if (!Object.keys(player.jobs).includes(companyName)) {\n workerScript.log(\"workForCompany\", () => `You do not have a job at '${companyName}'`);\n return false;\n }\n\n // Check to make sure company position data is valid\n const companyPositionName = player.jobs[companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (companyPositionName === \"\" || !(companyPosition instanceof CompanyPosition)) {\n workerScript.log(\"workForCompany\", () => \"You do not have a job\");\n return false;\n }\n\n const wasFocused = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n workerScript.log(\"workForCompany\", () => txt);\n }\n\n if (companyPosition.isPartTimeJob()) {\n player.startWorkPartTime(companyName);\n } else {\n player.startWork(companyName);\n }\n\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocused) {\n player.stopFocusing();\n Router.toTerminal();\n }\n workerScript.log(\n \"workForCompany\",\n () => `Began working at '${player.companyName}' as a '${companyPositionName}'`,\n );\n return true;\n },\n applyToCompany: function (companyName: any, field: any): any {\n helper.updateDynamicRam(\"applyToCompany\", getRamCost(player, \"applyToCompany\"));\n helper.checkSingularityAccess(\"applyToCompany\");\n getCompany(\"applyToCompany\", companyName);\n\n player.location = companyName;\n let res;\n switch (field.toLowerCase()) {\n case \"software\":\n res = player.applyForSoftwareJob(true);\n break;\n case \"software consultant\":\n res = player.applyForSoftwareConsultantJob(true);\n break;\n case \"it\":\n res = player.applyForItJob(true);\n break;\n case \"security engineer\":\n res = player.applyForSecurityEngineerJob(true);\n break;\n case \"network engineer\":\n res = player.applyForNetworkEngineerJob(true);\n break;\n case \"business\":\n res = player.applyForBusinessJob(true);\n break;\n case \"business consultant\":\n res = player.applyForBusinessConsultantJob(true);\n break;\n case \"security\":\n res = player.applyForSecurityJob(true);\n break;\n case \"agent\":\n res = player.applyForAgentJob(true);\n break;\n case \"employee\":\n res = player.applyForEmployeeJob(true);\n break;\n case \"part-time employee\":\n res = player.applyForPartTimeEmployeeJob(true);\n break;\n case \"waiter\":\n res = player.applyForWaiterJob(true);\n break;\n case \"part-time waiter\":\n res = player.applyForPartTimeWaiterJob(true);\n break;\n default:\n workerScript.log(\"applyToCompany\", () => `Invalid job: '${field}'.`);\n return false;\n }\n // TODO https://github.com/danielyxie/bitburner/issues/1378\n // The player object's applyForJob function can return string with special error messages\n // if (isString(res)) {\n // workerScript.log(\"applyToCompany\",()=> res);\n // return false;\n // }\n if (res) {\n workerScript.log(\n \"applyToCompany\",\n () => `You were offered a new job at '${companyName}' as a '${player.jobs[companyName]}'`,\n );\n } else {\n workerScript.log(\n \"applyToCompany\",\n () => `You failed to get a new job/promotion at '${companyName}' in the '${field}' field.`,\n );\n }\n return res;\n },\n getCompanyRep: function (companyName: any): any {\n helper.updateDynamicRam(\"getCompanyRep\", getRamCost(player, \"getCompanyRep\"));\n helper.checkSingularityAccess(\"getCompanyRep\");\n const company = getCompany(\"getCompanyRep\", companyName);\n return company.playerReputation;\n },\n getCompanyFavor: function (companyName: any): any {\n helper.updateDynamicRam(\"getCompanyFavor\", getRamCost(player, \"getCompanyFavor\"));\n helper.checkSingularityAccess(\"getCompanyFavor\");\n const company = getCompany(\"getCompanyFavor\", companyName);\n return company.favor;\n },\n getCompanyFavorGain: function (companyName: any): any {\n helper.updateDynamicRam(\"getCompanyFavorGain\", getRamCost(player, \"getCompanyFavorGain\"));\n helper.checkSingularityAccess(\"getCompanyFavorGain\");\n const company = getCompany(\"getCompanyFavorGain\", companyName);\n return company.getFavorGain();\n },\n checkFactionInvitations: function (): any {\n helper.updateDynamicRam(\"checkFactionInvitations\", getRamCost(player, \"checkFactionInvitations\"));\n helper.checkSingularityAccess(\"checkFactionInvitations\");\n // Make a copy of player.factionInvitations\n return player.factionInvitations.slice();\n },\n joinFaction: function (name: any): any {\n helper.updateDynamicRam(\"joinFaction\", getRamCost(player, \"joinFaction\"));\n helper.checkSingularityAccess(\"joinFaction\");\n getFaction(\"joinFaction\", name);\n\n if (!player.factionInvitations.includes(name)) {\n workerScript.log(\"joinFaction\", () => `You have not been invited by faction '${name}'`);\n return false;\n }\n const fac = Factions[name];\n joinFaction(fac);\n\n // Update Faction Invitation list to account for joined + banned factions\n for (let i = 0; i < player.factionInvitations.length; ++i) {\n if (player.factionInvitations[i] == name || Factions[player.factionInvitations[i]].isBanned) {\n player.factionInvitations.splice(i, 1);\n i--;\n }\n }\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 5);\n workerScript.log(\"joinFaction\", () => `Joined the '${name}' faction.`);\n return true;\n },\n workForFaction: function (name: any, type: any, focus = true): any {\n helper.updateDynamicRam(\"workForFaction\", getRamCost(player, \"workForFaction\"));\n helper.checkSingularityAccess(\"workForFaction\");\n getFaction(\"workForFaction\", name);\n\n // if the player is in a gang and the target faction is any of the gang faction, fail\n if (player.inGang() && AllGangs[name] !== undefined) {\n workerScript.log(\"workForFaction\", () => `Faction '${name}' does not offer work at the moment.`);\n return false;\n }\n\n if (!player.factions.includes(name)) {\n workerScript.log(\"workForFaction\", () => `You are not a member of '${name}'`);\n return false;\n }\n\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n workerScript.log(\"workForFaction\", () => txt);\n }\n\n const fac = Factions[name];\n // Arrays listing factions that allow each time of work\n const hackAvailable = [\n \"Illuminati\",\n \"Daedalus\",\n \"The Covenant\",\n \"ECorp\",\n \"MegaCorp\",\n \"Bachman & Associates\",\n \"Blade Industries\",\n \"NWO\",\n \"Clarke Incorporated\",\n \"OmniTek Incorporated\",\n \"Four Sigma\",\n \"KuaiGong International\",\n \"Fulcrum Secret Technologies\",\n \"BitRunners\",\n \"The Black Hand\",\n \"NiteSec\",\n \"Chongqing\",\n \"Sector-12\",\n \"New Tokyo\",\n \"Aevum\",\n \"Ishima\",\n \"Volhaven\",\n \"Speakers for the Dead\",\n \"The Dark Army\",\n \"The Syndicate\",\n \"Silhouette\",\n \"Netburners\",\n \"Tian Di Hui\",\n \"CyberSec\",\n ];\n const fdWkAvailable = [\n \"Illuminati\",\n \"Daedalus\",\n \"The Covenant\",\n \"ECorp\",\n \"MegaCorp\",\n \"Bachman & Associates\",\n \"Blade Industries\",\n \"NWO\",\n \"Clarke Incorporated\",\n \"OmniTek Incorporated\",\n \"Four Sigma\",\n \"KuaiGong International\",\n \"The Black Hand\",\n \"Chongqing\",\n \"Sector-12\",\n \"New Tokyo\",\n \"Aevum\",\n \"Ishima\",\n \"Volhaven\",\n \"Speakers for the Dead\",\n \"The Dark Army\",\n \"The Syndicate\",\n \"Silhouette\",\n \"Tetrads\",\n \"Slum Snakes\",\n ];\n const scWkAvailable = [\n \"ECorp\",\n \"MegaCorp\",\n \"Bachman & Associates\",\n \"Blade Industries\",\n \"NWO\",\n \"Clarke Incorporated\",\n \"OmniTek Incorporated\",\n \"Four Sigma\",\n \"KuaiGong International\",\n \"Fulcrum Secret Technologies\",\n \"Chongqing\",\n \"Sector-12\",\n \"New Tokyo\",\n \"Aevum\",\n \"Ishima\",\n \"Volhaven\",\n \"Speakers for the Dead\",\n \"The Syndicate\",\n \"Tetrads\",\n \"Slum Snakes\",\n \"Tian Di Hui\",\n ];\n\n switch (type.toLowerCase()) {\n case \"hacking\":\n case \"hacking contracts\":\n case \"hackingcontracts\":\n if (!hackAvailable.includes(fac.name)) {\n workerScript.log(\"workForFaction\", () => `Faction '${fac.name}' do not need help with hacking contracts.`);\n return false;\n }\n player.startFactionHackWork(fac);\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n workerScript.log(\"workForFaction\", () => `Started carrying out hacking contracts for '${fac.name}'`);\n return true;\n case \"field\":\n case \"fieldwork\":\n case \"field work\":\n if (!fdWkAvailable.includes(fac.name)) {\n workerScript.log(\"workForFaction\", () => `Faction '${fac.name}' do not need help with field missions.`);\n return false;\n }\n player.startFactionFieldWork(fac);\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n workerScript.log(\"workForFaction\", () => `Started carrying out field missions for '${fac.name}'`);\n return true;\n case \"security\":\n case \"securitywork\":\n case \"security work\":\n if (!scWkAvailable.includes(fac.name)) {\n workerScript.log(\"workForFaction\", () => `Faction '${fac.name}' do not need help with security work.`);\n return false;\n }\n player.startFactionSecurityWork(fac);\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n workerScript.log(\"workForFaction\", () => `Started carrying out security work for '${fac.name}'`);\n return true;\n default:\n workerScript.log(\"workForFaction\", () => `Invalid work type: '${type}`);\n }\n return true;\n },\n getFactionRep: function (name: any): any {\n helper.updateDynamicRam(\"getFactionRep\", getRamCost(player, \"getFactionRep\"));\n helper.checkSingularityAccess(\"getFactionRep\");\n const faction = getFaction(\"getFactionRep\", name);\n return faction.playerReputation;\n },\n getFactionFavor: function (name: any): any {\n helper.updateDynamicRam(\"getFactionFavor\", getRamCost(player, \"getFactionFavor\"));\n helper.checkSingularityAccess(\"getFactionFavor\");\n const faction = getFaction(\"getFactionFavor\", name);\n return faction.favor;\n },\n getFactionFavorGain: function (name: any): any {\n helper.updateDynamicRam(\"getFactionFavorGain\", getRamCost(player, \"getFactionFavorGain\"));\n helper.checkSingularityAccess(\"getFactionFavorGain\");\n const faction = getFaction(\"getFactionFavorGain\", name);\n return faction.getFavorGain();\n },\n donateToFaction: function (name: any, amt: any): any {\n helper.updateDynamicRam(\"donateToFaction\", getRamCost(player, \"donateToFaction\"));\n helper.checkSingularityAccess(\"donateToFaction\");\n const faction = getFaction(\"donateToFaction\", name);\n if (!player.factions.includes(faction.name)) {\n workerScript.log(\"donateToFaction\", () => `You can't donate to '${name}' because you aren't a member`);\n return false;\n }\n if (player.inGang() && faction.name === player.getGangFaction().name) {\n workerScript.log(\"donateToFaction\", () => `You can't donate to '${name}' because youre managing a gang for it`);\n return false;\n }\n if (typeof amt !== \"number\" || amt <= 0 || isNaN(amt)) {\n workerScript.log(\"donateToFaction\", () => `Invalid donation amount: '${amt}'.`);\n return false;\n }\n if (player.money < amt) {\n workerScript.log(\n \"donateToFaction\",\n () => `You do not have enough money to donate ${numeralWrapper.formatMoney(amt)} to '${name}'`,\n );\n return false;\n }\n const repNeededToDonate = Math.round(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n if (faction.favor < repNeededToDonate) {\n workerScript.log(\n \"donateToFaction\",\n () =>\n `You do not have enough favor to donate to this faction. Have ${faction.favor}, need ${repNeededToDonate}`,\n );\n return false;\n }\n const repGain = (amt / CONSTANTS.DonateMoneyToRepDivisor) * player.faction_rep_mult;\n faction.playerReputation += repGain;\n player.loseMoney(amt, \"other\");\n workerScript.log(\n \"donateToFaction\",\n () =>\n `${numeralWrapper.formatMoney(amt)} donated to '${name}' for ${numeralWrapper.formatReputation(\n repGain,\n )} reputation`,\n );\n return true;\n },\n createProgram: function (name: any, focus = true): any {\n helper.updateDynamicRam(\"createProgram\", getRamCost(player, \"createProgram\"));\n helper.checkSingularityAccess(\"createProgram\");\n\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n workerScript.log(\"createProgram\", () => txt);\n }\n\n name = name.toLowerCase();\n\n const p = Object.values(Programs).find((p) => p.name.toLowerCase() === name);\n\n if (p == null) {\n workerScript.log(\"createProgram\", () => `The specified program does not exist: '${name}`);\n return false;\n }\n\n if (player.hasProgram(p.name)) {\n workerScript.log(\"createProgram\", () => `You already have the '${p.name}' program`);\n return false;\n }\n\n const create = p.create;\n if (create === null) {\n workerScript.log(\"createProgram\", () => `You cannot create the '${p.name}' program`);\n return false;\n }\n\n if (!create.req(player)) {\n workerScript.log(\n \"createProgram\",\n () => `Hacking level is too low to create '${p.name}' (level ${create.level} req)`,\n );\n return false;\n }\n\n player.startCreateProgramWork(p.name, create.time, create.level);\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n workerScript.log(\"createProgram\", () => `Began creating program: '${name}'`);\n return true;\n },\n commitCrime: function (crimeRoughName: any): any {\n helper.updateDynamicRam(\"commitCrime\", getRamCost(player, \"commitCrime\"));\n helper.checkSingularityAccess(\"commitCrime\");\n\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n workerScript.log(\"commitCrime\", () => txt);\n }\n\n // Set Location to slums\n player.gotoLocation(LocationName.Slums);\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n // couldn't find crime\n throw helper.makeRuntimeErrorMsg(\"commitCrime\", `Invalid crime: '${crimeRoughName}'`);\n }\n workerScript.log(\"commitCrime\", () => `Attempting to commit ${crime.name}...`);\n return crime.commit(Router, player, 1, workerScript);\n },\n getCrimeChance: function (crimeRoughName: any): any {\n helper.updateDynamicRam(\"getCrimeChance\", getRamCost(player, \"getCrimeChance\"));\n helper.checkSingularityAccess(\"getCrimeChance\");\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n throw helper.makeRuntimeErrorMsg(\"getCrimeChance\", `Invalid crime: ${crimeRoughName}`);\n }\n\n return crime.successRate(player);\n },\n getCrimeStats: function (crimeRoughName: any): any {\n helper.updateDynamicRam(\"getCrimeStats\", getRamCost(player, \"getCrimeStats\"));\n helper.checkSingularityAccess(\"getCrimeStats\");\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n throw helper.makeRuntimeErrorMsg(\"getCrimeStats\", `Invalid crime: ${crimeRoughName}`);\n }\n\n return Object.assign({}, crime);\n },\n };\n}\n","// Metadata used for constructing Company Positions\nimport { IConstructorParams } from \"../CompanyPosition\";\nimport * as posNames from \"./companypositionnames\";\n\nexport const companyPositionMetadata: IConstructorParams[] = [\n {\n name: posNames.SoftwareCompanyPositions[0], // Software Enginering Intern\n nextPosition: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer\n baseSalary: 33,\n charismaEffectiveness: 15,\n charismaExpGain: 0.02,\n hackingEffectiveness: 85,\n hackingExpGain: 0.05,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer\n nextPosition: posNames.SoftwareCompanyPositions[2], // Senior Software Engineer\n baseSalary: 80,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.1,\n reqdHacking: 51,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.SoftwareCompanyPositions[2], // Senior Software Engineer\n nextPosition: posNames.SoftwareCompanyPositions[3], // Lead Software Developer\n baseSalary: 165,\n charismaEffectiveness: 20,\n charismaExpGain: 0.08,\n hackingEffectiveness: 80,\n hackingExpGain: 0.4,\n reqdCharisma: 51,\n reqdHacking: 251,\n reqdReputation: 40e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.SoftwareCompanyPositions[3], // Lead Software Developer\n nextPosition: posNames.SoftwareCompanyPositions[4], // Head of Software\n baseSalary: 500,\n charismaEffectiveness: 25,\n charismaExpGain: 0.1,\n hackingEffectiveness: 75,\n hackingExpGain: 0.8,\n reqdCharisma: 151,\n reqdHacking: 401,\n reqdReputation: 200e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.SoftwareCompanyPositions[4], // Head of Software\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 800,\n charismaEffectiveness: 25,\n charismaExpGain: 0.5,\n hackingEffectiveness: 75,\n hackingExpGain: 1,\n reqdCharisma: 251,\n reqdHacking: 501,\n reqdReputation: 400e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n nextPosition: posNames.SoftwareCompanyPositions[6], // Vice President of Technology\n baseSalary: 1650,\n charismaEffectiveness: 25,\n charismaExpGain: 0.5,\n hackingEffectiveness: 75,\n hackingExpGain: 1.1,\n reqdCharisma: 251,\n reqdHacking: 501,\n reqdReputation: 800e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.SoftwareCompanyPositions[6], // Vice President of Technology\n nextPosition: posNames.SoftwareCompanyPositions[7], // Chief Technology Officer\n baseSalary: 2310,\n charismaEffectiveness: 30,\n charismaExpGain: 0.6,\n hackingEffectiveness: 70,\n hackingExpGain: 1.2,\n reqdCharisma: 401,\n reqdHacking: 601,\n reqdReputation: 1.6e6,\n repMultiplier: 1.75,\n },\n {\n name: posNames.SoftwareCompanyPositions[7], // Chief Technology Officer\n nextPosition: null,\n baseSalary: 2640,\n charismaEffectiveness: 35,\n charismaExpGain: 1,\n hackingEffectiveness: 65,\n hackingExpGain: 1.5,\n reqdCharisma: 501,\n reqdHacking: 751,\n reqdReputation: 3.2e6,\n repMultiplier: 2,\n },\n {\n name: posNames.ITCompanyPositions[0], // IT Intern\n nextPosition: posNames.ITCompanyPositions[1], // IT Analyst\n baseSalary: 26,\n charismaEffectiveness: 10,\n charismaExpGain: 0.01,\n hackingEffectiveness: 90,\n hackingExpGain: 0.04,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.ITCompanyPositions[1], // IT Analyst\n nextPosition: posNames.ITCompanyPositions[2], // IT Manager\n baseSalary: 66,\n charismaEffectiveness: 15,\n charismaExpGain: 0.02,\n hackingEffectiveness: 85,\n hackingExpGain: 0.08,\n reqdHacking: 26,\n reqdReputation: 7e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.ITCompanyPositions[2], // IT Manager\n nextPosition: posNames.ITCompanyPositions[3], // Systems Administrator\n baseSalary: 132,\n charismaEffectiveness: 20,\n charismaExpGain: 0.1,\n hackingEffectiveness: 80,\n hackingExpGain: 0.3,\n reqdCharisma: 51,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.ITCompanyPositions[3], // Systems Administrator\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 410,\n charismaEffectiveness: 20,\n charismaExpGain: 0.2,\n hackingEffectiveness: 80,\n hackingExpGain: 0.5,\n reqdCharisma: 76,\n reqdHacking: 251,\n reqdReputation: 175e3,\n repMultiplier: 1.4,\n },\n {\n name: posNames.SecurityEngineerCompanyPositions[0], // Security Engineer\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 121,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.4,\n reqdCharisma: 26,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.2,\n },\n {\n name: posNames.NetworkEngineerCompanyPositions[0], // Network Engineer\n nextPosition: posNames.NetworkEngineerCompanyPositions[1], // Network Adminsitrator\n baseSalary: 121,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.4,\n reqdCharisma: 26,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.2,\n },\n {\n name: posNames.NetworkEngineerCompanyPositions[1], // Network Administrator\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 410,\n charismaEffectiveness: 20,\n charismaExpGain: 0.1,\n hackingEffectiveness: 80,\n hackingExpGain: 0.5,\n reqdCharisma: 76,\n reqdHacking: 251,\n reqdReputation: 175e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.BusinessCompanyPositions[0], // Business Intern\n nextPosition: posNames.BusinessCompanyPositions[1], // Business Analyst\n baseSalary: 46,\n charismaEffectiveness: 90,\n charismaExpGain: 0.08,\n hackingEffectiveness: 10,\n hackingExpGain: 0.01,\n reqdCharisma: 1,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.BusinessCompanyPositions[1], // Business Analyst\n nextPosition: posNames.BusinessCompanyPositions[2], // Business Manager\n baseSalary: 100,\n charismaEffectiveness: 85,\n charismaExpGain: 0.15,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 51,\n reqdHacking: 6,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.BusinessCompanyPositions[2], // Business Manager\n nextPosition: posNames.BusinessCompanyPositions[3], // Operations Manager\n baseSalary: 200,\n charismaEffectiveness: 85,\n charismaExpGain: 0.3,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 101,\n reqdHacking: 51,\n reqdReputation: 40e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.BusinessCompanyPositions[3], // Operations Manager\n nextPosition: posNames.BusinessCompanyPositions[4], // Chief Financial Officer\n baseSalary: 660,\n charismaEffectiveness: 85,\n charismaExpGain: 0.4,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 226,\n reqdHacking: 51,\n reqdReputation: 200e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.BusinessCompanyPositions[4], // Chief Financial Officer\n nextPosition: posNames.BusinessCompanyPositions[5], // Chief Executive Officer\n baseSalary: 1950,\n charismaEffectiveness: 90,\n charismaExpGain: 1,\n hackingEffectiveness: 10,\n hackingExpGain: 0.05,\n reqdCharisma: 501,\n reqdHacking: 76,\n reqdReputation: 800e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.BusinessCompanyPositions[5], // Chief Executive Officer\n nextPosition: null,\n baseSalary: 3900,\n charismaEffectiveness: 90,\n charismaExpGain: 1.5,\n hackingEffectiveness: 10,\n hackingExpGain: 0.05,\n reqdCharisma: 751,\n reqdHacking: 101,\n reqdReputation: 3.2e6,\n repMultiplier: 1.75,\n },\n {\n name: posNames.SecurityCompanyPositions[0], // Police Officer\n nextPosition: posNames.SecurityCompanyPositions[1], // Police Chief\n baseSalary: 82,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.02,\n strengthExpGain: 0.08,\n defenseExpGain: 0.08,\n dexterityExpGain: 0.08,\n agilityExpGain: 0.08,\n charismaExpGain: 0.04,\n reqdHacking: 11,\n reqdStrength: 101,\n reqdDefense: 101,\n reqdDexterity: 101,\n reqdAgility: 101,\n reqdCharisma: 51,\n reqdReputation: 8e3,\n repMultiplier: 1,\n },\n {\n name: posNames.SecurityCompanyPositions[1], // Police Chief\n nextPosition: null,\n baseSalary: 460,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.02,\n strengthExpGain: 0.1,\n defenseExpGain: 0.1,\n dexterityExpGain: 0.1,\n agilityExpGain: 0.1,\n charismaExpGain: 0.1,\n reqdHacking: 101,\n reqdStrength: 301,\n reqdDefense: 301,\n reqdDexterity: 301,\n reqdAgility: 301,\n reqdCharisma: 151,\n reqdReputation: 36e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.SecurityCompanyPositions[2], // Security Guard\n nextPosition: posNames.SecurityCompanyPositions[3], // Security Officer\n baseSalary: 50,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.01,\n strengthExpGain: 0.04,\n defenseExpGain: 0.04,\n dexterityExpGain: 0.04,\n agilityExpGain: 0.04,\n charismaExpGain: 0.02,\n reqdStrength: 51,\n reqdDefense: 51,\n reqdDexterity: 51,\n reqdAgility: 51,\n reqdCharisma: 1,\n repMultiplier: 1,\n },\n {\n name: posNames.SecurityCompanyPositions[3], // Security Officer\n nextPosition: posNames.SecurityCompanyPositions[4], // Security Supervisor\n baseSalary: 195,\n hackingEffectiveness: 10,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 10,\n hackingExpGain: 0.02,\n strengthExpGain: 0.1,\n defenseExpGain: 0.1,\n dexterityExpGain: 0.1,\n agilityExpGain: 0.1,\n charismaExpGain: 0.05,\n reqdHacking: 26,\n reqdStrength: 151,\n reqdDefense: 151,\n reqdDexterity: 151,\n reqdAgility: 151,\n reqdCharisma: 51,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.SecurityCompanyPositions[4], // Security Supervisor\n nextPosition: posNames.SecurityCompanyPositions[5], // Head of Security\n baseSalary: 660,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 15,\n agilityEffectiveness: 15,\n charismaEffectiveness: 30,\n hackingExpGain: 0.02,\n strengthExpGain: 0.12,\n defenseExpGain: 0.12,\n dexterityExpGain: 0.12,\n agilityExpGain: 0.12,\n charismaExpGain: 0.1,\n reqdHacking: 26,\n reqdStrength: 251,\n reqdDefense: 251,\n reqdDexterity: 251,\n reqdAgility: 251,\n reqdCharisma: 101,\n reqdReputation: 36e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.SecurityCompanyPositions[5], // Head of Security\n nextPosition: null,\n baseSalary: 1320,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 15,\n agilityEffectiveness: 15,\n charismaEffectiveness: 30,\n hackingExpGain: 0.05,\n strengthExpGain: 0.15,\n defenseExpGain: 0.15,\n dexterityExpGain: 0.15,\n agilityExpGain: 0.15,\n charismaExpGain: 0.15,\n reqdHacking: 51,\n reqdStrength: 501,\n reqdDefense: 501,\n reqdDexterity: 501,\n reqdAgility: 501,\n reqdCharisma: 151,\n reqdReputation: 144e3,\n repMultiplier: 1.4,\n },\n {\n name: posNames.AgentCompanyPositions[0], // Field Agent\n nextPosition: posNames.AgentCompanyPositions[1], // Secret Agent\n baseSalary: 330,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 20,\n hackingExpGain: 0.04,\n strengthExpGain: 0.08,\n defenseExpGain: 0.08,\n dexterityExpGain: 0.08,\n agilityExpGain: 0.08,\n charismaExpGain: 0.05,\n reqdHacking: 101,\n reqdStrength: 101,\n reqdDefense: 101,\n reqdDexterity: 101,\n reqdAgility: 101,\n reqdCharisma: 101,\n reqdReputation: 8e3,\n repMultiplier: 1,\n },\n {\n name: posNames.AgentCompanyPositions[1], // Secret Agent\n nextPosition: posNames.AgentCompanyPositions[2], // Special Operative\n baseSalary: 990,\n hackingEffectiveness: 15,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.1,\n strengthExpGain: 0.15,\n defenseExpGain: 0.15,\n dexterityExpGain: 0.15,\n agilityExpGain: 0.15,\n charismaExpGain: 0.1,\n reqdHacking: 201,\n reqdStrength: 251,\n reqdDefense: 251,\n reqdDexterity: 251,\n reqdAgility: 251,\n reqdCharisma: 201,\n reqdReputation: 32e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.AgentCompanyPositions[2], // Special Operative\n nextPosition: null,\n baseSalary: 2000,\n hackingEffectiveness: 15,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.15,\n strengthExpGain: 0.2,\n defenseExpGain: 0.2,\n dexterityExpGain: 0.2,\n agilityExpGain: 0.2,\n charismaExpGain: 0.15,\n reqdHacking: 251,\n reqdStrength: 501,\n reqdDefense: 501,\n reqdDexterity: 501,\n reqdAgility: 501,\n reqdCharisma: 251,\n reqdReputation: 162e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.MiscCompanyPositions[0], // Waiter\n nextPosition: null,\n baseSalary: 22,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.02,\n defenseExpGain: 0.02,\n dexterityExpGain: 0.02,\n agilityExpGain: 0.02,\n charismaExpGain: 0.05,\n repMultiplier: 1,\n },\n {\n name: posNames.MiscCompanyPositions[1], // Employee\n nextPosition: null,\n baseSalary: 22,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.02,\n defenseExpGain: 0.02,\n dexterityExpGain: 0.02,\n agilityExpGain: 0.02,\n charismaExpGain: 0.04,\n repMultiplier: 1,\n },\n {\n name: posNames.SoftwareConsultantCompanyPositions[0], // Software Consultant\n nextPosition: posNames.SoftwareConsultantCompanyPositions[1], // Senior Software Consultant\n baseSalary: 66,\n hackingEffectiveness: 80,\n charismaEffectiveness: 20,\n hackingExpGain: 0.08,\n charismaExpGain: 0.03,\n reqdHacking: 51,\n repMultiplier: 1,\n },\n {\n name: posNames.SoftwareConsultantCompanyPositions[1], // Senior Software Consultant\n nextPosition: null,\n baseSalary: 132,\n hackingEffectiveness: 75,\n charismaEffectiveness: 25,\n hackingExpGain: 0.25,\n charismaExpGain: 0.06,\n reqdHacking: 251,\n reqdCharisma: 51,\n repMultiplier: 1.2,\n },\n {\n name: posNames.BusinessConsultantCompanyPositions[0], // Business Consultant\n nextPosition: posNames.BusinessConsultantCompanyPositions[1], // Senior Business Consultant\n baseSalary: 66,\n hackingEffectiveness: 20,\n charismaEffectiveness: 80,\n hackingExpGain: 0.015,\n charismaExpGain: 0.15,\n reqdHacking: 6,\n reqdCharisma: 51,\n repMultiplier: 1,\n },\n {\n name: posNames.BusinessConsultantCompanyPositions[1], // Senior Business Consultant\n nextPosition: null,\n baseSalary: 525,\n hackingEffectiveness: 15,\n charismaEffectiveness: 85,\n hackingExpGain: 0.015,\n charismaExpGain: 0.3,\n reqdHacking: 51,\n reqdCharisma: 226,\n repMultiplier: 1.2,\n },\n {\n name: posNames.PartTimeCompanyPositions[0], // Part-time waiter\n nextPosition: null,\n baseSalary: 20,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.0075,\n defenseExpGain: 0.0075,\n dexterityExpGain: 0.0075,\n agilityExpGain: 0.0075,\n charismaExpGain: 0.04,\n repMultiplier: 1,\n },\n {\n name: posNames.PartTimeCompanyPositions[1], // Part-time employee\n nextPosition: null,\n baseSalary: 20,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.0075,\n defenseExpGain: 0.0075,\n dexterityExpGain: 0.0075,\n agilityExpGain: 0.0075,\n charismaExpGain: 0.03,\n repMultiplier: 1,\n },\n];\n","import { Player } from \"../Player\";\nimport { Script } from \"../Script/Script\";\nimport { GetAllServers } from \"../Server/AllServers\";\n\nconst detect: [string, string][] = [\n [\"getHackTime\", \"returns milliseconds\"],\n [\"getGrowTime\", \"returns milliseconds\"],\n [\"getWeakenTime\", \"returns milliseconds\"],\n [\"getActionTime\", \"returns milliseconds\"],\n [\"hackAnalyzePercent\", \"renamed 'hackAnalyze' and returns decimal\"],\n [\"hackChance\", \"renamed 'hackAnalyzeChance'\"],\n [\"basic.calculateSkill\", \"renamed 'skills.calculateSkill'\"],\n [\"basic.calculateExp\", \"renamed 'skills.calculateExp'\"],\n [\"basic.hackChance\", \"renamed 'hacking.hackChance'\"],\n [\"basic.hackExp\", \"renamed 'hacking.hackExp'\"],\n [\"basic.hackPercent\", \"renamed 'hacking.hackPercent'\"],\n [\"basic.growPercent\", \"renamed 'hacking.growPercent'\"],\n [\"basic.hackTime\", \"renamed 'hacking.hackTime'\"],\n [\"basic.growTime\", \"renamed 'hacking.growTime'\"],\n [\"basic.weakenTime\", \"renamed 'hacking.weakenTime'\"],\n [\"write\", \"needs to be awaited\"],\n [\"scp\", \"needs to be awaited\"],\n [\"sleep\", \"Can no longer be called simultenaously.\"],\n [\"hacking_skill\", \"renamed 'hacking'\"],\n [\"tryWrite\", \"renamed 'tryWritePort'\"],\n];\n\nconst changes: [RegExp, string][] = [\n [/ns.getHackTime/g, \"((...a)=>ns.getHackTime(...a)/1000)\"],\n [/ns.getGrowTime/g, \"((...a)=>ns.getGrowTime(...a)/1000)\"],\n [/ns.getWeakenTime/g, \"((...a)=>ns.getWeakenTime(...a)/1000)\"],\n [/ns.bladeburner.getActionTime/g, \"((...a)=>ns.bladeburner.getActionTime(...a)/1000)\"],\n [/ns.hackAnalyzePercent/g, \"((...a)=>ns.hackAnalyze(...a)*100)\"],\n [/ns.hackChance/g, \"ns.hackAnalyzeChance\"],\n [/ns.tryWrite/g, \"ns.tryWritePort\"],\n [/formulas.basic.calculateSkill/g, \"formulas.skills.calculateSkill\"],\n [/formulas.basic.calculateExp/g, \"formulas.skills.calculateExp\"],\n [/formulas.basic.hackChance/g, \"formulas.hacking.hackChance\"],\n [/formulas.basic.hackExp/g, \"formulas.hacking.hackExp\"],\n [/formulas.basic.hackPercent/g, \"formulas.hacking.hackPercent\"],\n [/formulas.basic.growPercent/g, \"formulas.hacking.growPercent\"],\n [/formulas.basic.hackTime/g, \"formulas.hacking.hackTime\"],\n [/formulas.basic.growTime/g, \"formulas.hacking.growTime\"],\n [/formulas.basic.weakenTime/g, \"formulas.hacking.weakenTime\"],\n];\nfunction hasChanges(code: string): boolean {\n for (const change of changes) {\n if (code.match(change[0])) return true;\n }\n return false;\n}\n\nfunction convert(code: string): string {\n const lines = code.split(\"\\n\");\n const out: string[] = [];\n for (let i = 0; i < lines.length; i++) {\n const orig = lines[i];\n let line = lines[i];\n for (const change of changes) {\n line = line.replace(change[0], change[1]);\n }\n if (line != orig) {\n out.push(`// =============================== original line ===============================`);\n out.push(`/**`);\n out.push(` * ${orig}`);\n out.push(\" */\");\n out.push(`// =============================================================================`);\n }\n out.push(line);\n }\n return out.join(\"\\n\");\n}\n\nexport function v1APIBreak(): void {\n interface IFileLine {\n file: string;\n line: number;\n }\n let txt = \"\";\n for (const server of GetAllServers()) {\n for (const change of detect) {\n const s: IFileLine[] = [];\n for (const script of server.scripts) {\n const lines = script.code.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].includes(change[0])) {\n s.push({\n file: script.filename,\n line: i + 1,\n });\n }\n }\n }\n\n if (s.length === 0) continue;\n\n txt += `// Detected change ${change[0]}, reason: ${change[1]}` + \"\\n\";\n for (const fl of s) {\n txt += `${fl.file}:${fl.line}` + \"\\n\";\n }\n }\n }\n if (txt !== \"\") {\n const home = Player.getHomeComputer();\n home.writeToTextFile(\"v1_DETECTED_CHANGES.txt\", txt);\n }\n\n for (const server of GetAllServers()) {\n const backups: Script[] = [];\n for (const script of server.scripts) {\n if (!hasChanges(script.code)) continue;\n const prefix = script.filename.includes(\"/\") ? \"/BACKUP_\" : \"BACKUP_\";\n backups.push(new Script(Player, prefix + script.filename, script.code, script.server));\n script.code = convert(script.code);\n }\n server.scripts = server.scripts.concat(backups);\n }\n}\n","/**\n * Metadata for constructing Location objects for all Locations\n * in the game\n */\nimport { CityName } from \"./CityNames\";\nimport { LocationName } from \"./LocationNames\";\nimport { IConstructorParams } from \"../Location\";\nimport { LocationType } from \"../LocationTypeEnum\";\n\nexport const LocationsMetadata: IConstructorParams[] = [\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 8.18,\n },\n name: LocationName.AevumAeroCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 8.19,\n },\n name: LocationName.AevumBachmanAndAssociates,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 9.55,\n },\n name: LocationName.AevumClarkeIncorporated,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n costMult: 3,\n expMult: 2,\n name: LocationName.AevumCrushFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 37,\n startingSecurityLevel: 17.02,\n },\n name: LocationName.AevumECorp,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 512,\n techVendorMinRam: 128,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 15.54,\n },\n name: LocationName.AevumFulcrumTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 1024,\n techVendorMinRam: 256,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 7.89,\n },\n name: LocationName.AevumGalacticCybersystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 6,\n startingSecurityLevel: 3.29,\n },\n name: LocationName.AevumNetLinkTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 64,\n techVendorMinRam: 8,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 6,\n startingSecurityLevel: 5.35,\n },\n name: LocationName.AevumPolice,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 5.02,\n },\n name: LocationName.AevumRhoConstruction,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n costMult: 10,\n expMult: 5,\n name: LocationName.AevumSnapFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Aevum,\n costMult: 4,\n expMult: 3,\n name: LocationName.AevumSummitUniversity,\n types: [LocationType.University],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 7,\n startingSecurityLevel: 5.85,\n },\n name: LocationName.AevumWatchdogSecurity,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n name: LocationName.AevumCasino,\n types: [LocationType.Casino],\n },\n {\n city: CityName.Chongqing,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 16.25,\n },\n name: LocationName.ChongqingKuaiGongInternational,\n types: [LocationType.Company],\n },\n {\n city: CityName.Chongqing,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 12.59,\n },\n name: LocationName.ChongqingSolarisSpaceSystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.02,\n },\n name: LocationName.IshimaNovaMedical,\n types: [LocationType.Company],\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 10,\n startingSecurityLevel: 3.2,\n },\n name: LocationName.IshimaOmegaSoftware,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 128,\n techVendorMinRam: 4,\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 5.38,\n },\n name: LocationName.IshimaStormTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 512,\n techVendorMinRam: 32,\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 17,\n startingSecurityLevel: 7.18,\n },\n name: LocationName.NewTokyoDefComm,\n types: [LocationType.Company],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 20,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n types: [LocationType.Company],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 2.5,\n },\n name: LocationName.NewTokyoNoodleBar,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 5.52,\n },\n name: LocationName.NewTokyoVitaLife,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 10,\n startingSecurityLevel: 3.62,\n },\n name: LocationName.Sector12AlphaEnterprises,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 8,\n techVendorMinRam: 2,\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 10.59,\n },\n name: LocationName.Sector12BladeIndustries,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12CIA,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 4.66,\n },\n name: LocationName.Sector12CarmichaelSecurity,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12CityHall,\n types: [LocationType.Special],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.Sector12DeltaOne,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12FoodNStuff,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 8.18,\n },\n name: LocationName.Sector12FourSigma,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 17,\n startingSecurityLevel: 6.02,\n },\n name: LocationName.Sector12IcarusMicrosystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n expMult: 1,\n costMult: 1,\n name: LocationName.Sector12IronGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 3.13,\n },\n name: LocationName.Sector12JoesGuns,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 31,\n startingSecurityLevel: 16.36,\n },\n name: LocationName.Sector12MegaCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12NSA,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.Sector12,\n costMult: 20,\n expMult: 10,\n name: LocationName.Sector12PowerhouseGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Sector12,\n costMult: 3,\n expMult: 2,\n name: LocationName.Sector12RothmanUniversity,\n types: [LocationType.University],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.Sector12UniversalEnergy,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 3.59,\n },\n name: LocationName.VolhavenCompuTek,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 256,\n techVendorMinRam: 8,\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 7.28,\n },\n name: LocationName.VolhavenHeliosLabs,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 4.35,\n },\n name: LocationName.VolhavenLexoCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n costMult: 7,\n expMult: 4,\n name: LocationName.VolhavenMilleniumFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 50,\n startingSecurityLevel: 8.53,\n },\n name: LocationName.VolhavenNWO,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 7.74,\n },\n name: LocationName.VolhavenOmniTekIncorporated,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 1024,\n techVendorMinRam: 128,\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 22,\n startingSecurityLevel: 6,\n },\n name: LocationName.VolhavenOmniaCybersystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 4.77,\n },\n name: LocationName.VolhavenSysCoreSecurities,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n costMult: 5,\n expMult: 4,\n name: LocationName.VolhavenZBInstituteOfTechnology,\n types: [LocationType.University],\n },\n {\n city: null,\n name: LocationName.Hospital,\n types: [LocationType.Hospital],\n },\n {\n city: null,\n name: LocationName.Slums,\n types: [LocationType.Slums],\n },\n {\n city: null,\n name: LocationName.TravelAgency,\n types: [LocationType.TravelAgency],\n },\n {\n city: null,\n name: LocationName.WorldStockExchange,\n types: [LocationType.StockMarket],\n },\n {\n city: CityName.Chongqing,\n name: LocationName.ChongqingChurchOfTheMachineGod,\n types: [LocationType.Special],\n },\n {\n city: CityName.Ishima,\n name: LocationName.IshimaGlitch,\n types: [LocationType.Special],\n },\n];\n","import React, { useState, useEffect } from \"react\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Button from \"@mui/material/Button\";\nimport ArrowForwardIos from \"@mui/icons-material/ArrowForwardIos\";\nimport ArrowBackIos from \"@mui/icons-material/ArrowBackIos\";\nimport { ITutorialEvents } from \"./ITutorialEvents\";\nimport { CopyableText } from \"../React/CopyableText\";\n\nimport ListItem from \"@mui/material/ListItem\";\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport AccountTreeIcon from \"@mui/icons-material/AccountTree\";\nimport StorageIcon from \"@mui/icons-material/Storage\";\nimport LocationCityIcon from \"@mui/icons-material/LocationCity\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nimport {\n iTutorialPrevStep,\n iTutorialNextStep,\n ITutorial,\n iTutorialSteps,\n iTutorialEnd,\n} from \"../../InteractiveTutorial\";\n\ninterface IContent {\n content: React.ReactElement;\n canNext: boolean;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n borderBottom: \"1px solid \" + theme.palette.primary.main,\n },\n code: {\n whiteSpace: \"pre\",\n backgroundColor: theme.palette.background.paper,\n },\n }),\n);\n\nexport function InteractiveTutorialRoot(): React.ReactElement {\n const classes = useStyles();\n\n const contents: { [number: string]: IContent | undefined } = {\n [iTutorialSteps.Start as number]: {\n content: (\n <>\n <Typography>\n Welcome to Bitburner, a cyberpunk-themed incremental RPG! The game takes place in a dark, dystopian\n future... The year is 2077...\n <br />\n <br />\n This tutorial will show you the basics of the game. You may skip the tutorial at any time.\n <br />\n <br />\n You can also collapse this panel to temporarily hide this tutorial.\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.GoToCharacterPage as number]: {\n content: (\n <>\n <Typography>Let's start by heading to the Stats page. Click</Typography>\n <ListItem>\n <EqualizerIcon color={\"error\"} />\n <Typography color={\"error\"}>Stats</Typography>\n </ListItem>\n\n <Typography>on the main navigation menu (left-hand side of the screen)</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.CharacterPage as number]: {\n content: (\n <>\n <ListItem>\n <EqualizerIcon color={\"primary\"} />\n <Typography color={\"primary\"}>Stats</Typography>\n </ListItem>\n <Typography>\n shows a lot of important information about your progress, such as your skills, money, and bonuses.\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.CharacterGoToTerminalPage as number]: {\n content: (\n <>\n <Typography>Let's head to your computer's terminal by clicking</Typography>\n <ListItem>\n <LastPageIcon color={\"error\"} />\n <Typography color={\"error\"}>Terminal</Typography>\n </ListItem>\n <Typography>on the main navigation menu.</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalIntro as number]: {\n content: (\n <>\n <ListItem>\n <LastPageIcon color={\"primary\"} />\n <Typography color={\"primary\"}>Terminal</Typography>\n </ListItem>\n <Typography>\n is used to interface with your home computer as well as all of the other machines around the world.\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalHelp as number]: {\n content: (\n <>\n <Typography>Let's try it out. Start by entering</Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> help\"}</Typography>\n <Typography>(Don't forget to press Enter after typing the command)</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalLs as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> help\"}</Typography>\n <Typography>\n displays a list of all available Terminal commands, how to use them, and a description of what they do.{\" \"}\n <br />\n <br />\n Let's try another command. Enter\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> ls\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScan as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> ls\"}</Typography>\n <Typography>\n {\" \"}\n is a basic command that shows files on the computer. Right now, it shows that you have a program called{\" \"}\n NUKE.exe on your computer. We'll get to what this does later. <br />\n <br />\n Using your home computer's terminal, you can connect to other machines throughout the world. Let's do that\n now by first entering\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScanAnalyze1 as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan\"}</Typography>\n <Typography>\n shows all available network connections. In other words, it displays a list of all servers that can be\n connected to from your current machine. A server is identified by its hostname. <br />\n <br />\n That's great and all, but there's so many servers. Which one should you go to?{\" \"}\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze\"}</Typography>\n <Typography>gives some more detailed information about servers on the network. Try it now!</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScanAnalyze2 as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze\"}</Typography>\n <Typography>\n shows more detailed information about each server that you can connect to (servers that are a distance of\n one node away). <br />\n <br /> It is also possible to run scan-analyze with a higher depth. Let's try a depth of two with the\n following command:{\" \"}\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze 2\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalConnect as number]: {\n content: (\n <>\n <Typography>\n Now you can see information about all servers that are up to two nodes away, as well as figure out how to\n navigate to those servers through the network. You can only connect to a server that is one node away. To\n connect to a machine, use\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> connect hostname\"}</Typography>\n\n <Typography>From the results of </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze 2\"}</Typography>\n\n <Typography>\n {\" \"}\n we can see that the n00dles server is only one node away. Let's connect so it now using:\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> connect n00dles\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalAnalyze as number]: {\n content: (\n <>\n <Typography>\n You are now connected to another machine! What can you do now? You can hack it!\n <br />\n <br /> In the year 2077, currency has become digital and decentralized. People and corporations store their\n money on servers and computers. Using your hacking abilities, you can hack servers to steal money and gain\n experience. <br />\n <br />\n Before you try to hack a server, you should run diagnostics using{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> analyze\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalNuke as number]: {\n content: (\n <>\n <Typography>When </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> analyze\"}</Typography>\n\n <Typography>\n finishes running it will show useful information about hacking the server. <br />\n <br /> For this server, the required hacking skill is only 1, which means you can hack it right now.\n However, in order to hack a server you must first gain root access. The NUKE.exe program that we saw earlier\n on your home computer is a virus that will grant you root access to a machine if there are enough open\n ports.\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> analyze\"}</Typography>\n\n <Typography>\n {\" \"}\n shows that there do not need to be any open ports on this machine for the NUKE virus to work, so go ahead\n and run the virus using{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> run NUKE.exe\"}</Typography>\n\n <Typography></Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalManualHack as number]: {\n content: (\n <>\n <Typography>You now have root access! You can hack the server using </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> hack\"}</Typography>\n\n <Typography> Try doing that now.</Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalHackingMechanics as number]: {\n content: (\n <Typography>\n You are now attempting to hack the server. Performing a hack takes time and only has a certain percentage\n chance of success. This time and success chance is determined by a variety of factors, including your hacking\n skill and the server's security level.\n <br />\n <br />\n If your attempt to hack the server is successful, you will steal a certain percentage of the server's total\n money. This percentage is affected by your hacking skill and the server's security level.\n <br />\n <br />\n The amount of money on a server is not limitless. So, if you constantly hack a server and deplete its money,\n then you will encounter diminishing returns in your hacking. You will need to use{\" \"}\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> grow\"}</Typography>\n which tricks the company into adding money to their server and{\" \"}\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> weaken\"}</Typography>\n which increases the speed of hack and grow.\n </Typography>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalGoHome as number]: {\n content: (\n <>\n <Typography>From any server you can get back home using</Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> home\"}</Typography>\n\n <Typography>Let's head home before creating our first script!</Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalCreateScript as number]: {\n content: (\n <>\n <Typography>\n Hacking is the core mechanic of the game and is necessary for progressing. However, you don't want to be\n hacking manually the entire time. You can automate your hacking by writing scripts!\n <br />\n <br />\n To create a new script or edit an existing one, you can use{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> nano\"}</Typography>\n\n <Typography>Scripts must end with the .script extension. Let's make a script now by entering </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> nano n00dles.script\"}</Typography>\n\n <Typography>\n after the hack command finishes running (Sidenote: Pressing ctrl + c will end a command like hack early)\n </Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalTypeScript as number]: {\n content: (\n <>\n <Typography>\n This is the script editor. You can use it to program your scripts. Scripts are written in a simplified\n version of javascript. Copy and paste the following code into the script editor: <br />\n </Typography>\n\n <Typography classes={{ root: classes.code }}>\n <CopyableText\n value={`while(true) {\n hack('n00dles');\n}`}\n />\n </Typography>\n <Typography>\n For anyone with basic programming experience, this code should be straightforward. This script will\n continuously hack the n00dles server.\n <br />\n <br />\n To save and close the script editor, press the button in the bottom left, or press ctrl + s then ctrl + b.\n </Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalFree as number]: {\n content: (\n <>\n <Typography>\n Now we'll run the script. Scripts require a certain amount of RAM to run, and can be run on any machine\n which you have root access to. Different servers have different amounts of RAM. You can also purchase more\n RAM for your home server.\n <br />\n <br />\n To check how much RAM is available on this machine, enter\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> free\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalRunScript as number]: {\n content: (\n <>\n <Typography>\n We have 8GB of free RAM on this machine, which is enough to run our script. Let's run our script using\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> run n00dles.script\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalGoToActiveScriptsPage as number]: {\n content: (\n <>\n <Typography>\n Your script is now running! It will continuously run in the background and will automatically stop if the\n code ever completes (the n00dles.script will never complete because it runs an infinite loop). <br />\n <br />\n These scripts can passively earn you income and hacking experience. Your scripts will also earn money and\n experience while you are offline, although at a slightly slower rate. <br />\n <br />\n Let's check out some statistics for our running scripts by clicking{\" \"}\n </Typography>\n <ListItem>\n <StorageIcon color={\"error\"} />\n <Typography color={\"error\"}>Active Scripts</Typography>\n </ListItem>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.ActiveScriptsPage as number]: {\n content: (\n <>\n <Typography>\n This page displays information about all of your scripts that are running across every server. You can use\n this to gauge how well your scripts are doing. Let's go back to\n </Typography>\n <ListItem>\n <LastPageIcon color={\"error\"} />\n <Typography color={\"error\"}>Terminal</Typography>\n </ListItem>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.ActiveScriptsToTerminal as number]: {\n content: (\n <>\n <Typography>\n One last thing about scripts, each active script contains logs that detail what it's doing. We can check\n these logs using the tail command. Do that now for the script we just ran by typing{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> tail n00dles.script\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalTailScript as number]: {\n content: (\n <>\n <Typography>\n The log for this script won't show much right now (it might show nothing at all) because it just started\n running...but check back again in a few minutes! <br />\n <br />\n This covers the basics of hacking. To learn more about writing scripts, select\n </Typography>\n <ListItem>\n <HelpIcon color={\"primary\"} />\n <Typography color={\"primary\"}>Tutorial</Typography>\n </ListItem>\n <Typography>\n in the main navigation menu to look at the documentation.\n <br />\n <br />\n If you know even a little bit of programming it is highly recommended you use NS2 instead. You will enjoy\n the game much more. NS1 files end with .script and are a subset of javascript. NS2 files end with .js and\n are full speed native javascript.\n <br />\n <br />\n You can learn more about the difference between them later in the documentation.\n <br />\n <br />\n For now, let's move on to something else!\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.GoToHacknetNodesPage as number]: {\n content: (\n <>\n <Typography>\n Hacking is not the only way to earn money. One other way to passively earn money is by purchasing and\n upgrading Hacknet Nodes. Let's go to\n </Typography>\n <ListItem>\n <AccountTreeIcon color={\"error\"} />\n <Typography color={\"error\"}>Hacknet</Typography>\n </ListItem>\n <Typography>through the main navigation menu now.</Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.HacknetNodesIntroduction as number]: {\n content: (\n <Typography>\n Here you can purchase new Hacknet Nodes and upgrade your existing ones. Let's purchase a new one now.\n </Typography>\n ),\n canNext: true,\n },\n [iTutorialSteps.HacknetNodesGoToWorldPage as number]: {\n content: (\n <>\n <Typography>\n You just purchased a Hacknet Node! This Hacknet Node will passively earn you money over time, both online\n and offline. When you get enough money, you can upgrade your newly-purchased Hacknet Node below.\n <br />\n <br />\n Let's go to\n </Typography>\n <ListItem>\n <LocationCityIcon color={\"error\"} />\n <Typography color={\"error\"}>City</Typography>\n </ListItem>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.WorldDescription as number]: {\n content: (\n <>\n <Typography>\n This page lists all of the different locations you can currently travel to. Each location has something that\n you can do. There's a lot of content out in the world, make sure you explore and discover!\n <br />\n <br />\n Lastly, click on\n </Typography>\n <ListItem>\n <HelpIcon color={\"error\"} />\n <Typography color={\"error\"}>Tutorial</Typography>\n </ListItem>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TutorialPageInfo as number]: {\n content: (\n <Typography>\n This page contains a lot of different documentation about the game's content and mechanics. I know it's a lot,\n but I highly suggest you read (or at least skim) through this before you start playing . That's the end of the\n tutorial. Hope you enjoy the game!\n </Typography>\n ),\n canNext: true,\n },\n [iTutorialSteps.End as number]: {\n content: <Typography></Typography>,\n canNext: true,\n },\n };\n\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n return ITutorialEvents.subscribe(rerender);\n }, []);\n const step = ITutorial.currStep;\n const content = contents[step];\n if (content === undefined) throw new Error(\"error in the tutorial\");\n return (\n <Paper square sx={{ maxWidth: \"70vw\", p: 2 }}>\n {content.content}\n {step !== iTutorialSteps.TutorialPageInfo && (\n <>\n <IconButton onClick={iTutorialPrevStep} aria-label=\"previous\">\n <ArrowBackIos />\n </IconButton>\n {content.canNext && (\n <IconButton onClick={iTutorialNextStep} aria-label=\"next\">\n <ArrowForwardIos />\n </IconButton>\n )}\n </>\n )}\n <br />\n <br />\n <Button onClick={iTutorialEnd}>\n {step !== iTutorialSteps.TutorialPageInfo ? \"SKIP TUTORIAL\" : \"FINISH TUTORIAL\"}\n </Button>\n </Paper>\n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Draggable, { DraggableEventHandler } from \"react-draggable\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport Collapse from \"@mui/material/Collapse\";\nimport Paper from \"@mui/material/Paper\";\nimport KeyboardArrowDownIcon from \"@mui/icons-material/KeyboardArrowDown\";\nimport KeyboardArrowUpIcon from \"@mui/icons-material/KeyboardArrowUp\";\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\";\nimport SchoolIcon from \"@mui/icons-material/School\";\nimport { use } from \"../Context\";\nimport { Page } from \"../Router\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Box, Button, Typography } from \"@mui/material\";\nimport { debounce } from \"lodash\";\n\nconst useStyles = makeStyles({\n overviewContainer: {\n position: \"fixed\",\n top: 0,\n right: 0,\n zIndex: 1500,\n display: \"flex\",\n justifyContent: \"flex-end\",\n flexDirection: \"column\",\n },\n\n header: {\n cursor: \"grab\",\n textAlign: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n\n visibilityToggle: {\n padding: \"2px\",\n minWidth: \"inherit\",\n backgroundColor: \"transparent\",\n border: \"none\",\n \"&:hover\": {\n backgroundColor: \"rgba(255, 255, 255, 0.1)\",\n },\n },\n\n collapse: {\n borderTop: `1px solid ${Settings.theme.welllight}`,\n margin: \"0 auto\",\n },\n\n icon: {\n fontSize: \"24px\",\n },\n});\n\ninterface IProps {\n children: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n mode: \"tutorial\" | \"overview\";\n}\n\nexport interface OverviewSettings {\n opened: boolean;\n x: number;\n y: number;\n}\n\nexport function Overview({ children, mode }: IProps): React.ReactElement {\n const draggableRef = useRef<HTMLDivElement>(null);\n const [open, setOpen] = useState(Settings.overview.opened);\n const [x, setX] = useState(Settings.overview.x);\n const [y, setY] = useState(Settings.overview.y);\n const classes = useStyles();\n const router = use.Router();\n\n const CurrentIcon = open ? KeyboardArrowUpIcon : KeyboardArrowDownIcon;\n const LeftIcon = mode === \"tutorial\" ? SchoolIcon : EqualizerIcon;\n const header = mode === \"tutorial\" ? \"Tutorial\" : \"Overview\";\n const handleStop: DraggableEventHandler = (e, data) => {\n setX(data.x);\n setY(data.y);\n };\n\n useEffect(() => {\n Settings.overview = { x, y, opened: open };\n }, [open, x, y]);\n\n // Trigger fakeDrag once to make sure loaded data is not outside bounds\n useEffect(() => fakeDrag(), []);\n\n // And trigger fakeDrag when the window is resized\n useEffect(() => {\n window.addEventListener(\"resize\", fakeDrag);\n return () => {\n window.removeEventListener(\"resize\", fakeDrag);\n };\n }, []);\n\n const fakeDrag = debounce((): void => {\n const node = draggableRef?.current;\n if (!node) return;\n\n // No official way to trigger an onChange to recompute the bounds\n // See: https://github.com/react-grid-layout/react-draggable/issues/363#issuecomment-947751127\n triggerMouseEvent(node, \"mouseover\");\n triggerMouseEvent(node, \"mousedown\");\n triggerMouseEvent(document, \"mousemove\");\n triggerMouseEvent(node, \"mouseup\");\n triggerMouseEvent(node, \"click\");\n }, 100);\n\n const triggerMouseEvent = (node: HTMLDivElement | Document, eventType: string): void => {\n const clickEvent = document.createEvent(\"MouseEvents\");\n clickEvent.initEvent(eventType, true, true);\n node.dispatchEvent(clickEvent);\n };\n\n if (router.page() === Page.BitVerse || router.page() === Page.Loading || router.page() === Page.Recovery)\n return <></>;\n return (\n <Draggable handle=\".drag\" bounds=\"body\" onStop={handleStop} defaultPosition={{ x, y }}>\n <Paper className={classes.overviewContainer} square>\n <Box className=\"drag\" onDoubleClick={() => setOpen((old) => !old)} ref={draggableRef}>\n <Box className={classes.header}>\n <LeftIcon color=\"secondary\" className={classes.icon} sx={{ padding: \"2px\" }} />\n <Typography flexGrow={1} color=\"secondary\">\n {header}\n </Typography>\n <Button\n aria-label=\"expand or collapse character overview\"\n variant=\"text\"\n size=\"small\"\n className={classes.visibilityToggle}\n >\n {<CurrentIcon className={classes.icon} color=\"secondary\" onClick={() => setOpen((old) => !old)} />}\n </Button>\n </Box>\n </Box>\n <Collapse in={open} className={classes.collapse}>\n {children}\n </Collapse>\n </Paper>\n </Draggable>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport clsx from \"clsx\";\nimport { styled, Theme, CSSObject } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport MuiDrawer from \"@mui/material/Drawer\";\nimport List from \"@mui/material/List\";\nimport Divider from \"@mui/material/Divider\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\nimport ChevronRightIcon from \"@mui/icons-material/ChevronRight\";\nimport ListItem from \"@mui/material/ListItem\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Typography from \"@mui/material/Typography\";\nimport Collapse from \"@mui/material/Collapse\";\nimport Badge from \"@mui/material/Badge\";\n\nimport ComputerIcon from \"@mui/icons-material/Computer\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\"; // Terminal\nimport CreateIcon from \"@mui/icons-material/Create\"; // Create Script\nimport StorageIcon from \"@mui/icons-material/Storage\"; // Active Scripts\nimport BugReportIcon from \"@mui/icons-material/BugReport\"; // Create Program\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\"; // Stats\nimport ContactsIcon from \"@mui/icons-material/Contacts\"; // Factions\nimport DoubleArrowIcon from \"@mui/icons-material/DoubleArrow\"; // Augmentations\nimport AccountTreeIcon from \"@mui/icons-material/AccountTree\"; // Hacknet\nimport PeopleAltIcon from \"@mui/icons-material/PeopleAlt\"; // Sleeves\nimport LocationCityIcon from \"@mui/icons-material/LocationCity\"; // City\nimport AirplanemodeActiveIcon from \"@mui/icons-material/AirplanemodeActive\"; // Travel\nimport WorkIcon from \"@mui/icons-material/Work\"; // Job\nimport TrendingUpIcon from \"@mui/icons-material/TrendingUp\"; // Stock Market\nimport FormatBoldIcon from \"@mui/icons-material/FormatBold\"; // Bladeburner\nimport BusinessIcon from \"@mui/icons-material/Business\"; // Corp\nimport SportsMmaIcon from \"@mui/icons-material/SportsMma\"; // Gang\nimport CheckIcon from \"@mui/icons-material/Check\"; // Milestones\nimport HelpIcon from \"@mui/icons-material/Help\"; // Tutorial\nimport SettingsIcon from \"@mui/icons-material/Settings\"; // options\nimport DeveloperBoardIcon from \"@mui/icons-material/DeveloperBoard\"; // Dev\nimport EmojiEventsIcon from \"@mui/icons-material/EmojiEvents\"; // Achievements\nimport AccountBoxIcon from \"@mui/icons-material/AccountBox\";\nimport PublicIcon from \"@mui/icons-material/Public\";\nimport LiveHelpIcon from \"@mui/icons-material/LiveHelp\";\nimport ExpandLessIcon from \"@mui/icons-material/ExpandLess\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { IRouter, Page } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { iTutorialSteps, iTutorialNextStep, ITutorial } from \"../../InteractiveTutorial\";\nimport { getAvailableCreatePrograms } from \"../../Programs/ProgramHelpers\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { redPillFlag } from \"../../RedPill\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { ProgramsSeen } from \"../../Programs/ui/ProgramsRoot\";\nimport { InvitationsSeen } from \"../../Faction/ui/FactionsRoot\";\nimport { hash } from \"../../hash/hash\";\n\nconst openedMixin = (theme: Theme): CSSObject => ({\n width: theme.spacing(31),\n transition: theme.transitions.create(\"width\", {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.enteringScreen,\n }),\n overflowX: \"hidden\",\n});\n\nconst closedMixin = (theme: Theme): CSSObject => ({\n transition: theme.transitions.create(\"width\", {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n overflowX: \"hidden\",\n width: `calc(${theme.spacing(2)} + 1px)`,\n [theme.breakpoints.up(\"sm\")]: {\n width: `calc(${theme.spacing(7)} + 1px)`,\n },\n});\n\nconst Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== \"open\" })(({ theme, open }) => ({\n width: theme.spacing(31),\n whiteSpace: \"nowrap\",\n boxSizing: \"border-box\",\n ...(open && {\n ...openedMixin(theme),\n \"& .MuiDrawer-paper\": openedMixin(theme),\n }),\n ...(!open && {\n ...closedMixin(theme),\n \"& .MuiDrawer-paper\": closedMixin(theme),\n }),\n}));\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n active: {\n borderLeft: \"3px solid \" + theme.palette.primary.main,\n },\n listitem: {},\n }),\n);\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n page: Page;\n opened: boolean;\n onToggled: (newValue: boolean) => void;\n}\n\nexport function SidebarRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const [hackingOpen, setHackingOpen] = useState(true);\n const [characterOpen, setCharacterOpen] = useState(true);\n const [worldOpen, setWorldOpen] = useState(true);\n const [helpOpen, setHelpOpen] = useState(true);\n\n const flashTerminal =\n ITutorial.currStep === iTutorialSteps.CharacterGoToTerminalPage ||\n ITutorial.currStep === iTutorialSteps.ActiveScriptsPage;\n\n const flashStats = ITutorial.currStep === iTutorialSteps.GoToCharacterPage;\n\n const flashActiveScripts = ITutorial.currStep === iTutorialSteps.TerminalGoToActiveScriptsPage;\n\n const flashHacknet = ITutorial.currStep === iTutorialSteps.GoToHacknetNodesPage;\n\n const flashCity = ITutorial.currStep === iTutorialSteps.HacknetNodesGoToWorldPage;\n\n const flashTutorial = ITutorial.currStep === iTutorialSteps.WorldDescription;\n\n const augmentationCount = props.player.queuedAugmentations.length;\n const invitationsCount = props.player.factionInvitations.filter((f) => !InvitationsSeen.includes(f)).length;\n const programCount = getAvailableCreatePrograms(props.player).length - ProgramsSeen.length;\n const canCreateProgram =\n getAvailableCreatePrograms(props.player).length > 0 ||\n props.player.augmentations.length > 0 ||\n props.player.queuedAugmentations.length > 0 ||\n props.player.sourceFiles.length > 0;\n\n const canOpenFactions =\n props.player.factionInvitations.length > 0 ||\n props.player.factions.length > 0 ||\n props.player.augmentations.length > 0 ||\n props.player.queuedAugmentations.length > 0 ||\n props.player.sourceFiles.length > 0;\n\n const canOpenAugmentations =\n props.player.augmentations.length > 0 ||\n props.player.queuedAugmentations.length > 0 ||\n props.player.sourceFiles.length > 0;\n\n const canOpenSleeves = props.player.sleeves.length > 0;\n\n const canCorporation = !!(props.player.corporation as any);\n const canGang = !!(props.player.gang as any);\n const canJob = props.player.companyName !== \"\";\n const canStockMarket = props.player.hasWseAccount;\n const canBladeburner = !!(props.player.bladeburner as any);\n const canStaneksGift = props.player.augmentations.some((aug) => aug.name === AugmentationNames.StaneksGift1);\n\n function clickTerminal(): void {\n props.router.toTerminal();\n if (flashTerminal) iTutorialNextStep();\n }\n\n function clickScriptEditor(): void {\n props.router.toScriptEditor();\n }\n\n function clickStats(): void {\n props.router.toStats();\n if (flashStats) iTutorialNextStep();\n }\n\n function clickActiveScripts(): void {\n props.router.toActiveScripts();\n if (flashActiveScripts) iTutorialNextStep();\n }\n\n function clickCreateProgram(): void {\n props.router.toCreateProgram();\n }\n\n function clickStaneksGift(): void {\n props.router.toStaneksGift();\n }\n\n function clickFactions(): void {\n props.router.toFactions();\n }\n\n function clickAugmentations(): void {\n props.router.toAugmentations();\n }\n\n function clickSleeves(): void {\n props.router.toSleeves();\n }\n\n function clickHacknet(): void {\n props.router.toHacknetNodes();\n if (flashHacknet) iTutorialNextStep();\n }\n\n function clickCity(): void {\n props.router.toCity();\n if (flashCity) iTutorialNextStep();\n }\n\n function clickTravel(): void {\n props.router.toTravel();\n }\n\n function clickJob(): void {\n props.router.toJob();\n }\n\n function clickStockMarket(): void {\n props.router.toStockMarket();\n }\n\n function clickBladeburner(): void {\n props.router.toBladeburner();\n }\n\n function clickCorp(): void {\n props.router.toCorporation();\n }\n\n function clickGang(): void {\n props.router.toGang();\n }\n\n function clickTutorial(): void {\n props.router.toTutorial();\n if (flashTutorial) iTutorialNextStep();\n }\n\n function clickMilestones(): void {\n props.router.toMilestones();\n }\n function clickOptions(): void {\n props.router.toGameOptions();\n }\n\n function clickDev(): void {\n props.router.toDevMenu();\n }\n\n function clickAchievements(): void {\n props.router.toAchievements();\n }\n\n useEffect(() => {\n // Shortcuts to navigate through the game\n // Alt-t - Terminal\n // Alt-c - Character\n // Alt-e - Script editor\n // Alt-s - Active scripts\n // Alt-h - Hacknet Nodes\n // Alt-w - City\n // Alt-j - Job\n // Alt-r - Travel Agency of current city\n // Alt-p - Create program\n // Alt-f - Factions\n // Alt-a - Augmentations\n // Alt-u - Tutorial\n // Alt-o - Options\n function handleShortcuts(this: Document, event: KeyboardEvent): any {\n if (Settings.DisableHotkeys) return;\n if ((props.player.isWorking && props.player.focus) || redPillFlag) return;\n if (event.keyCode == KEY.T && event.altKey) {\n event.preventDefault();\n clickTerminal();\n } else if (event.keyCode === KEY.C && event.altKey) {\n event.preventDefault();\n clickStats();\n } else if (event.keyCode === KEY.E && event.altKey) {\n event.preventDefault();\n clickScriptEditor();\n } else if (event.keyCode === KEY.S && event.altKey) {\n event.preventDefault();\n clickActiveScripts();\n } else if (event.keyCode === KEY.H && event.altKey) {\n event.preventDefault();\n clickHacknet();\n } else if (event.keyCode === KEY.W && event.altKey) {\n event.preventDefault();\n clickCity();\n } else if (event.keyCode === KEY.J && event.altKey && !event.ctrlKey && !event.metaKey && canJob) {\n // ctrl/cmd + alt + j is shortcut to open Chrome dev tools\n event.preventDefault();\n clickJob();\n } else if (event.keyCode === KEY.R && event.altKey) {\n event.preventDefault();\n clickTravel();\n } else if (event.keyCode === KEY.P && event.altKey) {\n event.preventDefault();\n clickCreateProgram();\n } else if (event.keyCode === KEY.F && event.altKey) {\n if (props.page == Page.Terminal && Settings.EnableBashHotkeys) {\n return;\n }\n event.preventDefault();\n clickFactions();\n } else if (event.keyCode === KEY.A && event.altKey) {\n event.preventDefault();\n clickAugmentations();\n } else if (event.keyCode === KEY.U && event.altKey) {\n event.preventDefault();\n clickTutorial();\n } else if (event.keyCode === KEY.B && event.altKey && props.player.bladeburner) {\n event.preventDefault();\n clickBladeburner();\n } else if (event.keyCode === KEY.G && event.altKey && props.player.gang) {\n event.preventDefault();\n clickGang();\n }\n // if (event.keyCode === KEY.O && event.altKey) {\n // event.preventDefault();\n // gameOptionsBoxOpen();\n // }\n }\n\n document.addEventListener(\"keydown\", handleShortcuts);\n return () => document.removeEventListener(\"keydown\", handleShortcuts);\n }, []);\n\n const classes = useStyles();\n const [open, setOpen] = useState(props.opened);\n const toggleDrawer = (): void => setOpen((old) => !old);\n\n useEffect(() => {\n props.onToggled(open);\n }, [open]);\n\n return (\n <Drawer open={open} anchor=\"left\" variant=\"permanent\">\n <ListItem classes={{ root: classes.listitem }} button onClick={toggleDrawer}>\n <ListItemIcon>\n {!open ? <ChevronRightIcon color=\"primary\" /> : <ChevronLeftIcon color=\"primary\" />}\n </ListItemIcon>\n <ListItemText\n primary={\n <Tooltip title={hash()}>\n <Typography>Bitburner v{CONSTANTS.VersionString}</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n <Divider />\n <List>\n <ListItem classes={{ root: classes.listitem }} button onClick={() => setHackingOpen((old) => !old)}>\n <ListItemIcon>\n <Tooltip title={!open ? \"Hacking\" : \"\"}>\n <ComputerIcon color=\"primary\" />\n </Tooltip>\n </ListItemIcon>\n <ListItemText primary={<Typography>Hacking</Typography>} />\n {hackingOpen ? <ExpandLessIcon color=\"primary\" /> : <ExpandMoreIcon color=\"primary\" />}\n </ListItem>\n <Collapse in={hackingOpen} timeout=\"auto\" unmountOnExit>\n <List>\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Terminal\"}\n className={clsx({\n [classes.active]: props.page === Page.Terminal,\n })}\n onClick={clickTerminal}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Terminal\" : \"\"}>\n <LastPageIcon\n color={flashTerminal ? \"error\" : props.page !== Page.Terminal ? \"secondary\" : \"primary\"}\n />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={flashTerminal ? \"error\" : props.page !== Page.Terminal ? \"secondary\" : \"primary\"}>\n Terminal\n </Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Script Editor\"}\n className={clsx({\n [classes.active]: props.page === Page.ScriptEditor,\n })}\n onClick={clickScriptEditor}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Script Editor\" : \"\"}>\n <CreateIcon color={props.page !== Page.ScriptEditor ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.ScriptEditor ? \"secondary\" : \"primary\"}>\n Script Editor\n </Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Active Scripts\"}\n className={clsx({\n [classes.active]: props.page === Page.ActiveScripts,\n })}\n onClick={clickActiveScripts}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Active Scripts\" : \"\"}>\n <StorageIcon\n color={flashActiveScripts ? \"error\" : props.page !== Page.ActiveScripts ? \"secondary\" : \"primary\"}\n />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography\n color={flashActiveScripts ? \"error\" : props.page !== Page.ActiveScripts ? \"secondary\" : \"primary\"}\n >\n Active Scripts\n </Typography>\n </ListItemText>\n </ListItem>\n {canCreateProgram && (\n <ListItem\n button\n key={\"Create Program\"}\n className={clsx({\n [classes.active]: props.page === Page.CreateProgram,\n })}\n onClick={clickCreateProgram}\n >\n <ListItemIcon>\n <Badge badgeContent={programCount > 0 ? programCount : undefined} color=\"error\">\n <Tooltip title={!open ? \"Create Program\" : \"\"}>\n <BugReportIcon color={props.page !== Page.CreateProgram ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </Badge>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.CreateProgram ? \"secondary\" : \"primary\"}>\n Create Program\n </Typography>\n </ListItemText>\n </ListItem>\n )}\n {canStaneksGift && (\n <ListItem\n button\n key={\"Staneks Gift\"}\n className={clsx({\n [classes.active]: props.page === Page.StaneksGift,\n })}\n onClick={clickStaneksGift}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Stanek's Gift\" : \"\"}>\n <DeveloperBoardIcon color={props.page !== Page.StaneksGift ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.StaneksGift ? \"secondary\" : \"primary\"}>\n Stanek's Gift\n </Typography>\n </ListItemText>\n </ListItem>\n )}\n </List>\n </Collapse>\n\n <Divider />\n <ListItem classes={{ root: classes.listitem }} button onClick={() => setCharacterOpen((old) => !old)}>\n <ListItemIcon>\n <Tooltip title={!open ? \"Character\" : \"\"}>\n <AccountBoxIcon color=\"primary\" />\n </Tooltip>\n </ListItemIcon>\n <ListItemText primary={<Typography>Character</Typography>} />\n {characterOpen ? <ExpandLessIcon color=\"primary\" /> : <ExpandMoreIcon color=\"primary\" />}\n </ListItem>\n <Collapse in={characterOpen} timeout=\"auto\" unmountOnExit>\n <ListItem\n button\n key={\"Stats\"}\n className={clsx({\n [classes.active]: props.page === Page.Stats,\n })}\n onClick={clickStats}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Stats\" : \"\"}>\n <EqualizerIcon color={flashStats ? \"error\" : props.page !== Page.Stats ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={flashStats ? \"error\" : props.page !== Page.Stats ? \"secondary\" : \"primary\"}>\n Stats\n </Typography>\n </ListItemText>\n </ListItem>\n {canOpenFactions && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Factions\"}\n className={clsx({\n [classes.active]: [Page.Factions, Page.Faction].includes(props.page),\n })}\n onClick={clickFactions}\n >\n <ListItemIcon>\n <Badge badgeContent={invitationsCount !== 0 ? invitationsCount : undefined} color=\"error\">\n <Tooltip title={!open ? \"Factions\" : \"\"}>\n <ContactsIcon color={![Page.Factions, Page.Faction].includes(props.page) ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </Badge>\n </ListItemIcon>\n <ListItemText>\n <Typography color={![Page.Factions, Page.Faction].includes(props.page) ? \"secondary\" : \"primary\"}>\n Factions\n </Typography>\n </ListItemText>\n </ListItem>\n )}\n {canOpenAugmentations && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Augmentations\"}\n className={clsx({\n [classes.active]: props.page === Page.Augmentations,\n })}\n onClick={clickAugmentations}\n >\n <ListItemIcon>\n <Badge badgeContent={augmentationCount !== 0 ? augmentationCount : undefined} color=\"error\">\n <Tooltip title={!open ? \"Augmentations\" : \"\"}>\n <DoubleArrowIcon\n style={{ transform: \"rotate(-90deg)\" }}\n color={props.page !== Page.Augmentations ? \"secondary\" : \"primary\"}\n />\n </Tooltip>\n </Badge>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Augmentations ? \"secondary\" : \"primary\"}>\n Augmentations\n </Typography>\n </ListItemText>\n </ListItem>\n )}\n <ListItem\n button\n key={\"Hacknet\"}\n className={clsx({\n [classes.active]: props.page === Page.Hacknet,\n })}\n onClick={clickHacknet}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Hacknet\" : \"\"}>\n <AccountTreeIcon color={flashHacknet ? \"error\" : props.page !== Page.Hacknet ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={flashHacknet ? \"error\" : props.page !== Page.Hacknet ? \"secondary\" : \"primary\"}>\n Hacknet\n </Typography>\n </ListItemText>\n </ListItem>\n {canOpenSleeves && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Sleeves\"}\n className={clsx({\n [classes.active]: props.page === Page.Sleeves,\n })}\n onClick={clickSleeves}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Sleeves\" : \"\"}>\n <PeopleAltIcon color={props.page !== Page.Sleeves ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Sleeves ? \"secondary\" : \"primary\"}>Sleeves</Typography>\n </ListItemText>\n </ListItem>\n )}\n </Collapse>\n\n <Divider />\n <ListItem classes={{ root: classes.listitem }} button onClick={() => setWorldOpen((old) => !old)}>\n <ListItemIcon>\n <Tooltip title={!open ? \"World\" : \"\"}>\n <PublicIcon color=\"primary\" />\n </Tooltip>\n </ListItemIcon>\n <ListItemText primary={<Typography>World</Typography>} />\n {worldOpen ? <ExpandLessIcon color=\"primary\" /> : <ExpandMoreIcon color=\"primary\" />}\n </ListItem>\n <Collapse in={worldOpen} timeout=\"auto\" unmountOnExit>\n <ListItem\n button\n key={\"City\"}\n className={clsx({\n [classes.active]:\n props.page === Page.City || props.page === Page.Resleeves || props.page === Page.Location,\n })}\n onClick={clickCity}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"City\" : \"\"}>\n <LocationCityIcon color={flashCity ? \"error\" : props.page !== Page.City ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={flashCity ? \"error\" : props.page !== Page.City ? \"secondary\" : \"primary\"}>\n City\n </Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n button\n key={\"Travel\"}\n className={clsx({\n [classes.active]: props.page === Page.Travel,\n })}\n onClick={clickTravel}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Travel\" : \"\"}>\n <AirplanemodeActiveIcon color={props.page !== Page.Travel ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Travel ? \"secondary\" : \"primary\"}>Travel</Typography>\n </ListItemText>\n </ListItem>\n {canJob && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Job\"}\n className={clsx({\n [classes.active]: props.page === Page.Job,\n })}\n onClick={clickJob}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Job\" : \"\"}>\n <WorkIcon color={props.page !== Page.Job ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Job ? \"secondary\" : \"primary\"}>Job</Typography>\n </ListItemText>\n </ListItem>\n )}\n {canStockMarket && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Stock Market\"}\n className={clsx({\n [classes.active]: props.page === Page.StockMarket,\n })}\n onClick={clickStockMarket}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Stock Market\" : \"\"}>\n <TrendingUpIcon color={props.page !== Page.StockMarket ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.StockMarket ? \"secondary\" : \"primary\"}>Stock Market</Typography>\n </ListItemText>\n </ListItem>\n )}\n {canBladeburner && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Bladeburner\"}\n className={clsx({\n [classes.active]: props.page === Page.Bladeburner,\n })}\n onClick={clickBladeburner}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Bladeburner\" : \"\"}>\n <FormatBoldIcon color={props.page !== Page.Bladeburner ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Bladeburner ? \"secondary\" : \"primary\"}>Bladeburner</Typography>\n </ListItemText>\n </ListItem>\n )}\n {canCorporation && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Corp\"}\n className={clsx({\n [classes.active]: props.page === Page.Corporation,\n })}\n onClick={clickCorp}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Corp\" : \"\"}>\n <BusinessIcon color={props.page !== Page.Corporation ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Corporation ? \"secondary\" : \"primary\"}>Corp</Typography>\n </ListItemText>\n </ListItem>\n )}\n {canGang && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Gang\"}\n className={clsx({\n [classes.active]: props.page === Page.Gang,\n })}\n onClick={clickGang}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Gang\" : \"\"}>\n <SportsMmaIcon color={props.page !== Page.Gang ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Gang ? \"secondary\" : \"primary\"}>Gang</Typography>\n </ListItemText>\n </ListItem>\n )}\n </Collapse>\n\n <Divider />\n <ListItem classes={{ root: classes.listitem }} button onClick={() => setHelpOpen((old) => !old)}>\n <ListItemIcon>\n <Tooltip title={!open ? \"Help\" : \"\"}>\n <LiveHelpIcon color=\"primary\" />\n </Tooltip>\n </ListItemIcon>\n <ListItemText primary={<Typography>Help</Typography>} />\n {helpOpen ? <ExpandLessIcon color=\"primary\" /> : <ExpandMoreIcon color=\"primary\" />}\n </ListItem>\n <Collapse in={helpOpen} timeout=\"auto\" unmountOnExit>\n <ListItem\n button\n key={\"Milestones\"}\n className={clsx({\n [classes.active]: props.page === Page.Milestones,\n })}\n onClick={clickMilestones}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Milestones\" : \"\"}>\n <CheckIcon color={props.page !== Page.Milestones ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Milestones ? \"secondary\" : \"primary\"}>Milestones</Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n button\n key={\"Tutorial\"}\n className={clsx({\n [classes.active]: props.page === Page.Tutorial,\n })}\n onClick={clickTutorial}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Tutorial\" : \"\"}>\n <HelpIcon color={flashTutorial ? \"error\" : props.page !== Page.Tutorial ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={flashTutorial ? \"error\" : props.page !== Page.Tutorial ? \"secondary\" : \"primary\"}>\n Tutorial\n </Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n button\n key={\"Achievements\"}\n className={clsx({\n [classes.active]: props.page === Page.Achievements,\n })}\n onClick={clickAchievements}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Achievements\" : \"\"}>\n <EmojiEventsIcon color={props.page !== Page.Achievements ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Achievements ? \"secondary\" : \"primary\"}>Achievements</Typography>\n </ListItemText>\n </ListItem>\n <ListItem\n button\n key={\"Options\"}\n className={clsx({\n [classes.active]: props.page === Page.Options,\n })}\n onClick={clickOptions}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Options\" : \"\"}>\n <SettingsIcon color={props.page !== Page.Options ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.Options ? \"secondary\" : \"primary\"}>Options</Typography>\n </ListItemText>\n </ListItem>\n {process.env.NODE_ENV === \"development\" && (\n <ListItem\n classes={{ root: classes.listitem }}\n button\n key={\"Dev\"}\n className={clsx({\n [classes.active]: props.page === Page.DevMenu,\n })}\n onClick={clickDev}\n >\n <ListItemIcon>\n <Tooltip title={!open ? \"Dev\" : \"\"}>\n <DeveloperBoardIcon color={props.page !== Page.DevMenu ? \"secondary\" : \"primary\"} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.DevMenu ? \"secondary\" : \"primary\"}>Dev</Typography>\n </ListItemText>\n </ListItem>\n )}\n </Collapse>\n </List>\n </Drawer>\n );\n}\n","/**\n * Root React component for the Augmentations UI page that display all of your\n * owned and purchased Augmentations and Source-Files.\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { InstalledAugmentations } from \"./InstalledAugmentations\";\nimport { PlayerMultipliers } from \"./PlayerMultipliers\";\nimport { PurchasedAugmentations } from \"./PurchasedAugmentations\";\nimport { SourceFiles } from \"./SourceFiles\";\n\nimport { canGetBonus } from \"../../ExportBonus\";\nimport { use } from \"../../ui/Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\n\ninterface IProps {\n exportGameFn: () => void;\n installAugmentationsFn: () => void;\n}\n\nexport function AugmentationsRoot(props: IProps): React.ReactElement {\n const [installOpen, setInstallOpen] = useState(false);\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n function doExport(): void {\n props.exportGameFn();\n rerender();\n }\n\n function exportBonusStr(): string {\n if (canGetBonus()) return \"(+1 favor to all factions)\";\n return \"\";\n }\n\n function doInstall(): void {\n if (!Settings.SuppressBuyAugmentationConfirmation) {\n setInstallOpen(true);\n } else {\n props.installAugmentationsFn();\n }\n }\n\n return (\n <>\n <Typography variant=\"h4\">Augmentations</Typography>\n <Box mx={2}>\n <Typography>\n Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to\n install them.\n </Typography>\n <Typography>WARNING: Installing your Augmentations resets most of your progress, including:</Typography>\n <br />\n <Typography>- Stats/Skill levels and Experience</Typography>\n <Typography>- Money</Typography>\n <Typography>- Scripts on every computer but your home computer</Typography>\n <Typography>- Purchased servers</Typography>\n <Typography>- Hacknet Nodes</Typography>\n <Typography>- Faction/Company reputation</Typography>\n <Typography>- Stocks</Typography>\n <br />\n <Typography>\n Installing Augmentations lets you start over with the perks and benefits granted by all of the Augmentations\n you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your home computer (but you\n will lose all programs besides NUKE.exe)\n </Typography>\n </Box>\n <Typography variant=\"h4\" color=\"primary\">\n Purchased Augmentations\n </Typography>\n <Box mx={2}>\n <Tooltip title={<Typography>'I never asked for this'</Typography>}>\n <span>\n <Button disabled={player.queuedAugmentations.length === 0} onClick={doInstall}>\n Install Augmentations\n </Button>\n </span>\n </Tooltip>\n <ConfirmationModal\n open={installOpen}\n onClose={() => setInstallOpen(false)}\n onConfirm={props.installAugmentationsFn}\n confirmationText={\n <>\n Installing will reset\n <br />\n <br />- money\n <br />- skill / experience\n <br />- every server except home\n <br />- factions and reputation\n <br />\n <br />\n You will keep:\n <br />\n <br />- All scripts on home\n <br />- home ram and cores\n <br />\n <br />\n It is recommended to install several Augmentations at once. Preferably everything from any faction of your\n chosing.\n </>\n }\n />\n <Tooltip title={<Typography>It's always a good idea to backup/export your save!</Typography>}>\n <Button sx={{ mx: 2 }} onClick={doExport} color=\"error\">\n Backup Save {exportBonusStr()}\n </Button>\n </Tooltip>\n <PurchasedAugmentations />\n </Box>\n <Typography variant=\"h4\">Installed Augmentations</Typography>\n <Box mx={2}>\n <Typography>\n List of all Augmentations that have been installed. You have gained the effects of these.\n </Typography>\n <InstalledAugmentations />\n </Box>\n <PlayerMultipliers />\n <SourceFiles />\n </>\n );\n}\n","/**\n * React Component for displaying all of the player's installed Augmentations and\n * Source-Files.\n *\n * It also contains 'configuration' buttons that allow you to change how the\n * Augs/SF's are displayed\n */\nimport React, { useState } from \"react\";\n\nimport { AugmentationAccordion } from \"../../ui/React/AugmentationAccordion\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../../ui/Context\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport List from \"@mui/material/List\";\n\nexport function InstalledAugmentations(): React.ReactElement {\n const setRerender = useState(true)[1];\n const player = use.Player();\n\n const sourceAugs = player.augmentations.slice();\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceAugs.sort((aug1, aug2) => {\n return aug1.name.localeCompare(aug2.name);\n });\n }\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function sortByAcquirementTime(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.AcquirementTime;\n rerender();\n }\n\n function sortInOrder(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.Alphabetically;\n rerender();\n }\n\n return (\n <>\n <Tooltip title={\"Sorts the Augmentations alphabetically in numeral order\"}>\n <Button onClick={sortInOrder}>Sort in Order</Button>\n </Tooltip>\n <Tooltip title={\"Sorts the Augmentations based on when you acquired them (same as default)\"}>\n <Button sx={{ mx: 2 }} onClick={sortByAcquirementTime}>\n Sort by Acquirement Time\n </Button>\n </Tooltip>\n <List dense>\n {sourceAugs.map((e) => {\n const aug = Augmentations[e.name];\n\n let level = null;\n if (e.name === AugmentationNames.NeuroFluxGovernor) {\n level = e.level;\n }\n\n return <AugmentationAccordion key={aug.name} aug={aug} level={level} />;\n })}\n </List>\n </>\n );\n}\n","/**\n * React component for displaying the player's multipliers on the Augmentation UI page\n */\nimport * as React from \"react\";\n\nimport { Player } from \"../../Player\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Augmentations } from \"../Augmentations\";\nimport { Table, TableCell } from \"../../ui/React/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nfunction calculateAugmentedStats(): any {\n const augP: any = {};\n for (const aug of Player.queuedAugmentations) {\n const augObj = Augmentations[aug.name];\n for (const mult of Object.keys(augObj.mults)) {\n const v = augP[mult] ? augP[mult] : 1;\n augP[mult] = v * augObj.mults[mult];\n }\n }\n return augP;\n}\n\nfunction Improvements({ r, m }: { r: number; m: number }): React.ReactElement {\n if (r) {\n return (\n <>\n <TableCell key=\"2\">\n <Typography> {\"=>\"} </Typography>\n </TableCell>\n <TableCell key=\"3\">\n <Typography>\n {numeralWrapper.formatPercentage(r)} <BN5Stat base={r} mult={m} />\n </Typography>\n </TableCell>\n </>\n );\n }\n return <></>;\n}\n\ninterface IBN5StatsProps {\n base: number;\n mult: number;\n}\n\nfunction BN5Stat(props: IBN5StatsProps): React.ReactElement {\n if (props.mult === 1) return <></>;\n return <>({numeralWrapper.formatPercentage(props.base * props.mult)})</>;\n}\n\nfunction MultiplierTable({ rows }: { rows: [string, number, number, number][] }): React.ReactElement {\n return (\n <Table size=\"small\" padding=\"none\">\n <TableBody>\n {rows.map((r: any) => (\n <TableRow key={r[0]}>\n <TableCell key=\"0\">\n <Typography noWrap>{r[0]} multiplier: </Typography>\n </TableCell>\n <TableCell key=\"1\" style={{ textAlign: \"right\" }}>\n <Typography noWrap>\n {numeralWrapper.formatPercentage(r[1])} <BN5Stat base={r[1]} mult={r[3]} />\n </Typography>\n </TableCell>\n <Improvements r={r[2]} m={r[3]} />\n </TableRow>\n ))}\n </TableBody>\n </Table>\n );\n}\n\nexport function PlayerMultipliers(): React.ReactElement {\n const mults = calculateAugmentedStats();\n\n function BladeburnerMults(): React.ReactElement {\n if (!Player.canAccessBladeburner()) return <></>;\n return (\n <>\n <MultiplierTable\n rows={[\n [\n \"Bladeburner Success Chance\",\n Player.bladeburner_success_chance_mult,\n Player.bladeburner_success_chance_mult * mults.bladeburner_success_chance_mult,\n 1,\n ],\n [\n \"Bladeburner Max Stamina\",\n Player.bladeburner_max_stamina_mult,\n Player.bladeburner_max_stamina_mult * mults.bladeburner_max_stamina_mult,\n 1,\n ],\n [\n \"Bladeburner Stamina Gain\",\n Player.bladeburner_stamina_gain_mult,\n Player.bladeburner_stamina_gain_mult * mults.bladeburner_stamina_gain_mult,\n 1,\n ],\n [\n \"Bladeburner Field Analysis\",\n Player.bladeburner_analysis_mult,\n Player.bladeburner_analysis_mult * mults.bladeburner_analysis_mult,\n 1,\n ],\n ]}\n />\n <br />\n </>\n );\n }\n\n return (\n <>\n <Typography variant=\"h4\">Multipliers</Typography>\n <Box mx={2}>\n <MultiplierTable\n rows={[\n [\"Hacking Chance \", Player.hacking_chance_mult, Player.hacking_chance_mult * mults.hacking_chance_mult, 1],\n [\"Hacking Speed \", Player.hacking_speed_mult, Player.hacking_speed_mult * mults.hacking_speed_mult, 1],\n [\"Hacking Money \", Player.hacking_money_mult, Player.hacking_money_mult * mults.hacking_money_mult, 1],\n [\"Hacking Growth \", Player.hacking_grow_mult, Player.hacking_grow_mult * mults.hacking_grow_mult, 1],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Hacking Level \",\n Player.hacking_mult,\n Player.hacking_mult * mults.hacking_mult,\n BitNodeMultipliers.HackingLevelMultiplier,\n ],\n [\n \"Hacking Experience \",\n Player.hacking_exp_mult,\n Player.hacking_exp_mult * mults.hacking_exp_mult,\n BitNodeMultipliers.HackExpGain,\n ],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Strength Level \",\n Player.strength_mult,\n Player.strength_mult * mults.strength_mult,\n BitNodeMultipliers.StrengthLevelMultiplier,\n ],\n [\"Strength Experience \", Player.strength_exp_mult, Player.strength_exp_mult * mults.strength_exp_mult, 1],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Defense Level \",\n Player.defense_mult,\n Player.defense_mult * mults.defense_mult,\n BitNodeMultipliers.DefenseLevelMultiplier,\n ],\n [\"Defense Experience \", Player.defense_exp_mult, Player.defense_exp_mult * mults.defense_exp_mult, 1],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Dexterity Level \",\n Player.dexterity_mult,\n Player.dexterity_mult * mults.dexterity_mult,\n BitNodeMultipliers.DexterityLevelMultiplier,\n ],\n [\n \"Dexterity Experience \",\n Player.dexterity_exp_mult,\n Player.dexterity_exp_mult * mults.dexterity_exp_mult,\n 1,\n ],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Agility Level \",\n Player.agility_mult,\n Player.agility_mult * mults.agility_mult,\n BitNodeMultipliers.AgilityLevelMultiplier,\n ],\n [\"Agility Experience \", Player.agility_exp_mult, Player.agility_exp_mult * mults.agility_exp_mult, 1],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Charisma Level \",\n Player.charisma_mult,\n Player.charisma_mult * mults.charisma_mult,\n BitNodeMultipliers.CharismaLevelMultiplier,\n ],\n [\"Charisma Experience \", Player.charisma_exp_mult, Player.charisma_exp_mult * mults.charisma_exp_mult, 1],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Hacknet Node production \",\n Player.hacknet_node_money_mult,\n Player.hacknet_node_money_mult * mults.hacknet_node_money_mult,\n BitNodeMultipliers.HacknetNodeMoney,\n ],\n [\n \"Hacknet Node purchase cost \",\n Player.hacknet_node_purchase_cost_mult,\n Player.hacknet_node_purchase_cost_mult * mults.hacknet_node_purchase_cost_mult,\n 1,\n ],\n [\n \"Hacknet Node RAM upgrade cost \",\n Player.hacknet_node_ram_cost_mult,\n Player.hacknet_node_ram_cost_mult * mults.hacknet_node_ram_cost_mult,\n 1,\n ],\n [\n \"Hacknet Node Core purchase cost \",\n Player.hacknet_node_core_cost_mult,\n Player.hacknet_node_core_cost_mult * mults.hacknet_node_core_cost_mult,\n 1,\n ],\n [\n \"Hacknet Node level upgrade cost \",\n Player.hacknet_node_level_cost_mult,\n Player.hacknet_node_level_cost_mult * mults.hacknet_node_level_cost_mult,\n 1,\n ],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Company reputation gain \", Player.company_rep_mult, Player.company_rep_mult * mults.company_rep_mult, 1],\n [\n \"Faction reputation gain \",\n Player.faction_rep_mult,\n Player.faction_rep_mult * mults.faction_rep_mult,\n BitNodeMultipliers.FactionWorkRepGain,\n ],\n [\n \"Salary \",\n Player.work_money_mult,\n Player.work_money_mult * mults.work_money_mult,\n BitNodeMultipliers.CompanyWorkMoney,\n ],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Crime success \", Player.crime_success_mult, Player.crime_success_mult * mults.crime_success_mult, 1],\n [\n \"Crime money \",\n Player.crime_money_mult,\n Player.crime_money_mult * mults.crime_money_mult,\n BitNodeMultipliers.CrimeMoney,\n ],\n ]}\n />\n <br />\n\n <BladeburnerMults />\n </Box>\n </>\n );\n}\n","/**\n * React component for displaying all of the player's purchased (but not installed)\n * Augmentations on the Augmentations UI.\n */\nimport * as React from \"react\";\n\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\n\nimport { AugmentationAccordion } from \"../../ui/React/AugmentationAccordion\";\nimport List from \"@mui/material/List\";\n\nexport function PurchasedAugmentations(): React.ReactElement {\n const augs: React.ReactElement[] = [];\n // Only render the last NeuroFlux (there are no findLastIndex btw)\n let nfgIndex = -1;\n for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n nfgIndex = i;\n break;\n }\n }\n for (let i = 0; i < Player.queuedAugmentations.length; i++) {\n const ownedAug = Player.queuedAugmentations[i];\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;\n const aug = Augmentations[ownedAug.name];\n let level = null;\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {\n level = ownedAug.level;\n }\n augs.push(<AugmentationAccordion key={aug.name} aug={aug} level={level} />);\n }\n\n return <List dense>{augs}</List>;\n}\n","import React from \"react\";\nimport { SourceFileMinus1 } from \"./SourceFileMinus1\";\nimport { OwnedSourceFiles } from \"./OwnedSourceFiles\";\nimport List from \"@mui/material/List\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\n\nexport function SourceFiles(): React.ReactElement {\n return (\n <>\n <Typography variant=\"h4\">Source Files</Typography>\n <Box mx={2}>\n <List dense>\n <SourceFileMinus1 />\n <OwnedSourceFiles />\n </List>\n </Box>\n </>\n );\n}\n","/**\n * React Component for displaying a list of the player's Source-Files\n * on the Augmentations UI\n */\nimport React, { useState } from \"react\";\n\nimport { Player } from \"../../Player\";\nimport { Exploit, ExploitName } from \"../../Exploits/Exploit\";\n\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\n\nexport function SourceFileMinus1(): React.ReactElement {\n const [open, setOpen] = useState(false);\n const exploits = Player.exploits;\n\n if (exploits.length === 0) {\n return <></>;\n }\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText\n primary={\n <Typography style={{ whiteSpace: \"pre-wrap\" }}>\n Source-File -1: Exploits in the BitNodes\n <br />\n Level {exploits.length} / {Object.keys(Exploit).length}\n </Typography>\n }\n />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} unmountOnExit>\n <Box m={4}>\n <Typography>\n This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web ecosystem.\n </Typography>\n <Typography>It increases all of the player's multipliers by 0.1%</Typography>\n <br />\n\n <Typography>You have found the following exploits:</Typography>\n <Box mx={2}>\n {exploits.map((c: Exploit) => (\n <Typography key={c}>* {ExploitName(c)}</Typography>\n ))}\n </Box>\n </Box>\n </Collapse>\n </Box>\n );\n}\n","/**\n * React Component for displaying a list of the player's Source-Files\n * on the Augmentations UI\n */\nimport * as React from \"react\";\n\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { SourceFiles } from \"../../SourceFile/SourceFiles\";\n\nimport { SourceFileAccordion } from \"../../ui/React/SourceFileAccordion\";\n\nexport function OwnedSourceFiles(): React.ReactElement {\n const sourceSfs = Player.sourceFiles.slice();\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceSfs.sort((sf1, sf2) => {\n return sf1.n - sf2.n;\n });\n }\n\n return (\n <>\n {sourceSfs.map((e) => {\n const srcFileKey = \"SourceFile\" + e.n;\n const sfObj = SourceFiles[srcFileKey];\n if (sfObj == null) {\n console.error(`Invalid source file number: ${e.n}`);\n return null;\n }\n\n return <SourceFileAccordion key={e.n} level={e.lvl} sf={sfObj} />;\n })}\n </>\n );\n}\n","/**\n * React Component for displaying a single Source-File as an accordion.\n *\n * The header of the accordion contains the Source-Files's name and level,\n * and the accordion's panel contains the Source-File's description.\n */\nimport React, { useState } from \"react\";\n\nimport { SourceFile } from \"../../SourceFile/SourceFile\";\n\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\n\ntype IProps = {\n level: number;\n sf: SourceFile;\n};\n\nexport function SourceFileAccordion(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n const maxLevel = props.sf.n === 12 ? \"∞\" : \"3\";\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText\n primary={\n <Typography style={{ whiteSpace: \"pre-wrap\" }}>\n {props.sf.name}\n <br />\n {`Level ${props.level} / ${maxLevel}`}\n </Typography>\n }\n />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} unmountOnExit>\n <Box m={4}>\n <Typography>{props.sf.info}</Typography>\n </Box>\n </Collapse>\n </Box>\n );\n}\n","import { IPlayer } from \"./PersonObjects/IPlayer\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { IEngine } from \"./IEngine\";\nimport { IRouter } from \"./ui/Router\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\n\nimport React, { useEffect } from \"react\";\n\nimport { General } from \"./DevMenu/ui/General\";\nimport { Stats } from \"./DevMenu/ui/Stats\";\nimport { Factions } from \"./DevMenu/ui/Factions\";\nimport { Augmentations } from \"./DevMenu/ui/Augmentations\";\nimport { SourceFiles } from \"./DevMenu/ui/SourceFiles\";\nimport { Programs } from \"./DevMenu/ui/Programs\";\nimport { Servers } from \"./DevMenu/ui/Servers\";\nimport { Companies } from \"./DevMenu/ui/Companies\";\nimport { Bladeburner as BladeburnerElem } from \"./DevMenu/ui/Bladeburner\";\nimport { Gang } from \"./DevMenu/ui/Gang\";\nimport { Corporation } from \"./DevMenu/ui/Corporation\";\nimport { CodingContracts } from \"./DevMenu/ui/CodingContracts\";\nimport { StockMarket } from \"./DevMenu/ui/StockMarket\";\nimport { Sleeves } from \"./DevMenu/ui/Sleeves\";\nimport { Stanek } from \"./DevMenu/ui/Stanek\";\nimport { TimeSkip } from \"./DevMenu/ui/TimeSkip\";\nimport { Achievements } from \"./DevMenu/ui/Achievements\";\nimport Typography from \"@mui/material/Typography\";\nimport { Exploit } from \"./Exploits/Exploit\";\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n router: IRouter;\n}\n\nexport function DevMenuRoot(props: IProps): React.ReactElement {\n useEffect(() => {\n props.player.giveExploit(Exploit.YoureNotMeantToAccessThis);\n }, []);\n return (\n <>\n <Typography>Development Menu - Only meant to be used for testing/debugging</Typography>\n <General player={props.player} router={props.router} />\n <Stats player={props.player} />\n <Factions player={props.player} />\n <Augmentations player={props.player} />\n <SourceFiles player={props.player} />\n <Programs player={props.player} />\n <Servers />\n <Companies />\n\n {props.player.bladeburner instanceof Bladeburner && <BladeburnerElem player={props.player} />}\n\n {props.player.inGang() && <Gang player={props.player} />}\n\n {props.player.hasCorporation() && <Corporation player={props.player} />}\n\n <CodingContracts />\n\n {props.player.hasWseAccount && <StockMarket />}\n\n {props.player.sleeves.length > 0 && <Sleeves player={props.player} />}\n {props.player.augmentations.some((aug) => aug.name === AugmentationNames.StaneksGift1) && <Stanek />}\n\n <TimeSkip player={props.player} engine={props.engine} />\n <Achievements player={props.player} engine={props.engine} />\n </>\n );\n}\n","import React, { useEffect, useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../ui/React/Money\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n}\n\nexport function General(props: IProps): React.ReactElement {\n const [error, setError] = useState(false);\n\n function addMoney(n: number) {\n return function () {\n props.player.gainMoney(n, \"other\");\n };\n }\n\n function upgradeRam(): void {\n props.player.getHomeComputer().maxRam *= 2;\n }\n\n function quickB1tFlum3(): void {\n props.router.toBitVerse(true, true);\n }\n\n function b1tflum3(): void {\n props.router.toBitVerse(true, false);\n }\n\n function quickHackW0r1dD43m0n(): void {\n props.router.toBitVerse(false, true);\n }\n\n function hackW0r1dD43m0n(): void {\n props.router.toBitVerse(false, false);\n }\n\n useEffect(() => {\n if (error) throw new ReferenceError('Manually thrown error');\n }, [error]);\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>General</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Button onClick={addMoney(1e6)}>\n <pre>\n + <Money money={1e6} />\n </pre>\n </Button>\n <Button onClick={addMoney(1e9)}>\n <pre>\n + <Money money={1e9} />\n </pre>\n </Button>\n <Button onClick={addMoney(1e12)}>\n <pre>\n + <Money money={1e12} />\n </pre>\n </Button>\n <Button onClick={addMoney(1e15)}>\n <pre>\n + <Money money={1000e12} />\n </pre>\n </Button>\n <Button onClick={addMoney(Infinity)}>\n <pre>\n + <Money money={Infinity} />\n </pre>\n </Button>\n <Button onClick={upgradeRam}>+ RAM</Button>\n <br />\n\n <Button onClick={quickB1tFlum3}>Quick b1t_flum3.exe</Button>\n <Button onClick={b1tflum3}>Run b1t_flum3.exe</Button>\n <Button onClick={quickHackW0r1dD43m0n}>Quick w0rld_d34m0n</Button>\n <Button onClick={hackW0r1dD43m0n}>Hack w0rld_d34m0n</Button>\n <Button onClick={() => setError(true)}>Throw Error</Button>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Stats(props: IProps): React.ReactElement {\n function modifyExp(stat: string, modifier: number) {\n return function (exp: number) {\n switch (stat) {\n case \"hacking\":\n if (exp) {\n props.player.gainHackingExp(exp * modifier);\n }\n break;\n case \"strength\":\n if (exp) {\n props.player.gainStrengthExp(exp * modifier);\n }\n break;\n case \"defense\":\n if (exp) {\n props.player.gainDefenseExp(exp * modifier);\n }\n break;\n case \"dexterity\":\n if (exp) {\n props.player.gainDexterityExp(exp * modifier);\n }\n break;\n case \"agility\":\n if (exp) {\n props.player.gainAgilityExp(exp * modifier);\n }\n break;\n case \"charisma\":\n if (exp) {\n props.player.gainCharismaExp(exp * modifier);\n }\n break;\n case \"intelligence\":\n if (exp) {\n props.player.gainIntelligenceExp(exp * modifier);\n }\n break;\n }\n props.player.updateSkillLevels();\n };\n }\n\n function modifyKarma(modifier: number) {\n return function (amt: number) {\n props.player.karma += amt * modifier;\n };\n }\n\n function tonsOfExp(): void {\n props.player.gainHackingExp(bigNumber);\n props.player.gainStrengthExp(bigNumber);\n props.player.gainDefenseExp(bigNumber);\n props.player.gainDexterityExp(bigNumber);\n props.player.gainAgilityExp(bigNumber);\n props.player.gainCharismaExp(bigNumber);\n props.player.gainIntelligenceExp(bigNumber);\n props.player.updateSkillLevels();\n }\n\n function resetAllExp(): void {\n props.player.hacking_exp = 0;\n props.player.strength_exp = 0;\n props.player.defense_exp = 0;\n props.player.dexterity_exp = 0;\n props.player.agility_exp = 0;\n props.player.charisma_exp = 0;\n props.player.intelligence_exp = 0;\n props.player.updateSkillLevels();\n }\n\n function resetExperience(stat: string): () => void {\n return function () {\n switch (stat) {\n case \"hacking\":\n props.player.hacking_exp = 0;\n break;\n case \"strength\":\n props.player.strength_exp = 0;\n break;\n case \"defense\":\n props.player.defense_exp = 0;\n break;\n case \"dexterity\":\n props.player.dexterity_exp = 0;\n break;\n case \"agility\":\n props.player.agility_exp = 0;\n break;\n case \"charisma\":\n props.player.charisma_exp = 0;\n break;\n case \"intelligence\":\n props.player.intelligence_exp = 0;\n break;\n }\n props.player.updateSkillLevels();\n };\n }\n\n function resetKarma(): () => void {\n return function () {\n props.player.karma = 0;\n };\n }\n\n function enableIntelligence(): void {\n if (props.player.intelligence === 0) {\n props.player.intelligence = 1;\n props.player.updateSkillLevels();\n }\n }\n\n function disableIntelligence(): void {\n props.player.intelligence_exp = 0;\n props.player.intelligence = 0;\n props.player.updateSkillLevels();\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Experience / Stats</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>All:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfExp}>Tons of exp</Button>\n <Button onClick={resetAllExp}>Reset</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Hacking:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"hacking\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"hacking\", 1)(bigNumber)}\n add={modifyExp(\"hacking\", 1)}\n subtract={modifyExp(\"hacking\", -1)}\n reset={resetExperience(\"hacking\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Strength:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"strength\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"strength\", 1)(bigNumber)}\n add={modifyExp(\"strength\", 1)}\n subtract={modifyExp(\"strength\", -1)}\n reset={resetExperience(\"strength\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Defense:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"defense\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"defense\", 1)(bigNumber)}\n add={modifyExp(\"defense\", 1)}\n subtract={modifyExp(\"defense\", -1)}\n reset={resetExperience(\"defense\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Dexterity:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"dexterity\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"dexterity\", 1)(bigNumber)}\n add={modifyExp(\"dexterity\", 1)}\n subtract={modifyExp(\"dexterity\", -1)}\n reset={resetExperience(\"dexterity\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Agility:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"agility\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"agility\", 1)(bigNumber)}\n add={modifyExp(\"agility\", 1)}\n subtract={modifyExp(\"agility\", -1)}\n reset={resetExperience(\"agility\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Charisma:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"charisma\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"charisma\", 1)(bigNumber)}\n add={modifyExp(\"charisma\", 1)}\n subtract={modifyExp(\"charisma\", -1)}\n reset={resetExperience(\"charisma\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Intelligence:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"intelligence\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"intelligence\", 1)(bigNumber)}\n add={modifyExp(\"intelligence\", 1)}\n subtract={modifyExp(\"intelligence\", -1)}\n reset={resetExperience(\"intelligence\")}\n />\n </td>\n <td>\n <Button onClick={enableIntelligence}>Enable</Button>\n </td>\n <td>\n <Button onClick={disableIntelligence}>Disable</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Karma:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"karma\"\n placeholder=\"amt\"\n tons={() => modifyExp(\"intelligence\", 1)(100000)}\n add={modifyKarma(1)}\n subtract={modifyKarma(-1)}\n reset={resetKarma()}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Factions as AllFaction } from \"../../Faction/Factions\";\nimport FormControl from \"@mui/material/FormControl\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyAllIcon from \"@mui/icons-material/ReplyAll\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport InputLabel from \"@mui/material/InputLabel\";\n\nconst bigNumber = 1e12;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Factions(props: IProps): React.ReactElement {\n const [faction, setFaction] = useState(\"Illuminati\");\n\n function setFactionDropdown(event: SelectChangeEvent<string>): void {\n setFaction(event.target.value as string);\n }\n\n function receiveInvite(): void {\n props.player.receiveInvite(faction);\n }\n\n function receiveAllInvites(): void {\n for (const i of Object.keys(AllFaction)) {\n props.player.receiveInvite(AllFaction[i].name);\n }\n }\n\n function modifyFactionRep(modifier: number): (x: number) => void {\n return function (reputation: number): void {\n const fac = AllFaction[faction];\n if (fac != null && !isNaN(reputation)) {\n fac.playerReputation += reputation * modifier;\n }\n };\n }\n\n function resetFactionRep(): void {\n const fac = AllFaction[faction];\n if (fac != null) {\n fac.playerReputation = 0;\n }\n }\n\n function modifyFactionFavor(modifier: number): (x: number) => void {\n return function (favor: number): void {\n const fac = AllFaction[faction];\n if (fac != null && !isNaN(favor)) {\n fac.favor += favor * modifier;\n }\n };\n }\n\n function resetFactionFavor(): void {\n const fac = AllFaction[faction];\n if (fac != null) {\n fac.favor = 0;\n }\n }\n\n function tonsOfRep(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].playerReputation = bigNumber;\n }\n }\n\n function resetAllRep(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].playerReputation = 0;\n }\n }\n\n function tonsOfFactionFavor(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].favor = bigNumber;\n }\n }\n\n function resetAllFactionFavor(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].favor = 0;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Factions</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Faction:</Typography>\n </td>\n <td>\n <FormControl>\n <InputLabel id=\"factions-select\">Faction</InputLabel>\n <Select\n labelId=\"factions-select\"\n id=\"factions-dropdown\"\n onChange={setFactionDropdown}\n value={faction}\n startAdornment={\n <>\n <IconButton onClick={receiveAllInvites} size=\"large\" arial-label=\"receive-all-invitation\">\n <ReplyAllIcon />\n </IconButton>\n <IconButton onClick={receiveInvite} size=\"large\" arial-label=\"receive-one-invitation\">\n <ReplyIcon />\n </IconButton>\n </>\n }\n >\n {Object.values(AllFaction).map((faction) => (\n <MenuItem key={faction.name} value={faction.name}>\n {faction.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Reputation:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"reputation\"\n placeholder=\"amt\"\n tons={() => modifyFactionRep(1)(bigNumber)}\n add={modifyFactionRep(1)}\n subtract={modifyFactionRep(-1)}\n reset={resetFactionRep}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Favor:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"favor\"\n placeholder=\"amt\"\n tons={() => modifyFactionFavor(1)(2000)}\n add={modifyFactionFavor(1)}\n subtract={modifyFactionFavor(-1)}\n reset={resetFactionFavor}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>All Reputation:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfRep}>Tons</Button>\n <Button onClick={resetAllRep}>Reset</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>All Favor:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfFactionFavor}>Tons</Button>\n <Button onClick={resetAllFactionFavor}>Reset</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport Typography from \"@mui/material/Typography\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyAllIcon from \"@mui/icons-material/ReplyAll\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport ClearIcon from \"@mui/icons-material/Clear\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Augmentations(props: IProps): React.ReactElement {\n const [augmentation, setAugmentation] = useState(\"Augmented Targeting I\");\n\n function setAugmentationDropdown(event: SelectChangeEvent<string>): void {\n setAugmentation(event.target.value as string);\n }\n function queueAug(): void {\n props.player.queueAugmentation(augmentation);\n }\n\n function queueAllAugs(): void {\n for (const augName of Object.values(AugmentationNames)) {\n props.player.queueAugmentation(augName);\n }\n }\n\n function clearAugs(): void {\n props.player.augmentations = [];\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Augmentations</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Aug:</Typography>\n </td>\n <td>\n <Select\n onChange={setAugmentationDropdown}\n value={augmentation}\n startAdornment={\n <>\n <IconButton onClick={queueAllAugs} size=\"large\">\n <ReplyAllIcon />\n </IconButton>\n <IconButton onClick={queueAug} size=\"large\">\n <ReplyIcon />\n </IconButton>\n </>\n }\n endAdornment={\n <>\n <IconButton onClick={clearAugs} size=\"large\">\n <ClearIcon />\n </IconButton>\n </>\n }\n >\n {Object.values(AugmentationNames).map((aug) => (\n <MenuItem key={aug} value={aug}>\n {aug}\n </MenuItem>\n ))}\n </Select>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { PlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\n\n// Update as additional BitNodes get implemented\nconst validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function SourceFiles(props: IProps): React.ReactElement {\n function setSF(sfN: number, sfLvl: number) {\n return function () {\n if (sfN === 9) {\n props.player.hacknetNodes = [];\n }\n if (sfLvl === 0) {\n props.player.sourceFiles = props.player.sourceFiles.filter((sf) => sf.n !== sfN);\n return;\n }\n\n if (!props.player.sourceFiles.some((sf) => sf.n === sfN)) {\n props.player.sourceFiles.push(new PlayerOwnedSourceFile(sfN, sfLvl));\n return;\n }\n\n for (let i = 0; i < props.player.sourceFiles.length; i++) {\n if (props.player.sourceFiles[i].n === sfN) {\n props.player.sourceFiles[i].lvl = sfLvl;\n }\n }\n };\n }\n\n function setAllSF(sfLvl: number) {\n return () => {\n for (let i = 0; i < validSFN.length; i++) {\n setSF(validSFN[i], sfLvl)();\n }\n };\n }\n\n function clearExploits(): void {\n props.player.exploits = [];\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Source-Files</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Exploits:</Typography>\n </td>\n <td>\n <Button onClick={clearExploits}>Clear</Button>\n </td>\n </tr>\n <tr key={\"sf-all\"}>\n <td>\n <Typography>All:</Typography>\n </td>\n <td>\n <ButtonGroup>\n <Button aria-label=\"all-sf-0\" onClick={setAllSF(0)}>\n 0\n </Button>\n <Button aria-label=\"all-sf-1\" onClick={setAllSF(1)}>\n 1\n </Button>\n <Button aria-label=\"all-sf-2\" onClick={setAllSF(2)}>\n 2\n </Button>\n <Button aria-label=\"all-sf-3\" onClick={setAllSF(3)}>\n 3\n </Button>\n </ButtonGroup>\n </td>\n </tr>\n {validSFN.map((i) => (\n <tr key={\"sf-\" + i}>\n <td>\n <Typography>SF-{i}:</Typography>\n </td>\n <td>\n <ButtonGroup>\n <Button onClick={setSF(i, 0)}>0</Button>\n <Button onClick={setSF(i, 1)}>1</Button>\n <Button onClick={setSF(i, 2)}>2</Button>\n <Button onClick={setSF(i, 3)}>3</Button>\n </ButtonGroup>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Programs as AllPrograms } from \"../../Programs/Programs\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Programs(props: IProps): React.ReactElement {\n const [program, setProgram] = useState(\"NUKE.exe\");\n function setProgramDropdown(event: SelectChangeEvent<string>): void {\n setProgram(event.target.value as string);\n }\n function addProgram(): void {\n if (!props.player.hasProgram(program)) {\n props.player.getHomeComputer().programs.push(program);\n }\n }\n\n function addAllPrograms(): void {\n for (const i of Object.keys(AllPrograms)) {\n if (!props.player.hasProgram(AllPrograms[i].name)) {\n props.player.getHomeComputer().programs.push(AllPrograms[i].name);\n }\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Programs</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Program:</Typography>\n </td>\n <td>\n <Select onChange={setProgramDropdown} value={program}>\n {Object.values(AllPrograms).map((program) => (\n <MenuItem key={program.name} value={program.name}>\n {program.name}\n </MenuItem>\n ))}\n </Select>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Add:</Typography>\n </td>\n <td>\n <Button onClick={addProgram}>One</Button>\n <Button onClick={addAllPrograms}>All</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { GetServer, GetAllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\nexport function Servers(): React.ReactElement {\n const [server, setServer] = useState(\"home\");\n function setServerDropdown(event: SelectChangeEvent<string>): void {\n setServer(event.target.value as string);\n }\n function rootServer(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.hasAdminRights = true;\n s.sshPortOpen = true;\n s.ftpPortOpen = true;\n s.smtpPortOpen = true;\n s.httpPortOpen = true;\n s.sqlPortOpen = true;\n s.openPortCount = 5;\n }\n\n function rootAllServers(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.hasAdminRights = true;\n s.sshPortOpen = true;\n s.ftpPortOpen = true;\n s.smtpPortOpen = true;\n s.httpPortOpen = true;\n s.sqlPortOpen = true;\n s.openPortCount = 5;\n }\n }\n\n function minSecurity(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.hackDifficulty = s.minDifficulty;\n }\n\n function minAllSecurity(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.hackDifficulty = s.minDifficulty;\n }\n }\n\n function maxMoney(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.moneyAvailable = s.moneyMax;\n }\n\n function maxAllMoney(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.moneyAvailable = s.moneyMax;\n }\n }\n\n function minMoney(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.moneyAvailable = 0;\n }\n\n function minAllMoney(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.moneyAvailable = 0;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Servers</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Server:</Typography>\n </td>\n <td colSpan={2}>\n <Select id=\"dev-servers-dropdown\" onChange={setServerDropdown} value={server}>\n {GetAllServers().map((server) => (\n <MenuItem key={server.hostname} value={server.hostname}>\n {server.hostname}\n </MenuItem>\n ))}\n </Select>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Root:</Typography>\n </td>\n <td>\n <Button onClick={rootServer}>Root one</Button>\n </td>\n <td>\n <Button onClick={rootAllServers}>Root all</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Security:</Typography>\n </td>\n <td>\n <Button onClick={minSecurity}>Min one</Button>\n </td>\n <td>\n <Button onClick={minAllSecurity}>Min all</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Money:</Typography>\n </td>\n <td>\n <Button onClick={minMoney}>Min one</Button>\n </td>\n <td>\n <Button onClick={minAllMoney}>Min all</Button>\n </td>\n <td>\n <Button onClick={maxMoney}>Max one</Button>\n </td>\n <td>\n <Button onClick={maxAllMoney}>Max all</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Companies as AllCompanies } from \"../../Company/Companies\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { Adjuster } from \"./Adjuster\";\n\nconst bigNumber = 1e12;\n\nexport function Companies(): React.ReactElement {\n const [company, setCompany] = useState(\"ECorp\");\n function setCompanyDropdown(event: SelectChangeEvent<string>): void {\n setCompany(event.target.value as string);\n }\n function resetCompanyRep(): void {\n AllCompanies[company].playerReputation = 0;\n }\n\n function modifyCompanyRep(modifier: number): (x: number) => void {\n return function (reputation: number): void {\n const c = AllCompanies[company];\n if (c != null && !isNaN(reputation)) {\n c.playerReputation += reputation * modifier;\n }\n };\n }\n\n function modifyCompanyFavor(modifier: number): (x: number) => void {\n return function (favor: number): void {\n const c = AllCompanies[company];\n if (c != null && !isNaN(favor)) {\n c.favor += favor * modifier;\n }\n };\n }\n\n function resetCompanyFavor(): void {\n AllCompanies[company].favor = 0;\n }\n\n function tonsOfRepCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].playerReputation = bigNumber;\n }\n }\n\n function resetAllRepCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].playerReputation = 0;\n }\n }\n\n function tonsOfFavorCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].favor = bigNumber;\n }\n }\n\n function resetAllFavorCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].favor = 0;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Companies</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Company:</Typography>\n </td>\n <td colSpan={3}>\n <Select id=\"dev-companies-dropdown\" onChange={setCompanyDropdown} value={company}>\n {Object.values(AllCompanies).map((company) => (\n <MenuItem key={company.name} value={company.name}>\n {company.name}\n </MenuItem>\n ))}\n </Select>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Reputation:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"reputation\"\n placeholder=\"amt\"\n tons={() => modifyCompanyRep(1)(bigNumber)}\n add={modifyCompanyRep(1)}\n subtract={modifyCompanyRep(-1)}\n reset={resetCompanyRep}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Favor:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"favor\"\n placeholder=\"amt\"\n tons={() => modifyCompanyFavor(1)(2000)}\n add={modifyCompanyFavor(1)}\n subtract={modifyCompanyFavor(-1)}\n reset={resetCompanyFavor}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>All Reputation:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfRepCompanies}>Tons</Button>\n <Button onClick={resetAllRepCompanies}>Reset</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>All Favor:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfFavorCompanies}>Tons</Button>\n <Button onClick={resetAllFavorCompanies}>Reset</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Bladeburner(props: IProps): React.ReactElement {\n const bladeburner = props.player.bladeburner;\n if (bladeburner === null) return <></>;\n function modifyBladeburnerRank(modify: number): (x: number) => void {\n return function (rank: number): void {\n if (!bladeburner) return;\n bladeburner.changeRank(props.player, rank * modify);\n };\n }\n\n function resetBladeburnerRank(): void {\n if (!bladeburner) return;\n bladeburner.rank = 0;\n bladeburner.maxRank = 0;\n }\n\n function addTonsBladeburnerRank(): void {\n if (!bladeburner) return;\n\n bladeburner.changeRank(props.player, bigNumber);\n }\n\n function modifyBladeburnerCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (!bladeburner) return;\n bladeburner.storedCycles += cycles * modify;\n };\n }\n\n function resetBladeburnerCycles(): void {\n if (!bladeburner) return;\n bladeburner.storedCycles = 0;\n }\n\n function addTonsBladeburnerCycles(): void {\n if (!bladeburner) return;\n bladeburner.storedCycles += bigNumber;\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Bladeburner</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Rank:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"rank\"\n placeholder=\"amt\"\n tons={addTonsBladeburnerRank}\n add={modifyBladeburnerRank(1)}\n subtract={modifyBladeburnerRank(-1)}\n reset={resetBladeburnerRank}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Cycles:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"cycles\"\n placeholder=\"amt\"\n tons={addTonsBladeburnerCycles}\n add={modifyBladeburnerCycles(1)}\n subtract={modifyBladeburnerCycles(-1)}\n reset={resetBladeburnerCycles}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Gang(props: IProps): React.ReactElement {\n function addTonsGangCycles(): void {\n if (props.player.gang) {\n props.player.gang.storedCycles = bigNumber;\n }\n }\n\n function modifyGangCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (props.player.gang) {\n props.player.gang.storedCycles += cycles * modify;\n }\n };\n }\n\n function resetGangCycles(): void {\n if (props.player.gang) {\n props.player.gang.storedCycles = 0;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Gang</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Cycles:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"cycles\"\n placeholder=\"amt\"\n tons={addTonsGangCycles}\n add={modifyGangCycles(1)}\n subtract={modifyGangCycles(-1)}\n reset={resetGangCycles}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Corporation(props: IProps): React.ReactElement {\n function addTonsCorporationFunds(): void {\n if (props.player.corporation) {\n props.player.corporation.funds = props.player.corporation.funds + 1e99;\n }\n }\n\n function resetCorporationFunds(): void {\n if (props.player.corporation) {\n props.player.corporation.funds = props.player.corporation.funds - props.player.corporation.funds;\n }\n }\n\n function addTonsCorporationCycles(): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles = bigNumber;\n }\n }\n\n function modifyCorporationCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles += cycles * modify;\n }\n };\n }\n\n function resetCorporationCycles(): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles = 0;\n }\n }\n\n function finishCorporationProducts(): void {\n if (!props.player.corporation) return;\n props.player.corporation.divisions.forEach((div) => {\n Object.keys(div.products).forEach((prod) => {\n const product = div.products[prod];\n if (product === undefined) throw new Error(\"Impossible product undefined\");\n product.prog = 99.9;\n });\n });\n }\n\n function addCorporationResearch(): void {\n if (!props.player.corporation) return;\n props.player.corporation.divisions.forEach((div) => {\n div.sciResearch.qty += 1e10;\n });\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Corporation</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Button onClick={addTonsCorporationFunds}>Tons of funds</Button>\n <Button onClick={resetCorporationFunds}>Reset funds</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Cycles:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"cycles\"\n placeholder=\"amt\"\n tons={addTonsCorporationCycles}\n add={modifyCorporationCycles(1)}\n subtract={modifyCorporationCycles(-1)}\n reset={resetCorporationCycles}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Button onClick={finishCorporationProducts}>Finish products</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button onClick={addCorporationResearch}>Tons of research</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { generateContract, generateRandomContract, generateRandomContractOnHome } from \"../../CodingContractGenerator\";\nimport { CodingContractTypes } from \"../../CodingContracts\";\n\nexport function CodingContracts(): React.ReactElement {\n const [codingcontract, setCodingcontract] = useState(\"Find Largest Prime Factor\");\n function setCodingcontractDropdown(event: SelectChangeEvent<string>): void {\n setCodingcontract(event.target.value as string);\n }\n\n function specificContract(): void {\n generateContract({\n problemType: codingcontract,\n server: \"home\",\n });\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Coding Contracts</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Button onClick={generateRandomContract}>Generate Random Contract</Button>\n <Button onClick={generateRandomContractOnHome}>Generate Random Contract on Home Comp</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Select onChange={setCodingcontractDropdown} value={codingcontract}>\n {Object.values(CodingContractTypes).map((cc) => (\n <MenuItem key={cc.name} value={cc.name}>\n {cc.name}\n </MenuItem>\n ))}\n </Select>\n <Button onClick={specificContract}>Generate Specified Contract Type on Home Comp</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { Money } from \"../../ui/React/Money\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { StockMarket as SM } from \"../../StockMarket/StockMarket\";\nimport { Stock } from \"../../StockMarket/Stock\";\n\nexport function StockMarket(): React.ReactElement {\n const [stockPrice, setStockPrice] = useState(0);\n const [stockSymbol, setStockSymbol] = useState(\"\");\n\n function setStockPriceField(event: React.ChangeEvent<HTMLInputElement>): void {\n setStockPrice(parseFloat(event.target.value));\n }\n\n function setStockSymbolField(event: React.ChangeEvent<HTMLInputElement>): void {\n setStockSymbol(event.target.value);\n }\n\n function processStocks(sub: (arg0: Stock) => void): void {\n const inputSymbols = stockSymbol.replace(/\\s/g, \"\");\n\n let match: (symbol: string) => boolean = (): boolean => {\n return true;\n };\n\n if (inputSymbols !== \"\" && inputSymbols !== \"all\") {\n match = function (symbol: string): boolean {\n return inputSymbols.split(\",\").includes(symbol);\n };\n }\n\n for (const name of Object.keys(SM)) {\n if (SM.hasOwnProperty(name)) {\n const stock = SM[name];\n if (stock instanceof Stock && match(stock.symbol)) {\n sub(stock);\n }\n }\n }\n }\n\n function doSetStockPrice(): void {\n if (!isNaN(stockPrice)) {\n processStocks((stock: Stock) => {\n stock.price = stockPrice;\n });\n }\n }\n\n function viewStockCaps(): void {\n const stocks: JSX.Element[] = [];\n processStocks((stock: Stock) => {\n stocks.push(\n <tr key={stock.symbol}>\n <td>{stock.symbol}</td>\n <td style={{ textAlign: \"right\" }}>\n <Money money={stock.cap} />\n </td>\n </tr>,\n );\n });\n dialogBoxCreate(\n <table>\n <tbody>\n <tr>\n <th>Stock</th>\n <th>Price cap</th>\n </tr>\n {stocks}\n </tbody>\n </table>,\n );\n }\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Stock Market</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Symbol:</Typography>\n </td>\n <td>\n <TextField placeholder=\"symbol/'all'\" onChange={setStockSymbolField} />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Price:</Typography>\n </td>\n <td>\n <TextField placeholder=\"$$$\" onChange={setStockPriceField} />\n <Button onClick={doSetStockPrice}>Set</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Caps:</Typography>\n </td>\n <td>\n <Button onClick={viewStockCaps}>View stock caps</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Adjuster } from \"./Adjuster\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Sleeves(props: IProps): React.ReactElement {\n function sleeveMaxAllShock(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].shock = 0;\n }\n }\n\n function sleeveClearAllShock(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].shock = 100;\n }\n }\n\n function sleeveSyncMaxAll(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].sync = 100;\n }\n }\n\n function sleeveSyncClearAll(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].sync = 0;\n }\n }\n\n function sleeveSetStoredCycles(cycles: number): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].storedCycles = cycles;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Sleeves</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Shock:</Typography>\n </td>\n <td>\n <Button onClick={sleeveMaxAllShock}>Max all</Button>\n </td>\n <td>\n <Button onClick={sleeveClearAllShock}>Clear all</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Sync:</Typography>\n </td>\n <td>\n <Button onClick={sleeveSyncMaxAll}>Max all</Button>\n </td>\n <td>\n <Button onClick={sleeveSyncClearAll}>Clear all</Button>\n </td>\n </tr>\n <tr>\n <td colSpan={3}>\n <Adjuster\n label=\"Stored Cycles\"\n placeholder=\"cycles\"\n tons={() => sleeveSetStoredCycles(10000000)}\n add={sleeveSetStoredCycles}\n subtract={sleeveSetStoredCycles}\n reset={() => sleeveSetStoredCycles(0)}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport { staneksGift } from \"../../CotMG/Helper\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport { Adjuster } from \"./Adjuster\";\n\nexport function Stanek(): React.ReactElement {\n function addCycles(): void {\n staneksGift.storedCycles = 1e6;\n }\n\n function modCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n staneksGift.storedCycles += cycles * modify;\n };\n }\n\n function resetCycles(): void {\n staneksGift.storedCycles = 0;\n }\n\n function addCharge(): void {\n staneksGift.fragments.forEach((f) => {\n f.avgCharge = 1e21;\n f.numCharge = 1e21;\n });\n }\n\n function modCharge(modify: number): (x: number) => void {\n return function (cycles: number): void {\n staneksGift.fragments.forEach((f) => (f.avgCharge += cycles * modify));\n };\n }\n\n function resetCharge(): void {\n staneksGift.fragments.forEach((f) => {\n f.avgCharge = 0;\n f.numCharge = 0;\n });\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Stanek's Gift</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Adjuster\n label=\"cycles\"\n placeholder=\"amt\"\n tons={addCycles}\n add={modCycles(1)}\n subtract={modCycles(-1)}\n reset={resetCycles}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Adjuster\n label=\"all charge\"\n placeholder=\"amt\"\n tons={addCharge}\n add={modCharge(1)}\n subtract={modCharge(-1)}\n reset={resetCharge}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { saveObject } from \"../../SaveObject\";\nimport { IEngine } from \"../../IEngine\";\n\n// Update as additional BitNodes get implemented\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n}\n\nexport function TimeSkip(props: IProps): React.ReactElement {\n function timeskip(time: number) {\n return () => {\n props.player.lastUpdate -= time;\n props.engine._lastUpdate -= time;\n saveObject.saveGame();\n setTimeout(() => location.reload(), 1000);\n };\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Time skip</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Button onClick={timeskip(60 * 1000)}>1 minute</Button>\n <Button onClick={timeskip(60 * 60 * 1000)}>1 hour</Button>\n <Button onClick={timeskip(24 * 60 * 60 * 1000)}>1 day</Button>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport { Tooltip } from \"@mui/material\";\nimport LockIcon from '@mui/icons-material/Lock';\nimport LockOpenIcon from '@mui/icons-material/LockOpen';\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { achievements } from \"../../Achievements/Achievements\";\nimport { IEngine } from \"../../IEngine\";\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n}\n\nexport function Achievements(props: IProps): React.ReactElement {\n const [playerAchievement, setPlayerAchievements] = useState(props.player.achievements.map(m => m.ID));\n\n function grantAchievement(id: string): void {\n props.player.giveAchievement(id);\n setPlayerAchievements(props.player.achievements.map(m => m.ID));\n }\n\n function grantAllAchievements(): void {\n Object.values(achievements).forEach(a => props.player.giveAchievement(a.ID));\n setPlayerAchievements(props.player.achievements.map(m => m.ID));\n }\n\n function removeAchievement(id: string): void {\n props.player.achievements = props.player.achievements.filter(a => a.ID !== id);\n setPlayerAchievements(props.player.achievements.map(m => m.ID));\n }\n\n function clearAchievements(): void {\n props.player.achievements = [];\n setPlayerAchievements(props.player.achievements.map(m => m.ID));\n }\n\n function disableEngine(): void {\n props.engine.Counters.achievementsCounter = Number.MAX_VALUE;\n }\n\n function enableEngine(): void {\n props.engine.Counters.achievementsCounter = 0\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Achievements</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n </td>\n <td>\n <Typography>Achievements:</Typography>\n </td>\n <td>\n <ButtonGroup>\n <Button onClick={grantAllAchievements}>Grant All</Button>\n <Button onClick={clearAchievements}>Clear</Button>\n <Button onClick={disableEngine}>Disable Engine</Button>\n <Button onClick={enableEngine}>Enable Engine</Button>\n </ButtonGroup>\n </td>\n </tr>\n {Object.values(achievements).map((i) => {\n const achieved = playerAchievement.includes(i.ID);\n return <tr key={\"ach-\" + i.ID}>\n <td>\n {achieved ? (\n <Tooltip title=\"Achieved\">\n <LockOpenIcon color=\"primary\" />\n </Tooltip>\n ) : (\n <Tooltip title=\"Locked\">\n <LockIcon color=\"secondary\" />\n </Tooltip>\n )}\n </td>\n <td>\n <Tooltip title={<>{i.ID}<br />{i.Description}</>}>\n <Typography color={achieved ? 'primary': 'secondary'}>{i.Name}:</Typography>\n </Tooltip>\n </td>\n <td>\n <ButtonGroup>\n <Button onClick={() => grantAchievement(i.ID)}>Grant</Button>\n <Button onClick={() => removeAchievement(i.ID)}>Clear</Button>\n </ButtonGroup>\n </td>\n </tr>\n })}\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { Stats } from \"./Stats\";\nimport { Console } from \"./Console\";\nimport { AllPages } from \"./AllPages\";\n\nimport { use } from \"../../ui/Context\";\nimport Box from \"@mui/material/Box\";\n\nexport function BladeburnerRoot(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const bladeburner = player.bladeburner;\n if (bladeburner === null) return <></>;\n return (\n <Box display=\"flex\" flexDirection=\"column\">\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"4fr 8fr\", p: 1 }}>\n <Stats bladeburner={bladeburner} player={player} router={router} />\n <Console bladeburner={bladeburner} player={player} />\n </Box>\n\n <AllPages bladeburner={bladeburner} player={player} />\n </Box>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { IRouter } from \"../../ui/Router\";\nimport { joinFaction } from \"../../Faction/FactionHelpers\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport { TravelModal } from \"./TravelModal\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n router: IRouter;\n player: IPlayer;\n}\n\nexport function Stats(props: IProps): React.ReactElement {\n const [travelOpen, setTravelOpen] = useState(false);\n const setRerender = useState(false)[1];\n\n const inFaction = props.bladeburner.rank >= BladeburnerConstants.RankNeededForFaction;\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 1000);\n return () => clearInterval(id);\n }, []);\n\n function openFaction(): void {\n if (!inFaction) return;\n const faction = Factions[\"Bladeburners\"];\n if (!faction.isMember) {\n joinFaction(faction);\n }\n\n props.router.toFaction(faction);\n }\n\n return (\n <Paper sx={{ p: 1, overflowY: 'auto', overflowX: 'hidden', wordBreak: 'break-all' }}>\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 1, maxHeight: '60vh' }}>\n <Box sx={{ alignSelf: 'flex-start', width: '100%' }}>\n <Button onClick={() => setTravelOpen(true)} sx={{ width: '50%' }}>Travel</Button>\n <Tooltip title={!inFaction ? <Typography>Rank 25 required.</Typography> : \"\"}>\n <span>\n <Button disabled={!inFaction} onClick={openFaction} sx={{ width: '50%' }}>\n Faction\n </Button>\n </span>\n </Tooltip>\n <TravelModal open={travelOpen} onClose={() => setTravelOpen(false)} bladeburner={props.bladeburner} />\n </Box>\n <Box display=\"flex\">\n <Tooltip title={<Typography>Your rank within the Bladeburner division.</Typography>}>\n <Typography>Rank: {formatNumber(props.bladeburner.rank, 2)}</Typography>\n </Tooltip>\n </Box>\n <br />\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Performing actions will use up your stamina.\n <br />\n <br />\n Your max stamina is determined primarily by your agility stat.\n <br />\n <br />\n Your stamina gain rate is determined by both your agility and your max stamina. Higher max stamina leads\n to a higher gain rate.\n <br />\n <br />\n Once your stamina falls below 50% of its max value, it begins to negatively affect the success rate of\n your contracts/operations. This penalty is shown in the overview panel. If the penalty is 15%, then this\n means your success rate would be multipled by 85% (100 - 15).\n <br />\n <br />\n Your max stamina and stamina gain rate can also be increased by training, or through skills and\n Augmentation upgrades.\n </Typography>\n }\n >\n <Typography>\n Stamina: {formatNumber(props.bladeburner.stamina, 3)} / {formatNumber(props.bladeburner.maxStamina, 3)}\n </Typography>\n </Tooltip>\n </Box>\n <br />\n <Typography>\n Stamina Penalty: {formatNumber((1 - props.bladeburner.calculateStaminaPenalty()) * 100, 1)}%\n </Typography>\n <br />\n <Typography>Team Size: {formatNumber(props.bladeburner.teamSize, 0)}</Typography>\n <Typography>Team Members Lost: {formatNumber(props.bladeburner.teamLost, 0)}</Typography>\n <br />\n <Typography>Num Times Hospitalized: {props.bladeburner.numHosp}</Typography>\n <Typography>\n Money Lost From Hospitalizations: <Money money={props.bladeburner.moneyLost} />\n </Typography>\n <br />\n <Typography>Current City: {props.bladeburner.city}</Typography>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n This is your Bladeburner division's estimate of how many Synthoids exist in your current city. An accurate\n population count increases success rate estimates.\n </Typography>\n }\n >\n <Typography>\n Est. Synthoid Population: {numeralWrapper.formatPopulation(props.bladeburner.getCurrentCity().popEst)}\n </Typography>\n </Tooltip>\n </Box>\n <br />\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n This is your Bladeburner divison's estimate of how many Synthoid communities exist in your current city.\n </Typography>\n }\n >\n <Typography>Synthoid Communities: {formatNumber(props.bladeburner.getCurrentCity().comms, 0)}</Typography>\n </Tooltip>\n </Box>\n <br />\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n The city's chaos level due to tensions and conflicts between humans and Synthoids. Having too high of a\n chaos level can make contracts and operations harder.\n </Typography>\n }\n >\n <Typography>City Chaos: {formatNumber(props.bladeburner.getCurrentCity().chaos)}</Typography>\n </Tooltip>\n </Box>\n <br />\n {(props.bladeburner.storedCycles / BladeburnerConstants.CyclesPerSecond) * 1000 > 15000 && (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by\n browser). Bonus time makes the Bladeburner mechanic progress faster, up to 5x the normal speed.\n </Typography>\n }\n >\n <Typography>\n Bonus time:{\" \"}\n {convertTimeMsToTimeElapsedString(\n (props.bladeburner.storedCycles / BladeburnerConstants.CyclesPerSecond) * 1000,\n )}\n </Typography>\n </Tooltip>\n </Box>\n <br />\n </>\n )}\n <Typography>Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}</Typography>\n <br />\n <Typography>\n Aug. Success Chance mult: {formatNumber(props.player.bladeburner_success_chance_mult * 100, 1)}%\n <br />\n Aug. Max Stamina mult: {formatNumber(props.player.bladeburner_max_stamina_mult * 100, 1)}%\n <br />\n Aug. Stamina Gain mult: {formatNumber(props.player.bladeburner_stamina_gain_mult * 100, 1)}%\n <br />\n Aug. Field Analysis mult: {formatNumber(props.player.bladeburner_analysis_mult * 100, 1)}%\n </Typography>\n </Box>\n </Paper>\n );\n}\n","import React from \"react\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { Settings } from \"../../Settings/Settings\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n open: boolean;\n onClose: () => void;\n}\n\nexport function TravelModal(props: IProps): React.ReactElement {\n function travel(city: string): void {\n props.bladeburner.city = city;\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Travel to a different city for your Bladeburner activities. This does not cost any money. The city you are in\n for your Bladeburner duties does not affect your location in the game otherwise.\n </Typography>\n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n <Button key={city} onClick={() => travel(city)}>\n {city}\n </Button>\n ))\n ) : (\n <WorldMap currentCity={props.bladeburner.city as CityName} onTravel={(city: CityName) => travel(city)} />\n )}\n </>\n </Modal>\n );\n}\n","import React, { useState, useRef, useEffect } from \"react\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Paper from \"@mui/material/Paper\";\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface ILineProps {\n content: any;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n margin: theme.spacing(0),\n width: \"100%\",\n },\n input: {\n backgroundColor: theme.colors.backgroundsecondary,\n },\n nopadding: {\n padding: theme.spacing(0),\n },\n preformatted: {\n whiteSpace: \"pre-wrap\",\n margin: theme.spacing(0),\n },\n list: {\n padding: theme.spacing(0),\n height: \"100%\",\n },\n }),\n);\n\nfunction Line(props: ILineProps): React.ReactElement {\n return (\n <ListItem sx={{ p: 0 }}>\n <Typography>{props.content}</Typography>\n </ListItem>\n );\n}\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function Console(props: IProps): React.ReactElement {\n const classes = useStyles();\n const [command, setCommand] = useState(\"\");\n const setRerender = useState(false)[1];\n const consoleInput = useRef<HTMLInputElement>(null);\n\n function handleCommandChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setCommand(event.target.value);\n }\n\n const [consoleHistoryIndex, setConsoleHistoryIndex] = useState(props.bladeburner.consoleHistory.length);\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => {\n clearInterval(id);\n };\n }, []);\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) {\n event.preventDefault();\n if (command.length > 0) {\n props.bladeburner.postToConsole(\"> \" + command);\n props.bladeburner.executeConsoleCommands(props.player, command);\n setConsoleHistoryIndex(props.bladeburner.consoleHistory.length);\n setCommand(\"\");\n }\n }\n\n const consoleHistory = props.bladeburner.consoleHistory;\n\n if (event.keyCode === 38) {\n // up\n let i = consoleHistoryIndex;\n const len = consoleHistory.length;\n if (len === 0) {\n return;\n }\n if (i < 0 || i > len) {\n setConsoleHistoryIndex(len);\n }\n\n if (i !== 0) {\n i = i - 1;\n }\n setConsoleHistoryIndex(i);\n const prevCommand = consoleHistory[i];\n event.currentTarget.value = prevCommand;\n setCommand(prevCommand);\n }\n\n if (event.keyCode === 40) {\n const i = consoleHistoryIndex;\n const len = consoleHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n setConsoleHistoryIndex(len);\n }\n\n // Latest command, put nothing\n if (i == len || i == len - 1) {\n setConsoleHistoryIndex(len);\n event.currentTarget.value = \"\";\n } else {\n setConsoleHistoryIndex(consoleHistoryIndex + 1);\n const prevCommand = consoleHistory[consoleHistoryIndex + 1];\n event.currentTarget.value = prevCommand;\n setCommand(prevCommand);\n }\n }\n }\n\n function handleClick(): void {\n if (!consoleInput.current) return;\n consoleInput.current.focus();\n }\n\n return (\n <Paper sx={{ p: 1 }}>\n <Box sx={{\n height: '60vh',\n paddingBottom: '8px',\n display: 'flex',\n alignItems: 'stretch',\n whiteSpace: 'pre-wrap',\n }}\n onClick={handleClick}>\n <Box>\n <Logs entries={[...props.bladeburner.consoleLogs]} />\n </Box>\n </Box>\n <TextField\n classes={{ root: classes.textfield }}\n autoFocus\n tabIndex={1}\n type=\"text\"\n inputRef={consoleInput}\n value={command}\n onChange={handleCommandChange}\n onKeyDown={handleKeyDown}\n InputProps={{\n // for players to hook in\n className: classes.input,\n startAdornment: (\n <>\n <Typography>> </Typography>\n </>\n ),\n spellCheck: false,\n }}\n />\n </Paper>\n );\n}\n\ninterface ILogProps {\n entries: string[];\n}\n\nfunction Logs({ entries }: ILogProps): React.ReactElement {\n const scrollHook = useRef<HTMLUListElement>(null);\n\n // TODO: Text gets shifted up as new entries appear, if the user scrolled up it should attempt to keep the text focused\n function scrollToBottom(): void {\n if (!scrollHook.current) return;\n scrollHook.current.scrollTop = scrollHook.current.scrollHeight;\n }\n\n useEffect(() => {\n scrollToBottom();\n }, [entries.length]);\n\n return (\n <List sx={{ height: \"100%\", overflow: \"auto\", p: 1 }} ref={scrollHook}>\n {entries && entries.map((log: any, i: number) => (\n <Line key={i} content={log} />\n ))}\n </List>\n );\n}\n","import React from \"react\";\nimport { GeneralActionPage } from \"./GeneralActionPage\";\nimport { ContractPage } from \"./ContractPage\";\nimport { OperationPage } from \"./OperationPage\";\nimport { BlackOpPage } from \"./BlackOpPage\";\nimport { SkillPage } from \"./SkillPage\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function AllPages(props: IProps): React.ReactElement {\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n return (\n <>\n <Tabs variant=\"fullWidth\" value={value} onChange={handleChange}>\n <Tab label=\"General\" />\n <Tab label=\"Contracts\" />\n <Tab label=\"Operations\" />\n <Tab label=\"BlackOps\" />\n <Tab label=\"Skills\" />\n </Tabs>\n <Box sx={{ p: 1 }}>\n {value === 0 && <GeneralActionPage bladeburner={props.bladeburner} player={props.player} />}\n {value === 1 && <ContractPage bladeburner={props.bladeburner} player={props.player} />}\n {value === 2 && <OperationPage bladeburner={props.bladeburner} player={props.player} />}\n {value === 3 && <BlackOpPage bladeburner={props.bladeburner} player={props.player} />}\n {value === 4 && <SkillPage bladeburner={props.bladeburner} />}\n </Box>\n </>\n );\n}\n","import * as React from \"react\";\nimport { GeneralActionList } from \"./GeneralActionList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function GeneralActionPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>These are generic actions that will assist you in your Bladeburner duties.</Typography>\n <GeneralActionList bladeburner={props.bladeburner} player={props.player} />\n </>\n );\n}\n","import React from \"react\";\nimport { GeneralActionElem } from \"./GeneralActionElem\";\nimport { Action } from \"../Action\";\nimport { GeneralActions } from \"../GeneralActions\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function GeneralActionList(props: IProps): React.ReactElement {\n const actions: Action[] = [];\n for (const name of Object.keys(GeneralActions)) {\n if (GeneralActions.hasOwnProperty(name)) {\n actions.push(GeneralActions[name]);\n }\n }\n return (\n <>\n {actions.map((action: Action) => (\n <GeneralActionElem key={action.name} bladeburner={props.bladeburner} action={action} player={props.player} />\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IAction } from \"../IAction\";\nimport { GeneralActions } from \"../data/GeneralActions\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: IAction;\n}\n\nexport function GeneralActionElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive = props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = (function (): number {\n switch (props.action.name) {\n case \"Training\":\n case \"Field Analysis\":\n return 30;\n case \"Diplomacy\":\n case \"Hyperbolic Regeneration Chamber\":\n case \"Incite Violence\":\n return 60;\n case \"Recruitment\":\n return props.bladeburner.getRecruitmentTime(props.player);\n }\n return -1; // dead code\n })();\n const successChance =\n props.action.name === \"Recruitment\"\n ? Math.max(0, Math.min(props.bladeburner.getRecruitmentSuccessChance(props.player), 1))\n : -1;\n\n const actionData = GeneralActions[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n {isActive ? (\n <>\n <CopyableText value={props.action.name} />\n <Typography>\n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </Typography>\n <Typography>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </Typography>\n </>\n ) : (\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <CopyableText value={props.action.name} />\n <StartButton\n bladeburner={props.bladeburner}\n type={ActionTypes[props.action.name as string]}\n name={props.action.name}\n rerender={rerender}\n />\n </Box>\n )}\n <br />\n <br />\n <Typography>{actionData.desc}</Typography>\n <br />\n <br />\n <Typography>\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n {successChance !== -1 && (\n <>\n <br />\n Estimated success chance: {formatNumber(successChance * 100, 1)}%\n </>\n )}\n </Typography>\n </Paper>\n );\n}\n","import React from \"react\";\n\ninterface IContract {\n desc: JSX.Element;\n}\n\nexport const GeneralActions: {\n [key: string]: IContract | undefined;\n} = {\n Training: {\n desc: (\n <>\n Improve your abilities at the Bladeburner unit's specialized training center. Doing this gives experience for\n all combat stats and also increases your max stamina.\n </>\n ),\n },\n\n \"Field Analysis\": {\n desc: (\n <>\n Mine and analyze Synthoid-related data. This improves the Bladeburner unit's intelligence on Synthoid locations\n and activities. Completing this action will improve the accuracy of your Synthoid population estimated in the\n current city.\n <br />\n <br />\n Does NOT require stamina.\n </>\n ),\n },\n\n Recruitment: {\n desc: (\n <>\n Attempt to recruit members for your Bladeburner team. These members can help you conduct operations.\n <br />\n <br />\n Does NOT require stamina.\n </>\n ),\n },\n\n Diplomacy: {\n desc: (\n <>\n Improve diplomatic relations with the Synthoid population. Completing this action will reduce the Chaos level in\n your current city.\n <br />\n <br />\n Does NOT require stamina.\n </>\n ),\n },\n\n \"Hyperbolic Regeneration Chamber\": {\n desc: (\n <>\n Enter cryogenic stasis using the Bladeburner division's hi-tech Regeneration Chamber. This will slowly heal your\n wounds and slightly increase your stamina.\n <br />\n <br />\n </>\n ),\n },\n \"Incite Violence\": {\n desc: (\n <>\n Purposefully stir trouble in the synthoid community in order to gain a political edge. This will generate\n additional contracts and operations, at the cost of increased Chaos.\n </>\n ),\n },\n};\n","import * as React from \"react\";\nimport { ContractList } from \"./ContractList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function ContractPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n Complete contracts in order to increase your Bladeburner rank and earn money. Failing a contract will cause you\n to lose HP, which can lead to hospitalization.\n <br />\n <br />\n You can unlock higher-level contracts by successfully completing them. Higher-level contracts are more\n difficult, but grant more rank, experience, and money.\n </Typography>\n <ContractList bladeburner={props.bladeburner} player={props.player} />\n </>\n );\n}\n","import React from \"react\";\nimport { ContractElem } from \"./ContractElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function ContractList(props: IProps): React.ReactElement {\n const names = Object.keys(props.bladeburner.contracts);\n const contracts = props.bladeburner.contracts;\n return (\n <>\n {names.map((name: string) => (\n <ContractElem key={name} bladeburner={props.bladeburner} action={contracts[name]} player={props.player} />\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Contracts } from \"../data/Contracts\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IAction } from \"../IAction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { ActionLevel } from \"./ActionLevel\";\nimport { Autolevel } from \"./Autolevel\";\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: IAction;\n}\n\nexport function ContractElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Contract\"] && props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = props.action.getActionTime(props.bladeburner);\n\n const actionData = Contracts[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n {isActive ? (\n <>\n <Typography>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </Typography>\n <Typography>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </Typography>\n </>\n ) : (\n <>\n <CopyableText value={props.action.name} />\n <StartButton\n bladeburner={props.bladeburner}\n type={ActionTypes.Contract}\n name={props.action.name}\n rerender={rerender}\n />\n </>\n )}\n <br />\n <br />\n <ActionLevel action={props.action} bladeburner={props.bladeburner} isActive={isActive} rerender={rerender} />\n <br />\n <br />\n <Typography>\n {actionData.desc}\n <br />\n <br />\n <SuccessChance action={props.action} bladeburner={props.bladeburner} />\n <br />\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n <br />\n Contracts remaining: {Math.floor(props.action.count)}\n <br />\n Successes: {props.action.successes}\n <br />\n Failures: {props.action.failures}\n </Typography>\n <br />\n <Autolevel rerender={rerender} action={props.action} />\n </Paper>\n );\n}\n","import React from \"react\";\n\ninterface IContract {\n desc: JSX.Element;\n}\n\nexport const Contracts: {\n [key: string]: IContract | undefined;\n} = {\n Tracking: {\n desc: (\n <>\n Identify and locate Synthoids. This contract involves reconnaissance and information-gathering ONLY. Do NOT\n engage. Stealth is of the utmost importance.\n <br />\n <br />\n Successfully completing Tracking contracts will slightly improve your Synthoid population estimate for whatever\n city you are currently in.\n </>\n ),\n },\n \"Bounty Hunter\": {\n desc: (\n <>\n Hunt down and capture fugitive Synthoids. These Synthoids are wanted alive.\n <br />\n <br />\n Successfully completing a Bounty Hunter contract will lower the population in your current city, and will also\n increase its chaos level.\n </>\n ),\n },\n Retirement: {\n desc: (\n <>\n Hunt down and retire (kill) rogue Synthoids.\n <br />\n <br />\n Successfully completing a Retirement contract will lower the population in your current city, and will also\n increase its chaos level.\n </>\n ),\n },\n};\n","import React from \"react\";\nimport { stealthIcon } from \"../data/Icons\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nexport function StealthIcon(): React.ReactElement {\n return <Tooltip title={<Typography>This action involves stealth</Typography>}>{stealthIcon}</Tooltip>;\n}\n","import React from \"react\";\nimport { killIcon } from \"../data/Icons\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nexport function KillIcon(): React.ReactElement {\n return <Tooltip title={<Typography>This action involves retirement</Typography>}>{killIcon}</Tooltip>;\n}\n","import * as React from \"react\";\nimport { OperationList } from \"./OperationList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function OperationPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n Carry out operations for the Bladeburner division. Failing an operation will reduce your Bladeburner rank. It\n will also cause you to lose HP, which can lead to hospitalization. In general, operations are harder and more\n punishing than contracts, but are also more rewarding.\n <br />\n <br />\n Operations can affect the chaos level and Synthoid population of your current city. The exact effects vary\n between different Operations.\n <br />\n <br />\n For operations, you can use a team. You must first recruit team members. Having a larger team will improves your\n chances of success.\n <br />\n <br />\n You can unlock higher-level operations by successfully completing them. Higher-level operations are more\n difficult, but grant more rank and experience.\n </Typography>\n <OperationList bladeburner={props.bladeburner} player={props.player} />\n </>\n );\n}\n","import React from \"react\";\nimport { OperationElem } from \"./OperationElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function OperationList(props: IProps): React.ReactElement {\n const names = Object.keys(props.bladeburner.operations);\n const operations = props.bladeburner.operations;\n return (\n <>\n {names.map((name: string) => (\n <OperationElem key={name} bladeburner={props.bladeburner} action={operations[name]} player={props.player} />\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { ActionLevel } from \"./ActionLevel\";\nimport { Autolevel } from \"./Autolevel\";\nimport { StartButton } from \"./StartButton\";\nimport { TeamSizeButton } from \"./TeamSizeButton\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { Operation } from \"../Operation\";\nimport { Operations } from \"../data/Operations\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: Operation;\n}\n\nexport function OperationElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Operation\"] && props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = props.action.getActionTime(props.bladeburner);\n\n const actionData = Operations[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n {isActive ? (\n <>\n <Typography>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </Typography>\n <Typography>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </Typography>\n </>\n ) : (\n <>\n <CopyableText value={props.action.name} />\n <StartButton\n bladeburner={props.bladeburner}\n type={ActionTypes.Operation}\n name={props.action.name}\n rerender={rerender}\n />\n <TeamSizeButton action={props.action} bladeburner={props.bladeburner} />\n </>\n )}\n <br />\n <br />\n\n <ActionLevel action={props.action} bladeburner={props.bladeburner} isActive={isActive} rerender={rerender} />\n <br />\n <br />\n <Typography>\n {actionData.desc}\n <br />\n <br />\n <SuccessChance action={props.action} bladeburner={props.bladeburner} />\n <br />\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n <br />\n Operations remaining: {Math.floor(props.action.count)}\n <br />\n Successes: {props.action.successes}\n <br />\n Failures: {props.action.failures}\n </Typography>\n <br />\n <Autolevel rerender={rerender} action={props.action} />\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Action } from \"../Action\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n action: Action;\n open: boolean;\n onClose: () => void;\n}\n\nexport function TeamSizeModal(props: IProps): React.ReactElement {\n const [teamSize, setTeamSize] = useState<number | undefined>();\n\n function confirmTeamSize(): void {\n if (teamSize === undefined) return;\n const num = Math.round(teamSize);\n if (isNaN(num) || num < 0) {\n dialogBoxCreate(\"Invalid value entered for number of Team Members (must be numeric, positive)\");\n } else {\n props.action.teamCount = num;\n }\n props.onClose();\n }\n\n function onTeamSize(event: React.ChangeEvent<HTMLInputElement>): void {\n const x = parseFloat(event.target.value);\n if (x > props.bladeburner.teamSize) setTeamSize(props.bladeburner.teamSize);\n else setTeamSize(x);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the amount of team members you would like to take on this Op. If you do not have the specified number of\n team members, then as many as possible will be used. Note that team members may be lost during operations.\n </Typography>\n <TextField autoFocus type=\"number\" placeholder=\"Team size\" value={teamSize} onChange={onTeamSize} />\n <Button sx={{ mx: 2 }} onClick={confirmTeamSize}>\n Confirm\n </Button>\n </Modal>\n );\n}\n","import React from \"react\";\n\ninterface IOperation {\n desc: JSX.Element;\n}\n\nexport const Operations: {\n [key: string]: IOperation | undefined;\n} = {\n Investigation: {\n desc: (\n <>\n As a field agent, investigate and identify Synthoid populations, movements, and operations.\n <br />\n <br />\n Successful Investigation ops will increase the accuracy of your synthoid data.\n <br />\n <br />\n You will NOT lose HP from failed Investigation ops.\n </>\n ),\n },\n \"Undercover Operation\": {\n desc: (\n <>\n Conduct undercover operations to identify hidden and underground Synthoid communities and organizations.\n <br />\n <br />\n Successful Undercover ops will increase the accuracy of your synthoid data.\n </>\n ),\n },\n \"Sting Operation\": {\n desc: <>Conduct a sting operation to bait and capture particularly notorious Synthoid criminals.</>,\n },\n Raid: {\n desc: (\n <>\n Lead an assault on a known Synthoid community. Note that there must be an existing Synthoid community in your\n current city in order for this Operation to be successful.\n </>\n ),\n },\n \"Stealth Retirement Operation\": {\n desc: (\n <>\n Lead a covert operation to retire Synthoids. The objective is to complete the task without drawing any\n attention. Stealth and discretion are key.\n </>\n ),\n },\n Assassination: {\n desc: (\n <>\n Assassinate Synthoids that have been identified as important, high-profile social and political leaders in the\n Synthoid communities.\n </>\n ),\n },\n};\n","import * as React from \"react\";\nimport { BlackOpList } from \"./BlackOpList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n Black Operations (Black Ops) are special, one-time covert operations. Each Black Op must be unlocked\n successively by completing the one before it.\n <br />\n <br />\n <b>Your ultimate goal to climb through the ranks of Bladeburners is to complete all of the Black Ops.</b>\n <br />\n <br />\n Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank\n losses.\n </Typography>\n <BlackOpList bladeburner={props.bladeburner} player={props.player} />\n </>\n );\n}\n","import React from \"react\";\nimport { BlackOperations } from \"../BlackOperations\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { BlackOpElem } from \"./BlackOpElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpList(props: IProps): React.ReactElement {\n let blackops: BlackOperation[] = [];\n for (const blackopName of Object.keys(BlackOperations)) {\n if (BlackOperations.hasOwnProperty(blackopName)) {\n blackops.push(BlackOperations[blackopName]);\n }\n }\n blackops.sort(function (a, b) {\n return a.reqdRank - b.reqdRank;\n });\n\n blackops = blackops.filter(\n (blackop: BlackOperation, i: number) =>\n !(\n props.bladeburner.blackops[blackops[i].name] == null &&\n i !== 0 &&\n props.bladeburner.blackops[blackops[i - 1].name] == null\n ),\n );\n\n blackops = blackops.reverse();\n\n return (\n <>\n {blackops.map((blackop: BlackOperation) => (\n <BlackOpElem key={blackop.name} bladeburner={props.bladeburner} action={blackop} player={props.player} />\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { TeamSizeButton } from \"./TeamSizeButton\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { BlackOperations } from \"../data/BlackOperations\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: BlackOperation;\n}\n\nexport function BlackOpElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isCompleted = props.bladeburner.blackops[props.action.name] != null;\n if (isCompleted) {\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Typography>{props.action.name} (COMPLETED)</Typography>\n </Paper>\n );\n }\n\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"BlackOperation\"] &&\n props.action.name === props.bladeburner.action.name;\n const actionTime = props.action.getActionTime(props.bladeburner);\n const hasReqdRank = props.bladeburner.rank >= props.action.reqdRank;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n\n const actionData = BlackOperations[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n {isActive ? (\n <>\n <>\n <CopyableText value={props.action.name} />\n <Typography>\n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </Typography>\n <Typography>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </Typography>\n </>\n </>\n ) : (\n <>\n <CopyableText value={props.action.name} />\n\n <StartButton\n bladeburner={props.bladeburner}\n type={ActionTypes.BlackOperation}\n name={props.action.name}\n rerender={rerender}\n />\n <TeamSizeButton action={props.action} bladeburner={props.bladeburner} />\n </>\n )}\n\n <br />\n <br />\n <Typography>{actionData.desc}</Typography>\n <br />\n <br />\n <Typography color={hasReqdRank ? \"primary\" : \"error\"}>\n Required Rank: {formatNumber(props.action.reqdRank, 0)}\n </Typography>\n <br />\n <Typography>\n <SuccessChance action={props.action} bladeburner={props.bladeburner} />\n <br />\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n </Typography>\n </Paper>\n );\n}\n","import React from \"react\";\n\ninterface IBlackOp {\n desc: JSX.Element;\n}\n\nexport const BlackOperations: {\n [key: string]: IBlackOp | undefined;\n} = {\n \"Operation Typhoon\": {\n desc: (\n <>\n Obadiah Zenyatta is the leader of a RedWater PMC. It has long been known among the intelligence community that\n Zenyatta, along with the rest of the PMC, is a Synthoid.\n <br />\n <br />\n The goal of Operation Typhoon is to find and eliminate Zenyatta and RedWater by any means necessary. After the\n task is completed, the actions must be covered up from the general public.\n </>\n ),\n },\n\n \"Operation Zero\": {\n desc: (\n <>\n AeroCorp is one of the world's largest defense contractors. Its leader, Steve Watataki, is thought to be a\n supporter of Synthoid rights. He must be removed.\n <br />\n <br />\n The goal of Operation Zero is to covertly infiltrate AeroCorp and uncover any incriminating evidence or\n information against Watataki that will cause him to be removed from his position at AeroCorp. Incriminating\n evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced security\n measures in the world.\n </>\n ),\n },\n \"Operation X\": {\n desc: (\n <>\n We have recently discovered an underground publication group called Samizdat. Even though most of their\n publications are nonsensical conspiracy theories, the average human is gullible enough to believe them. Many of\n their works discuss Synthoids and pose a threat to society. The publications are spreading rapidly in China and\n other Eastern countries.\n <br />\n <br />\n Samizdat has done a good job of keeping hidden and anonymous. However, we've just received intelligence that\n their base of operations is in Ishima's underground sewer systems. Your task is to investigate the sewer\n systems, and eliminate Samizdat. They must never publish anything again.\n </>\n ),\n },\n \"Operation Titan\": {\n desc: (\n <>\n Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we\n know, Titan Laboratories' management has no knowledge about this. We don't know what the Synthoids are up to,\n but the research that they could be conducting using Titan Laboraties' vast resources is potentially very\n dangerous.\n <br />\n <br />\n Your goal is to enter and destroy the Bioengineering department's facility in Aevum. The task is not just to\n retire the Synthoids there, but also to destroy any information or research at the facility that is relevant to\n the Synthoids and their goals.\n </>\n ),\n },\n \"Operation Ares\": {\n desc: (\n <>\n One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai\n between rogue Russian militants and a radical Synthoid community. These weapons are next-gen plasma and energy\n weapons. It is critical for the safety of humanity that this deal does not happen.\n <br />\n <br />\n Your task is to intercept the deal. Leave no survivors.\n </>\n ),\n },\n \"Operation Archangel\": {\n desc: (\n <>\n Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI\n Synthoids. Intelligence suggests that the profit from this brothel is used to fund a large black market arms\n trafficking operation.\n <br />\n <br />\n The goal of this operation is to take out the leaders that are running the Red Rabbit brothel. Try to limit the\n number of other casualties, but do what you must to complete the mission.\n </>\n ),\n },\n \"Operation Juggernaut\": {\n desc: (\n <>\n The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls\n himself Juggernaut, has been smuggling drugs and weapons (including suspected bioweapons) into Sector-12. We\n also have reason to believe they tried to break into one of Universal Energy's facilities in order to cause a\n city-wide blackout. The CIA suspects that Juggernaut is a heavily-augmented Synthoid, and have thus enlisted our\n help.\n <br />\n <br />\n Your mission is to eradicate Juggernaut and his followers.\n </>\n ),\n },\n \"Operation Red Dragon\": {\n desc: (\n <>\n The Tetrads criminal organization is suspected of reverse-engineering the MK-VI Synthoid design. We believe they\n altered and possibly improved the design and began manufacturing their own Synthoid models in order to bolster\n their criminal activities.\n <br />\n <br />\n Your task is to infiltrate and destroy the Tetrads' base of operations in Los Angeles. Intelligence tells us\n that their base houses one of their Synthoid manufacturing units.\n </>\n ),\n },\n \"Operation K\": {\n desc: (\n <>\n CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology.\n This technology is supposedly capable of cloning Synthoid, not only physically but also their advanced AI\n modules. We do not believe that VitaLife is trying to use this technology illegally or maliciously, but if any\n Synthoids were able to infiltrate the corporation and take advantage of this technology then the results would\n be catastrophic.\n <br />\n <br />\n We do not have the power or jurisdiction to shut this down through legal or political means, so we must resort\n to a covert operation. Your goal is to destroy this technology and eliminate anyone who was involved in its\n creation.\n </>\n ),\n },\n \"Operation Deckard\": {\n desc: (\n <>\n Despite your success in eliminating VitaLife's new android-replicating technology in Operation K, we've\n discovered that a small group of MK-VI Synthoids were able to make off with the schematics and design of the\n technology before the Operation. It is almost a certainty that these Synthoids are some of the rogue MK-VI ones\n from the Synthoid Uprising.\n <br />\n <br />\n The goal of Operation Deckard is to hunt down these Synthoids and retire them. I don't need to tell you how\n critical this mission is.\n </>\n ),\n },\n \"Operation Tyrell\": {\n desc: (\n <>\n A week ago Blade Industries reported a small break-in at one of their Aevum Augmentation storage facilities. We\n figured out that The Dark Army was behind the heist, and didn't think any more of it. However, we've just\n discovered that several known MK-VI Synthoids were part of that break-in group.\n <br />\n <br />\n We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt\n down the associated Dark Army members and eliminate them.\n </>\n ),\n },\n \"Operation Wallace\": {\n desc: (\n <>\n Based on information gathered from Operation Tyrell, we've discovered that The Dark Army was well aware that\n there were Synthoids amongst their ranks. Even worse, we believe that The Dark Army is working together with\n other criminal organizations such as The Syndicate and that they are planning some sort of large-scale takeover\n of multiple major cities, most notably Aevum. We suspect that Synthoids have infiltrated the ranks of these\n criminal factions and are trying to stage another Synthoid uprising.\n <br />\n <br />\n The best way to deal with this is to prevent it before it even happens. The goal of Operation Wallace is to\n destroy the Dark Army and Syndicate factions in Aevum immediately. Leave no survivors.\n </>\n ),\n },\n \"Operation Shoulder of Orion\": {\n desc: (\n <>\n China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using\n Synthoids. We believe China is trying to establish the first off-world colonies.\n <br />\n <br />\n The mission is to prevent this launch without instigating an international conflict. When you accept this\n mission you will be officially disavowed by the NSA and the national government until after you successfully\n return. In the event of failure, all of the operation's team members must not let themselves be captured alive.\n </>\n ),\n },\n \"Operation Hyron\": {\n desc: (\n <>\n Our intelligence tells us that Fulcrum Technologies is developing a quantum supercomputer using human brains as\n core processors. This supercomputer is rumored to be able to store vast amounts of data and perform computations\n unmatched by any other supercomputer on the planet. But more importantly, the use of organic human brains means\n that the supercomputer may be able to reason abstractly and become self-aware.\n <br />\n <br />\n I do not need to remind you why sentient-level AIs pose a serious threat to all of mankind.\n <br />\n <br />\n The research for this project is being conducted at one of Fulcrum Technologies secret facilities in Aevum,\n codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work, and then find and kill the\n project lead.\n </>\n ),\n },\n \"Operation Morpheus\": {\n desc: (\n <>\n DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the\n people's dreams and subconcious. They do this using broadcast transmitter towers. Based on information from our\n agents and informants in Chonqging, we have reason to believe that one of the broadcast towers there has been\n compromised by Synthoids and is being used to spread pro-Synthoid propaganda.\n <br />\n <br />\n The mission is to destroy this broadcast tower. Speed and stealth are of the utmost importance for this.\n </>\n ),\n },\n \"Operation Ion Storm\": {\n desc: (\n <>\n Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the Sector-12 Slums.\n We don't know if they are rogue Synthoids from the Uprising, but we do know that they have been stockpiling\n weapons, money, and other resources. This makes them dangerous.\n <br />\n <br />\n This is a full-scale assault operation to find and retire all of these Synthoids in the Sector-12 Slums.\n </>\n ),\n },\n \"Operation Annihilus\": {\n desc: (\n <>\n Our superiors have ordered us to eradicate everything and everyone in an underground facility located in Aevum.\n They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist organization called\n 'The Covenant'. We have no prior intelligence about this organization, so you are going in blind.\n </>\n ),\n },\n \"Operation Ultron\": {\n desc: (\n <>\n OmniTek Incorporated, the original designer and manufacturer of Synthoids, has notified us of a malfunction in\n their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized and seek out the\n destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue ones from the\n Uprising.\n <br />\n <br />\n OmniTek has also told us they they believe someone has triggered this malfunction in a large group of MK-VI\n Synthoids, and that these newly-radicalized Synthoids are now amassing in Volhaven to form a terrorist group\n called Ultron.\n <br />\n <br />\n Intelligence suggests Ultron is heavily armed and that their members are augmented. We believe Ultron is making\n moves to take control of and weaponize DeltaOne's Tactical High-Energy Satellite Laser Array (THESLA).\n <br />\n <br />\n Your task is to find and destroy Ultron.\n </>\n ),\n },\n \"Operation Centurion\": {\n desc: (\n <>\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n <br />\n <br />\n Throughout all of humanity's history, we have relied on technology to survive, conquer, and progress. Its\n advancement became our primary goal. And at the peak of human civilization technology turned into power. Global,\n absolute power.\n <br />\n <br />\n It seems that the universe is not without a sense of irony.\n <br />\n <br />\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n </>\n ),\n },\n \"Operation Vindictus\": {\n desc: (\n <>\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n <br />\n <br />\n The bits are all around us. The daemons that hold the Node together can manifest themselves in many different\n ways.\n <br />\n <br />\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n </>\n ),\n },\n \"Operation Daedalus\": {\n desc: <> Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.</>,\n },\n};\n","import React, { useState } from \"react\";\nimport { SkillList } from \"./SkillList\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport Typography from \"@mui/material/Typography\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\ninterface IProps {\n bladeburner: IBladeburner;\n}\n\nexport function SkillPage(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const mults = props.bladeburner.skillMultipliers;\n\n function valid(mult: any): boolean {\n return mult && mult !== 1;\n }\n\n return (\n <>\n <Typography>\n <strong>Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}</strong>\n </Typography>\n <Typography>\n You will gain one skill point every{\" \"}\n {BladeburnerConstants.RanksPerSkillPoint * BitNodeMultipliers.BladeburnerSkillCost} ranks.\n <br />\n Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different\n skills with each other is multiplicative.\n </Typography>\n {valid(mults[\"successChanceAll\"]) && (\n <Typography>Total Success Chance: x{formatNumber(mults[\"successChanceAll\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceStealth\"]) && (\n <Typography>Stealth Success Chance: x{formatNumber(mults[\"successChanceStealth\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceKill\"]) && (\n <Typography>Retirement Success Chance: x{formatNumber(mults[\"successChanceKill\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceContract\"]) && (\n <Typography>Contract Success Chance: x{formatNumber(mults[\"successChanceContract\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceOperation\"]) && (\n <Typography>Operation Success Chance: x{formatNumber(mults[\"successChanceOperation\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceEstimate\"]) && (\n <Typography>Synthoid Data Estimate: x{formatNumber(mults[\"successChanceEstimate\"], 3)}</Typography>\n )}\n {valid(mults[\"actionTime\"]) && <Typography>Action Time: x{formatNumber(mults[\"actionTime\"], 3)}</Typography>}\n {valid(mults[\"effHack\"]) && <Typography>Hacking Skill: x{formatNumber(mults[\"effHack\"], 3)}</Typography>}\n {valid(mults[\"effStr\"]) && <Typography>Strength: x{formatNumber(mults[\"effStr\"], 3)}</Typography>}\n {valid(mults[\"effDef\"]) && <Typography>Defense: x{formatNumber(mults[\"effDef\"], 3)}</Typography>}\n {valid(mults[\"effDex\"]) && <Typography>Dexterity: x{formatNumber(mults[\"effDex\"], 3)}</Typography>}\n {valid(mults[\"effAgi\"]) && <Typography>Agility: x{formatNumber(mults[\"effAgi\"], 3)}</Typography>}\n {valid(mults[\"effCha\"]) && <Typography>Charisma: x{formatNumber(mults[\"effCha\"], 3)}</Typography>}\n {valid(mults[\"effInt\"]) && <Typography>Intelligence: x{formatNumber(mults[\"effInt\"], 3)}</Typography>}\n {valid(mults[\"stamina\"]) && <Typography>Stamina: x{formatNumber(mults[\"stamina\"], 3)}</Typography>}\n {valid(mults[\"money\"]) && <Typography>Contract Money: x{formatNumber(mults[\"money\"], 3)}</Typography>}\n {valid(mults[\"expGain\"]) && <Typography>Exp Gain: x{formatNumber(mults[\"expGain\"], 3)}</Typography>}\n <SkillList bladeburner={props.bladeburner} onUpgrade={() => setRerender((old) => !old)} />\n </>\n );\n}\n\n/*\n\n\n\n\nvar multKeys = Object.keys(this.skillMultipliers);\nfor (var i = 0; i < multKeys.length; ++i) {\n var mult = this.skillMultipliers[multKeys[i]];\n if (mult && mult !== 1) {\n mult = formatNumber(mult, 3);\n switch(multKeys[i]) {\n \n }\n }\n}\n*/\n","import * as React from \"react\";\nimport { SkillElem } from \"./SkillElem\";\nimport { Skills } from \"../Skills\";\nimport { IBladeburner } from \"../IBladeburner\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n onUpgrade: () => void;\n}\n\nexport function SkillList(props: IProps): React.ReactElement {\n return (\n <>\n {Object.keys(Skills).map((skill: string) => (\n <SkillElem key={skill} bladeburner={props.bladeburner} skill={Skills[skill]} onUpgrade={props.onUpgrade} />\n ))}\n </>\n );\n}\n","import React from \"react\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport AddIcon from \"@mui/icons-material/Add\";\nimport CloseIcon from \"@mui/icons-material/Close\";\n\ninterface IProps {\n skill: any;\n bladeburner: IBladeburner;\n onUpgrade: () => void;\n}\n\nexport function SkillElem(props: IProps): React.ReactElement {\n const skillName = props.skill.name;\n let currentLevel = 0;\n if (props.bladeburner.skills[skillName] && !isNaN(props.bladeburner.skills[skillName])) {\n currentLevel = props.bladeburner.skills[skillName];\n }\n const pointCost = props.skill.calculateCost(currentLevel);\n\n const canLevel = props.bladeburner.skillPoints >= pointCost;\n const maxLvl = props.skill.maxLvl ? currentLevel >= props.skill.maxLvl : false;\n\n function onClick(): void {\n if (props.bladeburner.skillPoints < pointCost) return;\n props.bladeburner.skillPoints -= pointCost;\n props.bladeburner.upgradeSkill(props.skill);\n props.onUpgrade();\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <CopyableText variant=\"h6\" color=\"primary\" value={props.skill.name} />\n {!canLevel || maxLvl ? (\n <IconButton disabled>\n <CloseIcon />\n </IconButton>\n ) : (\n <IconButton onClick={onClick}>\n <AddIcon />\n </IconButton>\n )}\n </Box>\n <Typography>Level: {currentLevel}</Typography>\n {maxLvl ? (\n <Typography>MAX LEVEL</Typography>\n ) : (\n <Typography>Skill Points required: {formatNumber(pointCost, 0)}</Typography>\n )}\n <Typography>{props.skill.desc}</Typography>\n </Paper>\n );\n}\n","/**\n * React Component for all the gang stuff.\n */\nimport React, { useState, useEffect } from \"react\";\nimport { ManagementSubpage } from \"./ManagementSubpage\";\nimport { TerritorySubpage } from \"./TerritorySubpage\";\nimport { EquipmentsSubpage } from \"./EquipmentsSubpage\";\nimport { use } from \"../../ui/Context\";\nimport { Context } from \"./Context\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nexport function GangRoot(): React.ReactElement {\n const player = use.Player();\n const gang = (function () {\n if (player.gang === null) throw new Error(\"Gang should not be null\");\n return player.gang;\n })();\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <Context.Gang.Provider value={gang}>\n <Tabs variant=\"fullWidth\" value={value} onChange={handleChange}>\n <Tab label=\"Management\" />\n <Tab label=\"Equipment\" />\n <Tab label=\"Territory\" />\n </Tabs>\n {value === 0 && <ManagementSubpage />}\n {value === 1 && <EquipmentsSubpage />}\n {value === 2 && <TerritorySubpage />}\n </Context.Gang.Provider>\n );\n}\n","/**\n * React Component for the subpage that manages gang members, the main page.\n */\nimport React from \"react\";\nimport { GangStats } from \"./GangStats\";\nimport { GangMemberList } from \"./GangMemberList\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\n\nexport function ManagementSubpage(): React.ReactElement {\n const gang = useGang();\n return (\n <>\n <Typography>\n This page is used to manage your gang members and get an overview of your gang's stats.\n <br />\n <br />\n If a gang member is not earning much money or respect, the task that you have assigned to that member might be\n too difficult. Consider training that member's stats or choosing an easier task. The tasks closer to the top of\n the dropdown list are generally easier. Alternatively, the gang member's low production might be due to the fact\n that your wanted level is too high. Consider assigning a few members to the '\n {gang.isHackingGang ? \"Ethical Hacking\" : \"Vigilante Justice\"}' task to lower your wanted level.\n <br />\n <br />\n Installing Augmentations does NOT reset your progress with your Gang. Furthermore, after installing\n Augmentations, you will automatically be a member of whatever Faction you created your gang with.\n <br />\n <br />\n You can also manage your gang programmatically through Netscript using the Gang API\n </Typography>\n <br />\n <GangStats />\n <br />\n <GangMemberList />\n </>\n );\n}\n","/**\n * React Component for the stats related to the gang, like total respect and\n * money per second.\n */\nimport React from \"react\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { AllGangs } from \"../AllGangs\";\nimport { BonusTime } from \"./BonusTime\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\nexport function GangStats(): React.ReactElement {\n const gang = useGang();\n const territoryMult = AllGangs[gang.facName].territory * 100;\n let territoryStr;\n if (territoryMult <= 0) {\n territoryStr = formatNumber(0, 2);\n } else if (territoryMult >= 100) {\n territoryStr = formatNumber(100, 2);\n } else {\n territoryStr = formatNumber(territoryMult, 2);\n }\n\n return (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Represents the amount of respect your gang has from other gangs and criminal organizations. Your respect\n affects the amount of money your gang members will earn, and also determines how much reputation you are\n earning with your gang's corresponding Faction.\n </Typography>\n }\n >\n <Typography>\n Respect: {numeralWrapper.formatRespect(gang.respect)} (\n {numeralWrapper.formatRespect(5 * gang.respectGainRate)} / sec)\n </Typography>\n </Tooltip>\n </Box>\n\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Represents how much the gang is wanted by law enforcement. The higher your gang's wanted level, the harder\n it will be for your gang members to make money and earn respect. Note that the minimum wanted level is 1.\n </Typography>\n }\n >\n <Typography>\n Wanted Level: {numeralWrapper.formatWanted(gang.wanted)} (\n {numeralWrapper.formatWanted(5 * gang.wantedGainRate)} / sec)\n </Typography>\n </Tooltip>\n </Box>\n\n <Box display=\"flex\">\n <Tooltip title={<Typography>Penalty for respect and money gain rates due to Wanted Level</Typography>}>\n <Typography>Wanted Level Penalty: -{formatNumber((1 - gang.getWantedPenalty()) * 100, 2)}%</Typography>\n </Tooltip>\n </Box>\n\n <Typography>\n Money gain rate: <MoneyRate money={5 * gang.moneyGainRate} />\n </Typography>\n\n <Box display=\"flex\">\n <Tooltip title={<Typography>The percentage of total territory your Gang controls</Typography>}>\n <Typography>Territory: {territoryStr}%</Typography>\n </Tooltip>\n </Box>\n <Typography>\n Faction reputation: <Reputation reputation={Factions[gang.facName].playerReputation} />\n </Typography>\n\n <BonusTime gang={gang} />\n </>\n );\n}\n","/**\n * React Component for displaying the bonus time remaining.\n */\nimport * as React from \"react\";\nimport { Gang } from \"../Gang\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n gang: Gang;\n}\n\nexport function BonusTime(props: IProps): React.ReactElement {\n const CyclerPerSecond = 1000 / CONSTANTS._idleSpeed;\n if ((props.gang.storedCycles / CyclerPerSecond) * 1000 <= 5000) return <></>;\n const bonusMillis = (props.gang.storedCycles / CyclerPerSecond) * 1000;\n return (\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by the\n browser). Bonus time makes the Gang mechanic progress faster, up to 5x the normal speed.\n </Typography>\n }\n >\n <Typography>Bonus time: {convertTimeMsToTimeElapsedString(bonusMillis)}</Typography>\n </Tooltip>\n </Box>\n );\n}\n","/**\n * React Component for the list of gang members on the management subpage.\n */\nimport React, { useState } from \"react\";\nimport { GangMemberCard } from \"./GangMemberCard\";\nimport { RecruitButton } from \"./RecruitButton\";\nimport { useGang } from \"./Context\";\n\nimport { Box, TextField } from \"@mui/material\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { GangMember } from \"../GangMember\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\n\nexport function GangMemberList(): React.ReactElement {\n const gang = useGang();\n const setRerender = useState(false)[1];\n const [filter, setFilter] = useState(\"\");\n const [ascendOnly, setAscendOnly] = useState(false);\n\n const handleFilterChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setFilter(event.target.value.toLowerCase());\n }\n\n const members = gang.members\n .filter((member) => member && member.name.toLowerCase().includes(filter))\n .filter((member) => {\n if (ascendOnly) return member.canAscend();\n return true;\n });\n\n return (\n <>\n <RecruitButton onRecruit={() => setRerender((old) => !old)} />\n <TextField\n value={filter}\n onChange={handleFilterChange}\n autoFocus\n InputProps={{\n startAdornment: <SearchIcon />,\n spellCheck: false\n }}\n placeholder=\"Filter by member name\"\n sx={{ m: 1, width: '15%' }}\n />\n <OptionSwitch\n checked={ascendOnly}\n onChange={(newValue) => (setAscendOnly(newValue))}\n text=\"Show only ascendable\"\n tooltip={\n <>\n Filter the members list by whether or not the member\n can be ascended.\n </>\n }\n />\n <Box display=\"grid\" sx={{ gridTemplateColumns: 'repeat(2, 1fr)' }}>\n {members.map((member: GangMember) => (\n <GangMemberCard key={member.name} member={member} />\n ))}\n </Box>\n </>\n );\n}\n","/**\n * React Component for a gang member on the management subpage.\n */\nimport React from \"react\";\nimport { GangMember } from \"../GangMember\";\nimport { GangMemberCardContent } from \"./GangMemberCardContent\";\n\nimport Box from \"@mui/material/Box\";\n\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberCard(props: IProps): React.ReactElement {\n return (\n <Box component={Paper} sx={{ width: 'auto' }}>\n <Box sx={{ m: 1 }}>\n <ListItemText primary={<b>{props.member.name}</b>} />\n <GangMemberCardContent member={props.member} />\n </Box>\n </Box>\n );\n}\n","/**\n * React Component for the content of the accordion of gang members on the\n * management subpage.\n */\nimport React, { useState } from \"react\";\nimport { GangMemberStats } from \"./GangMemberStats\";\nimport { TaskSelector } from \"./TaskSelector\";\nimport { AscensionModal } from \"./AscensionModal\";\n\nimport { Box } from \"@mui/system\";\nimport { Button, Typography } from \"@mui/material\";\nimport HelpIcon from \"@mui/icons-material/Help\";\n\nimport { GangMember } from \"../GangMember\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberCardContent(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const [helpOpen, setHelpOpen] = useState(false);\n const [ascendOpen, setAscendOpen] = useState(false);\n\n return (\n <>\n {props.member.canAscend() && (\n <Box sx={{ display: 'flex', justifyContent: 'space-between', my: 1 }}>\n <Button onClick={() => setAscendOpen(true)} style={{ flexGrow: 1, borderRightWidth: 0 }}>Ascend</Button>\n <AscensionModal\n open={ascendOpen}\n onClose={() => setAscendOpen(false)}\n member={props.member}\n onAscend={() => setRerender((old) => !old)}\n />\n <Button onClick={() => setHelpOpen(true)} style={{ width: 'fit-content', borderLeftWidth: 0 }}>\n <HelpIcon />\n </Button>\n <StaticModal open={helpOpen} onClose={() => setHelpOpen(false)}>\n <Typography>\n Ascending a Gang Member resets the member's progress and stats in exchange for a permanent boost to their\n stat multipliers.\n <br />\n <br />\n The additional stat multiplier that the Gang Member gains upon ascension is based on the amount of exp\n they have.\n <br />\n <br />\n Upon ascension, the member will lose all of its non-Augmentation Equipment and your gang will lose respect\n equal to the total respect earned by the member.\n </Typography>\n </StaticModal>\n </Box>\n )}\n <Box display=\"grid\" sx={{ gridTemplateColumns: '1fr 1fr', width: '100%', gap: 1 }}>\n <GangMemberStats member={props.member} />\n <TaskSelector onTaskChange={() => setRerender((old) => !old)} member={props.member} />\n </Box>\n </>\n );\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n killScripts: () => void;\n}\n\nexport function KillScriptsModal(props: IProps): React.ReactElement {\n function onClick(): void {\n props.killScripts();\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Forcefully kill all running scripts? This will also save your game and reload the game.</Typography>\n <Button onClick={onClick}>KILL</Button>\n </Modal>\n );\n}\n","/**\n * React Component for the middle part of the gang member accordion. Contains\n * the task selector as well as some stats.\n */\nimport React, { useState } from \"react\";\nimport { useGang } from \"./Context\";\nimport { TaskDescription } from \"./TaskDescription\";\n\nimport { Box } from \"@mui/material\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\nimport { GangMember } from \"../GangMember\";\n\ninterface IProps {\n member: GangMember;\n onTaskChange: () => void;\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const gang = useGang();\n const [currentTask, setCurrentTask] = useState(props.member.task);\n\n function onChange(event: SelectChangeEvent<string>): void {\n const task = event.target.value;\n props.member.assignToTask(task);\n setCurrentTask(task);\n props.onTaskChange();\n }\n\n const tasks = gang.getAllTaskNames();\n\n return (\n <Box>\n <Select onChange={onChange} value={currentTask} sx={{ width: '100%' }}>\n <MenuItem key={0} value={\"Unassigned\"}>\n Unassigned\n </MenuItem>\n {tasks.map((task: string, i: number) => (\n <MenuItem key={i + 1} value={task}>\n {task}\n </MenuItem>\n ))}\n </Select>\n <TaskDescription member={props.member} />\n </Box>\n );\n}\n","/**\n * React Component for left side of the gang member accordion, contains the\n * description of the task that member is currently doing.\n */\nimport React from \"react\";\nimport { GangMemberTasks } from \"../GangMemberTasks\";\nimport { GangMember } from \"../GangMember\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function TaskDescription(props: IProps): React.ReactElement {\n const task = GangMemberTasks[props.member.task];\n const desc = task ? task.desc : GangMemberTasks[\"Unassigned\"].desc;\n\n return <Typography dangerouslySetInnerHTML={{ __html: desc }} />;\n}\n","/**\n * React Component for the content of the popup before the player confirms the\n * ascension of a gang member.\n */\nimport React, { useState, useEffect } from \"react\";\nimport { GangMember } from \"../GangMember\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n member: GangMember;\n onAscend: () => void;\n}\n\nexport function AscensionModal(props: IProps): React.ReactElement {\n const gang = useGang();\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 1000);\n return () => clearInterval(id);\n }, []);\n\n function confirm(): void {\n props.onAscend();\n const res = gang.ascendMember(props.member);\n dialogBoxCreate(\n <>\n You ascended {props.member.name}!<br />\n <br />\n Your gang lost {numeralWrapper.formatRespect(res.respect)} respect.\n <br />\n <br />\n {props.member.name} gained the following stat multipliers for ascending:\n <br />\n Hacking: x{numeralWrapper.format(res.hack, \"0.000\")}\n <br />\n Strength: x{numeralWrapper.format(res.str, \"0.000\")}\n <br />\n Defense: x{numeralWrapper.format(res.def, \"0.000\")}\n <br />\n Dexterity: x{numeralWrapper.format(res.dex, \"0.000\")}\n <br />\n Agility: x{numeralWrapper.format(res.agi, \"0.000\")}\n <br />\n Charisma: x{numeralWrapper.format(res.cha, \"0.000\")}\n <br />\n </>\n );\n props.onClose();\n }\n\n // const ascendBenefits = props.member.getAscensionResults();\n const preAscend = props.member.getCurrentAscensionMults();\n const postAscend = props.member.getAscensionMultsAfterAscend();\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Are you sure you want to ascend this member? They will lose all of\n <br />\n their non-Augmentation upgrades and their stats will reset back to 1.\n <br />\n <br />\n Furthermore, your gang will lose {numeralWrapper.formatRespect(props.member.earnedRespect)} respect\n <br />\n <br />\n In return, they will gain the following permanent boost to stat multipliers:\n <br />\n Hacking: x{numeralWrapper.format(preAscend.hack, \"0.000\")} => x\n {numeralWrapper.format(postAscend.hack, \"0.000\")}\n <br />\n Strength: x{numeralWrapper.format(preAscend.str, \"0.000\")} => x\n {numeralWrapper.format(postAscend.str, \"0.000\")}\n <br />\n Defense: x{numeralWrapper.format(preAscend.def, \"0.000\")} => x\n {numeralWrapper.format(postAscend.def, \"0.000\")}\n <br />\n Dexterity: x{numeralWrapper.format(preAscend.dex, \"0.000\")} => x\n {numeralWrapper.format(postAscend.dex, \"0.000\")}\n <br />\n Agility: x{numeralWrapper.format(preAscend.agi, \"0.000\")} => x\n {numeralWrapper.format(postAscend.agi, \"0.000\")}\n <br />\n Charisma: x{numeralWrapper.format(preAscend.cha, \"0.000\")} => x\n {numeralWrapper.format(postAscend.cha, \"0.000\")}\n <br />\n </Typography>\n <Button onClick={confirm}>Ascend</Button>\n </Modal>\n );\n}\n","/**\n * React Component for the recruitment button and text on the gang main page.\n */\nimport React, { useState } from \"react\";\nimport { RecruitModal } from \"./RecruitModal\";\nimport { GangConstants } from \"../data/Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n onRecruit: () => void;\n}\n\nexport function RecruitButton(props: IProps): React.ReactElement {\n const gang = useGang();\n const [open, setOpen] = useState(false);\n if (gang.members.length >= GangConstants.MaximumGangMembers) {\n return <></>;\n }\n\n if (!gang.canRecruitMember()) {\n const respect = gang.getRespectNeededToRecruitMember();\n return (\n <Box display=\"flex\" alignItems=\"center\" sx={{ mx: 1 }}>\n <Button disabled>\n Recruit Gang Member\n </Button>\n <Typography sx={{ ml: 1 }}>{numeralWrapper.formatRespect(respect)} respect needed to recruit next member</Typography>\n </Box>\n );\n }\n\n return (\n <>\n <Box sx={{ mx: 1 }}>\n <Button onClick={() => setOpen(true)}>Recruit Gang Member</Button>\n </Box>\n <RecruitModal open={open} onClose={() => setOpen(false)} onRecruit={props.onRecruit} />\n </>\n );\n}\n","/**\n * React Component for the popup used to recruit new gang members.\n */\nimport React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IRecruitPopupProps {\n open: boolean;\n onClose: () => void;\n onRecruit: () => void;\n}\n\nexport function RecruitModal(props: IRecruitPopupProps): React.ReactElement {\n const gang = useGang();\n const [name, setName] = useState(\"\");\n\n const disabled = name === \"\" || !gang.canRecruitMember();\n function recruit(): void {\n if (disabled) return;\n // At this point, the only way this can fail is if you already\n // have a gang member with the same name\n if (!gang.recruitMember(name)) {\n dialogBoxCreate(\"You already have a gang member with this name!\");\n return;\n }\n\n props.onRecruit();\n props.onClose();\n }\n\n function onKeyUp(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) recruit();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setName(event.target.value);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Enter a name for your new Gang member:</Typography>\n <br />\n <TextField\n autoFocus\n onKeyUp={onKeyUp}\n onChange={onChange}\n type=\"text\"\n placeholder=\"unique name\"\n InputProps={{\n endAdornment: (\n <Button disabled={disabled} onClick={recruit}>\n Recruit\n </Button>\n ),\n }}\n />\n </Modal>\n );\n}\n","/**\n * React Component for the territory subpage.\n */\nimport React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { AllGangs } from \"../AllGangs\";\nimport { useGang } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\n\nexport function TerritorySubpage(): React.ReactElement {\n const gang = useGang();\n const gangNames = Object.keys(AllGangs).filter((g) => g != gang.facName);\n\n return (\n <>\n <Typography>\n This page shows how much territory your Gang controls. This statistic is listed as a percentage, which\n represents how much of the total territory you control.\n <br />\n <br />\n Every ~20 seconds, your gang has a chance to 'clash' with other gangs. Your chance to win a clash depends on\n your gang's power, which is listed in the display below. Your gang's power slowly accumulates over time. The\n accumulation rate is determined by the stats of all Gang members you have assigned to the 'Territory Warfare'\n task. Gang members that are not assigned to this task do not contribute to your gang's power. Your gang also\n loses a small amount of power whenever you lose a clash.\n <br />\n <br />\n NOTE: Gang members assigned to 'Territory Warfare' can be killed during clashes. This can happen regardless of\n whether you win or lose the clash. A gang member being killed results in both respect and power loss for your\n gang.\n <br />\n <br />\n The amount of territory you have affects all aspects of your Gang members' production, including money, respect,\n and wanted level. It is very beneficial to have high territory control.\n <br />\n <br />\n To increase your chances of winning territory assign gang members to \"Territory Warfare\", this will build your\n gang power. Then enable \"Engage in Territory Warfare\" to start fighting over territory.\n </Typography>\n <FormControlLabel\n control={\n <Switch\n checked={gang.territoryWarfareEngaged}\n onChange={(event) => (gang.territoryWarfareEngaged = event.target.checked)}\n />\n }\n label={\n <Tooltip\n title={\n <Typography>\n Engaging in Territory Warfare sets your clash chance to 100%. Disengaging will cause your clash chance\n to gradually decrease until it reaches 0%.\n </Typography>\n }\n >\n <Typography>Engage in Territory Warfare</Typography>\n </Tooltip>\n }\n />\n <br />\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n This percentage represents the chance you have of 'clashing' with with another gang. If you do not wish to\n gain/lose territory, then keep this percentage at 0% by not engaging in territory warfare.\n </Typography>\n }\n >\n <Typography>\n Territory Clash Chance: {numeralWrapper.formatPercentage(gang.territoryClashChance, 3)}\n </Typography>\n </Tooltip>\n </Box>\n <br />\n <FormControlLabel\n control={\n <Switch\n checked={gang.notifyMemberDeath}\n onChange={(event) => (gang.notifyMemberDeath = event.target.checked)}\n />\n }\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then you will receive a pop-up notifying you whenever one of your Gang Members dies\n in a territory clash.\n </Typography>\n }\n >\n <Typography>Notify about Gang Member Deaths</Typography>\n </Tooltip>\n }\n />\n <br />\n <Paper>\n <Typography>\n <b>\n <u>{gang.facName}</u>\n </b>\n <br />\n Power: {formatNumber(AllGangs[gang.facName].power, 6)}\n <br />\n Territory: {formatTerritory(AllGangs[gang.facName].territory)}%\n <br />\n <br />\n </Typography>\n {gangNames.map((name) => (\n <OtherGangTerritory key={name} name={name} />\n ))}\n </Paper>\n </>\n );\n}\nfunction formatTerritory(n: number): string {\n const v = n * 100;\n if (v <= 0) {\n return formatNumber(0, 2);\n } else if (v >= 100) {\n return formatNumber(100, 2);\n } else {\n return formatNumber(v, 2);\n }\n}\n\ninterface ITerritoryProps {\n name: string;\n}\n\nfunction OtherGangTerritory(props: ITerritoryProps): React.ReactElement {\n const gang = useGang();\n const playerPower = AllGangs[gang.facName].power;\n const power = AllGangs[props.name].power;\n const clashVictoryChance = playerPower / (power + playerPower);\n return (\n <Typography>\n <u>{props.name}</u>\n <br />\n Power: {formatNumber(power, 6)}\n <br />\n Territory: {formatTerritory(AllGangs[props.name].territory)}%<br />\n Chance to win clash with this gang: {numeralWrapper.formatPercentage(clashVictoryChance, 3)}\n <br />\n <br />\n </Typography>\n );\n}\n","/**\n * React Component for the popup that manages gang members upgrades\n */\nimport React, { useState } from \"react\";\nimport { useGang } from \"./Context\";\nimport { generateTableRow } from \"./GangMemberStats\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { MenuItem, Table, TableBody, TextField } from \"@mui/material\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMemberUpgrades } from \"../GangMemberUpgrades\";\nimport { GangMemberUpgrade } from \"../GangMemberUpgrade\";\nimport { Money } from \"../../ui/React/Money\";\nimport { GangMember } from \"../GangMember\";\nimport { UpgradeType } from \"../data/upgrades\";\nimport { use } from \"../../ui/Context\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { characterOverviewStyles as useStyles } from \"../../ui/React/CharacterOverview\";\n\ninterface INextRevealProps {\n upgrades: string[];\n type: UpgradeType;\n}\n\nfunction NextReveal(props: INextRevealProps): React.ReactElement {\n const gang = useGang();\n const player = use.Player();\n const upgrades = Object.keys(GangMemberUpgrades)\n .filter((upgName: string) => {\n const upg = GangMemberUpgrades[upgName];\n if (player.money > gang.getUpgradeCost(upg)) return false;\n if (upg.type !== props.type) return false;\n if (props.upgrades.includes(upgName)) return false;\n return true;\n })\n .map((upgName: string) => GangMemberUpgrades[upgName]);\n\n if (upgrades.length === 0) return <></>;\n return (\n <Typography>\n Next at <Money money={upgrades[0].cost} />\n </Typography>\n );\n}\n\nfunction PurchasedUpgrade({ upgName }: { upgName: string }): React.ReactElement {\n const upg = GangMemberUpgrades[upgName];\n return (\n <Paper sx={{ p: 1 }}>\n <Tooltip title={<Typography dangerouslySetInnerHTML={{ __html: upg.desc }} />}>\n <Typography>{upg.name}</Typography>\n </Tooltip>\n </Paper>\n );\n}\n\ninterface IUpgradeButtonProps {\n upg: GangMemberUpgrade;\n rerender: () => void;\n member: GangMember;\n}\n\nfunction UpgradeButton(props: IUpgradeButtonProps): React.ReactElement {\n const gang = useGang();\n const player = use.Player();\n function onClick(): void {\n props.member.buyUpgrade(props.upg, player, gang);\n props.rerender();\n }\n return (\n <Tooltip title={<Typography dangerouslySetInnerHTML={{ __html: props.upg.desc }} />}>\n <span>\n <Button onClick={onClick} sx={{ display: 'flex', flexDirection: 'column', width: '100%', height: '100%' }}>\n <Typography sx={{ display: 'block' }}>{props.upg.name}</Typography>\n <Money money={gang.getUpgradeCost(props.upg)} />\n </Button>\n </span>\n </Tooltip>\n );\n}\n\ninterface IPanelProps {\n member: GangMember;\n}\n\nfunction GangMemberUpgradePanel(props: IPanelProps): React.ReactElement {\n const classes = useStyles();\n const gang = useGang();\n const player = use.Player();\n const setRerender = useState(false)[1];\n const [currentCategory, setCurrentCategory] = useState(\"Weapons\");\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function filterUpgrades(list: string[], type: UpgradeType): GangMemberUpgrade[] {\n return Object.keys(GangMemberUpgrades)\n .filter((upgName: string) => {\n const upg = GangMemberUpgrades[upgName];\n if (player.money < gang.getUpgradeCost(upg)) return false;\n if (upg.type !== type) return false;\n if (list.includes(upgName)) return false;\n return true;\n })\n .map((upgName: string) => GangMemberUpgrades[upgName]);\n }\n\n const onChange = (event: SelectChangeEvent<string>): void => {\n setCurrentCategory(event.target.value);\n rerender()\n }\n\n const weaponUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Weapon);\n const armorUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Armor);\n const vehicleUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Vehicle);\n const rootkitUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Rootkit);\n const augUpgrades = filterUpgrades(props.member.augmentations, UpgradeType.Augmentation);\n\n const categories: { [key: string]: (GangMemberUpgrade[] | UpgradeType)[] } = {\n 'Weapons': [weaponUpgrades, UpgradeType.Weapon],\n 'Armor': [armorUpgrades, UpgradeType.Armor],\n 'Vehicles': [vehicleUpgrades, UpgradeType.Vehicle],\n 'Rootkits': [rootkitUpgrades, UpgradeType.Rootkit],\n 'Augmentations': [augUpgrades, UpgradeType.Augmentation]\n };\n\n const asc = {\n hack: props.member.calculateAscensionMult(props.member.hack_asc_points),\n str: props.member.calculateAscensionMult(props.member.str_asc_points),\n def: props.member.calculateAscensionMult(props.member.def_asc_points),\n dex: props.member.calculateAscensionMult(props.member.dex_asc_points),\n agi: props.member.calculateAscensionMult(props.member.agi_asc_points),\n cha: props.member.calculateAscensionMult(props.member.cha_asc_points),\n };\n return (\n <Paper>\n <Box display=\"grid\" sx={{ gridTemplateColumns: '1fr 1fr', m: 1, gap: 1 }}>\n <span>\n <Typography variant=\"h5\" color=\"primary\">\n {props.member.name} ({props.member.task})\n </Typography>\n <Tooltip\n title={\n <Typography>\n Hk: x{numeralWrapper.formatMultiplier(props.member.hack_mult * asc.hack)}(x\n {numeralWrapper.formatMultiplier(props.member.hack_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.hack)}{\" \"}\n Asc)\n <br />\n St: x{numeralWrapper.formatMultiplier(props.member.str_mult * asc.str)}\n (x{numeralWrapper.formatMultiplier(props.member.str_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.str)}{\" \"}\n Asc)\n <br />\n Df: x{numeralWrapper.formatMultiplier(props.member.def_mult * asc.def)}\n (x{numeralWrapper.formatMultiplier(props.member.def_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.def)}{\" \"}\n Asc)\n <br />\n Dx: x{numeralWrapper.formatMultiplier(props.member.dex_mult * asc.dex)}\n (x{numeralWrapper.formatMultiplier(props.member.dex_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.dex)}{\" \"}\n Asc)\n <br />\n Ag: x{numeralWrapper.formatMultiplier(props.member.agi_mult * asc.agi)}\n (x{numeralWrapper.formatMultiplier(props.member.agi_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.agi)}{\" \"}\n Asc)\n <br />\n Ch: x{numeralWrapper.formatMultiplier(props.member.cha_mult * asc.cha)}\n (x{numeralWrapper.formatMultiplier(props.member.cha_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.cha)}{\" \"}\n Asc)\n </Typography>\n }\n >\n <Table>\n <TableBody>\n {generateTableRow(\"Hacking\", props.member.hack, props.member.hack_exp, Settings.theme.hack, classes)}\n {generateTableRow(\"Strength\", props.member.str, props.member.str_exp, Settings.theme.combat, classes)}\n {generateTableRow(\"Defense\", props.member.def, props.member.def_exp, Settings.theme.combat, classes)}\n {generateTableRow(\"Dexterity\", props.member.dex, props.member.dex_exp, Settings.theme.combat, classes)}\n {generateTableRow(\"Agility\", props.member.agi, props.member.agi_exp, Settings.theme.combat, classes)}\n {generateTableRow(\"Charisma\", props.member.cha, props.member.cha_exp, Settings.theme.cha, classes)}\n </TableBody>\n </Table>\n </Tooltip>\n\n </span>\n\n <span>\n <Select onChange={onChange} value={currentCategory} sx={{ width: '100%', mb: 1 }}>\n {Object.keys(categories).map((k, i) => (\n <MenuItem key={i + 1} value={k}>\n <Typography variant=\"h6\">{k}</Typography>\n </MenuItem>\n ))}\n </Select>\n\n <Box sx={{ width: '100%' }}>\n {(categories[currentCategory][0] as GangMemberUpgrade[]).length === 0 && (\n <Typography>\n All upgrades owned!\n </Typography>\n )}\n <Box display=\"grid\" sx={{ gridTemplateColumns: '1fr 1fr' }}>\n {(categories[currentCategory][0] as GangMemberUpgrade[]).map((upg) => (\n <UpgradeButton\n key={upg.name}\n rerender={rerender}\n member={props.member}\n upg={upg}\n />\n ))}\n </Box>\n <NextReveal\n type={categories[currentCategory][1] as UpgradeType}\n upgrades={props.member.upgrades}\n />\n </Box>\n </span>\n </Box>\n\n <Typography sx={{ mx: 1 }}>Purchased Upgrades: </Typography>\n <Box display=\"grid\" sx={{ gridTemplateColumns: 'repeat(4, 1fr)', m: 1 }}>\n {props.member.upgrades.map((upg: string) => (\n <PurchasedUpgrade key={upg} upgName={upg} />\n ))}\n {props.member.augmentations.map((upg: string) => (\n <PurchasedUpgrade key={upg} upgName={upg} />\n ))}\n </Box>\n </Paper >\n );\n}\n\nexport function EquipmentsSubpage(): React.ReactElement {\n const gang = useGang();\n const [filter, setFilter] = useState(\"\");\n\n\n const handleFilterChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setFilter(event.target.value.toLowerCase());\n }\n\n const members = gang.members\n .filter((member) => member && member.name.toLowerCase().includes(filter));\n\n return (\n <>\n <Tooltip\n title={\n <Typography>\n You get a discount on equipment and upgrades based on your gang's respect and power. More respect and power\n leads to more discounts.\n </Typography>\n }\n >\n <Typography sx={{ m: 1 }}>Discount: -{numeralWrapper.formatPercentage(1 - 1 / gang.getDiscount())}</Typography>\n </Tooltip>\n\n <TextField\n value={filter}\n onChange={handleFilterChange}\n autoFocus\n InputProps={{\n startAdornment: <SearchIcon />,\n spellCheck: false\n }}\n placeholder=\"Filter by member name\"\n sx={{ m: 1, width: '15%' }}\n />\n\n <Box display=\"grid\" sx={{ gridTemplateColumns: '1fr 1fr', width: 'fit-content' }}>\n {members.map((member: GangMember) => (\n <GangMemberUpgradePanel key={member.name} member={member} />\n ))}\n </Box>\n </>\n );\n}\n","// React Components for the Corporation UI's navigation tabs\n// These are the tabs at the top of the UI that let you switch to different\n// divisions, see an overview of your corporation, or create a new industry\nimport React, { useState, useEffect } from \"react\";\nimport { IIndustry } from \"../IIndustry\";\nimport { MainPanel } from \"./MainPanel\";\nimport { Industries } from \"../IndustryData\";\nimport { ExpandIndustryTab } from \"./ExpandIndustryTab\";\nimport { use } from \"../../ui/Context\";\nimport { Context } from \"./Context\";\nimport { Overview } from \"./Overview\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nexport function CorporationRoot(): React.ReactElement {\n const player = use.Player();\n const corporation = player.corporation;\n if (corporation === null) return <></>;\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const [divisionName, setDivisionName] = useState<string | number>(\"Overview\");\n function handleChange(event: React.SyntheticEvent, tab: string | number): void {\n setDivisionName(tab);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const canExpand =\n Object.keys(Industries).filter(\n (industryType: string) =>\n corporation.divisions.find((division: IIndustry) => division.type === industryType) === undefined,\n ).length > 0;\n\n return (\n <Context.Corporation.Provider value={corporation}>\n <Tabs variant=\"fullWidth\" value={divisionName} onChange={handleChange}>\n <Tab label={corporation.name} value={\"Overview\"} />\n {corporation.divisions.map((div) => (\n <Tab key={div.name} label={div.name} value={div.name} />\n ))}\n {canExpand && <Tab label={\"Expand\"} value={-1} />}\n </Tabs>\n {divisionName === \"Overview\" && <Overview rerender={rerender} />}\n {divisionName === -1 && <ExpandIndustryTab setDivisionName={setDivisionName} />}\n {typeof divisionName === \"string\" && divisionName !== \"Overview\" && (\n <MainPanel rerender={rerender} divisionName={divisionName + \"\"} />\n )}\n </Context.Corporation.Provider>\n );\n}\n","// React Component for the element that contains the actual info/data\n// for the Corporation UI. This panel lies below the header tabs and will\n// be filled with whatever is needed based on the routing/navigation\nimport React from \"react\";\n\nimport { CityTabs } from \"./CityTabs\";\nimport { IIndustry } from \"../IIndustry\";\nimport { Context, useCorporation } from \"./Context\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\n\ninterface IProps {\n divisionName: string;\n rerender: () => void;\n}\n\nexport function MainPanel(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division =\n props.divisionName !== \"Overview\"\n ? corp.divisions.find((division: IIndustry) => division.name === props.divisionName)\n : undefined; // use undefined because find returns undefined\n\n if (division === undefined) throw new Error(\"Cannot find division\");\n return (\n <Context.Division.Provider value={division}>\n <CityTabs rerender={props.rerender} city={CityName.Sector12} />\n </Context.Division.Provider>\n );\n}\n","// React Components for the Corporation UI's City navigation tabs\n// These allow player to navigate between different cities for each industry\nimport React, { useState } from \"react\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Industry } from \"./Industry\";\nimport { ExpandNewCity } from \"./ExpandNewCity\";\nimport { useDivision } from \"./Context\";\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\ninterface IProps {\n city: string;\n rerender: () => void;\n}\n\nexport function CityTabs(props: IProps): React.ReactElement {\n const division = useDivision();\n const [city, setCity] = useState(props.city);\n\n const office = division.offices[city];\n if (office === 0) {\n setCity(\"Sector-12\");\n return <></>;\n }\n\n const canExpand =\n Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] === 0).length > 0;\n function handleChange(event: React.SyntheticEvent, tab: string): void {\n setCity(tab);\n }\n return (\n <>\n <Tabs variant=\"fullWidth\" value={city} onChange={handleChange}>\n {Object.values(division.offices).map(\n (office: OfficeSpace | 0) => office !== 0 && <Tab key={office.loc} label={office.loc} value={office.loc} />,\n )}\n {canExpand && <Tab label={\"Expand\"} value={\"Expand\"} />}\n </Tabs>\n\n {city !== \"Expand\" ? (\n <Industry\n key={city}\n rerender={props.rerender}\n city={city}\n warehouse={division.warehouses[city]}\n office={office}\n />\n ) : (\n <ExpandNewCity cityStateSetter={setCity} />\n )}\n </>\n );\n}\n","// React Component for managing the Corporation's Industry UI\n// This Industry component does NOT include the city tabs at the top\nimport React from \"react\";\n\nimport { IndustryOffice } from \"./IndustryOffice\";\nimport { IndustryOverview } from \"./IndustryOverview\";\nimport { IndustryWarehouse } from \"./IndustryWarehouse\";\nimport { Warehouse } from \"../Warehouse\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n city: string;\n warehouse: Warehouse | 0;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function Industry(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const division = useDivision();\n return (\n <Box display=\"flex\">\n <Box sx={{ width: \"50%\" }}>\n <IndustryOverview rerender={props.rerender} currentCity={props.city} office={props.office} />\n <IndustryOffice rerender={props.rerender} office={props.office} />\n </Box>\n <Box sx={{ width: \"50%\" }}>\n <IndustryWarehouse\n rerender={props.rerender}\n player={player}\n corp={corp}\n currentCity={props.city}\n division={division}\n warehouse={props.warehouse}\n />\n </Box>\n </Box>\n );\n}\n","// React Component for displaying an Industry's OfficeSpace information\n// (bottom-left panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Employee } from \"../Employee\";\nimport { EmployeePositions } from \"../EmployeePositions\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { UpgradeOfficeSizeModal } from \"./UpgradeOfficeSizeModal\";\nimport { ThrowPartyModal } from \"./ThrowPartyModal\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Paper from \"@mui/material/Paper\";\nimport ArrowDropUpIcon from \"@mui/icons-material/ArrowDropUp\";\nimport ArrowDropDownIcon from \"@mui/icons-material/ArrowDropDown\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableRow from \"@mui/material/TableRow\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport { Box } from \"@mui/material\";\n\ninterface IProps {\n office: OfficeSpace;\n rerender: () => void;\n}\n\nfunction countEmployee(employees: Employee[], job: string): number {\n let n = 0;\n for (let i = 0; i < employees.length; ++i) {\n if (employees[i].pos === job) n++;\n }\n return n;\n}\n\ninterface ISwitchProps {\n manualMode: boolean;\n switchMode: (f: (b: boolean) => boolean) => void;\n}\n\nfunction SwitchButton(props: ISwitchProps): React.ReactElement {\n if (props.manualMode) {\n return (\n <Tooltip\n title={\n <Typography>\n Switch to Automatic Assignment Mode, which will automatically assign employees to your selected jobs. You\n simply have to select the number of assignments for each job\n </Typography>\n }\n >\n <Button onClick={() => props.switchMode((old) => !old)}>Switch to Auto Mode</Button>\n </Tooltip>\n );\n } else {\n return (\n <Tooltip\n title={\n <Typography>\n Switch to Manual Assignment Mode, which allows you to specify which employees should get which jobs\n </Typography>\n }\n >\n <Button onClick={() => props.switchMode((old) => !old)}>Switch to Manual Mode</Button>\n </Tooltip>\n );\n }\n}\n\nfunction ManualManagement(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [employee, setEmployee] = useState<Employee | null>(\n props.office.employees.length > 0 ? props.office.employees[0] : null,\n );\n\n // Employee Selector\n const employees = [];\n for (let i = 0; i < props.office.employees.length; ++i) {\n employees.push(\n <MenuItem key={props.office.employees[i].name} value={props.office.employees[i].name}>\n {props.office.employees[i].name}\n </MenuItem>,\n );\n }\n\n function employeeSelectorOnChange(e: SelectChangeEvent<string>): void {\n const name = e.target.value;\n for (let i = 0; i < props.office.employees.length; ++i) {\n if (name === props.office.employees[i].name) {\n setEmployee(props.office.employees[i]);\n break;\n }\n }\n\n props.rerender();\n }\n\n // Employee Positions Selector\n const emp = employee;\n let employeePositionSelectorInitialValue = \"\";\n const employeePositions = [];\n const positionNames = Object.values(EmployeePositions);\n for (let i = 0; i < positionNames.length; ++i) {\n employeePositions.push(\n <MenuItem key={positionNames[i]} value={positionNames[i]}>\n {positionNames[i]}\n </MenuItem>,\n );\n if (emp != null && emp.pos === positionNames[i]) {\n employeePositionSelectorInitialValue = positionNames[i];\n }\n }\n\n function employeePositionSelectorOnChange(e: SelectChangeEvent<string>): void {\n if (employee === null) return;\n employee.pos = e.target.value;\n props.rerender();\n }\n\n // Numeraljs formatter\n const nf = \"0.000\";\n\n // Employee stats (after applying multipliers)\n const effCre = emp ? emp.cre * corp.getEmployeeCreMultiplier() * division.getEmployeeCreMultiplier() : 0;\n const effCha = emp ? emp.cha * corp.getEmployeeChaMultiplier() * division.getEmployeeChaMultiplier() : 0;\n const effInt = emp ? emp.int * corp.getEmployeeIntMultiplier() * division.getEmployeeIntMultiplier() : 0;\n const effEff = emp ? emp.eff * corp.getEmployeeEffMultiplier() * division.getEmployeeEffMultiplier() : 0;\n\n return (\n <>\n <br />\n <Select value={employee !== null ? employee.name : \"\"} onChange={employeeSelectorOnChange}>\n {employees}\n </Select>\n {employee != null && (\n <Typography>\n Morale: {numeralWrapper.format(employee.mor, nf)}\n <br />\n Happiness: {numeralWrapper.format(employee.hap, nf)}\n <br />\n Energy: {numeralWrapper.format(employee.ene, nf)}\n <br />\n Intelligence: {numeralWrapper.format(effInt, nf)}\n <br />\n Charisma: {numeralWrapper.format(effCha, nf)}\n <br />\n Experience: {numeralWrapper.format(employee.exp, nf)}\n <br />\n Creativity: {numeralWrapper.format(effCre, nf)}\n <br />\n Efficiency: {numeralWrapper.format(effEff, nf)}\n <br />\n Salary: <Money money={employee.sal} />\n </Typography>\n )}\n {employee != null && (\n <Select onChange={employeePositionSelectorOnChange} value={employeePositionSelectorInitialValue}>\n {employeePositions}\n </Select>\n )}\n </>\n );\n}\n\ninterface IAutoAssignProps {\n office: OfficeSpace;\n job: string;\n desc: string;\n rerender: () => void;\n}\n\nfunction AutoAssignJob(props: IAutoAssignProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const numJob = countEmployee(props.office.employees, props.job);\n const numUnassigned = countEmployee(props.office.employees, EmployeePositions.Unassigned);\n function assignEmployee(): void {\n if (numUnassigned <= 0) {\n console.warn(\"Cannot assign employee. No unassigned employees available\");\n return;\n }\n\n props.office.assignEmployeeToJob(props.job);\n props.office.calculateEmployeeProductivity(corp, division);\n props.rerender();\n }\n\n function unassignEmployee(): void {\n props.office.unassignEmployeeFromJob(props.job);\n props.office.calculateEmployeeProductivity(corp, division);\n props.rerender();\n }\n return (\n <TableRow>\n <TableCell>\n <Tooltip title={props.desc}>\n <Typography>\n {props.job} ({numJob})\n </Typography>\n </Tooltip>\n </TableCell>\n <TableCell>\n <IconButton disabled={numUnassigned === 0} onClick={assignEmployee}>\n <ArrowDropUpIcon />\n </IconButton>\n <IconButton disabled={numJob === 0} onClick={unassignEmployee}>\n <ArrowDropDownIcon />\n </IconButton>\n </TableCell>\n </TableRow>\n );\n}\n\nfunction AutoManagement(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const numUnassigned = countEmployee(props.office.employees, EmployeePositions.Unassigned);\n const vechain = corp.unlockUpgrades[4] === 1; // Has Vechain upgrade\n\n // Calculate average morale, happiness, energy, and salary.\n let totalMorale = 0,\n totalHappiness = 0,\n totalEnergy = 0,\n totalSalary = 0;\n for (let i = 0; i < props.office.employees.length; ++i) {\n totalMorale += props.office.employees[i].mor;\n totalHappiness += props.office.employees[i].hap;\n totalEnergy += props.office.employees[i].ene;\n totalSalary += props.office.employees[i].sal;\n }\n\n let avgMorale = 0,\n avgHappiness = 0,\n avgEnergy = 0;\n if (props.office.employees.length > 0) {\n avgMorale = totalMorale / props.office.employees.length;\n avgHappiness = totalHappiness / props.office.employees.length;\n avgEnergy = totalEnergy / props.office.employees.length;\n }\n\n return (\n <>\n <Table padding=\"none\">\n <TableBody>\n <TableRow>\n <TableCell>\n <Typography>Unassigned Employees:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{numUnassigned}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Avg Employee Morale:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{numeralWrapper.format(avgMorale, \"0.000\")}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Avg Employee Happiness:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{numeralWrapper.format(avgHappiness, \"0.000\")}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Avg Employee Energy:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{numeralWrapper.format(avgEnergy, \"0.000\")}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Total Employee Salary:</Typography>\n </TableCell>\n <TableCell>\n <Typography>\n <Money money={totalSalary} />\n </Typography>\n </TableCell>\n </TableRow>\n {vechain && (\n <>\n <TableRow>\n <TableCell>\n <Tooltip\n title={\n <Typography>\n The base amount of material this office can produce. Does not include production multipliers\n from upgrades and materials. This value is based off the productivity of your Operations,\n Engineering, and Management employees\n </Typography>\n }\n >\n <Typography>Material Production:</Typography>\n </Tooltip>\n </TableCell>\n <TableCell>\n <Typography>\n {numeralWrapper.format(division.getOfficeProductivity(props.office), \"0.000\")}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Tooltip\n title={\n <Typography>\n The base amount of any given Product this office can produce. Does not include production\n multipliers from upgrades and materials. This value is based off the productivity of your\n Operations, Engineering, and Management employees\n </Typography>\n }\n >\n <Typography>Product Production:</Typography>\n </Tooltip>\n </TableCell>\n <TableCell>\n <Typography>\n {numeralWrapper.format(\n division.getOfficeProductivity(props.office, {\n forProduct: true,\n }),\n \"0.000\",\n )}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Tooltip\n title={<Typography>The effect this office's 'Business' employees has on boosting sales</Typography>}\n >\n <Typography> Business Multiplier:</Typography>\n </Tooltip>\n </TableCell>\n <TableCell>\n <Typography>x{numeralWrapper.format(division.getBusinessFactor(props.office), \"0.000\")}</Typography>\n </TableCell>\n </TableRow>\n </>\n )}\n </TableBody>\n </Table>\n\n <Table padding=\"none\">\n <TableBody>\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.Operations}\n desc={\"Manages supply chain operations. Improves the amount of Materials and Products you produce.\"}\n />\n\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.Engineer}\n desc={\n \"Develops and maintains products and production systems. Increases the quality of everything you produce. Also increases the amount you produce (not as much as Operations, however)\"\n }\n />\n\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.Business}\n desc={\"Handles sales and finances. Improves the amount of Materials and Products you can sell.\"}\n />\n\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.Management}\n desc={\n \"Leads and oversees employees and office operations. Improves the effectiveness of Engineer and Operations employees.\"\n }\n />\n\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.RandD}\n desc={\"Research new innovative ways to improve the company. Generates Scientific Research.\"}\n />\n\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n job={EmployeePositions.Training}\n desc={\n \"Set employee to training, which will increase some of their stats. Employees in training do not affect any company operations.\"\n }\n />\n </TableBody>\n </Table>\n </>\n );\n}\n\nexport function IndustryOffice(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [upgradeOfficeSizeOpen, setUpgradeOfficeSizeOpen] = useState(false);\n const [throwPartyOpen, setThrowPartyOpen] = useState(false);\n const [employeeManualAssignMode, setEmployeeManualAssignMode] = useState(false);\n\n function autohireEmployeeButtonOnClick(): void {\n if (props.office.atCapacity()) return;\n props.office.hireRandomEmployee();\n props.rerender();\n }\n\n return (\n <Paper>\n <Typography>Office Space</Typography>\n <Typography>\n Size: {props.office.employees.length} / {props.office.size} employees\n </Typography>\n <Box sx={{ display: 'grid', gridTemplateColumns: '1fr', width: 'fit-content' }}>\n <Box sx={{ gridTemplateColumns: 'repeat(3, 1fr)' }}>\n <Tooltip title={<Typography>Automatically hires an employee and gives him/her a random name</Typography>}>\n <Button disabled={props.office.atCapacity()} onClick={autohireEmployeeButtonOnClick}>\n Hire Employee\n </Button>\n </Tooltip>\n <Tooltip title={<Typography>Upgrade the office's size so that it can hold more employees!</Typography>}>\n <Button disabled={corp.funds < 0} onClick={() => setUpgradeOfficeSizeOpen(true)}>\n Upgrade size\n </Button>\n </Tooltip>\n <UpgradeOfficeSizeModal\n rerender={props.rerender}\n office={props.office}\n open={upgradeOfficeSizeOpen}\n onClose={() => setUpgradeOfficeSizeOpen(false)}\n />\n\n {!division.hasResearch(\"AutoPartyManager\") && (\n <>\n <Tooltip\n title={<Typography>Throw an office party to increase your employee's morale and happiness</Typography>}\n >\n <Button disabled={corp.funds < 0} onClick={() => setThrowPartyOpen(true)}>\n Throw Party\n </Button>\n </Tooltip>\n <ThrowPartyModal\n rerender={props.rerender}\n office={props.office}\n open={throwPartyOpen}\n onClose={() => setThrowPartyOpen(false)}\n />\n </>\n )}\n\n </Box>\n <SwitchButton manualMode={employeeManualAssignMode} switchMode={setEmployeeManualAssignMode} />\n </Box>\n {employeeManualAssignMode ? (\n <ManualManagement rerender={props.rerender} office={props.office} />\n ) : (\n <AutoManagement rerender={props.rerender} office={props.office} />\n )}\n </Paper>\n );\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { ICorporation } from \"../ICorporation\";\nimport { UpgradeOfficeSize } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ninterface IUpgradeButton {\n cost: number;\n size: number;\n corp: ICorporation;\n office: OfficeSpace;\n onClose: () => void;\n rerender: () => void;\n}\n\nfunction UpgradeSizeButton(props: IUpgradeButton): React.ReactElement {\n const corp = useCorporation();\n function upgradeSize(cost: number, size: number): void {\n if (corp.funds < cost) {\n return;\n }\n\n UpgradeOfficeSize(corp, props.office, size);\n props.rerender();\n props.onClose();\n }\n return (\n <Tooltip title={numeralWrapper.formatMoney(props.cost)}>\n <span>\n <Button disabled={corp.funds < props.cost} onClick={() => upgradeSize(props.cost, props.size)}>\n +{props.size}\n </Button>\n </span>\n </Tooltip>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function UpgradeOfficeSizeModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const initialPriceMult = Math.round(props.office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n const upgradeCost = CorporationConstants.OfficeInitialCost * Math.pow(costMultiplier, initialPriceMult);\n\n // Calculate cost to upgrade size by 15 employees\n let mult = 0;\n for (let i = 0; i < 5; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n const upgradeCost15 = CorporationConstants.OfficeInitialCost * mult;\n\n //Calculate max upgrade size and cost\n const maxMult = corp.funds / CorporationConstants.OfficeInitialCost;\n let maxNum = 1;\n mult = Math.pow(costMultiplier, initialPriceMult);\n while (maxNum < 50) {\n //Hard cap of 50x (extra 150 employees)\n if (mult >= maxMult) break;\n const multIncrease = Math.pow(costMultiplier, initialPriceMult + maxNum);\n if (mult + multIncrease > maxMult) {\n break;\n } else {\n mult += multIncrease;\n }\n ++maxNum;\n }\n const upgradeCostMax = CorporationConstants.OfficeInitialCost * mult;\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Increase the size of your office space to fit additional employees!</Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>Upgrade size: </Typography>\n <UpgradeSizeButton\n onClose={props.onClose}\n rerender={props.rerender}\n office={props.office}\n corp={corp}\n cost={upgradeCost}\n size={CorporationConstants.OfficeInitialSize}\n />\n <UpgradeSizeButton\n onClose={props.onClose}\n rerender={props.rerender}\n office={props.office}\n corp={corp}\n cost={upgradeCost15}\n size={CorporationConstants.OfficeInitialSize * 5}\n />\n <UpgradeSizeButton\n onClose={props.onClose}\n rerender={props.rerender}\n office={props.office}\n corp={corp}\n cost={upgradeCostMax}\n size={maxNum * CorporationConstants.OfficeInitialSize}\n />\n </Box>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { ThrowParty } from \"../Actions\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function ThrowPartyModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [cost, setCost] = useState(0);\n\n const totalCost = cost * props.office.employees.length;\n const canParty = corp.funds >= totalCost;\n function changeCost(event: React.ChangeEvent<HTMLInputElement>): void {\n let x = parseFloat(event.target.value);\n if (isNaN(x)) x = 0;\n setCost(x);\n }\n\n function throwParty(): void {\n if (cost === null || isNaN(cost) || cost < 0) {\n dialogBoxCreate(\"Invalid value entered\");\n } else {\n if (!canParty) {\n dialogBoxCreate(\"You don't have enough company funds to throw a party!\");\n } else {\n const mult = ThrowParty(corp, props.office, cost);\n dialogBoxCreate(\n \"You threw a party for the office! The morale and happiness \" +\n \"of each employee increased by \" +\n numeralWrapper.formatPercentage(mult - 1),\n );\n props.rerender();\n props.onClose();\n }\n }\n }\n\n function EffectText(): React.ReactElement {\n if (isNaN(cost) || cost < 0) return <Typography>Invalid value entered!</Typography>;\n return (\n <Typography>\n Throwing this party will cost a total of <Money money={totalCost} />\n </Typography>\n );\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) throwParty();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Enter the amount of money you would like to spend PER EMPLOYEE on this office party</Typography>\n <EffectText />\n <Box display=\"flex\" alignItems=\"center\">\n <TextField\n autoFocus={true}\n type=\"number\"\n placeholder=\"$ / employee\"\n value={cost}\n onChange={changeCost}\n onKeyDown={onKeyDown}\n />\n <Button disabled={!canParty} onClick={throwParty}>\n Throw Party\n </Button>\n </Box>\n </Modal>\n );\n}\n","// React Component for displaying an Industry's overview information\n// (top-left panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Industries } from \"../IndustryData\";\nimport { IndustryUpgrades } from \"../IndustryUpgrades\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { MakeProductModal } from \"./MakeProductModal\";\nimport { ResearchModal } from \"./ResearchModal\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport IconButton from \"@mui/material/IconButton\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport Box from \"@mui/material/Box\";\n\nfunction MakeProductButton(): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [makeOpen, setMakeOpen] = useState(false);\n\n const hasMaxProducts = division.hasMaximumNumberProducts();\n\n function shouldFlash(): boolean {\n return Object.keys(division.products).length === 0;\n }\n\n let createProductButtonText = \"\";\n switch (division.type) {\n case Industries.Food:\n createProductButtonText = \"Build Restaurant\";\n break;\n case Industries.Tobacco:\n createProductButtonText = \"Create Product\";\n break;\n case Industries.Pharmaceutical:\n createProductButtonText = \"Create Drug\";\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductButtonText = \"Create Product\";\n break;\n case Industries.Robotics:\n createProductButtonText = \"Design Robot\";\n break;\n case Industries.Software:\n createProductButtonText = \"Develop Software\";\n break;\n case Industries.Healthcare:\n createProductButtonText = \"Build Hospital\";\n break;\n case Industries.RealEstate:\n createProductButtonText = \"Develop Property\";\n break;\n default:\n createProductButtonText = \"Create Product\";\n return <></>;\n }\n\n return (\n <>\n <Tooltip\n title={\n hasMaxProducts ? (\n <Typography>\n You have reached the maximum number of products: {division.getMaximumNumberProducts()}\n </Typography>\n ) : (\n \"\"\n )\n }\n >\n <Button color={shouldFlash() ? \"error\" : \"primary\"} onClick={() => setMakeOpen(true)} disabled={corp.funds < 0}>\n {createProductButtonText}\n </Button>\n </Tooltip>\n <MakeProductModal open={makeOpen} onClose={() => setMakeOpen(false)} />\n </>\n );\n}\nfunction Text(): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [helpOpen, setHelpOpen] = useState(false);\n const [researchOpen, setResearchOpen] = useState(false);\n const vechain = corp.unlockUpgrades[4] === 1;\n const profit = division.lastCycleRevenue - division.lastCycleExpenses;\n\n let advertisingInfo = false;\n const advertisingFactors = division.getAdvertisingFactors();\n const awarenessFac = advertisingFactors[1];\n const popularityFac = advertisingFactors[2];\n const ratioFac = advertisingFactors[3];\n const totalAdvertisingFac = advertisingFactors[0];\n if (vechain) {\n advertisingInfo = true;\n }\n\n function convertEffectFacToGraphic(fac: number): string {\n return createProgressBarText({\n progress: fac,\n totalTicks: 20,\n });\n }\n\n return (\n <>\n <Typography>\n Industry: {division.type} (Corp Funds: <Money money={corp.funds} />)\n </Typography>\n <br />\n <StatsTable\n rows={[\n [\"Awareness:\", numeralWrapper.format(division.awareness, \"0.000\")],\n [\"Popularity:\", numeralWrapper.format(division.popularity, \"0.000\")],\n ]}\n />\n {advertisingInfo !== false && (\n <Tooltip\n title={\n <>\n <Typography>Total multiplier for this industrys sales due to its awareness and popularity</Typography>\n <StatsTable\n rows={[\n [\"Awareness Bonus:\", \"x\" + numeralWrapper.format(Math.pow(awarenessFac, 0.85), \"0.000\")],\n [\"Popularity Bonus:\", \"x\" + numeralWrapper.format(Math.pow(popularityFac, 0.85), \"0.000\")],\n [\"Ratio Multiplier:\", \"x\" + numeralWrapper.format(Math.pow(ratioFac, 0.85), \"0.000\")],\n ]}\n />\n </>\n }\n >\n <Typography>Advertising Multiplier: x{numeralWrapper.format(totalAdvertisingFac, \"0.000\")}</Typography>\n </Tooltip>\n )}\n <br />\n <StatsTable\n rows={[\n [\"Revenue:\", <MoneyRate money={division.lastCycleRevenue} />],\n [\"Expenses:\", <MoneyRate money={division.lastCycleExpenses} />],\n [\"Profit:\", <MoneyRate money={profit} />],\n ]}\n />\n <br />\n <Box display=\"flex\" alignItems=\"center\">\n <Tooltip\n title={\n <Typography>\n Production gain from owning production-boosting materials such as hardware, Robots, AI Cores, and Real\n Estate.\n </Typography>\n }\n >\n <Typography>Production Multiplier: {numeralWrapper.format(division.prodMult, \"0.00\")}</Typography>\n </Tooltip>\n <IconButton onClick={() => setHelpOpen(true)}>\n <HelpIcon />\n </IconButton>\n <StaticModal open={helpOpen} onClose={() => setHelpOpen(false)}>\n <Typography>\n Owning Hardware, Robots, AI Cores, and Real Estate can boost your Industry's production. The effect these\n materials have on your production varies between Industries. For example, Real Estate may be very effective\n for some Industries, but ineffective for others.\n <br />\n <br />\n This division's production multiplier is calculated by summing the individual production multiplier of each\n of its office locations. This production multiplier is applied to each office. Therefore, it is beneficial\n to expand into new cities as this can greatly increase the production multiplier of your entire Division.\n <br />\n <br />\n Below are approximations for how effective each material is at boosting this industry's production\n multiplier (Bigger bars = more effective):\n <br />\n <br />\n Hardware: {convertEffectFacToGraphic(division.hwFac)}\n <br />\n Robots: {convertEffectFacToGraphic(division.robFac)}\n <br />\n AI Cores: {convertEffectFacToGraphic(division.aiFac)}\n <br />\n Real Estate: {convertEffectFacToGraphic(division.reFac)}\n </Typography>\n </StaticModal>\n </Box>\n\n <Box display=\"flex\" alignItems=\"center\">\n <Tooltip\n title={\n <Typography>\n Scientific Research increases the quality of the materials and products that you produce.\n </Typography>\n }\n >\n <Typography>Scientific Research: {numeralWrapper.format(division.sciResearch.qty, \"0.000a\")}</Typography>\n </Tooltip>\n <Button sx={{ mx: 1 }} onClick={() => setResearchOpen(true)}>\n Research\n </Button>\n <ResearchModal open={researchOpen} onClose={() => setResearchOpen(false)} industry={division} />\n </Box>\n </>\n );\n}\n\nfunction Upgrades(props: { office: OfficeSpace; rerender: () => void }): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const upgrades = [];\n for (const index of Object.keys(IndustryUpgrades)) {\n const upgrade = IndustryUpgrades[index];\n\n // AutoBrew research disables the Coffee upgrade\n if (division.hasResearch(\"AutoBrew\") && upgrade[4] === \"Coffee\") {\n continue;\n }\n\n const i = upgrade[0];\n const baseCost = upgrade[1];\n const priceMult = upgrade[2];\n let cost = 0;\n switch (i) {\n case 0: //Coffee, cost is static per employee\n cost = props.office.employees.length * baseCost;\n break;\n default:\n cost = baseCost * Math.pow(priceMult, division.upgrades[i]);\n break;\n }\n\n function onClick(): void {\n if (corp.funds < cost) return;\n corp.funds = corp.funds - cost;\n division.upgrade(upgrade, {\n corporation: corp,\n office: props.office,\n });\n props.rerender();\n }\n\n upgrades.push(\n <Tooltip key={index} title={upgrade[5]}>\n <span>\n <Button disabled={corp.funds < cost} onClick={onClick}>\n {upgrade[4]} - \n <MoneyCost money={cost} corp={corp} />\n </Button>\n </span>\n </Tooltip>,\n );\n }\n\n return <>{upgrades}</>;\n}\n\ninterface IProps {\n currentCity: string;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function IndustryOverview(props: IProps): React.ReactElement {\n const division = useDivision();\n\n return (\n <Paper>\n <Text />\n <br />\n <Typography>Purchases & Upgrades</Typography>\n <Upgrades office={props.office} rerender={props.rerender} /> <br />\n {division.makesProducts && <MakeProductButton />}\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Industries } from \"../IndustryData\";\nimport { MakeProduct } from \"../Actions\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nfunction productPlaceholder(tpe: string): string {\n if (tpe === Industries.Food) {\n return \"Restaurant Name\";\n } else if (tpe === Industries.Healthcare) {\n return \"Hospital Name\";\n } else if (tpe === Industries.RealEstate) {\n return \"Property Name\";\n }\n return \"Product Name\";\n}\n\n// Create a popup that lets the player create a product for their current industry\nexport function MakeProductModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const allCities = Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] !== 0);\n const [city, setCity] = useState(allCities.length > 0 ? allCities[0] : \"\");\n const [name, setName] = useState(\"\");\n const [design, setDesign] = useState<number | null>(null);\n const [marketing, setMarketing] = useState<number | null>(null);\n if (division.hasMaximumNumberProducts()) return <></>;\n\n let createProductPopupText = <></>;\n switch (division.type) {\n case Industries.Food:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Build and manage a new restaurant!\n </>\n );\n break;\n case Industries.Tobacco:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Create a new tobacco product!\n </>\n );\n break;\n case Industries.Pharmaceutical:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Design and develop a new pharmaceutical drug!\n </>\n );\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Design and manufacture a new computer hardware product!\n </>\n );\n break;\n case Industries.Robotics:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Design and create a new robot or robotic system!\n </>\n );\n break;\n case Industries.Software:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Develop a new piece of software!\n </>\n );\n break;\n case Industries.Healthcare:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Build and manage a new hospital!\n </>\n );\n break;\n case Industries.RealEstate:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Develop a new piece of real estate property!\n </>\n );\n break;\n default:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Create a new product!\n </>\n );\n return <></>;\n }\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n <br />\n To begin developing a product, first choose the city in which it will be designed. The stats of your employees in\n the selected city affect the properties of the finished product, such as its quality, performance, and durability.\n <br />\n <br />\n You can also choose to invest money in the design and marketing of the product. Investing money in its design will\n result in a superior product. Investing money in marketing the product will help the product's sales.\n </>\n );\n\n function makeProduct(): void {\n if (design === null || marketing === null) return;\n try {\n MakeProduct(corp, division, city, name, design, marketing);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onCityChange(event: SelectChangeEvent<string>): void {\n setCity(event.target.value);\n }\n\n function onProductNameChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setName(event.target.value);\n }\n\n function onDesignChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setDesign(null);\n else setDesign(parseFloat(event.target.value));\n }\n\n function onMarketingChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setMarketing(null);\n else setMarketing(parseFloat(event.target.value));\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) makeProduct();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>{createProductPopupText}</Typography>\n <Select style={{ margin: \"5px\" }} onChange={onCityChange} defaultValue={city}>\n {allCities.map((cityName: string) => (\n <MenuItem key={cityName} value={cityName}>\n {cityName}\n </MenuItem>\n ))}\n </Select>\n <TextField onChange={onProductNameChange} placeholder={productPlaceholder(division.type)} />\n <br />\n <TextField onChange={onDesignChange} autoFocus={true} type=\"number\" placeholder={\"Design investment\"} />\n <TextField\n onChange={onMarketingChange}\n onKeyDown={onKeyDown}\n type=\"number\"\n placeholder={\"Marketing investment\"}\n />\n <Button onClick={makeProduct}>Develop Product</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { IndustryResearchTrees } from \"../IndustryData\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { IIndustry } from \"../IIndustry\";\nimport { Research } from \"../Actions\";\nimport { Node } from \"../ResearchTree\";\nimport { ResearchMap } from \"../ResearchMap\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport CheckIcon from '@mui/icons-material/Check';\n\ninterface INodeProps {\n n: Node | null;\n division: IIndustry;\n}\nfunction Upgrade({ n, division }: INodeProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n if (n === null) return <></>;\n const r = ResearchMap[n.text];\n let disabled = division.sciResearch.qty < r.cost || n.researched;\n const parent = n.parent;\n if (parent !== null) {\n disabled = disabled || !parent.researched;\n }\n\n function research(): void {\n if (n === null || disabled) return;\n try {\n Research(division, n.text);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n dialogBoxCreate(\n `Researched ${n.text}. It may take a market cycle ` +\n `(~${CorporationConstants.SecsPerMarketCycle} seconds) before the effects of ` +\n `the Research apply.`,\n );\n }\n\n let color: \"primary\" | \"info\" = \"primary\";\n if (n.researched) {\n color = \"info\";\n }\n\n const wrapInTooltip = (ele: React.ReactElement): React.ReactElement => {\n return (\n <Tooltip\n title={\n <Typography>\n Research points: {r.cost}\n <br />\n {r.desc}\n </Typography>\n }\n >\n {ele}\n </Tooltip>\n )\n }\n\n const but = (\n <Box>\n {wrapInTooltip(\n <span>\n <Button color={color} disabled={disabled && !n.researched} onClick={research}\n style={{ width: '100%', textAlign: 'left', justifyContent: 'unset' }}\n >\n {n.researched && (<CheckIcon sx={{ mr: 1 }} />)}{n.text}\n </Button>\n </span>\n )}\n </Box>\n );\n\n if (n.children.length === 0) return but;\n\n return (\n <Box>\n <Box display=\"flex\" sx={{ border: '1px solid ' + Settings.theme.well }}>\n {wrapInTooltip(\n <span style={{ width: '100%' }}>\n <Button color={color} disabled={disabled && !n.researched} onClick={research} sx={{\n width: '100%',\n textAlign: 'left',\n justifyContent: 'unset',\n borderColor: Settings.theme.button\n }}>\n {n.researched && (<CheckIcon sx={{ mr: 1 }} />)}{n.text}\n </Button>\n </span>\n )}\n <Button onClick={() => setOpen((old) => !old)} sx={{ borderColor: Settings.theme.button, minWidth: 'fit-content' }}>\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </Button>\n </Box>\n <Collapse in={open} unmountOnExit>\n <Box m={1}>\n {n.children.map((m) => (\n <Upgrade key={m.text} division={division} n={m} />\n ))}\n </Box>\n </Collapse>\n </Box>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n industry: IIndustry;\n}\n\n// Create the Research Tree UI for this Industry\nexport function ResearchModal(props: IProps): React.ReactElement {\n const researchTree = IndustryResearchTrees[props.industry.type];\n if (researchTree === undefined) return <></>;\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Upgrade division={props.industry} n={researchTree.root} />\n <Typography sx={{ mt: 1 }}>\n Research points: {props.industry.sciResearch.qty.toFixed(3)}\n <br />\n Multipliers from research:\n <br />* Advertising Multiplier: x{researchTree.getAdvertisingMultiplier()}\n <br />* Employee Charisma Multiplier: x{researchTree.getEmployeeChaMultiplier()}\n <br />* Employee Creativity Multiplier: x{researchTree.getEmployeeCreMultiplier()}\n <br />* Employee Efficiency Multiplier: x{researchTree.getEmployeeEffMultiplier()}\n <br />* Employee Intelligence Multiplier: x{researchTree.getEmployeeIntMultiplier()}\n <br />* Production Multiplier: x{researchTree.getProductionMultiplier()}\n <br />* Sales Multiplier: x{researchTree.getSalesMultiplier()}\n <br />* Scientific Research Multiplier: x{researchTree.getScientificResearchMultiplier()}\n <br />* Storage Multiplier: x{researchTree.getStorageMultiplier()}\n </Typography>\n </Modal>\n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Material } from \"../Material\";\nimport { Product } from \"../Product\";\nimport { Warehouse } from \"../Warehouse\";\nimport { SmartSupplyModal } from \"./SmartSupplyModal\";\nimport { ProductElem } from \"./ProductElem\";\nimport { MaterialElem } from \"./MaterialElem\";\nimport { MaterialSizes } from \"../MaterialSizes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { isRelevantMaterial } from \"./Helpers\";\nimport { IndustryProductEquation } from \"./IndustryProductEquation\";\nimport { PurchaseWarehouse } from \"../Actions\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n corp: ICorporation;\n division: IIndustry;\n warehouse: Warehouse | 0;\n currentCity: string;\n player: IPlayer;\n rerender: () => void;\n}\n\nfunction WarehouseRoot(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [smartSupplyOpen, setSmartSupplyOpen] = useState(false);\n if (props.warehouse === 0) return <></>;\n\n // Upgrade Warehouse size button\n const sizeUpgradeCost = CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, props.warehouse.level + 1);\n const canAffordUpgrade = corp.funds > sizeUpgradeCost;\n function upgradeWarehouseOnClick(): void {\n if (division === null) return;\n if (props.warehouse === 0) return;\n if (!canAffordUpgrade) return;\n ++props.warehouse.level;\n props.warehouse.updateSize(corp, division);\n corp.funds = corp.funds - sizeUpgradeCost;\n props.rerender();\n }\n\n // Current State:\n let stateText;\n switch (division.state) {\n case \"START\":\n stateText = \"Current state: Preparing...\";\n break;\n case \"PURCHASE\":\n stateText = \"Current state: Purchasing materials...\";\n break;\n case \"PRODUCTION\":\n stateText = \"Current state: Producing materials and/or products...\";\n break;\n case \"SALE\":\n stateText = \"Current state: Selling materials and/or products...\";\n break;\n case \"EXPORT\":\n stateText = \"Current state: Exporting materials and/or products...\";\n break;\n default:\n console.error(`Invalid state: ${division.state}`);\n break;\n }\n\n // Create React components for materials\n const mats = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n if (!(props.warehouse.materials[matName] instanceof Material)) continue;\n // Only create UI for materials that are relevant for the industry\n if (!isRelevantMaterial(matName, division)) continue;\n mats.push(\n <MaterialElem\n rerender={props.rerender}\n city={props.currentCity}\n key={matName}\n mat={props.warehouse.materials[matName]}\n warehouse={props.warehouse}\n />,\n );\n }\n\n // Create React components for products\n const products = [];\n if (division.makesProducts && Object.keys(division.products).length > 0) {\n for (const productName of Object.keys(division.products)) {\n const product = division.products[productName];\n if (!(product instanceof Product)) continue;\n products.push(\n <ProductElem rerender={props.rerender} city={props.currentCity} key={productName} product={product} />,\n );\n }\n }\n\n const breakdownItems: JSX.Element[] = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n const mat = props.warehouse.materials[matName];\n if (!MaterialSizes.hasOwnProperty(matName)) continue;\n if (mat.qty === 0) continue;\n breakdownItems.push(<>{matName}: {numeralWrapper.format(mat.qty * MaterialSizes[matName], \"0,0.0\")}</>);\n }\n\n for (const prodName of Object.keys(division.products)) {\n const prod = division.products[prodName];\n if (prod === undefined) continue;\n breakdownItems.push(<>{prodName}: {numeralWrapper.format(prod.data[props.warehouse.loc][0] * prod.siz, \"0,0.0\")}</>);\n }\n\n let breakdown;\n if (breakdownItems && breakdownItems.length > 0) {\n breakdown = breakdownItems.reduce(\n (previous: JSX.Element, current: JSX.Element): JSX.Element => previous && <>{previous}<br />{current}</> || <>{current}</>);\n } else {\n breakdown = <>No items in storage.</>\n }\n\n return (\n <Paper>\n <Box display=\"flex\" alignItems=\"center\">\n <Tooltip title={props.warehouse.sizeUsed !== 0 ? <Typography><>{breakdown}</></Typography> : \"\"}>\n <Typography color={props.warehouse.sizeUsed >= props.warehouse.size ? \"error\" : \"primary\"}>\n Storage: {numeralWrapper.formatBigNumber(props.warehouse.sizeUsed)} /{\" \"}\n {numeralWrapper.formatBigNumber(props.warehouse.size)}\n </Typography>\n </Tooltip>\n </Box>\n\n <Button disabled={!canAffordUpgrade} onClick={upgradeWarehouseOnClick}>\n Upgrade Warehouse Size - \n <MoneyCost money={sizeUpgradeCost} corp={corp} />\n </Button>\n\n <Typography>This industry uses the following equation for its production: </Typography>\n <br />\n <Typography>\n <IndustryProductEquation key={division.name} division={division} />\n </Typography>\n <br />\n <Typography>\n To get started with production, purchase your required materials or import them from another of your company's\n divisions.\n </Typography>\n <br />\n\n <Typography>{stateText}</Typography>\n\n {corp.unlockUpgrades[1] && (\n <>\n <Button onClick={() => setSmartSupplyOpen(true)}>Configure Smart Supply</Button>\n <SmartSupplyModal\n open={smartSupplyOpen}\n onClose={() => setSmartSupplyOpen(false)}\n warehouse={props.warehouse}\n />\n </>\n )}\n\n {mats}\n\n {products}\n </Paper>\n );\n}\n\nexport function IndustryWarehouse(props: IProps): React.ReactElement {\n if (props.warehouse instanceof Warehouse) {\n return <WarehouseRoot {...props} />;\n } else {\n return <EmptyWarehouse rerender={props.rerender} city={props.currentCity} />;\n }\n}\n\ninterface IEmptyProps {\n city: string;\n rerender: () => void;\n}\n\nfunction EmptyWarehouse(props: IEmptyProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const disabled = corp.funds < CorporationConstants.WarehouseInitialCost;\n function purchaseWarehouse(): void {\n if (disabled) return;\n PurchaseWarehouse(corp, division, props.city);\n props.rerender();\n }\n return (\n <Paper>\n <Button onClick={purchaseWarehouse} disabled={disabled}>\n Purchase Warehouse (\n <MoneyCost money={CorporationConstants.WarehouseInitialCost} corp={corp} />)\n </Button>\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Warehouse } from \"../Warehouse\";\nimport { SetSmartSupply, SetSmartSupplyUseLeftovers } from \"../Actions\";\nimport { Material } from \"../Material\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\n\ninterface ILeftoverProps {\n matName: string;\n warehouse: Warehouse;\n}\n\nfunction Leftover(props: ILeftoverProps): React.ReactElement {\n const [checked, setChecked] = useState(!!props.warehouse.smartSupplyUseLeftovers[props.matName.replace(/ /g, \"\")]);\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n try {\n const matName = props.matName.replace(/ /g, \"\");\n const material = props.warehouse.materials[matName];\n SetSmartSupplyUseLeftovers(props.warehouse, material, event.target.checked);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n setChecked(event.target.checked);\n }\n\n return (\n <>\n <FormControlLabel\n control={<Switch checked={checked} onChange={onChange} />}\n label={<Typography>{props.warehouse.materials[props.matName.replace(/ /g, \"\")].name}</Typography>}\n />\n <br />\n </>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n warehouse: Warehouse;\n}\n\nexport function SmartSupplyModal(props: IProps): React.ReactElement {\n const division = useDivision();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n // Smart Supply Checkbox\n function smartSupplyOnChange(e: React.ChangeEvent<HTMLInputElement>): void {\n SetSmartSupply(props.warehouse, e.target.checked);\n rerender();\n }\n\n // Create React components for materials\n const mats = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n if (!(props.warehouse.materials[matName] instanceof Material)) continue;\n if (!Object.keys(division.reqMats).includes(matName)) continue;\n mats.push(<Leftover key={matName} warehouse={props.warehouse} matName={matName} />);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <FormControlLabel\n control={<Switch checked={props.warehouse.smartSupplyEnabled} onChange={smartSupplyOnChange} />}\n label={<Typography>Enable Smart Supply</Typography>}\n />\n <br />\n <Typography>Use materials already in the warehouse instead of buying new ones, if available:</Typography>\n {mats}\n </>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Product } from \"../Product\";\nimport { DiscontinueProductModal } from \"./DiscontinueProductModal\";\nimport { LimitProductProductionModal } from \"./LimitProductProductionModal\";\nimport { SellProductModal } from \"./SellProductModal\";\nimport { ProductMarketTaModal } from \"./ProductMarketTaModal\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { isString } from \"../../utils/helpers/isString\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProductProps {\n city: string;\n product: Product;\n rerender: () => void;\n}\n\n// Creates the UI for a single Product type\nexport function ProductElem(props: IProductProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [sellOpen, setSellOpen] = useState(false);\n const [limitOpen, setLimitOpen] = useState(false);\n const [discontinueOpen, setDiscontinueOpen] = useState(false);\n const [marketTaOpen, setMarketTaOpen] = useState(false);\n const city = props.city;\n const product = props.product;\n\n // Numeraljs formatters\n const nf = \"0.000\";\n const nfB = \"0.000a\"; // For numbers that might be big\n\n const hasUpgradeDashboard = division.hasResearch(\"uPgrade: Dashboard\");\n\n // Total product gain = production - sale\n const totalGain = product.data[city][1] - product.data[city][2];\n\n // Sell button\n let sellButtonText: JSX.Element;\n if (product.sllman[city][0]) {\n if (isString(product.sllman[city][1])) {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(product.data[city][2], nfB)}/{product.sllman[city][1]})\n </>\n );\n } else {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(product.data[city][2], nfB)}/\n {numeralWrapper.format(product.sllman[city][1], nfB)})\n </>\n );\n }\n } else {\n sellButtonText = <>Sell (0.000/0.000)</>;\n }\n\n if (product.marketTa2) {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={product.marketTa2Price[city]} />\n </>\n );\n } else if (product.marketTa1) {\n const markupLimit = product.rat / product.mku;\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={product.pCost + markupLimit} />\n </>\n );\n } else if (product.sCost) {\n if (isString(product.sCost)) {\n const sCost = (product.sCost as string).replace(/MP/g, product.pCost + product.rat / product.mku + \"\");\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={eval(sCost)} />\n </>\n );\n } else {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={product.sCost} />\n </>\n );\n }\n }\n\n // Limit Production button\n let limitProductionButtonText = \"Limit Production\";\n if (product.prdman[city][0]) {\n limitProductionButtonText += \" (\" + numeralWrapper.format(product.prdman[city][1], nf) + \")\";\n }\n\n return (\n <Paper>\n {!product.fin ? (\n <>\n <Typography>\n Designing {product.name} (req. Operations/Engineers in {product.createCity})...\n </Typography>\n <br />\n <Typography>{numeralWrapper.format(product.prog, \"0.00\")}% complete</Typography>\n </>\n ) : (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Prod: {numeralWrapper.format(product.data[city][1], nfB)}/s\n <br />\n Sell: {numeralWrapper.format(product.data[city][2], nfB)} /s\n </Typography>\n }\n >\n <Typography>\n {product.name}: {numeralWrapper.format(product.data[city][0], nfB)} (\n {numeralWrapper.format(totalGain, nfB)}\n /s)\n </Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Quality: {numeralWrapper.format(product.qlt, nf)} <br />\n Performance: {numeralWrapper.format(product.per, nf)} <br />\n Durability: {numeralWrapper.format(product.dur, nf)} <br />\n Reliability: {numeralWrapper.format(product.rel, nf)} <br />\n Aesthetics: {numeralWrapper.format(product.aes, nf)} <br />\n Features: {numeralWrapper.format(product.fea, nf)}\n {corp.unlockUpgrades[2] === 1 && <br />}\n {corp.unlockUpgrades[2] === 1 && \"Demand: \" + numeralWrapper.format(product.dmd, nf)}\n {corp.unlockUpgrades[3] === 1 && <br />}\n {corp.unlockUpgrades[3] === 1 && \"Competition: \" + numeralWrapper.format(product.cmp, nf)}\n </Typography>\n }\n >\n <Typography>Rating: {numeralWrapper.format(product.rat, nf)}</Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip title={<Typography>An estimate of the material cost it takes to create this Product.</Typography>}>\n <Typography>\n Est. Production Cost:{\" \"}\n {numeralWrapper.formatMoney(product.pCost / CorporationConstants.ProductProductionCostRatio)}\n </Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n An estimate of how much consumers are willing to pay for this product. Setting the sale price above\n this may result in less sales. Setting the sale price below this may result in more sales.\n </Typography>\n }\n >\n <Typography>Est. Market Price: {numeralWrapper.formatMoney(product.pCost)}</Typography>\n </Tooltip>\n </Box>\n </>\n )}\n\n {(hasUpgradeDashboard || product.fin) && (\n <>\n <Button onClick={() => setSellOpen(true)}>{sellButtonText}</Button>\n <SellProductModal product={product} city={city} open={sellOpen} onClose={() => setSellOpen(false)} />\n <br />\n <Button onClick={() => setLimitOpen(true)}>{limitProductionButtonText}</Button>\n <LimitProductProductionModal\n product={product}\n city={city}\n open={limitOpen}\n onClose={() => setLimitOpen(false)}\n />\n <Button onClick={() => setDiscontinueOpen(true)}>Discontinue</Button>\n\n <DiscontinueProductModal\n product={product}\n rerender={props.rerender}\n open={discontinueOpen}\n onClose={() => setDiscontinueOpen(false)}\n />\n {division.hasResearch(\"Market-TA.I\") && (\n <>\n <Button onClick={() => setMarketTaOpen(true)}>Market-TA</Button>\n <ProductMarketTaModal product={product} open={marketTaOpen} onClose={() => setMarketTaOpen(false)} />\n </>\n )}\n </>\n )}\n </Paper>\n );\n}\n","import React from \"react\";\n\nimport { Product } from \"../Product\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n rerender: () => void;\n}\n\n// Create a popup that lets the player discontinue a product\nexport function DiscontinueProductModal(props: IProps): React.ReactElement {\n const division = useDivision();\n function discontinue(): void {\n division.discontinueProduct(props.product);\n props.onClose();\n props.rerender();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Are you sure you want to do this? Discontinuing a product removes it completely and permanently. You will no\n longer produce this product and all of its existing stock will be removed and left unsold\n </Typography>\n <Button onClick={discontinue}>Discontinue</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Product } from \"../Product\";\nimport { LimitProductProduction } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n city: string;\n}\n\n// Create a popup that lets the player limit the production of a product\nexport function LimitProductProductionModal(props: IProps): React.ReactElement {\n const [limit, setLimit] = useState<number | null>(null);\n\n function limitProductProduction(): void {\n let qty = limit;\n if (qty === null) qty = -1;\n LimitProductProduction(props.product, props.city, qty);\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) limitProductProduction();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setLimit(null);\n else setLimit(parseFloat(event.target.value));\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter a limit to the amount of this product you would like to product per second. Leave the box empty to set no\n limit.\n </Typography>\n <TextField autoFocus={true} placeholder=\"Limit\" type=\"number\" onChange={onChange} onKeyDown={onKeyDown} />\n <Button onClick={limitProductProduction}>Limit production</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Product } from \"../Product\";\nimport { SellProduct } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\n\nfunction initialPrice(product: Product): string {\n let val = product.sCost ? product.sCost + \"\" : \"\";\n if (product.marketTa2) {\n val += \" (Market-TA.II)\";\n } else if (product.marketTa1) {\n val += \" (Market-TA.I)\";\n }\n return val;\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n city: string;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellProductModal(props: IProps): React.ReactElement {\n const [checked, setChecked] = useState(true);\n const [iQty, setQty] = useState<string>(\n props.product.sllman[props.city][1] ? props.product.sllman[props.city][1] : \"\",\n );\n const [px, setPx] = useState<string>(initialPrice(props.product));\n\n function onCheckedChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setChecked(event.target.checked);\n }\n\n function sellProduct(): void {\n try {\n SellProduct(props.product, props.city, iQty, px, checked);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function onAmtChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setQty(event.target.value);\n }\n\n function onPriceChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setPx(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) sellProduct();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the maximum amount of {props.product.name} you would like to sell per second, as well as the price at\n which you would like to sell it at.\n <br />\n <br />\n If the sell amount is set to 0, then the product will not be sold. If the sell price is set to 0, then the\n product will be discarded.\n <br />\n <br />\n Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.\n <br />\n <br />\n When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that\n depends on your production. For example, if you set the sell amount to 'PROD-1' then you will always sell 1 less\n of the material than you produce.\n <br />\n <br />\n When setting the sell price, you can use the 'MP' variable to set a dynamically changing price that depends on\n the Product's estimated market price. For example, if you set it to 'MP*5' then it will always be sold at five\n times the estimated market price.\n </Typography>\n <br />\n <TextField\n value={iQty}\n autoFocus={true}\n type=\"text\"\n placeholder=\"Sell amount\"\n onChange={onAmtChange}\n onKeyDown={onKeyDown}\n />\n <TextField value={px} type=\"text\" placeholder=\"Sell price\" onChange={onPriceChange} onKeyDown={onKeyDown} />\n <Button onClick={sellProduct}>Confirm</Button>\n <FormControlLabel\n control={<Switch checked={checked} onChange={onCheckedChange} />}\n label={<Typography>Use same 'Sell Amount' for all cities</Typography>}\n />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Product } from \"../Product\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface ITa2Props {\n product: Product;\n}\n\nfunction MarketTA2(props: ITa2Props): React.ReactElement {\n const division = useDivision();\n if (!division.hasResearch(\"Market-TA.II\")) return <></>;\n const markupLimit = props.product.rat / props.product.mku;\n const [value, setValue] = useState(props.product.pCost);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setValue(parseFloat(event.target.value));\n }\n\n function onCheckedChange(event: React.ChangeEvent<HTMLInputElement>): void {\n props.product.marketTa2 = event.target.checked;\n rerender();\n }\n\n const sCost = value;\n let markup = 1;\n if (sCost > props.product.pCost) {\n if (sCost - props.product.pCost > markupLimit) {\n markup = markupLimit / (sCost - props.product.pCost);\n }\n }\n\n return (\n <>\n <Typography variant=\"h4\">Market-TA.II</Typography>\n <br />\n <Typography>\n If you sell at {numeralWrapper.formatMoney(sCost)}, then you will sell{\" \"}\n {numeralWrapper.format(markup, \"0.00000\")}x as much compared to if you sold at market price.\n </Typography>\n <TextField type=\"number\" onChange={onChange} value={value} />\n <br />\n <FormControlLabel\n control={<Switch checked={props.product.marketTa2} onChange={onCheckedChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then this Material will automatically be sold at the optimal price such that the\n amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all\n produced materials will be sold)\n </Typography>\n }\n >\n <Typography>Use Market-TA.II for Auto-Sale Price</Typography>\n </Tooltip>\n }\n />\n </>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n}\n\n// Create a popup that lets the player use the Market TA research for Products\nexport function ProductMarketTaModal(props: IProps): React.ReactElement {\n const markupLimit = props.product.rat / props.product.mku;\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n props.product.marketTa1 = event.target.checked;\n rerender();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography variant=\"h4\">Market-TA.I</Typography>\n <Typography>\n The maximum sale price you can mark this up to is{\" \"}\n {numeralWrapper.formatMoney(props.product.pCost + markupLimit)}. This means that if you set the sale price\n higher than this, you will begin to experience a loss in number of sales\n </Typography>\n\n <FormControlLabel\n control={<Switch checked={props.product.marketTa1} onChange={onChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then this Material will automatically be sold at the price identified by\n Market-TA.I (i.e. the price shown above)\n </Typography>\n }\n >\n <Typography>Use Market-TA.I for Auto-Sale Price</Typography>\n </Tooltip>\n }\n />\n </>\n\n <MarketTA2 product={props.product} />\n </Modal>\n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Material } from \"../Material\";\nimport { Warehouse } from \"../Warehouse\";\nimport { ExportModal } from \"./ExportModal\";\nimport { MaterialMarketTaModal } from \"./MaterialMarketTaModal\";\nimport { SellMaterialModal } from \"./SellMaterialModal\";\nimport { PurchaseMaterialModal } from \"./PurchaseMaterialModal\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { isString } from \"../../utils/helpers/isString\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IMaterialProps {\n warehouse: Warehouse;\n city: string;\n mat: Material;\n rerender: () => void;\n}\n\n// Creates the UI for a single Material type\nexport function MaterialElem(props: IMaterialProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [purchaseMaterialOpen, setPurchaseMaterialOpen] = useState(false);\n const [exportOpen, setExportOpen] = useState(false);\n const [sellMaterialOpen, setSellMaterialOpen] = useState(false);\n const [materialMarketTaOpen, setMaterialMarketTaOpen] = useState(false);\n const warehouse = props.warehouse;\n const city = props.city;\n const mat = props.mat;\n const markupLimit = mat.getMarkupLimit();\n const office = division.offices[city];\n if (!(office instanceof OfficeSpace)) {\n throw new Error(`Could not get OfficeSpace object for this city (${city})`);\n }\n\n // Numeraljs formatter\n const nf = \"0.000\";\n const nfB = \"0.000a\"; // For numbers that might be biger\n\n // Total gain or loss of this material (per second)\n const totalGain = mat.buy + mat.prd + mat.imp - mat.sll - mat.totalExp;\n\n // Flag that determines whether this industry is \"new\" and the current material should be\n // marked with flashing-red lights\n const tutorial =\n division.newInd && Object.keys(division.reqMats).includes(mat.name) && mat.buy === 0 && mat.imp === 0;\n\n // Purchase material button\n const purchaseButtonText = `Buy (${numeralWrapper.format(mat.buy, nfB)})`;\n\n // Sell material button\n let sellButtonText: JSX.Element;\n if (mat.sllman[0]) {\n if (isString(mat.sllman[1])) {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(mat.sll, nfB)}/{mat.sllman[1]})\n </>\n );\n } else {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(mat.sll, nfB)}/{numeralWrapper.format(mat.sllman[1] as number, nfB)})\n </>\n );\n }\n\n if (mat.marketTa2) {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={mat.marketTa2Price} />\n </>\n );\n } else if (mat.marketTa1) {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={mat.bCost + markupLimit} />\n </>\n );\n } else if (mat.sCost) {\n if (isString(mat.sCost)) {\n const sCost = (mat.sCost as string).replace(/MP/g, mat.bCost + \"\");\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={eval(sCost)} />\n </>\n );\n } else {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={mat.sCost} />\n </>\n );\n }\n }\n } else {\n sellButtonText = <>Sell (0.000/0.000)</>;\n }\n\n return (\n <Paper>\n <Box sx={{ display: 'grid', gridTemplateColumns: '2fr 1fr', m: '5px' }}>\n <Box>\n <Tooltip\n title={\n <Typography>\n Buy: {numeralWrapper.format(mat.buy, nfB)} <br />\n Prod: {numeralWrapper.format(mat.prd, nfB)} <br />\n Sell: {numeralWrapper.format(mat.sll, nfB)} <br />\n Export: {numeralWrapper.format(mat.totalExp, nfB)} <br />\n Import: {numeralWrapper.format(mat.imp, nfB)}\n {corp.unlockUpgrades[2] === 1 && <br />}\n {corp.unlockUpgrades[2] === 1 && \"Demand: \" + numeralWrapper.format(mat.dmd, nf)}\n {corp.unlockUpgrades[3] === 1 && <br />}\n {corp.unlockUpgrades[3] === 1 && \"Competition: \" + numeralWrapper.format(mat.cmp, nf)}\n </Typography>\n }\n >\n <Typography>\n {mat.name}: {numeralWrapper.format(mat.qty, nfB)} ({numeralWrapper.format(totalGain, nfB)}/s)\n </Typography>\n </Tooltip>\n <Tooltip\n title={\n <Typography>\n Market Price: The price you would pay if you were to buy this material on the market\n </Typography>\n }\n >\n <Typography>MP: {numeralWrapper.formatMoney(mat.bCost)}</Typography>\n </Tooltip>\n <Tooltip\n title={<Typography>The quality of your material. Higher quality will lead to more sales</Typography>}\n >\n <Typography>Quality: {numeralWrapper.format(mat.qlt, \"0.00a\")}</Typography>\n </Tooltip>\n </Box>\n\n <Box sx={{ \"& button\": { width: '100%' } }}>\n <Tooltip\n title={tutorial ? <Typography>Purchase your required materials to get production started!</Typography> : \"\"}\n >\n <Button\n color={tutorial ? \"error\" : \"primary\"}\n onClick={() => setPurchaseMaterialOpen(true)}\n disabled={props.warehouse.smartSupplyEnabled && Object.keys(division.reqMats).includes(props.mat.name)}\n >\n {purchaseButtonText}\n </Button>\n </Tooltip>\n <PurchaseMaterialModal\n mat={mat}\n warehouse={warehouse}\n open={purchaseMaterialOpen}\n onClose={() => setPurchaseMaterialOpen(false)}\n />\n\n {corp.unlockUpgrades[0] === 1 && (\n <>\n <Button onClick={() => setExportOpen(true)}>Export</Button>\n\n <ExportModal mat={mat} open={exportOpen} onClose={() => setExportOpen(false)} />\n </>\n )}\n\n <Button\n color={division.prodMats.includes(props.mat.name) && !mat.sllman[0] ? \"error\" : \"primary\"}\n onClick={() => setSellMaterialOpen(true)}\n >\n {sellButtonText}\n </Button>\n <SellMaterialModal mat={mat} open={sellMaterialOpen} onClose={() => setSellMaterialOpen(false)} />\n {division.hasResearch(\"Market-TA.I\") && (\n <>\n <Button onClick={() => setMaterialMarketTaOpen(true)}>Market-TA</Button>\n\n <MaterialMarketTaModal\n mat={mat}\n open={materialMarketTaOpen}\n onClose={() => setMaterialMarketTaOpen(false)}\n />\n </>\n )}\n </Box>\n </Box>\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Material } from \"../Material\";\nimport { Export } from \"../Export\";\nimport { IIndustry } from \"../IIndustry\";\nimport { ExportMaterial } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that lets the player manage exports\nexport function ExportModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n if (corp.divisions.length === 0) throw new Error(\"Export popup created with no divisions.\");\n if (Object.keys(corp.divisions[0].warehouses).length === 0)\n throw new Error(\"Export popup created in a division with no warehouses.\");\n const [industry, setIndustry] = useState<string>(corp.divisions[0].name);\n const [city, setCity] = useState<string>(Object.keys(corp.divisions[0].warehouses)[0]);\n const [amt, setAmt] = useState(\"\");\n const setRerender = useState(false)[1];\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onCityChange(event: SelectChangeEvent<string>): void {\n setCity(event.target.value);\n }\n\n function onIndustryChange(event: SelectChangeEvent<string>): void {\n const div = event.target.value;\n setIndustry(div);\n setCity(Object.keys(corp.divisions[0].warehouses)[0]);\n }\n\n function onAmtChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setAmt(event.target.value);\n }\n\n function exportMaterial(): void {\n try {\n ExportMaterial(industry, city, props.mat, amt);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function removeExport(exp: Export): void {\n for (let i = 0; i < props.mat.exp.length; ++i) {\n if (props.mat.exp[i].ind !== exp.ind || props.mat.exp[i].city !== exp.city || props.mat.exp[i].amt !== exp.amt)\n continue;\n props.mat.exp.splice(i, 1);\n break;\n }\n rerender();\n }\n\n const currentDivision = corp.divisions.find((division: IIndustry) => division.name === industry);\n if (currentDivision === undefined)\n throw new Error(`Export popup somehow ended up with undefined division '${currentDivision}'`);\n const possibleCities = Object.keys(currentDivision.warehouses).filter(\n (city) => currentDivision.warehouses[city] !== 0,\n );\n if (possibleCities.length > 0 && !possibleCities.includes(city)) {\n setCity(possibleCities[0]);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Select the industry and city to export this material to, as well as how much of this material to export per\n second. You can set the export amount to 'MAX' to export all of the materials in this warehouse.\n </Typography>\n <Select onChange={onIndustryChange} value={industry}>\n {corp.divisions.map((division: IIndustry) => (\n <MenuItem key={division.name} value={division.name}>\n {division.name}\n </MenuItem>\n ))}\n </Select>\n <Select onChange={onCityChange} value={city}>\n {possibleCities.map((cityName: string) => {\n if (currentDivision.warehouses[cityName] === 0) return;\n return (\n <MenuItem key={cityName} value={cityName}>\n {cityName}\n </MenuItem>\n );\n })}\n </Select>\n <TextField placeholder=\"Export amount / s\" onChange={onAmtChange} value={amt} />\n <Button onClick={exportMaterial}>Export</Button>\n <Typography>\n Below is a list of all current exports of this material from this warehouse. Clicking on one of the exports\n below will REMOVE that export.\n </Typography>\n {props.mat.exp.map((exp: Export, index: number) => (\n <Box display=\"flex\" alignItems=\"center\" key={index}>\n <Button sx={{ mx: 2 }} onClick={() => removeExport(exp)}>\n delete\n </Button>\n <Typography>\n Industry: {exp.ind}\n <br />\n City: {exp.city}\n <br />\n Amount/s: {exp.amt}\n </Typography>\n </Box>\n ))}\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Material } from \"../Material\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IMarketTA2Props {\n mat: Material;\n}\n\nfunction MarketTA2(props: IMarketTA2Props): React.ReactElement {\n const division = useDivision();\n if (!division.hasResearch(\"Market-TA.II\")) return <></>;\n const [newCost, setNewCost] = useState<number>(props.mat.bCost);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const markupLimit = props.mat.getMarkupLimit();\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setNewCost(0);\n else setNewCost(parseFloat(event.target.value));\n }\n\n const sCost = newCost;\n let markup = 1;\n if (sCost > props.mat.bCost) {\n //Penalty if difference between sCost and bCost is greater than markup limit\n if (sCost - props.mat.bCost > markupLimit) {\n markup = Math.pow(markupLimit / (sCost - props.mat.bCost), 2);\n }\n } else if (sCost < props.mat.bCost) {\n if (sCost <= 0) {\n markup = 1e12; //Sell everything, essentially discard\n } else {\n //Lower prices than market increases sales\n markup = props.mat.bCost / sCost;\n }\n }\n\n function onMarketTA2(event: React.ChangeEvent<HTMLInputElement>): void {\n props.mat.marketTa2 = event.target.checked;\n rerender();\n }\n\n return (\n <>\n <Typography variant=\"h4\">Market-TA.II</Typography>\n <br />\n <Typography>\n If you sell at {numeralWrapper.formatMoney(sCost)}, then you will sell{\" \"}\n {numeralWrapper.format(markup, \"0.00000\")}x as much compared to if you sold at market price.\n </Typography>\n <TextField type=\"number\" onChange={onChange} value={newCost} />\n <br />\n <FormControlLabel\n control={<Switch checked={props.mat.marketTa2} onChange={onMarketTA2} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then this Material will automatically be sold at the optimal price such that the\n amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all\n produced materials will be sold)\n </Typography>\n }\n >\n <Typography>Use Market-TA.II for Auto-Sale Price</Typography>\n </Tooltip>\n }\n />\n </>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that lets the player use the Market TA research for Materials\nexport function MaterialMarketTaModal(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const markupLimit = props.mat.getMarkupLimit();\n\n function onMarketTA1(event: React.ChangeEvent<HTMLInputElement>): void {\n props.mat.marketTa1 = event.target.checked;\n rerender();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography variant=\"h4\">Market-TA.I</Typography>\n <Typography>\n The maximum sale price you can mark this up to is {numeralWrapper.formatMoney(props.mat.bCost + markupLimit)}.\n This means that if you set the sale price higher than this, you will begin to experience a loss in number of\n sales\n </Typography>\n\n <FormControlLabel\n control={<Switch checked={props.mat.marketTa1} onChange={onMarketTA1} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then this Material will automatically be sold at the price identified by\n Market-TA.I (i.e. the price shown above)\n </Typography>\n }\n >\n <Typography>Use Market-TA.I for Auto-Sale Price</Typography>\n </Tooltip>\n }\n />\n </>\n\n <MarketTA2 mat={props.mat} />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Material } from \"../Material\";\nimport { SellMaterial } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\nfunction initialPrice(mat: Material): string {\n let val = mat.sCost ? mat.sCost + \"\" : \"\";\n if (mat.marketTa2) {\n val += \" (Market-TA.II)\";\n } else if (mat.marketTa1) {\n val += \" (Market-TA.I)\";\n }\n return val;\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellMaterialModal(props: IProps): React.ReactElement {\n const [amt, setAmt] = useState<string>(props.mat.sllman[1] ? props.mat.sllman[1] + \"\" : \"\");\n const [price, setPrice] = useState<string>(initialPrice(props.mat));\n\n function sellMaterial(): void {\n try {\n SellMaterial(props.mat, amt, price);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onAmtChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setAmt(event.target.value);\n }\n\n function onPriceChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setPrice(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) sellMaterial();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the maximum amount of {props.mat.name} you would like to sell per second, as well as the price at which\n you would like to sell at.\n <br />\n <br />\n If the sell amount is set to 0, then the material will not be sold. If the sell price if set to 0, then the\n material will be discarded\n <br />\n <br />\n Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.\n <br />\n <br />\n When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that\n depends on your production. For example, if you set the sell amount to 'PROD-5' then you will always sell 5 less\n of the material than you produce.\n <br />\n <br />\n When setting the sell price, you can use the 'MP' variable to designate a dynamically changing price that\n depends on the market price. For example, if you set the sell price to 'MP+10' then it will always be sold at\n $10 above the market price.\n </Typography>\n <br />\n <TextField\n value={amt}\n autoFocus={true}\n type=\"text\"\n placeholder=\"Sell amount\"\n onChange={onAmtChange}\n onKeyDown={onKeyDown}\n />\n <TextField value={price} type=\"text\" placeholder=\"Sell price\" onChange={onPriceChange} onKeyDown={onKeyDown} />\n <Button onClick={sellMaterial}>Confirm</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { MaterialSizes } from \"../MaterialSizes\";\nimport { Warehouse } from \"../Warehouse\";\nimport { Material } from \"../Material\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { BuyMaterial } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IBulkPurchaseTextProps {\n warehouse: Warehouse;\n mat: Material;\n amount: string;\n}\n\nfunction BulkPurchaseText(props: IBulkPurchaseTextProps): React.ReactElement {\n const parsedAmt = parseFloat(props.amount);\n const cost = parsedAmt * props.mat.bCost;\n\n const matSize = MaterialSizes[props.mat.name];\n const maxAmount = (props.warehouse.size - props.warehouse.sizeUsed) / matSize;\n\n if (parsedAmt * matSize > maxAmount) {\n return (\n <>\n <Typography color={\"error\"}>Not enough warehouse space to purchase this amount</Typography>\n </>\n );\n } else if (isNaN(cost) || parsedAmt < 0) {\n return (\n <>\n <Typography color={\"error\"}>Invalid put for Bulk Purchase amount</Typography>\n </>\n );\n } else {\n return (\n <>\n <Typography>\n Purchasing {numeralWrapper.format(parsedAmt, \"0,0.00\")} of {props.mat.name} will cost{\" \"}\n {numeralWrapper.formatMoney(cost)}\n </Typography>\n </>\n );\n }\n}\n\ninterface IBPProps {\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n}\n\nfunction BulkPurchase(props: IBPProps): React.ReactElement {\n const corp = useCorporation();\n const [buyAmt, setBuyAmt] = useState(\"\");\n\n function bulkPurchase(): void {\n const amount = parseFloat(buyAmt);\n\n const matSize = MaterialSizes[props.mat.name];\n const maxAmount = (props.warehouse.size - props.warehouse.sizeUsed) / matSize;\n if (amount * matSize > maxAmount) {\n dialogBoxCreate(`You do not have enough warehouse size to fit this purchase`);\n return;\n }\n\n if (isNaN(amount) || amount < 0) {\n dialogBoxCreate(\"Invalid input amount\");\n } else {\n const cost = amount * props.mat.bCost;\n if (corp.funds >= cost) {\n corp.funds = corp.funds - cost;\n props.mat.qty += amount;\n } else {\n dialogBoxCreate(`You cannot afford this purchase.`);\n return;\n }\n props.onClose();\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) bulkPurchase();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setBuyAmt(event.target.value);\n }\n\n return (\n <>\n <Typography>\n Enter the amount of {props.mat.name} you would like to bulk purchase. This purchases the specified amount\n instantly (all at once).\n </Typography>\n <BulkPurchaseText warehouse={props.warehouse} mat={props.mat} amount={buyAmt} />\n <TextField\n value={buyAmt}\n onChange={onChange}\n type=\"number\"\n placeholder=\"Bulk Purchase amount\"\n onKeyDown={onKeyDown}\n />\n <Button onClick={bulkPurchase}>Confirm Bulk Purchase</Button>\n </>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n}\n\n// Create a popup that lets the player purchase a Material\nexport function PurchaseMaterialModal(props: IProps): React.ReactElement {\n const division = useDivision();\n const [buyAmt, setBuyAmt] = useState(props.mat.buy ? props.mat.buy : 0);\n\n function purchaseMaterial(): void {\n if (buyAmt === null) return;\n try {\n BuyMaterial(props.mat, buyAmt);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function clearPurchase(): void {\n props.mat.buy = 0;\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) purchaseMaterial();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setBuyAmt(parseFloat(event.target.value));\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Enter the amount of {props.mat.name} you would like to purchase per second. This material's cost changes\n constantly.\n </Typography>\n <TextField\n value={buyAmt}\n onChange={onChange}\n autoFocus={true}\n placeholder=\"Purchase amount\"\n type=\"number\"\n onKeyDown={onKeyDown}\n />\n <Button onClick={purchaseMaterial}>Confirm</Button>\n <Button onClick={clearPurchase}>Clear Purchase</Button>\n {division.hasResearch(\"Bulk Purchasing\") && (\n <BulkPurchase onClose={props.onClose} mat={props.mat} warehouse={props.warehouse} />\n )}\n </>\n </Modal>\n );\n}\n","import { IIndustry } from \"../IIndustry\";\n\n// Returns a boolean indicating whether the given material is relevant for the\n// current industry.\nexport function isRelevantMaterial(matName: string, division: IIndustry): boolean {\n // Materials that affect Production multiplier\n const prodMultiplierMats = [\"Hardware\", \"Robots\", \"AICores\", \"RealEstate\"];\n\n if (Object.keys(division.reqMats).includes(matName)) {\n return true;\n }\n if (division.prodMats.includes(matName)) {\n return true;\n }\n if (prodMultiplierMats.includes(matName)) {\n return true;\n }\n\n return false;\n}\n","import React from \"react\";\nimport { IIndustry } from \"../IIndustry\";\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\ninterface IProps {\n division: IIndustry;\n}\n\nexport function IndustryProductEquation(props: IProps): React.ReactElement {\n const reqs = [];\n for (const reqMat of Object.keys(props.division.reqMats)) {\n const reqAmt = props.division.reqMats[reqMat];\n if (reqAmt === undefined) continue;\n reqs.push(String.raw`${reqAmt}\\text{ }${reqMat}`);\n }\n const prod = props.division.prodMats.slice();\n if (props.division.makesProducts) {\n prod.push(props.division.type);\n }\n\n return (\n <MathJaxWrapper>{\"\\\\(\" + reqs.join(\"+\") + `\\\\Rightarrow` + prod.map((p) => `1 \\\\text{${p}}`).join(\"+\") + \"\\\\)\"}</MathJaxWrapper>\n );\n}\n","import React, { useState } from \"react\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { NewCity } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n cityStateSetter: (city: string) => void;\n}\n\nexport function ExpandNewCity(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const possibleCities = Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] === 0);\n const [city, setCity] = useState(possibleCities[0]);\n\n const disabled = corp.funds < CorporationConstants.OfficeInitialCost;\n\n function onCityChange(event: SelectChangeEvent<string>): void {\n setCity(event.target.value);\n }\n\n function expand(): void {\n try {\n NewCity(corp, division, city);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n dialogBoxCreate(`Opened a new office in ${city}!`);\n\n props.cityStateSetter(city);\n }\n return (\n <>\n <Typography>\n Would you like to expand into a new city by opening an office? This would cost{\" \"}\n <MoneyCost money={CorporationConstants.OfficeInitialCost} corp={corp} />\n </Typography>\n <Select\n endAdornment={\n <Button onClick={expand} disabled={disabled}>\n Confirm\n </Button>\n }\n value={city}\n onChange={onCityChange}\n >\n {possibleCities.map((cityName: string) => (\n <MenuItem key={cityName} value={cityName}>\n {cityName}\n </MenuItem>\n ))}\n </Select>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { IndustryStartingCosts, Industries, IndustryDescriptions } from \"../IndustryData\";\nimport { useCorporation } from \"./Context\";\nimport { IIndustry } from \"../IIndustry\";\nimport { NewIndustry } from \"../Actions\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Box from \"@mui/material/Box\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n setDivisionName: (name: string) => void;\n}\n\nexport function ExpandIndustryTab(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const allIndustries = Object.keys(Industries).sort();\n const possibleIndustries = allIndustries\n .filter(\n (industryType: string) =>\n corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined,\n )\n .sort();\n const [industry, setIndustry] = useState(possibleIndustries.length > 0 ? possibleIndustries[0] : \"\");\n const [name, setName] = useState(\"\");\n\n const cost = IndustryStartingCosts[industry];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industry}'`);\n }\n const disabled = corp.funds < cost || name === \"\";\n\n function newIndustry(): void {\n if (disabled) return;\n try {\n NewIndustry(corp, industry, name);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n // Set routing to the new division so that the UI automatically switches to it\n props.setDivisionName(name);\n }\n\n function onNameChange(event: React.ChangeEvent<HTMLInputElement>): void {\n // [a-zA-Z0-9-_]\n setName(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) newIndustry();\n }\n\n function onIndustryChange(event: SelectChangeEvent<string>): void {\n setIndustry(event.target.value);\n }\n\n const desc = IndustryDescriptions[industry];\n if (desc === undefined) throw new Error(`Trying to create an industry that doesn't exists: '${industry}'`);\n\n return (\n <>\n <Typography>Create a new division to expand into a new industry:</Typography>\n <Select value={industry} onChange={onIndustryChange}>\n {possibleIndustries.map((industry: string) => (\n <MenuItem key={industry} value={industry}>\n {industry}\n </MenuItem>\n ))}\n </Select>\n <Typography>{desc(corp)}</Typography>\n <br />\n <br />\n\n <Typography>Division name:</Typography>\n\n <Box display=\"flex\" alignItems=\"center\">\n <TextField\n autoFocus={true}\n value={name}\n onChange={onNameChange}\n onKeyDown={onKeyDown}\n type=\"text\"\n InputProps={{\n endAdornment: (\n <Button disabled={disabled} sx={{ mx: 1 }} onClick={newIndustry}>\n Expand\n </Button>\n ),\n }}\n />\n </Box>\n </>\n );\n}\n","// React Component for displaying Corporation Overview info\nimport React, { useState } from \"react\";\nimport { LevelableUpgrade } from \"./LevelableUpgrade\";\nimport { UnlockUpgrade } from \"./UnlockUpgrade\";\nimport { BribeFactionModal } from \"./BribeFactionModal\";\nimport { SellSharesModal } from \"./SellSharesModal\";\nimport { BuybackSharesModal } from \"./BuybackSharesModal\";\nimport { IssueDividendsModal } from \"./IssueDividendsModal\";\nimport { IssueNewSharesModal } from \"./IssueNewSharesModal\";\nimport { FindInvestorsModal } from \"./FindInvestorsModal\";\nimport { GoPublicModal } from \"./GoPublicModal\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { CorporationUnlockUpgrade, CorporationUnlockUpgrades } from \"../data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade, CorporationUpgrades } from \"../data/CorporationUpgrades\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n rerender: () => void;\n}\nexport function Overview({ rerender }: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const profit: number = corp.revenue - corp.expenses;\n\n const multRows: any[][] = [];\n function appendMult(name: string, value: number): void {\n if (value === 1) return;\n multRows.push([name, numeralWrapper.format(value, \"0.000\")]);\n }\n appendMult(\"Production Multiplier: \", corp.getProductionMultiplier());\n appendMult(\"Storage Multiplier: \", corp.getStorageMultiplier());\n appendMult(\"Advertising Multiplier: \", corp.getAdvertisingMultiplier());\n appendMult(\"Empl. Creativity Multiplier: \", corp.getEmployeeCreMultiplier());\n appendMult(\"Empl. Charisma Multiplier: \", corp.getEmployeeChaMultiplier());\n appendMult(\"Empl. Intelligence Multiplier: \", corp.getEmployeeIntMultiplier());\n appendMult(\"Empl. Efficiency Multiplier: \", corp.getEmployeeEffMultiplier());\n appendMult(\"Sales Multiplier: \", corp.getSalesMultiplier());\n appendMult(\"Scientific Research Multiplier: \", corp.getScientificResearchMultiplier());\n\n return (\n <>\n <StatsTable\n rows={[\n [\"Total Funds:\", <Money money={corp.funds} />],\n [\"Total Revenue:\", <MoneyRate money={corp.revenue} />],\n [\"Total Expenses:\", <MoneyRate money={corp.expenses} />],\n [\"Publicly Traded:\", corp.public ? \"Yes\" : \"No\"],\n [\"Owned Stock Shares:\", numeralWrapper.format(corp.numShares, \"0.000a\")],\n [\"Stock Price:\", corp.public ? <Money money={corp.sharePrice} /> : \"N/A\"],\n ]}\n />\n <br />\n <Box display=\"flex\">\n <Tooltip\n title={\n <StatsTable\n rows={[\n [\"Outstanding Shares:\", numeralWrapper.format(corp.issuedShares, \"0.000a\")],\n [\n \"Private Shares:\",\n numeralWrapper.format(corp.totalShares - corp.issuedShares - corp.numShares, \"0.000a\"),\n ],\n ]}\n />\n }\n >\n <Typography>Total Stock Shares: {numeralWrapper.format(corp.totalShares, \"0.000a\")}</Typography>\n </Tooltip>\n </Box>\n <br />\n <DividendsStats profit={profit} />\n <br />\n <StatsTable rows={multRows} />\n <br />\n <BonusTime />\n <Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', width: 'fit-content' }}>\n <Tooltip\n title={\n <Typography>\n Get a copy of and read 'The Complete Handbook for Creating a Successful Corporation.' This is a .lit file\n that guides you through the beginning of setting up a Corporation and provides some tips/pointers for\n helping you get started with managing it.\n </Typography>\n }\n >\n <Button onClick={() => corp.getStarterGuide(player)}>Getting Started Guide</Button>\n </Tooltip>\n {corp.public ? <PublicButtons rerender={rerender} /> : <PrivateButtons rerender={rerender} />}\n <BribeButton />\n </Box>\n <br />\n <Upgrades rerender={rerender} />\n </>\n );\n}\n\ninterface IPrivateButtonsProps {\n rerender: () => void;\n}\n// Render the buttons for when your Corporation is still private\nfunction PrivateButtons({ rerender }: IPrivateButtonsProps): React.ReactElement {\n const corp = useCorporation();\n const [findInvestorsopen, setFindInvestorsopen] = useState(false);\n const [goPublicopen, setGoPublicopen] = useState(false);\n\n const fundingAvailable = corp.fundingRound < 4;\n const findInvestorsTooltip = fundingAvailable\n ? \"Search for private investors who will give you startup funding in exchange for equity (stock shares) in your company\"\n : \"\";\n\n return (\n <>\n <Tooltip title={<Typography>{findInvestorsTooltip}</Typography>}>\n <Button disabled={!fundingAvailable} onClick={() => setFindInvestorsopen(true)}>\n Find Investors\n </Button>\n </Tooltip>\n <Tooltip\n title={\n <Typography>\n Become a publicly traded and owned entity. Going public involves issuing shares for an IPO. Once you are a\n public company, your shares will be traded on the stock market.\n </Typography>\n }\n >\n <Button onClick={() => setGoPublicopen(true)}>Go Public</Button>\n </Tooltip>\n <FindInvestorsModal open={findInvestorsopen} onClose={() => setFindInvestorsopen(false)} rerender={rerender} />\n <GoPublicModal open={goPublicopen} onClose={() => setGoPublicopen(false)} rerender={rerender} />\n </>\n );\n}\n\ninterface IUpgradeProps {\n rerender: () => void;\n}\n// Render the UI for Corporation upgrades\nfunction Upgrades({ rerender }: IUpgradeProps): React.ReactElement {\n const corp = useCorporation();\n // Don't show upgrades\n if (corp.divisions.length <= 0) {\n return <Typography variant=\"h4\">Upgrades are unlocked once you create an industry.</Typography>;\n }\n\n return (\n <>\n <Paper sx={{ p: 1, my: 1 }}>\n <Typography variant=\"h4\">Unlocks</Typography>\n <Grid container>\n {Object.values(CorporationUnlockUpgrades)\n .filter((upgrade: CorporationUnlockUpgrade) => !corp.unlockUpgrades[upgrade[0]])\n .map((upgrade: CorporationUnlockUpgrade) => (\n <UnlockUpgrade rerender={rerender} upgradeData={upgrade} key={upgrade[0]} />\n ))}\n </Grid>\n </Paper>\n <Paper sx={{ p: 1, my: 1 }}>\n <Typography variant=\"h4\">Upgrades</Typography>\n <Grid container>\n {corp.upgrades\n .map((level: number, i: number) => CorporationUpgrades[i])\n .map((upgrade: CorporationUpgrade) => (\n <LevelableUpgrade rerender={rerender} upgrade={upgrade} key={upgrade[0]} />\n ))}\n </Grid>\n </Paper>\n </>\n );\n}\n\ninterface IPublicButtonsProps {\n rerender: () => void;\n}\n\n// Render the buttons for when your Corporation has gone public\nfunction PublicButtons({ rerender }: IPublicButtonsProps): React.ReactElement {\n const corp = useCorporation();\n const [sellSharesOpen, setSellSharesOpen] = useState(false);\n const [buybackSharesOpen, setBuybackSharesOpen] = useState(false);\n const [issueNewSharesOpen, setIssueNewSharesOpen] = useState(false);\n const [issueDividendsOpen, setIssueDividendsOpen] = useState(false);\n\n const sellSharesOnCd = corp.shareSaleCooldown > 0;\n const sellSharesTooltip = sellSharesOnCd\n ? \"Cannot sell shares for \" + corp.convertCooldownToString(corp.shareSaleCooldown)\n : \"Sell your shares in the company. The money earned from selling your \" +\n \"shares goes into your personal account, not the Corporation's. \" +\n \"This is one of the only ways to profit from your business venture.\";\n\n const issueNewSharesOnCd = corp.issueNewSharesCooldown > 0;\n const issueNewSharesTooltip = issueNewSharesOnCd\n ? \"Cannot issue new shares for \" + corp.convertCooldownToString(corp.issueNewSharesCooldown)\n : \"Issue new equity shares to raise capital.\";\n\n return (\n <>\n <Tooltip title={<Typography>{sellSharesTooltip}</Typography>}>\n <Button disabled={sellSharesOnCd} onClick={() => setSellSharesOpen(true)}>\n Sell Shares\n </Button>\n </Tooltip>\n <SellSharesModal open={sellSharesOpen} onClose={() => setSellSharesOpen(false)} rerender={rerender} />\n <Tooltip title={<Typography>Buy back shares you that previously issued or sold at market price.</Typography>}>\n <Button disabled={corp.issuedShares < 1} onClick={() => setBuybackSharesOpen(true)}>\n Buyback shares\n </Button>\n </Tooltip>\n <BuybackSharesModal open={buybackSharesOpen} onClose={() => setBuybackSharesOpen(false)} rerender={rerender} />\n <Tooltip title={<Typography>{issueNewSharesTooltip}</Typography>}>\n <Button disabled={issueNewSharesOnCd} onClick={() => setIssueNewSharesOpen(true)}>\n Issue New Shares\n </Button>\n </Tooltip>\n <IssueNewSharesModal open={issueNewSharesOpen} onClose={() => setIssueNewSharesOpen(false)} />\n <Tooltip\n title={<Typography>Manage the dividends that are paid out to shareholders (including yourself)</Typography>}\n >\n <Button onClick={() => setIssueDividendsOpen(true)}>Issue Dividends</Button>\n </Tooltip>\n <IssueDividendsModal open={issueDividendsOpen} onClose={() => setIssueDividendsOpen(false)} />\n </>\n );\n}\n\nfunction BribeButton(): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [open, setOpen] = useState(false);\n const canBribe =\n corp.determineValuation() >= CorporationConstants.BribeThreshold &&\n player.factions.filter((f) => Factions[f].getInfo().offersWork()).length > 0;\n\n function openBribe(): void {\n if (!canBribe) return;\n setOpen(true);\n }\n\n return (\n <>\n <Tooltip\n title={\n canBribe\n ? \"Use your Corporations power and influence to bribe Faction leaders in exchange for reputation\"\n : \"Your Corporation is not powerful enough to bribe Faction leaders\"\n }\n >\n <Button disabled={!canBribe} onClick={openBribe}>\n Bribe Factions\n </Button>\n </Tooltip>\n <BribeFactionModal open={open} onClose={() => setOpen(false)} />\n </>\n );\n}\n\ninterface IDividendsStatsProps {\n profit: number;\n}\nfunction DividendsStats({ profit }: IDividendsStatsProps): React.ReactElement {\n const corp = useCorporation();\n if (corp.dividendPercentage <= 0 || profit <= 0) return <></>;\n const totalDividends = (corp.dividendPercentage / 100) * profit;\n const retainedEarnings = profit - totalDividends;\n const dividendsPerShare = totalDividends / corp.totalShares;\n return (\n <StatsTable\n rows={[\n [\"Retained Profits (after dividends):\", <MoneyRate money={retainedEarnings} />],\n [\"Dividend Percentage:\", numeralWrapper.format(corp.dividendPercentage / 100, \"0%\")],\n [\"Dividends per share:\", <MoneyRate money={dividendsPerShare} />],\n [\"Your earnings as a shareholder:\", <MoneyRate money={corp.getDividends()} />],\n ]}\n />\n );\n}\n\n// Returns a string with general information about Corporation\nfunction BonusTime(): React.ReactElement {\n const corp = useCorporation();\n const storedTime = corp.storedCycles * CONSTANTS.MilliPerCycle;\n if (storedTime <= 15000) return <></>;\n return (\n <Typography>\n Bonus time: {convertTimeMsToTimeElapsedString(storedTime)}\n <br />\n <br />\n </Typography>\n );\n}\n","// React components for the levelable upgrade buttons on the overview panel\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CorporationUpgrade } from \"../data/CorporationUpgrades\";\nimport { LevelUpgrade } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n upgrade: CorporationUpgrade;\n rerender: () => void;\n}\n\nexport function LevelableUpgrade(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const data = props.upgrade;\n const level = corp.upgrades[data[0]];\n\n const baseCost = data[1];\n const priceMult = data[2];\n const cost = baseCost * Math.pow(priceMult, level);\n\n const tooltip = data[5];\n function onClick(): void {\n if (corp.funds < cost) return;\n try {\n LevelUpgrade(corp, props.upgrade);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n <Grid item xs={4}>\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row-reverse\">\n <Button disabled={corp.funds < cost} sx={{ mx: 1 }} onClick={onClick}>\n <MoneyCost money={cost} corp={corp} />\n </Button>\n <Tooltip title={tooltip}>\n <Typography>\n {data[4]} - lvl {level}\n </Typography>\n </Tooltip>\n </Box>\n </Grid>\n );\n}\n","// React Components for the Unlock upgrade buttons on the overview page\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CorporationUnlockUpgrade } from \"../data/CorporationUnlockUpgrades\";\nimport { useCorporation } from \"./Context\";\nimport { UnlockUpgrade as UU } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n upgradeData: CorporationUnlockUpgrade;\n rerender: () => void;\n}\n\nexport function UnlockUpgrade(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const data = props.upgradeData;\n const tooltip = data[3];\n function onClick(): void {\n if (corp.funds < data[1]) return;\n try {\n UU(corp, props.upgradeData);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n <Grid item xs={4}>\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row-reverse\">\n <Button disabled={corp.funds < data[1]} sx={{ mx: 1 }} onClick={onClick}>\n <MoneyCost money={data[1]} corp={corp} />\n </Button>\n <Tooltip title={tooltip}>\n <Typography>{data[2]}</Typography>\n </Tooltip>\n </Box>\n </Grid>\n );\n}\n","import React, { useState } from \"react\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function BribeFactionModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const factions = player.factions.filter((name: string) => {\n const info = Factions[name].getInfo();\n if (!info.offersWork()) return false;\n if (player.hasGangWith(name)) return false;\n return true;\n });\n const corp = useCorporation();\n const [money, setMoney] = useState<number | null>(0);\n const [stock, setStock] = useState<number | null>(0);\n const [selectedFaction, setSelectedFaction] = useState(factions.length > 0 ? factions[0] : \"\");\n const disabled =\n money === null ||\n stock === null ||\n (money === 0 && stock === 0) ||\n isNaN(money) ||\n isNaN(stock) ||\n money < 0 ||\n stock < 0 ||\n corp.funds < money ||\n stock > corp.numShares;\n\n function onMoneyChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setMoney(parseFloat(event.target.value));\n }\n\n function onStockChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setStock(parseFloat(event.target.value));\n }\n\n function changeFaction(event: SelectChangeEvent<string>): void {\n setSelectedFaction(event.target.value);\n }\n\n function repGain(money: number, stock: number): number {\n return (money + stock * corp.sharePrice) / CorporationConstants.BribeToRepRatio;\n }\n\n function getRepText(money: number, stock: number): string {\n if (money === 0 && stock === 0) return \"\";\n if (isNaN(money) || isNaN(stock) || money < 0 || stock < 0) {\n return \"ERROR: Invalid value(s) entered\";\n } else if (corp.funds < money) {\n return \"ERROR: You do not have this much money to bribe with\";\n } else if (stock > corp.numShares) {\n return \"ERROR: You do not have this many shares to bribe with\";\n } else {\n return (\n \"You will gain \" +\n numeralWrapper.formatReputation(repGain(money, stock)) +\n \" reputation with \" +\n selectedFaction +\n \" with this bribe\"\n );\n }\n }\n\n function bribe(money: number, stock: number): void {\n const fac = Factions[selectedFaction];\n if (disabled) return;\n const rep = repGain(money, stock);\n dialogBoxCreate(\n \"You gained \" + numeralWrapper.formatReputation(rep) + \" reputation with \" + fac.name + \" by bribing them.\",\n );\n fac.playerReputation += rep;\n corp.funds = corp.funds - money;\n corp.numShares -= stock;\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation.\n </Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>Faction:</Typography>\n <Select value={selectedFaction} onChange={changeFaction}>\n {factions.map((name: string) => {\n const info = Factions[name].getInfo();\n if (!info.offersWork()) return;\n if (player.hasGangWith(name)) return;\n return (\n <MenuItem key={name} value={name}>\n {name}\n </MenuItem>\n );\n })}\n </Select>\n </Box>\n <Typography>{getRepText(money ? money : 0, stock ? stock : 0)}</Typography>\n <TextField onChange={onMoneyChange} placeholder=\"Corporation funds\" />\n <TextField sx={{ mx: 1 }} onChange={onStockChange} placeholder=\"Stock Shares\" />\n <Button disabled={disabled} sx={{ mx: 1 }} onClick={() => bribe(money ? money : 0, stock ? stock : 0)}>\n Bribe\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation } from \"./Context\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { ICorporation } from \"../ICorporation\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../ui/React/Money\";\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player sell Corporation shares\n// This is created when the player clicks the \"Sell Shares\" button in the overview panel\nexport function SellSharesModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [shares, setShares] = useState<number | null>(null);\n\n const disabled = shares === null || isNaN(shares) || shares <= 0 || shares > corp.numShares;\n\n function changeShares(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(Math.round(parseFloat(event.target.value)));\n }\n\n function ProfitIndicator(props: { shares: number | null; corp: ICorporation }): React.ReactElement {\n if (props.shares === null) return <></>;\n if (isNaN(props.shares) || props.shares <= 0) {\n return <>ERROR: Invalid value entered for number of shares to sell</>;\n } else if (props.shares > corp.numShares) {\n return <>You don't have this many shares to sell!</>;\n } else {\n const stockSaleResults = corp.calculateShareSale(props.shares);\n const profit = stockSaleResults[0];\n return (\n <>\n Sell {props.shares} shares for a total of {numeralWrapper.formatMoney(profit)}\n </>\n );\n }\n }\n\n function sell(): void {\n if (shares === null) return;\n if (disabled) return;\n const stockSaleResults = corp.calculateShareSale(shares);\n const profit = stockSaleResults[0];\n const newSharePrice = stockSaleResults[1];\n const newSharesUntilUpdate = stockSaleResults[2];\n\n corp.numShares -= shares;\n if (isNaN(corp.issuedShares)) {\n console.error(`Corporation issuedShares is NaN: ${corp.issuedShares}`);\n const res = corp.issuedShares;\n if (isNaN(res)) {\n corp.issuedShares = 0;\n } else {\n corp.issuedShares = res;\n }\n }\n corp.issuedShares += shares;\n corp.sharePrice = newSharePrice;\n corp.shareSalesUntilPriceUpdate = newSharesUntilUpdate;\n corp.shareSaleCooldown = CorporationConstants.SellSharesCooldown;\n player.gainMoney(profit, \"corporation\");\n props.onClose();\n dialogBoxCreate(\n <>\n Sold {numeralWrapper.formatMoney(shares)} shares for\n <Money money={profit} />. The corporation's stock price fell to <Money money={corp.sharePrice} />\n as a result of dilution.\n </>,\n );\n\n props.rerender();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) sell();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the number of shares you would like to sell. The money from selling your shares will go directly to you\n (NOT your Corporation).\n <br />\n <br />\n Selling your shares will cause your corporation's stock price to fall due to dilution. Furthermore, selling a\n large number of shares all at once will have an immediate effect in reducing your stock price.\n <br />\n <br />\n The current price of your company's stock is {numeralWrapper.formatMoney(corp.sharePrice)}\n </Typography>\n <ProfitIndicator shares={shares} corp={corp} />\n <br />\n <TextField\n variant=\"standard\"\n autoFocus\n type=\"number\"\n placeholder=\"Shares to sell\"\n onChange={changeShares}\n onKeyDown={onKeyDown}\n />\n <Button disabled={disabled} onClick={sell} sx={{ mx: 1 }}>\n Sell shares\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player buyback shares\n// This is created when the player clicks the \"Buyback Shares\" button in the overview panel\nexport function BuybackSharesModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [shares, setShares] = useState<number | null>(null);\n\n function changeShares(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(Math.round(parseFloat(event.target.value)));\n }\n\n const currentStockPrice = corp.sharePrice;\n const buybackPrice = currentStockPrice * 1.1;\n const disabled =\n shares === null ||\n isNaN(shares) ||\n shares <= 0 ||\n shares > corp.issuedShares ||\n shares * buybackPrice > player.money;\n\n function buy(): void {\n if (disabled) return;\n if (shares === null) return;\n corp.numShares += shares;\n if (isNaN(corp.issuedShares)) {\n console.warn(\"Corporation issuedShares is NaN: \" + corp.issuedShares);\n console.warn(\"Converting to number now\");\n const res = corp.issuedShares;\n if (isNaN(res)) {\n corp.issuedShares = 0;\n } else {\n corp.issuedShares = res;\n }\n }\n corp.issuedShares -= shares;\n player.loseMoney(shares * buybackPrice, \"corporation\");\n props.onClose();\n props.rerender();\n }\n\n function CostIndicator(): React.ReactElement {\n if (shares === null) return <></>;\n if (isNaN(shares) || shares <= 0) {\n return <>ERROR: Invalid value entered for number of shares to buyback</>;\n } else if (shares > corp.issuedShares) {\n return (\n <>\n There are not this many shares available to buy back. There are only{\" \"}\n {numeralWrapper.formatBigNumber(corp.issuedShares)} outstanding shares.\n </>\n );\n } else {\n return (\n <>\n Purchase {shares} shares for a total of {numeralWrapper.formatMoney(shares * buybackPrice)}\n </>\n );\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) buy();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the number of outstanding shares you would like to buy back. These shares must be bought at a 10% premium.\n However, repurchasing shares from the market tends to lead to an increase in stock price.\n <br />\n <br />\n To purchase these shares, you must use your own money (NOT your Corporation's funds).\n <br />\n <br />\n The current buyback price of your company's stock is {numeralWrapper.formatMoney(buybackPrice)}. Your company\n currently has {numeralWrapper.formatBigNumber(corp.issuedShares)} outstanding stock shares.\n </Typography>\n <CostIndicator />\n <br />\n <TextField\n autoFocus={true}\n type=\"number\"\n placeholder=\"Shares to buyback\"\n onChange={changeShares}\n onKeyDown={onKeyDown}\n />\n <Button disabled={disabled} onClick={buy}>\n Buy shares\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { IssueDividends } from \"../Actions\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Create a popup that lets the player issue & manage dividends\n// This is created when the player clicks the \"Issue Dividends\" button in the overview panel\nexport function IssueDividendsModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [percent, setPercent] = useState(0);\n\n const canIssue = !isNaN(percent) && percent >= 0 && percent <= CorporationConstants.DividendMaxPercentage * 100;\n function issueDividends(): void {\n if (!canIssue) return;\n if (percent === null) return;\n try {\n IssueDividends(corp, percent / 100);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) issueDividends();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setPercent(0);\n else {\n let p = parseFloat(event.target.value);\n if (p > 100) p = 100;\n if (p < 0) p = 0;\n setPercent(p);\n }\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Dividends are a distribution of a portion of the corporation's profits to the shareholders. This includes\n yourself, as well.\n <br />\n <br />\n In order to issue dividends, simply allocate some percentage of your corporation's profits to dividends. This\n percentage must be an integer between 0 and 100. (A percentage of 0 means no dividends will be issued)\n <br />\n <br />\n Two important things to note:\n <br />\n * Issuing dividends will negatively affect your corporation's stock price\n <br />\n <br />\n Example: Assume your corporation makes $100m / sec in profit and you allocate 40% of that towards dividends.\n That means your corporation will gain $60m / sec in funds and the remaining $40m / sec will be paid as\n dividends. Since your corporation starts with 1 billion shares, every shareholder will be paid $0.04 per share\n per second before taxes.\n </Typography>\n <TextField\n autoFocus\n value={percent}\n onChange={onChange}\n onKeyDown={onKeyDown}\n placeholder=\"Dividend %\"\n type=\"number\"\n />\n <Button disabled={!canIssue} sx={{ mx: 1 }} onClick={issueDividends}>\n Allocate Dividend Percentage\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { getRandomInt } from \"../../utils/helpers/getRandomInt\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IEffectTextProps {\n shares: number | null;\n}\n\nfunction EffectText(props: IEffectTextProps): React.ReactElement {\n const corp = useCorporation();\n if (props.shares === null) return <></>;\n const newSharePrice = Math.round(corp.sharePrice * 0.9);\n const maxNewSharesUnrounded = Math.round(corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n let newShares = props.shares;\n if (isNaN(newShares)) {\n return <Typography>Invalid input</Typography>;\n }\n\n // Round to nearest ten-millionth\n newShares /= 10e6;\n newShares = Math.round(newShares) * 10e6;\n\n if (newShares < 10e6) {\n return <Typography>Must issue at least 10 million new shares</Typography>;\n }\n\n if (newShares > maxNewShares) {\n return <Typography>You cannot issue that many shares</Typography>;\n }\n\n return (\n <Typography>\n Issue {numeralWrapper.format(newShares, \"0.000a\")} new shares for{\" \"}\n {numeralWrapper.formatMoney(newShares * newSharePrice)}?\n </Typography>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Create a popup that lets the player issue new shares\n// This is created when the player clicks the \"Issue New Shares\" buttons in the overview panel\nexport function IssueNewSharesModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState<number | null>(null);\n const maxNewSharesUnrounded = Math.round(corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n\n const newShares = Math.round((shares || 0) / 10e6) * 10e6;\n const disabled = shares === null || isNaN(newShares) || newShares < 10e6 || newShares > maxNewShares;\n\n function issueNewShares(): void {\n if (shares === null) return;\n if (disabled) return;\n\n const newSharePrice = Math.round(corp.sharePrice * 0.9);\n let newShares = shares;\n\n // Round to nearest ten-millionth\n newShares = Math.round(newShares / 10e6) * 10e6;\n\n const profit = newShares * newSharePrice;\n corp.issueNewSharesCooldown = CorporationConstants.IssueNewSharesCooldown;\n corp.totalShares += newShares;\n\n // Determine how many are bought by private investors\n // Private investors get up to 50% at most\n // Round # of private shares to the nearest millionth\n let privateShares = getRandomInt(0, Math.round(newShares / 2));\n privateShares = Math.round(privateShares / 1e6) * 1e6;\n\n corp.issuedShares += newShares - privateShares;\n corp.funds = corp.funds + profit;\n corp.immediatelyUpdateSharePrice();\n props.onClose();\n dialogBoxCreate(\n `Issued ${numeralWrapper.format(newShares, \"0.000a\")} and raised ` +\n `${numeralWrapper.formatMoney(profit)}. ${numeralWrapper.format(privateShares, \"0.000a\")} ` +\n `of these shares were bought by private investors.<br><br>` +\n `Stock price decreased to ${numeralWrapper.formatMoney(corp.sharePrice)}`,\n );\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) issueNewShares();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(parseFloat(event.target.value));\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n You can issue new equity shares (i.e. stocks) in order to raise capital for your corporation.\n <br />\n <br />\n * You can issue at most {numeralWrapper.formatMoney(maxNewShares)} new shares\n <br />\n * New shares are sold at a 10% discount\n <br />\n * You can only issue new shares once every 12 hours\n <br />\n * Issuing new shares causes dilution, resulting in a decrease in stock price and lower dividends per share\n <br />\n * Number of new shares issued must be a multiple of 10 million\n <br />\n <br />\n When you choose to issue new equity, private shareholders have first priority for up to 50% of the new shares.\n If they choose to exercise this option, these newly issued shares become private, restricted shares, which means\n you cannot buy them back.\n </Typography>\n <EffectText shares={shares} />\n <TextField autoFocus placeholder=\"# New Shares\" onChange={onChange} onKeyDown={onKeyDown} />\n <Button disabled={disabled} onClick={issueNewShares} sx={{ mx: 1 }}>\n Issue New Shares\n </Button>\n </Modal>\n );\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useCorporation } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function FindInvestorsModal(props: IProps): React.ReactElement {\n const corporation = useCorporation();\n const val = corporation.determineValuation();\n if (corporation.fundingRound >= CorporationConstants.FundingRoundShares.length || corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length) return <></>;\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n\n function findInvestors(): void {\n corporation.fundingRound++;\n corporation.addFunds(funding);\n corporation.numShares -= investShares;\n props.rerender();\n props.onClose();\n }\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n An investment firm has offered you {numeralWrapper.formatMoney(funding)} in funding in exchange for a{\" \"}\n {numeralWrapper.format(percShares * 100, \"0.000a\")}% stake in the company (\n {numeralWrapper.format(investShares, \"0.000a\")} shares).\n <br />\n <br />\n Do you accept or reject this offer?\n <br />\n <br />\n Hint: Investment firms will offer more money if your corporation is turning a profit\n </Typography>\n <Button onClick={findInvestors}>Accept</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function GoPublicModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState(\"\");\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n\n function goPublic(): void {\n const numShares = parseFloat(shares);\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n if (isNaN(numShares)) {\n dialogBoxCreate(\"Invalid value for number of issued shares\");\n return;\n }\n if (numShares > corp.numShares) {\n dialogBoxCreate(\"Error: You don't have that many shares to issue!\");\n return;\n }\n corp.public = true;\n corp.sharePrice = initialSharePrice;\n corp.issuedShares = numShares;\n corp.numShares -= numShares;\n corp.addFunds(numShares * initialSharePrice);\n props.rerender();\n dialogBoxCreate(\n `You took your ${corp.name} public and earned ` +\n `${numeralWrapper.formatMoney(numShares * initialSharePrice)} in your IPO`,\n );\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) goPublic();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setShares(event.target.value);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the number of shares you would like to issue for your IPO. These shares will be publicly sold and you will\n no longer own them. Your Corporation will receive {numeralWrapper.formatMoney(initialSharePrice)} per share (the\n IPO money will be deposited directly into your Corporation's funds).\n <br />\n <br />\n You have a total of {numeralWrapper.format(corp.numShares, \"0.000a\")} of shares that you can issue.\n </Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <TextField\n value={shares}\n onChange={onChange}\n autoFocus\n type=\"number\"\n placeholder=\"Shares to issue\"\n onKeyDown={onKeyDown}\n />\n <Button\n disabled={parseFloat(shares) < 0 || parseFloat(shares) > corp.numShares}\n sx={{ mx: 1 }}\n onClick={goPublic}\n >\n Go Public\n </Button>\n </Box>\n </Modal>\n );\n}\n","import { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport React, { useState } from \"react\";\nimport { Intro } from \"./Intro\";\nimport { Game } from \"./Game\";\nimport { Location } from \"../../Locations/Location\";\nimport { use } from \"../../ui/Context\";\nimport { calculateSkill } from \"../../PersonObjects/formulas/skill\";\n\ninterface IProps {\n location: Location;\n}\n\nfunction calcRawDiff(player: IPlayer, stats: number, startingDifficulty: number): number {\n const difficulty = startingDifficulty - Math.pow(stats, 0.9) / 250 - player.intelligence / 1600;\n if (difficulty < 0) return 0;\n if (difficulty > 3) return 3;\n return difficulty;\n}\n\nfunction calcDifficulty(player: IPlayer, startingDifficulty: number): number {\n const totalStats = player.strength + player.defense + player.dexterity + player.agility + player.charisma;\n return calcRawDiff(player, totalStats, startingDifficulty);\n}\n\nfunction calcReward(player: IPlayer, startingDifficulty: number): number {\n const xpMult = 10 * 60 * 15;\n const total =\n calculateSkill(player.strength_exp_mult * xpMult, player.strength_mult) +\n calculateSkill(player.defense_exp_mult * xpMult, player.defense_mult) +\n calculateSkill(player.agility_exp_mult * xpMult, player.agility_mult) +\n calculateSkill(player.dexterity_exp_mult * xpMult, player.dexterity_mult) +\n calculateSkill(player.charisma_exp_mult * xpMult, player.charisma_mult);\n return calcRawDiff(player, total, startingDifficulty);\n}\n\nexport function InfiltrationRoot(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [start, setStart] = useState(false);\n\n if (props.location.infiltrationData === undefined) throw new Error(\"Trying to do infiltration on invalid location.\");\n const startingDifficulty = props.location.infiltrationData.startingSecurityLevel;\n const difficulty = calcDifficulty(player, startingDifficulty);\n const reward = calcReward(player, startingDifficulty);\n console.log(`${difficulty} ${reward}`);\n\n function cancel(): void {\n router.toCity();\n }\n\n if (!start) {\n return (\n <Intro\n Location={props.location}\n Difficulty={difficulty}\n MaxLevel={props.location.infiltrationData.maxClearanceLevel}\n start={() => setStart(true)}\n cancel={cancel}\n />\n );\n }\n\n return (\n <Game\n StartingDifficulty={startingDifficulty}\n Difficulty={difficulty}\n Reward={reward}\n MaxLevel={props.location.infiltrationData.maxClearanceLevel}\n />\n );\n}\n","import React from \"react\";\nimport { Location } from \"../../Locations/Location\";\nimport Grid from \"@mui/material/Grid\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\ninterface IProps {\n Location: Location;\n Difficulty: number;\n MaxLevel: number;\n start: () => void;\n cancel: () => void;\n}\n\nfunction arrowPart(color: string, length: number): JSX.Element {\n let arrow = \"\";\n if (length <= 0) length = 0;\n else if (length > 13) length = 13;\n else {\n length--;\n arrow = \">\";\n }\n return (\n <span style={{ color: color }}>\n {\"=\".repeat(length)}\n {arrow}\n {\" \".repeat(13 - arrow.length - length)}\n </span>\n );\n}\n\nfunction coloredArrow(difficulty: number): JSX.Element {\n if (difficulty === 0) {\n return (\n <span style={{ color: \"white\" }}>\n {\">\"}\n {\" \".repeat(38)}\n </span>\n );\n } else {\n return (\n <>\n {arrowPart(\"white\", difficulty * 13)}\n {arrowPart(\"orange\", (difficulty - 1) * 13)}\n {arrowPart(\"red\", (difficulty - 2) * 13)}\n </>\n );\n }\n}\n\nexport function Intro(props: IProps): React.ReactElement {\n return (\n <>\n <Grid container spacing={3}>\n <Grid item xs={10}>\n <Typography variant=\"h4\">Infiltrating {props.Location.name}</Typography>\n </Grid>\n <Grid item xs={10}>\n <Typography variant=\"h5\" color=\"primary\">\n Maximum level: {props.MaxLevel}\n </Typography>\n </Grid>\n <Grid item xs={10}>\n <Typography variant=\"h5\" color=\"primary\">\n Difficulty: {numeralWrapper.format(props.Difficulty * 33.3333, \"0\")} / 100\n </Typography>\n </Grid>\n\n {props.Difficulty > 1.5 && (\n <Grid item xs={10}>\n <Typography variant=\"h5\" color=\"primary\">\n Warning: This location is too heavily guarded for your current stats, try training or finding an easier\n location.\n </Typography>\n </Grid>\n )}\n\n <Grid item xs={10}>\n <Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>[{coloredArrow(props.Difficulty)}]</Typography>\n <Typography\n sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}\n >{` ^ ^ ^ ^`}</Typography>\n <Typography\n sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}\n >{` Trivial Normal Hard Impossible`}</Typography>\n </Grid>\n <Grid item xs={10}>\n <Typography>\n Infiltration is a series of short minigames that get progressively harder. You take damage for failing them.\n Reaching the maximum level rewards you with intel you can trade for money or reputation.\n </Typography>\n <br />\n <Typography>\n The minigames you play are randomly selected. It might take you few tries to get used to them.\n </Typography>\n <br />\n <Typography>No game require use of the mouse.</Typography>\n <br />\n <Typography>Spacebar is the default action/confirm button.</Typography>\n <br />\n <Typography>Everything that uses arrow can also use WASD</Typography>\n <br />\n <Typography>Sometimes the rest of the keyboard is used.</Typography>\n </Grid>\n <Grid item xs={3}>\n <Button onClick={props.start}>Start</Button>\n </Grid>\n <Grid item xs={3}>\n <Button onClick={props.cancel}>Cancel</Button>\n </Grid>\n </Grid>\n </>\n );\n}\n","import { use } from \"../../ui/Context\";\nimport React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport { Countdown } from \"./Countdown\";\nimport { BracketGame } from \"./BracketGame\";\nimport { SlashGame } from \"./SlashGame\";\nimport { BackwardGame } from \"./BackwardGame\";\nimport { BribeGame } from \"./BribeGame\";\nimport { CheatCodeGame } from \"./CheatCodeGame\";\nimport { Cyberpunk2077Game } from \"./Cyberpunk2077Game\";\nimport { MinesweeperGame } from \"./MinesweeperGame\";\nimport { WireCuttingGame } from \"./WireCuttingGame\";\nimport { Victory } from \"./Victory\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n StartingDifficulty: number;\n Difficulty: number;\n Reward: number;\n MaxLevel: number;\n}\n\nenum Stage {\n Countdown = 0,\n Minigame,\n Result,\n Sell,\n}\n\nconst minigames = [\n SlashGame,\n BracketGame,\n BackwardGame,\n BribeGame,\n CheatCodeGame,\n Cyberpunk2077Game,\n MinesweeperGame,\n WireCuttingGame,\n];\n\nexport function Game(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [level, setLevel] = useState(1);\n const [stage, setStage] = useState(Stage.Countdown);\n const [results, setResults] = useState(\"\");\n const [gameIds, setGameIds] = useState({\n lastGames: [-1, -1],\n id: Math.floor(Math.random() * minigames.length),\n });\n\n function nextGameId(): number {\n let id = gameIds.lastGames[0];\n const ids = [gameIds.lastGames[0], gameIds.lastGames[1], gameIds.id];\n while (ids.includes(id)) {\n id = Math.floor(Math.random() * minigames.length);\n }\n return id;\n }\n\n function setupNextGame(): void {\n setGameIds({\n lastGames: [gameIds.lastGames[1], gameIds.id],\n id: nextGameId(),\n });\n }\n\n function success(): void {\n pushResult(true);\n if (level === props.MaxLevel) {\n setStage(Stage.Sell);\n } else {\n setStage(Stage.Countdown);\n setLevel(level + 1);\n }\n setupNextGame();\n }\n\n function pushResult(win: boolean): void {\n setResults((old) => {\n let next = old;\n next += win ? \"✓\" : \"✗\";\n if (next.length > 15) next = next.slice(1);\n return next;\n });\n }\n\n function failure(options?: { automated: boolean }): void {\n setStage(Stage.Countdown);\n pushResult(false);\n // Kill the player immediately if they use automation, so\n // it's clear they're not meant to\n const damage = options?.automated ? player.hp : props.StartingDifficulty * 3;\n if (player.takeDamage(damage)) {\n router.toCity();\n return;\n }\n setupNextGame();\n }\n\n function cancel(): void {\n router.toCity();\n return;\n }\n\n let stageComponent: React.ReactNode;\n switch (stage) {\n case Stage.Countdown:\n stageComponent = <Countdown onFinish={() => setStage(Stage.Minigame)} />;\n break;\n case Stage.Minigame: {\n const MiniGame = minigames[gameIds.id];\n stageComponent = <MiniGame onSuccess={success} onFailure={failure} difficulty={props.Difficulty + level / 50} />;\n break;\n }\n case Stage.Sell:\n stageComponent = (\n <Victory\n StartingDifficulty={props.StartingDifficulty}\n Difficulty={props.Difficulty}\n Reward={props.Reward}\n MaxLevel={props.MaxLevel}\n />\n );\n break;\n }\n\n function Progress(): React.ReactElement {\n return (\n <Typography variant=\"h4\">\n <span style={{ color: \"gray\" }}>{results.slice(0, results.length - 1)}</span>\n {results[results.length - 1]}\n </Typography>\n );\n }\n\n return (\n <>\n <Grid container spacing={3}>\n <Grid item xs={3}>\n <Button onClick={cancel}>Cancel</Button>\n </Grid>\n <Grid item xs={3}>\n <Typography>\n Level: {level} / {props.MaxLevel}\n </Typography>\n <Progress />\n </Grid>\n\n <Grid item xs={12}>\n {stageComponent}\n </Grid>\n </Grid>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport Grid from \"@mui/material/Grid\";\n\nimport Typography from \"@mui/material/Typography\";\ninterface IProps {\n onFinish: () => void;\n}\n\nexport function Countdown(props: IProps): React.ReactElement {\n const [x, setX] = useState(3);\n useEffect(() => {\n if (x === 0) {\n props.onFinish();\n return;\n }\n setTimeout(() => setX(x - 1), 200);\n });\n\n return (\n <>\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <Typography variant=\"h4\">Get Ready!</Typography>\n <Typography variant=\"h4\">{x}</Typography>\n </Grid>\n </Grid>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { random } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 8000, min: 2, max: 3 },\n Normal: { timer: 6000, min: 4, max: 5 },\n Hard: { timer: 4000, min: 4, max: 6 },\n Impossible: { timer: 2500, min: 7, max: 7 },\n};\n\nfunction generateLeftSide(difficulty: Difficulty): string {\n let str = \"\";\n const length = random(difficulty.min, difficulty.max);\n for (let i = 0; i < length; i++) {\n str += [\"[\", \"<\", \"(\", \"{\"][Math.floor(Math.random() * 4)];\n }\n\n return str;\n}\n\nfunction getChar(event: KeyboardEvent): string {\n if (event.key === \")\") return \")\";\n if (event.key === \"]\") return \"]\";\n if (event.key === \"}\") return \"}\";\n if (event.key === \">\") return \">\";\n return \"\";\n}\n\nfunction match(left: string, right: string): boolean {\n return (\n (left === \"[\" && right === \"]\") ||\n (left === \"<\" && right === \">\") ||\n (left === \"(\" && right === \")\") ||\n (left === \"{\" && right === \"}\")\n );\n}\n\nexport function BracketGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [right, setRight] = useState(\"\");\n const [left] = useState(generateLeftSide(difficulty));\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const char = getChar(event);\n if (!char) return;\n if (!match(left[left.length - right.length - 1], char)) {\n props.onFailure();\n return;\n }\n if (left.length === right.length + 1) {\n props.onSuccess();\n return;\n }\n setRight(right + char);\n }\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Close the brackets</Typography>\n <Typography style={{ fontSize: \"5em\" }}>\n {`${left}${right}`}\n <BlinkingCursor />\n </Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { interpolate } from \"./Difficulty\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n window: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { window: 600 },\n Normal: { window: 325 },\n Hard: { window: 250 },\n Impossible: { window: 150 },\n};\n\nexport function SlashGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { window: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const [phase, setPhase] = useState(0);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (event.key !== \" \") return;\n if (phase !== 2) {\n props.onFailure();\n } else {\n props.onSuccess();\n }\n }\n\n useEffect(() => {\n let id = window.setTimeout(() => {\n setPhase(1);\n id = window.setTimeout(() => {\n setPhase(2);\n id = window.setTimeout(() => setPhase(0), difficulty.window);\n }, 250);\n }, Math.random() * 3250 + 1500 - (250 + difficulty.window));\n return () => {\n clearInterval(id);\n };\n }, []);\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={5000} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Slash when his guard is down!</Typography>\n {phase === 0 && <Typography variant=\"h4\">Guarding ...</Typography>}\n {phase === 1 && <Typography variant=\"h4\">Preparing?</Typography>}\n {phase === 2 && <Typography variant=\"h4\">ATTACKING!</Typography>}\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { random } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 16000, min: 3, max: 4 },\n Normal: { timer: 12500, min: 2, max: 3 },\n Hard: { timer: 15000, min: 3, max: 4 },\n Impossible: { timer: 8000, min: 4, max: 4 },\n};\n\nexport function BackwardGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [answer] = useState(makeAnswer(difficulty));\n const [guess, setGuess] = useState(\"\");\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (event.key === \"Backspace\") return;\n const nextGuess = guess + event.key.toUpperCase();\n if (!answer.startsWith(nextGuess)) props.onFailure();\n else if (answer === nextGuess) props.onSuccess();\n else setGuess(nextGuess);\n }\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Type it backward</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n <Grid item xs={6}>\n <Typography style={{ transform: \"scaleX(-1)\" }}>{answer}</Typography>\n </Grid>\n <Grid item xs={6}>\n <Typography>\n {guess}\n <BlinkingCursor />\n </Typography>\n </Grid>\n </Grid>\n );\n}\n\nfunction makeAnswer(difficulty: Difficulty): string {\n const length = random(difficulty.min, difficulty.max);\n let answer = \"\";\n for (let i = 0; i < length; i++) {\n if (i > 0) answer += \" \";\n answer += words[Math.floor(Math.random() * words.length)];\n }\n\n return answer;\n}\n\nconst words = [\n \"ALGORITHM\",\n \"ANALOG\",\n \"APP\",\n \"APPLICATION\",\n \"ARRAY\",\n \"BACKUP\",\n \"BANDWIDTH\",\n \"BINARY\",\n \"BIT\",\n \"BITE\",\n \"BITMAP\",\n \"BLOG\",\n \"BLOGGER\",\n \"BOOKMARK\",\n \"BOOT\",\n \"BROADBAND\",\n \"BROWSER\",\n \"BUFFER\",\n \"BUG\",\n \"BUS\",\n \"BYTE\",\n \"CACHE\",\n \"CAPS LOCK\",\n \"CAPTCHA\",\n \"CD\",\n \"CD-ROM\",\n \"CLIENT\",\n \"CLIPBOARD\",\n \"CLOUD\",\n \"COMPUTING\",\n \"COMMAND\",\n \"COMPILE\",\n \"COMPRESS\",\n \"COMPUTER\",\n \"CONFIGURE\",\n \"COOKIE\",\n \"COPY\",\n \"CPU\",\n \"CYBERCRIME\",\n \"CYBERSPACE\",\n \"DASHBOARD\",\n \"DATA\",\n \"MINING\",\n \"DATABASE\",\n \"DEBUG\",\n \"DECOMPRESS\",\n \"DELETE\",\n \"DESKTOP\",\n \"DEVELOPMENT\",\n \"DIGITAL\",\n \"DISK\",\n \"DNS\",\n \"DOCUMENT\",\n \"DOMAIN\",\n \"DOMAIN NAME\",\n \"DOT\",\n \"DOT MATRIX\",\n \"DOWNLOAD\",\n \"DRAG\",\n \"DVD\",\n \"DYNAMIC\",\n \"EMAIL\",\n \"EMOTICON\",\n \"ENCRYPT\",\n \"ENCRYPTION\",\n \"ENTER\",\n \"EXABYTE\",\n \"FAQ\",\n \"FILE\",\n \"FINDER\",\n \"FIREWALL\",\n \"FIRMWARE\",\n \"FLAMING\",\n \"FLASH\",\n \"FLASH DRIVE\",\n \"FLOPPY DISK\",\n \"FLOWCHART\",\n \"FOLDER\",\n \"FONT\",\n \"FORMAT\",\n \"FRAME\",\n \"FREEWARE\",\n \"GIGABYTE\",\n \"GRAPHICS\",\n \"HACK\",\n \"HACKER\",\n \"HARDWARE\",\n \"HOME PAGE\",\n \"HOST\",\n \"HTML\",\n \"HYPERLINK\",\n \"HYPERTEXT\",\n \"ICON\",\n \"INBOX\",\n \"INTEGER\",\n \"INTERFACE\",\n \"INTERNET\",\n \"IP ADDRESS\",\n \"ITERATION\",\n \"JAVA\",\n \"JOYSTICK\",\n \"JUNKMAIL\",\n \"KERNEL\",\n \"KEY\",\n \"KEYBOARD\",\n \"KEYWORD\",\n \"LAPTOP\",\n \"LASER PRINTER\",\n \"LINK\",\n \"LINUX\",\n \"LOG OUT\",\n \"LOGIC\",\n \"LOGIN\",\n \"LURKING\",\n \"MACINTOSH\",\n \"MACRO\",\n \"MAINFRAME\",\n \"MALWARE\",\n \"MEDIA\",\n \"MEMORY\",\n \"MIRROR\",\n \"MODEM\",\n \"MONITOR\",\n \"MOTHERBOARD\",\n \"MOUSE\",\n \"MULTIMEDIA\",\n \"NET\",\n \"NETWORK\",\n \"NODE\",\n \"NOTEBOOK\",\n \"COMPUTER\",\n \"OFFLINE\",\n \"ONLINE\",\n \"OPENSOURCE\",\n \"OPERATING\",\n \"SYSTEM\",\n \"OPTION\",\n \"OUTPUT\",\n \"PAGE\",\n \"PASSWORD\",\n \"PASTE\",\n \"PATH\",\n \"PHISHING\",\n \"PIRACY\",\n \"PIRATE\",\n \"PLATFORM\",\n \"PLUGIN\",\n \"PODCAST\",\n \"POPUP\",\n \"PORTAL\",\n \"PRINT\",\n \"PRINTER\",\n \"PRIVACY\",\n \"PROCESS\",\n \"PROGRAM\",\n \"PROGRAMMER\",\n \"PROTOCOL\",\n \"QUEUE\",\n \"QWERTY\",\n \"RAM\",\n \"REALTIME\",\n \"REBOOT\",\n \"RESOLUTION\",\n \"RESTORE\",\n \"ROM\",\n \"ROOT\",\n \"ROUTER\",\n \"RUNTIME\",\n \"SAVE\",\n \"SCAN\",\n \"SCANNER\",\n \"SCREEN\",\n \"SCREENSHOT\",\n \"SCRIPT\",\n \"SCROLL\",\n \"SCROLL\",\n \"SEARCH\",\n \"ENGINE\",\n \"SECURITY\",\n \"SERVER\",\n \"SHAREWARE\",\n \"SHELL\",\n \"SHIFT\",\n \"SHIFT KEY\",\n \"SNAPSHOT\",\n \"SOCIAL NETWORKING\",\n \"SOFTWARE\",\n \"SPAM\",\n \"SPAMMER\",\n \"SPREADSHEET\",\n \"SPYWARE\",\n \"STATUS\",\n \"STORAGE\",\n \"SUPERCOMPUTER\",\n \"SURF\",\n \"SYNTAX\",\n \"TABLE\",\n \"TAG\",\n \"TERMINAL\",\n \"TEMPLATE\",\n \"TERABYTE\",\n \"TEXT EDITOR\",\n \"THREAD\",\n \"TOOLBAR\",\n \"TRASH\",\n \"TROJAN HORSE\",\n \"TYPEFACE\",\n \"UNDO\",\n \"UNIX\",\n \"UPLOAD\",\n \"URL\",\n \"USER\",\n \"USER INTERFACE\",\n \"USERNAME\",\n \"UTILITY\",\n \"VERSION\",\n \"VIRTUAL\",\n \"VIRTUAL MEMORY\",\n \"VIRUS\",\n \"WEB\",\n \"WEBMASTER\",\n \"WEBSITE\",\n \"WIDGET\",\n \"WIKI\",\n \"WINDOW\",\n \"WINDOWS\",\n \"WIRELESS\",\n \"PROCESSOR\",\n \"WORKSTATION\",\n \"WEB\",\n \"WORM\",\n \"WWW\",\n \"XML\",\n \"ZIP\",\n];\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { interpolate } from \"./Difficulty\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n size: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 12000, size: 6 },\n Normal: { timer: 9000, size: 8 },\n Hard: { timer: 5000, size: 9 },\n Impossible: { timer: 2500, size: 12 },\n};\n\nexport function BribeGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, size: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [choices] = useState(makeChoices(difficulty));\n const [index, setIndex] = useState(0);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const k = event.key;\n if (k === \" \") {\n if (positive.includes(choices[index])) props.onSuccess();\n else props.onFailure();\n return;\n }\n\n let newIndex = index;\n if ([\"ArrowUp\", \"w\", \"ArrowRight\", \"d\"].includes(k)) newIndex++;\n if ([\"ArrowDown\", \"s\", \"ArrowLeft\", \"a\"].includes(k)) newIndex--;\n while (newIndex < 0) newIndex += choices.length;\n while (newIndex > choices.length - 1) newIndex -= choices.length;\n setIndex(newIndex);\n }\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Say something nice about the guard.</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n <Grid item xs={6}>\n <Typography variant=\"h5\" color=\"primary\">\n ↑\n </Typography>\n <Typography variant=\"h5\" color=\"primary\">\n {choices[index]}\n </Typography>\n <Typography variant=\"h5\" color=\"primary\">\n ↓\n </Typography>\n </Grid>\n </Grid>\n );\n}\n\nfunction shuffleArray(array: string[]): void {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n}\n\nfunction makeChoices(difficulty: Difficulty): string[] {\n const choices = [];\n choices.push(positive[Math.floor(Math.random() * positive.length)]);\n for (let i = 0; i < difficulty.size; i++) {\n const option = negative[Math.floor(Math.random() * negative.length)];\n if (choices.includes(option)) {\n i--;\n continue;\n }\n choices.push(option);\n }\n shuffleArray(choices);\n return choices;\n}\n\nconst positive = [\n \"affectionate\",\n \"agreeable\",\n \"bright\",\n \"charming\",\n \"creative\",\n \"determined\",\n \"energetic\",\n \"friendly\",\n \"funny\",\n \"generous\",\n \"polite\",\n \"likable\",\n \"diplomatic\",\n \"helpful\",\n \"giving\",\n \"kind\",\n \"hardworking\",\n \"patient\",\n \"dynamic\",\n \"loyal\",\n];\n\nconst negative = [\n \"aggressive\",\n \"aloof\",\n \"arrogant\",\n \"big-headed\",\n \"boastful\",\n \"boring\",\n \"bossy\",\n \"careless\",\n \"clingy\",\n \"couch potato\",\n \"cruel\",\n \"cynical\",\n \"grumpy\",\n \"hot air\",\n \"know it all\",\n \"obnoxious\",\n \"pain in the neck\",\n \"picky\",\n \"tactless\",\n \"thoughtless\",\n];\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { random, getArrow } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 13000, min: 6, max: 8 },\n Normal: { timer: 7000, min: 7, max: 8 },\n Hard: { timer: 5000, min: 8, max: 9 },\n Impossible: { timer: 3000, min: 9, max: 10 },\n};\n\nexport function CheatCodeGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [code] = useState(generateCode(difficulty));\n const [index, setIndex] = useState(0);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (code[index] !== getArrow(event)) {\n props.onFailure();\n return;\n }\n setIndex(index + 1);\n if (index + 1 >= code.length) props.onSuccess();\n }\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Enter the Code!</Typography>\n <Typography variant=\"h4\">{code[index]}</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n\nfunction generateCode(difficulty: Difficulty): string {\n const arrows = [\"←\", \"→\", \"↑\", \"↓\"];\n let code = \"\";\n for (let i = 0; i < random(difficulty.min, difficulty.max); i++) {\n let arrow = arrows[Math.floor(4 * Math.random())];\n while (arrow === code[code.length - 1]) arrow = arrows[Math.floor(4 * Math.random())];\n code += arrow;\n }\n\n return code;\n}\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { interpolate } from \"./Difficulty\";\nimport { getArrow } from \"../utils\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n symbols: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 12500, width: 3, height: 3, symbols: 6 },\n Normal: { timer: 15000, width: 4, height: 4, symbols: 7 },\n Hard: { timer: 12500, width: 5, height: 5, symbols: 8 },\n Impossible: { timer: 10000, width: 6, height: 6, symbols: 9 },\n};\n\nexport function Cyberpunk2077Game(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, width: 0, height: 0, symbols: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [grid] = useState(generatePuzzle(difficulty));\n const [answer] = useState(generateAnswer(grid, difficulty));\n const [index, setIndex] = useState(0);\n const [pos, setPos] = useState([0, 0]);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const move = [0, 0];\n const arrow = getArrow(event);\n switch (arrow) {\n case \"↑\":\n move[1]--;\n break;\n case \"←\":\n move[0]--;\n break;\n case \"↓\":\n move[1]++;\n break;\n case \"→\":\n move[0]++;\n break;\n }\n const next = [pos[0] + move[0], pos[1] + move[1]];\n next[0] = (next[0] + grid[0].length) % grid[0].length;\n next[1] = (next[1] + grid.length) % grid.length;\n setPos(next);\n\n if (event.key === \" \") {\n const selected = grid[pos[1]][pos[0]];\n const expected = answer[index];\n if (selected !== expected) {\n props.onFailure();\n return;\n }\n setIndex(index + 1);\n if (answer.length === index + 1) props.onSuccess();\n }\n }\n\n const fontSize = \"2em\";\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Match the symbols!</Typography>\n <Typography variant=\"h5\" color=\"primary\">\n Targets:{\" \"}\n {answer.map((a, i) => {\n if (i == index)\n return (\n <span key={`${i}`} style={{ fontSize: \"1em\", color: \"blue\" }}>\n {a} \n </span>\n );\n return (\n <span key={`${i}`} style={{ fontSize: \"1em\" }}>\n {a} \n </span>\n );\n })}\n </Typography>\n <br />\n {grid.map((line, y) => (\n <div key={y}>\n <Typography>\n {line.map((cell, x) => {\n if (x == pos[0] && y == pos[1])\n return (\n <span key={`${x}${y}`} style={{ fontSize: fontSize, color: \"blue\" }}>\n {cell} \n </span>\n );\n return (\n <span key={`${x}${y}`} style={{ fontSize: fontSize }}>\n {cell} \n </span>\n );\n })}\n </Typography>\n <br />\n </div>\n ))}\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n\nfunction generateAnswer(grid: string[][], difficulty: Difficulty): string[] {\n const answer = [];\n for (let i = 0; i < Math.round(difficulty.symbols); i++) {\n answer.push(grid[Math.floor(Math.random() * grid.length)][Math.floor(Math.random() * grid[0].length)]);\n }\n return answer;\n}\n\nfunction randChar(): string {\n return \"ABCDEF0123456789\"[Math.floor(Math.random() * 16)];\n}\n\nfunction generatePuzzle(difficulty: Difficulty): string[][] {\n const puzzle = [];\n for (let i = 0; i < Math.round(difficulty.height); i++) {\n const line = [];\n for (let j = 0; j < Math.round(difficulty.width); j++) {\n line.push(randChar() + randChar());\n }\n puzzle.push(line);\n }\n return puzzle;\n}\n","import React, { useState, useEffect } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { interpolate } from \"./Difficulty\";\nimport { getArrow } from \"../utils\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n mines: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 15000, width: 3, height: 3, mines: 4 },\n Normal: { timer: 15000, width: 4, height: 4, mines: 7 },\n Hard: { timer: 15000, width: 5, height: 5, mines: 11 },\n Impossible: { timer: 15000, width: 6, height: 6, mines: 15 },\n};\n\nexport function MinesweeperGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, width: 0, height: 0, mines: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [minefield] = useState(generateMinefield(difficulty));\n const [answer, setAnswer] = useState(generateEmptyField(difficulty));\n const [pos, setPos] = useState([0, 0]);\n const [memoryPhase, setMemoryPhase] = useState(true);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (memoryPhase) return;\n const move = [0, 0];\n const arrow = getArrow(event);\n switch (arrow) {\n case \"↑\":\n move[1]--;\n break;\n case \"←\":\n move[0]--;\n break;\n case \"↓\":\n move[1]++;\n break;\n case \"→\":\n move[0]++;\n break;\n }\n const next = [pos[0] + move[0], pos[1] + move[1]];\n next[0] = (next[0] + minefield[0].length) % minefield[0].length;\n next[1] = (next[1] + minefield.length) % minefield.length;\n setPos(next);\n\n if (event.key == \" \") {\n if (!minefield[pos[1]][pos[0]]) {\n props.onFailure();\n return;\n }\n setAnswer((old) => {\n old[pos[1]][pos[0]] = true;\n if (fieldEquals(minefield, old)) props.onSuccess();\n return old;\n });\n }\n }\n\n useEffect(() => {\n const id = setTimeout(() => setMemoryPhase(false), 2000);\n return () => clearInterval(id);\n }, []);\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">{memoryPhase ? \"Remember all the mines!\" : \"Mark all the mines!\"}</Typography>\n {minefield.map((line, y) => (\n <div key={y}>\n <Typography>\n {line.map((cell, x) => {\n if (memoryPhase) {\n if (minefield[y][x]) return <span key={x}>[?] </span>;\n return <span key={x}>[ ] </span>;\n } else {\n if (x == pos[0] && y == pos[1]) return <span key={x}>[X] </span>;\n if (answer[y][x]) return <span key={x}>[.] </span>;\n return <span key={x}>[ ] </span>;\n }\n })}\n </Typography>\n <br />\n </div>\n ))}\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n\nfunction fieldEquals(a: boolean[][], b: boolean[][]): boolean {\n function count(field: boolean[][]): number {\n return field.flat().reduce((a, b) => a + (b ? 1 : 0), 0);\n }\n return count(a) === count(b);\n}\n\nfunction generateEmptyField(difficulty: Difficulty): boolean[][] {\n const field = [];\n for (let i = 0; i < difficulty.height; i++) {\n field.push(new Array(Math.round(difficulty.width)).fill(false));\n }\n return field;\n}\n\nfunction generateMinefield(difficulty: Difficulty): boolean[][] {\n const field = generateEmptyField(difficulty);\n for (let i = 0; i < difficulty.mines; i++) {\n const x = Math.floor(Math.random() * field.length);\n const y = Math.floor(Math.random() * field[0].length);\n if (field[x][y]) {\n i--;\n continue;\n }\n field[x][y] = true;\n }\n return field;\n}\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport Typography from \"@mui/material/Typography\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { random } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n wiresmin: number;\n wiresmax: number;\n rules: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 9000, wiresmin: 4, wiresmax: 4, rules: 2 },\n Normal: { timer: 7000, wiresmin: 6, wiresmax: 6, rules: 2 },\n Hard: { timer: 5000, wiresmin: 8, wiresmax: 8, rules: 3 },\n Impossible: { timer: 4000, wiresmin: 9, wiresmax: 9, rules: 4 },\n};\n\nconst types = [\"|\", \".\", \"/\", \"-\", \"█\", \"#\"];\n\nconst colors = [\"red\", \"#FFC107\", \"blue\", \"white\"];\n\nconst colorNames: any = {\n red: \"red\",\n \"#FFC107\": \"yellow\",\n blue: \"blue\",\n white: \"white\",\n};\n\ninterface Wire {\n tpe: string;\n colors: string[];\n}\n\ninterface Question {\n toString: () => string;\n shouldCut: (wire: Wire, index: number) => boolean;\n}\n\nexport function WireCuttingGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = {\n timer: 0,\n wiresmin: 0,\n wiresmax: 0,\n rules: 0,\n };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [wires] = useState(generateWires(difficulty));\n const [cutWires, setCutWires] = useState(new Array(wires.length).fill(false));\n const [questions] = useState(generateQuestion(wires, difficulty));\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const wireNum = parseInt(event.key);\n\n if (wireNum < 1 || wireNum > wires.length || isNaN(wireNum)) return;\n setCutWires((old) => {\n const next = [...old];\n next[wireNum - 1] = true;\n if (!questions.some((q) => q.shouldCut(wires[wireNum - 1], wireNum - 1))) {\n props.onFailure();\n }\n\n // check if we won\n const wiresToBeCut = [];\n for (let j = 0; j < wires.length; j++) {\n let shouldBeCut = false;\n for (let i = 0; i < questions.length; i++) {\n shouldBeCut = shouldBeCut || questions[i].shouldCut(wires[j], j);\n }\n wiresToBeCut.push(shouldBeCut);\n }\n if (wiresToBeCut.every((b, i) => b === next[i])) {\n props.onSuccess();\n }\n\n return next;\n });\n }\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Cut the wires with the following properties! (keyboard 1 to 9)</Typography>\n {questions.map((question, i) => (\n <Typography key={i}>{question.toString()}</Typography>\n ))}\n <Typography>\n {new Array(wires.length).fill(0).map((_, i) => (\n <span key={i}> {i + 1} </span>\n ))}\n </Typography>\n {new Array(8).fill(0).map((_, i) => (\n <div key={i}>\n <Typography>\n {wires.map((wire, j) => {\n if ((i === 3 || i === 4) && cutWires[j])\n return <span key={j}> </span>;\n return (\n <span key={j} style={{ color: wire.colors[i % wire.colors.length] }}>\n |{wire.tpe}| \n </span>\n );\n })}\n </Typography>\n </div>\n ))}\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n\nfunction randomPositionQuestion(wires: Wire[]): Question {\n const index = Math.floor(Math.random() * wires.length);\n return {\n toString: (): string => {\n return `Cut wires number ${index + 1}.`;\n },\n shouldCut: (wire: Wire, i: number): boolean => {\n return index === i;\n },\n };\n}\n\nfunction randomColorQuestion(wires: Wire[]): Question {\n const index = Math.floor(Math.random() * wires.length);\n const cutColor = wires[index].colors[0];\n return {\n toString: (): string => {\n return `Cut all wires colored ${colorNames[cutColor]}.`;\n },\n shouldCut: (wire: Wire): boolean => {\n return wire.colors.includes(cutColor);\n },\n };\n}\n\nfunction generateQuestion(wires: Wire[], difficulty: Difficulty): Question[] {\n const numQuestions = difficulty.rules;\n const questionGenerators = [randomPositionQuestion, randomColorQuestion];\n const questions = [];\n for (let i = 0; i < numQuestions; i++) {\n questions.push(questionGenerators[i % 2](wires));\n }\n return questions;\n}\n\nfunction generateWires(difficulty: Difficulty): Wire[] {\n const wires = [];\n const numWires = random(difficulty.wiresmin, difficulty.wiresmax);\n for (let i = 0; i < numWires; i++) {\n const wireColors = [colors[Math.floor(Math.random() * colors.length)]];\n if (Math.random() < 0.15) {\n wireColors.push(colors[Math.floor(Math.random() * colors.length)]);\n }\n wires.push({\n tpe: types[Math.floor(Math.random() * types.length)],\n colors: wireColors,\n });\n }\n return wires;\n}\n","import { Factions } from \"../../Faction/Factions\";\nimport React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n StartingDifficulty: number;\n Difficulty: number;\n Reward: number;\n MaxLevel: number;\n}\n\nexport function Victory(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [faction, setFaction] = useState(\"none\");\n\n function quitInfiltration(): void {\n router.toCity();\n }\n\n const levelBonus = props.MaxLevel * Math.pow(1.01, props.MaxLevel);\n\n const repGain =\n Math.pow(props.Reward + 1, 1.1) *\n Math.pow(props.StartingDifficulty, 1.2) *\n 30 *\n levelBonus *\n BitNodeMultipliers.InfiltrationRep;\n\n const moneyGain =\n Math.pow(props.Reward + 1, 2) *\n Math.pow(props.StartingDifficulty, 3) *\n 3e3 *\n levelBonus *\n BitNodeMultipliers.InfiltrationMoney;\n\n function sell(): void {\n player.gainMoney(moneyGain, \"infiltration\");\n quitInfiltration();\n }\n\n function trade(): void {\n if (faction === \"none\") return;\n Factions[faction].playerReputation += repGain;\n quitInfiltration();\n }\n\n function changeDropdown(event: SelectChangeEvent<string>): void {\n setFaction(event.target.value);\n }\n\n return (\n <>\n <Grid container spacing={3}>\n <Grid item xs={10}>\n <Typography variant=\"h4\">Infiltration successful!</Typography>\n </Grid>\n <Grid item xs={10}>\n <Typography variant=\"h5\" color=\"primary\">\n You can trade the confidential information you found for money or reputation.\n </Typography>\n <Select value={faction} onChange={changeDropdown}>\n <MenuItem key={\"none\"} value={\"none\"}>\n {\"none\"}\n </MenuItem>\n {player.factions\n .filter((f) => Factions[f].getInfo().offersWork())\n .map((f) => (\n <MenuItem key={f} value={f}>\n {f}\n </MenuItem>\n ))}\n </Select>\n <Button onClick={trade}>\n Trade for <Reputation reputation={repGain} /> reputation\n </Button>\n </Grid>\n <Grid item xs={3}>\n <Button onClick={sell}>\n Sell for \n <Money money={moneyGain} />\n </Button>\n </Grid>\n <Grid item xs={3}>\n <Button onClick={quitInfiltration}>Quit</Button>\n </Grid>\n </Grid>\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { generateResleeves } from \"../Resleeving\";\nimport { Resleeve } from \"../Resleeve\";\nimport { ResleeveElem } from \"./ResleeveElem\";\nimport { use } from \"../../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Box from \"@mui/material/Box\";\n\nconst SortOption: {\n [key: string]: string | undefined;\n Cost: string;\n Hacking: string;\n Strength: string;\n Defense: string;\n Dexterity: string;\n Agility: string;\n Charisma: string;\n AverageCombatStats: string;\n AverageAllStats: string;\n TotalNumAugmentations: string;\n} = {\n Cost: \"Cost\",\n Hacking: \"Hacking Level\",\n Strength: \"Strength Level\",\n Defense: \"Defense Level\",\n Dexterity: \"Dexterity Level\",\n Agility: \"Agility Level\",\n Charisma: \"Charisma Level\",\n AverageCombatStats: \"Average Combat Stats\",\n AverageAllStats: \"Average Stats\",\n TotalNumAugmentations: \"Number of Augmentations\",\n};\n\n// Helper function for averaging\nfunction getAverage(...values: number[]): number {\n let sum = 0;\n for (let i = 0; i < values.length; ++i) {\n sum += values[i];\n }\n\n return sum / values.length;\n}\n\nconst SortFunctions: {\n [key: string]: ((a: Resleeve, b: Resleeve) => number) | undefined;\n Cost: (a: Resleeve, b: Resleeve) => number;\n Hacking: (a: Resleeve, b: Resleeve) => number;\n Strength: (a: Resleeve, b: Resleeve) => number;\n Defense: (a: Resleeve, b: Resleeve) => number;\n Dexterity: (a: Resleeve, b: Resleeve) => number;\n Agility: (a: Resleeve, b: Resleeve) => number;\n Charisma: (a: Resleeve, b: Resleeve) => number;\n AverageCombatStats: (a: Resleeve, b: Resleeve) => number;\n AverageAllStats: (a: Resleeve, b: Resleeve) => number;\n TotalNumAugmentations: (a: Resleeve, b: Resleeve) => number;\n} = {\n Cost: (a: Resleeve, b: Resleeve): number => a.getCost() - b.getCost(),\n Hacking: (a: Resleeve, b: Resleeve): number => a.hacking - b.hacking,\n Strength: (a: Resleeve, b: Resleeve): number => a.strength - b.strength,\n Defense: (a: Resleeve, b: Resleeve): number => a.defense - b.defense,\n Dexterity: (a: Resleeve, b: Resleeve): number => a.dexterity - b.dexterity,\n Agility: (a: Resleeve, b: Resleeve): number => a.agility - b.agility,\n Charisma: (a: Resleeve, b: Resleeve): number => a.charisma - b.charisma,\n AverageCombatStats: (a: Resleeve, b: Resleeve): number =>\n getAverage(a.strength, a.defense, a.dexterity, a.agility) -\n getAverage(b.strength, b.defense, b.dexterity, b.agility),\n AverageAllStats: (a: Resleeve, b: Resleeve): number =>\n getAverage(a.hacking, a.strength, a.defense, a.dexterity, a.agility, a.charisma) -\n getAverage(b.hacking, b.strength, b.defense, b.dexterity, b.agility, b.charisma),\n TotalNumAugmentations: (a: Resleeve, b: Resleeve): number => a.augmentations.length - b.augmentations.length,\n};\n\nexport function ResleeveRoot(): React.ReactElement {\n const player = use.Player();\n const [sort, setSort] = useState(SortOption.Cost);\n // Randomly create all Resleeves if they dont already exist\n if (player.resleeves.length === 0) {\n player.resleeves = generateResleeves();\n }\n\n function onSortChange(event: SelectChangeEvent<string>): void {\n setSort(event.target.value);\n }\n\n const sortFunction = SortFunctions[sort];\n if (sortFunction === undefined) throw new Error(`sort function '${sort}' is undefined`);\n player.resleeves.sort(sortFunction);\n\n return (\n <>\n <Typography>\n Re-sleeving is the process of digitizing and transferring your consciousness into a new human body, or 'sleeve'.\n Here at VitaLife, you can purchase new specially-engineered bodies for the re-sleeve process. Many of these\n bodies even come with genetic and cybernetic Augmentations!\n <br />\n <br />\n Re-sleeving will change your experience for every stat. It will also REMOVE all of your currently-installed\n Augmentations, and replace them with the ones provided by the purchased sleeve. However, Augmentations that you\n have purchased but not installed will NOT be removed. If you have purchased an Augmentation and then re-sleeve\n into a body which already has that Augmentation, it will be removed (since you cannot have duplicate\n Augmentations).\n <br />\n <br />\n NOTE: The stats and multipliers displayed on this page do NOT include your bonuses from Source-File.\n </Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>Sort By: </Typography>\n <Select value={sort} onChange={onSortChange}>\n {Object.keys(SortOption).map((opt) => (\n <MenuItem key={opt} value={opt}>\n {SortOption[opt]}\n </MenuItem>\n ))}\n </Select>\n </Box>\n {player.resleeves.map((resleeve, i) => (\n <ResleeveElem key={i} player={player} resleeve={resleeve} />\n ))}\n </>\n );\n}\n","/**\n * Implements the Resleeve class, which defines a new body\n * that the player can \"re-sleeve\" into.\n */\nimport { Person } from \"../Person\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../../utils/JSONReviver\";\n\nexport class Resleeve extends Person {\n constructor() {\n super();\n }\n\n getCost(): number {\n // Each experience point adds this to the cost\n const CostPerExp = 25e3;\n\n // Final cost is multiplied by this constant ^ # Augs\n const NumAugsExponent = 1.2;\n\n // Get total exp in this re-sleeve\n const totalExp: number =\n this.hacking_exp +\n this.strength_exp +\n this.defense_exp +\n this.dexterity_exp +\n this.agility_exp +\n this.charisma_exp;\n\n // Get total base Augmentation cost for this re-sleeve\n let totalAugmentationCost = 0;\n for (let i = 0; i < this.augmentations.length; ++i) {\n const aug: Augmentation | null = Augmentations[this.augmentations[i].name];\n if (aug == null) {\n console.error(`Could not find Augmentation ${this.augmentations[i].name}`);\n continue;\n }\n totalAugmentationCost += aug.startingCost;\n }\n\n return totalExp * CostPerExp + totalAugmentationCost * Math.pow(NumAugsExponent, this.augmentations.length);\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Resleeve\", this);\n }\n\n /**\n * Initiatizes a Resleeve object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Resleeve {\n return Generic_fromJSON(Resleeve, value.data);\n }\n}\n\nReviver.constructors.Resleeve = Resleeve;\n","import React, { useState } from \"react\";\nimport { IPlayer } from \"../../IPlayer\";\nimport { Resleeve } from \"../Resleeve\";\nimport { Augmentations } from \"../../../Augmentation/Augmentations\";\nimport { purchaseResleeve } from \"../Resleeving\";\nimport { Money } from \"../../../ui/React/Money\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n resleeve: Resleeve;\n player: IPlayer;\n}\n\nexport function ResleeveElem(props: IProps): React.ReactElement {\n const [aug, setAug] = useState(props.resleeve.augmentations[0].name);\n\n function openStats(): void {\n dialogBoxCreate(\n <>\n <Typography variant=\"h5\" color=\"primary\">\n Total Multipliers:\n </Typography>\n <Typography>\n Hacking Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_mult)}\n <br />\n Hacking Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_exp_mult)}\n <br />\n Strength Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.strength_mult)}\n <br />\n Strength Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.strength_exp_mult)}\n <br />\n Defense Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.defense_mult)}\n <br />\n Defense Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.defense_exp_mult)}\n <br />\n Dexterity Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.dexterity_mult)}\n <br />\n Dexterity Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.dexterity_exp_mult)}\n <br />\n Agility Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.agility_mult)}\n <br />\n Agility Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.agility_exp_mult)}\n <br />\n Charisma Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.charisma_mult)}\n <br />\n Charisma Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.charisma_exp_mult)}\n <br />\n Hacking Chance multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_chance_mult)}\n <br />\n Hacking Speed multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_speed_mult)}\n <br />\n Hacking Money multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_money_mult)}\n <br />\n Hacking Growth multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_grow_mult)}\n <br />\n Salary multiplier: {numeralWrapper.formatPercentage(props.resleeve.work_money_mult)}\n <br />\n Company Reputation Gain multiplier: {numeralWrapper.formatPercentage(props.resleeve.company_rep_mult)}\n <br />\n Faction Reputation Gain multiplier: {numeralWrapper.formatPercentage(props.resleeve.faction_rep_mult)}\n <br />\n Crime Money multiplier: {numeralWrapper.formatPercentage(props.resleeve.crime_money_mult)}\n <br />\n Crime Success multiplier: {numeralWrapper.formatPercentage(props.resleeve.crime_success_mult)}\n <br />\n Hacknet Income multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacknet_node_money_mult)}\n <br />\n Hacknet Purchase Cost multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.hacknet_node_purchase_cost_mult)}\n <br />\n Hacknet Level Upgrade Cost multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.hacknet_node_level_cost_mult)}\n <br />\n Hacknet Ram Upgrade Cost multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.hacknet_node_ram_cost_mult)}\n <br />\n Hacknet Core Upgrade Cost multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.hacknet_node_core_cost_mult)}\n <br />\n Bladeburner Max Stamina multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.bladeburner_max_stamina_mult)}\n <br />\n Bladeburner Stamina Gain multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.bladeburner_stamina_gain_mult)}\n <br />\n Bladeburner Field Analysis multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.bladeburner_analysis_mult)}\n <br />\n Bladeburner Success Chance multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.bladeburner_success_chance_mult)}\n </Typography>\n </>,\n );\n }\n\n function onAugChange(event: SelectChangeEvent<string>): void {\n setAug(event.target.value);\n }\n\n const currentAug = Augmentations[aug];\n const cost = props.resleeve.getCost();\n\n function purchase(): void {\n if (!purchaseResleeve(props.resleeve, props.player)) return;\n dialogBoxCreate(\n <>\n You re-sleeved for <Money money={cost} />!\n </>,\n );\n }\n\n return (\n <Paper sx={{ my: 1 }}>\n <Grid container>\n <Grid item xs={3}>\n <Typography>\n Hacking: {numeralWrapper.formatSkill(props.resleeve.hacking)} (\n {numeralWrapper.formatExp(props.resleeve.hacking_exp)} exp)\n <br />\n Strength: {numeralWrapper.formatSkill(props.resleeve.strength)} (\n {numeralWrapper.formatExp(props.resleeve.strength_exp)} exp)\n <br />\n Defense: {numeralWrapper.formatSkill(props.resleeve.defense)} (\n {numeralWrapper.formatExp(props.resleeve.defense_exp)} exp)\n <br />\n Dexterity: {numeralWrapper.formatSkill(props.resleeve.dexterity)} (\n {numeralWrapper.formatExp(props.resleeve.dexterity_exp)} exp)\n <br />\n Agility: {numeralWrapper.formatSkill(props.resleeve.agility)} (\n {numeralWrapper.formatExp(props.resleeve.agility_exp)} exp)\n <br />\n Charisma: {numeralWrapper.formatSkill(props.resleeve.charisma)} (\n {numeralWrapper.formatExp(props.resleeve.charisma_exp)} exp)\n <br /># Augmentations: {props.resleeve.augmentations.length}\n </Typography>\n <Button onClick={openStats}>Multipliers</Button>\n </Grid>\n <Grid item xs={6}>\n <Select value={aug} onChange={onAugChange}>\n {props.resleeve.augmentations.map((aug) => (\n <MenuItem key={aug.name} value={aug.name}>\n {aug.name}\n </MenuItem>\n ))}\n </Select>\n <Typography>{currentAug !== undefined && currentAug.info}</Typography>\n </Grid>\n <Grid item xs={3}>\n <Typography>\n It costs <Money money={cost} player={props.player} /> to purchase this Sleeve.\n </Typography>\n <Button onClick={purchase}>Purchase</Button>\n </Grid>\n </Grid>\n </Paper>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { use } from \"./Context\";\nimport { CONSTANTS } from \"../Constants\";\nimport { numeralWrapper } from \"./numeralFormat\";\nimport { Reputation } from \"./React/Reputation\";\nimport { ReputationRate } from \"./React/ReputationRate\";\nimport { MoneyRate } from \"./React/MoneyRate\";\nimport { Money } from \"./React/Money\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { Factions } from \"../Faction/Factions\";\nimport { Company } from \"../Company/Company\";\nimport { Companies } from \"../Company/Companies\";\nimport { Locations } from \"../Locations/Locations\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\n\nimport { createProgressBarText } from \"../utils/helpers/createProgressBarText\";\n\nconst CYCLES_PER_SEC = 1000 / CONSTANTS.MilliPerCycle;\n\nexport function WorkInProgressRoot(): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, CONSTANTS.MilliPerCycle);\n return () => clearInterval(id);\n }, []);\n const player = use.Player();\n const router = use.Router();\n const faction = Factions[player.currentWorkFactionName];\n if (player.workType == CONSTANTS.WorkTypeFaction) {\n function cancel(): void {\n router.toFaction(faction);\n player.finishFactionWork(true);\n }\n function unfocus(): void {\n router.toFaction(faction);\n player.stopFocusing();\n }\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n You are currently {player.currentWorkFactionDescription} for your faction {faction.name}\n <br />\n (Current Faction Reputation: <Reputation reputation={faction.playerReputation} />\n ). <br />\n You have been doing this for {convertTimeMsToTimeElapsedString(player.timeWorked)}\n <br />\n <br />\n You have earned: <br />\n <br />\n <Money money={player.workMoneyGained} /> (<MoneyRate money={player.workMoneyGainRate * CYCLES_PER_SEC} />){\" \"}\n <br />\n <br />\n <Reputation reputation={player.workRepGained} /> (\n <ReputationRate reputation={player.workRepGainRate * CYCLES_PER_SEC} />) reputation for this faction <br />\n <br />\n {player.workHackExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workHackExpGained)} (\n {numeralWrapper.formatExp(player.workHackExpGainRate * CYCLES_PER_SEC)} / sec) hacking exp <br />\n </>\n )}\n <br />\n {player.workStrExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workStrExpGained)} (\n {numeralWrapper.formatExp(player.workStrExpGainRate * CYCLES_PER_SEC)} / sec) strength exp <br />\n </>\n )}\n {player.workDefExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workDefExpGained)} (\n {numeralWrapper.formatExp(player.workDefExpGainRate * CYCLES_PER_SEC)} / sec) defense exp <br />\n </>\n )}\n {player.workDexExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workDexExpGained)} (\n {numeralWrapper.formatExp(player.workDexExpGainRate * CYCLES_PER_SEC)} / sec) dexterity exp <br />\n </>\n )}\n {player.workAgiExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workAgiExpGained)} (\n {numeralWrapper.formatExp(player.workAgiExpGainRate * CYCLES_PER_SEC)} / sec) agility exp <br />\n </>\n )}\n <br />\n {player.workChaExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workChaExpGained)} (\n {numeralWrapper.formatExp(player.workChaExpGainRate * CYCLES_PER_SEC)} / sec) charisma exp <br />\n </>\n )}\n <br />\n You will automatically finish after working for 20 hours. You can cancel earlier if you wish.\n <br />\n There is no penalty for cancelling earlier.\n </Typography>\n </Grid>\n <Grid item>\n <Button sx={{ mx: 2 }} onClick={cancel}>\n Stop Faction Work\n </Button>\n <Button onClick={unfocus}>Do something else simultaneously</Button>\n </Grid>\n </Grid>\n );\n }\n\n const className = player.className;\n if (player.className !== \"\") {\n function cancel(): void {\n player.finishClass(true);\n router.toCity();\n }\n\n function unfocus(): void {\n router.toFaction(faction);\n router.toCity();\n player.stopFocusing();\n }\n\n let stopText = \"\";\n if (\n className == CONSTANTS.ClassGymStrength ||\n className == CONSTANTS.ClassGymDefense ||\n className == CONSTANTS.ClassGymDexterity ||\n className == CONSTANTS.ClassGymAgility\n ) {\n stopText = \"Stop training at gym\";\n } else {\n stopText = \"Stop taking course\";\n }\n\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n You have been {className} for {convertTimeMsToTimeElapsedString(player.timeWorked)}\n <br />\n <br />\n This has cost you: <br />\n <Money money={-player.workMoneyGained} /> (<MoneyRate money={player.workMoneyLossRate * CYCLES_PER_SEC} />){\" \"}\n <br />\n <br />\n You have gained: <br />\n {player.workHackExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workHackExpGained)} (\n {numeralWrapper.formatExp(player.workHackExpGainRate * CYCLES_PER_SEC)} / sec) hacking exp <br />\n </>\n )}\n {player.workStrExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workStrExpGained)} (\n {numeralWrapper.formatExp(player.workStrExpGainRate * CYCLES_PER_SEC)} / sec) strength exp <br />\n </>\n )}\n {player.workDefExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workDefExpGained)} (\n {numeralWrapper.formatExp(player.workDefExpGainRate * CYCLES_PER_SEC)} / sec) defense exp <br />\n </>\n )}\n {player.workDexExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workDexExpGained)} (\n {numeralWrapper.formatExp(player.workDexExpGainRate * CYCLES_PER_SEC)} / sec) dexterity exp <br />\n </>\n )}\n {player.workAgiExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workAgiExpGained)} (\n {numeralWrapper.formatExp(player.workAgiExpGainRate * CYCLES_PER_SEC)} / sec) agility exp <br />\n </>\n )}\n {player.workChaExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workChaExpGained)} (\n {numeralWrapper.formatExp(player.workChaExpGainRate * CYCLES_PER_SEC)} / sec) charisma exp <br />\n </>\n )}\n You may cancel at any time\n </Typography>\n </Grid>\n <Grid item>\n <Button sx={{ mx: 2 }} onClick={cancel}>\n {stopText}\n </Button>\n <Button onClick={unfocus}>Do something else simultaneously</Button>\n </Grid>\n </Grid>\n );\n }\n\n if (player.workType == CONSTANTS.WorkTypeCompany) {\n const comp = Companies[player.companyName];\n let companyRep = 0;\n if (comp == null || !(comp instanceof Company)) {\n throw new Error(`Could not find Company: ${player.companyName}`);\n }\n companyRep = comp.playerReputation;\n\n function cancel(): void {\n player.finishWork(true);\n router.toJob();\n }\n function unfocus(): void {\n player.stopFocusing();\n router.toJob();\n }\n\n const position = player.jobs[player.companyName];\n\n const penalty = player.cancelationPenalty();\n\n const penaltyString = penalty === 0.5 ? \"half\" : \"three-quarters\";\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n You are currently working as a {position} at {player.companyName} (Current Company Reputation:{\" \"}\n <Reputation reputation={companyRep} />)<br />\n <br />\n You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}\n <br />\n <br />\n You have earned: <br />\n <br />\n <Money money={player.workMoneyGained} /> (<MoneyRate money={player.workMoneyGainRate * CYCLES_PER_SEC} />){\" \"}\n <br />\n <br />\n <Reputation reputation={player.workRepGained} /> (\n <ReputationRate reputation={player.workRepGainRate * CYCLES_PER_SEC} />) reputation for this company <br />\n <br />\n {player.workHackExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workHackExpGained)} (\n {`${numeralWrapper.formatExp(player.workHackExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) hacking exp <br />\n </>\n )}\n <br />\n {player.workStrExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workStrExpGained)} (\n {`${numeralWrapper.formatExp(player.workStrExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) strength exp <br />\n </>\n )}\n {player.workDefExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workDefExpGained)} (\n {`${numeralWrapper.formatExp(player.workDefExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) defense exp <br />\n </>\n )}\n {player.workDexExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workDexExpGained)} (\n {`${numeralWrapper.formatExp(player.workDexExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) dexterity exp <br />\n </>\n )}\n {player.workAgiExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workAgiExpGained)} (\n {`${numeralWrapper.formatExp(player.workAgiExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) agility exp <br />\n </>\n )}\n <br />\n {player.workChaExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workChaExpGained)} (\n {`${numeralWrapper.formatExp(player.workChaExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) charisma exp <br />\n </>\n )}\n <br />\n You will automatically finish after working for 8 hours. You can cancel earlier if you wish, but you will\n only gain {penaltyString} of the reputation you've earned so far.\n </Typography>\n </Grid>\n <Grid item>\n <Button sx={{ mx: 2 }} onClick={cancel}>\n Stop Working\n </Button>\n <Button onClick={unfocus}>Do something else simultaneously</Button>\n </Grid>\n </Grid>\n );\n }\n\n if (player.workType == CONSTANTS.WorkTypeCompanyPartTime) {\n function cancel(): void {\n player.finishWorkPartTime(true);\n router.toJob();\n }\n function unfocus(): void {\n player.stopFocusing();\n router.toJob();\n }\n const comp = Companies[player.companyName];\n let companyRep = 0;\n if (comp == null || !(comp instanceof Company)) {\n throw new Error(`Could not find Company: ${player.companyName}`);\n }\n companyRep = comp.playerReputation;\n\n const position = player.jobs[player.companyName];\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n You are currently working as a {position} at {player.companyName} (Current Company Reputation:{\" \"}\n <Reputation reputation={companyRep} />)<br />\n <br />\n You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}\n <br />\n <br />\n You have earned: <br />\n <br />\n <Money money={player.workMoneyGained} /> (<MoneyRate money={player.workMoneyGainRate * CYCLES_PER_SEC} />){\" \"}\n <br />\n <br />\n <Reputation reputation={player.workRepGained} /> (\n <ReputationRate reputation={player.workRepGainRate * CYCLES_PER_SEC} />\n ) reputation for this company <br />\n <br />\n {player.workHackExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workHackExpGained)} (\n {`${numeralWrapper.formatExp(player.workHackExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) hacking exp <br />\n </>\n )}\n <br />\n {player.workStrExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workStrExpGained)} (\n {`${numeralWrapper.formatExp(player.workStrExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) strength exp <br />\n </>\n )}\n {player.workDefExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workDefExpGained)} (\n {`${numeralWrapper.formatExp(player.workDefExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) defense exp <br />\n </>\n )}\n {player.workDexExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workDexExpGained)} (\n {`${numeralWrapper.formatExp(player.workDexExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) dexterity exp <br />\n </>\n )}\n {player.workAgiExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workAgiExpGained)} (\n {`${numeralWrapper.formatExp(player.workAgiExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) agility exp <br />\n </>\n )}\n <br />\n {player.workChaExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(player.workChaExpGained)} (\n {`${numeralWrapper.formatExp(player.workChaExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) charisma exp <br />\n </>\n )}\n <br />\n You will automatically finish after working for 8 hours. You can cancel earlier if you wish, and there will\n be no penalty because this is a part-time job.\n </Typography>\n </Grid>\n <Grid item>\n <Button sx={{ mx: 2 }} onClick={cancel}>\n Stop Working\n </Button>\n <Button onClick={unfocus}>Do something else simultaneously</Button>\n </Grid>\n </Grid>\n );\n }\n\n if (player.crimeType !== \"\") {\n const percent = Math.round((player.timeWorked / player.timeNeededToCompleteWork) * 100);\n let numBars = Math.round(percent / 5);\n if (numBars < 0) {\n numBars = 0;\n }\n if (numBars > 20) {\n numBars = 20;\n }\n // const progressBar = \"[\" + Array(numBars + 1).join(\"|\") + Array(20 - numBars + 1).join(\" \") + \"]\";\n const progressBar = createProgressBarText({ progress: (numBars + 1) / 20, totalTicks: 20 });\n\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n <Typography>You are attempting to {player.crimeType}.</Typography>\n <br />\n\n <Typography>\n Time remaining: {convertTimeMsToTimeElapsedString(player.timeNeededToCompleteWork - player.timeWorked)}\n </Typography>\n\n <br />\n <pre>{progressBar}</pre>\n </Typography>\n </Grid>\n <Grid item>\n <Button\n onClick={() => {\n router.toLocation(Locations[LocationName.Slums]);\n player.finishCrime(true);\n }}\n >\n Cancel crime\n </Button>\n </Grid>\n </Grid>\n );\n }\n\n if (player.createProgramName !== \"\") {\n function cancel(): void {\n player.finishCreateProgramWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n You are currently working on coding {player.createProgramName}.<br />\n <br />\n You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}\n <br />\n <br />\n The program is {((player.timeWorkedCreateProgram / player.timeNeededToCompleteWork) * 100).toFixed(2)}\n % complete. <br />\n If you cancel, your work will be saved and you can come back to complete the program later.\n </Typography>\n </Grid>\n <Grid item>\n <Button sx={{ mx: 2 }} onClick={cancel}>\n Cancel work on creating program\n </Button>\n <Button onClick={unfocus}>Do something else simultaneously</Button>\n </Grid>\n </Grid>\n );\n }\n\n if (!player.workType) router.toTerminal();\n\n return <></>;\n}\n","import React, { useState, useRef } from \"react\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Typography from \"@mui/material/Typography\";\nimport Slider from \"@mui/material/Slider\";\nimport Grid from \"@mui/material/Grid\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Button from \"@mui/material/Button\";\n\nimport Box from \"@mui/material/Box\";\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport Link from \"@mui/material/Link\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport TextField from \"@mui/material/TextField\";\n\nimport DownloadIcon from \"@mui/icons-material/Download\";\nimport UploadIcon from \"@mui/icons-material/Upload\";\nimport SaveIcon from \"@mui/icons-material/Save\";\nimport PaletteIcon from '@mui/icons-material/Palette';\n\nimport { FileDiagnosticModal } from \"../../Diagnostic/FileDiagnosticModal\";\nimport { ConfirmationModal } from \"./ConfirmationModal\";\n\nimport { SnackbarEvents } from \"./Snackbar\";\n\nimport { Settings } from \"../../Settings/Settings\";\nimport { DeleteGameButton } from \"./DeleteGameButton\";\nimport { SoftResetButton } from \"./SoftResetButton\";\nimport { IRouter } from \"../Router\";\nimport { ThemeEditorButton } from \"../../Themes/ui/ThemeEditorButton\";\nimport { StyleEditorButton } from \"../../Themes/ui/StyleEditorButton\";\nimport { formatTime } from \"../../utils/helpers/formatTime\";\nimport { OptionSwitch } from \"./OptionSwitch\";\nimport { ImportData, saveObject } from \"../../SaveObject\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: 50,\n padding: theme.spacing(2),\n userSelect: \"none\",\n },\n }),\n);\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n save: () => void;\n export: () => void;\n forceKill: () => void;\n softReset: () => void;\n}\n\nexport function GameOptionsRoot(props: IProps): React.ReactElement {\n const classes = useStyles();\n const importInput = useRef<HTMLInputElement>(null);\n\n const [execTime, setExecTime] = useState(Settings.CodeInstructionRunTime);\n const [logSize, setLogSize] = useState(Settings.MaxLogCapacity);\n const [portSize, setPortSize] = useState(Settings.MaxPortCapacity);\n const [terminalSize, setTerminalSize] = useState(Settings.MaxTerminalCapacity);\n const [autosaveInterval, setAutosaveInterval] = useState(Settings.AutosaveInterval);\n const [timestampFormat, setTimestampFormat] = useState(Settings.TimestampsFormat);\n const [locale, setLocale] = useState(Settings.Locale);\n const [diagnosticOpen, setDiagnosticOpen] = useState(false);\n const [importSaveOpen, setImportSaveOpen] = useState(false);\n const [importData, setImportData] = useState<ImportData | null>(null);\n\n function handleExecTimeChange(event: any, newValue: number | number[]): void {\n setExecTime(newValue as number);\n Settings.CodeInstructionRunTime = newValue as number;\n }\n\n function handleLogSizeChange(event: any, newValue: number | number[]): void {\n setLogSize(newValue as number);\n Settings.MaxLogCapacity = newValue as number;\n }\n\n function handlePortSizeChange(event: any, newValue: number | number[]): void {\n setPortSize(newValue as number);\n Settings.MaxPortCapacity = newValue as number;\n }\n\n function handleTerminalSizeChange(event: any, newValue: number | number[]): void {\n setTerminalSize(newValue as number);\n Settings.MaxTerminalCapacity = newValue as number;\n }\n\n function handleAutosaveIntervalChange(event: any, newValue: number | number[]): void {\n setAutosaveInterval(newValue as number);\n Settings.AutosaveInterval = newValue as number;\n }\n\n function handleLocaleChange(event: SelectChangeEvent<string>): void {\n setLocale(event.target.value as string);\n Settings.Locale = event.target.value as string;\n }\n\n function handleTimestampFormatChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setTimestampFormat(event.target.value);\n Settings.TimestampsFormat = event.target.value;\n }\n\n function startImport(): void {\n if (!window.File || !window.FileReader || !window.FileList || !window.Blob) return;\n const ii = importInput.current;\n if (ii === null) throw new Error(\"import input should not be null\");\n ii.click();\n }\n\n async function onImport(event: React.ChangeEvent<HTMLInputElement>): Promise<void> {\n try {\n const base64Save = await saveObject.getImportStringFromFile(event.target.files);\n const data = await saveObject.getImportDataFromString(base64Save);\n setImportData(data);\n setImportSaveOpen(true);\n } catch (ex: any) {\n SnackbarEvents.emit(ex.toString(), \"error\", 5000);\n }\n }\n\n async function confirmedImportGame(): Promise<void> {\n if (!importData) return;\n\n try {\n await saveObject.importGame(importData.base64);\n } catch (ex: any) {\n SnackbarEvents.emit(ex.toString(), \"error\", 5000);\n }\n\n setImportSaveOpen(false);\n setImportData(null);\n }\n\n function compareSaveGame(): void {\n if (!importData) return;\n props.router.toImportSave(importData.base64);\n setImportSaveOpen(false);\n setImportData(null);\n }\n\n return (\n <div className={classes.root} style={{ width: \"90%\" }}>\n <Typography variant=\"h4\" gutterBottom>\n Options\n </Typography>\n\n <Grid container spacing={3}>\n <Grid item xs={12} sm={6}>\n <List>\n <ListItem>\n <Box display=\"grid\" sx={{ width: 'fit-content', gridTemplateColumns: '1fr 3.5fr', gap: 1 }}>\n <Tooltip\n title={\n <Typography>\n The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too\n low can result in poor performance if you have many scripts running.\n </Typography>\n }\n >\n <Typography>.script exec time (ms)</Typography>\n </Tooltip>\n <Slider\n value={execTime}\n onChange={handleExecTimeChange}\n step={1}\n min={5}\n max={100}\n valueLabelDisplay=\"auto\"\n />\n <Tooltip\n title={\n <Typography>\n The maximum number of lines a script's logs can hold. Setting this too high can cause the game to\n use a lot of memory if you have many scripts running.\n </Typography>\n }\n >\n <Typography>Netscript log size</Typography>\n </Tooltip>\n <Slider\n value={logSize}\n onChange={handleLogSizeChange}\n step={20}\n min={20}\n max={500}\n valueLabelDisplay=\"auto\"\n />\n <Tooltip\n title={\n <Typography>\n The maximum number of entries that can be written to a port using Netscript's write() function.\n Setting this too high can cause the game to use a lot of memory.\n </Typography>\n }\n >\n <Typography>Netscript port size</Typography>\n </Tooltip>\n <Slider\n value={portSize}\n onChange={handlePortSizeChange}\n step={1}\n min={20}\n max={100}\n valueLabelDisplay=\"auto\"\n />\n <Tooltip\n title={\n <Typography>\n The maximum number of entries that can be written to the terminal. Setting this too high can cause\n the game to use a lot of memory.\n </Typography>\n }\n >\n <Typography>Terminal capacity</Typography>\n </Tooltip>\n <Slider\n value={terminalSize}\n onChange={handleTerminalSizeChange}\n step={50}\n min={50}\n max={500}\n valueLabelDisplay=\"auto\"\n marks\n />\n <Tooltip\n title={\n <Typography>The time (in seconds) between each autosave. Set to 0 to disable autosave.</Typography>\n }\n >\n <Typography>Autosave interval (s)</Typography>\n </Tooltip>\n <Slider\n value={autosaveInterval}\n onChange={handleAutosaveIntervalChange}\n step={30}\n min={0}\n max={600}\n valueLabelDisplay=\"auto\"\n marks\n />\n </Box>\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.SuppressMessages}\n onChange={(newValue) => (Settings.SuppressMessages = newValue)}\n text=\"Suppress story messages\"\n tooltip={\n <>\n If this is set, then any messages you receive will not appear as popups on the screen. They will\n still get sent to your home computer as '.msg' files and can be viewed with the 'cat' Terminal\n command.\n </>\n }\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.SuppressFactionInvites}\n onChange={(newValue) => (Settings.SuppressFactionInvites = newValue)}\n text=\"Suppress faction invites\"\n tooltip={\n <>\n If this is set, then any faction invites you receive will not appear as popups on the screen. Your\n outstanding faction invites can be viewed in the 'Factions' page.\n </>\n }\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.SuppressTravelConfirmation}\n onChange={(newValue) => (Settings.SuppressTravelConfirmation = newValue)}\n text=\"Suppress travel confirmations\"\n tooltip={\n <>\n If this is set, the confirmation message before traveling will not show up. You will automatically\n be deducted the travel cost as soon as you click.\n </>\n }\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.SuppressBuyAugmentationConfirmation}\n onChange={(newValue) => (Settings.SuppressBuyAugmentationConfirmation = newValue)}\n text=\"Suppress augmentations confirmation\"\n tooltip={<>If this is set, the confirmation message before buying augmentation will not show up.</>}\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.SuppressTIXPopup}\n onChange={(newValue) => (Settings.SuppressTIXPopup = newValue)}\n text=\"Suppress TIX messages\"\n tooltip={<>If this is set, the stock market will never create any popup.</>}\n />\n </ListItem>\n {!!props.player.bladeburner && (\n <ListItem>\n <OptionSwitch\n checked={Settings.SuppressBladeburnerPopup}\n onChange={(newValue) => (Settings.SuppressBladeburnerPopup = newValue)}\n text=\"Suppress bladeburner popup\"\n tooltip={\n <>\n If this is set, then having your Bladeburner actions interrupted by being busy with something else\n will not display a popup message.\n </>\n }\n />\n </ListItem>\n )}\n <ListItem>\n <OptionSwitch\n checked={Settings.SuppressSavedGameToast}\n onChange={(newValue) => (Settings.SuppressSavedGameToast = newValue)}\n text=\"Suppress Auto-Save Game Toast\"\n tooltip={<>If this is set, there will be no \"Game Saved!\" toast appearing after an auto-save.</>}\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.DisableHotkeys}\n onChange={(newValue) => (Settings.DisableHotkeys = newValue)}\n text=\"Disable hotkeys\"\n tooltip={\n <>\n If this is set, then most hotkeys (keyboard shortcuts) in the game are disabled. This includes\n Terminal commands, hotkeys to navigate between different parts of the game, and the \"Save and Close\n (Ctrl + b)\" hotkey in the Text Editor.\n </>\n }\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.DisableASCIIArt}\n onChange={(newValue) => (Settings.DisableASCIIArt = newValue)}\n text=\"Disable ascii art\"\n tooltip={<>If this is set all ASCII art will be disabled.</>}\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.DisableTextEffects}\n onChange={(newValue) => (Settings.DisableTextEffects = newValue)}\n text=\"Disable text effects\"\n tooltip={\n <>\n If this is set, text effects will not be displayed. This can help if text is difficult to read in\n certain areas.\n </>\n }\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.DisableOverviewProgressBars}\n onChange={(newValue) => (Settings.DisableOverviewProgressBars = newValue)}\n text=\"Disable Overview Progress Bars\"\n tooltip={<>If this is set, the progress bars in the character overview will be hidden.</>}\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.EnableBashHotkeys}\n onChange={(newValue) => (Settings.EnableBashHotkeys = newValue)}\n text=\"Enable bash hotkeys\"\n tooltip={\n <>\n Improved Bash emulation mode. Setting this to 1 enables several new Terminal shortcuts and features\n that more closely resemble a real Bash-style shell. Note that when this mode is enabled, the default\n browser shortcuts are overriden by the new Bash shortcuts.\n </>\n }\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.UseIEC60027_2}\n onChange={(newValue) => (Settings.UseIEC60027_2 = newValue)}\n text=\"Use GiB instead of GB\"\n tooltip={\n <>\n If this is set all references to memory will use GiB instead of GB, in accordance with IEC 60027-2.\n </>\n }\n />\n </ListItem>\n <ListItem>\n <OptionSwitch\n checked={Settings.ExcludeRunningScriptsFromSave}\n onChange={(newValue) => (Settings.ExcludeRunningScriptsFromSave = newValue)}\n text=\"Exclude Running Scripts from Save\"\n tooltip={\n <>\n If this is set, the save file will exclude all running scripts. This is only useful if your save is\n lagging a lot. You'll have to restart your script every time you launch the game.\n </>\n }\n />\n </ListItem>\n <ListItem>\n <Tooltip\n title={\n <Typography>\n Terminal commands and log entries will be timestamped. See\n https://date-fns.org/docs/Getting-Started/\n </Typography>\n }\n >\n <span>\n <TextField\n InputProps={{\n startAdornment: (\n <Typography\n color={\n formatTime(timestampFormat) === \"format error\" && timestampFormat !== \"\"\n ? \"error\"\n : \"success\"\n }\n >\n Timestamp format: \n </Typography>\n ),\n }}\n value={timestampFormat}\n onChange={handleTimestampFormatChange}\n placeholder=\"yyyy-MM-dd hh:mm:ss\"\n />\n </span>\n </Tooltip>\n </ListItem>\n\n <ListItem>\n <OptionSwitch\n checked={Settings.SaveGameOnFileSave}\n onChange={(newValue) => (Settings.SaveGameOnFileSave = newValue)}\n text=\"Save game on file save\"\n tooltip={<>Save your game any time a file is saved in the script editor.</>}\n />\n </ListItem>\n\n <ListItem>\n <Tooltip title={<Typography>Sets the locale for displaying numbers.</Typography>}>\n <Typography>Locale </Typography>\n </Tooltip>\n <Select value={locale} onChange={handleLocaleChange}>\n <MenuItem value=\"en\">en</MenuItem>\n <MenuItem value=\"bg\">bg</MenuItem>\n <MenuItem value=\"cs\">cs</MenuItem>\n <MenuItem value=\"da-dk\">da-dk</MenuItem>\n <MenuItem value=\"de\">de</MenuItem>\n <MenuItem value=\"en-au\">en-au</MenuItem>\n <MenuItem value=\"en-gb\">en-gb</MenuItem>\n <MenuItem value=\"es\">es</MenuItem>\n <MenuItem value=\"fr\">fr</MenuItem>\n <MenuItem value=\"hu\">hu</MenuItem>\n <MenuItem value=\"it\">it</MenuItem>\n <MenuItem value=\"lv\">lv</MenuItem>\n <MenuItem value=\"no\">no</MenuItem>\n <MenuItem value=\"pl\">pl</MenuItem>\n <MenuItem value=\"ru\">ru</MenuItem>\n </Select>\n </ListItem>\n </List>\n {!location.href.startsWith(\"file://\") && (\n <>\n <ListItem>\n <Typography>danielyxie / BigD (Original developer): </Typography>\n <form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_blank\">\n <input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\" />\n <input\n type=\"hidden\"\n name=\"encrypted\"\n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SqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcwNzI1MDExODE2WjAjBgkqhkiG9w0BCQQxFgQUNo8efiZ7sk7nwKM/6B6Z7sU8hIIwDQYJKoZIhvcNAQEBBQAEgYB+JB4vZ/r48815/1HF/xK3+rOx7bPz3kAXmbhW/mkoF4OUbzqMeljvDIA9q/BDdlCLtxFOw9XlftTzv0eZCW/uCIiwu5wTzPIfPY1SI8WHe4cJbP2f2EYxIVs8D7OSirbW4yVa0+gACaLLj0rzIzNN8P/5PxgB03D+jwkcJABqng==-----END PKCS7-----\"\n />\n <input\n type=\"image\"\n src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif\"\n name=\"submit\"\n alt=\"PayPal - The safer, easier way to pay online!\"\n />\n </form>\n </ListItem>\n\n <ListItem>\n <Typography>\n hydroflame (Current maintainer):{\" \"}\n <Link href=\"https://www.google.com/search?q=Where+to+donate+blood+near+me%3F\" target=\"_blank\">\n Donate blood!\n </Link>{\" \"}\n </Typography>\n </ListItem>\n </>\n )}\n </Grid>\n <Box sx={{ display: \"grid\", width: \"fit-content\", height: \"fit-content\" }}>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}>\n <Button onClick={() => props.save()} startIcon={<SaveIcon />}>\n Save Game\n </Button>\n <DeleteGameButton />\n </Box>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}>\n <Tooltip title={<Typography>Export your game to a text file.</Typography>}>\n <Button onClick={() => props.export()} startIcon={<DownloadIcon />}>\n Export Game\n </Button>\n </Tooltip>\n <Tooltip\n title={\n <Typography>\n Import your game from a text file.\n <br />\n This will <strong>overwrite</strong> your current game. Back it up first!\n </Typography>\n }\n >\n <Button onClick={startImport} startIcon={<UploadIcon />}>\n Import Game\n <input ref={importInput} id=\"import-game-file-selector\" type=\"file\" hidden onChange={onImport} />\n </Button>\n </Tooltip>\n <ConfirmationModal\n open={importSaveOpen}\n onClose={() => setImportSaveOpen(false)}\n onConfirm={() => confirmedImportGame()}\n additionalButton={<Button onClick={compareSaveGame}>Compare Save</Button>}\n confirmationText={\n <>\n Importing a new game will <strong>completely wipe</strong> the current data!\n <br />\n <br />\n Make sure to have a backup of your current save file before importing.\n <br />\n The file you are attempting to import seems valid.\n {(importData?.playerData?.lastSave ?? 0) > 0 && (\n <>\n <br />\n <br />\n The export date of the save file is{\" \"}\n <strong>{new Date(importData?.playerData?.lastSave ?? 0).toLocaleString()}</strong>\n </>\n )}\n {(importData?.playerData?.totalPlaytime ?? 0) > 0 && (\n <>\n <br />\n <br />\n Total play time of imported game:{\" \"}\n {convertTimeMsToTimeElapsedString(importData?.playerData?.totalPlaytime ?? 0)}\n </>\n )}\n <br />\n <br />\n </>\n }\n />\n </Box>\n <Box sx={{ display: \"grid\" }}>\n <Tooltip\n title={\n <Typography>\n Forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the\n game. After using this, save the game and then reload the page. This is different then normal kill in\n that normal kill will tell the script to shut down while force kill just removes the references to it\n (and it should crash on it's own). This will not remove the files on your computer. Just forcefully\n kill all running instance of all scripts.\n </Typography>\n }\n >\n <Button onClick={() => props.forceKill()}>Force kill all active scripts</Button>\n </Tooltip>\n </Box>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}>\n <SoftResetButton\n noConfirmation={Settings.SuppressBuyAugmentationConfirmation}\n onTriggered={props.softReset}\n />\n <Tooltip\n title={\n <Typography>\n If your save file is extremely big you can use this button to view a map of all the files on every\n server. Be careful there might be spoilers.\n </Typography>\n }\n >\n <Button onClick={() => setDiagnosticOpen(true)}>Diagnose files</Button>\n </Tooltip>\n </Box>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr 1fr\" }}>\n <Tooltip title=\"Head to the theme browser to see a collection of prebuilt themes.\">\n <Button startIcon={<PaletteIcon />} onClick={() => props.router.toThemeBrowser()}>\n Theme Browser\n </Button>\n </Tooltip>\n <ThemeEditorButton router={props.router} />\n <StyleEditorButton />\n </Box>\n <Box>\n <Link href=\"https://github.com/danielyxie/bitburner/issues/new\" target=\"_blank\">\n <Typography>Report bug</Typography>\n </Link>\n <Link href=\"https://bitburner.readthedocs.io/en/latest/changelog.html\" target=\"_blank\">\n <Typography>Changelog</Typography>\n </Link>\n <Link href=\"https://bitburner.readthedocs.io/en/latest/index.html\" target=\"_blank\">\n <Typography>Documentation</Typography>\n </Link>\n <Link href=\"https://discord.gg/TFc3hKD\" target=\"_blank\">\n <Typography>Discord</Typography>\n </Link>\n <Link href=\"https://www.reddit.com/r/bitburner\" target=\"_blank\">\n <Typography>Reddit</Typography>\n </Link>\n <Link href=\"https://plaza.dsolver.ca/games/bitburner\" target=\"_blank\">\n <Typography>Incremental game plaza</Typography>\n </Link>\n </Box>\n </Box>\n </Grid>\n <FileDiagnosticModal open={diagnosticOpen} onClose={() => setDiagnosticOpen(false)} />\n </div>\n );\n}\n","import React from \"react\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\nimport { Modal } from \"../ui/React/Modal\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableContainer from \"@mui/material/TableContainer\";\nimport TableHead from \"@mui/material/TableHead\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\ninterface IServerProps {\n hostname: string;\n}\n\nfunction ServerAccordion(props: IServerProps): React.ReactElement {\n const server = GetServer(props.hostname);\n if (server === null) throw new Error(`server '${props.hostname}' should not be null`);\n let totalSize = 0;\n for (const f of server.scripts) {\n totalSize += f.code.length;\n }\n\n for (const f of server.textFiles) {\n totalSize += f.text.length;\n }\n\n if (totalSize === 0) {\n return <></>;\n }\n\n interface File {\n name: string;\n size: number;\n }\n\n const files: File[] = [];\n\n for (const f of server.scripts) {\n files.push({ name: f.filename, size: f.code.length });\n }\n\n for (const f of server.textFiles) {\n files.push({ name: f.fn, size: f.text.length });\n }\n\n files.sort((a: File, b: File): number => b.size - a.size);\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>\n {server.hostname} ({numeralWrapper.formatBigNumber(totalSize)}b)\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <TableContainer component={Paper}>\n <Table>\n <TableHead>\n <TableRow>\n <TableCell>\n <Typography>Filename</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>Size</Typography>\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {files.map((file: File) => (\n <TableRow key={file.name}>\n <TableCell component=\"th\" scope=\"row\">\n <Typography>{file.name}</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>{numeralWrapper.formatBigNumber(file.size)}b</Typography>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </TableContainer>\n <ul></ul>\n </AccordionDetails>\n </Accordion>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function FileDiagnosticModal(props: IProps): React.ReactElement {\n const keys: string[] = [];\n for (const key of GetAllServers()) {\n keys.push(key.hostname);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Welcome to the file diagnostic! If your save file is really big it's likely because you have too many\n text/scripts. This tool can help you narrow down where they are.\n </Typography>\n {keys.map((hostname: string) => (\n <ServerAccordion key={hostname} hostname={hostname} />\n ))}\n </>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport TextField from \"@mui/material/TextField\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport PaletteSharpIcon from \"@mui/icons-material/PaletteSharp\";\nimport HistoryIcon from '@mui/icons-material/History';\nimport { Color, ColorPicker } from \"material-ui-color\";\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings, defaultSettings } from \"../../Settings/Settings\";\nimport { defaultTheme } from \"../Themes\";\nimport { UserInterfaceTheme } from \"../../ScriptEditor/NetscriptDefinitions\";\nimport { IRouter } from \"../../ui/Router\";\nimport { ThemeCollaborate } from \"./ThemeCollaborate\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n router: IRouter;\n}\n\ninterface IColorEditorProps {\n name: string;\n color: string | undefined;\n onColorChange: (name: string, value: string) => void;\n defaultColor: string;\n}\n\nfunction ColorEditor({ name, onColorChange, color, defaultColor }: IColorEditorProps): React.ReactElement {\n if (color === undefined) {\n console.error(`color ${name} was undefined, reverting to default`);\n color = defaultColor;\n }\n\n return (\n <>\n <TextField\n sx={{ mx: 1 }}\n label={name}\n value={color}\n InputProps={{\n startAdornment: (\n <>\n <ColorPicker\n hideTextfield\n deferred\n value={color}\n onChange={(newColor: Color) => onColorChange(name, \"#\" + newColor.hex)}\n disableAlpha\n />\n </>\n ),\n endAdornment: (\n <>\n <IconButton onClick={() => onColorChange(name, defaultColor)}>\n <ReplyIcon color=\"primary\" />\n </IconButton>\n </>\n ),\n }}\n />\n </>\n );\n}\n\nexport function ThemeEditorModal(props: IProps): React.ReactElement {\n const [customTheme, setCustomTheme] = useState<{ [key: string]: string | undefined }>({\n ...Settings.theme,\n });\n\n function setTheme(theme: UserInterfaceTheme): void {\n setCustomTheme(theme);\n Object.assign(Settings.theme, theme);\n ThemeEvents.emit();\n }\n\n function onThemeChange(event: React.ChangeEvent<HTMLInputElement>): void {\n try {\n const importedTheme = JSON.parse(event.target.value);\n if (typeof importedTheme !== \"object\") return;\n setCustomTheme(importedTheme);\n for (const key of Object.keys(importedTheme)) {\n Settings.theme[key] = importedTheme[key];\n }\n ThemeEvents.emit();\n } catch (err) {\n // ignore\n }\n }\n\n function onColorChange(name: string, value: string): void {\n setCustomTheme((old: any) => {\n old[name] = value;\n return old;\n });\n\n Settings.theme[name] = value;\n ThemeEvents.emit();\n }\n\n function setTemplateTheme(theme: UserInterfaceTheme): void {\n setTheme(theme);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Paper sx={{ px: 1, py: 1, my: 1 }}>\n <Tooltip open={true} placement={\"top\"} title={<Typography>Example tooltip</Typography>}>\n <Button color=\"primary\" size=\"small\">primary button</Button>\n </Tooltip>\n <Button color=\"secondary\" size=\"small\">secondary button</Button>\n <Button color=\"warning\" size=\"small\">warning button</Button>\n <Button color=\"info\" size=\"small\">info button</Button>\n <Button color=\"error\" size=\"small\">error button</Button>\n <Button disabled size=\"small\">disabled button</Button>\n\n <br />\n <Typography color=\"primary\" variant=\"caption\">text with primary color</Typography> \n <Typography color=\"secondary\" variant=\"caption\">text with secondary color</Typography> \n <Typography color=\"error\" variant=\"caption\">text with error color</Typography>\n\n <br />\n <TextField value={\"Text field\"} size=\"small\" />\n </Paper>\n\n <Paper sx={{ py: 1, my: 1 }}>\n <ColorEditor\n name=\"primarylight\"\n onColorChange={onColorChange}\n color={customTheme[\"primarylight\"]}\n defaultColor={defaultSettings.theme[\"primarylight\"]}\n />\n <ColorEditor\n name=\"primary\"\n onColorChange={onColorChange}\n color={customTheme[\"primary\"]}\n defaultColor={defaultSettings.theme[\"primary\"]}\n />\n <ColorEditor\n name=\"primarydark\"\n onColorChange={onColorChange}\n color={customTheme[\"primarydark\"]}\n defaultColor={defaultSettings.theme[\"primarydark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"successlight\"\n onColorChange={onColorChange}\n color={customTheme[\"successlight\"]}\n defaultColor={defaultSettings.theme[\"successlight\"]}\n />\n <ColorEditor\n name=\"success\"\n onColorChange={onColorChange}\n color={customTheme[\"success\"]}\n defaultColor={defaultSettings.theme[\"success\"]}\n />\n <ColorEditor\n name=\"successdark\"\n onColorChange={onColorChange}\n color={customTheme[\"successdark\"]}\n defaultColor={defaultSettings.theme[\"successdark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"errorlight\"\n onColorChange={onColorChange}\n color={customTheme[\"errorlight\"]}\n defaultColor={defaultSettings.theme[\"errorlight\"]}\n />\n <ColorEditor\n name=\"error\"\n onColorChange={onColorChange}\n color={customTheme[\"error\"]}\n defaultColor={defaultSettings.theme[\"error\"]}\n />\n <ColorEditor\n name=\"errordark\"\n onColorChange={onColorChange}\n color={customTheme[\"errordark\"]}\n defaultColor={defaultSettings.theme[\"errordark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"secondarylight\"\n onColorChange={onColorChange}\n color={customTheme[\"secondarylight\"]}\n defaultColor={defaultSettings.theme[\"secondarylight\"]}\n />\n <ColorEditor\n name=\"secondary\"\n onColorChange={onColorChange}\n color={customTheme[\"secondary\"]}\n defaultColor={defaultSettings.theme[\"secondary\"]}\n />\n <ColorEditor\n name=\"secondarydark\"\n onColorChange={onColorChange}\n color={customTheme[\"secondarydark\"]}\n defaultColor={defaultSettings.theme[\"secondarydark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"warninglight\"\n onColorChange={onColorChange}\n color={customTheme[\"warninglight\"]}\n defaultColor={defaultSettings.theme[\"warninglight\"]}\n />\n <ColorEditor\n name=\"warning\"\n onColorChange={onColorChange}\n color={customTheme[\"warning\"]}\n defaultColor={defaultSettings.theme[\"warning\"]}\n />\n <ColorEditor\n name=\"warningdark\"\n onColorChange={onColorChange}\n color={customTheme[\"warningdark\"]}\n defaultColor={defaultSettings.theme[\"warningdark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"infolight\"\n onColorChange={onColorChange}\n color={customTheme[\"infolight\"]}\n defaultColor={defaultSettings.theme[\"infolight\"]}\n />\n <ColorEditor\n name=\"info\"\n onColorChange={onColorChange}\n color={customTheme[\"info\"]}\n defaultColor={defaultSettings.theme[\"info\"]}\n />\n <ColorEditor\n name=\"infodark\"\n onColorChange={onColorChange}\n color={customTheme[\"infodark\"]}\n defaultColor={defaultSettings.theme[\"infodark\"]}\n />\n\n <br />\n <ColorEditor\n name=\"welllight\"\n onColorChange={onColorChange}\n color={customTheme[\"welllight\"]}\n defaultColor={defaultSettings.theme[\"welllight\"]}\n />\n <ColorEditor\n name=\"well\"\n onColorChange={onColorChange}\n color={customTheme[\"well\"]}\n defaultColor={defaultSettings.theme[\"well\"]}\n />\n <ColorEditor\n name=\"white\"\n onColorChange={onColorChange}\n color={customTheme[\"white\"]}\n defaultColor={defaultSettings.theme[\"white\"]}\n />\n <ColorEditor\n name=\"black\"\n onColorChange={onColorChange}\n color={customTheme[\"black\"]}\n defaultColor={defaultSettings.theme[\"black\"]}\n />\n <ColorEditor\n name=\"backgroundprimary\"\n onColorChange={onColorChange}\n color={customTheme[\"backgroundprimary\"]}\n defaultColor={defaultSettings.theme[\"backgroundprimary\"]}\n />\n <ColorEditor\n name=\"backgroundsecondary\"\n onColorChange={onColorChange}\n color={customTheme[\"backgroundsecondary\"]}\n defaultColor={defaultSettings.theme[\"backgroundsecondary\"]}\n />\n <ColorEditor\n name=\"button\"\n onColorChange={onColorChange}\n color={customTheme[\"button\"]}\n defaultColor={defaultSettings.theme[\"button\"]}\n />\n\n <br />\n <ColorEditor\n name=\"hp\"\n onColorChange={onColorChange}\n color={customTheme[\"hp\"]}\n defaultColor={defaultSettings.theme[\"hp\"]}\n />\n <ColorEditor\n name=\"money\"\n onColorChange={onColorChange}\n color={customTheme[\"money\"]}\n defaultColor={defaultSettings.theme[\"money\"]}\n />\n <ColorEditor\n name=\"hack\"\n onColorChange={onColorChange}\n color={customTheme[\"hack\"]}\n defaultColor={defaultSettings.theme[\"hack\"]}\n />\n <ColorEditor\n name=\"combat\"\n onColorChange={onColorChange}\n color={customTheme[\"combat\"]}\n defaultColor={defaultSettings.theme[\"combat\"]}\n />\n <ColorEditor\n name=\"cha\"\n onColorChange={onColorChange}\n color={customTheme[\"cha\"]}\n defaultColor={defaultSettings.theme[\"cha\"]}\n />\n <ColorEditor\n name=\"int\"\n onColorChange={onColorChange}\n color={customTheme[\"int\"]}\n defaultColor={defaultSettings.theme[\"int\"]}\n />\n <ColorEditor\n name=\"rep\"\n onColorChange={onColorChange}\n color={customTheme[\"rep\"]}\n defaultColor={defaultSettings.theme[\"rep\"]}\n />\n <ColorEditor\n name=\"disabled\"\n onColorChange={onColorChange}\n color={customTheme[\"disabled\"]}\n defaultColor={defaultSettings.theme[\"disabled\"]}\n />\n </Paper>\n\n <Paper sx={{ px: 1, py: 1, my: 1 }}>\n <TextField\n sx={{ mb: 1 }}\n multiline\n fullWidth\n maxRows={3}\n label={\"import / export theme\"}\n value={JSON.stringify(customTheme)}\n onChange={onThemeChange}\n />\n <>\n <Typography sx={{ my: 1 }}>Backup your theme or share it with others by copying the string above.</Typography>\n <ThemeCollaborate />\n <ButtonGroup>\n <Tooltip title=\"Reverts all modification back to the default theme. This is permanent.\">\n <Button onClick={() => setTemplateTheme(defaultTheme)}\n startIcon={<HistoryIcon />}>\n Revert to Default\n </Button>\n </Tooltip>\n <Tooltip title=\"Move over to the theme browser's page to use one of our predefined themes.\">\n <Button startIcon={<PaletteSharpIcon />} onClick={() => props.router.toThemeBrowser()}>See more themes</Button>\n </Tooltip>\n </ButtonGroup>\n </>\n </Paper>\n </Modal>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport TextField from \"@mui/material/TextField\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport SaveIcon from \"@mui/icons-material/Save\";\n\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { defaultStyles } from \"../Styles\";\nimport { Tooltip } from \"@mui/material\";\nimport { IStyleSettings } from \"../../ScriptEditor/NetscriptDefinitions\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\ninterface FontFamilyProps {\n value: React.CSSProperties[\"fontFamily\"];\n onChange: (newValue: React.CSSProperties[\"fontFamily\"], error?: string) => void;\n refreshId: number;\n}\n\nfunction FontFamilyField({ value, onChange, refreshId }: FontFamilyProps): React.ReactElement {\n const [errorText, setErrorText] = useState<string | undefined>();\n const [fontFamily, setFontFamily] = useState<React.CSSProperties[\"fontFamily\"]>(value);\n\n function update(newValue: React.CSSProperties[\"fontFamily\"]): void {\n setFontFamily(newValue);\n if (!newValue) {\n setErrorText(\"Must have a value\");\n } else {\n setErrorText(\"\");\n }\n }\n\n function onTextChange(event: React.ChangeEvent<HTMLInputElement>): void {\n update(event.target.value);\n }\n\n useEffect(() => onChange(fontFamily, errorText), [fontFamily]);\n useEffect(() => update(value), [refreshId]);\n\n return (\n <TextField\n sx={{ my: 1 }}\n label={\"Font-Family\"}\n error={!!errorText}\n value={fontFamily}\n helperText={errorText}\n onChange={onTextChange}\n fullWidth\n />\n );\n}\n\ninterface LineHeightProps {\n value: React.CSSProperties[\"lineHeight\"];\n onChange: (newValue: React.CSSProperties[\"lineHeight\"], error?: string) => void;\n refreshId: number;\n}\n\nfunction LineHeightField({ value, onChange, refreshId }: LineHeightProps): React.ReactElement {\n const [errorText, setErrorText] = useState<string | undefined>();\n const [lineHeight, setLineHeight] = useState<React.CSSProperties[\"lineHeight\"]>(value);\n\n function update(newValue: React.CSSProperties[\"lineHeight\"]): void {\n setLineHeight(newValue);\n if (!newValue) {\n setErrorText(\"Must have a value\");\n } else if (isNaN(Number(newValue))) {\n setErrorText(\"Must be a number\");\n } else {\n setErrorText(\"\");\n }\n }\n\n function onTextChange(event: React.ChangeEvent<HTMLInputElement>): void {\n update(event.target.value);\n }\n\n useEffect(() => onChange(lineHeight, errorText), [lineHeight]);\n useEffect(() => update(value), [refreshId]);\n\n return (\n <TextField\n sx={{ my: 1 }}\n label={\"Line Height\"}\n error={!!errorText}\n value={lineHeight}\n helperText={errorText}\n onChange={onTextChange}\n />\n );\n}\n\nexport function StyleEditorModal(props: IProps): React.ReactElement {\n const [refreshId, setRefreshId] = useState<number>(0);\n const [error, setError] = useState<string | undefined>();\n const [customStyle, setCustomStyle] = useState<IStyleSettings>({\n ...Settings.styles,\n });\n\n function persistToSettings(styles: IStyleSettings): void {\n Object.assign(Settings.styles, styles);\n ThemeEvents.emit();\n }\n\n function saveStyles(): void {\n persistToSettings(customStyle);\n }\n\n function setDefaults(): void {\n const styles = { ...defaultStyles };\n setCustomStyle(styles);\n persistToSettings(styles);\n setRefreshId(refreshId + 1);\n }\n\n function update(styles: IStyleSettings, errorMessage?: string): void {\n setError(errorMessage);\n if (!errorMessage) {\n setCustomStyle(styles);\n }\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography variant=\"h6\">Styles Editor</Typography>\n <Typography>\n WARNING: Changing styles <strong>may mess up</strong> the interface. Drastic changes are{\" \"}\n <strong>NOT recommended</strong>.\n </Typography>\n <Paper sx={{ p: 2, my: 2 }}>\n <FontFamilyField\n value={customStyle.fontFamily}\n refreshId={refreshId}\n onChange={(value, error) => update({ ...customStyle, fontFamily: value as any }, error)}\n />\n <br />\n <LineHeightField\n value={customStyle.lineHeight}\n refreshId={refreshId}\n onChange={(value, error) => update({ ...customStyle, lineHeight: value as any }, error)}\n />\n <br />\n <ButtonGroup sx={{ my: 1 }}>\n <Button onClick={setDefaults} startIcon={<ReplyIcon />} color=\"secondary\" variant=\"outlined\">\n Revert to Defaults\n </Button>\n <Tooltip title={\"Save styles to settings\"}>\n <Button onClick={saveStyles} endIcon={<SaveIcon />} color={error ? \"error\" : \"primary\"} disabled={!!error}>\n Save Modifications\n </Button>\n </Tooltip>\n </ButtonGroup>\n </Paper>\n </Modal>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { SleeveElem } from \"./SleeveElem\";\nimport { FAQModal } from \"./FAQModal\";\nimport { use } from \"../../../ui/Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Link from \"@mui/material/Link\";\n\nexport function SleeveRoot(): React.ReactElement {\n const player = use.Player();\n const [FAQOpen, setFAQOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <>\n <Typography variant=\"h4\">Sleeves</Typography>\n <Typography>\n Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciousness has been copied. In\n other words, these Synthoids contain a perfect duplicate of your mind.\n <br />\n <br />\n Sleeves can be used to perform different tasks synchronously.\n <br />\n <br />\n </Typography>\n\n <Button onClick={() => setFAQOpen(true)}>FAQ</Button>\n <Link\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/advancedgameplay/sleeves.html#duplicate-sleeves\"\n >\n <Typography> Documentation</Typography>\n </Link>\n {player.sleeves.map((sleeve, i) => (\n <SleeveElem key={i} rerender={rerender} sleeve={sleeve} />\n ))}\n <FAQModal open={FAQOpen} onClose={() => setFAQOpen(false)} />\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\n\nimport { CONSTANTS } from \"../../../Constants\";\n\nimport { Crimes } from \"../../../Crime/Crimes\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\n\nimport { createProgressBarText } from \"../../../utils/helpers/createProgressBarText\";\n\nimport { SleeveAugmentationsModal } from \"./SleeveAugmentationsModal\";\nimport { TravelModal } from \"./TravelModal\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { MoneyRate } from \"../../../ui/React/MoneyRate\";\nimport { use } from \"../../../ui/Context\";\nimport { ReputationRate } from \"../../../ui/React/ReputationRate\";\nimport { StatsElement } from \"../ui/StatsElement\";\nimport { MoreStatsModal } from \"./MoreStatsModal\";\nimport { MoreEarningsModal } from \"../ui/MoreEarningsModal\";\nimport { TaskSelector } from \"../ui/TaskSelector\";\nimport { FactionWorkType } from \"../../../Faction/FactionWorkTypeEnum\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IProps {\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function SleeveElem(props: IProps): React.ReactElement {\n const player = use.Player();\n const [statsOpen, setStatsOpen] = useState(false);\n const [earningsOpen, setEarningsOpen] = useState(false);\n const [travelOpen, setTravelOpen] = useState(false);\n const [augmentationsOpen, setAugmentationsOpen] = useState(false);\n\n const [abc, setABC] = useState([\"------\", \"------\", \"------\"]);\n\n function setTask(): void {\n props.sleeve.resetTaskStatus(); // sets to idle\n switch (abc[0]) {\n case \"------\":\n break;\n case \"Work for Company\":\n props.sleeve.workForCompany(player, abc[1]);\n break;\n case \"Work for Faction\":\n props.sleeve.workForFaction(player, abc[1], abc[2]);\n break;\n case \"Commit Crime\":\n props.sleeve.commitCrime(player, abc[1]);\n break;\n case \"Take University Course\":\n props.sleeve.takeUniversityCourse(player, abc[2], abc[1]);\n break;\n case \"Workout at Gym\":\n props.sleeve.workoutAtGym(player, abc[2], abc[1]);\n break;\n case \"Shock Recovery\":\n props.sleeve.shockRecovery(player);\n break;\n case \"Synchronize\":\n props.sleeve.synchronize(player);\n break;\n default:\n console.error(`Invalid/Unrecognized taskValue in setSleeveTask(): ${abc[0]}`);\n }\n props.rerender();\n }\n\n let desc = <></>;\n switch (props.sleeve.currentTask) {\n case SleeveTaskType.Idle:\n desc = <>This sleeve is currently idle</>;\n break;\n case SleeveTaskType.Company:\n desc = <>This sleeve is currently working your job at {props.sleeve.currentTaskLocation}.</>;\n break;\n case SleeveTaskType.Faction: {\n let doing = \"nothing\";\n switch (props.sleeve.factionWorkType) {\n case FactionWorkType.Field:\n doing = \"Field work\";\n break;\n case FactionWorkType.Hacking:\n doing = \"Hacking contracts\";\n break;\n case FactionWorkType.Security:\n doing = \"Security work\";\n break;\n }\n desc = (\n <>\n This sleeve is currently doing {doing} for {props.sleeve.currentTaskLocation}.\n </>\n );\n break;\n }\n case SleeveTaskType.Crime: {\n const crime = Object.values(Crimes).find((crime) => crime.name === props.sleeve.crimeType);\n if (!crime) throw new Error(\"crime should not be undefined\");\n desc = (\n <>\n This sleeve is currently attempting to {crime.type} (Success Rate:{\" \"}\n {numeralWrapper.formatPercentage(crime.successRate(props.sleeve))}).\n </>\n );\n break;\n }\n case SleeveTaskType.Class:\n desc = <>This sleeve is currently studying/taking a course at {props.sleeve.currentTaskLocation}.</>;\n break;\n case SleeveTaskType.Gym:\n desc = <>This sleeve is currently working out at {props.sleeve.currentTaskLocation}.</>;\n break;\n case SleeveTaskType.Recovery:\n desc = (\n <>\n This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a\n faster rate.\n </>\n );\n break;\n case SleeveTaskType.Synchro:\n desc = (\n <>\n This sleeve is currently set to synchronize with the original consciousness. This causes the Sleeve's\n synchronization to increase.\n </>\n );\n break;\n default:\n console.error(`Invalid/Unrecognized taskValue in updateSleeveTaskDescription(): ${abc[0]}`);\n }\n\n let data: any[][] = [];\n if (props.sleeve.currentTask === SleeveTaskType.Crime) {\n data = [\n [`Money`, <Money money={parseFloat(props.sleeve.currentTaskLocation)} />, `(on success)`],\n [`Hacking Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.hack), `(2x on success)`],\n [`Strength Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.str), `(2x on success)`],\n [`Defense Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.def), `(2x on success)`],\n [`Dexterity Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.dex), `(2x on success)`],\n [`Agility Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.agi), `(2x on success)`],\n [`Charisma Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.cha), `(2x on success)`],\n ];\n } else {\n data = [\n [`Money:`, <MoneyRate money={5 * props.sleeve.gainRatesForTask.money} />],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.hack)} / s`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.str)} / s`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.def)} / s`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.dex)} / s`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.agi)} / s`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.cha)} / s`],\n ];\n if (props.sleeve.currentTask === SleeveTaskType.Company || props.sleeve.currentTask === SleeveTaskType.Faction) {\n const repGain: number = props.sleeve.getRepGain(player);\n data.push([`Reputation:`, <ReputationRate reputation={5 * repGain} />]);\n }\n }\n\n return (\n <>\n <Grid container component={Paper}>\n <Grid item xs={3}>\n <StatsElement sleeve={props.sleeve} />\n <Button onClick={() => setStatsOpen(true)}>More Stats</Button>\n <Tooltip title={player.money < CONSTANTS.TravelCost ? <Typography>Insufficient funds</Typography> : \"\"}>\n <span>\n <Button onClick={() => setTravelOpen(true)} disabled={player.money < CONSTANTS.TravelCost}>\n Travel\n </Button>\n </span>\n </Tooltip>\n <Tooltip\n title={props.sleeve.shock < 100 ? <Typography>Unlocked when sleeve has fully recovered</Typography> : \"\"}\n >\n <span>\n <Button onClick={() => setAugmentationsOpen(true)} disabled={props.sleeve.shock < 100}>\n Manage Augmentations\n </Button>\n </span>\n </Tooltip>\n </Grid>\n <Grid item xs={5}>\n <TaskSelector player={player} sleeve={props.sleeve} setABC={setABC} />\n <Typography>{desc}</Typography>\n <Typography>\n {props.sleeve.currentTask === SleeveTaskType.Crime &&\n createProgressBarText({\n progress: props.sleeve.currentTaskTime / props.sleeve.currentTaskMaxTime,\n totalTicks: 25,\n })}\n </Typography>\n <Button onClick={setTask}>Set Task</Button>\n </Grid>\n <Grid item xs={4}>\n <StatsTable title=\"Earnings (Pre-Synchronization)\" rows={data} />\n <Button onClick={() => setEarningsOpen(true)}>More Earnings Info</Button>\n </Grid>\n </Grid>\n <MoreStatsModal open={statsOpen} onClose={() => setStatsOpen(false)} sleeve={props.sleeve} />\n <MoreEarningsModal open={earningsOpen} onClose={() => setEarningsOpen(false)} sleeve={props.sleeve} />\n <TravelModal\n open={travelOpen}\n onClose={() => setTravelOpen(false)}\n sleeve={props.sleeve}\n rerender={props.rerender}\n />\n <SleeveAugmentationsModal\n open={augmentationsOpen}\n onClose={() => setAugmentationsOpen(false)}\n sleeve={props.sleeve}\n />\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { findSleevePurchasableAugs } from \"../SleeveHelpers\";\nimport { Augmentations } from \"../../../Augmentation/Augmentations\";\nimport { Augmentation } from \"../../../Augmentation/Augmentation\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { use } from \"../../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport { TableCell } from \"../../../ui/React/Table\";\nimport TableRow from \"@mui/material/TableRow\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function SleeveAugmentationsModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 150);\n return () => clearInterval(id);\n }, []);\n\n // Array of all owned Augmentations. Names only\n const ownedAugNames = props.sleeve.augmentations.map((e) => e.name);\n\n // You can only purchase Augmentations that are actually available from\n // your factions. I.e. you must be in a faction that has the Augmentation\n // and you must also have enough rep in that faction in order to purchase it.\n const availableAugs = findSleevePurchasableAugs(props.sleeve, player);\n\n function purchaseAugmentation(aug: Augmentation): void {\n props.sleeve.tryBuyAugmentation(player, aug);\n rerender();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n You can purchase Augmentations for your Duplicate Sleeves. These Augmentations have the same effect as they\n would for you. You can only purchase Augmentations that you have unlocked through Factions.\n <br />\n <br />\n When purchasing an Augmentation for a Duplicate Sleeve, they are immediately installed. This means that the\n Duplicate Sleeve will immediately lose all of its stat experience.\n </Typography>\n <Table size=\"small\" padding=\"none\">\n <TableBody>\n {availableAugs.map((aug) => {\n return (\n <TableRow key={aug.name}>\n <TableCell>\n <Button onClick={() => purchaseAugmentation(aug)} disabled={player.money < aug.startingCost}>\n Buy\n </Button>\n </TableCell>\n <TableCell>\n <Box display=\"flex\">\n <Tooltip title={aug.stats || \"\"}>\n <Typography>{aug.name}</Typography>\n </Tooltip>\n </Box>\n </TableCell>\n <TableCell>\n <Money money={aug.startingCost} player={player} />\n </TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n\n {ownedAugNames.length > 0 && (\n <>\n <Typography>Owned Augmentations:</Typography>\n {ownedAugNames.map((augName) => {\n const aug = Augmentations[augName];\n let tooltip = <></>;\n if (typeof aug.info === \"string\") {\n tooltip = (\n <>\n <span>{aug.info}</span>\n <br />\n <br />\n {aug.stats}\n </>\n );\n } else {\n tooltip = (\n <>\n {aug.info}\n <br />\n <br />\n {aug.stats}\n </>\n );\n }\n\n return (\n <Tooltip key={augName} title={<Typography>{tooltip}</Typography>}>\n <Paper>\n <Typography>{augName}</Typography>\n </Paper>\n </Tooltip>\n );\n })}\n </>\n )}\n </>\n </Modal>\n );\n}\n","import React from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { WorldMap } from \"../../../ui/React/WorldMap\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { use } from \"../../../ui/Context\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function TravelModal(props: IProps): React.ReactElement {\n const player = use.Player();\n function travel(city: string): void {\n if (!player.canAfford(CONSTANTS.TravelCost)) {\n dialogBoxCreate(\"You cannot afford to have this sleeve travel to another city\");\n }\n props.sleeve.city = city as CityName;\n player.loseMoney(CONSTANTS.TravelCost, \"sleeve\");\n props.sleeve.resetTaskStatus();\n props.rerender();\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Have this sleeve travel to a different city. This affects the gyms and universities at which this sleeve can\n study. Traveling to a different city costs <Money money={CONSTANTS.TravelCost} player={player} />. It will\n also set your current sleeve task to idle.\n </Typography>\n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n <Button key={city} onClick={() => travel(city)}>\n {city}\n </Button>\n ))\n ) : (\n <WorldMap currentCity={props.sleeve.city} onTravel={(city: CityName) => travel(city)} />\n )}\n </>\n </Modal>\n );\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport React from \"react\";\n\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\n\ninterface IProps {\n sleeve: Sleeve;\n}\n\nexport function StatsElement(props: IProps): React.ReactElement {\n const rows = [\n [\n \"HP: \",\n <>\n {numeralWrapper.formatHp(props.sleeve.hp)} / {numeralWrapper.formatHp(props.sleeve.max_hp)}\n </>,\n ],\n [\"City: \", <>{props.sleeve.city}</>],\n [\"Hacking: \", <>{numeralWrapper.formatSkill(props.sleeve.hacking)}</>],\n [\"Strength: \", <>{numeralWrapper.formatSkill(props.sleeve.strength)}</>],\n [\"Defense: \", <>{numeralWrapper.formatSkill(props.sleeve.defense)}</>],\n [\"Dexterity: \", <>{numeralWrapper.formatSkill(props.sleeve.dexterity)}</>],\n [\"Agility: \", <>{numeralWrapper.formatSkill(props.sleeve.agility)}</>],\n [\"Charisma: \", <>{numeralWrapper.formatSkill(props.sleeve.charisma)}</>],\n [\"Shock: \", <>{numeralWrapper.formatSleeveShock(100 - props.sleeve.shock)}</>],\n [\"Sync: \", <>{numeralWrapper.formatSleeveSynchro(props.sleeve.sync)}</>],\n [\"Memory: \", <>{numeralWrapper.formatSleeveMemory(props.sleeve.memory)}</>],\n ];\n return <StatsTable rows={rows} />;\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../../../utils/StringHelperFunctions\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Typography } from \"@mui/material\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport React from \"react\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function MoreStatsModal(props: IProps): React.ReactElement {\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <StatsTable\n rows={[\n [\n <>Hacking: </>,\n props.sleeve.hacking,\n <> ({numeralWrapper.formatExp(props.sleeve.hacking_exp)} exp)</>,\n ],\n [\n <>Strength: </>,\n props.sleeve.strength,\n <> ({numeralWrapper.formatExp(props.sleeve.strength_exp)} exp)</>,\n ],\n [\n <>Defense: </>,\n props.sleeve.defense,\n <> ({numeralWrapper.formatExp(props.sleeve.defense_exp)} exp)</>,\n ],\n [\n <>Dexterity: </>,\n props.sleeve.dexterity,\n <> ({numeralWrapper.formatExp(props.sleeve.dexterity_exp)} exp)</>,\n ],\n [\n <>Agility: </>,\n props.sleeve.agility,\n <> ({numeralWrapper.formatExp(props.sleeve.agility_exp)} exp)</>,\n ],\n [\n <>Charisma: </>,\n props.sleeve.charisma,\n <> ({numeralWrapper.formatExp(props.sleeve.charisma_exp)} exp)</>,\n ],\n ]}\n title=\"Stats:\"\n />\n <br />\n <StatsTable\n rows={[\n [<>Hacking Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.hacking_mult)],\n [<>Hacking Experience multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.hacking_exp_mult)],\n [<>Strength Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.strength_mult)],\n [<>Strength Experience multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.strength_exp_mult)],\n [<>Defense Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.defense_mult)],\n [<>Defense Experience multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.defense_exp_mult)],\n [<>Dexterity Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.dexterity_mult)],\n [\n <>Dexterity Experience multiplier: </>,\n numeralWrapper.formatPercentage(props.sleeve.dexterity_exp_mult),\n ],\n [<>Agility Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.agility_mult)],\n [<>Agility Experience multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.agility_exp_mult)],\n [<>Charisma Level multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.charisma_mult)],\n [<>Charisma Experience multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.charisma_exp_mult)],\n [\n <>Faction Reputation Gain multiplier: </>,\n numeralWrapper.formatPercentage(props.sleeve.faction_rep_mult),\n ],\n [\n <>Company Reputation Gain multiplier: </>,\n numeralWrapper.formatPercentage(props.sleeve.company_rep_mult),\n ],\n [<>Salary multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.work_money_mult)],\n [<>Crime Money multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.crime_money_mult)],\n [<>Crime Success multiplier: </>, numeralWrapper.formatPercentage(props.sleeve.crime_success_mult)],\n ]}\n title=\"Multipliers:\"\n />\n\n {/* Check for storedCycles to be a bit over 0 to prevent jittering */}\n {props.sleeve.storedCycles > 10 && (\n <Typography sx={{ py: 2 }}>\n Bonus Time: {convertTimeMsToTimeElapsedString(props.sleeve.storedCycles * CONSTANTS.MilliPerCycle)}\n </Typography>\n )}\n </Modal>\n );\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Money } from \"../../../ui/React/Money\";\nimport * as React from \"react\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\nimport { Modal } from \"../../../ui/React/Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function MoreEarningsModal(props: IProps): React.ReactElement {\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <StatsTable\n rows={[\n [\"Money \", <Money money={props.sleeve.earningsForTask.money} />],\n [\"Hacking Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.hack)],\n [\"Strength Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.str)],\n [\"Defense Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.def)],\n [\"Dexterity Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.dex)],\n [\"Agility Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.agi)],\n [\"Charisma Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.cha)],\n ]}\n title=\"Earnings for Current Task:\"\n />\n <br />\n <StatsTable\n rows={[\n [\"Money: \", <Money money={props.sleeve.earningsForPlayer.money} />],\n [\"Hacking Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.hack)],\n [\"Strength Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.str)],\n [\"Defense Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.def)],\n [\"Dexterity Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.dex)],\n [\"Agility Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.agi)],\n [\"Charisma Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.cha)],\n ]}\n title=\"Total Earnings for Host Consciousness:\"\n />\n <br />\n <StatsTable\n rows={[\n [\"Money: \", <Money money={props.sleeve.earningsForSleeves.money} />],\n [\"Hacking Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.hack)],\n [\"Strength Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.str)],\n [\"Defense Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.def)],\n [\"Dexterity Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.dex)],\n [\"Agility Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.agi)],\n [\"Charisma Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.cha)],\n ]}\n title=\"Total Earnings for Other Sleeves:\"\n />\n <br />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { IPlayer } from \"../../IPlayer\";\nimport { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport { FactionWorkType } from \"../../../Faction/FactionWorkTypeEnum\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\nconst universitySelectorOptions: string[] = [\n \"Study Computer Science\",\n \"Data Structures\",\n \"Networks\",\n \"Algorithms\",\n \"Management\",\n \"Leadership\",\n];\n\nconst gymSelectorOptions: string[] = [\"Train Strength\", \"Train Defense\", \"Train Dexterity\", \"Train Agility\"];\n\ninterface IProps {\n sleeve: Sleeve;\n player: IPlayer;\n setABC: (abc: string[]) => void;\n}\n\ninterface ITaskDetails {\n first: string[];\n second: (s1: string) => string[];\n}\n\nfunction possibleJobs(player: IPlayer, sleeve: Sleeve): string[] {\n // Array of all companies that other sleeves are working at\n const forbiddenCompanies = [];\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (otherSleeve.currentTask === SleeveTaskType.Company) {\n forbiddenCompanies.push(otherSleeve.currentTaskLocation);\n }\n }\n const allJobs: string[] = Object.keys(player.jobs);\n for (let i = 0; i < allJobs.length; ++i) {\n if (!forbiddenCompanies.includes(allJobs[i])) {\n allJobs[i];\n }\n }\n\n return allJobs;\n}\n\nfunction possibleFactions(player: IPlayer, sleeve: Sleeve): string[] {\n // Array of all factions that other sleeves are working for\n const forbiddenFactions = [\"Bladeburners\"];\n if (player.gang) {\n forbiddenFactions.push(player.gang.facName);\n }\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (otherSleeve.currentTask === SleeveTaskType.Faction) {\n forbiddenFactions.push(otherSleeve.currentTaskLocation);\n }\n }\n\n const factions = [];\n for (const fac of player.factions) {\n if (!forbiddenFactions.includes(fac)) {\n factions.push(fac);\n }\n }\n\n return factions;\n}\n\nconst tasks: {\n [key: string]: undefined | ((player: IPlayer, sleeve: Sleeve) => ITaskDetails);\n [\"------\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Work for Company\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Work for Faction\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Commit Crime\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Take University Course\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Workout at Gym\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Shock Recovery\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Synchronize\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n} = {\n \"------\": (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n \"Work for Company\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let jobs = possibleJobs(player, sleeve);\n\n if (jobs.length === 0) jobs = [\"------\"];\n return { first: jobs, second: () => [\"------\"] };\n },\n \"Work for Faction\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let factions = possibleFactions(player, sleeve);\n if (factions.length === 0) factions = [\"------\"];\n\n return {\n first: factions,\n second: (s1: string) => {\n const faction = Factions[s1];\n const facInfo = faction.getInfo();\n const options: string[] = [];\n if (facInfo.offerHackingWork) {\n options.push(\"Hacking Contracts\");\n }\n if (facInfo.offerFieldWork) {\n options.push(\"Field Work\");\n }\n if (facInfo.offerSecurityWork) {\n options.push(\"Security Work\");\n }\n return options;\n },\n };\n },\n \"Commit Crime\": (): ITaskDetails => {\n return { first: Object.values(Crimes).map((crime) => crime.name), second: () => [\"------\"] };\n },\n \"Take University Course\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let universities: string[] = [];\n switch (sleeve.city) {\n case CityName.Aevum:\n universities = [LocationName.AevumSummitUniversity];\n break;\n case CityName.Sector12:\n universities = [LocationName.Sector12RothmanUniversity];\n break;\n case CityName.Volhaven:\n universities = [LocationName.VolhavenZBInstituteOfTechnology];\n break;\n default:\n universities = [\"No university available in city!\"];\n break;\n }\n\n return { first: universitySelectorOptions, second: () => universities };\n },\n \"Workout at Gym\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let gyms: string[] = [];\n switch (sleeve.city) {\n case CityName.Aevum:\n gyms = [LocationName.AevumCrushFitnessGym, LocationName.AevumSnapFitnessGym];\n break;\n case CityName.Sector12:\n gyms = [LocationName.Sector12IronGym, LocationName.Sector12PowerhouseGym];\n break;\n case CityName.Volhaven:\n gyms = [LocationName.VolhavenMilleniumFitnessGym];\n break;\n default:\n gyms = [\"No gym available in city!\"];\n break;\n }\n\n return { first: gymSelectorOptions, second: () => gyms };\n },\n \"Shock Recovery\": (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n Synchronize: (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n};\n\nconst canDo: {\n [key: string]: undefined | ((player: IPlayer, sleeve: Sleeve) => boolean);\n [\"------\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Work for Company\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Work for Faction\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Commit Crime\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Take University Course\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Workout at Gym\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Shock Recovery\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Synchronize\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n} = {\n \"------\": () => true,\n \"Work for Company\": (player: IPlayer, sleeve: Sleeve) => possibleJobs(player, sleeve).length > 0,\n \"Work for Faction\": (player: IPlayer, sleeve: Sleeve) => possibleFactions(player, sleeve).length > 0,\n \"Commit Crime\": () => true,\n \"Take University Course\": (player: IPlayer, sleeve: Sleeve) =>\n [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),\n \"Workout at Gym\": (player: IPlayer, sleeve: Sleeve) =>\n [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),\n \"Shock Recovery\": (player: IPlayer, sleeve: Sleeve) => sleeve.shock < 100,\n Synchronize: (player: IPlayer, sleeve: Sleeve) => sleeve.sync < 100,\n};\n\nfunction getABC(sleeve: Sleeve): [string, string, string] {\n switch (sleeve.currentTask) {\n case SleeveTaskType.Idle:\n return [\"------\", \"------\", \"------\"];\n case SleeveTaskType.Company:\n return [\"Work for Company\", sleeve.currentTaskLocation, \"------\"];\n case SleeveTaskType.Faction: {\n let workType = \"\";\n switch (sleeve.factionWorkType) {\n case FactionWorkType.Hacking:\n workType = \"Hacking Contracts\";\n break;\n case FactionWorkType.Field:\n workType = \"Field Work\";\n break;\n case FactionWorkType.Security:\n workType = \"Security Work\";\n break;\n }\n return [\"Work for Faction\", sleeve.currentTaskLocation, workType];\n }\n case SleeveTaskType.Crime:\n return [\"Commit Crime\", sleeve.crimeType, \"------\"];\n case SleeveTaskType.Class:\n return [\"Take University Course\", sleeve.className, sleeve.currentTaskLocation];\n case SleeveTaskType.Gym:\n return [\"Workout at Gym\", sleeve.gymStatType, sleeve.currentTaskLocation];\n case SleeveTaskType.Recovery:\n return [\"Shock Recovery\", \"------\", \"------\"];\n case SleeveTaskType.Synchro:\n return [\"Synchronize\", \"------\", \"------\"];\n }\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const abc = getABC(props.sleeve);\n const [s0, setS0] = useState(abc[0]);\n const [s1, setS1] = useState(abc[1]);\n const [s2, setS2] = useState(abc[2]);\n\n const validActions = Object.keys(canDo).filter((k) =>\n (canDo[k] as (player: IPlayer, sleeve: Sleeve) => boolean)(props.player, props.sleeve),\n );\n\n const detailsF = tasks[s0];\n if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);\n const details = detailsF(props.player, props.sleeve);\n const details2 = details.second(s1);\n\n if (details.first.length > 0 && !details.first.includes(s1)) {\n setS1(details.first[0]);\n props.setABC([s0, details.first[0], s2]);\n }\n if (details2.length > 0 && !details2.includes(s2)) {\n setS2(details2[0]);\n props.setABC([s0, s1, details2[0]]);\n }\n\n function onS0Change(event: SelectChangeEvent<string>): void {\n const n = event.target.value;\n const detailsF = tasks[n];\n if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);\n const details = detailsF(props.player, props.sleeve);\n const details2 = details.second(details.first[0]);\n setS2(details2[0]);\n setS1(details.first[0]);\n setS0(n);\n props.setABC([n, details.first[0], details2[0]]);\n }\n\n function onS1Change(event: SelectChangeEvent<string>): void {\n setS1(event.target.value);\n props.setABC([s0, event.target.value, s2]);\n }\n\n function onS2Change(event: SelectChangeEvent<string>): void {\n setS2(event.target.value);\n props.setABC([s0, s1, event.target.value]);\n }\n\n return (\n <>\n <Select onChange={onS0Change} value={s0}>\n {validActions.map((task) => (\n <MenuItem key={task} value={task}>\n {task}\n </MenuItem>\n ))}\n </Select>\n {!(details.first.length === 1 && details.first[0] === \"------\") && (\n <>\n <br />\n <Select onChange={onS1Change} value={s1}>\n {details.first.map((detail) => (\n <MenuItem key={detail} value={detail}>\n {detail}\n </MenuItem>\n ))}\n </Select>\n </>\n )}\n {!(details2.length === 1 && details2[0] === \"------\") && (\n <>\n <br />\n <Select onChange={onS2Change} value={s2}>\n {details2.map((detail) => (\n <MenuItem key={detail} value={detail}>\n {detail}\n </MenuItem>\n ))}\n </Select>\n </>\n )}\n </>\n );\n}\n","import React from \"react\";\n\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function FAQModal({ open, onClose }: IProps): React.ReactElement {\n return (\n <Modal open={open} onClose={onClose}>\n <>\n <Typography variant=\"h4\">How do Duplicate Sleeves work?</Typography>\n <br />\n <Typography>\n Duplicate Sleeves are essentially clones. You can use them to perform any work type action, such as working\n for a company/faction or committing a crime. Having sleeves perform these tasks earns you money, experience,\n and reputation.\n </Typography>\n <br />\n <br />\n <Typography>\n Sleeves are their own individuals, which means they each have their own experience and stats.\n </Typography>\n <br />\n <br />\n <Typography>\n When a sleeve earns experience, it earns experience for itself, the player's original 'consciousness', as well\n as all of the player's other sleeves.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">What is Synchronization (Sync)?</Typography>\n <br />\n <Typography>\n Synchronization is a measure of how aligned your consciousness is with that of your Duplicate Sleeves. It is a\n numerical value between 1 and 100, and it affects how much experience is earned when the sleeve is performing\n a task.\n </Typography>\n <br />\n <br />\n <Typography>\n Let N be the sleeve's synchronization. When the sleeve earns experience by performing a task, both the sleeve\n and the player's original host consciousness earn N% of the amount of experience normally earned by the task.\n All of the player's other sleeves earn ((N/100)^2 * 100)% of the experience.\n </Typography>\n <br />\n <br />\n <Typography>Synchronization can be increased by assigning sleeves to the 'Synchronize' task.</Typography>\n <br />\n <br />\n <Typography variant=\"h4\">What is Shock?</Typography>\n <br />\n <Typography>\n Sleeve shock is a measure of how much trauma the sleeve has due to being placed in a new body. It is a\n numerical value between 0 and 99, where 99 indicates full shock and 0 indicates no shock. Shock affects the\n amount of experience earned by the sleeve.\n </Typography>\n <br />\n <br />\n <Typography>\n Sleeve shock slowly decreases over time. You can further increase the rate at which it decreases by assigning\n sleeves to the 'Shock Recovery' task.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Why can't I work for this company or faction?</Typography>\n <br />\n <Typography>\n Only one of your sleeves can work for a given company/faction a time. To clarify further, if you have two\n sleeves they can work for two different companies, but they cannot both work for the same company.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Why did my Sleeve stop working?</Typography>\n <br />\n <Typography>\n Sleeves are subject to the same time restrictions as you. This means that they automatically stop working at a\n company after 8 hours, and stop working for a faction after 20 hours.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">How do I buy Augmentations for my Sleeves?</Typography>\n <br />\n <Typography>Your Sleeve needs to have a Shock of 0 in order for you to buy Augmentations for it.</Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Why can't I buy the X Augmentation for my sleeve?</Typography>\n <br />\n <Typography>\n Certain Augmentations, like Bladeburner-specific ones and NeuroFlux Governor, are not available for sleeves.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Do sleeves get reset when installing Augmentations or switching BitNodes?</Typography>\n <br />\n <Typography>Sleeves are reset when switching BitNodes, but not when installing Augmentations.</Typography>\n <br />\n <br />\n <Typography variant=\"h4\">What is Memory?</Typography>\n <br />\n <Typography>\n Sleeve memory dictates what a sleeve's synchronization will be when its reset by switching BitNodes. For\n example, if a sleeve has a memory of 25, then when you switch BitNodes its synchronization will initially be\n set to 25, rather than 1.\n </Typography>\n <br />\n <br />\n <Typography>\n Memory can only be increased by purchasing upgrades from The Covenant. It is a persistent stat, meaning it\n never gets resets back to 1. The maximum possible value for a sleeve's memory is 100.\n </Typography>\n </>\n </Modal>\n );\n}\n","/**\n * Root React Component for the Hacknet Node UI\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { GeneralInfo } from \"./GeneralInfo\";\nimport { HacknetNodeElem } from \"./HacknetNodeElem\";\nimport { HacknetServerElem } from \"./HacknetServerElem\";\nimport { HacknetNode } from \"../HacknetNode\";\nimport { HacknetServer } from \"../HacknetServer\";\nimport { HashUpgradeModal } from \"./HashUpgradeModal\";\nimport { MultiplierButtons } from \"./MultiplierButtons\";\nimport { PlayerInfo } from \"./PlayerInfo\";\nimport { PurchaseButton } from \"./PurchaseButton\";\nimport { PurchaseMultipliers } from \"../data/Constants\";\n\nimport {\n getCostOfNextHacknetNode,\n getCostOfNextHacknetServer,\n hasHacknetServers,\n purchaseHacknet,\n} from \"../HacknetHelpers\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport { Box } from \"@mui/material\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function HacknetRoot(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const [purchaseMultiplier, setPurchaseMultiplier] = useState<number | \"MAX\">(PurchaseMultipliers.x1);\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n let totalProduction = 0;\n for (let i = 0; i < props.player.hacknetNodes.length; ++i) {\n const node = props.player.hacknetNodes[i];\n if (hasHacknetServers(props.player)) {\n if (node instanceof HacknetNode) throw new Error(\"node was hacknet node\"); // should never happen\n const hserver = GetServer(node);\n if (!(hserver instanceof HacknetServer)) throw new Error(\"node was not hacknet server\"); // should never happen\n if (hserver) {\n totalProduction += hserver.hashRate;\n } else {\n console.warn(`Could not find Hacknet Server object in AllServers map (i=${i})`);\n }\n } else {\n if (typeof node === \"string\") throw new Error(\"node was ip string\"); // should never happen\n totalProduction += node.moneyGainRatePerSecond;\n }\n }\n\n function handlePurchaseButtonClick(): void {\n purchaseHacknet(props.player);\n rerender();\n }\n\n // Cost to purchase a new Hacknet Node\n let purchaseCost;\n if (hasHacknetServers(props.player)) {\n purchaseCost = getCostOfNextHacknetServer(props.player);\n } else {\n purchaseCost = getCostOfNextHacknetNode(props.player);\n }\n\n // onClick event handlers for purchase multiplier buttons\n const purchaseMultiplierOnClicks = [\n () => setPurchaseMultiplier(PurchaseMultipliers.x1),\n () => setPurchaseMultiplier(PurchaseMultipliers.x5),\n () => setPurchaseMultiplier(PurchaseMultipliers.x10),\n () => setPurchaseMultiplier(PurchaseMultipliers.MAX),\n ];\n\n // HacknetNode components\n const nodes = props.player.hacknetNodes.map((node: string | HacknetNode) => {\n if (hasHacknetServers(props.player)) {\n if (node instanceof HacknetNode) throw new Error(\"node was hacknet node\"); // should never happen\n const hserver = GetServer(node);\n if (hserver == null) {\n throw new Error(`Could not find Hacknet Server object in AllServers map for IP: ${node}`);\n }\n if (!(hserver instanceof HacknetServer)) throw new Error(\"node was not hacknet server\"); // should never happen\n return (\n <HacknetServerElem\n player={props.player}\n key={hserver.hostname}\n node={hserver}\n purchaseMultiplier={purchaseMultiplier}\n rerender={rerender}\n />\n );\n } else {\n if (typeof node === \"string\") throw new Error(\"node was ip string\"); // should never happen\n return (\n <HacknetNodeElem\n player={props.player}\n key={node.name}\n node={node}\n purchaseMultiplier={purchaseMultiplier}\n rerender={rerender}\n />\n );\n }\n });\n\n return (\n <>\n <Typography variant=\"h4\">Hacknet {hasHacknetServers(props.player) ? \"Servers\" : \"Nodes\"}</Typography>\n <GeneralInfo hasHacknetServers={hasHacknetServers(props.player)} />\n\n <PurchaseButton cost={purchaseCost} multiplier={purchaseMultiplier} onClick={handlePurchaseButtonClick} />\n\n <br />\n\n <Grid container spacing={2}>\n <Grid item xs={6}>\n <PlayerInfo totalProduction={totalProduction} player={props.player} />\n </Grid>\n <Grid item xs={6}>\n <MultiplierButtons onClicks={purchaseMultiplierOnClicks} purchaseMultiplier={purchaseMultiplier} />\n </Grid>\n </Grid>\n\n {hasHacknetServers(props.player) && <Button onClick={() => setOpen(true)}>Spend Hashes on Upgrades</Button>}\n\n <Box sx={{ display: 'grid', width: 'fit-content', gridTemplateColumns: 'repeat(3, 1fr)' }}>{nodes}</Box>\n <HashUpgradeModal open={open} onClose={() => setOpen(false)} />\n </>\n );\n}\n","/**\n * React Component for the Hacknet Node UI\n *\n * Displays general information about Hacknet Nodes\n */\nimport React from \"react\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n hasHacknetServers: boolean;\n}\n\nexport function GeneralInfo(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n The Hacknet is a global, decentralized network of machines. It is used by hackers all around the world to\n anonymously share computing power and perform distributed cyberattacks without the fear of being traced.\n </Typography>\n {!props.hasHacknetServers ? (\n <>\n <Typography>\n {`Here, you can purchase a Hacknet Node, a specialized machine that can connect ` +\n `and contribute its resources to the Hacknet network. This allows you to take ` +\n `a small percentage of profits from hacks performed on the network. Essentially, ` +\n `you are renting out your Node's computing power.`}\n </Typography>\n <Typography>\n {`Each Hacknet Node you purchase will passively earn you money. Each Hacknet Node ` +\n `can be upgraded in order to increase its computing power and thereby increase ` +\n `the profit you earn from it.`}\n </Typography>\n </>\n ) : (\n <>\n <Typography>\n {`Here, you can purchase a Hacknet Server, an upgraded version of the Hacknet Node. ` +\n `Hacknet Servers will perform computations and operations on the network, earning ` +\n `you hashes. Hashes can be spent on a variety of different upgrades.`}\n </Typography>\n <Typography>\n {`Hacknet Servers can also be used as servers to run scripts. However, running scripts ` +\n `on a server will reduce its hash rate (hashes generated per second). A Hacknet Server's hash ` +\n `rate will be reduced by the percentage of RAM that is being used by that Server to run ` +\n `scripts.`}\n </Typography>\n </>\n )}\n </>\n );\n}\n","/**\n * React Component for the Hacknet Node UI.\n * This Component displays the panel for a single Hacknet Node\n */\nimport React from \"react\";\n\nimport { HacknetNodeConstants } from \"../data/Constants\";\nimport {\n getMaxNumberLevelUpgrades,\n getMaxNumberRamUpgrades,\n getMaxNumberCoreUpgrades,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n} from \"../HacknetHelpers\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { HacknetNode } from \"../HacknetNode\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { calculateMoneyGainRate } from \"../formulas/HacknetNodes\";\n\ninterface IProps {\n node: HacknetNode;\n purchaseMultiplier: number | \"MAX\";\n rerender: () => void;\n player: IPlayer;\n}\n\nexport function HacknetNodeElem(props: IProps): React.ReactElement {\n const node = props.node;\n const purchaseMult = props.purchaseMultiplier;\n const rerender = props.rerender;\n\n // Upgrade Level Button\n let upgradeLevelButton;\n if (node.level >= HacknetNodeConstants.MaxLevel) {\n upgradeLevelButton = <Button disabled>MAX LEVEL</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberLevelUpgrades(props.player, node, HacknetNodeConstants.MaxLevel);\n } else {\n const levelsToMax = HacknetNodeConstants.MaxLevel - node.level;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const increase =\n calculateMoneyGainRate(node.level + multiplier, node.ram, node.cores, props.player.hacknet_node_money_mult) -\n node.moneyGainRatePerSecond;\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.hacknet_node_level_cost_mult);\n upgradeLevelButton = (\n <Tooltip\n title={\n <Typography>\n +<MoneyRate money={increase} />\n </Typography>\n }\n >\n <Button onClick={upgradeLevelOnClick}>\n +{multiplier} - \n <Money money={upgradeLevelCost} player={props.player} />\n </Button>\n </Tooltip>\n );\n }\n function upgradeLevelOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\"\n ? getMaxNumberLevelUpgrades(props.player, node, HacknetNodeConstants.MaxLevel)\n : purchaseMult;\n purchaseLevelUpgrade(props.player, node, numUpgrades);\n rerender();\n }\n\n let upgradeRAMButton;\n if (node.ram >= HacknetNodeConstants.MaxRam) {\n upgradeRAMButton = <Button disabled>MAX RAM</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberRamUpgrades(props.player, node, HacknetNodeConstants.MaxRam);\n } else {\n const levelsToMax = Math.round(Math.log2(HacknetNodeConstants.MaxRam / node.ram));\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const increase =\n calculateMoneyGainRate(\n node.level,\n node.ram * Math.pow(2, multiplier),\n node.cores,\n props.player.hacknet_node_money_mult,\n ) - node.moneyGainRatePerSecond;\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.hacknet_node_ram_cost_mult);\n upgradeRAMButton = (\n <Tooltip\n title={\n <Typography>\n +<MoneyRate money={increase} />\n </Typography>\n }\n >\n <Button onClick={upgradeRamOnClick}>\n +{multiplier} - \n <Money money={upgradeRamCost} player={props.player} />\n </Button>\n </Tooltip>\n );\n }\n function upgradeRamOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\" ? getMaxNumberRamUpgrades(props.player, node, HacknetNodeConstants.MaxRam) : purchaseMult;\n purchaseRamUpgrade(props.player, node, numUpgrades);\n rerender();\n }\n\n function upgradeCoresOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\"\n ? getMaxNumberCoreUpgrades(props.player, node, HacknetNodeConstants.MaxCores)\n : purchaseMult;\n purchaseCoreUpgrade(props.player, node, numUpgrades);\n rerender();\n }\n let upgradeCoresButton;\n if (node.cores >= HacknetNodeConstants.MaxCores) {\n upgradeCoresButton = <Button disabled>MAX CORES</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCoreUpgrades(props.player, node, HacknetNodeConstants.MaxCores);\n } else {\n const levelsToMax = HacknetNodeConstants.MaxCores - node.cores;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const increase =\n calculateMoneyGainRate(node.level, node.ram, node.cores + multiplier, props.player.hacknet_node_money_mult) -\n node.moneyGainRatePerSecond;\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.hacknet_node_core_cost_mult);\n upgradeCoresButton = (\n <Tooltip\n title={\n <Typography>\n +<MoneyRate money={increase} />\n </Typography>\n }\n >\n <Button onClick={upgradeCoresOnClick}>\n +{multiplier} - \n <Money money={upgradeCoreCost} player={props.player} />\n </Button>\n </Tooltip>\n );\n }\n\n return (\n <Grid item component={Paper} p={1}>\n <Table size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell>\n <Typography>{node.name}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Production:</Typography>\n </TableCell>\n <TableCell colSpan={2}>\n <Typography>\n <Money money={node.totalMoneyGenerated} /> (\n <MoneyRate money={node.moneyGainRatePerSecond} />)\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Level:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.level}</Typography>\n </TableCell>\n <TableCell>{upgradeLevelButton}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>RAM:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{numeralWrapper.formatRAM(node.ram)}</Typography>\n </TableCell>\n <TableCell>{upgradeRAMButton}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Cores:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.cores}</Typography>\n </TableCell>\n <TableCell>{upgradeCoresButton}</TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </Grid>\n );\n}\n","/**\n * React Component for the Hacknet Node UI.\n * This Component displays the panel for a single Hacknet Node\n */\nimport React from \"react\";\n\nimport { HacknetServerConstants } from \"../data/Constants\";\nimport {\n getMaxNumberLevelUpgrades,\n getMaxNumberRamUpgrades,\n getMaxNumberCoreUpgrades,\n getMaxNumberCacheUpgrades,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n purchaseCacheUpgrade,\n updateHashManagerCapacity,\n} from \"../HacknetHelpers\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { HacknetServer } from \"../HacknetServer\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport { HashRate } from \"../../ui/React/HashRate\";\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport TableRow from \"@mui/material/TableRow\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { calculateHashGainRate } from \"../formulas/HacknetServers\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IProps {\n node: HacknetServer;\n purchaseMultiplier: number | string;\n rerender: () => void;\n player: IPlayer;\n}\n\nexport function HacknetServerElem(props: IProps): React.ReactElement {\n const node = props.node;\n const purchaseMult = props.purchaseMultiplier;\n const rerender = props.rerender;\n\n // Upgrade Level Button\n let upgradeLevelButton;\n if (node.level >= HacknetServerConstants.MaxLevel) {\n upgradeLevelButton = <Button disabled>MAX LEVEL</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberLevelUpgrades(props.player, node, HacknetServerConstants.MaxLevel);\n } else {\n const levelsToMax = HacknetServerConstants.MaxLevel - node.level;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const increase =\n calculateHashGainRate(node.level + multiplier, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult) -\n node.hashRate;\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.hacknet_node_level_cost_mult);\n upgradeLevelButton = (\n <Tooltip\n title={\n <Typography>\n +<HashRate hashes={increase} />\n </Typography>\n }\n >\n <Button onClick={upgradeLevelOnClick}>\n +{multiplier} - \n <Money money={upgradeLevelCost} player={props.player} />\n </Button>\n </Tooltip>\n );\n }\n function upgradeLevelOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberLevelUpgrades(props.player, node, HacknetServerConstants.MaxLevel);\n }\n purchaseLevelUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n\n function upgradeRamOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberRamUpgrades(props.player, node, HacknetServerConstants.MaxRam);\n }\n purchaseRamUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n // Upgrade RAM Button\n let upgradeRamButton;\n if (node.maxRam >= HacknetServerConstants.MaxRam) {\n upgradeRamButton = <Button disabled>MAX RAM</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberRamUpgrades(props.player, node, HacknetServerConstants.MaxRam);\n } else {\n const levelsToMax = Math.round(Math.log2(HacknetServerConstants.MaxRam / node.maxRam));\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const increase =\n calculateHashGainRate(\n node.level,\n 0,\n node.maxRam * Math.pow(2, multiplier),\n node.cores,\n props.player.hacknet_node_money_mult,\n ) - node.hashRate;\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.hacknet_node_ram_cost_mult);\n upgradeRamButton = (\n <Tooltip\n title={\n <Typography>\n +<HashRate hashes={increase} />\n </Typography>\n }\n >\n <Button onClick={upgradeRamOnClick}>\n +{multiplier} - \n <Money money={upgradeRamCost} player={props.player} />\n </Button>\n </Tooltip>\n );\n }\n\n function upgradeCoresOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberCoreUpgrades(props.player, node, HacknetServerConstants.MaxCores);\n }\n purchaseCoreUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n // Upgrade Cores Button\n let upgradeCoresButton;\n if (node.cores >= HacknetServerConstants.MaxCores) {\n upgradeCoresButton = <Button disabled>MAX CORES</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCoreUpgrades(props.player, node, HacknetServerConstants.MaxCores);\n } else {\n const levelsToMax = HacknetServerConstants.MaxCores - node.cores;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const increase =\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores + multiplier, props.player.hacknet_node_money_mult) -\n node.hashRate;\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.hacknet_node_core_cost_mult);\n upgradeCoresButton = (\n <Tooltip\n title={\n <Typography>\n +<HashRate hashes={increase} />\n </Typography>\n }\n >\n <Button onClick={upgradeCoresOnClick}>\n +{multiplier} - \n <Money money={upgradeCoreCost} player={props.player} />\n </Button>\n </Tooltip>\n );\n }\n\n // Upgrade Cache button\n let upgradeCacheButton;\n if (node.cache >= HacknetServerConstants.MaxCache) {\n upgradeCacheButton = <Button disabled>MAX CACHE</Button>;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCacheUpgrades(props.player, node, HacknetServerConstants.MaxCache);\n } else {\n const levelsToMax = HacknetServerConstants.MaxCache - node.cache;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const increase = 32 * Math.pow(2, node.cache + multiplier) - node.hashCapacity;\n const upgradeCacheCost = node.calculateCacheUpgradeCost(multiplier);\n upgradeCacheButton = (\n <Tooltip\n title={\n <Typography>\n +<Hashes hashes={increase} /> hashes\n </Typography>\n }\n >\n <Button onClick={upgradeCacheOnClick}>\n +{multiplier} - \n <Money money={upgradeCacheCost} player={props.player} />\n </Button>\n </Tooltip>\n );\n if (props.player.money < upgradeCacheCost) {\n } else {\n }\n }\n function upgradeCacheOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberCacheUpgrades(props.player, node, HacknetServerConstants.MaxCache);\n }\n purchaseCacheUpgrade(props.player, node, numUpgrades as number);\n rerender();\n updateHashManagerCapacity(props.player);\n }\n\n return (\n <Grid item component={Paper} p={1}>\n <Table size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell>\n <Typography>{node.hostname}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Production:</Typography>\n </TableCell>\n <TableCell colSpan={2}>\n <Typography>\n <Hashes hashes={node.totalHashesGenerated} /> (<HashRate hashes={node.hashRate} />)\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Hash Capacity:</Typography>\n </TableCell>\n <TableCell colSpan={2}>\n <Typography>\n <Hashes hashes={node.hashCapacity} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Level:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.level}</Typography>\n </TableCell>\n <TableCell>{upgradeLevelButton}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>RAM:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{numeralWrapper.formatRAM(node.maxRam)}</Typography>\n </TableCell>\n <TableCell>{upgradeRamButton}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Cores:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.cores}</Typography>\n </TableCell>\n <TableCell>{upgradeCoresButton}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Cache Level:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.cache}</Typography>\n </TableCell>\n <TableCell>{upgradeCacheButton}</TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </Grid>\n );\n}\n","/**\n * Create the pop-up for purchasing upgrades with hashes\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { HashManager } from \"../HashManager\";\nimport { HashUpgrades } from \"../HashUpgrades\";\n\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport { HacknetUpgradeElem } from \"./HacknetUpgradeElem\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function HashUpgradeModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 200);\n return () => clearInterval(id);\n }, []);\n\n const hashManager = player.hashManager;\n if (!(hashManager instanceof HashManager)) {\n throw new Error(`Player does not have a HashManager)`);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>Spend your hashes on a variety of different upgrades</Typography>\n <Typography>\n Hashes: <Hashes hashes={player.hashManager.hashes} />\n </Typography>\n {Object.keys(HashUpgrades).map((upgName) => {\n const upg = HashUpgrades[upgName];\n return (\n <HacknetUpgradeElem\n player={player}\n upg={upg}\n hashManager={hashManager}\n key={upg.name}\n rerender={rerender}\n />\n );\n })}\n </>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { purchaseHashUpgrade } from \"../HacknetHelpers\";\nimport { HashManager } from \"../HashManager\";\nimport { HashUpgrade } from \"../HashUpgrade\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { ServerDropdown, ServerType } from \"../../ui/React/ServerDropdown\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { Hashes } from \"../../ui/React/Hashes\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n player: IPlayer;\n hashManager: HashManager;\n upg: HashUpgrade;\n rerender: () => void;\n}\n\nconst serversMap: { [key: string]: string } = {};\n\nexport function HacknetUpgradeElem(props: IProps): React.ReactElement {\n const [selectedServer, setSelectedServer] = useState(\n serversMap[props.upg.name] ? serversMap[props.upg.name] : \"ecorp\",\n );\n function changeTargetServer(event: SelectChangeEvent<string>): void {\n setSelectedServer(event.target.value);\n serversMap[props.upg.name] = event.target.value;\n }\n\n function purchase(): void {\n const canPurchase = props.hashManager.hashes >= props.hashManager.getUpgradeCost(props.upg.name);\n if (canPurchase) {\n const res = purchaseHashUpgrade(props.player, props.upg.name, selectedServer);\n if (!res) {\n dialogBoxCreate(\n \"Failed to purchase upgrade. This may be because you do not have enough hashes, \" +\n \"or because you do not have access to the feature upgrade affects.\",\n );\n }\n props.rerender();\n }\n }\n\n const hashManager = props.hashManager;\n const upg = props.upg;\n const cost = hashManager.getUpgradeCost(upg.name);\n const level = hashManager.upgrades[upg.name];\n const effect = upg.effectText(level);\n\n // Purchase button\n const canPurchase = hashManager.hashes >= cost;\n\n // We'll reuse a Bladeburner css class\n return (\n <Paper sx={{ p: 1 }}>\n <Typography>\n <CopyableText value={upg.name} />\n </Typography>\n <Typography>\n Cost: <Hashes hashes={cost} />, Bought: {level} times\n </Typography>\n\n <Typography>{upg.desc}</Typography>\n {!upg.hasTargetServer && (\n <Button onClick={purchase} disabled={!canPurchase}>\n Buy\n </Button>\n )}\n {upg.hasTargetServer && (\n <ServerDropdown\n purchase={purchase}\n canPurchase={canPurchase}\n value={selectedServer}\n serverType={ServerType.Foreign}\n onChange={changeTargetServer}\n />\n )}\n {level > 0 && effect && <Typography>{effect}</Typography>}\n </Paper>\n );\n}\n","/**\n * React Component for the Multiplier buttons on the Hacknet page.\n * These buttons let the player control how many Nodes/Upgrades they're\n * purchasing when using the UI (x1, x5, x10, MAX)\n */\nimport React from \"react\";\n\nimport { PurchaseMultipliers } from \"../data/Constants\";\nimport Button from \"@mui/material/Button\";\n\ninterface IMultiplierProps {\n disabled: boolean;\n onClick: () => void;\n text: string;\n}\n\nfunction MultiplierButton(props: IMultiplierProps): React.ReactElement {\n return (\n <Button disabled={props.disabled} onClick={props.onClick}>\n {props.text}\n </Button>\n );\n}\n\ninterface IProps {\n purchaseMultiplier: number | string;\n onClicks: (() => void)[];\n}\n\nexport function MultiplierButtons(props: IProps): React.ReactElement {\n if (props.purchaseMultiplier == null) {\n throw new Error(`MultiplierButtons constructed without required props`);\n }\n\n const mults = [\"x1\", \"x5\", \"x10\", \"MAX\"];\n const onClicks = props.onClicks;\n const buttons = [];\n for (let i = 0; i < mults.length; ++i) {\n const mult = mults[i];\n const btnProps = {\n disabled: props.purchaseMultiplier === PurchaseMultipliers[mult],\n onClick: onClicks[i],\n text: mult,\n };\n\n buttons.push(<MultiplierButton key={mult} {...btnProps} />);\n }\n\n return <>{buttons}</>;\n}\n","/**\n * React Component for displaying Player info and stats on the Hacknet Node UI.\n * This includes:\n * - Player's money\n * - Player's production from Hacknet Nodes\n */\nimport React from \"react\";\n\nimport { hasHacknetServers } from \"../HacknetHelpers\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { HashRate } from \"../../ui/React/HashRate\";\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n totalProduction: number;\n player: IPlayer;\n}\n\nexport function PlayerInfo(props: IProps): React.ReactElement {\n const hasServers = hasHacknetServers(props.player);\n\n let prod;\n if (hasServers) {\n prod = <HashRate hashes={props.totalProduction} />;\n } else {\n prod = <MoneyRate money={props.totalProduction} />;\n }\n\n return (\n <>\n <Typography>\n Money:\n <Money money={props.player.money} />\n </Typography>\n\n {hasServers && (\n <>\n <Typography>\n Hashes: <Hashes hashes={props.player.hashManager.hashes} /> /{\" \"}\n <Hashes hashes={props.player.hashManager.capacity} />\n </Typography>\n </>\n )}\n\n <Typography>\n Total Hacknet {hasServers ? \"Server\" : \"Node\"} Production: {prod}\n </Typography>\n </>\n );\n}\n","/**\n * React Component for the button that is used to purchase new Hacknet Nodes\n */\nimport React from \"react\";\n\nimport { hasHacknetServers, hasMaxNumberHacknetServers } from \"../HacknetHelpers\";\nimport { Player } from \"../../Player\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n multiplier: number | string;\n onClick: () => void;\n cost: number;\n}\n\nexport function PurchaseButton(props: IProps): React.ReactElement {\n const cost = props.cost;\n let text;\n if (hasHacknetServers(Player)) {\n if (hasMaxNumberHacknetServers(Player)) {\n text = <>Hacknet Server limit reached</>;\n } else {\n text = (\n <>\n Purchase Hacknet Server - \n <Money money={cost} player={Player} />\n </>\n );\n }\n } else {\n text = (\n <>\n Purchase Hacknet Node - \n <Money money={cost} player={Player} />\n </>\n );\n }\n\n return (\n <Button disabled={!Player.canAfford(cost)} onClick={props.onClick}>\n {text}\n </Button>\n );\n}\n","/**\n * React Component for displaying a location's UI\n *\n * This is a \"router\" component of sorts, meaning it deduces the type of\n * location that is being rendered and then creates the proper component(s) for that.\n */\nimport * as React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { CompanyLocation } from \"./CompanyLocation\";\nimport { GymLocation } from \"./GymLocation\";\nimport { HospitalLocation } from \"./HospitalLocation\";\nimport { SlumsLocation } from \"./SlumsLocation\";\nimport { SpecialLocation } from \"./SpecialLocation\";\nimport { TechVendorLocation } from \"./TechVendorLocation\";\nimport { TravelAgencyRoot } from \"./TravelAgencyRoot\";\nimport { UniversityLocation } from \"./UniversityLocation\";\nimport { CasinoLocation } from \"./CasinoLocation\";\n\nimport { Location } from \"../Location\";\nimport { LocationType } from \"../LocationTypeEnum\";\n\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { isBackdoorInstalled } from \"../../Server/ServerHelpers\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\nimport { use } from \"../../ui/Context\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { Tooltip } from \"@mui/material\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function GenericLocation({ loc }: IProps): React.ReactElement {\n const router = use.Router();\n const player = use.Player();\n /**\n * Determine what needs to be rendered for this location based on the locations\n * type. Returns an array of React components that should be rendered\n */\n function getLocationSpecificContent(): React.ReactNode[] {\n const content: React.ReactNode[] = [];\n\n if (loc.types.includes(LocationType.Company)) {\n content.push(<CompanyLocation key={\"companylocation\"} locName={loc.name} />);\n }\n\n if (loc.types.includes(LocationType.Gym)) {\n content.push(<GymLocation key={\"gymlocation\"} router={router} loc={loc} p={player} />);\n }\n\n if (loc.types.includes(LocationType.Hospital)) {\n content.push(<HospitalLocation key={\"hospitallocation\"} p={player} />);\n }\n\n if (loc.types.includes(LocationType.Slums)) {\n content.push(<SlumsLocation key={\"slumslocation\"} />);\n }\n\n if (loc.types.includes(LocationType.Special)) {\n content.push(<SpecialLocation key={\"speciallocation\"} loc={loc} />);\n }\n\n if (loc.types.includes(LocationType.TechVendor)) {\n content.push(<TechVendorLocation key={\"techvendorlocation\"} loc={loc} />);\n }\n\n if (loc.types.includes(LocationType.TravelAgency)) {\n content.push(<TravelAgencyRoot key={\"travelagencylocation\"} p={player} router={router} />);\n }\n\n if (loc.types.includes(LocationType.University)) {\n content.push(<UniversityLocation key={\"universitylocation\"} loc={loc} />);\n }\n\n if (loc.types.includes(LocationType.Casino)) {\n content.push(<CasinoLocation key={\"casinoLocation\"} p={player} />);\n }\n\n return content;\n }\n\n const locContent: React.ReactNode[] = getLocationSpecificContent();\n const serverMeta = serverMetadata.find((s) => s.specialName === loc.name);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n\n const backdoorInstalled = server !== null && isBackdoorInstalled(server);\n\n return (\n <>\n <Button onClick={() => router.toCity()}>Return to World</Button>\n <Typography variant=\"h4\" sx={{ mt: 1 }}>\n {backdoorInstalled && !Settings.DisableTextEffects ? (\n <Tooltip title={`Backdoor installed on ${loc.name}.`}>\n <span><CorruptableText content={loc.name} /></span>\n </Tooltip>) : loc.name}\n </Typography>\n {locContent}\n </>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a company\n *\n * This subcomponent renders all of the buttons for applying to jobs at a company\n */\nimport React, { useState, useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\nimport { ApplyToJobButton } from \"./ApplyToJobButton\";\n\nimport { Locations } from \"../Locations\";\nimport { LocationName } from \"../data/LocationNames\";\n\nimport { Companies } from \"../../Company/Companies\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport * as posNames from \"../../Company/data/companypositionnames\";\n\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { use } from \"../../ui/Context\";\nimport { QuitJobModal } from \"../../Company/ui/QuitJobModal\";\n\ntype IProps = {\n locName: LocationName;\n};\n\nexport function CompanyLocation(props: IProps): React.ReactElement {\n const p = use.Player();\n const router = use.Router();\n const [quitOpen, setQuitOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n /**\n * We'll keep a reference to the Company that this component is being rendered for,\n * so we don't have to look it up every time\n */\n const company = Companies[props.locName];\n if (company == null) throw new Error(`CompanyLocation component constructed with invalid company: ${props.locName}`);\n\n /**\n * Reference to the Location that this component is being rendered for\n */\n const location = Locations[props.locName];\n if (location == null) {\n throw new Error(`CompanyLocation component constructed with invalid location: ${props.locName}`);\n }\n\n /**\n * Name of company position that player holds, if applicable\n */\n const jobTitle = p.jobs[props.locName] ? p.jobs[props.locName] : null;\n\n /**\n * CompanyPosition object for the job that the player holds at this company\n * (if he has one)\n */\n const companyPosition = jobTitle ? CompanyPositions[jobTitle] : null;\n\n p.location = props.locName;\n\n function applyForAgentJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForAgentJob();\n rerender();\n }\n\n function applyForBusinessConsultantJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForBusinessConsultantJob();\n rerender();\n }\n\n function applyForBusinessJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForBusinessJob();\n rerender();\n }\n\n function applyForEmployeeJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForEmployeeJob();\n rerender();\n }\n\n function applyForItJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForItJob();\n rerender();\n }\n\n function applyForPartTimeEmployeeJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForPartTimeEmployeeJob();\n rerender();\n }\n\n function applyForPartTimeWaiterJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForPartTimeWaiterJob();\n rerender();\n }\n\n function applyForSecurityJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForSecurityJob();\n rerender();\n }\n\n function applyForSoftwareConsultantJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForSoftwareConsultantJob();\n rerender();\n }\n\n function applyForSoftwareJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForSoftwareJob();\n rerender();\n }\n\n function applyForWaiterJob(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForWaiterJob();\n rerender();\n }\n\n function startInfiltration(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n const loc = location;\n if (!loc.infiltrationData)\n throw new Error(`trying to start infiltration at ${props.locName} but the infiltrationData is null`);\n\n router.toInfiltration(loc);\n }\n\n function work(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n\n const pos = companyPosition;\n if (pos instanceof CompanyPosition) {\n if (pos.isPartTimeJob() || pos.isSoftwareConsultantJob() || pos.isBusinessConsultantJob()) {\n p.startWorkPartTime(props.locName);\n } else {\n p.startWork(props.locName);\n }\n p.startFocusing();\n router.toWork();\n }\n }\n\n const isEmployedHere = jobTitle != null;\n const favorGain = company.getFavorGain();\n\n return (\n <>\n {isEmployedHere && (\n <>\n <Typography>Job Title: {jobTitle}</Typography>\n <Typography>-------------------------</Typography>\n <Box display=\"flex\">\n <Tooltip\n title={\n <>\n You will have <Favor favor={company.favor + favorGain} /> company favor upon resetting after\n installing Augmentations\n </>\n }\n >\n <Typography>\n Company reputation: <Reputation reputation={company.playerReputation} />\n </Typography>\n </Tooltip>\n </Box>\n <Typography>-------------------------</Typography>\n <Box display=\"flex\">\n <Tooltip\n title={\n <>\n Company favor increases the rate at which you earn reputation for this company by 1% per favor.\n Company favor is gained whenever you reset after installing Augmentations. The amount of favor you\n gain depends on how much reputation you have with the company.\n </>\n }\n >\n <Typography>\n Company Favor: <Favor favor={company.favor} />\n </Typography>\n </Tooltip>\n </Box>\n <Typography>-------------------------</Typography>\n <br />\n </>\n )}\n <Box sx={{ display: 'grid', width: 'fit-content' }}>\n {isEmployedHere && (\n <Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr' }}>\n <Button onClick={work}>Work</Button>\n <Button onClick={() => setQuitOpen(true)}>Quit</Button>\n <QuitJobModal\n locName={props.locName}\n company={company}\n onQuit={rerender}\n open={quitOpen}\n onClose={() => setQuitOpen(false)}\n />\n </Box>\n )\n\n }\n {company.hasAgentPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.AgentCompanyPositions[0]]}\n onClick={applyForAgentJob}\n text={\"Apply for Agent Job\"}\n />\n )}\n {company.hasBusinessConsultantPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.BusinessConsultantCompanyPositions[0]]}\n onClick={applyForBusinessConsultantJob}\n text={\"Apply for Business Consultant Job\"}\n />\n )}\n {company.hasBusinessPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.BusinessCompanyPositions[0]]}\n onClick={applyForBusinessJob}\n text={\"Apply for Business Job\"}\n />\n )}\n {company.hasEmployeePositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.MiscCompanyPositions[1]]}\n onClick={applyForEmployeeJob}\n text={\"Apply to be an Employee\"}\n />\n )}\n {company.hasEmployeePositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.PartTimeCompanyPositions[1]]}\n onClick={applyForPartTimeEmployeeJob}\n text={\"Apply to be a part-time Employee\"}\n />\n )}\n {company.hasITPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.ITCompanyPositions[0]]}\n onClick={applyForItJob}\n text={\"Apply for IT Job\"}\n />\n )}\n {company.hasSecurityPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.SecurityCompanyPositions[2]]}\n onClick={applyForSecurityJob}\n text={\"Apply for Security Job\"}\n />\n )}\n {company.hasSoftwareConsultantPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.SoftwareConsultantCompanyPositions[0]]}\n onClick={applyForSoftwareConsultantJob}\n text={\"Apply for Software Consultant Job\"}\n />\n )}\n {company.hasSoftwarePositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.SoftwareCompanyPositions[0]]}\n onClick={applyForSoftwareJob}\n text={\"Apply for Software Job\"}\n />\n )}\n {company.hasWaiterPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.MiscCompanyPositions[0]]}\n onClick={applyForWaiterJob}\n text={\"Apply to be a Waiter\"}\n />\n )}\n {company.hasWaiterPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.PartTimeCompanyPositions[0]]}\n onClick={applyForPartTimeWaiterJob}\n text={\"Apply to be a part-time Waiter\"}\n />\n )}\n {location.infiltrationData != null && <Button onClick={startInfiltration}>Infiltrate Company</Button>}\n </Box>\n </>\n );\n}\n","import React from \"react\";\nimport { Company } from \"../Company\";\nimport { use } from \"../../ui/Context\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n locName: string;\n company: Company;\n onQuit: () => void;\n}\n\nexport function QuitJobModal(props: IProps): React.ReactElement {\n const player = use.Player();\n function quit(): void {\n player.quitJob(props.locName);\n props.onQuit();\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography> Would you like to quit your job at {props.company.name}?</Typography>\n <br />\n <br />\n <Button onClick={quit}>Quit</Button>\n </Modal>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a gym\n *\n * This subcomponent renders all of the buttons for training at the gym\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { IRouter } from \"../../ui/Router\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { Box } from \"@mui/material\";\n\ntype IProps = {\n loc: Location;\n p: IPlayer;\n router: IRouter;\n};\n\nexport function GymLocation(props: IProps): React.ReactElement {\n function calculateCost(): number {\n const serverMeta = serverMetadata.find((s) => s.specialName === props.loc.name);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n if (server == null || !server.hasOwnProperty(\"backdoorInstalled\")) return props.loc.costMult;\n const discount = (server as Server).backdoorInstalled ? 0.9 : 1;\n return props.loc.costMult * discount;\n }\n\n function train(stat: string): void {\n const loc = props.loc;\n props.p.startClass(calculateCost(), loc.expMult, stat);\n props.p.startFocusing();\n props.router.toWork();\n }\n\n function trainStrength(): void {\n train(CONSTANTS.ClassGymStrength);\n }\n\n function trainDefense(): void {\n train(CONSTANTS.ClassGymDefense);\n }\n\n function trainDexterity(): void {\n train(CONSTANTS.ClassGymDexterity);\n }\n\n function trainAgility(): void {\n train(CONSTANTS.ClassGymAgility);\n }\n\n const cost = CONSTANTS.ClassGymBaseCost * calculateCost();\n\n return (\n <Box sx={{ display: 'grid', width: 'fit-content' }}>\n <Button onClick={trainStrength}>\n Train Strength (<Money money={cost} player={props.p} /> / sec)\n </Button>\n <Button onClick={trainDefense}>\n Train Defense (<Money money={cost} player={props.p} /> / sec)\n </Button>\n <Button onClick={trainDexterity}>\n Train Dexterity (<Money money={cost} player={props.p} /> / sec)\n </Button>\n <Button onClick={trainAgility}>\n Train Agility (<Money money={cost} player={props.p} /> / sec)\n </Button>\n </Box>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a hospital\n *\n * This subcomponent renders all of the buttons for hospital options\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { getHospitalizationCost } from \"../../Hospital/Hospital\";\n\nimport { Money } from \"../../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\ntype IProps = {\n p: IPlayer;\n};\n\ntype IState = {\n currHp: number;\n};\n\nexport class HospitalLocation extends React.Component<IProps, IState> {\n /**\n * Stores button styling that sets them all to block display\n */\n btnStyle: any;\n\n constructor(props: IProps) {\n super(props);\n\n this.btnStyle = { display: \"block\" };\n\n this.getCost = this.getCost.bind(this);\n this.getHealed = this.getHealed.bind(this);\n\n this.state = {\n currHp: this.props.p.hp,\n };\n }\n\n getCost(): number {\n return getHospitalizationCost(this.props.p);\n }\n\n getHealed(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n\n if (this.props.p.hp < 0) {\n this.props.p.hp = 0;\n }\n if (this.props.p.hp >= this.props.p.max_hp) {\n return;\n }\n\n const cost = this.getCost();\n this.props.p.loseMoney(cost, \"hospitalization\");\n this.props.p.hp = this.props.p.max_hp;\n\n // This just forces a re-render to update the cost\n this.setState({\n currHp: this.props.p.hp,\n });\n\n dialogBoxCreate(\n <>\n You were healed to full health! The hospital billed you for <Money money={cost} />\n </>,\n );\n }\n\n render(): React.ReactNode {\n const cost = this.getCost();\n\n return (\n <Button onClick={this.getHealed} style={this.btnStyle}>\n Get treatment for wounds - <Money money={cost} player={this.props.p} />\n </Button>\n );\n }\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a slum\n *\n * This subcomponent renders all of the buttons for committing crimes\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nimport { Crimes } from \"../../Crime/Crimes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { use } from \"../../ui/Context\";\nimport { Box } from \"@mui/material\";\n\nexport function SlumsLocation(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n function shoplift(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Shoplift.commit(router, player);\n }\n\n function robStore(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.RobStore.commit(router, player);\n }\n\n function mug(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Mug.commit(router, player);\n }\n\n function larceny(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Larceny.commit(router, player);\n }\n\n function dealDrugs(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.DealDrugs.commit(router, player);\n }\n\n function bondForgery(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.BondForgery.commit(router, player);\n }\n\n function traffickArms(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.TraffickArms.commit(router, player);\n }\n\n function homicide(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Homicide.commit(router, player);\n }\n\n function grandTheftAuto(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.GrandTheftAuto.commit(router, player);\n }\n\n function kidnap(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Kidnap.commit(router, player);\n }\n\n function assassinate(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Assassination.commit(router, player);\n }\n\n function heist(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Heist.commit(router, player);\n }\n\n const shopliftChance = Crimes.Shoplift.successRate(player);\n const robStoreChance = Crimes.RobStore.successRate(player);\n const mugChance = Crimes.Mug.successRate(player);\n const larcenyChance = Crimes.Larceny.successRate(player);\n const drugsChance = Crimes.DealDrugs.successRate(player);\n const bondChance = Crimes.BondForgery.successRate(player);\n const armsChance = Crimes.TraffickArms.successRate(player);\n const homicideChance = Crimes.Homicide.successRate(player);\n const gtaChance = Crimes.GrandTheftAuto.successRate(player);\n const kidnapChance = Crimes.Kidnap.successRate(player);\n const assassinateChance = Crimes.Assassination.successRate(player);\n const heistChance = Crimes.Heist.successRate(player);\n\n return (\n <Box sx={{ display: 'grid', width: 'fit-content' }}>\n <Tooltip title={<>Attempt to shoplift from a low-end retailer</>}>\n <Button onClick={shoplift}>\n Shoplift ({numeralWrapper.formatPercentage(shopliftChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to commit armed robbery on a high-end store</>}>\n <Button onClick={robStore}>\n Rob store ({numeralWrapper.formatPercentage(robStoreChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to mug a random person on the street</>}>\n <Button onClick={mug}>Mug someone ({numeralWrapper.formatPercentage(mugChance)} chance of success)</Button>\n </Tooltip>\n <Tooltip title={<>Attempt to rob property from someone's house</>}>\n <Button onClick={larceny}>Larceny ({numeralWrapper.formatPercentage(larcenyChance)} chance of success)</Button>\n </Tooltip>\n <Tooltip title={<>Attempt to deal drugs</>}>\n <Button onClick={dealDrugs}>\n Deal Drugs ({numeralWrapper.formatPercentage(drugsChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to forge corporate bonds</>}>\n <Button onClick={bondForgery}>\n Bond Forgery ({numeralWrapper.formatPercentage(bondChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to smuggle illegal arms into the city</>}>\n <Button onClick={traffickArms}>\n Traffick illegal Arms ({numeralWrapper.formatPercentage(armsChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to murder a random person on the street</>}>\n <Button onClick={homicide}>\n Homicide ({numeralWrapper.formatPercentage(homicideChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to commit grand theft auto</>}>\n <Button onClick={grandTheftAuto}>\n Grand theft Auto ({numeralWrapper.formatPercentage(gtaChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to kidnap and ransom a high-profile-target</>}>\n <Button onClick={kidnap}>\n Kidnap and Ransom ({numeralWrapper.formatPercentage(kidnapChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to assassinate a high-profile target</>}>\n <Button onClick={assassinate}>\n Assassinate ({numeralWrapper.formatPercentage(assassinateChance)} chance of success)\n </Button>\n </Tooltip>\n <Tooltip title={<>Attempt to pull off the ultimate heist</>}>\n <Button onClick={heist}>Heist ({numeralWrapper.formatPercentage(heistChance)} chance of success)</Button>\n </Tooltip>\n </Box>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location has special\n * actions/options/properties\n *\n * Examples:\n * - Bladeburner @ NSA\n * - Re-sleeving @ VitaLife\n * - Create Corporation @ City Hall\n *\n * This subcomponent creates all of the buttons for interacting with those special\n * properties\n */\nimport React, { useState } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\nimport { CreateCorporationModal } from \"../../Corporation/ui/CreateCorporationModal\";\nimport { LocationName } from \"../data/LocationNames\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { joinFaction } from \"../../Faction/FactionHelpers\";\n\nimport { use } from \"../../ui/Context\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { SnackbarEvents } from \"../../ui/React/Snackbar\";\nimport { N00dles } from \"../../utils/helpers/N00dles\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { applyAugmentation } from \"../../Augmentation/AugmentationHelpers\";\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\nimport { HacknetNode } from \"../../Hacknet/HacknetNode\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { GetServer } from \"../../Server/AllServers\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function SpecialLocation(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n const inBladeburner = player.inBladeburner();\n\n /**\n * Click handler for Bladeburner button at Sector-12 NSA\n */\n function handleBladeburner(): void {\n const p = player;\n if (p.inBladeburner()) {\n // Enter Bladeburner division\n router.toBladeburner();\n } else {\n // Apply for Bladeburner division\n if (p.strength >= 100 && p.defense >= 100 && p.dexterity >= 100 && p.agility >= 100) {\n p.startBladeburner({ new: true });\n dialogBoxCreate(\"You have been accepted into the Bladeburner division!\");\n setRerender((old) => !old);\n\n const worldHeader = document.getElementById(\"world-menu-header\");\n if (worldHeader instanceof HTMLElement) {\n worldHeader.click();\n worldHeader.click();\n }\n } else {\n dialogBoxCreate(\"Rejected! Please apply again when you have 100 of each combat stat (str, def, dex, agi)\");\n }\n }\n }\n\n /**\n * Click handler for Resleeving button at New Tokyo VitaLife\n */\n function handleResleeving(): void {\n router.toResleeves();\n }\n\n function renderBladeburner(): React.ReactElement {\n if (!player.canAccessBladeburner()) {\n return <></>;\n }\n const text = inBladeburner ? \"Enter Bladeburner Headquarters\" : \"Apply to Bladeburner Division\";\n return <><br/><Button onClick={handleBladeburner}>{text}</Button></>;\n }\n\n function renderNoodleBar(): React.ReactElement {\n function EatNoodles(): void {\n SnackbarEvents.emit(\"You ate some delicious noodles and feel refreshed\", \"success\", 2000);\n N00dles(); // This is the true power of the noodles.\n if (player.sourceFiles.length > 0) player.giveExploit(Exploit.N00dles);\n if (player.sourceFileLvl(5) > 0 || player.bitNodeN === 5) {\n player.intelligence_exp *= 1.0000000000000002;\n }\n player.hacking_exp *= 1.0000000000000002;\n player.strength_exp *= 1.0000000000000002;\n player.defense_exp *= 1.0000000000000002;\n player.agility_exp *= 1.0000000000000002;\n player.dexterity_exp *= 1.0000000000000002;\n player.charisma_exp *= 1.0000000000000002;\n for (const node of player.hacknetNodes) {\n if (node instanceof HacknetNode) {\n player.gainMoney(node.moneyGainRatePerSecond * 0.001, \"other\");\n } else {\n const server = GetServer(node);\n if (!(server instanceof HacknetServer)) throw new Error(`Server ${node} is not a hacknet server.`);\n player.hashManager.storeHashes(server.hashRate * 0.001);\n }\n }\n\n if (player.bladeburner) {\n player.bladeburner.rank += 0.00001;\n }\n\n if (player.corporation) {\n player.corporation.funds += player.corporation.revenue * 0.01;\n }\n }\n\n return (\n <>\n <br />\n <Button onClick={EatNoodles}>Eat noodles</Button>\n </>\n );\n }\n\n function CreateCorporation(): React.ReactElement {\n const [open, setOpen] = useState(false);\n if (!player.canAccessCorporation()) {\n return (\n <>\n <Typography>\n <i>A business man is yelling at a clerk. You should come back later.</i>\n </Typography>\n </>\n );\n }\n return (\n <>\n <Button disabled={!player.canAccessCorporation() || player.hasCorporation()} onClick={() => setOpen(true)}>\n Create a Corporation\n </Button>\n <CreateCorporationModal open={open} onClose={() => setOpen(false)} />\n </>\n );\n }\n\n function renderResleeving(): React.ReactElement {\n if (!player.canAccessResleeving()) {\n return <></>;\n }\n return <Button onClick={handleResleeving}>Re-Sleeve</Button>;\n }\n\n function handleCotMG(): void {\n const faction = Factions[\"Church of the Machine God\"];\n if (!player.factions.includes(\"Church of the Machine God\")) {\n joinFaction(faction);\n }\n if (\n !player.augmentations.some((a) => a.name === AugmentationNames.StaneksGift1) &&\n !player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)\n ) {\n applyAugmentation({ name: AugmentationNames.StaneksGift1, level: 1 });\n }\n\n router.toFaction(faction);\n }\n\n function renderCotMG(): React.ReactElement {\n // prettier-ignore\n const symbol = <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>\n {\" `` \"}<br />\n {\" -odmmNmds: \"}<br />\n {\" `hNmo:..-omNh. \"}<br />\n {\" yMd` `hNh \"}<br />\n {\" mMd oNm \"}<br />\n {\" oMNo .mM/ \"}<br />\n {\" `dMN+ -mM+ \"}<br />\n {\" -mMNo -mN+ \"}<br />\n {\" .+- :mMNo/mN/ \"}<br />\n {\":yNMd. :NMNNN/ \"}<br />\n {\"-mMMMh. /NMMh` \"}<br />\n {\" .dMMMd. /NMMMy` \"}<br />\n {\" `yMMMd. /NNyNMMh` \"}<br />\n {\" `sMMMd. +Nm: +NMMh. \"}<br />\n {\" oMMMm- oNm: /NMMd. \"}<br />\n {\" +NMMmsMm- :mMMd. \"}<br />\n {\" /NMMMm- -mMMd. \"}<br />\n {\" /MMMm- -mMMd. \"}<br />\n {\" `sMNMMm- .mMmo \"}<br />\n {\" `sMd:hMMm. ./. \"}<br />\n {\" `yMy` `yNMd` \"}<br />\n {\" `hMs` oMMy \"}<br />\n {\" `hMh sMN- \"}<br />\n {\" /MM- .NMo \"}<br />\n {\" +MM: :MM+ \"}<br />\n {\" sNNo-.`.-omNy` \"}<br />\n {\" -smNNNNmdo- \"}<br />\n {\" `..` \"}</Typography>\n if (player.hasAugmentation(AugmentationNames.StaneksGift3, true)) {\n return (\n <>\n <Typography>\n <i>\n Allison \"Mother\" Stanek: ..can ...you hear them too ...? Come now, don't be shy and let me get a closer\n look at you. Yes wonderful, I see my creation has taken root without consquence or much ill effect it\n seems. Curious, Just how much of a machine's soul do you house in that body?\n </i>\n </Typography>\n {symbol}\n </>\n );\n }\n if (player.hasAugmentation(AugmentationNames.StaneksGift2, true)) {\n return (\n <>\n <Typography>\n <i>\n Allison \"Mother\" Stanek: I see you've taken to my creation. So much so it could hardly be recognized as\n one of my own after your tinkering with it. I see you follow the ways of the Machine God as I do, and your\n mastery of the gift clearly demonstrates that. My hopes are climbing by the day for you.\n </i>\n </Typography>\n {symbol}\n </>\n );\n }\n if (player.factions.includes(\"Church of the Machine God\")) {\n return (\n <>\n <Typography>\n <i>Allison \"Mother\" Stanek: Welcome back my child!</i>\n </Typography>\n {symbol}\n </>\n );\n }\n\n if (!player.canAccessCotMG()) {\n return (\n <>\n <Typography>\n A decrepit altar stands in the middle of a dilapidated church.\n <br />\n <br />A symbol is carved in the altar.\n </Typography>\n <br />\n {symbol}\n </>\n );\n }\n\n if (\n player.augmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length > 0 ||\n player.queuedAugmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length > 0\n ) {\n return (\n <>\n <Typography>\n <i>\n Allison \"Mother\" Stanek: Begone you filth! My gift must be the first modification that your body should\n have!\n </i>\n </Typography>\n </>\n );\n }\n\n return (\n <>\n <Typography>\n <i>\n Allison \"Mother\" Stanek: Welcome child, I see your body is pure. Are you ready to ascend beyond our human\n form? If you are, accept my gift.\n </i>\n </Typography>\n <Button onClick={handleCotMG}>Accept Stanek's Gift</Button>\n {symbol}\n </>\n );\n }\n\n function renderGlitch(): React.ReactElement {\n return (\n <>\n <Typography>\n <CorruptableText content={\"An eerie aura surrounds this area. You feel you should leave.\"} />\n </Typography>\n </>\n );\n }\n\n switch (props.loc.name) {\n case LocationName.NewTokyoVitaLife: {\n return renderResleeving();\n }\n case LocationName.Sector12CityHall: {\n return <CreateCorporation />;\n }\n case LocationName.Sector12NSA: {\n return renderBladeburner();\n }\n case LocationName.NewTokyoNoodleBar: {\n return renderNoodleBar();\n }\n case LocationName.ChongqingChurchOfTheMachineGod: {\n return renderCotMG();\n }\n case LocationName.IshimaGlitch: {\n return renderGlitch();\n }\n default:\n console.error(`Location ${props.loc.name} doesn't have any special properties`);\n return <></>;\n }\n}\n","import React, { useState } from \"react\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function CreateCorporationModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const canSelfFund = player.canAfford(150e9);\n if (!player.canAccessCorporation() || player.hasCorporation()) {\n props.onClose();\n return <></>;\n }\n\n const [name, setName] = useState(\"\");\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setName(event.target.value);\n }\n\n function selfFund(): void {\n if (!canSelfFund) {\n return;\n }\n\n if (name == \"\") {\n return;\n }\n\n player.startCorporation(name);\n player.loseMoney(150e9, \"corporation\");\n\n props.onClose();\n router.toCorporation();\n }\n\n function seed(): void {\n if (name == \"\") {\n return;\n }\n\n player.startCorporation(name, 500e6);\n\n props.onClose();\n router.toCorporation();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to start a corporation? This will require $150b for registration and initial funding. {player.bitNodeN === 3 && (`This $150b\n can either be self-funded, or you can obtain the seed money from the government in exchange for 500 million\n shares`)}\n <br />\n <br />\n If you would like to start one, please enter a name for your corporation below:\n </Typography>\n <TextField autoFocus={true} placeholder=\"Corporation Name\" onChange={onChange} value={name} />\n {player.bitNodeN === 3 && (\n <Button onClick={seed} disabled={name == \"\"}>\n Use seed money\n </Button>\n )}\n <Button onClick={selfFund} disabled={name == \"\" || !canSelfFund}>\n Self-Fund (<Money money={150e9} player={player} />)\n </Button>\n </Modal>\n );\n}\n","const n00dlePower =\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[]\" +\n \")[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(\" +\n \"!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]\" +\n \"+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+\" +\n \"[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[\" +\n \"])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!\" +\n \"+[]]+([][[]]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[\" +\n \"])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!\" +\n \"![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+\" +\n \"[]+[!+[]+!+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[\" +\n \"!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+\" +\n \"[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[]\" +\n \")[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+\" +\n \"([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!\" +\n \"+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]]\" +\n \")[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])\" +\n \"[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+\" +\n \"[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[\" +\n \"]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[\" +\n \"]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[\" +\n \"]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]\" +\n \"])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+\" +\n \"!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[\" +\n \"])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+\" +\n \"(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!\" +\n \"+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+\" +\n \"[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+\" +\n \"!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]\" +\n \"]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(!\" +\n \"[]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]\" +\n \"]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[]\" +\n \")[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[\" +\n \"]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!\" +\n \"+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[\" +\n \"+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(\" +\n \"![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]\" +\n \"+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[]\" +\n \")[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]]+[+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+\" +\n \"[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][(\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+\" +\n \"[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]\" +\n \"]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!\" +\n \"![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(\" +\n \"![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[\" +\n \"])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[\" +\n \"])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[]\" +\n \")[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[\" +\n \"]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[\" +\n \"][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[\" +\n \"]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[]\" +\n \")[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!\" +\n \"+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]\" +\n \"]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]\" +\n \"]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+(\" +\n \"[][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[\" +\n \"+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+\" +\n \"[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[\" +\n \"]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+\" +\n \"(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[]\" +\n \")[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]\" +\n \"])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]]\" +\n \"(!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]])()([][(![]+[])[+[]]+(!\" +\n \"[]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[(![]+[])[!+[]+!+[]+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]\" +\n \"]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]]\" +\n \"((+((+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]+[+[\" +\n \"]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+!+[]]])+[])[!+[]+!+[]]+[+!+[]])+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]])()())[!+[]+!+[]+!+[]+[+[]]]+(+[]+[][(\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+\" +\n \"[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]\" +\n \"]])[+!+[]+[+[]]]+(+[]+[][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]+!+[]]]()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!\" +\n \"![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![\" +\n \"]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]\" +\n \"+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[\" +\n \"])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]\" +\n \"+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+\" +\n \"[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]\" +\n \"+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+!+[]]+([\" +\n \"![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[!+[]+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[\" +\n \"])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(+[![]]+[+(+!+[]+(\" +\n \"!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(!![]+[][(![]\" +\n \"+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][\" +\n \"[]]+[])[+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[\" +\n \"]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+\" +\n \"[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+\" +\n \"!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]\" +\n \"+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(+(!+[]\" +\n \"+!+[]+[+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])\" +\n \"[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+\" +\n \"[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([\" +\n \"][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[\" +\n \"]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!\" +\n \"+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]\" +\n \"]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]\" +\n \"+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]\" +\n \"]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(!\" +\n \"[]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!\" +\n \"![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]]\" +\n \")+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[\" +\n \"+!+[]+[+!+[]]]+(!![]+[])[+[]]+(+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"[]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])\" +\n \"[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![\" +\n \"]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![\" +\n \"]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[]\" +\n \")[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[\" +\n \"])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+\" +\n \"[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[\" +\n \"+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!\" +\n \"+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[]\" +\n \")[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![\" +\n \"]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!\" +\n \"[]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!!\" +\n \"[]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]\" +\n \"]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![\" +\n \"]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[\" +\n \"]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]\" +\n \"+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+\" +\n \"[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])\" +\n \"[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]\" +\n \"+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+\" +\n \"[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!\" +\n \"+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])\" +\n \"[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[\" +\n \"])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+\" +\n \"[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()\" +\n \"+[])[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[\" +\n \"!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+\" +\n \"[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[]\" +\n \")[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+\" +\n \"([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!\" +\n \"+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]]\" +\n \")[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])\" +\n \"[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+\" +\n \"[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[\" +\n \"]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[\" +\n \"]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[\" +\n \"]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]\" +\n \"])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"[][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[\" +\n \"+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+\" +\n \"!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[]\" +\n \"[(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]])()\";\n\nexport function N00dles(): void {\n // TODO: Too powerful, needs a nerf.\n eval(n00dlePower);\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a tech vendor\n *\n * This subcomponent renders all of the buttons for purchasing things from tech vendors\n */\nimport React, { useState, useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\nimport { RamButton } from \"./RamButton\";\nimport { TorButton } from \"./TorButton\";\nimport { CoresButton } from \"./CoresButton\";\n\nimport { getPurchaseServerCost } from \"../../Server/ServerPurchases\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { use } from \"../../ui/Context\";\nimport { PurchaseServerModal } from \"./PurchaseServerModal\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Box } from \"@mui/material\";\n\ninterface IServerProps {\n ram: number;\n rerender: () => void;\n}\n\nfunction ServerButton(props: IServerProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n const player = use.Player();\n const cost = getPurchaseServerCost(props.ram);\n return (\n <>\n <Button onClick={() => setOpen(true)} disabled={!player.canAfford(cost)}>\n Purchase {numeralWrapper.formatRAM(props.ram)} Server - \n <Money money={cost} player={player} />\n </Button>\n <PurchaseServerModal\n open={open}\n onClose={() => setOpen(false)}\n ram={props.ram}\n cost={cost}\n rerender={props.rerender}\n />\n </>\n );\n}\n\ntype IProps = {\n loc: Location;\n};\n\nexport function TechVendorLocation(props: IProps): React.ReactElement {\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n const purchaseServerButtons: React.ReactNode[] = [];\n for (let i = props.loc.techVendorMinRam; i <= props.loc.techVendorMaxRam; i *= 2) {\n purchaseServerButtons.push(<ServerButton key={i} ram={i} rerender={rerender} />);\n }\n\n return (\n <>\n <br />\n <Box sx={{ display: 'grid', width: 'fit-content' }}>\n {purchaseServerButtons}\n </Box>\n <br />\n <Typography>\n <i>\"You can order bigger servers via scripts. We don't take custom orders in person.\"</i>\n </Typography>\n <br />\n <TorButton p={player} rerender={rerender} />\n <br />\n <RamButton p={player} rerender={rerender} />\n <br />\n <CoresButton p={player} rerender={rerender} />\n </>\n );\n}\n","import React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Typography from \"@mui/material/Typography\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { purchaseRamForHomeComputer } from \"../../Server/ServerPurchases\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\ntype IProps = {\n p: IPlayer;\n rerender: () => void;\n};\n\nexport function RamButton(props: IProps): React.ReactElement {\n const homeComputer = props.p.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n return <Button>Upgrade 'home' RAM - MAX</Button>;\n }\n\n const cost = props.p.getUpgradeHomeRamCost();\n\n function buy(): void {\n purchaseRamForHomeComputer(props.p);\n props.rerender();\n }\n\n return (\n <Tooltip\n title={\n <MathJaxWrapper>{`\\\\(\\\\large{cost = 3.2 \\\\cdot 10^3 \\\\cdot 1.58^{log_2{(ram)}}}\\\\)`}</MathJaxWrapper>\n }\n >\n <span>\n <br />\n <Typography>\n <i>\"More RAM means more scripts on 'home'\"</i>\n </Typography>\n <br />\n <Button disabled={!props.p.canAfford(cost)} onClick={buy}>\n Upgrade 'home' RAM ({numeralWrapper.formatRAM(homeComputer.maxRam)} -> \n {numeralWrapper.formatRAM(homeComputer.maxRam * 2)}) - \n <Money money={cost} player={props.p} />\n </Button>\n </span>\n </Tooltip>\n );\n}\n","import React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { purchaseTorRouter } from \"../LocationsHelpers\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { Money } from \"../../ui/React/Money\";\n\ntype IProps = {\n p: IPlayer;\n rerender: () => void;\n};\n\nexport function TorButton(props: IProps): React.ReactElement {\n function buy(): void {\n purchaseTorRouter(props.p);\n props.rerender();\n }\n\n if (props.p.hasTorRouter()) {\n return <Button>TOR Router - Purchased</Button>;\n }\n\n return (\n <Button disabled={!props.p.canAfford(CONSTANTS.TorRouterCost)} onClick={buy}>\n Purchase TOR router - \n <Money money={CONSTANTS.TorRouterCost} player={props.p} />\n </Button>\n );\n}\n","/**\n * Location and traveling-related helper functions.\n * Mostly used for UI\n */\nimport { CONSTANTS } from \"../Constants\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { AddToAllServers, createUniqueRandomIp } from \"../Server/AllServers\";\nimport { safetlyCreateUniqueServer } from \"../Server/ServerHelpers\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\n/**\n * Attempt to purchase a TOR router\n * @param {IPlayer} p - Player object\n */\nexport function purchaseTorRouter(p: IPlayer): void {\n if (p.hasTorRouter()) {\n dialogBoxCreate(`You already have a TOR Router!`);\n return;\n }\n if (!p.canAfford(CONSTANTS.TorRouterCost)) {\n dialogBoxCreate(\"You cannot afford to purchase the TOR router!\");\n return;\n }\n p.loseMoney(CONSTANTS.TorRouterCost, \"other\");\n\n const darkweb = safetlyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: \"darkweb\",\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: false,\n purchasedByPlayer: false,\n maxRam: 1,\n });\n AddToAllServers(darkweb);\n\n p.getHomeComputer().serversOnNetwork.push(darkweb.hostname);\n darkweb.serversOnNetwork.push(p.getHomeComputer().hostname);\n dialogBoxCreate(\n \"You have purchased a TOR router!<br>\" +\n \"You now have access to the dark web from your home computer.<br>\" +\n \"Use the scan/scan-analyze commands to search for the dark web connection.\",\n );\n}\n","import React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Typography from \"@mui/material/Typography\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\ntype IProps = {\n p: IPlayer;\n rerender: () => void;\n};\n\nexport function CoresButton(props: IProps): React.ReactElement {\n const homeComputer = props.p.getHomeComputer();\n const maxCores = homeComputer.cpuCores >= 8;\n if (maxCores) {\n return <Button>Upgrade 'home' cores - MAX</Button>;\n }\n\n const cost = props.p.getUpgradeHomeCoresCost();\n\n function buy(): void {\n if (maxCores) return;\n if (!props.p.canAfford(cost)) return;\n props.p.loseMoney(cost, \"servers\");\n homeComputer.cpuCores++;\n props.rerender();\n }\n\n return (\n <Tooltip\n title={\n <MathJaxWrapper>{`\\\\(\\\\large{cost = 10^9 \\\\cdot 7.5 ^{\\\\text{cores}}}\\\\)`}</MathJaxWrapper>\n }\n >\n <span>\n <br />\n <Typography>\n <i>\"Cores increase the effectiveness of grow() and weaken() on 'home'\"</i>\n </Typography>\n <br />\n <Button disabled={!props.p.canAfford(cost)} onClick={buy}>\n Upgrade 'home' cores ({homeComputer.cpuCores} -> {homeComputer.cpuCores + 1}) - \n <Money money={cost} player={props.p} />\n </Button>\n </span>\n </Tooltip>\n );\n}\n","/**\n * React Component for the popup used to purchase a new server.\n */\nimport React, { useState } from \"react\";\nimport { purchaseServer } from \"../../Server/ServerPurchases\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n ram: number;\n cost: number;\n rerender: () => void;\n}\n\nexport function PurchaseServerModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const [hostname, setHostname] = useState(\"\");\n\n function tryToPurchaseServer(): void {\n purchaseServer(hostname, props.ram, props.cost, player);\n props.onClose();\n }\n\n function onKeyUp(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) tryToPurchaseServer();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setHostname(event.target.value);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to purchase a new server with {numeralWrapper.formatRAM(props.ram)} of RAM for{\" \"}\n <Money money={props.cost} player={player} />?\n </Typography>\n <br />\n <br />\n <Typography> Please enter the server hostname below:</Typography>\n <br />\n\n <TextField\n autoFocus\n onKeyUp={onKeyUp}\n onChange={onChange}\n type=\"text\"\n placeholder=\"Unique Hostname\"\n InputProps={{\n endAdornment: (\n <Button onClick={tryToPurchaseServer} disabled={!player.canAfford(props.cost) || hostname === \"\"}>\n Buy\n </Button>\n ),\n }}\n />\n </Modal>\n );\n}\n","import React from \"react\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n city: string;\n travel: () => void;\n\n open: boolean;\n onClose: () => void;\n}\n\nexport function TravelConfirmationModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const cost = CONSTANTS.TravelCost;\n function travel(): void {\n props.travel();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to travel to {props.city}? The trip will cost <Money money={cost} player={player} />.\n </Typography>\n <br />\n <br />\n <Button onClick={travel}>\n <Typography>Travel</Typography>\n </Button>\n </Modal>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a university\n *\n * This subcomponent renders all of the buttons for studying/taking courses\n */\nimport * as React from \"react\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { use } from \"../../ui/Context\";\nimport { Box } from \"@mui/material\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function UniversityLocation(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n\n function calculateCost(): number {\n const server = GetServer(props.loc.name);\n if (server == null || !server.hasOwnProperty(\"backdoorInstalled\")) return props.loc.costMult;\n const discount = (server as Server).backdoorInstalled ? 0.9 : 1;\n return props.loc.costMult * discount;\n }\n\n function take(stat: string): void {\n const loc = props.loc;\n player.startClass(calculateCost(), loc.expMult, stat);\n player.startFocusing();\n router.toWork();\n }\n\n function study(): void {\n take(CONSTANTS.ClassStudyComputerScience);\n }\n\n function dataStructures(): void {\n take(CONSTANTS.ClassDataStructures);\n }\n\n function networks(): void {\n take(CONSTANTS.ClassNetworks);\n }\n\n function algorithms(): void {\n take(CONSTANTS.ClassAlgorithms);\n }\n\n function management(): void {\n take(CONSTANTS.ClassManagement);\n }\n\n function leadership(): void {\n take(CONSTANTS.ClassLeadership);\n }\n\n const costMult: number = calculateCost();\n\n const dataStructuresCost = CONSTANTS.ClassDataStructuresBaseCost * costMult;\n const networksCost = CONSTANTS.ClassNetworksBaseCost * costMult;\n const algorithmsCost = CONSTANTS.ClassAlgorithmsBaseCost * costMult;\n const managementCost = CONSTANTS.ClassManagementBaseCost * costMult;\n const leadershipCost = CONSTANTS.ClassLeadershipBaseCost * costMult;\n\n const earnHackingExpTooltip = `Gain hacking experience!`;\n const earnCharismaExpTooltip = `Gain charisma experience!`;\n\n return (\n <Box sx={{ display: 'grid', width: 'fit-content' }}>\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={study}>Study Computer Science (free)</Button>\n </Tooltip>\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={dataStructures}>\n Take Data Structures course (\n <Money money={dataStructuresCost} player={player} /> / sec)\n </Button>\n </Tooltip>\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={networks}>\n Take Networks course (\n <Money money={networksCost} player={player} /> / sec)\n </Button>\n </Tooltip>\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={algorithms}>\n Take Algorithms course (\n <Money money={algorithmsCost} player={player} /> / sec)\n </Button>\n </Tooltip>\n <Tooltip title={earnCharismaExpTooltip}>\n <Button onClick={management}>\n Take Management course (\n <Money money={managementCost} player={player} /> / sec)\n </Button>\n </Tooltip>\n <Tooltip title={earnCharismaExpTooltip}>\n <Button onClick={leadership}>\n Take Leadership course (\n <Money money={leadershipCost} player={player} /> / sec)\n </Button>\n </Tooltip>\n </Box>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a gym\n *\n * This subcomponent renders all of the buttons for training at the gym\n */\nimport React, { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport { Blackjack, DECK_COUNT } from \"../../Casino/Blackjack\";\nimport { CoinFlip } from \"../../Casino/CoinFlip\";\nimport { Roulette } from \"../../Casino/Roulette\";\nimport { SlotMachine } from \"../../Casino/SlotMachine\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Box } from \"@mui/material\";\n\nenum GameType {\n None = \"none\",\n Coin = \"coin\",\n Slots = \"slots\",\n Roulette = \"roulette\",\n Blackjack = \"blackjack\",\n}\n\ntype IProps = {\n p: IPlayer;\n};\n\nexport function CasinoLocation(props: IProps): React.ReactElement {\n const [game, setGame] = useState(GameType.None);\n\n function updateGame(game: GameType): void {\n setGame(game);\n }\n\n return (\n <>\n {game === GameType.None && (\n <Box sx={{ display: 'grid', width: 'fit-content' }}>\n <Button onClick={() => updateGame(GameType.Coin)}>Play coin flip</Button>\n <Button onClick={() => updateGame(GameType.Slots)}>Play slots</Button>\n <Button onClick={() => updateGame(GameType.Roulette)}>Play roulette</Button>\n <Button onClick={() => updateGame(GameType.Blackjack)}>Play blackjack ({DECK_COUNT} decks)</Button>\n </Box>\n )}\n {game !== GameType.None && (\n <>\n <Button onClick={() => updateGame(GameType.None)}>Stop playing</Button>\n {game === GameType.Coin && <CoinFlip p={props.p} />}\n {game === GameType.Slots && <SlotMachine p={props.p} />}\n {game === GameType.Roulette && <Roulette p={props.p} />}\n {game === GameType.Blackjack && <Blackjack p={props.p} />}\n </>\n )}\n </>\n );\n}\n","import { Card, Suit } from \"./Card\";\nimport { shuffle } from \"lodash\";\n\nexport class Deck {\n private cards: Card[] = [];\n\n // Support multiple decks\n constructor(private numDecks = 1) {\n this.reset();\n }\n\n shuffle(): void {\n this.cards = shuffle(this.cards); // Just use lodash\n }\n\n drawCard(): Card {\n if (this.cards.length == 0) {\n throw new Error(\"Tried to draw card from empty deck\");\n }\n\n return this.cards.shift() as Card; // Guaranteed to return a Card since we throw an Error if array is empty\n }\n\n // Draws a card, resetting the deck beforehands if the Deck is empty\n safeDrawCard(): Card {\n if (this.cards.length === 0) {\n this.reset();\n }\n\n return this.drawCard();\n }\n\n // Reset the deck back to the original 52 cards and shuffle it\n reset(): void {\n this.cards = [];\n\n for (let i = 1; i <= 13; ++i) {\n for (let j = 0; j < this.numDecks; ++j) {\n this.cards.push(new Card(i, Suit.Clubs));\n this.cards.push(new Card(i, Suit.Diamonds));\n this.cards.push(new Card(i, Suit.Hearts));\n this.cards.push(new Card(i, Suit.Spades));\n }\n }\n\n this.shuffle();\n }\n\n size(): number {\n return this.cards.length;\n }\n\n isEmpty(): boolean {\n return this.cards.length === 0;\n }\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a gym\n *\n * This subcomponent renders all of the buttons for training at the gym\n */\nimport React, { useState } from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { BadRNG } from \"./RNG\";\nimport { win, reachedLimit } from \"./Game\";\nimport { trusted } from \"./utils\";\n\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n p: IPlayer;\n};\n\nconst minPlay = 0;\nconst maxPlay = 10e3;\n\nexport function CoinFlip(props: IProps): React.ReactElement {\n const [investment, setInvestment] = useState(1000);\n const [result, setResult] = useState(<span> </span>);\n const [status, setStatus] = useState(\"\");\n const [playLock, setPlayLock] = useState(false);\n\n function updateInvestment(e: React.ChangeEvent<HTMLInputElement>): void {\n let investment: number = parseInt(e.currentTarget.value);\n if (isNaN(investment)) {\n investment = minPlay;\n }\n if (investment > maxPlay) {\n investment = maxPlay;\n }\n if (investment < minPlay) {\n investment = minPlay;\n }\n setInvestment(investment);\n }\n\n function play(guess: string): void {\n if (reachedLimit(props.p)) return;\n const v = BadRNG.random();\n let letter: string;\n if (v < 0.5) {\n letter = \"H\";\n } else {\n letter = \"T\";\n }\n const correct: boolean = guess === letter;\n\n setResult(\n <Box display=\"flex\">\n <Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }} color={correct ? \"primary\" : \"error\"}>\n {letter}\n </Typography>\n </Box>,\n );\n setStatus(correct ? \" win!\" : \"lose!\");\n setPlayLock(true);\n\n setTimeout(() => setPlayLock(false), 250);\n if (correct) {\n win(props.p, investment);\n } else {\n win(props.p, -investment);\n }\n if (reachedLimit(props.p)) return;\n }\n\n return (\n <>\n <Typography>Result:</Typography> {result}\n <Box display=\"flex\" alignItems=\"center\">\n <TextField\n type=\"number\"\n onChange={updateInvestment}\n InputProps={{\n endAdornment: (\n <>\n <Button onClick={trusted(() => play(\"H\"))} disabled={playLock}>\n Head!\n </Button>\n <Button onClick={trusted(() => play(\"T\"))} disabled={playLock}>\n Tail!\n </Button>\n </>\n ),\n }}\n />\n </Box>\n <Typography variant=\"h3\">{status}</Typography>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Money } from \"../ui/React/Money\";\nimport { win, reachedLimit } from \"./Game\";\nimport { WHRNG } from \"./RNG\";\nimport { trusted } from \"./utils\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ntype IProps = {\n p: IPlayer;\n};\n\nconst minPlay = 0;\nconst maxPlay = 1e7;\n\nfunction isRed(n: number): boolean {\n return [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36].includes(n);\n}\n\ntype Strategy = {\n match: (n: number) => boolean;\n payout: number;\n};\n\nconst redNumbers: number[] = [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36];\n\nconst strategies: {\n Red: Strategy;\n Black: Strategy;\n Odd: Strategy;\n Even: Strategy;\n High: Strategy;\n Low: Strategy;\n Third1: Strategy;\n Third2: Strategy;\n Third3: Strategy;\n} = {\n Red: {\n match: (n: number): boolean => {\n return redNumbers.includes(n);\n },\n payout: 1,\n },\n Black: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return !redNumbers.includes(n);\n },\n payout: 1,\n },\n Odd: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n % 2 === 1;\n },\n payout: 1,\n },\n Even: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n % 2 === 0;\n },\n payout: 1,\n },\n High: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n > 18;\n },\n payout: 1,\n },\n Low: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n < 19;\n },\n payout: 1,\n },\n Third1: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n <= 12;\n },\n payout: 2,\n },\n Third2: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n >= 13 && n <= 24;\n },\n payout: 2,\n },\n Third3: {\n match: (n: number): boolean => {\n if (n === 0) return false;\n return n >= 25;\n },\n payout: 2,\n },\n};\n\nfunction Single(s: number): Strategy {\n return {\n match: (n: number): boolean => {\n return s === n;\n },\n payout: 36,\n };\n}\n\nexport function Roulette(props: IProps): React.ReactElement {\n const [rng] = useState(new WHRNG(new Date().getTime()));\n const [investment, setInvestment] = useState(1000);\n const [canPlay, setCanPlay] = useState(true);\n const [status, setStatus] = useState<string | JSX.Element>(\"waiting\");\n const [n, setN] = useState(0);\n const [lock, setLock] = useState(true);\n\n useEffect(() => {\n const i = window.setInterval(step, 50);\n return () => clearInterval(i);\n });\n\n function step(): void {\n if (!lock) {\n setN(Math.floor(Math.random() * 37));\n }\n }\n\n function updateInvestment(e: React.ChangeEvent<HTMLInputElement>): void {\n let investment: number = parseInt(e.currentTarget.value);\n if (isNaN(investment)) {\n investment = minPlay;\n }\n if (investment > maxPlay) {\n investment = maxPlay;\n }\n if (investment < minPlay) {\n investment = minPlay;\n }\n setInvestment(investment);\n }\n\n function currentNumber(): string {\n if (n === 0) return \"0\";\n const color = isRed(n) ? \"R\" : \"B\";\n return `${n}${color}`;\n }\n\n function play(strategy: Strategy): void {\n if (reachedLimit(props.p)) return;\n\n setCanPlay(false);\n setLock(false);\n setStatus(\"playing\");\n\n setTimeout(() => {\n let n = Math.floor(rng.random() * 37);\n let status = <></>;\n let gain = 0;\n let playerWin = strategy.match(n);\n // oh yeah, the house straight up cheats. Try finding the seed now!\n if (playerWin && Math.random() > 0.9) {\n playerWin = false;\n while (strategy.match(n)) {\n n = (n + 1) % 36;\n }\n }\n if (playerWin) {\n gain = investment * strategy.payout;\n status = (\n <>\n won <Money money={gain} />\n </>\n );\n } else {\n gain = -investment;\n status = (\n <>\n lost <Money money={-gain} />\n </>\n );\n }\n win(props.p, gain);\n\n setCanPlay(true);\n setLock(true);\n setStatus(status);\n setN(n);\n\n reachedLimit(props.p);\n }, 1600);\n }\n\n return (\n <>\n <Typography variant=\"h4\">{currentNumber()}</Typography>\n <TextField type=\"number\" onChange={updateInvestment} placeholder={\"Amount to play\"} disabled={!canPlay} />\n <Typography variant=\"h4\">{status}</Typography>\n <table>\n <tbody>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(3)))}>\n 3\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(6)))}>\n 6\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(9)))}>\n 9\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(12)))}>\n 12\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(15)))}>\n 15\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(18)))}>\n 18\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(21)))}>\n 21\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(24)))}>\n 24\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(27)))}>\n 27\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(30)))}>\n 30\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(33)))}>\n 33\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(36)))}>\n 36\n </Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(2)))}>\n 2\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(5)))}>\n 5\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(8)))}>\n 8\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(11)))}>\n 11\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(14)))}>\n 14\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(17)))}>\n 17\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(20)))}>\n 20\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(23)))}>\n 23\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(26)))}>\n 26\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(29)))}>\n 29\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(32)))}>\n 32\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(35)))}>\n 35\n </Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(1)))}>\n 1\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(4)))}>\n 4\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(7)))}>\n 7\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(10)))}>\n 10\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(13)))}>\n 13\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(16)))}>\n 16\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(19)))}>\n 19\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(22)))}>\n 22\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(25)))}>\n 25\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(28)))}>\n 28\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(31)))}>\n 31\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(34)))}>\n 34\n </Button>\n </td>\n </tr>\n <tr>\n <td colSpan={4}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Third1))}>\n 1 to 12\n </Button>\n </td>\n <td colSpan={4}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Third2))}>\n 13 to 24\n </Button>\n </td>\n <td colSpan={4}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Third3))}>\n 25 to 36\n </Button>\n </td>\n </tr>\n <tr>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Red))}>\n Red\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Black))}>\n Black\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Odd))}>\n Odd\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Even))}>\n Even\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.High))}>\n High\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Low))}>\n Low\n </Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(0)))}>\n 0\n </Button>\n </td>\n </tr>\n </tbody>\n </table>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Money } from \"../ui/React/Money\";\nimport { WHRNG } from \"./RNG\";\nimport { win, reachedLimit } from \"./Game\";\nimport { trusted } from \"./utils\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ntype IProps = {\n p: IPlayer;\n};\n\n// statically shuffled array of symbols.\nconst symbols = [\n \"D\",\n \"C\",\n \"$\",\n \"?\",\n \"♥\",\n \"A\",\n \"C\",\n \"B\",\n \"C\",\n \"E\",\n \"B\",\n \"E\",\n \"C\",\n \"*\",\n \"D\",\n \"♥\",\n \"B\",\n \"A\",\n \"A\",\n \"A\",\n \"C\",\n \"A\",\n \"D\",\n \"B\",\n \"E\",\n \"?\",\n \"D\",\n \"*\",\n \"@\",\n \"♥\",\n \"B\",\n \"E\",\n \"?\",\n];\n\nfunction getPayout(s: string, n: number): number {\n switch (s) {\n case \"$\":\n return [20, 200, 1000][n];\n case \"@\":\n return [8, 80, 400][n];\n case \"♥\":\n case \"?\":\n return [6, 20, 150][n];\n case \"D\":\n case \"E\":\n return [1, 8, 30][n];\n default:\n return [1, 5, 20][n];\n }\n}\n\nconst payLines = [\n // lines\n [\n [0, 0],\n [0, 1],\n [0, 2],\n [0, 3],\n [0, 4],\n ],\n [\n [1, 0],\n [1, 1],\n [1, 2],\n [1, 3],\n [1, 4],\n ],\n [\n [2, 0],\n [2, 1],\n [2, 2],\n [2, 3],\n [2, 4],\n ],\n\n // Vs\n [\n [2, 0],\n [1, 1],\n [0, 2],\n [1, 3],\n [2, 4],\n ],\n [\n [0, 0],\n [1, 1],\n [2, 2],\n [1, 3],\n [0, 4],\n ],\n\n // rest\n [\n [0, 0],\n [1, 1],\n [1, 2],\n [1, 3],\n [0, 4],\n ],\n [\n [2, 0],\n [1, 1],\n [1, 2],\n [1, 3],\n [2, 4],\n ],\n [\n [1, 0],\n [0, 1],\n [0, 2],\n [0, 3],\n [1, 4],\n ],\n [\n [1, 0],\n [2, 1],\n [2, 2],\n [2, 3],\n [1, 4],\n ],\n];\n\nconst minPlay = 0;\nconst maxPlay = 1e6;\n\nexport function SlotMachine(props: IProps): React.ReactElement {\n const [rng] = useState(new WHRNG(props.p.totalPlaytime));\n const [index, setIndex] = useState<number[]>([0, 0, 0, 0, 0]);\n const [locks, setLocks] = useState<number[]>([0, 0, 0, 0, 0]);\n const [investment, setInvestment] = useState(1000);\n const [canPlay, setCanPlay] = useState(true);\n const [status, setStatus] = useState<string | JSX.Element>(\"waiting\");\n\n useEffect(() => {\n const i = window.setInterval(step, 50);\n return () => clearInterval(i);\n });\n\n function step(): void {\n let stoppedOne = false;\n const copy = index.slice();\n for (let i = 0; i < copy.length; i++) {\n if (copy[i] === locks[i] && !stoppedOne) continue;\n copy[i] = (copy[i] - 1 >= 0) ? copy[i] - 1 : symbols.length - 1;\n stoppedOne = true;\n }\n\n setIndex(copy);\n\n if (stoppedOne && copy.every((e, i) => e === locks[i])) {\n checkWinnings(getTable(copy, symbols));\n }\n }\n\n function getTable(index:number[], symbols:string[]): string[][] {\n return [\n [\n symbols[(index[0] + symbols.length - 1) % symbols.length],\n symbols[(index[1] + symbols.length - 1) % symbols.length],\n symbols[(index[2] + symbols.length - 1) % symbols.length],\n symbols[(index[3] + symbols.length - 1) % symbols.length],\n symbols[(index[4] + symbols.length - 1) % symbols.length],\n ],\n [symbols[index[0]], symbols[index[1]], symbols[index[2]], symbols[index[3]], symbols[index[4]]],\n [\n symbols[(index[0] + 1) % symbols.length],\n symbols[(index[1] + 1) % symbols.length],\n symbols[(index[2] + 1) % symbols.length],\n symbols[(index[3] + 1) % symbols.length],\n symbols[(index[4] + 1) % symbols.length],\n ],\n ];\n }\n\n function play(): void {\n if (reachedLimit(props.p)) return;\n setStatus(\"playing\");\n win(props.p, -investment);\n if (!canPlay) return;\n unlock();\n setTimeout(lock, rng.random() * 2000 + 1000);\n }\n\n function lock(): void {\n setLocks([\n Math.floor(rng.random() * symbols.length),\n Math.floor(rng.random() * symbols.length),\n Math.floor(rng.random() * symbols.length),\n Math.floor(rng.random() * symbols.length),\n Math.floor(rng.random() * symbols.length),\n ]);\n }\n\n function checkWinnings(t:string[][]): void {\n const getPaylineData = function (payline: number[][]): string[] {\n const data = [];\n for (const point of payline) {\n data.push(t[point[0]][point[1]]);\n }\n return data;\n };\n\n const countSequence = function (data: string[]): number {\n let count = 1;\n for (let i = 1; i < data.length; i++) {\n if (data[i] !== data[i - 1]) break;\n count++;\n }\n\n return count;\n };\n\n let gains = -investment;\n for (const payline of payLines) {\n const data = getPaylineData(payline);\n const count = countSequence(data);\n if (count < 3) continue;\n const payout = getPayout(data[0], count - 3);\n gains += investment * payout;\n win(props.p, investment * payout);\n }\n\n setStatus(\n <>\n {gains > 0 ? \"gained\" : \"lost\"} <Money money={Math.abs(gains)} />\n </>,\n );\n setCanPlay(true);\n if (reachedLimit(props.p)) return;\n }\n\n function unlock(): void {\n setLocks([-1, -1, -1, -1, -1]);\n setCanPlay(false);\n }\n\n function updateInvestment(e: React.ChangeEvent<HTMLInputElement>): void {\n let investment: number = parseInt(e.currentTarget.value);\n if (isNaN(investment)) {\n investment = minPlay;\n }\n if (investment > maxPlay) {\n investment = maxPlay;\n }\n if (investment < minPlay) {\n investment = minPlay;\n }\n setInvestment(investment);\n }\n\n const t = getTable(index, symbols);\n // prettier-ignore\n return (\n <>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>+———————————————————————+</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>| | {t[0][0]} | {t[0][1]} | {t[0][2]} | {t[0][3]} | {t[0][4]} | |</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>| | | | | | | |</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>| | {symbols[index[0]]} | {symbols[index[1]]} | {symbols[index[2]]} | {symbols[index[3]]} | {symbols[index[4]]} | |</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>| | | | | | | |</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>| | {symbols[(index[0]+1)%symbols.length]} | {symbols[(index[1]+1)%symbols.length]} | {symbols[(index[2]+1)%symbols.length]} | {symbols[(index[3]+1)%symbols.length]} | {symbols[(index[4]+1)%symbols.length]} | |</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>+———————————————————————+</Typography>\n <TextField\n type=\"number\"\n onChange={updateInvestment}\n placeholder={\"Amount to play\"}\n disabled={!canPlay}\n InputProps={{endAdornment:(<Button\n onClick={trusted(play)}\n disabled={!canPlay}\n >Spin!</Button>)}}\n />\n\n <Typography variant=\"h4\">{status}</Typography>\n <Typography>Pay lines</Typography>\n\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>----- ····· ·····</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>····· ----- ·····</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>····· ····· -----</Typography>\n<br />\n\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>··^·· \\···/ \\···/</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>·/·\\· ·\\·/· ·---·</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>/···\\ ··v·· ·····</Typography>\n<br />\n\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>····· ·---· ·····</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>·---· /···\\ \\···/</Typography>\n<Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>/···\\ ····· ·---·</Typography>\n </>\n );\n}\n\n// https://felgo.com/doc/how-to-make-a-slot-game-tutorial/\n","/**\n * React Component for displaying a City's UI.\n * This UI shows all of the available locations in the city, and lets the player\n * visit those locations\n */\nimport * as React from \"react\";\n\nimport { City } from \"../City\";\nimport { Cities } from \"../Cities\";\nimport { LocationName } from \"../data/LocationNames\";\nimport { Locations } from \"../Locations\";\nimport { Location } from \"../Location\";\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { use } from \"../../ui/Context\";\nimport { IRouter } from \"../../ui/Router\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { LocationType } from \"../LocationTypeEnum\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ntype IProps = {\n city: City;\n};\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n location: {\n color: theme.colors.white,\n whiteSpace: \"nowrap\",\n margin: \"0px\",\n padding: \"0px\",\n cursor: \"pointer\",\n },\n })\n);\n\n\nfunction toLocation(router: IRouter, location: Location): void {\n if (location.name === LocationName.TravelAgency) {\n router.toTravel();\n } else if (location.name === LocationName.WorldStockExchange) {\n router.toStockMarket();\n } else {\n router.toLocation(location);\n }\n}\n\nfunction LocationLetter(location: Location): React.ReactElement {\n location.types;\n const router = use.Router();\n const classes = useStyles();\n let L = \"X\";\n if (location.types.includes(LocationType.Company)) L = \"C\";\n if (location.types.includes(LocationType.Gym)) L = \"G\";\n if (location.types.includes(LocationType.Hospital)) L = \"H\";\n if (location.types.includes(LocationType.Slums)) L = \"S\";\n if (location.types.includes(LocationType.StockMarket)) L = \"$\";\n if (location.types.includes(LocationType.TechVendor)) L = \"T\";\n if (location.types.includes(LocationType.TravelAgency)) L = \"T\";\n if (location.types.includes(LocationType.University)) L = \"U\";\n if (location.types.includes(LocationType.Casino)) L = \"¢\";\n if (location.types.includes(LocationType.Special)) L = \"?\";\n if (!location) return <span>*</span>;\n return (\n <span\n aria-label={location.name}\n key={location.name}\n className={classes.location}\n onClick={() => toLocation(router, location)}\n >\n <b>{L}</b>\n </span>\n );\n}\n\nfunction ASCIICity(props: IProps): React.ReactElement {\n const locationLettersRegex = /[A-Z]/g;\n const letterMap: any = {\n A: 0,\n B: 1,\n C: 2,\n D: 3,\n E: 4,\n F: 5,\n G: 6,\n H: 7,\n I: 8,\n J: 9,\n K: 10,\n L: 11,\n M: 12,\n N: 13,\n O: 14,\n P: 15,\n Q: 16,\n R: 17,\n S: 18,\n T: 19,\n U: 20,\n V: 21,\n W: 22,\n X: 23,\n Y: 24,\n Z: 25,\n };\n\n const lineElems = (s: string): JSX.Element[] => {\n const elems: any[] = [];\n const matches: any[] = [];\n let match: any;\n while ((match = locationLettersRegex.exec(s)) !== null) {\n matches.push(match);\n }\n if (matches.length === 0) {\n elems.push(s);\n return elems;\n }\n\n for (let i = 0; i < matches.length; i++) {\n const startI = i === 0 ? 0 : matches[i - 1].index + 1;\n const endI = matches[i].index;\n elems.push(s.slice(startI, endI));\n const locationI = letterMap[s[matches[i].index]];\n elems.push(LocationLetter(Locations[props.city.locations[locationI]]));\n }\n elems.push(s.slice(matches[matches.length - 1].index + 1));\n return elems;\n };\n\n const elems: JSX.Element[] = [];\n const lines = props.city.asciiArt.split(\"\\n\");\n for (const line of lines) {\n elems.push(\n <Typography key={line} sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>\n {lineElems(line)}\n </Typography>,\n );\n }\n\n return <>{elems}</>;\n}\n\nfunction ListCity(props: IProps): React.ReactElement {\n const router = use.Router();\n const locationButtons = props.city.locations.map((locName) => {\n return (\n <React.Fragment key={locName}>\n <Button onClick={() => toLocation(router, Locations[locName])}>{locName}</Button>\n <br />\n </React.Fragment>\n );\n });\n\n return <>{locationButtons}</>;\n}\n\nexport function LocationCity(): React.ReactElement {\n const player = use.Player();\n const city = Cities[player.city];\n return (\n <>\n <Typography>{city.name}</Typography>\n {Settings.DisableASCIIArt ? <ListCity city={city} /> : <ASCIICity city={city} />}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { Options, WordWrapOptions } from \"./Options\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport Select from \"@mui/material/Select\";\nimport Switch from \"@mui/material/Switch\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n options: Options;\n save: (options: Options) => void;\n onClose: () => void;\n open: boolean;\n}\n\nexport function OptionsModal(props: IProps): React.ReactElement {\n const [theme, setTheme] = useState(props.options.theme);\n const [insertSpaces, setInsertSpaces] = useState(props.options.insertSpaces);\n const [fontSize, setFontSize] = useState(props.options.fontSize);\n const [wordWrap, setWordWrap] = useState(props.options.wordWrap);\n const [vim, setVim] = useState(props.options.vim);\n\n function save(): void {\n props.save({\n theme,\n insertSpaces,\n fontSize,\n wordWrap,\n vim,\n });\n props.onClose();\n }\n\n function onFontChange(event: React.ChangeEvent<HTMLInputElement>): void {\n const f = parseFloat(event.target.value);\n if (isNaN(f)) return;\n setFontSize(f);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Theme: </Typography>\n <Select onChange={(event) => setTheme(event.target.value)} value={theme}>\n <MenuItem value=\"monokai\">monokai</MenuItem>\n <MenuItem value=\"solarized-dark\">solarized-dark</MenuItem>\n <MenuItem value=\"solarized-light\">solarized-light</MenuItem>\n <MenuItem value=\"vs-dark\">dark</MenuItem>\n <MenuItem value=\"light\">light</MenuItem>\n <MenuItem value=\"dracula\">dracula</MenuItem>\n <MenuItem value=\"one-dark\">one-dark</MenuItem>\n </Select>\n </Box>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Use whitespace over tabs: </Typography>\n <Switch onChange={(event) => setInsertSpaces(event.target.checked)} checked={insertSpaces} />\n </Box>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Word Wrap: </Typography>\n <Select onChange={(event) => setWordWrap(event.target.value as WordWrapOptions)} value={wordWrap}>\n <MenuItem value={\"off\"}>Off</MenuItem>\n <MenuItem value={\"on\"}>On</MenuItem>\n <MenuItem value={\"bounded\"}>Bounded</MenuItem>\n <MenuItem value={\"wordWrapColumn\"}>Word Wrap Column</MenuItem>\n </Select>\n </Box>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Enable vim mode: </Typography>\n <Switch onChange={(event) => setVim(event.target.checked)} checked={vim} />\n </Box>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <TextField type=\"number\" label=\"Font size\" value={fontSize} onChange={onFontChange} />\n </Box>\n <br />\n <Button onClick={save}>Save</Button>\n </Modal>\n );\n}\n","export async function loadThemes(monaco: { editor: any }): Promise<void> {\n monaco.editor.defineTheme(\"monokai\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n background: \"272822\",\n token: \"\",\n },\n {\n foreground: \"75715e\",\n token: \"comment\",\n },\n {\n foreground: \"e6db74\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"ae81ff\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"ae81ff\",\n },\n {\n foreground: \"ae81ff\",\n token: \"function\",\n },\n {\n foreground: \"f92672\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"ae81ff\",\n },\n {\n token: \"ns\",\n foreground: \"97d92b\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"53d3e4\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"53d3e4\",\n },\n {\n token: \"this\",\n foreground: \"fd971f\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#F8F8F2\",\n \"editor.background\": \"#272822\",\n \"editor.selectionBackground\": \"#49483E\",\n \"editor.lineHighlightBackground\": \"#3E3D32\",\n \"editorCursor.foreground\": \"#F8F8F0\",\n \"editorWhitespace.foreground\": \"#3B3A32\",\n \"editorIndentGuide.activeBackground\": \"#9D550FB0\",\n \"editor.selectionHighlightBorder\": \"#222218\",\n },\n });\n\n monaco.editor.defineTheme(\"solarized-dark\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n background: \"002b36\",\n token: \"\",\n },\n {\n foreground: \"586e75\",\n token: \"comment\",\n },\n {\n foreground: \"00afaf\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"00afaf\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"268bd2\",\n },\n {\n foreground: \"268bd2\",\n token: \"function\",\n },\n {\n foreground: \"859900\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"cb4b16\",\n },\n {\n token: \"ns\",\n foreground: \"cb4b16\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"268bd2\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"268bd2\",\n },\n {\n token: \"type.identifier.js\",\n foreground: \"b58900\",\n },\n {\n token: \"delimiter.square.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"delimiter.bracket.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"this\",\n foreground: \"cb4b16\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#839496\",\n \"editor.background\": \"#002b36\",\n \"editor.selectionBackground\": \"#073642\",\n \"editor.lineHighlightBackground\": \"#073642\",\n \"editorCursor.foreground\": \"#819090\",\n \"editorWhitespace.foreground\": \"#073642\",\n \"editorIndentGuide.activeBackground\": \"#9D550FB0\",\n \"editor.selectionHighlightBorder\": \"#222218\",\n },\n });\n\n monaco.editor.defineTheme(\"solarized-light\", {\n base: \"vs\",\n inherit: true,\n rules: [\n {\n foreground: \"657b83\",\n background: \"fdf6e3\",\n token: \"\",\n },\n {\n foreground: \"586e75\",\n token: \"comment\",\n },\n {\n foreground: \"2aa198\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"2aa198\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"268bd2\",\n },\n {\n foreground: \"268bd2\",\n token: \"function\",\n },\n {\n foreground: \"859900\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"bc4b16\",\n },\n {\n token: \"ns\",\n foreground: \"cb4b16\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"268bd2\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"268bd2\",\n },\n {\n token: \"type.identifier.js\",\n foreground: \"b58900\",\n },\n {\n token: \"delimiter.square.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"delimiter.bracket.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"this\",\n foreground: \"cb4b16\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#657b83\",\n \"editor.background\": \"#fdf6e3\",\n \"editor.selectionBackground\": \"#eee8d5\",\n \"editor.lineHighlightBackground\": \"#eee8d5\",\n \"editorCursor.foreground\": \"#657b83\",\n \"editorWhitespace.foreground\": \"#eee8d5\",\n \"editorIndentGuide.activeBackground\": \"#eee8d5\",\n \"editor.selectionHighlightBorder\": \"#073642\",\n },\n });\n\n monaco.editor.defineTheme(\"dracula\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n background: \"282A36\",\n foreground: \"F8F8F2\",\n token: \"\",\n },\n {\n foreground: \"6272A4\",\n token: \"comment\",\n },\n {\n foreground: \"F1FA8C\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"BD93F9\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"BD93F9\",\n },\n {\n foreground: \"FF79C6\",\n token: \"function\",\n },\n {\n foreground: \"FF79C6\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"FF79C6\",\n },\n {\n token: \"ns\",\n foreground: \"FFB86C\",\n fontStyle: \"italic\",\n \n },\n {\n token: \"netscriptfunction\",\n foreground: \"FF79C6\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"FF68A7\",\n },\n {\n token: \"type.identifier.js\",\n foreground: \"7EE9FD\",\n fontStyle: \"italic\"\n },\n {\n token: \"delimiter.square.js\",\n foreground: \"FFD709\",\n },\n {\n token: \"delimiter.parenthesis.js\",\n foreground: \"FFD709\"\n },\n {\n token: \"delimiter.bracket.js\",\n foreground: \"FFD709\",\n },\n {\n token: \"this\",\n foreground: \"BD93F9\",\n fontStyle: \"italic\",\n },\n ],\n \"colors\": {\n \"editor.foreground\": \"#F8F8F2\",\n \"editor.background\": \"#282A36\",\n \"editorLineNumber.foreground\": \"#6272A4\",\n \"editor.selectionBackground\": \"#44475A\",\n \"editor.selectionHighlightBackground\": \"#424450\",\n \"editor.foldBackground\": \"#21222C\",\n \"editor.wordHighlightBackground\": \"#8BE9FD50\",\n \"editor.wordHighlightStrongBackground\": \"#50FA7B50\",\n \"editor.findMatchBackground\": \"#FFB86C80\",\n \"editor.findMatchHighlightBackground\": \"#FFFFFF40\",\n \"editor.findRangeHighlightBackground\": \"#44475A75\",\n \"editor.hoverHighlightBackground\": \"#8BE9FD50\",\n \"editor.lineHighlightBorder\": \"#44475A\",\n \"editor.rangeHighlightBackground\": \"#BD93F915\",\n \"editor.snippetTabstopHighlightBackground\": \"#282A36\",\n \"editor.snippetTabstopHighlightBorder\": \"#6272A4\",\n \"editor.snippetFinalTabstopHighlightBackground\": \"#282A36\",\n \"editor.snippetFinalTabstopHighlightBorder\": \"#50FA7B\",\n },\n });\n\n monaco.editor.defineTheme(\"one-dark\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n token: \"\",\n background: \"333842\",\n foreground: \"ABB2BF\",\n },\n {\n token: \"comment\",\n foreground: \"5C6370\",\n },\n {\n token: \"string\",\n foreground: \"98C379\",\n },\n {\n token: \"number\",\n foreground: \"D19A66\",\n },\n {\n token: \"function\",\n foreground: \"C678DD\",\n },\n {\n token: \"keyword\",\n foreground: \"C678DD\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"D19A66\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"C678DD\",\n },\n {\n token: \"ns\",\n foreground: \"E06C75\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"61AFEF\",\n },\n {\n token: \"type.identifier\",\n foreground: \"E5C07B\",\n },\n {\n token: \"delimiter\",\n foreground: \"ABB2BF\",\n },\n {\n token: \"this\",\n foreground: \"E06C75\",\n },\n ],\n colors: {\n \"editor.background\": \"#282C34\",\n \"editor.foreground\": \"#ABB2BF\",\n \"editor.lineHighlightBackground\": \"#99BBFF0A\",\n \"editor.selectionBackground\": \"#3E4451\",\n \"editor.findMatchHighlightBackground\": \"#528BFF3D\",\n \"editorCursor.foreground\": \"#528BFF\",\n \"editorHoverWidget.background\": \"#21252B\",\n \"editorHoverWidget.border\": \"#181A1F\",\n \"editorIndentGuide.background\": \"#ABB2BF26\",\n \"editorIndentGuide.activeBackground\": \"#626772\",\n \"editorLineNumber.foreground\": \"#636D83\",\n \"editorLineNumber.activeForeground\": \"#ABB2BF\",\n \"editorSuggestWidget.background\": \"#21252B\",\n \"editorSuggestWidget.border\": \"#181A1F\",\n \"editorSuggestWidget.selectedBackground\": \"#2C313A\",\n \"editorWhitespace.foreground\": \"#ABB2BF26\",\n \"editorWidget.background\": \"#21252B\",\n \"editorWidget.border\": \"#3A3F4B\",\n \"input.background\": \"#1B1D23\",\n \"input.border\": \"#181A1F\",\n \"peekView.border\": \"#528BFF\",\n \"peekViewResult.background\": \"#21252B\",\n \"peekViewResult.selectionBackground\": \"#2C313A\",\n \"peekViewTitle.background\": \"#1B1D23\",\n \"peekViewEditor.background\": \"#1B1D23\",\n \"scrollbarSlider.background\": \"#4E566680\",\n \"scrollbarSlider.activeBackground\": \"#747D9180\",\n \"scrollbarSlider.hoverBackground\": \"#5A637580\",\n }\n });\n}\n","export default \"/**\\n * @public\\n */\\ntype FilenameOrPID = number | string;\\n\\n/**\\n * @public\\n */\\ninterface Player {\\n hacking: number;\\n hp: number;\\n max_hp: number;\\n strength: number;\\n defense: number;\\n dexterity: number;\\n agility: number;\\n charisma: number;\\n intelligence: number;\\n hacking_chance_mult: number;\\n hacking_speed_mult: number;\\n hacking_money_mult: number;\\n hacking_grow_mult: number;\\n hacking_exp: number;\\n strength_exp: number;\\n defense_exp: number;\\n dexterity_exp: number;\\n agility_exp: number;\\n charisma_exp: number;\\n hacking_mult: number;\\n strength_mult: number;\\n defense_mult: number;\\n dexterity_mult: number;\\n agility_mult: number;\\n charisma_mult: number;\\n hacking_exp_mult: number;\\n strength_exp_mult: number;\\n defense_exp_mult: number;\\n dexterity_exp_mult: number;\\n agility_exp_mult: number;\\n charisma_exp_mult: number;\\n company_rep_mult: number;\\n faction_rep_mult: number;\\n numPeopleKilled: number;\\n money: number;\\n city: string;\\n location: string;\\n companyName: string;\\n crime_money_mult: number;\\n crime_success_mult: number;\\n isWorking: boolean;\\n workType: string;\\n currentWorkFactionName: string;\\n currentWorkFactionDescription: string;\\n workHackExpGainRate: number;\\n workStrExpGainRate: number;\\n workDefExpGainRate: number;\\n workDexExpGainRate: number;\\n workAgiExpGainRate: number;\\n workChaExpGainRate: number;\\n workRepGainRate: number;\\n workMoneyGainRate: number;\\n workMoneyLossRate: number;\\n workHackExpGained: number;\\n workStrExpGained: number;\\n workDefExpGained: number;\\n workDexExpGained: number;\\n workAgiExpGained: number;\\n workChaExpGained: number;\\n workRepGained: number;\\n workMoneyGained: number;\\n createProgramName: string;\\n createProgramReqLvl: number;\\n className: string;\\n crimeType: string;\\n work_money_mult: number;\\n hacknet_node_money_mult: number;\\n hacknet_node_purchase_cost_mult: number;\\n hacknet_node_ram_cost_mult: number;\\n hacknet_node_core_cost_mult: number;\\n hacknet_node_level_cost_mult: number;\\n hasWseAccount: boolean;\\n hasTixApiAccess: boolean;\\n has4SData: boolean;\\n has4SDataTixApi: boolean;\\n bladeburner_max_stamina_mult: number;\\n bladeburner_stamina_gain_mult: number;\\n bladeburner_analysis_mult: number;\\n bladeburner_success_chance_mult: number;\\n bitNodeN: number;\\n totalPlaytime: number;\\n playtimeSinceLastAug: number;\\n playtimeSinceLastBitnode: number;\\n jobs: any;\\n factions: string[];\\n tor: boolean;\\n hasCorporation: boolean;\\n}\\n\\n/**\\n * @public\\n */\\ninterface RunningScript {\\n args: string[];\\n filename: string;\\n logs: string[];\\n offlineExpGained: number;\\n offlineMoneyMade: number;\\n offlineRunningTime: number;\\n onlineExpGained: number;\\n onlineMoneyMade: number;\\n onlineRunningTime: number;\\n pid: number;\\n ramUsage: number;\\n server: string;\\n threads: number;\\n}\\n\\n/**\\n * Data representing the internal values of a crime.\\n * @public\\n */\\nexport interface CrimeStats {\\n /** Number representing the difficulty of the crime. Used for success chance calculations */\\n difficulty: number;\\n /** Amount of karma lost for successfully committing this crime */\\n karma: number;\\n /** How many people die as a result of this crime */\\n kills: number;\\n /** How much money is given */\\n money: number;\\n /** Name of crime */\\n name: string;\\n /** Milliseconds it takes to attempt the crime */\\n time: number;\\n /** Description of the crime activity */\\n type: string;\\n /** hacking level impact on success change of the crime */\\n hacking_success_weight: number;\\n /** strength level impact on success change of the crime */\\n strength_success_weight: number;\\n /** defense level impact on success change of the crime */\\n defense_success_weight: number;\\n /** dexterity level impact on success change of the crime */\\n dexterity_success_weight: number;\\n /** agility level impact on success change of the crime */\\n agility_success_weight: number;\\n /** charisma level impact on success change of the crime */\\n charisma_success_weight: number;\\n /** hacking exp gained from crime */\\n hacking_exp: number;\\n /** strength exp gained from crime */\\n strength_exp: number;\\n /** defense exp gained from crime */\\n defense_exp: number;\\n /** dexterity exp gained from crime */\\n dexterity_exp: number;\\n /** agility exp gained from crime */\\n agility_exp: number;\\n /** charisma exp gained from crime */\\n charisma_exp: number;\\n /** intelligence exp gained from crime */\\n intelligence_exp: number;\\n}\\n\\n/**\\n * Data representing the internal values of an Augmentation.\\n * @public\\n */\\nexport interface AugmentationStats {\\n /** Multipler to hacking skill */\\n hacking_mult?: number;\\n /** Multipler to strength skill */\\n strength_mult?: number;\\n /** Multipler to defense skill */\\n defense_mult?: number;\\n /** Multipler to dexterity skill */\\n dexterity_mult?: number;\\n /** Multipler to agility skill */\\n agility_mult?: number;\\n /** Multipler to charisma skill */\\n charisma_mult?: number;\\n /** Multipler to hacking experience gain rate */\\n hacking_exp_mult?: number;\\n /** Multipler to strength experience gain rate */\\n strength_exp_mult?: number;\\n /** Multipler to defense experience gain rate */\\n defense_exp_mult?: number;\\n /** Multipler to dexterity experience gain rate */\\n dexterity_exp_mult?: number;\\n /** Multipler to agility experience gain rate */\\n agility_exp_mult?: number;\\n /** Multipler to charisma experience gain rate */\\n charisma_exp_mult?: number;\\n /** Multipler to chance of successfully performing a hack */\\n hacking_chance_mult?: number;\\n /** Multipler to hacking speed */\\n hacking_speed_mult?: number;\\n /** Multipler to amount of money the player gains from hacking */\\n hacking_money_mult?: number;\\n /** Multipler to amount of money injected into servers using grow */\\n hacking_grow_mult?: number;\\n /** Multipler to amount of reputation gained when working */\\n company_rep_mult?: number;\\n /** Multipler to amount of reputation gained when working */\\n faction_rep_mult?: number;\\n /** Multipler to amount of money gained from crimes */\\n crime_money_mult?: number;\\n /** Multipler to crime success rate */\\n crime_success_mult?: number;\\n /** Multipler to amount of money gained from working */\\n work_money_mult?: number;\\n /** Multipler to amount of money produced by Hacknet Nodes */\\n hacknet_node_money_mult?: number;\\n /** Multipler to cost of purchasing a Hacknet Node */\\n hacknet_node_purchase_cost_mult?: number;\\n /** Multipler to cost of ram for a Hacknet Node */\\n hacknet_node_ram_cost_mult?: number;\\n /** Multipler to cost of core for a Hacknet Node */\\n hacknet_node_core_cost_mult?: number;\\n /** Multipler to cost of leveling up a Hacknet Node */\\n hacknet_node_level_cost_mult?: number;\\n /** Multipler to Bladeburner max stamina */\\n bladeburner_max_stamina_mult?: number;\\n /** Multipler to Bladeburner stamina gain rate */\\n bladeburner_stamina_gain_mult?: number;\\n /** Multipler to effectiveness in Bladeburner Field Analysis */\\n bladeburner_analysis_mult?: number;\\n /** Multipler to success chance in Bladeburner contracts/operations */\\n bladeburner_success_chance_mult?: number;\\n}\\n\\n/**\\n * Options to affect the behavior of {@link NS.hack | hack}, {@link NS.grow | grow}, and {@link NS.weaken | weaken}.\\n * @public\\n */\\nexport interface BasicHGWOptions {\\n /** Number of threads to use for this function. Must be less than or equal to the number of threads the script is running with. */\\n threads?: number;\\n /** Set to true this action will affect the stock market. */\\n stock?: boolean;\\n}\\n\\n/**\\n * Options to affect the behavior of {@link CodingContract} attempt.\\n * @public\\n */\\nexport interface CodingAttemptOptions {\\n /** If truthy, then the function will return a string that states the contract’s reward when it is successfully solved. */\\n returnReward: boolean;\\n}\\n\\n/**\\n * Return value of {@link Sleeve.getSleevePurchasableAugs | getSleevePurchasableAugs}\\n * @public\\n */\\nexport interface AugmentPair {\\n /** augmentation name */\\n name: string;\\n /** augmentation cost */\\n cost: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport enum PositionTypes {\\n Long = \\\"L\\\",\\n Short = \\\"S\\\",\\n}\\n\\n/**\\n * @public\\n */\\nexport enum OrderTypes {\\n LimitBuy = \\\"Limit Buy Order\\\",\\n LimitSell = \\\"Limit Sell Order\\\",\\n StopBuy = \\\"Stop Buy Order\\\",\\n StopSell = \\\"Stop Sell Order\\\",\\n}\\n\\n/**\\n * Value in map of {@link StockOrder}\\n * @public\\n */\\nexport interface StockOrderObject {\\n /** Number of shares */\\n shares: number;\\n /** Price per share */\\n price: number;\\n /** Order type */\\n type: OrderTypes;\\n /** Order position */\\n position: PositionTypes;\\n}\\n\\n/**\\n * Return value of {@link TIX.getOrders | getOrders}\\n *\\n * Keys are stock symbols, properties are arrays of {@link StockOrderObject}\\n * @public\\n */\\nexport interface StockOrder {\\n [key: string]: StockOrderObject[];\\n}\\n\\n/**\\n * A single process on a server.\\n * @public\\n */\\nexport interface ProcessInfo {\\n /** Script name. */\\n filename: string;\\n /** Number of threads script is running with */\\n threads: number;\\n /** Script's arguments */\\n args: string[];\\n /** Process ID */\\n pid: number;\\n}\\n\\n/**\\n * Hack related multipliers.\\n * @public\\n */\\nexport interface HackingMultipliers {\\n /** Player's hacking chance multiplier. */\\n chance: number;\\n /** Player's hacking speed multiplier. */\\n speed: number;\\n /** Player's hacking money stolen multiplier. */\\n money: number;\\n /** Player's hacking growth multiplier */\\n growth: number;\\n}\\n\\n/**\\n * Hacknet related multipliers.\\n * @public\\n */\\nexport interface HacknetMultipliers {\\n /** Player's hacknet production multiplier */\\n production: number;\\n /** Player's hacknet purchase cost multiplier */\\n purchaseCost: number;\\n /** Player's hacknet ram cost multiplier */\\n ramCost: number;\\n /** Player's hacknet core cost multiplier */\\n coreCost: number;\\n /** Player's hacknet level cost multiplier */\\n levelCost: number;\\n}\\n\\n/**\\n * Hacknet node related constants\\n * @public\\n */\\nexport interface HacknetNodeConstants {\\n /** Amount of money gained per level */\\n MoneyGainPerLevel: number;\\n /** Base cost for a new node */\\n BaseCost: number;\\n /** Base cost per level */\\n LevelBaseCost: number;\\n /** Base cost to incrase RAM */\\n RamBaseCost: number;\\n /** Base cost to increase cores */\\n CoreBaseCost: number;\\n /** Multiplier to purchase new node */\\n PurchaseNextMult: number;\\n /** Multiplier to increase node level */\\n UpgradeLevelMult: number;\\n /** Multiplier to increase RAM */\\n UpgradeRamMult: number;\\n /** Multiplier to increase cores */\\n UpgradeCoreMult: number;\\n /** Max node level */\\n MaxLevel: number;\\n /** Max amount of RAM in GB */\\n MaxRam: number;\\n /** Max number of cores */\\n MaxCores: number;\\n}\\n\\n/**\\n * Hacknet server related constants\\n * @public\\n */\\nexport interface HacknetServerConstants {\\n /** Number of hashes calculated per level */\\n HashesPerLevel: number;\\n /** Base cost for a new server */\\n BaseCost: number;\\n /** Base cost to increase RAM */\\n RamBaseCost: number;\\n /** Base cost to increase cores */\\n CoreBaseCost: number;\\n /** Base cost to upgrade cache */\\n CacheBaseCost: number;\\n /** Multiplier to purchase a new server */\\n PurchaseMult: number;\\n /** Multiplier to increase server level */\\n UpgradeLevelMult: number;\\n /** Multiplier to increase RAM */\\n UpgradeRamMult: number;\\n /** Multiplier to increase cores */\\n UpgradeCoreMult: number;\\n /** Multiplier to upgrade cache */\\n UpgradeCacheMult: number;\\n /** Max number of servers */\\n MaxServers: number;\\n /** Max level for a server */\\n MaxLevel: number;\\n /** Max amount of RAM in GB */\\n MaxRam: number;\\n /** Max number of cores */\\n MaxCores: number;\\n /** Max cache size */\\n MaxCache: number;\\n}\\n\\n/**\\n * A single server.\\n * @public\\n */\\nexport interface Server {\\n /**\\n * How many CPU cores this server has. Maximum of 8.\\n * Affects magnitude of grow and weaken.\\n */\\n cpuCores: number;\\n\\n /** Flag indicating whether the FTP port is open */\\n ftpPortOpen: boolean;\\n\\n /** Flag indicating whether player has admin/root access to this server */\\n hasAdminRights: boolean;\\n\\n /** Hostname. Must be unique */\\n hostname: string;\\n\\n /** Flag indicating whether HTTP Port is open */\\n httpPortOpen: boolean;\\n\\n /** IP Address. Must be unique */\\n ip: string;\\n\\n /** Flag indicating whether player is curently connected to this server */\\n isConnectedTo: boolean;\\n\\n /** RAM (GB) available on this server */\\n maxRam: number;\\n\\n /**\\n * Name of company/faction/etc. that this server belongs to.\\n * Optional, not applicable to all Servers\\n */\\n organizationName: string;\\n\\n /** RAM (GB) used. i.e. unavailable RAM */\\n ramUsed: number;\\n\\n /** Flag indicating whether SMTP Port is open */\\n smtpPortOpen: boolean;\\n\\n /** Flag indicating whether SQL Port is open */\\n sqlPortOpen: boolean;\\n\\n /** Flag indicating whether the SSH Port is open */\\n sshPortOpen: boolean;\\n\\n /** Flag indicating whether this is a purchased server */\\n purchasedByPlayer: boolean;\\n\\n /** Flag indicating whether this server has a backdoor installed by a player */\\n backdoorInstalled: boolean;\\n\\n /**\\n * Initial server security level\\n * (i.e. security level when the server was created)\\n */\\n baseDifficulty: number;\\n\\n /** Server Security Level */\\n hackDifficulty: number;\\n\\n /** Minimum server security level that this server can be weakened to */\\n minDifficulty: number;\\n\\n /** How much money currently resides on the server and can be hacked */\\n moneyAvailable: number;\\n\\n /** Maximum amount of money that this server can hold */\\n moneyMax: number;\\n\\n /** Number of open ports required in order to gain admin/root access */\\n numOpenPortsRequired: number;\\n\\n /** How many ports are currently opened on the server */\\n openPortCount: number;\\n\\n /** Hacking level required to hack this server */\\n requiredHackingSkill: number;\\n\\n /**\\n * Parameter that affects how effectively this server's money can\\n * be increased using the grow() Netscript function\\n */\\n serverGrowth: number;\\n}\\n\\n/**\\n * All multipliers affecting the difficulty of the current challenge.\\n * @public\\n */\\nexport interface BitNodeMultipliers {\\n /** Influences how quickly the player's agility level (not exp) scales */\\n AgilityLevelMultiplier: number;\\n /** Influences the base cost to purchase an augmentation. */\\n AugmentationMoneyCost: number;\\n /** Influences the base rep the player must have with a faction to purchase an augmentation. */\\n AugmentationRepCost: number;\\n /** Influences how quickly the player can gain rank within Bladeburner. */\\n BladeburnerRank: number;\\n /** Influences the cost of skill levels from Bladeburner. */\\n BladeburnerSkillCost: number;\\n /** Influences how quickly the player's charisma level (not exp) scales */\\n CharismaLevelMultiplier: number;\\n /** Influences the experience gained for each ability when a player completes a class. */\\n ClassGymExpGain: number;\\n /** Influences the amount of money gained from completing Coding Contracts */\\n CodingContractMoney: number;\\n /** Influences the experience gained for each ability when the player completes working their job. */\\n CompanyWorkExpGain: number;\\n /** Influences how much money the player earns when completing working their job. */\\n CompanyWorkMoney: number;\\n /** Influences the valuation of corporations created by the player. */\\n CorporationValuation: number;\\n /** Influences the base experience gained for each ability when the player commits a crime. */\\n CrimeExpGain: number;\\n /** Influences the base money gained when the player commits a crime. */\\n CrimeMoney: number;\\n /** Influences how many Augmentations you need in order to get invited to the Daedalus faction */\\n DaedalusAugsRequirement: number;\\n /** Influences how quickly the player's defense level (not exp) scales */\\n DefenseLevelMultiplier: number;\\n /** Influences how quickly the player's dexterity level (not exp) scales */\\n DexterityLevelMultiplier: number;\\n /** Influences how much rep the player gains in each faction simply by being a member. */\\n FactionPassiveRepGain: number;\\n /** Influences the experience gained for each ability when the player completes work for a Faction. */\\n FactionWorkExpGain: number;\\n /** Influences how much rep the player gains when performing work for a faction. */\\n FactionWorkRepGain: number;\\n /** Influences how much it costs to unlock the stock market's 4S Market Data API */\\n FourSigmaMarketDataApiCost: number;\\n /** Influences how much it costs to unlock the stock market's 4S Market Data (NOT API) */\\n FourSigmaMarketDataCost: number;\\n /** Influences the respect gain and money gain of your gang. */\\n GangSoftcap: number;\\n /** Influences the experienced gained when hacking a server. */\\n HackExpGain: number;\\n /** Influences how quickly the player's hacking level (not experience) scales */\\n HackingLevelMultiplier: number;\\n /** Influences how much money is produced by Hacknet Nodes and the hash rate of Hacknet Servers (unlocked in BitNode-9) */\\n HacknetNodeMoney: number;\\n /** Influences how much money it costs to upgrade your home computer's RAM */\\n HomeComputerRamCost: number;\\n /** Influences how much money is gained when the player infiltrates a company. */\\n InfiltrationMoney: number;\\n /** Influences how much rep the player can gain from factions when selling stolen documents and secrets */\\n InfiltrationRep: number;\\n /** Influences how much money can be stolen from a server when the player performs a hack against it through the Terminal. */\\n ManualHackMoney: number;\\n /** Influence how much it costs to purchase a server */\\n PurchasedServerCost: number;\\n /** Influences the maximum number of purchased servers you can have */\\n PurchasedServerLimit: number;\\n /** Influences the maximum allowed RAM for a purchased server */\\n PurchasedServerMaxRam: number;\\n /** Influences cost of any purchased server at or above 128GB */\\n PurchasedServerSoftCap: number;\\n /** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */\\n RepToDonateToFaction: number;\\n /** Influences how much the money on a server can be reduced when a script performs a hack against it. */\\n ScriptHackMoney: number;\\n /** Influences how much of the money stolen by a scripted hack will be added to the player's money. */\\n ScriptHackMoneyGain: number;\\n /** Influences the growth percentage per cycle against a server. */\\n ServerGrowthRate: number;\\n /** Influences the maxmimum money that a server can grow to. */\\n ServerMaxMoney: number;\\n /** Influences the initial money that a server starts with. */\\n ServerStartingMoney: number;\\n /** Influences the initial security level (hackDifficulty) of a server. */\\n ServerStartingSecurity: number;\\n /** Influences the weaken amount per invocation against a server. */\\n ServerWeakenRate: number;\\n /** Influences how quickly the player's strength level (not exp) scales */\\n StrengthLevelMultiplier: number;\\n /** Influences the power of the gift */\\n StaneksGiftPowerMultiplier: number;\\n /** Influences the size of the gift */\\n StaneksGiftExtraSize: number;\\n /** Influences the hacking skill required to backdoor the world daemon. */\\n WorldDaemonDifficulty: number;\\n}\\n\\n/**\\n * Object representing all the values related to a hacknet node.\\n * @public\\n */\\nexport interface NodeStats {\\n /** Node's name */\\n name: string;\\n /** Node's level */\\n level: number;\\n /** Node's RAM (GB) */\\n ram: number;\\n /** Node's used RAM (GB) */\\n ramUsed: number;\\n /** Node's number of cores */\\n cores: number;\\n /** Cache level. Only applicable for Hacknet Servers */\\n cache: number;\\n /** Hash Capacity provided by this Node. Only applicable for Hacknet Servers */\\n hashCapacity: number;\\n /** Node's production per second */\\n production: number;\\n /** Number of seconds since Node has been purchased */\\n timeOnline: number;\\n /** Total number of money Node has produced */\\n totalProduction: number;\\n}\\n\\n/**\\n * Short summary of the players skills.\\n * @public\\n */\\nexport interface PlayerSkills {\\n /** Hacking level */\\n hacking: number;\\n /** Strength level */\\n strength: number;\\n /** Defense level */\\n defense: number;\\n /** Dexterity level */\\n dexterity: number;\\n /** Agility level */\\n agility: number;\\n /** Chraisma level */\\n charisma: number;\\n /** Intelligence level */\\n intelligence: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface CharacterMult {\\n /** Agility stat */\\n agility: number;\\n /** Agility exp */\\n agilityExp: number;\\n /** Company reputation */\\n companyRep: number;\\n /** Money earned from crimes */\\n crimeMoney: number;\\n /** Crime success chance */\\n crimeSuccess: number;\\n /** Defense stat */\\n defense: number;\\n /** Defense exp */\\n defenseExp: number;\\n /** Dexterity stat */\\n dexterity: number;\\n /** Dexterity exp */\\n dexterityExp: number;\\n /** Faction reputation */\\n factionRep: number;\\n /** Hacking stat */\\n hacking: number;\\n /** Hacking exp */\\n hackingExp: number;\\n /** Strength stat */\\n strength: number;\\n /** Strength exp */\\n strengthExp: number;\\n /** Money earned from jobs */\\n workMoney: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface CharacterInfo {\\n /** Current BitNode number */\\n bitnode: number;\\n /** Name of city you are currently in */\\n city: string;\\n /** Array of factions you are currently a member of */\\n factions: string[];\\n /** Current health points */\\n hp: number;\\n /** Array of all companies at which you have jobs */\\n company: string[];\\n /** Array of job positions for all companies you are employed at. Same order as 'jobs' */\\n jobTitle: string[];\\n /** Maximum health points */\\n maxHp: number;\\n /** Boolean indicating whether or not you have a tor router */\\n tor: boolean;\\n /** Object with many of the player's multipliers from Augmentations/Source Files */\\n mult: CharacterMult;\\n /** Timed worked in ms */\\n timeWorked: number;\\n /** Hacking experience earned so far from work */\\n workHackExpGain: number;\\n /** Str experience earned so far from work */\\n workStrExpGain: number;\\n /** Def experience earned so far from work */\\n workDefExpGain: number;\\n /** Dex experience earned so far from work */\\n workDexExpGain: number;\\n /** Agi experience earned so far from work */\\n workAgiExpGain: number;\\n /** Cha experience earned so far from work */\\n workChaExpGain: number;\\n /** Reputation earned so far from work, if applicable */\\n workRepGain: number;\\n /** Money earned so far from work, if applicable */\\n workMoneyGain: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface SleeveWorkGains {\\n /** Hacking exp gained from work */\\n workHackExpGain: number;\\n /** Strength exp gained from work */\\n workStrExpGain: number;\\n /** Defense exp gained from work, */\\n workDefExpGain: number;\\n /** Dexterity exp gained from work */\\n workDexExpGain: number;\\n /** Agility exp gained from work */\\n workAgiExpGain: number;\\n /** Charisma exp gained from work */\\n workChaExpGain: number;\\n /** Money gained from work */\\n workMoneyGain: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface SourceFileLvl {\\n /** The number of the source file */\\n n: number;\\n /** The level of the source file */\\n lvl: number;\\n}\\n\\n/**\\n * Bladeburner current action.\\n * @public\\n */\\nexport interface BladeburnerCurAction {\\n /** Type of Action */\\n type: string;\\n /** Name of Action */\\n name: string;\\n}\\n\\n/**\\n * Gang general info.\\n * @public\\n */\\nexport interface GangGenInfo {\\n /** Name of faction that the gang belongs to (\\\"Slum Snakes\\\", etc.) */\\n faction: string;\\n /** Indicating whether or not it's a hacking gang */\\n isHacking: boolean;\\n /** Money earned per game cycle */\\n moneyGainRate: number;\\n /** Gang's power for territory warfare */\\n power: number;\\n /** Gang's respect */\\n respect: number;\\n /** Respect earned per game cycle */\\n respectGainRate: number;\\n /** Amount of territory held */\\n territory: number;\\n /** Clash chance */\\n territoryClashChance: number;\\n /** Gang's wanted level */\\n wantedLevel: number;\\n /** Wanted level gained/lost per game cycle (negative for losses) */\\n wantedLevelGainRate: number;\\n /** Indicating if territory warfare is enabled */\\n territoryWarfareEngaged: boolean;\\n /** Number indicating the current wanted penalty */\\n wantedPenalty: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangOtherInfoObject {\\n /** Gang power */\\n power: number;\\n /** Gang territory, in decimal form */\\n territory: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangOtherInfo {\\n \\\"Slum Snakes\\\": GangOtherInfoObject;\\n Tetrads: GangOtherInfoObject;\\n \\\"The Syndicate\\\": GangOtherInfoObject;\\n \\\"The Dark Army\\\": GangOtherInfoObject;\\n \\\"Speakers for the Dead\\\": GangOtherInfoObject;\\n NiteSec: GangOtherInfoObject;\\n \\\"The Black Hand\\\": GangOtherInfoObject;\\n}\\n\\n/**\\n * Object representing data representing a gang member task.\\n * @public\\n */\\nexport interface GangTaskStats {\\n /** Task name */\\n name: string;\\n /** Task Description */\\n desc: string;\\n /** Is a task of a hacking gang */\\n isHacking: boolean;\\n /** Is a task of a combat gang */\\n isCombat: boolean;\\n /** Base respect earned */\\n baseRespect: number;\\n /** Base wanted earned */\\n baseWanted: number;\\n /** Base money earned */\\n baseMoney: number;\\n /** Hacking skill impact on task scaling */\\n hackWeight: number;\\n /** Stength skill impact on task scaling */\\n strWeight: number;\\n /** Defense skill impact on task scaling */\\n defWeight: number;\\n /** Dexterity skill impact on task scaling */\\n dexWeight: number;\\n /** Agility skill impact on task scaling */\\n agiWeight: number;\\n /** Charisma skill impact on task scaling */\\n chaWeight: number;\\n /** Number representing the difficulty of the task */\\n difficulty: number;\\n /** Territory impact on task scaling */\\n territory: GangTerritory;\\n}\\n\\n/**\\n * Object representing data representing a gang member equipment.\\n * @public\\n */\\nexport interface EquipmentStats {\\n /** Strength multiplier */\\n str?: number;\\n /** Defense multiplier */\\n def?: number;\\n /** Dexterity multiplier */\\n dex?: number;\\n /** Agility multiplier */\\n agi?: number;\\n /** Charisma multiplier */\\n cha?: number;\\n /** Hacking multiplier */\\n hack?: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangTerritory {\\n /** Money gain impact on task scaling */\\n money: number;\\n /** Respect gain impact on task scaling */\\n respect: number;\\n /** Wanted gain impact on task scaling */\\n wanted: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangMemberInfo {\\n name: string;\\n task: string;\\n earnedRespect: number;\\n hack: number;\\n str: number;\\n def: number;\\n dex: number;\\n agi: number;\\n cha: number;\\n\\n hack_exp: number;\\n str_exp: number;\\n def_exp: number;\\n dex_exp: number;\\n agi_exp: number;\\n cha_exp: number;\\n\\n hack_mult: number;\\n str_mult: number;\\n def_mult: number;\\n dex_mult: number;\\n agi_mult: number;\\n cha_mult: number;\\n\\n hack_asc_mult: number;\\n str_asc_mult: number;\\n def_asc_mult: number;\\n dex_asc_mult: number;\\n agi_asc_mult: number;\\n cha_asc_mult: number;\\n\\n hack_asc_points: number;\\n str_asc_points: number;\\n def_asc_points: number;\\n dex_asc_points: number;\\n agi_asc_points: number;\\n cha_asc_points: number;\\n\\n upgrades: string[];\\n augmentations: string[];\\n\\n respectGain: number;\\n wantedLevelGain: number;\\n moneyGain: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangMemberAscension {\\n /** Amount of respect lost from ascending */\\n respect: number;\\n /** Hacking multiplier gained from ascending */\\n hack: number;\\n /** Strength multiplier gained from ascending */\\n str: number;\\n /** Defense multiplier gained from ascending */\\n def: number;\\n /** Dexterity multiplier gained from ascending */\\n dex: number;\\n /** Agility multiplier gained from ascending */\\n agi: number;\\n /** Charisma multiplier gained from ascending */\\n cha: number;\\n}\\n\\n/**\\n * Object representing a sleeve stats.\\n * @public\\n */\\nexport interface SleeveSkills {\\n /** Current shock of the sleeve [0-100] */\\n shock: number;\\n /** Current sync of the sleeve [0-100] */\\n sync: number;\\n /** Current hacking skill of the sleeve */\\n hacking: number;\\n /** Current strength of the sleeve */\\n strength: number;\\n /** Current defense of the sleeve */\\n defense: number;\\n /** Current dexterity of the sleeve */\\n dexterity: number;\\n /** Current agility of the sleeve */\\n agility: number;\\n /** Current charisma of the sleeve */\\n charisma: number;\\n}\\n\\n/**\\n * Object representing sleeve information.\\n * @public\\n */\\nexport interface SleeveInformation {\\n /** Location of the sleeve */\\n city: string;\\n /** Current hp of the sleeve */\\n hp: number;\\n /** Max hp of the sleeve */\\n maxHp: number;\\n /** Jobs available to the sleeve */\\n jobs: string[];\\n /** Job titles available to the sleeve */\\n jobTitle: string[];\\n /** Does this sleeve have access to the tor router */\\n tor: boolean;\\n /** Sleeve multipliers */\\n mult: CharacterMult;\\n /** Time spent on the current task in milliseconds */\\n timeWorked: number;\\n /** Earnings synchronized to other sleeves */\\n earningsForSleeves: SleeveWorkGains;\\n /** Earnings synchronized to the player */\\n earningsForPlayer: SleeveWorkGains;\\n /** Earnings for this sleeve */\\n earningsForTask: SleeveWorkGains;\\n /** Faction or company reputation gained for the current task */\\n workRepGain: number;\\n}\\n\\n/**\\n * Object representing a sleeve current task.\\n * @public\\n */\\nexport interface SleeveTask {\\n /** Task type */\\n task: string;\\n /** Crime currently attempting, if any */\\n crime: string;\\n /** Location of the task, if any */\\n location: string;\\n /** Stat being trained at the gym, if any */\\n gymStatType: string;\\n /** Faction work type being performed, if any */\\n factionWorkType: string;\\n}\\n\\n/**\\n * Object representing a port. A port is a serialized queue.\\n * @public\\n */\\nexport interface NetscriptPort {\\n /**\\n * Write data to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns The data popped off the queue if it was full.\\n */\\n write(value: string | number): null | string | number;\\n\\n /**\\n * Attempt to write data to the port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns True if the data was added to the port, false if the port was full\\n */\\n tryWrite(value: string | number): boolean;\\n\\n /**\\n * Shift an element out of the port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function will remove the first element from the port and return it.\\n * If the port is empty, then the string “NULL PORT DATA” will be returned.\\n * @returns the data read.\\n */\\n read(): string | number;\\n\\n /**\\n * Retrieve the first element from the port without removing it.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to peek at the data from a port. It returns the\\n * first element in the specified port without removing that element. If\\n * the port is empty, the string “NULL PORT DATA” will be returned.\\n * @returns the data read\\n */\\n peek(): string | number;\\n\\n /**\\n * Check if the port is full.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns true if the port is full, otherwise false\\n */\\n full(): boolean;\\n\\n /**\\n * Check if the port is empty.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns true if the port is empty, otherwise false\\n */\\n empty(): boolean;\\n\\n /**\\n * Empties all data from the port.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clear(): void;\\n}\\n\\n/**\\n * Stock market API\\n * @public\\n */\\nexport interface TIX {\\n /**\\n * Returns an array of the symbols of the tradable stocks\\n *\\n * @remarks RAM cost: 2 GB\\n * @returns Array of the symbols of the tradable stocks.\\n */\\n getSymbols(): string[];\\n\\n /**\\n * Returns the price of a stock\\n *\\n * @remarks\\n * RAM cost: 2 GB\\n * The stock’s price is the average of its bid and ask price.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * stock.getPrice(\\\"FISG\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.stock.getPrice(\\\"FISG\\\");\\n * ```\\n * @param sym - Stock symbol.\\n * @returns The price of a stock.\\n */\\n getPrice(sym: string): number;\\n\\n /**\\n * Returns the ask price of that stock.\\n * @remarks RAM cost: 2 GB\\n *\\n * @param sym - Stock symbol.\\n * @returns The ask price of a stock.\\n */\\n getAskPrice(sym: string): number;\\n\\n /**\\n * Returns the bid price of that stock.\\n * @remarks RAM cost: 2 GB\\n *\\n * @param sym - Stock symbol.\\n * @returns The bid price of a stock.\\n */\\n getBidPrice(sym: string): number;\\n\\n /**\\n * Returns the player’s position in a stock.\\n * @remarks\\n * RAM cost: 2 GB\\n * Returns an array of four elements that represents the player’s position in a stock.\\n *\\n * The first element is the returned array is the number of shares the player owns of\\n * the stock in the Long position. The second element in the array is the average price\\n * of the player’s shares in the Long position.\\n *\\n * The third element in the array is the number of shares the player owns of the stock\\n * in the Short position. The fourth element in the array is the average price of the\\n * player’s Short position.\\n *\\n * All elements in the returned array are numeric.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * var pos = stock.getPosition(\\\"ECP\\\");\\n * var shares = pos[0];\\n * var avgPx = pos[1];\\n * var sharesShort = pos[2];\\n * var avgPxShort = pos[3];\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * const [shares, avgPx, sharesShort, avgPxShort] = ns.stock.getPosition(\\\"ECP\\\");\\n * ```\\n * @param sym - Stock symbol.\\n * @returns Array of four elements that represents the player’s position in a stock.\\n */\\n getPosition(sym: string): [number, number, number, number];\\n\\n /**\\n * Returns the maximum number of shares of a stock.\\n * @remarks\\n * RAM cost: 2 GB\\n * This is the maximum amount of the stock that can be purchased\\n * in both the Long and Short positions combined.\\n *\\n * @param sym - Stock symbol.\\n * @returns Maximum number of shares that the stock has.\\n */\\n getMaxShares(sym: string): number;\\n\\n /**\\n * Calculates cost of buying stocks.\\n * @remarks\\n * RAM cost: 2 GB\\n * Calculates and returns how much it would cost to buy a given number of shares of a stock.\\n * This takes into account spread, large transactions influencing the price of the stock and commission fees.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to purchase.\\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\\n * @returns Cost to buy a given number of shares of a stock.\\n */\\n getPurchaseCost(sym: string, shares: number, posType: string): number;\\n\\n /**\\n * Calculate profit of selling stocks.\\n * @remarks\\n * RAM cost: 2 GB\\n * Calculates and returns how much you would gain from selling a given number of shares of a stock.\\n * This takes into account spread, large transactions influencing the price of the stock and commission fees.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell.\\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\\n * @returns Gain from selling a given number of shares of a stock.\\n */\\n getSaleGain(sym: string, shares: number, posType: string): number;\\n\\n /**\\n * Buy stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to purchase shares of a stock using a Market Order.\\n *\\n * If the player does not have enough money to purchase the specified number of shares,\\n * then no shares will be purchased. Remember that every transaction on the stock exchange\\n * costs a certain commission fee.\\n *\\n * If this function successfully purchases the shares, it will return the stock price at which\\n * each share was purchased. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\\n */\\n buy(sym: string, shares: number): number;\\n\\n /**\\n * Sell stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to sell shares of a stock using a Market Order.\\n *\\n * If the specified number of shares in the function exceeds the amount that the player\\n * actually owns, then this function will sell all owned shares. Remember that every\\n * transaction on the stock exchange costs a certain commission fee.\\n *\\n * The net profit made from selling stocks with this function is reflected in the script’s\\n * statistics. This net profit is calculated as:\\n *\\n * shares * (sell_price - average_price_of_purchased_shares)\\n *\\n * If the sale is successful, this function will return the stock price at\\n * which each share was sold. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\\n */\\n sell(sym: string, shares: number): number;\\n\\n /**\\n * Short stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to purchase a short position of a stock using a Market Order.\\n *\\n * The ability to short a stock is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * If the player does not have enough money to purchase the specified number of shares,\\n * then no shares will be purchased. Remember that every transaction on the stock exchange\\n * costs a certain commission fee.\\n *\\n * If the purchase is successful, this function will return the stock price at which each\\n * share was purchased. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to short. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\\n */\\n short(sym: string, shares: number): number;\\n\\n /**\\n * Sell short stock.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to sell a short position of a stock using a Market Order.\\n *\\n * The ability to short a stock is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * If the specified number of shares exceeds the amount that the player actually owns,\\n * then this function will sell all owned shares. Remember that every transaction on\\n * the stock exchange costs a certain commission fee.\\n *\\n * If the sale is successful, this function will return the stock price at which each\\n * share was sold. Otherwise it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\\n */\\n sellShort(sym: string, shares: number): number;\\n\\n /**\\n * Place order for stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Places an order on the stock market. This function only works for Limit and Stop Orders.\\n *\\n * The ability to place limit and stop orders is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * Returns true if the order is successfully placed, and false otherwise.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\\n * @param price - Execution price for the order.\\n * @param type - Type of order.\\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\\n * @returns True if the order is successfully placed, and false otherwise.\\n */\\n placeOrder(sym: string, shares: number, price: number, type: string, pos: string): boolean;\\n\\n /**\\n * Cancel order for stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Cancels an oustanding Limit or Stop order on the stock market.\\n *\\n * The ability to use limit and stop orders is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\\n * @param price - Execution price for the order.\\n * @param type - Type of order.\\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\\n */\\n cancelOrder(sym: string, shares: number, price: number, type: string, pos: string): void;\\n\\n /**\\n * Returns your order book for the stock market.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * This is an object containing information for all the Limit and Stop Orders you have in the stock market.\\n * For each symbol you have a position in, the returned object will have a key with that symbol's name.\\n * The object's properties are each an array of {@link StockOrderObject}\\n * The object has the following structure:\\n *\\n * ```ts\\n * {\\n * string1: [ // Array of orders for this stock\\n * {\\n * shares: Order quantity\\n * price: Order price\\n * type: Order type\\n * position: Either \\\"L\\\" or \\\"S\\\" for Long or Short position\\n * },\\n * {\\n * ...\\n * },\\n * ...\\n * ],\\n * string2: [ // Array of orders for this stock\\n * ...\\n * ],\\n * ...\\n * }\\n * ```\\n * The “Order type” property can have one of the following four values: \\\"Limit Buy Order\\\", \\\"Limit Sell Order\\\", \\\"Stop Buy Order\\\", \\\"Stop Sell Order\\\".\\n * Note that the order book will only contain information for stocks that you actually have orders in.\\n *\\n * @example\\n * ```ts\\n * \\\"If you do not have orders in Nova Medical (NVMD), then the returned object will not have a “NVMD” property.\\\"\\n * {\\n * ECP: [\\n * {\\n * shares: 5,\\n * price: 100,000\\n * type: \\\"Stop Buy Order\\\",\\n * position: \\\"S\\\",\\n * },\\n * {\\n * shares: 25,\\n * price: 125,000\\n * type: \\\"Limit Sell Order\\\",\\n * position: \\\"L\\\",\\n * },\\n * ],\\n * SYSC: [\\n * {\\n * shares: 100,\\n * price: 10,000\\n * type: \\\"Limit Buy Order\\\",\\n * position: \\\"L\\\",\\n * },\\n * ],\\n * }\\n * ```\\n * @returns Object containing information for all the Limit and Stop Orders you have in the stock market.\\n */\\n getOrders(): StockOrder;\\n\\n /**\\n * Returns the volatility of the specified stock.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Volatility represents the maximum percentage by which a stock’s price can change every tick.\\n * The volatility is returned as a decimal value, NOT a percentage\\n * (e.g. if a stock has a volatility of 3%, then this function will return 0.03, NOT 3).\\n *\\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\\n *\\n * @param sym - Stock symbol.\\n * @returns Volatility of the specified stock.\\n */\\n getVolatility(sym: string): number;\\n\\n /**\\n * Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * The probability is returned as a decimal value, NOT a percentage\\n * (e.g. if a stock has a 60% chance of increasing, then this function will return 0.6, NOT 60).\\n *\\n * In other words, if this function returned 0.30 for a stock, then this means that the stock’s price has a\\n * 30% chance of increasing and a 70% chance of decreasing during the next tick.\\n *\\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\\n *\\n * @param sym - Stock symbol.\\n * @returns Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\\n */\\n getForecast(sym: string): number;\\n\\n /**\\n * Purchase 4S Market Data Access.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchase4SMarketData(): boolean;\\n\\n /**\\n * Purchase 4S Market Data TIX API Access.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchase4SMarketDataTixApi(): boolean;\\n}\\n\\n/**\\n * Singularity API\\n * @remarks\\n * This API requires Source-File 4 to use. The RAM cost of all these functions is multiplied by 16/4/1 based on Source-File 4 levels.\\n * @public\\n */\\nexport interface Singularity {\\n /**\\n * Take university class.\\n *\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start taking a course at a university.\\n * If you are already in the middle of some “working” action (such as working at a\\n * company, for a faction, or on a program), then running this function will automatically\\n * cancel that action and give you your earnings.\\n *\\n * The cost and experience gains for all of these universities and classes are the same as\\n * if you were to manually visit and take these classes.\\n *\\n * @param universityName - Name of university. You must be in the correct city for whatever university you specify.\\n * @param courseName - Name of course.\\n * @param focus - Acquire player focus on this class. Optional. Defaults to true.\\n * @returns True if actions is successfully started, false otherwise.\\n */\\n universityCourse(universityName: string, courseName: string, focus?: boolean): boolean;\\n\\n /**\\n * Workout at the gym.\\n *\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n\\n * This function will automatically set you to start working out at a gym to train\\n * a particular stat. If you are already in the middle of some “working” action\\n * (such as working at a company, for a faction, or on a program), then running\\n * this function will automatically cancel that action and give you your earnings.\\n *\\n * The cost and experience gains for all of these gyms are the same as if you were\\n * to manually visit these gyms and train\\n *\\n * @param gymName - Name of gym. You must be in the correct city for whatever gym you specify.\\n * @param stat - The stat you want to train.\\n * @param focus - Acquire player focus on this gym workout. Optional. Defaults to true.\\n * @returns True if actions is successfully started, false otherwise.\\n */\\n gymWorkout(gymName: string, stat: string, focus?: boolean): boolean;\\n\\n /**\\n * Travel to another city.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows the player to travel to any city. The cost for using this\\n * function is the same as the cost for traveling through the Travel Agency.\\n *\\n * @param city - City to travel to.\\n * @returns True if actions is successful, false otherwise.\\n */\\n travelToCity(city: string): boolean;\\n\\n /**\\n * Purchase the TOR router.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows you to automatically purchase a TOR router. The cost for\\n * purchasing a TOR router using this function is the same as if you were to\\n * manually purchase one.\\n *\\n * @returns True if actions is successful, false otherwise.\\n */\\n purchaseTor(): boolean;\\n\\n /**\\n * Purchase a program from the dark web.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows you to automatically purchase programs. You MUST have a\\n * TOR router in order to use this function. The cost of purchasing programs\\n * using this function is the same as if you were purchasing them through the Dark\\n * Web using the Terminal buy command.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * purchaseProgram(\\\"brutessh.exe\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.purchaseProgram(\\\"brutessh.exe\\\");\\n * ```\\n * @param programName - Name of program to purchase.\\n * @returns True if the specified program is purchased, and false otherwise.\\n */\\n purchaseProgram(programName: string): boolean;\\n\\n /**\\n * Check if the player is busy.\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * Returns a boolean indicating whether or not the player is currently performing an\\n * ‘action’. These actions include working for a company/faction, studying at a univeristy,\\n * working out at a gym, creating a program, committing a crime, or carrying out a Hacking Mission.\\n *\\n * @returns True if the player is currently performing an ‘action’, false otherwise.\\n */\\n isBusy(): boolean;\\n\\n /**\\n * Stop the current action.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function is used to end whatever ‘action’ the player is currently performing.\\n * The player will receive whatever money/experience/etc. he has earned from that action.\\n *\\n * The actions that can be stopped with this function are:\\n *\\n * * Studying at a university\\n * * Working for a company/faction\\n * * Creating a program\\n * * Committing a Crime\\n *\\n * This function will return true if the player’s action was ended.\\n * It will return false if the player was not performing an action when this function was called.\\n *\\n * @returns True if the player’s action was ended, false if the player was not performing an action.\\n */\\n stopAction(): boolean;\\n\\n /**\\n * Upgrade home computer RAM.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will upgrade amount of RAM on the player’s home computer. The cost is\\n * the same as if you were to do it manually.\\n *\\n * This function will return true if the player’s home computer RAM is successfully upgraded, and false otherwise.\\n *\\n * @returns True if the player’s home computer RAM is successfully upgraded, and false otherwise.\\n */\\n upgradeHomeRam(): boolean;\\n\\n /**\\n * Upgrade home computer cores.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will upgrade amount of cores on the player’s home computer. The cost is\\n * the same as if you were to do it manually.\\n *\\n * This function will return true if the player’s home computer cores is successfully upgraded, and false otherwise.\\n *\\n * @returns True if the player’s home computer cores is successfully upgraded, and false otherwise.\\n */\\n upgradeHomeCores(): boolean;\\n\\n /**\\n * Get the price of upgrading home RAM.\\n * @remarks\\n * RAM cost: 1.5 GB * 16/4/1\\n *\\n *\\n * Returns the cost of upgrading the player’s home computer RAM.\\n *\\n * @returns Cost of upgrading the player’s home computer RAM.\\n */\\n getUpgradeHomeRamCost(): number;\\n\\n /**\\n * Get the price of upgrading home cores.\\n * @remarks\\n * RAM cost: 1.5 GB * 16/4/1\\n *\\n *\\n * Returns the cost of upgrading the player’s home computer cores.\\n *\\n * @returns Cost of upgrading the player’s home computer cores.\\n */\\n getUpgradeHomeCoresCost(): number;\\n\\n /**\\n * Work for a company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working at the company\\n * at which you are employed. If you are already in the middle of some “working”\\n * action (such as working for a faction, training at a gym, or creating a program),\\n * then running this function will automatically cancel that action and give you\\n * your earnings.\\n *\\n * This function will return true if the player starts working, and false otherwise.\\n *\\n * Note that when you are working for a company, you will not actually receive your earnings (reputation, money, experience) until you FINISH the action.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //If you only want to work until you get 100,000 company reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (getCompanyRep(COMPANY HERE) < VALUE) {\\n * workForCompany();\\n * sleep(60000);\\n * }\\n * //This way, your company reputation will be updated every minute.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //If you only want to work until you get 100,000 company reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (ns.getCompanyRep(COMPANY HERE) < VALUE) {\\n * ns.workForCompany();\\n * await ns.sleep(60000);\\n * }\\n * //This way, your company reputation will be updated every minute.\\n * ```\\n * @param companyName - Name of company to work for. Must be an exact match. Optional. If not specified, this argument defaults to the last job that you worked\\n * @param focus - Acquire player focus on this work operation. Optional. Defaults to true.\\n * @returns True if the player starts working, and false otherwise.\\n */\\n workForCompany(companyName?: string, focus?: boolean): boolean;\\n\\n /**\\n * Apply for a job at a company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically try to apply to the specified company\\n * for a position in the specified field. This function can also be used to\\n * apply for promotions by specifying the company and field you are already\\n * employed at.\\n *\\n * This function will return true if you successfully get a job/promotion,\\n * and false otherwise. Note that if you are trying to use this function to\\n * apply for a promotion and you don’t get one, it will return false.\\n *\\n * @param companyName - Name of company to apply to.\\n * @param field - Field to which you want to apply.\\n * @returns True if the player successfully get a job/promotion, and false otherwise.\\n */\\n applyToCompany(companyName: string, field: string): boolean;\\n\\n /**\\n * Get company reputation.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of reputation you have at the specified company.\\n * If the company passed in as an argument is invalid, -1 will be returned.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of reputation you have at the specified company.\\n */\\n getCompanyRep(companyName: string): number;\\n\\n /**\\n * Get company favor.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of favor you have at the specified company.\\n * If the company passed in as an argument is invalid, -1 will be returned.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of favor you have at the specified company.\\n */\\n getCompanyFavor(companyName: string): number;\\n\\n /**\\n * Get company favor gain.\\n * @remarks\\n * RAM cost: 0.75 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of favor you will gain for the specified\\n * company when you reset by installing Augmentations.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of favor you gain at the specified company when you reset by installing Augmentations.\\n */\\n getCompanyFavorGain(companyName: string): number;\\n\\n /**\\n * List all current faction invitations.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * Returns an array with the name of all Factions you currently have oustanding invitations from.\\n *\\n * @returns Array with the name of all Factions you currently have oustanding invitations from.\\n */\\n checkFactionInvitations(): string[];\\n\\n /**\\n * Join a faction.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically accept an invitation from a faction and join it.\\n *\\n * @param faction - Name of faction to join.\\n * @returns True if player joined the faction, and false otherwise.\\n */\\n joinFaction(faction: string): boolean;\\n\\n /**\\n * Work for a faction.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working for the specified faction.\\n * Obviously, you must be a member of the faction or else this function will fail. If\\n * you are already in the middle of some “working” action (such as working for a company,\\n * training at a gym, or creating a program), then running this function will automatically\\n * cancel that action and give you your earnings.\\n *\\n * This function will return true if you successfully start working for the specified faction, and false otherwise.\\n *\\n * Note that when you are working for a faction, you will not actually receive your earnings (reputation, experience) until you FINISH the action.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //If you only want to work until you get 100,000 faction reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (getFactionRep(FACTION NAME) < VALUE) {\\n * workForFaction(FACNAME, WORKTYPE);\\n * sleep(60000);\\n * }\\n * //This way, your faction reputation will be updated every minute.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //If you only want to work until you get 100,000 faction reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (ns.getFactionRep(FACTION NAME) < VALUE) {\\n * ns.workForFaction(FACNAME, WORKTYPE);\\n * await ns.sleep(60000);\\n * }\\n * //This way, your faction reputation will be updated every minute.\\n * ```\\n * @param faction - Name of faction to work for.\\n * @param workType - Type of work to perform for the faction.\\n * @param focus - Acquire player focus on this work operation. Optional. Defaults to true.\\n * @returns True if the player starts working, and false otherwise.\\n */\\n workForFaction(faction: string, workType: string, focus?: boolean): boolean;\\n\\n /**\\n * Get faction reputation.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of reputation you have for the specified faction.\\n *\\n * @param faction - Name of faction to work for.\\n * @returns Amount of reputation you have for the specified faction.\\n */\\n getFactionRep(faction: string): number;\\n\\n /**\\n * Get faction favor.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of favor you have for the specified faction.\\n *\\n * @param faction - Name of faction.\\n * @returns Amount of favor you have for the specified faction.\\n */\\n getFactionFavor(faction: string): number;\\n\\n /**\\n * Get faction favor gain.\\n * @remarks\\n * RAM cost: 0.75 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of favor you will gain for the specified\\n * faction when you reset by installing Augmentations.\\n *\\n * @param faction - Name of faction.\\n * @returns Amount of favor you will gain for the specified faction when you reset by installing Augmentations.\\n */\\n getFactionFavorGain(faction: string): number;\\n\\n /**\\n * Donate to a faction.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Attempts to donate money to the specified faction in exchange for reputation.\\n * Returns true if you successfully donate the money, and false otherwise.\\n *\\n * @param faction - Name of faction to donate to.\\n * @param amount - Amount of money to donate.\\n * @returns True if the money was donated, and false otherwise.\\n */\\n donateToFaction(faction: string, amount: number): boolean;\\n\\n /**\\n * Create a program.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working on creating the\\n * specified program. If you are already in the middle of some “working” action\\n * (such as working for a company, training at a gym, or taking a course), then\\n * running this function will automatically cancel that action and give you your\\n * earnings.\\n *\\n * This function returns true if you successfully start working on the specified program, and false otherwise.\\n *\\n * Note that creating a program using this function has the same hacking level requirements as it normally would. These level requirements are:\\n * * BruteSSH.exe: 50\\n * * FTPCrack.exe: 100\\n * * relaySMTP.exe: 250\\n * * HTTPWorm.exe: 500\\n * * SQLInject.exe: 750\\n * * DeepscanV1.exe: 75\\n * * DeepscanV2.exe: 400\\n * * ServerProfiler.exe: 75\\n * * AutoLink.exe: 25\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * createProgram(“relaysmtp.exe”);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.createProgram(“relaysmtp.exe”);\\n * ```\\n * @param program - Name of program to create.\\n * @param focus - Acquire player focus on this program creation. Optional. Defaults to true.\\n * @returns True if you successfully start working on the specified program, and false otherwise.\\n */\\n createProgram(program: string, focus?: boolean): boolean;\\n\\n /**\\n * Commit a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function is used to automatically attempt to commit crimes.\\n * If you are already in the middle of some ‘working’ action (such\\n * as working for a company or training at a gym), then running this\\n * function will automatically cancel that action and give you your\\n * earnings.\\n *\\n * This function returns the number of milliseconds it takes to attempt the\\n * specified crime (e.g It takes 60 seconds to attempt the ‘Rob Store’ crime,\\n * so running `commitCrime('rob store')` will return 60,000).\\n *\\n * Warning: I do not recommend using the time returned from this function to try\\n * and schedule your crime attempts. Instead, I would use the isBusy Singularity\\n * function to check whether you have finished attempting a crime. This is because\\n * although the game sets a certain crime to be X amount of seconds, there is no\\n * guarantee that your browser will follow that time limit.\\n *\\n * @param crime - Name of crime to attempt.\\n * @returns The number of milliseconds it takes to attempt the specified crime.\\n */\\n commitCrime(crime: string): number;\\n\\n /**\\n * Get chance to successfully commit a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns your chance of success at commiting the specified crime.\\n *\\n * @param crime - Name of crime.\\n * @returns Chance of success at commiting the specified crime.\\n */\\n getCrimeChance(crime: string): number;\\n\\n /**\\n * Get stats related to a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Returns the stats of the crime.\\n *\\n * @param crime - Name of crime. Not case-sensitive\\n * @returns The stats of the crime.\\n */\\n getCrimeStats(crime: string): CrimeStats;\\n\\n /**\\n * Get a list of owned augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array containing the names (as strings) of all Augmentations you have.\\n *\\n * @param purchased - Specifies whether the returned array should include Augmentations you have purchased but not yet installed. By default, this argument is false which means that the return value will NOT have the purchased Augmentations.\\n * @returns Array containing the names (as strings) of all Augmentations you have.\\n */\\n getOwnedAugmentations(purchased?: boolean): string[];\\n\\n /**\\n * Get a list of augmentation available from a faction.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Returns an array containing the names (as strings) of all Augmentations\\n * that are available from the specified faction.\\n *\\n * @param faction - Name of faction.\\n * @returns Array containing the names of all Augmentations.\\n */\\n getAugmentationsFromFaction(faction: string): string[];\\n\\n /**\\n * Get the pre-requisite of an augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array with the names of the prerequisite Augmentation(s) for the specified Augmentation.\\n * If there are no prerequisites, a blank array is returned.\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Array with the names of the prerequisite Augmentation(s) for the specified Augmentation.\\n */\\n getAugmentationPrereq(augName: string): string[];\\n\\n /**\\n * Get the price and reputation of an augmentation.\\n * @deprecated use getAugmentationPrice getAugmentationRepCost\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array with two elements that gives the cost for\\n * the specified Augmentation. The first element in the returned array is the\\n * reputation requirement of the Augmentation, and the second element is the\\n * money cost.\\n *\\n * If an invalid Augmentation name is passed in for the augName argument, this\\n * function will return the array [-1, -1].\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Array with first element as a reputation requirement and second element as the money cost.\\n */\\n getAugmentationCost(augName: string): [number, number];\\n\\n /**\\n * Get price of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Price of the augmentation.\\n */\\n getAugmentationPrice(augName: string): number;\\n\\n /**\\n * Get reputation requirement of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Reputation requirement of the augmentation.\\n */\\n getAugmentationRepReq(augName: string): number;\\n\\n /**\\n * Purchase an augmentation\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will try to purchase the specified Augmentation through the given Faction.\\n *\\n * This function will return true if the Augmentation is successfully purchased, and false otherwise.\\n *\\n * @param faction - Name of faction to purchase Augmentation from.\\n * @param augmentation - Name of Augmentation to purchase.\\n * @returns True if the Augmentation is successfully purchased, and false otherwise.\\n */\\n purchaseAugmentation(faction: string, augmentation: string): boolean;\\n\\n /**\\n * Get the stats of an augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns augmentation stats.\\n *\\n * @param name - Name of Augmentation. CASE-SENSITIVE.\\n * @returns Augmentation stats.\\n */\\n getAugmentationStats(name: string): AugmentationStats;\\n\\n /**\\n * Install your purchased augmentations.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will automatically install your Augmentations, resetting the game as usual.\\n *\\n * @param cbScript - This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.\\n */\\n installAugmentations(cbScript?: string): void;\\n\\n /**\\n * Returns an object with the Player’s stats.\\n * @deprecated use getPlayer\\n *\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * @example\\n * ```ts\\n * res = getStats();\\n * print('My charisma level is: ' + res.charisma);\\n * ```\\n * @returns Object with the Player’s stats.\\n */\\n getStats(): PlayerSkills;\\n\\n /**\\n * Returns an object with various information about your character.\\n * @deprecated use getPlayer\\n *\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * @returns Object with various information about your character.\\n */\\n getCharacterInformation(): CharacterInfo;\\n\\n /**\\n * Hospitalize the player.\\n * @remarks\\n * RAM cost: 0.25 GB * 16/4/1\\n *\\n *\\n * @returns The cost of the hospitalization.\\n */\\n hospitalize(): number;\\n\\n /**\\n * Soft reset the game.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will perform a reset even if you don’t have any augmentation installed.\\n *\\n * @param cbScript - This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.\\n */\\n softReset(cbScript: string): void;\\n\\n /**\\n * Go to a location.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Move the player to a specific location.\\n *\\n * @param locationName - Name of the location.\\n * @returns True if the player was moved there, false otherwise.\\n */\\n goToLocation(locationName: string): boolean;\\n\\n /**\\n * Get the current server.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Name of the current server.\\n */\\n getCurrentServer(): string;\\n\\n /**\\n * Connect to a server.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * Run the connect HOSTNAME command in the terminal. Can only connect to neighbors.\\n *\\n * @returns True if the connect command was successful, false otherwise.\\n */\\n connect(hostname: string): boolean;\\n\\n /**\\n * Run the hack command in the terminal.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Amount of money stolen by manual hacking.\\n */\\n manualHack(): Promise<number>;\\n\\n /**\\n * Run the backdoor command in the terminal.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Promise waiting for the installation to finish.\\n */\\n installBackdoor(): Promise<void>;\\n\\n /**\\n * Check if the player is focused.\\n * @remarks\\n * RAM cost: 0.1 GB * 16/4/1\\n *\\n *\\n * @returns True if the player is focused.\\n */\\n isFocused(): boolean;\\n\\n /**\\n * Set the players focus.\\n * @remarks\\n * RAM cost: 0.1 GB * 16/4/1\\n *\\n * @returns True if the focus was changed.\\n */\\n setFocus(focus: boolean): boolean;\\n}\\n\\n/**\\n * Hacknet API\\n * @remarks\\n * Not all these functions are immediately available.\\n * @public\\n */\\nexport interface Hacknet {\\n /**\\n * Get the number of hacknet nodes you own.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the number of Hacknet Nodes you own.\\n *\\n * @returns number of hacknet nodes.\\n */\\n numNodes(): number;\\n\\n /**\\n * Get the maximum number of hacknet nodes.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns maximum number of hacknet nodes.\\n */\\n maxNumNodes(): number;\\n\\n /**\\n * Purchase a new hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Purchases a new Hacknet Node. Returns a number with the index of the\\n * Hacknet Node. This index is equivalent to the number at the end of\\n * the Hacknet Node’s name (e.g The Hacknet Node named `hacknet-node-4`\\n * will have an index of 4).\\n *\\n * If the player cannot afford to purchase a new Hacknet Node then the function will return -1.\\n *\\n * @returns The index of the Hacknet Node or if the player cannot afford to purchase a new Hacknet Node the function will return -1.\\n */\\n purchaseNode(): number;\\n\\n /**\\n * Get the price of the next hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of purchasing a new Hacknet Node.\\n *\\n * @returns Cost of purchasing a new Hacknet Node.\\n */\\n getPurchaseNodeCost(): number;\\n\\n /**\\n * Get the stats of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns an object containing a variety of stats about the specified Hacknet Node.\\n *\\n * Note that for Hacknet Nodes, production refers to the amount of money the node generates.\\n * For Hacknet Servers (the upgraded version of Hacknet Nodes), production refers to the\\n * amount of hashes the node generates.\\n *\\n * @param index - Index/Identifier of Hacknet Node\\n * @returns Object containing a variety of stats about the specified Hacknet Node.\\n */\\n getNodeStats(index: number): NodeStats;\\n\\n /**\\n * Upgrade the level of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to upgrade the level of the specified Hacknet Node by n.\\n *\\n * Returns true if the Hacknet Node’s level is successfully upgraded by n\\n * or if it is upgraded by some positive amount and the Node reaches its max level.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of levels to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s level is successfully upgraded, false otherwise.\\n */\\n upgradeLevel(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the RAM of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to upgrade the specified Hacknet Node’s RAM n times.\\n * Note that each upgrade doubles the Node’s RAM.\\n * So this is equivalent to multiplying the Node’s RAM by 2 n.\\n *\\n * Returns true if the Hacknet Node’s RAM is successfully upgraded n times\\n * or if it is upgraded some positive number of times and the Node reaches it max RAM.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s ram is successfully upgraded, false otherwise.\\n */\\n upgradeRam(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the core of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to purchase n cores for the specified Hacknet Node.\\n *\\n * Returns true if it successfully purchases n cores for the Hacknet Node\\n * or if it purchases some positive amount and the Node reaches its max number of cores.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of cores to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s cores are successfully purchased, false otherwise.\\n */\\n upgradeCore(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the cache of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Tries to upgrade the specified Hacknet Server’s cache n times.\\n *\\n * Returns true if it successfully upgrades the Server’s cache n times,\\n * or if it purchases some positive amount and the Server reaches its max cache level.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of cache levels to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s cores are successfully purchased, false otherwise.\\n */\\n upgradeCache(index: number, n: number): boolean;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node levels.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the specified Hacknet Node by n levels.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of levels to upgrade. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node.\\n */\\n getLevelUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node RAM.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the RAM of the specified Hacknet Node n times.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's ram.\\n */\\n getRamUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node cores.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the number of cores of the specified Hacknet Node by n.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade cores. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's number of cores.\\n */\\n getCoreUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node cache.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the cost of upgrading the cache level of the specified Hacknet Server by n.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade cache. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's cache.\\n */\\n getCacheUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Get the total number of hashes stored.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes you have.\\n *\\n * @returns Number of hashes you have.\\n */\\n numHashes(): number;\\n\\n /**\\n * Get the maximum number of hashes you can store.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes you can store.\\n *\\n * @returns Number of hashes you can store.\\n */\\n hashCapacity(): number;\\n\\n /**\\n * Get the cost of a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes required for the specified upgrade. The name of the upgrade must be an exact match.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var upgradeName = \\\"Sell for Corporation Funds\\\";\\n * if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {\\n * hacknet.spendHashes(upgName);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const upgradeName = \\\"Sell for Corporation Funds\\\";\\n * if (ns.hacknet.numHashes() > ns.hacknet.hashCost(upgradeName)) {\\n * ns.hacknet.spendHashes(upgName);\\n * }\\n * ```\\n * @param upgName - Name of the upgrade of Hacknet Node.\\n * @returns Number of hashes required for the specified upgrade.\\n */\\n hashCost(upgName: string): number;\\n\\n /**\\n * Purchase a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Spend the hashes generated by your Hacknet Servers on an upgrade.\\n * Returns a boolean value - true if the upgrade is successfully purchased, and false otherwise.\\n *\\n * The name of the upgrade must be an exact match.\\n * The `upgTarget` argument is used for upgrades such as `Reduce Minimum Security`, which applies to a specific server.\\n * In this case, the `upgTarget` argument must be the hostname of the server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * hacknet.spendHashes(\\\"Sell for Corporation Funds\\\");\\n * hacknet.spendHashes(\\\"Increase Maximum Money\\\", \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * NS2:\\n * ns.hacknet.spendHashes(\\\"Sell for Corporation Funds\\\");\\n * ns.hacknet.spendHashes(\\\"Increase Maximum Money\\\", \\\"foodnstuff\\\");\\n * ```\\n * @param upgName - Name of the upgrade of Hacknet Node.\\n * @param upgTarget - Object to which upgrade applies. Required for certain upgrades.\\n * @returns True if the upgrade is successfully purchased, and false otherwise..\\n */\\n spendHashes(upgName: string, upgTarget?: string): boolean;\\n\\n /**\\n * Get the list of hash upgrades\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the list of all available hash upgrades that can be used in the spendHashes function.\\n * @example\\n * ```ts\\n * // NS1:\\n * var upgrades = hacknet.getHashUpgrades(); // [\\\"Sell for Money\\\",\\\"Sell for Corporation Funds\\\",...]\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const upgrades = ns.hacknet.getHashUpgrades(); // [\\\"Sell for Money\\\",\\\"Sell for Corporation Funds\\\",...]\\n * ```\\n * @returns An array containing the available upgrades\\n */\\n getHashUpgrades(): string[];\\n\\n /**\\n * Get the level of a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Level of the upgrade.\\n */\\n getHashUpgradeLevel(upgName: string): number;\\n\\n /**\\n * Get the multipler to study.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Multiplier.\\n */\\n getStudyMult(): number;\\n\\n /**\\n * Get the multipler to training.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Multiplier.\\n */\\n getTrainingMult(): number;\\n}\\n\\n/**\\n * Bladeburner API\\n * @remarks\\n * You have to be employed in the Bladeburner division and be in BitNode-7\\n * or have Source-File 7 in order to use this API.\\n * @public\\n */\\nexport interface Bladeburner {\\n /**\\n * List all contracts.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner contracts.\\n *\\n * @returns Array of strings containing the names of all Bladeburner contracts.\\n */\\n getContractNames(): string[];\\n\\n /**\\n * List all operations.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner operations.\\n *\\n * @returns Array of strings containing the names of all Bladeburner operations.\\n */\\n getOperationNames(): string[];\\n\\n /**\\n * List all black ops.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner Black Ops.\\n *\\n * @returns Array of strings containing the names of all Bladeburner Black Ops.\\n */\\n getBlackOpNames(): string[];\\n\\n /**\\n * List all general actions.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all general Bladeburner actions.\\n *\\n * @returns Array of strings containing the names of all general Bladeburner actions.\\n */\\n getGeneralActionNames(): string[];\\n\\n /**\\n * List all skills.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all general Bladeburner skills.\\n *\\n * @returns Array of strings containing the names of all general Bladeburner skills.\\n */\\n getSkillNames(): string[];\\n\\n /**\\n * Start an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to start the specified Bladeburner action.\\n * Returns true if the action was started successfully, and false otherwise.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match\\n * @returns True if the action was started successfully, and false otherwise.\\n */\\n startAction(type: string, name: string): boolean;\\n\\n /**\\n * Stop current action.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Stops the current Bladeburner action.\\n *\\n */\\n stopBladeburnerAction(): void;\\n\\n /**\\n * Get current action.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns an object that represents the player’s current Bladeburner action.\\n * If the player is not performing an action, the function will return an object with the ‘type’ property set to “Idle”.\\n *\\n * @returns Object that represents the player’s current Bladeburner action.\\n */\\n getCurrentAction(): BladeburnerCurAction;\\n\\n /**\\n * Get the time to complete an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of seconds it takes to complete the specified action\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Number of milliseconds it takes to complete the specified action.\\n */\\n getActionTime(type: string, name: string): number;\\n\\n /**\\n * Get estimate success chance of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated success chance for the specified action.\\n * This chance is returned as a decimal value, NOT a percentage\\n * (e.g. if you have an estimated success chance of 80%, then this function will return 0.80, NOT 80).\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Estimated success chance for the specified action.\\n */\\n getActionEstimatedSuccessChance(type: string, name: string): [number, number];\\n\\n /**\\n * Get the reputation gain of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the average Bladeburner reputation gain for successfully\\n * completing the specified action.\\n * Note that this value is an ‘average’ and the real reputation gain may vary slightly from this value.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param level - Optional action level at which to calculate the gain\\n * @returns Average Bladeburner reputation gain for successfully completing the specified action.\\n */\\n getActionRepGain(type: string, name: string, level: number): number;\\n\\n /**\\n * Get action count remaining.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the remaining count of the specified action.\\n *\\n * Note that this is meant to be used for Contracts and Operations.\\n * This function will return ‘Infinity’ for actions such as Training and Field Analysis.\\n * This function will return 1 for BlackOps not yet completed regardless of wether\\n * the player has the required rank to attempt the mission or not.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Remaining count of the specified action.\\n */\\n getActionCountRemaining(type: string, name: string): number;\\n\\n /**\\n * Get the maximum level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the maximum level for this action.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Maximum level of the specified action.\\n */\\n getActionMaxLevel(type: string, name: string): number;\\n\\n /**\\n * Get the current level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the current level of this action.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Current level of the specified action.\\n */\\n getActionCurrentLevel(type: string, name: string): number;\\n\\n /**\\n * Get wether an action is set to autolevel.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action is currently set to autolevel.\\n *\\n * Returns false if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns True if the action is set to autolevel, and false otherwise.\\n */\\n getActionAutolevel(type: string, name: string): boolean;\\n\\n /**\\n * Set an action autolevel.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Enable/disable autoleveling for the specified action.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param autoLevel - Whether or not to autolevel this action\\n */\\n setActionAutolevel(type: string, name: string, autoLevel: boolean): void;\\n\\n /**\\n * Set the level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Set the level for the specified action.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param level - Level to set this action to.\\n */\\n setActionLevel(type: string, name: string, level: number): void;\\n\\n /**\\n * Get player bladeburner rank.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the player’s Bladeburner Rank.\\n *\\n * @returns Player’s Bladeburner Rank.\\n */\\n getRank(): number;\\n\\n /**\\n * Get black op required rank.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Returns the rank required to complete this BlackOp.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param name - Name of BlackOp. Must be an exact match.\\n * @returns Rank required to complete this BlackOp.\\n */\\n getBlackOpRank(name: string): number;\\n\\n /**\\n * Get bladeburner skill points.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of Bladeburner skill points you have.\\n *\\n * @returns Number of Bladeburner skill points you have.\\n */\\n getSkillPoints(): number;\\n\\n /**\\n * Get skill level.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * This function returns your level in the specified skill.\\n *\\n * The function returns -1 if an invalid skill name is passed in.\\n *\\n * @param skillName - Name of skill. Case-sensitive and must be an exact match\\n * @returns Level in the specified skill.\\n */\\n getSkillLevel(name: string): number;\\n\\n /**\\n * Get cost to upgrade skill.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * This function returns the number of skill points needed to upgrade the specified skill.\\n *\\n * The function returns -1 if an invalid skill name is passed in.\\n *\\n * @param skillName - Name of skill. Case-sensitive and must be an exact match\\n * @returns Number of skill points needed to upgrade the specified skill.\\n */\\n getSkillUpgradeCost(name: string): number;\\n\\n /**\\n * Upgrade skill.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to upgrade the specified Bladeburner skill.\\n *\\n * Returns true if the skill is successfully upgraded, and false otherwise.\\n *\\n * @param skillName - Name of skill to be upgraded. Case-sensitive and must be an exact match\\n * @returns true if the skill is successfully upgraded, and false otherwise.\\n */\\n upgradeSkill(name: string): boolean;\\n\\n /**\\n * Get team size.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of Bladeburner team members you have assigned to the specified action.\\n *\\n * Setting a team is only applicable for Operations and BlackOps. This function will return 0 for other action types.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Number of Bladeburner team members that were assigned to the specified action.\\n */\\n getTeamSize(type: string, name: string): number;\\n\\n /**\\n * Set team size.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Set the team size for the specified Bladeburner action.\\n *\\n * Returns the team size that was set, or -1 if the function failed.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param size - Number of team members to set. Will be converted using Math.round().\\n * @returns Number of Bladeburner team members you assigned to the specified action.\\n */\\n setTeamSize(type: string, name: string, size: number): number;\\n\\n /**\\n * Get estimated population in city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated number of Synthoids in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Estimated number of Synthoids in the specified city.\\n */\\n getCityEstimatedPopulation(name: string): number;\\n\\n /**\\n * Get number of communities in a city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated number of Synthoid communities in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Number of Synthoids communities in the specified city.\\n */\\n getCityCommunities(name: string): number;\\n\\n /**\\n * Get chaos of a city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the chaos in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Chaos in the specified city.\\n */\\n getCityChaos(name: string): number;\\n\\n /**\\n * Get current city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the city that the player is currently in (for Bladeburner).\\n *\\n * @returns City that the player is currently in (for Bladeburner).\\n */\\n getCity(): string;\\n\\n /**\\n * Travel to another city in bladeburner.\\n * @remarks\\n * RAM cost: 4 GB\\n * Attempts to switch to the specified city (for Bladeburner only).\\n *\\n * Returns true if successful, and false otherwise\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns true if successful, and false otherwise\\n */\\n switchCity(name: string): boolean;\\n\\n /**\\n * Get bladeburner stamina.\\n * @remarks\\n * RAM cost: 4 GB\\n * Returns an array with two elements:\\n * * [Current stamina, Max stamina]\\n * @example\\n * ```ts\\n * // NS1:\\n * function getStaminaPercentage() {\\n * var res = bladeburner.getStamina();\\n * return res[0] / res[1];\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * function getStaminaPercentage() {\\n * const [current, max] = ns.bladeburner.getStamina();\\n * return current / max;\\n * }\\n * ```\\n * @returns Array containing current stamina and max stamina.\\n */\\n getStamina(): [number, number];\\n\\n /**\\n * Join the bladeburner faction.\\n * @remarks\\n * RAM cost: 4 GB\\n * Attempts to join the Bladeburner faction.\\n *\\n * Returns true if you successfully join the Bladeburner faction, or if you are already a member.\\n *\\n * Returns false otherwise.\\n *\\n * @returns True if you successfully join the Bladeburner faction, or if you are already a member, false otherwise.\\n */\\n joinBladeburnerFaction(): boolean;\\n\\n /**\\n * Join the bladeburner division.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to join the Bladeburner division.\\n *\\n * Returns true if you successfully join the Bladeburner division, or if you are already a member.\\n *\\n * Returns false otherwise.\\n *\\n * @returns True if you successfully join the Bladeburner division, or if you are already a member, false otherwise.\\n */\\n joinBladeburnerDivision(): boolean;\\n\\n /**\\n * Get bladeburner bonus time.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the amount of accumulated “bonus time” (seconds) for the Bladeburner mechanic.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster, up to 5x the normal speed.\\n * For example, if an action takes 30 seconds to complete but you’ve accumulated over\\n * 30 seconds in bonus time, then the action will only take 6 seconds in real life to complete.\\n *\\n * @returns Amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechanic.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * Coding Contract API\\n * @public\\n */\\nexport interface CodingContract {\\n /**\\n * Attemps a coding contract.\\n * @remarks\\n * RAM cost: 10 GB\\n *\\n * Attempts to solve the Coding Contract with the provided solution.\\n *\\n * @param answer - Solution for the contract.\\n * @param fn - Filename of the contract.\\n * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns True if the solution was correct, false otherwise. If the returnReward option is configured, then the function will instead return a string. If the contract is successfully solved, the string will contain a description of the contract’s reward. Otherwise, it will be an empty string.\\n */\\n attempt(answer: string[] | number, filename: string, host?: string, opts?: CodingAttemptOptions): boolean | string;\\n\\n /**\\n * Get the type of a coding contract.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Returns a name describing the type of problem posed by the Coding Contract.\\n * (e.g. Find Largest Prime Factor, Total Ways to Sum, etc.)\\n *\\n * @param fn - Filename of the contract.\\n * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns Name describing the type of problem posed by the Coding Contract.\\n */\\n getContractType(filename: string, host?: string): string;\\n\\n /**\\n * Get the description.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Get the full text description for the problem posed by the Coding Contract.\\n *\\n * @param fn - Filename of the contract.\\n * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns Contract’s text description.\\n */\\n getDescription(filename: string, host?: string): string;\\n\\n /**\\n * Get the input data.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Get the data associated with the specific Coding Contract.\\n * Note that this is not the same as the contract’s description.\\n * This is just the data that the contract wants you to act on in order to solve\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns The specified contract’s data, data type depends on contract type.;\\n */\\n getData(filename: string, host?: string): any;\\n\\n /**\\n * Get the number of attempt remaining.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the number of tries remaining on the contract before it self-destructs.\\n *\\n * @param fn - Filename of the contract.\\n * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns How many attempts are remaining for the contract;\\n */\\n getNumTriesRemaining(filename: string, host?: string): number;\\n}\\n\\n/**\\n * Gang API\\n * @remarks\\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this API.\\n * @public\\n */\\nexport interface Gang {\\n /**\\n * Create a gang.\\n * @remarks\\n * RAM cost: 1GB\\n *\\n * Create a gang with the specified faction.\\n * @returns True if the gang was created, false otherwise.\\n */\\n createGang(faction: string): boolean;\\n\\n /**\\n * Check if you're in a gang.\\n * @remarks\\n * RAM cost: 1GB\\n * @returns True if you're in a gang, false otherwise.\\n */\\n inGang(): boolean;\\n\\n /**\\n * List all gang members.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the names of all Gang members\\n *\\n * @returns Names of all Gang members.\\n */\\n getMemberNames(): string[];\\n\\n /**\\n * Get information about your gang.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get general information about the gang.\\n *\\n * @returns Object containing general information about the gang.\\n */\\n getGangInformation(): GangGenInfo;\\n\\n /**\\n * Get information about the other gangs.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get territory and power information about all gangs.\\n *\\n * @returns Object containing territory and power information about all gangs.\\n */\\n getOtherGangInformation(): GangOtherInfo;\\n\\n /**\\n * Get information about a specific gang member.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get stat and equipment-related information about a Gang Member\\n *\\n * @param name - Name of member.\\n * @returns Object containing stat and equipment-related information about a Gang Member.\\n */\\n getMemberInformation(name: string): GangMemberInfo;\\n\\n /**\\n * Check if you can recruit a new gang member.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns boolean indicating whether a member can currently be recruited\\n *\\n * @returns True if a member can currently be recruited, false otherwise.\\n */\\n canRecruitMember(): boolean;\\n\\n /**\\n * Recruit a new gang member.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Attempt to recruit a new gang member.\\n *\\n * Possible reasons for failure:\\n * * Cannot currently recruit a new member\\n * * There already exists a member with the specified name\\n *\\n * @param name - Name of member to recruit.\\n * @returns True if the member was successfully recruited, false otherwise.\\n */\\n recruitMember(name: string): boolean;\\n\\n /**\\n * List member task names.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the name of all valid tasks that Gang members can be assigned to.\\n *\\n * @returns All valid tasks that Gang members can be assigned to.\\n */\\n getTaskNames(): string[];\\n\\n /**\\n * Set gang member to task.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Attempts to assign the specified Gang Member to the specified task.\\n * If an invalid task is specified, the Gang member will be set to idle (“Unassigned”).\\n *\\n * @param memberName - Name of Gang member to assign.\\n * @param taskName - Task to assign.\\n * @returns True if the Gang Member was successfully assigned to the task, false otherwise.\\n */\\n setMemberTask(memberName: string, taskName: string): boolean;\\n\\n /**\\n * Get stats of a task.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the stats of a gang task stats. This is typically used to evaluate which action should be executed next.\\n *\\n * @param name - Name of the task.\\n * @returns Detailed stats of a task.\\n */\\n getTaskStats(name: string): GangTaskStats;\\n\\n /**\\n * List equipment names.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the name of all possible equipment/upgrades you can purchase for your Gang Members.\\n * This includes Augmentations.\\n *\\n * @returns Names of all Equipments/Augmentations.\\n */\\n getEquipmentNames(): string[];\\n\\n /**\\n * Get cost of equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the amount of money it takes to purchase a piece of Equipment or an Augmentation.\\n * If an invalid Equipment/Augmentation is specified, this function will return Infinity.\\n *\\n * @param equipName - Name of equipment.\\n * @returns Cost to purchase the specified Equipment/Augmentation (number). Infinity for invalid arguments\\n */\\n getEquipmentCost(equipName: string): number;\\n\\n /**\\n * Get type of an equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the specified equipment type.\\n *\\n * @param equipName - Name of equipment.\\n * @returns Type of the equipment.\\n */\\n getEquipmentType(equipName: string): string;\\n\\n /**\\n * Get stats of an equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the specified equipment stats.\\n *\\n * @param equipName - Name of equipment.\\n * @returns A dictionary containing the stats of the equipment.\\n */\\n getEquipmentStats(equipName: string): EquipmentStats;\\n\\n /**\\n * Purchase an equipment for a gang member.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempt to purchase the specified Equipment/Augmentation for the specified Gang member.\\n *\\n * @param memberName - Name of Gang member to purchase the equipment for.\\n * @param equipName - Name of Equipment/Augmentation to purchase.\\n * @returns True if the equipment was successfully purchased. False otherwise\\n */\\n purchaseEquipment(memberName: string, equipName: string): boolean;\\n\\n /**\\n * Ascend a gang member.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Ascend the specified Gang Member.\\n *\\n * @param memberName - Name of member to ascend.\\n * @returns Object with info about the ascension results. undefined if ascension did not occur.\\n */\\n ascendMember(memberName: string): GangMemberAscension | undefined;\\n\\n /**\\n * Get the result of an ascension without ascending.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the result of an ascension without ascending.\\n *\\n * @param memberName - Name of member.\\n * @returns Object with info about the ascension results. undefined if ascension is impossible.\\n */\\n getAscensionResult(memberName: string): GangMemberAscension | undefined;\\n\\n /**\\n * Enable/Disable territory warfare.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Set whether or not the gang should engage in territory warfare\\n *\\n * @param engage - Whether or not to engage in territory warfare.\\n */\\n setTerritoryWarfare(engage: boolean): void;\\n\\n /**\\n * Get chance to win clash with other gang.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the chance you have to win a clash with the specified gang. The chance is returned in decimal form, not percentage\\n *\\n * @param gangName - Target gang\\n * @returns Chance you have to win a clash with the specified gang.\\n */\\n getChanceToWinClash(gangName: string): number;\\n\\n /**\\n * Get bonus time.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the amount of accumulated “bonus time” (seconds) for the Gang mechanic.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster, up to 10x the normal speed.\\n *\\n * @returns Bonus time for the Gang mechanic in milliseconds.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * Sleeve API\\n * @remarks\\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this API.\\n * @public\\n */\\nexport interface Sleeve {\\n /**\\n * Get the number of sleeves you own.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return the number of duplicate sleeves the player has.\\n *\\n * @returns number of duplicate sleeves the player has.\\n */\\n getNumSleeves(): number;\\n\\n /**\\n * Get the stats of a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a structure containing the stats of the sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to get stats of.\\n * @returns Object containing the stats of the sleeve.\\n */\\n getSleeveStats(sleeveNumber: number): SleeveSkills;\\n\\n /**\\n * Get information about a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a struct containing tons of information about this sleeve\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve information.\\n * @returns Object containing tons of information about this sleeve.\\n */\\n getInformation(sleeveNumber: number): SleeveInformation;\\n\\n /**\\n * Get task of a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return the current task that the sleeve is performing. type is set to “Idle” if the sleeve isn’t doing anything.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve task from.\\n * @returns Object containing information the current task that the sleeve is performing.\\n */\\n getTask(sleeveNumber: number): SleeveTask;\\n\\n /**\\n * Set a sleeve to shock recovery.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start recovery.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToShockRecovery(sleeveNumber: number): boolean;\\n\\n /**\\n * Set a sleeve to synchronize.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start synchronizing.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToSynchronize(sleeveNumber: number): boolean;\\n\\n /**\\n * Set a sleeve to commit crime.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * Returns false if an invalid action is specified.\\n *\\n * @param sleeveNumber - Index of the sleeve to start commiting crime.\\n * @param name - Name of the crime. Must be an exact match.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToCommitCrime(sleeveNumber: number, name: string): boolean;\\n\\n /**\\n * Set a sleeve to work for a faction.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working or this faction.\\n *\\n * @param sleeveNumber - Index of the sleeve to work for the faction.\\n * @param factionName - Name of the faction to work for.\\n * @param factionWorkType - Name of the action to perform for this faction.\\n * @returns True if the sleeve started working on this faction, false otherwise.\\n */\\n setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean;\\n\\n /**\\n * Set a sleeve to work for a company.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working or this company.\\n *\\n * @param sleeveNumber - Index of the sleeve to work for the company.\\n * @param companyName - Name of the company to work for.\\n * @returns True if the sleeve started working on this company, false otherwise.\\n */\\n setToCompanyWork(sleeveNumber: number, companyName: string): boolean;\\n\\n /**\\n * Set a sleeve to take a class at a university.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start taking class.\\n * @param university - Name of the university to attend.\\n * @param className - Name of the class to follow.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToUniversityCourse(sleeveNumber: number, university: string, className: string): boolean;\\n\\n /**\\n * Set a sleeve to workout at the gym.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working out.\\n *\\n * @param sleeveNumber - Index of the sleeve to workout at the gym.\\n * @param gymName - Name of the gym.\\n * @param stat - Name of the stat to train.\\n * @returns True if the sleeve started working out, false otherwise.\\n */\\n setToGymWorkout(sleeveNumber: number, gymName: string, stat: string): boolean;\\n\\n /**\\n * Make a sleeve travel to another city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve reached destination.\\n *\\n * @param sleeveNumber - Index of the sleeve to travel.\\n * @param cityName - Name of the destination city.\\n * @returns True if the sleeve reached destination, false otherwise.\\n */\\n travel(sleeveNumber: number, cityName: string): boolean;\\n\\n /**\\n * Get augmentations installed on a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a list of augmentation names that this sleeve has installed.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve augmentations from.\\n * @returns List of augmentation names that this sleeve has installed.\\n */\\n getSleeveAugmentations(sleeveNumber: number): string[];\\n\\n /**\\n * List purchasable augs for a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a list of augmentations that the player can buy for this sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve purchasable augmentations from.\\n * @returns List of augmentations that the player can buy for this sleeve.\\n */\\n getSleevePurchasableAugs(sleeveNumber: number): AugmentPair[];\\n\\n /**\\n * Purchase an aug for a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return true if the aug was purchased and installed on the sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to buy an aug for.\\n * @param augName - Name of the aug to buy. Must be an exact match.\\n * @returns True if the aug was purchased and installed on the sleeve, false otherwise.\\n */\\n purchaseSleeveAug(sleeveNumber: number, augName: string): boolean;\\n}\\n\\n/**\\n * Skills formulas\\n * @public\\n */\\ninterface SkillsFormulas {\\n /**\\n * Calculate skill level.\\n * @param exp - experience for that skill\\n * @param skillMult - Multiplier for that skill, defaults to 1.\\n * @returns The calculated skill level.\\n */\\n calculateSkill(exp: number, skillMult?: number): number;\\n /**\\n * Calculate exp for skill level.\\n * @param skill - target skill level\\n * @param skillMult - Multiplier for that skill, defaults to 1.\\n * @returns The calculated exp required.\\n */\\n calculateExp(skill: number, skillMult?: number): number;\\n}\\n\\n/**\\n * Hacking formulas\\n * @public\\n */\\ninterface HackingFormulas {\\n /**\\n * Calculate hack chance.\\n * (Ex: 0.25 would indicate a 25% chance of success.)\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack chance.\\n */\\n hackChance(server: Server, player: Player): number;\\n /**\\n * Calculate hack exp for one thread.\\n * @remarks\\n * Multiply by thread to get total exp\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack exp.\\n */\\n hackExp(server: Server, player: Player): number;\\n /**\\n * Calculate hack percent for one thread.\\n * (Ex: 0.25 would steal 25% of the server's current value.)\\n * @remarks\\n * Multiply by thread to get total percent hacked.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack percent.\\n */\\n hackPercent(server: Server, player: Player): number;\\n /**\\n * Calculate the percent a server would grow to.\\n * (Ex: 3.0 would would grow the server to 300% of its current value.)\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param threads - Amount of thread.\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @param cores - Number of cores on the computer that will execute grow.\\n * @returns The calculated grow percent.\\n */\\n growPercent(server: Server, threads: number, player: Player, cores?: number): number;\\n /**\\n * Calculate hack time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack time.\\n */\\n hackTime(server: Server, player: Player): number;\\n /**\\n * Calculate grow time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated grow time.\\n */\\n growTime(server: Server, player: Player): number;\\n /**\\n * Calculate weaken time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated weaken time.\\n */\\n weakenTime(server: Server, player: Player): number;\\n}\\n\\n/**\\n * Hacknet Node formulas\\n * @public\\n */\\ninterface HacknetNodesFormulas {\\n /**\\n * Calculate money gain rate.\\n * @param level - level of the node.\\n * @param ram - ram of the node.\\n * @param cores - cores of the node.\\n * @param mult - player production mult (default to 1)\\n * @returns The calculated money gain rate.\\n */\\n moneyGainRate(level: number, ram: number, cores: number, mult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node level.\\n * @param startingLevel - starting level\\n * @param extraLevels - amount of level to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n levelUpgradeCost(startingLevel: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node ram.\\n * @param startingRam - starting ram\\n * @param extraLevels - amount of level of ram to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n ramUpgradeCost(startingRam: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node cores.\\n * @param startingCore - starting cores\\n * @param extraCores - amount of cores to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n coreUpgradeCost(startingCore: number, extraCores?: number, costMult?: number): number;\\n /**\\n * Calculate the cost of a hacknet node.\\n * @param n - number of the hacknet node\\n * @param mult - player cost reduction (defaults to 1)\\n * @returns The calculated cost.\\n */\\n hacknetNodeCost(n: number, mult: number): number;\\n /**\\n * All constants used by the game.\\n * @returns An object with all hacknet node constants used by the game.\\n */\\n constants(): HacknetNodeConstants;\\n}\\n\\n/**\\n * Hacknet Server formulas\\n * @public\\n */\\ninterface HacknetServersFormulas {\\n /**\\n * Calculate hash gain rate.\\n * @param level - level of the server.\\n * @param ramUsed - ramUsed of the server.\\n * @param maxRam - maxRam of the server.\\n * @param cores - cores of the server.\\n * @param mult - player production mult (default to 1)\\n * @returns The calculated hash gain rate.\\n */\\n hashGainRate(level: number, ramUsed: number, maxRam: number, cores: number, mult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server level.\\n * @param startingLevel - starting level\\n * @param extraLevels - amount of level to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n levelUpgradeCost(startingLevel: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server ram.\\n * @param startingRam - starting ram\\n * @param extraLevels - amount of level of ram to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n ramUpgradeCost(startingRam: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server cores.\\n * @param startingCore - starting cores\\n * @param extraCores - amount of cores to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n coreUpgradeCost(startingCore: number, extraCores?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server cache.\\n * @param startingCache - starting cache level\\n * @param extraCache - amount of levels of cache to purchase (defaults to 1)\\n * @returns The calculated cost.\\n */\\n cacheUpgradeCost(startingCache: number, extraCache?: number): number;\\n /**\\n * Calculate hash cost of an upgrade.\\n * @param upgName - name of the upgrade\\n * @param level - level of the upgrade\\n * @returns The calculated hash cost.\\n */\\n hashUpgradeCost(upgName: number, level: number): number;\\n /**\\n * Calculate the cost of a hacknet server.\\n * @param n - number of the hacknet server\\n * @param mult - player cost reduction (defaults to 1)\\n * @returns The calculated cost.\\n */\\n hacknetServerCost(n: number, mult?: number): number;\\n /**\\n * All constants used by the game.\\n * @returns An object with all hacknet server constants used by the game.\\n */\\n constants(): HacknetServerConstants;\\n}\\n\\n/**\\n * Gang formulas\\n * @public\\n */\\ninterface GangFormulas {\\n /**\\n * Calculate the wanted penalty.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @returns The calculated wanted penalty.\\n */\\n wantedPenalty(gang: GangGenInfo): number;\\n /**\\n * Calculate respect gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Gang info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Gang info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated respect gain.\\n */\\n respectGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n /**\\n * Calculate wanted gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Task info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated wanted gain.\\n */\\n wantedLevelGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n /**\\n * Calculate money gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Task info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated money gain.\\n */\\n moneyGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n\\n /**\\n * Calculate ascension point gain.\\n * @param exp - Experience point before ascension.\\n * @returns The calculated ascension point gain.\\n */\\n ascensionPointsGain(exp: number): number;\\n\\n /**\\n * Calculate ascension mult.\\n * @param points - Amount of ascension points.\\n * @returns The calculated ascension mult.\\n */\\n ascensionMultiplier(points: number): number;\\n}\\n\\n/**\\n * Formulas API\\n * @remarks\\n * You need Formulas.exe on your home computer to use this API.\\n * @public\\n */\\nexport interface Formulas {\\n /** Skills formulas */\\n skills: SkillsFormulas;\\n /** Hacking formulas */\\n hacking: HackingFormulas;\\n /** Hacknet Nodes formulas */\\n hacknetNodes: HacknetNodesFormulas;\\n /** Hacknet Servers formulas */\\n hacknetServers: HacknetServersFormulas;\\n /** Gang formulas */\\n gang: GangFormulas;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface Fragment {\\n id: number;\\n shape: boolean[][];\\n type: number;\\n power: number;\\n limit: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface ActiveFragment {\\n id: number;\\n avgCharge: number;\\n numCharge: number;\\n rotation: number;\\n x: number;\\n y: number;\\n}\\n\\n/**\\n * Stanek's Gift API.\\n * @public\\n */\\ninterface Stanek {\\n /**\\n * Stanek's Gift width.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @returns The width of the gift.\\n */\\n width(): number;\\n /**\\n * Stanek's Gift height.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @returns The height of the gift.\\n */\\n height(): number;\\n\\n /**\\n * Charge a fragment, increasing its power.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @param rootX - rootX Root X against which to align the top left of the fragment.\\n * @param rootY - rootY Root Y against which to align the top left of the fragment.\\n * @returns Promise that lasts until the charge action is over.\\n */\\n charge(rootX: number, rootY: number): Promise<void>;\\n\\n /**\\n * List possible fragments.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns List of possible fragments.\\n */\\n fragmentDefinitions(): Fragment[];\\n\\n /**\\n * List of fragments in Stanek's Gift.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @returns List of active fragments placed on Stanek's Gift.\\n */\\n activeFragments(): ActiveFragment[];\\n\\n /**\\n * Clear the board of all fragments.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clear(): void;\\n\\n /**\\n * Check if fragment can be placed at specified location.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * @param rootX - rootX Root X against which to align the top left of the fragment.\\n * @param rootY - rootY Root Y against which to align the top left of the fragment.\\n * @param rotation - rotation A number from 0 to 3, the mount of 90 degree turn to take.\\n * @param fragmentId - fragmentId ID of the fragment to place.\\n * @returns true if the fragment can be placed at that position. false otherwise.\\n */\\n canPlace(rootX: number, rootY: number, rotation: number, fragmentId: number): boolean;\\n /**\\n * Place fragment on Stanek's Gift.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @param rotation - A number from 0 to 3, the mount of 90 degree turn to take.\\n * @param fragmentId - ID of the fragment to place.\\n * @returns true if the fragment can be placed at that position. false otherwise.\\n */\\n place(rootX: number, rootY: number, rotation: number, fragmentId: number): boolean;\\n /**\\n * Get placed fragment at location.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @returns The fragment at [rootX, rootY], if any.\\n */\\n get(rootX: number, rootY: number): ActiveFragment | undefined;\\n\\n /**\\n * Remove fragment at location.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @returns The fragment at [rootX, rootY], if any.\\n */\\n remove(rootX: number, rootY: number): boolean;\\n}\\n\\n/**\\n * User Interface API.\\n * @public\\n */\\ninterface UserInterface {\\n /**\\n * Get the current theme\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An object containing the theme's colors\\n */\\n getTheme(): UserInterfaceTheme;\\n\\n /**\\n * Sets the current theme\\n * @remarks\\n * RAM cost: 0 GB\\n * @example\\n * Usage example (NS2)\\n * ```ts\\n * const theme = ns.ui.getTheme();\\n * theme.primary = '#ff5500';\\n * ns.ui.setTheme(theme);\\n * ```\\n */\\n setTheme(newTheme: UserInterfaceTheme): void;\\n\\n /**\\n * Resets the player's theme to the default values\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n resetTheme(): void;\\n\\n /**\\n * Get the current styles\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An object containing the player's styles\\n */\\n getStyles(): IStyleSettings;\\n\\n /**\\n * Sets the current styles\\n * @remarks\\n * RAM cost: 0 GB\\n * @example\\n * Usage example (NS2)\\n * ```ts\\n * const styles = ns.ui.getStyles();\\n * styles.fontFamily = 'Comic Sans Ms';\\n * ns.ui.setStyles(styles);\\n * ```\\n */\\n setStyles(newStyles: IStyleSettings): void;\\n\\n /**\\n * Resets the player's styles to the default values\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n resetStyles(): void;\\n\\n /**\\n * Gets the current game information (version, commit, ...)\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n getGameInfo(): GameInfo;\\n}\\n\\n/**\\n * Collection of all functions passed to scripts\\n * @public\\n * @remarks\\n * <b>Basic ns1 usage example:</b>\\n * ```ts\\n * // Basic ns functions can be used directly\\n * getHostname();\\n * // Some related functions are gathered within a common namespace\\n * stock.getPrice();\\n * ```\\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html| ns1 in-game docs}\\n * <hr>\\n * <b>Basic ns2 usage example:</b>\\n * ```ts\\n * export async function main(ns) {\\n * // Basic ns functions can be accessed on the ns object\\n * ns.getHostname();\\n * // Some related functions are gathered under a sub-property of the ns object\\n * ns.stock.getPrice();\\n * // Some functions need to be await ed\\n * await ns.hack('n00dles');\\n * }\\n * ```\\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}\\n * <hr>\\n */\\nexport interface NS extends Singularity {\\n /**\\n * Namespace for hacknet functions.\\n * @remarks RAM cost: 4 GB\\n */\\n readonly hacknet: Hacknet;\\n /**\\n *\\n * Namespace for bladeburner functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly bladeburner: Bladeburner;\\n /**\\n *\\n * Namespace for codingcontract functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly codingcontract: CodingContract;\\n /**\\n *\\n * Namespace for gang functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly gang: Gang;\\n /**\\n *\\n * Namespace for sleeve functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly sleeve: Sleeve;\\n /**\\n *\\n * Namespace for stock functions.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n readonly stock: TIX;\\n /**\\n *\\n * Namespace for formulas functions.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n readonly formulas: Formulas;\\n /**\\n * Namespace for stanek functions.\\n * RAM cost: 0 GB\\n */\\n readonly stanek: Stanek;\\n /**\\n * Namespace for corporation functions.\\n * RAM cost: 0 GB\\n */\\n readonly corporation: Corporation;\\n\\n /**\\n * Namespace for user interface functions.\\n * RAM cost: 0 GB\\n */\\n readonly ui: UserInterface;\\n\\n /**\\n * Arguments passed into the script.\\n *\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Arguments passed into a script can be accessed using a normal\\n * array using the [] operator (args[0], args[1], etc…).\\n *\\n * It is also possible to get the number of arguments that was passed into a script using: 'args.length'\\n * WARNING: Do not try to modify the args array. This will break the game.\\n */\\n readonly args: (string | number | boolean)[];\\n\\n /**\\n * Steal a servers money.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Function that is used to try and hack servers to steal money and gain hacking experience.\\n * The runtime for this command depends on your hacking level and the target server’s\\n * security level when this function is called. In order to hack a server you must first gain root access to that server\\n * and also have the required hacking level.\\n *\\n * A script can hack a server from anywhere. It does not need to be running on the same\\n * server to hack that server. For example, you can create a script that hacks the `foodnstuff`\\n * server and run that script on any server in the game.\\n *\\n * A successful `hack()` on a server will raise that server’s security level by 0.002.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var earnedMoney = hack(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let earnedMoney = await ns.hack(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server to hack.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The amount of money stolen if the hack is successful, and zero otherwise.\\n */\\n hack(host: string, opts?: BasicHGWOptions): Promise<number>;\\n\\n /**\\n * Spoof money in a servers bank account, increasing the amount available.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * Use your hacking skills to increase the amount of money available on a server.\\n * The runtime for this command depends on your hacking level and the target server’s\\n * security level. When `grow` completes, the money available on a target server will\\n * be increased by a certain, fixed percentage. This percentage is determined by the\\n * target server’s growth rate (which varies between servers) and security level. Generally,\\n * higher-level servers have higher growth rates. The getServerGrowth() function can be used\\n * to obtain a server’s growth rate.\\n *\\n * Like hack, `grow` can be called on any server, regardless of where the script is running.\\n * The grow() command requires root access to the target server, but there is no required hacking\\n * level to run the command. It also raises the security level of the target server by 0.004.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var currentMoney = getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * currentMoney = currentMoney * (1 + grow(\\\"foodnstuff\\\"));\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let currentMoney = ns.getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * currentMoney *= (1 + await ns.grow(\\\"foodnstuff\\\"));\\n * ```\\n * @param host - Hostname of the target server to grow.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The number by which the money on the server was multiplied for the growth.\\n */\\n grow(host: string, opts?: BasicHGWOptions): Promise<number>;\\n\\n /**\\n * Reduce a server security level.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * Use your hacking skills to attack a server’s security, lowering the server’s security level.\\n * The runtime for this command depends on your hacking level and the target server’s security\\n * level when this function is called. This function lowers the security level of the target server by 0.05.\\n *\\n * Like hack and grow, `weaken` can be called on any server, regardless of\\n * where the script is running. This command requires root access to the target server, but\\n * there is no required hacking level to run the command.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var currentSecurity = getServerSecurityLevel(\\\"foodnstuff\\\");\\n * currentSecurity = currentSecurity - weaken(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let currentSecurity = ns.getServerSecurityLevel(\\\"foodnstuff\\\");\\n * currentSecurity -= await ns.weaken(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server to weaken.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The amount by which the target server’s security level was decreased. This is equivalent to 0.05 multiplied by the number of script threads.\\n */\\n weaken(host: string, opts?: BasicHGWOptions): Promise<number>;\\n\\n /**\\n * Predict the effect of weaken.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security decrease that would occur if a weaken with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @param cores - Optional. The number of cores of the server that would run weaken.\\n * @returns The security decrease.\\n */\\n weakenAnalyze(threads: number, cores?: number): number;\\n\\n /**\\n * Predict the effect of hack.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * This function returns the number of script threads you need when running the hack command\\n * to steal the specified amount of money from the target server.\\n * If hackAmount is less than zero or greater than the amount of money available on the server,\\n * then this function returns -1.\\n *\\n * Warning: The value returned by this function isn’t necessarily a whole number.\\n *\\n * @example\\n * ```ts\\n * //For example, let’s say the foodnstuff server has $10m and you run:\\n * hackAnalyzeThreads(\\\"foodnstuff\\\", 1e6);\\n * //If this function returns 50, this means that if your next hack call is run on a script with 50 threads, it will steal $1m from the foodnstuff server.\\n * ```\\n * @param host - Hostname of the target server to analyze.\\n * @param hackAmount - Amount of money you want to hack from the server.\\n * @returns The number of threads needed to hack the server for hackAmount money.\\n */\\n hackAnalyzeThreads(host: string, hackAmount: number): number;\\n\\n /**\\n * Get the part of money stolen with a single thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the part of the specified server’s money you will steal with a single thread hack.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //For example, assume the following returns 0.01:\\n * var hackAmount = hackAnalyze(\\\"foodnstuff\\\");\\n * //This means that if hack the foodnstuff server using a single thread, then you will steal 1%, or 0.01 of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //For example, assume the following returns 0.01:\\n * const hackAmount = ns.hackAnalyze(\\\"foodnstuff\\\");\\n * //This means that if hack the foodnstuff server using a single thread, then you will steal 1%, or 0.01 of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.\\n * ```\\n * @param host - Hostname of the target server.\\n * @returns The part of money you will steal from the target server with a single thread hack.\\n */\\n hackAnalyze(host: string): number;\\n\\n /**\\n * Get the security increase for a number of thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security increase that would occur if a hack with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @returns The security increase.\\n */\\n hackAnalyzeSecurity(threads: number): number;\\n\\n /**\\n * Get the chance of successfully hacking a server.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the chance you have of successfully hacking the specified server.\\n *\\n * This returned value is in decimal form, not percentage.\\n *\\n * @param host - Hostname of the target server.\\n * @returns The chance you have of successfully hacking the target server.\\n */\\n hackAnalyzeChance(host: string): number;\\n\\n /**\\n * Calculate the number of grow thread needed to grow a server by a certain multiplier.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * This function returns the number of “growths” needed in order to increase\\n * the amount of money available on the specified server by the specified amount.\\n * The specified amount is multiplicative and is in decimal form, not percentage.\\n *\\n * Warning: The value returned by this function isn’t necessarily a whole number.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:\\n * var growTimes = growthAnalyze(\\\"foodnstuff\\\", 2);\\n * //If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:\\n * const growTimes = ns.growthAnalyze(\\\"foodnstuff\\\", 2);\\n * //If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).\\n * ```\\n * @param host - Hostname of the target server.\\n * @param growthAmount - Multiplicative factor by which the server is grown. Decimal form..\\n * @returns The amount of grow calls needed to grow the specified server by the specified amount\\n */\\n growthAnalyze(host: string, growthAmount: number, cores?: number): number;\\n\\n /**\\n * Calculate the security increase for a number of thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security increase that would occur if a grow with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @returns The security increase.\\n */\\n growthAnalyzeSecurity(threads: number): number;\\n\\n /**\\n * Suspends the script for n milliseconds.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param millis - Number of milliseconds to sleep.\\n * @example\\n * ```ts\\n * // NS1:\\n * // This will count from 1 to 10 in your terminal, with one number every 5 seconds\\n * for (var i=0; i<10; i++) {\\n * tprint(i + 1);\\n * sleep(5000);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // This will count from 1 to 10 in your terminal, with one number every 5 seconds\\n * for (var i=0; i<10; i++) {\\n * ns.tprint(i + 1);\\n * await ns.sleep(5000);\\n * }\\n * ```\\n * @returns\\n */\\n sleep(millis: number): Promise<void>;\\n\\n /**\\n * Suspends the script for n milliseconds. Doesn't block with concurrent calls.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param millis - Number of milliseconds to sleep.\\n * @returns\\n */\\n asleep(millis: number): Promise<void>;\\n\\n /**\\n * Prints one or move values or variables to the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param args - Value(s) to be printed.\\n */\\n print(...args: any[]): void;\\n\\n /**\\n * Prints a formatted string to the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - format of the message\\n * @param args - Value(s) to be printed.\\n */\\n printf(format: string, ...args: any[]): void;\\n\\n /**\\n * Prints one or more values or variables to the Terminal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param args - Value(s) to be printed.\\n */\\n tprint(...args: any[]): void;\\n\\n /**\\n * Prints a raw value or a variable to the Terminal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param format - format of the message\\n * @param msg - Value to be printed.\\n */\\n tprintf(format: string, ...values: any[]): void;\\n\\n /**\\n * Clears the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clearLog(): void;\\n\\n /**\\n * Disables logging for the given function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Logging can be disabled for all functions by passing `ALL` as the argument.\\n *\\n * Note that this does not completely remove all logging functionality.\\n * This only stops a function from logging when the function is successful.\\n * If the function fails, it will still log the reason for failure.\\n *\\n * @param fn - Name of function for which to disable logging.\\n */\\n disableLog(fn: string): void;\\n\\n /**\\n * Enable logging for a certain function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Re-enables logging for the given function. If `ALL` is passed into this\\n * function as an argument, then it will revert the effects of disableLog(`ALL`).\\n *\\n * @param fn - Name of function for which to enable logging.\\n */\\n enableLog(fn: string): void;\\n\\n /**\\n * Checks the status of the logging for the given function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param fn - Name of function to check.\\n * @returns Returns a boolean indicating whether or not logging is enabled for that function (or `ALL`)\\n */\\n isLogEnabled(fn: string): boolean;\\n\\n /**\\n * Get all the logs of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns a script’s logs. The logs are returned as an array, where each line is an element in the array.\\n * The most recently logged line is at the end of the array.\\n * Note that there is a maximum number of lines that a script stores in its logs. This is configurable in the game’s options.\\n * If the function is called with no arguments, it will return the current script’s logs.\\n *\\n * Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script.\\n * Remember that scripts are uniquely identified by both their names and arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Get logs from foo.script on the current server that was run with no args\\n * getScriptLogs(\\\"foo.script\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with no args\\n * getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Get logs from foo.script on the current server that was run with no args\\n * ns.getScriptLogs(\\\"foo.script\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with no args\\n * ns.getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * ns.getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @param fn - Optional. Filename of script to get logs from.\\n * @param host - Optional. Hostname of the server that the script is on.\\n * @param args - Arguments to identify which scripts to get logs for.\\n * @returns Returns an string array, where each line is an element in the array. The most recently logged line is at the end of the array.\\n */\\n getScriptLogs(fn?: string, host?: string, ...args: any[]): string[];\\n\\n /**\\n * Open the tail window of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Opens a script’s logs. This is functionally the same as the tail Terminal command.\\n *\\n * If the function is called with no arguments, it will open the current script’s logs.\\n *\\n * Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script.\\n * Remember that scripts are uniquely identified by both their names and arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Open logs from foo.script on the current server that was run with no args\\n * tail(\\\"foo.script\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with no args\\n * tail(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * tail(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Open logs from foo.script on the current server that was run with no args\\n * ns.tail(\\\"foo.script\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with no args\\n * ns.tail(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * ns.tail(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @param fn - Optional. Filename or PID of the script being tailed. If omitted, the current script is tailed.\\n * @param host - Optional. Hostname of the script being tailed. Defaults to the server this script is running on. If args are specified, this is not optional.\\n * @param args - Arguments for the script being tailed.\\n */\\n tail(fn?: FilenameOrPID, host?: string, ...args: any[]): void;\\n\\n /**\\n * Get the list of servers connected to a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array containing the hostnames of all servers that are one\\n * node way from the specified target server. The hostnames in the returned\\n * array are strings.\\n *\\n * @param host - Optional, Hostname of the server to scan, default to current server.\\n * @returns Returns an string of hostnames.\\n */\\n scan(host?: string): string[];\\n\\n /**\\n * Runs NUKE.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Running NUKE.exe on a target server gives you root access which means you can executes scripts on said server. NUKE.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * nuke(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.nuke(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n nuke(host: string): void;\\n\\n /**\\n * Runs BruteSSH.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the BruteSSH.exe program on the target server. BruteSSH.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * brutessh(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.brutessh(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n brutessh(host: string): void;\\n\\n /**\\n * Runs FTPCrack.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the FTPCrack.exe program on the target server. FTPCrack.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * ftpcrack(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.ftpcrack(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n ftpcrack(host: string): void;\\n\\n /**\\n * Runs relaySMTP.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the relaySMTP.exe program on the target server. relaySMTP.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * relaysmtp(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.relaysmtp(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n relaysmtp(host: string): void;\\n\\n /**\\n * Runs HTTPWorm.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the HTTPWorm.exe program on the target server. HTTPWorm.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * httpworm(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.httpworm(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n httpworm(host: string): void;\\n\\n /**\\n * Runs SQLInject.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the SQLInject.exe program on the target server. SQLInject.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * sqlinject(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.sqlinject(\\\"foodnstuff\\\");\\n * ```\\n * @remarks RAM cost: 0.05 GB\\n * @param host - Hostname of the target server.\\n */\\n sqlinject(host: string): void;\\n\\n /**\\n * Start another script on the current server.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Run a script as a separate process. This function can only be used to run scripts located on the\\n * current server (the server running the script that calls this function). Requires a significant\\n * amount of RAM to run this command.\\n *\\n * If the script was successfully started, then this functions returns the PID of that script.\\n * Otherwise, it returns 0.\\n *\\n * PID stands for Process ID. The PID is a unique identifier for each script.\\n * The PID will always be a positive integer.\\n *\\n * Running this function with a numThreads argument of 0 will return 0 without running the script.\\n * However, running this function with a negative numThreads argument will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The simplest way to use the run command is to call it with just the script name. The following example will run ‘foo.script’ single-threaded with no arguments:\\n * run(\\\"foo.script\\\");\\n *\\n * //The following example will run ‘foo.script’ but with 5 threads instead of single-threaded:\\n * run(\\\"foo.script\\\", 5);\\n *\\n * //This next example will run ‘foo.script’ single-threaded, and will pass the string ‘foodnstuff’ into the script as an argument:\\n * run(\\\"foo.script\\\", 1, 'foodnstuff');\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The simplest way to use the run command is to call it with just the script name. The following example will run ‘foo.script’ single-threaded with no arguments:\\n * ns.run(\\\"foo.script\\\");\\n *\\n * //The following example will run ‘foo.script’ but with 5 threads instead of single-threaded:\\n * ns.run(\\\"foo.script\\\", 5);\\n *\\n * //This next example will run ‘foo.script’ single-threaded, and will pass the string ‘foodnstuff’ into the script as an argument:\\n * ns.run(\\\"foo.script\\\", 1, 'foodnstuff');\\n * ```\\n * @param script - Filename of script to run.\\n * @param numThreads - Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the second argument numThreads must be filled in with a value.\\n * @returns Returns the PID of a successfully started script, and 0 otherwise.\\n */\\n run(script: string, numThreads?: number, ...args: Array<string | number | boolean>): number;\\n\\n /**\\n * Start another script on any server.\\n * @remarks\\n * RAM cost: 1.3 GB\\n *\\n * Run a script as a separate process on a specified server. This is similar to the run function\\n * except that it can be used to run a script on any server, instead of just the current server.\\n *\\n * If the script was successfully started, then this functions returns the PID of that script.\\n * Otherwise, it returns 0.\\n *\\n * PID stands for Process ID. The PID is a unique identifier for each script.\\n * The PID will always be a positive integer.\\n *\\n * Running this function with a numThreads argument of 0 will return 0 without running the script.\\n * However, running this function with a negative numThreads argument will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The simplest way to use the exec command is to call it with just the script name and the target server. The following example will try to run generic-hack.script on the foodnstuff server:\\n * exec(\\\"generic-hack.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following example will try to run the script generic-hack.script on the joesguns server with 10 threads:\\n * exec(\\\"generic-hack.script\\\", \\\"joesguns\\\", 10);\\n *\\n * //This last example will try to run the script foo.script on the foodnstuff server with 5 threads. It will also pass the number 1 and the string “test” in as arguments to the script:\\n * exec(\\\"foo.script\\\", \\\"foodnstuff\\\", 5, 1, \\\"test\\\");\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * //The simplest way to use the exec command is to call it with just the script name and the target server. The following example will try to run generic-hack.script on the foodnstuff server:\\n * ns.exec(\\\"generic-hack.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following example will try to run the script generic-hack.script on the joesguns server with 10 threads:\\n * ns.exec(\\\"generic-hack.script\\\", \\\"joesguns\\\", 10);\\n *\\n * //This last example will try to run the script foo.script on the foodnstuff server with 5 threads. It will also pass the number 1 and the string “test” in as arguments to the script:\\n * ns.exec(\\\"foo.script\\\", \\\"foodnstuff\\\", 5, 1, \\\"test\\\");\\n * ```\\n * @param script - Filename of script to execute.\\n * @param host - Hostname of the `target server` on which to execute the script.\\n * @param numThreads - Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the third argument numThreads must be filled in with a value.\\n * @returns Returns the PID of a successfully started script, and 0 otherwise.\\n */\\n exec(script: string, host: string, numThreads?: number, ...args: Array<string | number | boolean>): number;\\n\\n /**\\n * Terminate current script and start another in 10s.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Terminates the current script, and then after a delay of about 10 seconds it will execute the\\n * newly-specified script. The purpose of this function is to execute a new script without being\\n * constrained by the RAM usage of the current one. This function can only be used to run scripts\\n * on the local server.\\n *\\n * Because this function immediately terminates the script, it does not have a return value.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will execute the script ‘foo.script’ with 10 threads and the arguments ‘foodnstuff’ and 90:\\n * spawn('foo.script', 10, 'foodnstuff', 90);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will execute the script ‘foo.script’ with 10 threads and the arguments ‘foodnstuff’ and 90:\\n * ns.spawn('foo.script', 10, 'foodnstuff', 90);\\n * ```\\n * @param script - Filename of script to execute.\\n * @param numThreads - Number of threads to spawn new script with. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run.\\n */\\n spawn(script: string, numThreads?: number, ...args: string[]): void;\\n\\n /**\\n * Terminate another script.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Kills the script on the target server specified by the script’s name and arguments.\\n * Remember that scripts are uniquely identified by both their name and arguments.\\n * For example, if `foo.script` is run with the argument 1, then this is not the same as\\n * `foo.script` run with the argument 2, even though they have the same code.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * ns.kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @param script - Filename or pid of the script to kill\\n * @param host - Hostname of the server on which to kill the script.\\n * @param args - Arguments to identify which script to kill.\\n * @returns True if the script is successfully killed, and false otherwise.\\n */\\n kill(script: number): boolean;\\n kill(script: string, host: string, ...args: string[]): boolean;\\n\\n /**\\n * Terminate all scripts on a server.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Kills all running scripts on the specified server. This function returns true\\n * if any scripts were killed, and false otherwise. In other words, it will return\\n * true if there are any scripts running on the target server.\\n * If no host is defined, it will kill all scripts, where the script is running.\\n *\\n * @param host - IP or hostname of the server on which to kill all scripts.\\n * @returns True if any scripts were killed, and false otherwise.\\n */\\n killall(host?: string): boolean;\\n\\n /**\\n * Terminates the current script immediately.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n exit(): void;\\n\\n /**\\n * Copy file between servers.\\n * @remarks\\n * RAM cost: 0.6 GB\\n *\\n * Copies a script or literature (.lit) file(s) to another server. The files argument can be either a string\\n * specifying a single file to copy, or an array of strings specifying multiple files to copy.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Copies foo.lit from the helios server to the home computer:\\n * scp(\\\"foo.lit\\\", \\\"helios\\\", \\\"home\\\");\\n *\\n * //Tries to copy three files from rothman-uni to home computer:\\n * files = [\\\"foo1.lit\\\", \\\"foo2.script\\\", \\\"foo3.script\\\"];\\n * scp(files, \\\"rothman-uni\\\", \\\"home\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Copies foo.lit from the helios server to the home computer:\\n * await ns.scp(\\\"foo.lit\\\", \\\"helios\\\", \\\"home\\\");\\n *\\n * //Tries to copy three files from rothman-uni to home computer:\\n * files = [\\\"foo1.lit\\\", \\\"foo2.script\\\", \\\"foo3.script\\\"];\\n * await ns.scp(files, \\\"rothman-uni\\\", \\\"home\\\");\\n * ```\\n * @example\\n * ```ts\\n * //ns2, copies files from home to a target server\\n * const server = ns.args[0];\\n * const files = [\\\"hack.js\\\",\\\"weaken.js\\\",\\\"grow.js\\\"];\\n * await ns.scp(files, \\\"home\\\", server);\\n * ```\\n * @param files - Filename or an array of filenames of script/literature files to copy.\\n * @param source - Host of the source server, which is the server from which the file will be copied. This argument is optional and if it’s omitted the source will be the current server.\\n * @param destination - Host of the destination server, which is the server to which the file will be copied.\\n * @returns True if the script/literature file is successfully copied over and false otherwise. If the files argument is an array then this function will return true if at least one of the files in the array is successfully copied.\\n */\\n scp(files: string | string[], destination: string): Promise<boolean>;\\n scp(files: string | string[], source: string, destination: string): Promise<boolean>;\\n\\n /**\\n * List files on a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array with the filenames of all files on the specified server\\n * (as strings). The returned array is sorted in alphabetic order.\\n *\\n * @param host - Host of the target server.\\n * @param grep - A substring to search for in the filename.\\n * @returns Array with the filenames of all files on the specified server.\\n */\\n ls(host: string, grep?: string): string[];\\n\\n /**\\n * List running scripts on a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array with general information about all scripts running on the specified target server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * const scripts = ps(\\\"home\\\");\\n * for (let i = 0; i < scripts.length; ++i) {\\n * tprint(scripts[i].filename + ' ' + scripts[i].threads);\\n * tprint(scripts[i].args);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const ps = ns.ps(\\\"home\\\");\\n * for (script of ps) {\\n * ns.tprint(`${script.filename} ${ps[i].threads}`);\\n * ns.tprint(script.args);\\n * }\\n * ```\\n * @param host - Host address of the target server. If not specified, it will be the current server’s IP by default.\\n * @returns Array with general information about all scripts running on the specified target server.\\n */\\n ps(host?: string): ProcessInfo[];\\n\\n /**\\n * Check if your have root access on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns a boolean indicating whether or not the player has root access to the specified target server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * if (hasRootAccess(\\\"foodnstuff\\\") == false) {\\n * nuke(\\\"foodnstuff\\\");\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * if (ns.hasRootAccess(\\\"foodnstuff\\\") == false) {\\n * ns.nuke(\\\"foodnstuff\\\");\\n * }\\n * ```\\n * @param host - Host of the target server\\n * @returns True if player has root access to the specified target server, and false otherwise.\\n */\\n hasRootAccess(host: string): boolean;\\n\\n /**\\n * Returns a string with the hostname of the server that the script is running on.\\n *\\n * @remarks\\n * RAM cost: 0.05 GB\\n * @returns Hostname of the server that the script is on.\\n */\\n getHostname(): string;\\n\\n /**\\n * Returns the player’s current hacking level.\\n *\\n * @remarks\\n * RAM cost: 0.05 GB\\n * @returns Player’s current hacking level\\n */\\n getHackingLevel(): number;\\n\\n /**\\n * Get hacking related multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the Player’s hacking related multipliers.\\n * These multipliers are returned in fractional forms, not percentages\\n * (e.g. 1.5 instead of 150%).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * // Example of how this can be used:\\n * var mults = getHackingMultipliers();\\n * print(mults.chance);\\n * print(mults.growth);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // Example of how this can be used:\\n * const {chance, growth} = ns.getHackingMultipliers();\\n * print(chance);\\n * print(growth);\\n * ```\\n * @returns Object containing the Player’s hacking related multipliers.\\n */\\n getHackingMultipliers(): HackingMultipliers;\\n\\n /**\\n * Get hacknet related multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the Player’s hacknet related multipliers.\\n * These multipliers are returned in fractional forms, not percentages\\n * (e.g. 1.5 instead of 150%).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * // Example of how this can be used:\\n * var mults = getHacknetMultipliers();\\n * print(mults.production);\\n * print(mults.purchaseCost);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // Example of how this can be used:\\n * const {production, purchaseCost} = ns.getHacknetMultipliers();\\n * print(production);\\n * print(purchaseCost);\\n * ```\\n * @returns Object containing the Player’s hacknet related multipliers.\\n */\\n getHacknetMultipliers(): HacknetMultipliers;\\n\\n /**\\n * Returns a server object for the given server. Defaults to the running script's server if host is not specified.\\n *\\n * @remarks\\n * RAM cost: 2 GB\\n * @param host - Optional. Hostname for the requested server object.\\n * @returns The requested server object.\\n */\\n getServer(host?: string): Server;\\n\\n /**\\n * Get money available on a server.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of money available on a server.\\n * Running this function on the home computer will return the player’s money.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * getServerMoneyAvailable(\\\"home\\\"); //Returns player's money\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * ns.getServerMoneyAvailable(\\\"home\\\"); // Returns player's money\\n * ```\\n * @param host - Host of target server\\n * @returns Amount of money available on the server.\\n */\\n getServerMoneyAvailable(host: string): number;\\n\\n /**\\n * Get maximum money available on a server.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the maximum amount of money that can be available on a server.\\n *\\n * @param host - Host of target server.\\n * @returns Maximum amount of money available on the server.\\n */\\n getServerMaxMoney(host: string): number;\\n\\n /**\\n * Get a server growth parameter.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the server’s intrinsic “growth parameter”. This growth\\n * parameter is a number typically between 0 and 100 that represents\\n * how quickly the server’s money grows. This parameter affects the\\n * percentage by which the server’s money is increased when using the\\n * grow function. A higher growth parameter will result in a\\n * higher percentage increase from grow.\\n *\\n * @param host - Host of target server.\\n * @returns Parameter that affects the percentage by which the server’s money is increased when using the grow function.\\n */\\n getServerGrowth(host: string): number;\\n\\n /**\\n * Get server security level.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the security level of the target server. A server’s security\\n * level is denoted by a number, typically between 1 and 100\\n * (but it can go above 100).\\n *\\n * @param host - Host of target server.\\n * @returns Security level of the target server.\\n */\\n getServerSecurityLevel(host: string): number;\\n\\n /**\\n * Returns the minimum security level of the target server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns Minimum security level of the target server.\\n */\\n getServerMinSecurityLevel(host: string): number;\\n\\n /**\\n * @deprecated useless\\n * @remarks\\n * RAM cost: 0.1 GB\\n * Returns the base security level of the target server. This is the security\\n * level that the server starts out with. This is different than\\n * getServerSecurityLevel because getServerSecurityLevel returns\\n * the current security level of a server, which can constantly change due to\\n * hack, grow, and weaken, calls on that server.\\n * The base security level will stay the same until you reset by\\n * installing an Augmentation(s).\\n *\\n * @param host - Host of target server.\\n * @returns Base security level of the target server.\\n */\\n getServerBaseSecurityLevel(host: string): number;\\n\\n /**\\n * @deprecated use getServerMaxRam / getServerUsedRam\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns an array with two elements that gives information about a server’s memory (RAM).\\n * The first element in the array is the amount of RAM that the server has total (in GB).\\n * The second element in the array is the amount of RAM that is currently being used on\\n * the server (in GB).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var serverRam = getServerRam(\\\"helios\\\");\\n * var totalRam = serverRam[0];\\n * var ramUsed = serverRam[1];\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const [totalRam, ramUsed] = ns.getServerRam(\\\"helios\\\");\\n * ```\\n * @param host - Host of target server.\\n * @returns Array with total and used memory on the specified server, in GB.\\n */\\n getServerRam(host: string): [number, number];\\n\\n /**\\n * Get the max RAM on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * @param host - Hostname of the target server.\\n * @returns max ram (GB)\\n */\\n getServerMaxRam(host: string): number;\\n /**\\n * Get the used RAM on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * @param host - Hostname of the target server.\\n * @returns used ram (GB)\\n */\\n getServerUsedRam(host: string): number;\\n\\n /**\\n * Returns the required hacking level of the target server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns The required hacking level of the target server.\\n */\\n getServerRequiredHackingLevel(host: string): number;\\n\\n /**\\n * Returns the number of open ports required to successfully run NUKE.exe on the specified server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns The number of open ports required to successfully run NUKE.exe on the specified server.\\n */\\n getServerNumPortsRequired(host: string): number;\\n\\n /**\\n * Returns a boolean denoting whether or not the specified server exists.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns True if specified server exists, and false otherwise.\\n */\\n serverExists(host: string): boolean;\\n\\n /**\\n * Check if a file exists.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns a boolean indicating whether the specified file exists on the target server.\\n * The filename for scripts is case-sensitive, but for other types of files it is not.\\n * For example, fileExists(“brutessh.exe”) will work fine, even though the actual program\\n * is named 'BruteSSH.exe'.\\n *\\n * If the hostname/ip argument is omitted, then the function will search through the current\\n * server (the server running the script that calls this function) for the file.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if the script named foo.script exists on the foodnstuff server, and false otherwise.\\n * fileExists(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if the current server contains the FTPCrack.exe program, and false otherwise.\\n * fileExists(\\\"ftpcrack.exe\\\");\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * // The function call will return true if the script named foo.script exists on the foodnstuff server, and false otherwise.\\n * ns.fileExists(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * // The function call will return true if the current server contains the FTPCrack.exe program, and false otherwise.\\n * ns.fileExists(\\\"ftpcrack.exe\\\");\\n * ```\\n * @param filename - Filename of file to check.\\n * @param host - Host of target server. This is optional. If it is not specified then the function will use the current server as the target server.\\n * @returns True if specified file exists, and false otherwise.\\n */\\n fileExists(filename: string, host?: string): boolean;\\n\\n /**\\n * Check if a script is running.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns a boolean indicating whether the specified script is running on the target server.\\n * If you use a PID instead of a filename, the hostname and args parameters are unnecessary.\\n * Remember that a script is uniquely identified by both its name and its arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if there is a script named foo.script with no arguments running on the foodnstuff server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is a script named foo.script with no arguments running on the current server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", getHostname());\\n *\\n * //The function call will return true if there is a script named foo.script running with the arguments 1, 5, and “test” (in that order) on the joesguns server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", \\\"joesguns\\\", 1, 5, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The function call will return true if there is a script named foo.script with no arguments running on the foodnstuff server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is a script named foo.script with no arguments running on the current server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", ns.getHostname());\\n *\\n * //The function call will return true if there is a script named foo.script running with the arguments 1, 5, and “test” (in that order) on the joesguns server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", \\\"joesguns\\\", 1, 5, \\\"test\\\");\\n * ```\\n * @param script - Filename or PID of script to check. This is case-sensitive.\\n * @param host - Host of target server.\\n * @param args - Arguments to specify/identify which scripts to search for.\\n * @returns True if specified script is running on the target server, and false otherwise.\\n */\\n isRunning(script: FilenameOrPID, host: string, ...args: string[]): boolean;\\n\\n /**\\n * Get general info about a running script.\\n * @remarks\\n * RAM cost: 0.3 GB\\n *\\n * Running with no args returns curent script.\\n * If you use a PID as the first parameter, the hostname and args parameters are unnecessary.\\n *\\n * @param filename - Optional. Filename or PID of the script.\\n * @param hostname - Optional. Name of host server the script is running on.\\n * @param args - Arguments to identify the script\\n * @returns The info about the running script if found, and null otherwise.\\n */\\n getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): RunningScript;\\n\\n /**\\n * Get cost of purchasing a server.\\n * @remarks\\n * RAM cost: 0.25 GB\\n *\\n * Returns the cost to purchase a server with the specified amount of ram.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * for (i = 1; i <= 20; i++) {\\n * tprint(i + \\\" -- \\\" + getPurchasedServerCost(Math.pow(2, i)));\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * for (i = 1; i <= 20; i++) {\\n * ns.tprint(i + \\\" -- \\\" + ns.getPurchasedServerCost(Math.pow(2, i)));\\n * }\\n * ```\\n * @param ram - Amount of RAM of a potential purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\\n * @returns The cost to purchase a server with the specified amount of ram.\\n */\\n getPurchasedServerCost(ram: number): number;\\n\\n /**\\n * Purchase a server.\\n * @remarks\\n * 2.25 GB\\n *\\n * Purchased a server with the specified hostname and amount of RAM.\\n *\\n * The hostname argument can be any data type, but it will be converted to a string\\n * and have whitespace removed. Anything that resolves to an empty string will cause\\n * the function to fail. If there is already a server with the specified hostname,\\n * then the function will automatically append a number at the end of the hostname\\n * argument value until it finds a unique hostname. For example, if the script calls\\n * `purchaseServer(“foo”, 4)` but a server named “foo” already exists, the it will\\n * automatically change the hostname to `foo-0`. If there is already a server with the\\n * hostname `foo-0`, then it will change the hostname to `foo-1`, and so on.\\n *\\n * Note that there is a maximum limit to the amount of servers you can purchase.\\n *\\n * Returns the hostname of the newly purchased server as a string. If the function\\n * fails to purchase a server, then it will return an empty string. The function will\\n * fail if the arguments passed in are invalid, if the player does not have enough\\n * money to purchase the specified server, or if the player has exceeded the maximum\\n * amount of servers.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var ram = 64;\\n * var prefix = \\\"pserv-\\\";\\n * for (i = 0; i < 5; ++i) {\\n * purchaseServer(prefix + i, ram);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const ram = 64;\\n * const prefix = \\\"pserv-\\\";\\n * for (i = 0; i < 5; ++i) {\\n * ns.purchaseServer(prefix + i, ram);\\n * }\\n * ```\\n * @param hostname - Host of the purchased server.\\n * @param ram - Amount of RAM of the purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\\n * @returns The hostname of the newly purchased server.\\n */\\n purchaseServer(hostname: string, ram: number): string;\\n\\n /**\\n * Delete a purchased server.\\n * @remarks\\n * 2.25 GB\\n *\\n * Deletes one of your purchased servers, which is specified by its hostname.\\n *\\n * The hostname argument can be any data type, but it will be converted to a string.\\n * Whitespace is automatically removed from the string. This function will not delete a\\n * server that still has scripts running on it.\\n *\\n * @param host - Host of the server to delete.\\n * @returns True if successful, and false otherwise.\\n */\\n deleteServer(host: string): boolean;\\n\\n /**\\n * Returns an array with the hostnames of all of the servers you have purchased.\\n *\\n * @remarks 2.25 GB\\n * @returns Returns an array with the hostnames of all of the servers you have purchased.\\n */\\n getPurchasedServers(): string[];\\n\\n /**\\n * Returns the maximum number of servers you can purchase.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Returns the maximum number of servers you can purchase.\\n */\\n getPurchasedServerLimit(): number;\\n\\n /**\\n * Returns the maximum RAM that a purchased server can have.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Returns the maximum RAM (in GB) that a purchased server can have.\\n */\\n getPurchasedServerMaxRam(): number;\\n\\n /**\\n * Write data to a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function can be used to write data to a text file (.txt).\\n *\\n * This function will write data to that text file. If the specified text file does not exist,\\n * then it will be created. The third argument mode, defines how the data will be written to\\n * the text file. If *mode is set to “w”, then the data is written in “write” mode which means\\n * that it will overwrite all existing data on the text file. If mode is set to any other value\\n * then the data will be written in “append” mode which means that the data will be added at the\\n * end of the text file.\\n *\\n * @param handle - Filename of the text file that will be written to.\\n * @param data - Data to write.\\n * @param mode - Defines the write mode. Only valid when writing to text files.\\n */\\n write(handle: string, data?: string[] | number | string, mode?: \\\"w\\\" | \\\"a\\\"): Promise<void>;\\n\\n /**\\n * Attempt to write to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Attempts to write data to the specified Netscript Port.\\n * If the port is full, the data will not be written.\\n * Otherwise, the data will be written normally.\\n *\\n * @param port - Port or text file that will be written to.\\n * @param data - Data to write.\\n * @returns True if the data is successfully written to the port, and false otherwise.\\n */\\n tryWritePort(port: number, data: string[] | number): Promise<boolean>;\\n\\n /**\\n * Read content of a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to read data from a text file (.txt).\\n *\\n * This function will return the data in the specified text\\n * file. If the text file does not exist, an empty string will be returned.\\n *\\n * @param handle - Filename to read from.\\n * @returns Data in the specified text file.\\n */\\n read(handle: string): any;\\n\\n /**\\n * Get a copy of the data from a port without popping it.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to peek at the data from a port. It returns the\\n * first element in the specified port without removing that element. If\\n * the port is empty, the string “NULL PORT DATA” will be returned.\\n *\\n * @param port - Port to peek. Must be an integer between 1 and 20.\\n * @returns Data in the specified port.\\n */\\n peek(port: number): any;\\n\\n /**\\n * Clear data from a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Delete all data from that text file.\\n *\\n * @param handle - Text file to clear.\\n */\\n clear(handle: string): void;\\n\\n /**\\n * Clear data from a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Deleta all data from the underlying queue.\\n *\\n * @param handle - Port to clear.\\n */\\n clearPort(handle: number): void;\\n\\n /**\\n * Write data to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Write data to that netscript port.\\n * @returns The data popped off the queue if it was full.\\n */\\n writePort(port: number, data: string | number): Promise<any>;\\n /**\\n * Read data from a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Read data from that port. A port is a serialized queue.\\n * This function will remove the first element from that queue and return it.\\n * If the queue is empty, then the string “NULL PORT DATA” will be returned.\\n * @returns the data read.\\n */\\n readPort(port: number): any;\\n\\n /**\\n * Get all data on a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Get a handle to a Netscript Port.\\n *\\n * WARNING: Port Handles only work in NetscriptJS (Netscript 2.0). They will not work in Netscript 1.0.\\n *\\n * @see https://bitburner.readthedocs.io/en/latest/netscript/netscriptmisc.html#netscript-ports\\n * @param port - Port number. Must be an integer between 1 and 20.\\n */\\n getPortHandle(port: number): NetscriptPort;\\n\\n /**\\n * Delete a file.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Removes the specified file from the current server. This function works for every file\\n * type except message (.msg) files.\\n *\\n * @param name - Filename of file to remove. Must include the extension.\\n * @param host - Host Address of the server on which to delete the file. Optional. Defaults to current server.\\n * @returns True if it successfully deletes the file, and false otherwise.\\n */\\n rm(name: string, host?: string): boolean;\\n\\n /**\\n * Check if any script with a filename is running.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns a boolean indicating whether any instance of the specified script is running\\n * on the target server, regardless of its arguments.\\n *\\n * This is different than the isRunning function because it does not try to\\n * identify a specific instance of a running script by its arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if there is any script named foo.script running on the foodnstuff server, and false otherwise:\\n * scriptRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is any script named “foo.script” running on the current server, and false otherwise:\\n * scriptRunning(\\\"foo.script\\\", getHostname());\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * //The function call will return true if there is any script named foo.script running on the foodnstuff server, and false otherwise:\\n * ns.scriptRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is any script named “foo.script” running on the current server, and false otherwise:\\n * ns.scriptRunning(\\\"foo.script\\\", ns.getHostname());\\n * ```\\n * @param script - Filename of script to check. This is case-sensitive.\\n * @param host - Host of target server.\\n * @returns True if the specified script is running, and false otherwise.\\n */\\n scriptRunning(script: string, host: string): boolean;\\n\\n /**\\n * Kill all scripts with a filename.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Kills all scripts with the specified filename on the target server specified by hostname,\\n * regardless of arguments.\\n *\\n * @param script - Filename of script to kill. This is case-sensitive.\\n * @param host - Host of target server.\\n * @returns true if one or more scripts were successfully killed, and false if none were.\\n */\\n scriptKill(script: string, host: string): boolean;\\n\\n /**\\n * Returns the current script name.\\n *\\n * @remarks RAM cost: 0 GB\\n * @returns Current script name.\\n */\\n getScriptName(): string;\\n\\n /**\\n * Get the ram cost of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of RAM required to run the specified script on the target server.\\n * Returns 0 if the script does not exist.\\n *\\n * @param script - Filename of script. This is case-sensitive.\\n * @param host - Host of target server the script is located on. This is optional, If it is not specified then the function will se the current server as the target server.\\n * @returns Amount of RAM (in GB) required to run the specified script on the target server, and 0 if the script does not exist.\\n */\\n getScriptRam(script: string, host?: string): number;\\n\\n /**\\n * Get the execution time of a hack() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *When `hack` completes an amount of money is stolen depending on the player's skills.\\n * Returns the amount of time in milliseconds it takes to execute the hack Netscript function on the target server.\\n * The function takes in an optional hackLvl parameter that can be specified to see what the hack time would be at different hacking levels.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the hack Netscript function. Returns Infinity if called on a Hacknet Server.\\n */\\n getHackTime(host: string): number;\\n\\n /**\\n * Get the execution time of a grow() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns the amount of time in milliseconds it takes to execute the grow Netscript function on the target server.\\n * The function takes in an optional hackLvl parameter that can be specified to see what the grow time would be at different hacking levels.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the grow Netscript function. Returns Infinity if called on a Hacknet Server.\\n */\\n getGrowTime(host: string): number;\\n\\n /**\\n * Get the execution time of a weaken() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns the amount of time in milliseconds it takes to execute the weaken Netscript function on the target server.\\n * The function takes in an optional hackLvl parameter that can be specified to see what the weaken time would be at different hacking levels.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the weaken Netscript function. Returns Infinity if called on a Hacknet Server.\\n */\\n getWeakenTime(host: string): number;\\n\\n /**\\n * Get the income of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of income the specified script generates while online\\n * (when the game is open, does not apply for offline income). Remember that\\n * a script is uniquely identified by both its name and its arguments. So for\\n * example if you ran a script with the arguments “foodnstuff” and “5” then\\n * in order to use this function to get that script’s income you must specify\\n * those same arguments in the same order in this function call.\\n *\\n * This function can also be called with no arguments.\\n * If called with no arguments, then this function will return an array of two values.\\n * The first value is the total income (dollar / second) of all of your active scripts\\n * (scripts that are currently running on any server).\\n * The second value is the total income (dollar / second) that you’ve earned from scripts\\n * since you last installed Augmentations.\\n *\\n * @param script - Filename of script.\\n * @param host - Server on which script is running.\\n * @param args - Arguments that the script is running with.\\n * @returns Amount of income the specified script generates while online.\\n */\\n getScriptIncome(): [number, number];\\n getScriptIncome(script: string, host: string, ...args: string[]): number;\\n\\n /**\\n * Get the exp gain of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of hacking experience the specified script generates while online\\n * (when the game is open, does not apply for offline experience gains). Remember that a\\n * script is uniquely identified by both its name and its arguments.\\n *\\n * This function can also return the total experience gain rate of all of your active\\n * scripts by running the function with no arguments.\\n *\\n * @param script - Filename of script.\\n * @param host - Server on which script is running.\\n * @param args - Arguments that the script is running with.\\n * @returns Amount of hacking experience the specified script generates while online.\\n */\\n getScriptExpGain(): number;\\n getScriptExpGain(script: string, host: string, ...args: string[]): number;\\n\\n /**\\n * Returns the amount of time in milliseconds that have passed since you last installed Augmentations.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Time in milliseconds that have passed since you last installed Augmentations.\\n */\\n getTimeSinceLastAug(): number;\\n\\n /**\\n * Format a string.\\n *\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - String to format.\\n * @param args - Formating arguments.\\n * @returns Formated text.\\n */\\n sprintf(format: string, ...args: any[]): string;\\n\\n /**\\n * Format a string with an array of arguments.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - String to format.\\n * @param args - Formating arguments.\\n * @returns Formated text.\\n */\\n vsprintf(format: string, args: any[]): string;\\n\\n /**\\n * Format a number\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Converts a number into a string with the specified formatter.\\n * This uses the numeraljs library, so the formatters must be compatible with that.\\n * This is the same function that the game itself uses to display numbers.\\n *\\n * see: http://numeraljs.com/\\n * @param n - Number to format.\\n * @param format - Formatter.\\n * @returns Formated number.\\n */\\n nFormat(n: number, format: string): string;\\n\\n /**\\n * Format time to readable string\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param milliseconds - Number of millisecond to format.\\n * @param milliPrecision - Format time with subsecond precision, defaults to false.\\n * @returns The formatted time.\\n */\\n tFormat(milliseconds: number, milliPrecision?: boolean): string;\\n\\n /**\\n * Prompt the player with a Yes/No modal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Prompts the player with a dialog box with two options: “Yes” and “No”.\\n * This function will return true if the player click “Yes” and false if\\n * the player clicks “No”. The script’s execution is halted until the player\\n * selects one of the options.\\n *\\n * @param txt - Text to appear in the prompt dialog box.\\n * @returns True if the player click “Yes” and false if the player clicks “No”.\\n */\\n prompt(txt: string): Promise<boolean>;\\n\\n /**\\n * Open up a message box.\\n * @param msg - Message to alert.\\n */\\n alert(msg: any): void;\\n\\n /**\\n * Queue a toast (bottom-right notification).\\n * @param msg - Message in the toast.\\n * @param variant - Type of toast, must be one of success, info, warning, error. Defaults to success.\\n * @param duration - Duration of toast in ms. Can also be `null` to create a persistent toast. Defaults to 2000\\n */\\n toast(msg: any, variant?: string, duration?: number | null): void;\\n\\n /**\\n * Download a file from the internet.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Retrieves data from a URL and downloads it to a file on the specified server.\\n * The data can only be downloaded to a script (.script, .ns, .js) or a text file (.txt).\\n * If the file already exists, it will be overwritten by this command.\\n * Note that it will not be possible to download data from many websites because they\\n * do not allow cross-origin resource sharing (CORS).\\n *\\n * IMPORTANT: This is an asynchronous function that returns a Promise.\\n * The Promise’s resolved value will be a boolean indicating whether or not the data was\\n * successfully retrieved from the URL. Because the function is async and returns a Promise,\\n * it is recommended you use wget in NetscriptJS (Netscript 2.0).\\n *\\n * In NetscriptJS, you must preface any call to wget with the await keyword (like you would hack or sleep).\\n * wget will still work in Netscript 1.0, but the functions execution will not be synchronous\\n * (i.e. it may not execute when you expect/want it to).\\n * Furthermore, since Promises are not supported in ES5,\\n * you will not be able to process the returned value of wget in Netscript 1.0.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * wget(\\\"https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md\\\", \\\"game_readme.txt\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * await ns.wget(\\\"https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md\\\", \\\"game_readme.txt\\\");\\n * ```\\n * @param url - URL to pull data from.\\n * @param target - Filename to write data to. Must be script or text file.\\n * @param host - Optional hostname/ip of server for target file.\\n * @returns True if the data was successfully retrieved from the URL, false otherwise.\\n */\\n wget(url: string, target: string, host?: string): Promise<boolean>;\\n\\n /**\\n * Returns the amount of Faction favor required to be able to donate to a faction.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @returns Amount of Faction favor required to be able to donate to a faction.\\n */\\n getFavorToDonate(): number;\\n\\n /**\\n * Get the current Bitnode multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the current BitNode multipliers.\\n * This function requires you to be in Bitnode 5 or have Source-File 5 in order to run.\\n * The multipliers are returned in decimal forms (e.g. 1.5 instead of 150%).\\n * The multipliers represent the difference between the current BitNode and\\n * the original BitNode (BitNode-1).\\n *\\n * For example, if the CrimeMoney multiplier has a value of 0.1, then that means\\n * that committing crimes in the current BitNode will only give 10% of the money\\n * you would have received in BitNode-1.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var mults = getBitNodeMultipliers();\\n * print(mults.ServerMaxMoney);\\n * print(mults.HackExpGain);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const {ServerMaxMoney, HackExpGain} = ns.getBitNodeMultipliers();\\n * print(ServerMaxMoney);\\n * print(HackExpGain);\\n * ```\\n * @returns Object containing the current BitNode multipliers.\\n */\\n getBitNodeMultipliers(): BitNodeMultipliers;\\n\\n /**\\n * Get a list of acquired Source-Files.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Returns an array of source files\\n *\\n * @returns Array containing an object with number and level of the source file.\\n */\\n getOwnedSourceFiles(): SourceFileLvl[];\\n\\n /**\\n * Get information about the player.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Returns an object with information on the current player.\\n *\\n * @returns Player info\\n */\\n getPlayer(): Player;\\n\\n /**\\n * Add callback function when the script dies\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * NS2 exclusive\\n *\\n * Add callback to be executed when the script dies.\\n */\\n atExit(f: () => void): void;\\n\\n /**\\n * Move a file on the target server.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * NS2 exclusive\\n *\\n * Move the source file to the specified destination on the target server.\\n *\\n * This command only works for scripts and text files (.txt). It cannot, however, be used\\n * to convert from script to text file, or vice versa.\\n *\\n * This function can also be used to rename files.\\n *\\n * @param host - Host of target server.\\n * @param source - Filename of the source file.\\n * @param destination - Filename of the destination file.\\n */\\n mv(host: string, source: string, destination: string): void;\\n\\n /**\\n * Parse command line flags.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Allows unix like flag parsing.\\n * @example\\n * ```ts\\n * // example.script\\n * var data = flags([\\n * ['delay', 0], // a default number means this flag is a number\\n * ['server', 'foodnstuff'], // a default string means this flag is a string\\n * ['exclude', []], // a default array means this flag is a default array of string\\n * ['help', false], // a default boolean means this flag is a boolean\\n * ]);\\n * tprint(data);\\n *\\n * // example.ns\\n * export async function main(ns) {\\n * const data = ns.flags([\\n * ['delay', 0], // a default number means this flag is a number\\n * ['server', 'foodnstuff'], // a default string means this flag is a string\\n * ['exclude', []], // a default array means this flag is a default array of string\\n * ['help', false], // a default boolean means this flag is a boolean\\n * ]);\\n * ns.tprint(data);\\n * }\\n *\\n * // [home ~/]> run example.script\\n * // {\\\"_\\\":[],\\\"delay\\\":0,\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":false}\\n * // [home ~/]> run example.script --delay 3000\\n * // {\\\"_\\\":[],\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi\\n * // {\\\"_\\\":[],\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\"}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi hello world\\n * // {\\\"_\\\":[\\\"hello\\\",\\\"world\\\"],\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\"}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi hello world --exclude a --exclude b\\n * // {\\\"_\\\":[\\\"hello\\\",\\\"world\\\"],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\",\\\"exclude\\\":[\\\"a\\\",\\\"b\\\"]}\\n * // [home ~/]> run example.script --help\\n * // {\\\"_\\\":[],\\\"delay\\\":0,\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":true}\\n * ```\\n */\\n flags(schema: [string, string | number | boolean | string[]][]): any;\\n\\n /**\\n * Share your computer with your factions.\\n * @remarks\\n * RAM cost: 2.4 GB\\n *\\n * Increases your rep gain of hacking contracts while share is called.\\n * Scales with thread count.\\n */\\n share(): Promise<void>;\\n\\n /**\\n * Calculate your share power. Based on all the active share calls.\\n * @remarks\\n * RAM cost: 0.2 GB\\n */\\n getSharePower(): number;\\n}\\n\\n/**\\n * Corporation Office API\\n * @remarks\\n * Requires the Office API upgrade from your corporation.\\n * @public\\n */\\nexport interface OfficeAPI {\\n /**\\n * Assign an employee to a job.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param employeeName - name of the employee\\n * @param job - Name of the job.\\n * @returns A promise that is fulfilled when the assignment is complete.\\n */\\n assignJob(divisionName: string, cityName: string, employeeName: string, job: string): Promise<void>;\\n /**\\n * Hire an employee.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns The newly hired employee, if any\\n */\\n hireEmployee(divisionName: string, cityName: string): Employee | undefined;\\n /**\\n * Upgrade office size.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param size - Amount of positions to open\\n */\\n upgradeOfficeSize(divisionName: string, cityName: string, size: number): void;\\n /**\\n * Throw a party for your employees\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param costPerEmployee - Amount to spend per employee.\\n * @returns Amount of happiness increased.\\n */\\n throwParty(divisionName: string, cityName: string, costPerEmployee: number): Promise<number>;\\n /**\\n * Buy coffee for your employees\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns A promise that is fulfilled when the coffee is served.\\n */\\n buyCoffee(divisionName: string, cityName: string): Promise<void>;\\n /**\\n * Hire AdVert.\\n * @param divisionName - Name of the division\\n */\\n hireAdVert(divisionName: string): void;\\n /**\\n * Purchase a research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n */\\n research(divisionName: string, researchName: string): void;\\n /**\\n * Get data about an office\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns Office data\\n */\\n getOffice(divisionName: string, cityName: string): Office;\\n /**\\n * Get data about an employee\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param employeeName - Name of the employee\\n * @returns Employee data\\n */\\n getEmployee(divisionName: string, cityName: string, employeeName: string): Employee;\\n /**\\n * Get the cost to Hire AdVert\\n * @param divisionName - Name of the division\\n * @returns Cost\\n */\\n getHireAdVertCost(divisionName: string): number;\\n /**\\n * Get the number of times you have Hired AdVert\\n * @param divisionName - Name of the division\\n * @returns Number of times you have Hired AdVert\\n */\\n getHireAdVertCount(adivisionName: string): number;\\n /**\\n * Get the cost to unlock research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n * @returns cost\\n */\\n getResearchCost(divisionName: string, researchName: string): number;\\n /**\\n * Gets if you have unlocked a research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n * @returns true is unlocked, false if not\\n */\\n hasResearched(divisionName: string, researchName: string): boolean;\\n /**\\n * Set the auto job assignment for a job\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param job - Name of the job\\n * @param amount - Number of employees to assign to that job\\n * @returns A promise that is fulfilled when the assignment is complete.\\n */\\n setAutoJobAssignment(divisionName: string, cityName: string, job: string, amount: number): Promise<boolean>;\\n /**\\n * Cost to Upgrade office size.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param size - Amount of positions to open\\n * @returns Cost of upgrading the office\\n */\\n getOfficeSizeUpgradeCost(divisionName: string, cityName: string, asize: number): number;\\n}\\n\\n/**\\n * Corporation Warehouse API\\n * @remarks\\n * Requires the Warehouse API upgrade from your corporation.\\n * @public\\n */\\nexport interface WarehouseAPI {\\n /**\\n * Set material sell data.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount to sell, can be \\\"MAX\\\"\\n * @param price - Price to sell, can be \\\"MP\\\"\\n */\\n sellMaterial(divisionName: string, cityName: string, materialName: string, amt: string, price: string): void;\\n /**\\n * Set product sell data.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param amt - Amount to sell, can be \\\"MAX\\\"\\n * @param price - Price to sell, can be \\\"MP\\\"\\n * @param all - Sell in all city\\n */\\n sellProduct(\\n divisionName: string,\\n cityName: string,\\n productName: string,\\n amt: string,\\n price: string,\\n all: boolean,\\n ): void;\\n /**\\n * Discontinue a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n */\\n discontinueProduct(divisionName: string, productName: string): void;\\n /**\\n * Set smart supply\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param enabled - smart supply enabled\\n */\\n setSmartSupply(divisionName: string, cityName: string, enabled: boolean): void;\\n /**\\n * Set whether smart supply uses leftovers before buying\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param enabled - smart supply use leftovers enabled\\n */\\n setSmartSupplyUseLeftovers(divisionName: string, cityName: string, materialName: string, enabled: boolean): void;\\n /**\\n * Set material buy data\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to buy\\n */\\n buyMaterial(divisionName: string, cityName: string, materialName: string, amt: number): void;\\n /**\\n * Get warehouse data\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns warehouse data\\n */\\n getWarehouse(divisionName: string, cityName: string): Warehouse;\\n /**\\n * Get product data\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @returns product data\\n */\\n getProduct(divisionName: string, productName: string): Product;\\n /**\\n * Get material data\\n * @param divisionName - Name of the division\\n * @param materialName - Name of the material\\n * @returns material data\\n */\\n getMaterial(divisionName: string, cityName: string, materialName: string): Material;\\n /**\\n * Set market TA 1 for a material.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param on - market ta enabled\\n */\\n setMaterialMarketTA1(divisionName: string, cityName: string, materialName: string, on: boolean): void;\\n /**\\n * Set market TA 2 for a material.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param on - market ta enabled\\n */\\n setMaterialMarketTA2(divisionName: string, cityName: string, materialName: string, on: boolean): void;\\n /**\\n * Set market TA 1 for a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @param on - market ta enabled\\n */\\n setProductMarketTA1(divisionName: string, productName: string, on: boolean): void;\\n /**\\n * Set market TA 2 for a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @param on - market ta enabled\\n */\\n setProductMarketTA2(divisionName: string, productName: string, on: boolean): void;\\n /**\\n * Set material export data\\n * @param sourceDivision - Source division\\n * @param sourceCity - Source city\\n * @param targetDivision - Target division\\n * @param targetCity - Target city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to export.\\n */\\n exportMaterial(\\n sourceDivision: string,\\n sourceCity: string,\\n targetDivision: string,\\n targetCity: string,\\n materialName: string,\\n amt: number,\\n ): void;\\n /**\\n * Cancel material export\\n * @param sourceDivision - Source division\\n * @param sourceCity - Source city\\n * @param targetDivision - Target division\\n * @param targetCity - Target city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to export.\\n */\\n cancelExportMaterial(\\n sourceDivision: string,\\n sourceCity: string,\\n targetDivision: string,\\n targetCity: string,\\n materialName: string,\\n amt: number,\\n ): void;\\n /**\\n * Purchase warehouse for a new city\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n */\\n purchaseWarehouse(divisionName: string, cityName: string): void;\\n /**\\n * Upgrade warehouse\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n */\\n upgradeWarehouse(divisionName: string, cityName: string): void;\\n /**\\n * Create a new product\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param designInvest - Amount to invest for the design of the product.\\n * @param marketingInvest - Amount to invest for the marketing of the product.\\n */\\n makeProduct(\\n divisionName: string,\\n cityName: string,\\n productName: string,\\n designInvest: number,\\n marketingInvest: number,\\n ): void;\\n /**\\n * Gets the cost to purchase a warehouse\\n * @returns cost\\n */\\n getPurchaseWarehouseCost(): number;\\n /**\\n * Gets the cost to upgrade a warehouse to the next level\\n * @returns cost to upgrade\\n */\\n getUpgradeWarehouseCost(adivisionName: any, acityName: any): number;\\n /**\\n * Check if you have a warehouse in city\\n * @returns true if warehouse is present, false if not\\n */\\n hasWarehouse(adivisionName: any, acityName: any): boolean;\\n}\\n\\n/**\\n * Corporation API\\n * @public\\n */\\nexport interface Corporation extends WarehouseAPI, OfficeAPI {\\n /**\\n * Create a Corporation\\n * @param divisionName - Name of the division\\n * @param selfFund - If you should self fund, defaults to true, false will only work on Bitnode 3\\n * @returns true if created and false if not\\n */\\n createCorporation(corporationName: string, selfFund: boolean): boolean;\\n /**\\n * Check if you have a one time unlockable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns true if unlocked and false if not\\n */\\n hasUnlockUpgrade(upgradeName: string): boolean;\\n /**\\n * Gets the cost to unlock a one time unlockable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns cost of the upgrade\\n */\\n getUnlockUpgradeCost(upgradeName: string): number;\\n /**\\n * Get the level of a levelable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns the level of the upgrade\\n */\\n getUpgradeLevel(upgradeName: string): number;\\n /**\\n * Gets the cost to unlock the next level of a levelable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns cost of the upgrade\\n */\\n getUpgradeLevelCost(upgradeName: string): number;\\n /**\\n * Gets the cost to expand into a new industry\\n * @param industryName - Name of the industry\\n * @returns cost\\n */\\n getExpandIndustryCost(industryName: string): number;\\n /**\\n * Gets the cost to expand into a new city\\n * @returns cost\\n */\\n getExpandCityCost(): number;\\n /**\\n * Get an offer for investment based on you companies current valuation\\n * @returns An offer of investment\\n */\\n getInvestmentOffer(): InvestmentOffer;\\n /**\\n * Accept investment based on you companies current valuation\\n * @remarks\\n * Is based on current valuation and will not honer a specific Offer\\n * @returns An offer of investment\\n */\\n acceptInvestmentOffer(): boolean;\\n /**\\n * Go public\\n * @param numShares - number of shares you would like to issue for your IPO\\n * @returns true if you successfully go public, false if not\\n */\\n goPublic(numShares: number): boolean;\\n /**\\n * Bribe a faction\\n * @param factionName - Faction name\\n * @param amountCash - Amount of money to bribe\\n * @param amountShares - Amount of shares to bribe\\n * @returns True if successful, false if not\\n */\\n bribe(factionName: string, amountCash: number, amountShares: number): boolean;\\n /**\\n * Get corporation data\\n * @returns Corporation data\\n */\\n getCorporation(): CorporationInfo;\\n /**\\n * Get division data\\n * @param divisionName - Name of the division\\n * @returns Division data\\n */\\n getDivision(divisionName: string): Division;\\n /**\\n * Expand to a new industry\\n * @param industryType - Name of the industry\\n * @param divisionName - Name of the division\\n */\\n expandIndustry(industryType: string, divisionName: string): void;\\n /**\\n * Expand to a new city\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n */\\n expandCity(divisionName: string, cityName: string): void;\\n /**\\n * Unlock an upgrade\\n * @param upgradeName - Name of the upgrade\\n */\\n unlockUpgrade(upgradeName: string): void;\\n /**\\n * Level an upgrade.\\n * @param upgradeName - Name of the upgrade\\n */\\n levelUpgrade(upgradeName: string): void;\\n /**\\n * Issue dividends\\n * @param percent - Percent of profit to issue as dividends.\\n */\\n issueDividends(percent: number): void;\\n}\\n\\n/**\\n * General info about a corporation\\n * @public\\n */\\ninterface CorporationInfo {\\n /** Name of the corporation */\\n name: string;\\n /** Funds available */\\n funds: number;\\n /** Revenue per second this cycle */\\n revenue: number;\\n /** Expenses per second this cycle */\\n expenses: number;\\n /** Indicating if the company is public */\\n public: boolean;\\n /** Total number of shares issues by this corporation */\\n totalShares: number;\\n /** Amount of share owned */\\n numShares: number;\\n /** Cooldown until shares can be sold again */\\n shareSaleCooldown: number;\\n /** Amount of shares issued */\\n issuedShares: number;\\n /** Price of the shares */\\n sharePrice: number;\\n /** State of the corporation. Possible states are START, PURCHASE, PRODUCTION, SALE, EXPORT. */\\n state: string;\\n /** Array of all divisions */\\n divisions: Division[];\\n}\\n\\n/**\\n * Employee in an office\\n * @public\\n */\\ninterface Employee {\\n /** Name of the employee */\\n name: string;\\n /** Morale */\\n mor: number;\\n /** Happiness */\\n hap: number;\\n /** Energy */\\n ene: number;\\n int: number;\\n cha: number;\\n exp: number;\\n cre: number;\\n eff: number;\\n /** Salary */\\n sal: number;\\n /** City */\\n loc: string;\\n /** Current job */\\n pos: string;\\n}\\n\\n/**\\n * Product in a warehouse\\n * @public\\n */\\ninterface Product {\\n /** Name of the product */\\n name: string;\\n /** Demand for the product */\\n dmd: number;\\n /** Competition for the product */\\n cmp: number;\\n /** Production cost */\\n pCost: number;\\n /** Sell cost, can be \\\"MP+5\\\" */\\n sCost: string | number;\\n /** Data refers to the production, sale, and quantity of the products\\n * These values are specific to a city\\n * For each city, the data is [qty, prod, sell] */\\n cityData: { [key: string]: number[] };\\n /** Creation progress - A number between 0-100 representing percentage */\\n developmentProgress: number;\\n}\\n\\n/**\\n * Material in a warehouse\\n * @public\\n */\\ninterface Material {\\n /** Name of the material */\\n name: string;\\n /** Amount of material */\\n qty: number;\\n /** Quality of the material */\\n qlt: number;\\n /** Amount of material produced */\\n prod: number;\\n /** Amount of material sold */\\n sell: number;\\n}\\n\\n/**\\n * Warehouse for a division in a city\\n * @public\\n */\\ninterface Warehouse {\\n /** Amount of size upgrade bought */\\n level: number;\\n /** City in which the warehouse is located */\\n loc: string;\\n /** Total space in the warehouse */\\n size: number;\\n /** Used space in the warehouse */\\n sizeUsed: number;\\n /** Smart Supply status in the warehouse */\\n smartSupplyEnabled: boolean;\\n}\\n\\n/**\\n * Office for a division in a city.\\n * @public\\n */\\ninterface Office {\\n /** City of the office */\\n loc: string;\\n /** Maximum number of employee */\\n size: number;\\n /** Minimum amount of energy of the employees */\\n minEne: number;\\n /** Maximum amount of energy of the employees */\\n maxEne: number;\\n /** Minimum happiness of the employees */\\n minHap: number;\\n /** Maximum happiness of the employees */\\n maxHap: number;\\n /** Maximum morale of the employees */\\n maxMor: number;\\n /** Name of all the employees */\\n employees: string[];\\n /** Positions of the employees */\\n employeeProd: EmployeeJobs;\\n}\\n\\n/**\\n * Object representing the number of employee in each job.\\n * @public\\n */\\ninterface EmployeeJobs {\\n Operations: number;\\n Engineer: number;\\n Business: number;\\n Management: number;\\n \\\"Research & Development\\\": number;\\n Training: number;\\n Unassigned: number;\\n}\\n\\n/**\\n * Corporation division\\n * @public\\n */\\ninterface Division {\\n /** Name of the division */\\n name: string;\\n /** Type of division, like Aggriculture */\\n type: string;\\n /** Awareness of the division */\\n awareness: number;\\n /** Popularity of the division */\\n popularity: number;\\n /** Production multiplier */\\n prodMult: number;\\n /** Amount of research in that division */\\n research: number;\\n /** Revenue last cycle */\\n lastCycleRevenue: number;\\n /** Expenses last cycle */\\n lastCycleExpenses: number;\\n /** Revenue this cycle */\\n thisCycleRevenue: number;\\n /** Expenses this cycle */\\n thisCycleExpenses: number;\\n /** All research bought */\\n upgrades: number[];\\n /** Cities in which this division has expanded */\\n cities: string[];\\n /** Products developed by this division */\\n products: string[];\\n}\\n\\n/**\\n * Corporation investment offer\\n * @public\\n */\\ninterface InvestmentOffer {\\n /** Amount of funds you will get from this investment */\\n funds: number;\\n /** Amount of share you will give in exchange for this investment */\\n shares: number;\\n /** Current round of funding (max 4) */\\n round: number;\\n}\\n\\n/**\\n * Interface Theme\\n * @internal\\n */\\ninterface UserInterfaceTheme {\\n [key: string]: string | undefined;\\n primarylight: string;\\n primary: string;\\n primarydark: string;\\n successlight: string;\\n success: string;\\n successdark: string;\\n errorlight: string;\\n error: string;\\n errordark: string;\\n secondarylight: string;\\n secondary: string;\\n secondarydark: string;\\n warninglight: string;\\n warning: string;\\n warningdark: string;\\n infolight: string;\\n info: string;\\n infodark: string;\\n welllight: string;\\n well: string;\\n white: string;\\n black: string;\\n hp: string;\\n money: string;\\n hack: string;\\n combat: string;\\n cha: string;\\n int: string;\\n rep: string;\\n disabled: string;\\n backgroundprimary: string;\\n backgroundsecondary: string;\\n button: string;\\n}\\n\\n/**\\n * Interface Styles\\n * @internal\\n */\\ninterface IStyleSettings {\\n fontFamily: string;\\n lineHeight: number;\\n}\\n\\n/**\\n * Game Information\\n * @internal\\n */\\ninterface GameInfo {\\n version: string;\\n commit: string;\\n platform: string;\\n}\\n\";","import { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Milestones } from \"../Milestones\";\nimport { Milestone } from \"../Milestone\";\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nfunction highestMilestone(p: IPlayer, milestones: Milestone[]): number {\n let n = -1;\n for (let i = 0; i < milestones.length; i++) {\n if (milestones[i].fulfilled(p)) n = i;\n }\n\n return n;\n}\n\nexport function MilestonesRoot(props: IProps): JSX.Element {\n const n = highestMilestone(props.player, Milestones);\n const milestones = Milestones.map((milestone: Milestone, i: number) => {\n if (i <= n + 1) {\n return (\n <Typography key={i}>\n [{milestone.fulfilled(props.player) ? \"x\" : \" \"}] {milestone.title}\n </Typography>\n );\n }\n });\n return (\n <>\n <Typography variant=\"h4\">Milestones</Typography>\n <Box mx={2}>\n <Typography>\n Milestones don't reward you for completing them. They are here to guide you if you're lost. They will reset\n when you install Augmentations.\n </Typography>\n <br />\n\n <Typography>Completing fl1ght.exe</Typography>\n {milestones}\n </Box>\n </>\n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport { Link as MuiLink } from \"@mui/material\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Box from \"@mui/material/Box\";\nimport { ITerminal, Output, Link, RawOutput } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { TerminalInput } from \"./TerminalInput\";\nimport { TerminalEvents, TerminalClearEvents } from \"../TerminalEvents\";\nimport { BitFlumeModal } from \"../../BitNode/ui/BitFlumeModal\";\nimport { CodingContractModal } from \"../../ui/React/CodingContractModal\";\n\nimport _ from \"lodash\";\n\ninterface IActionTimerProps {\n terminal: ITerminal;\n}\n\nfunction ActionTimer({ terminal }: IActionTimerProps): React.ReactElement {\n return (\n <Typography color={\"primary\"} paragraph={false}>\n {terminal.getProgressText()}\n </Typography>\n );\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n nopadding: {\n padding: theme.spacing(0),\n },\n preformatted: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n },\n list: {\n padding: theme.spacing(0),\n height: \"100%\",\n },\n\n success: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.colors.success,\n },\n error: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.error.main,\n },\n primary: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.primary.main,\n },\n info: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.info.main,\n },\n warning: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.warning.main,\n },\n }),\n);\n\ninterface IProps {\n terminal: ITerminal;\n router: IRouter;\n player: IPlayer;\n}\n\nexport function TerminalRoot({ terminal, router, player }: IProps): React.ReactElement {\n const scrollHook = useRef<HTMLDivElement>(null);\n const setRerender = useState(0)[1];\n const [key, setKey] = useState(0);\n function rerender(): void {\n setRerender((old) => old + 1);\n }\n\n function clear(): void {\n setKey((key) => key + 1);\n }\n\n useEffect(() => {\n const debounced = _.debounce(async () => rerender(), 25, { maxWait: 50 });\n const unsubscribe = TerminalEvents.subscribe(debounced);\n return () => {\n debounced.cancel();\n unsubscribe();\n }\n }, []);\n\n useEffect(() => {\n const debounced = _.debounce(async () => clear(), 25, { maxWait: 50 });\n const unsubscribe = TerminalClearEvents.subscribe(debounced);\n return () => {\n debounced.cancel();\n unsubscribe();\n }\n }, []);\n\n function doScroll(): number | undefined {\n const hook = scrollHook.current;\n if (hook !== null) {\n return window.setTimeout(() => hook.scrollIntoView(true), 50);\n }\n }\n\n doScroll();\n\n useEffect(() => {\n let scrollId: number;\n const id = setTimeout(() => {\n scrollId = doScroll() ?? 0;\n }, 50);\n return () => {\n clearTimeout(id);\n clearTimeout(scrollId);\n }\n }, []);\n\n function lineClass(s: string): string {\n if (s === \"error\") {\n return classes.error;\n }\n if (s === \"success\") {\n return classes.success;\n }\n if (s === \"info\") {\n return classes.info;\n }\n if (s === \"warn\") {\n return classes.warning;\n }\n\n return classes.primary;\n }\n\n const classes = useStyles();\n return (\n <>\n <Box width=\"100%\" minHeight=\"100vh\" display={\"flex\"} alignItems={\"flex-end\"}>\n <List key={key} id=\"terminal\" classes={{ root: classes.list }}>\n {terminal.outputHistory.map((item, i) => {\n if (item instanceof Output)\n return (\n <ListItem key={i} classes={{ root: classes.nopadding }}>\n <Typography classes={{ root: lineClass(item.color) }} paragraph={false}>\n {item.text}\n </Typography>\n </ListItem>\n );\n if (item instanceof RawOutput)\n return (\n <ListItem key={i} classes={{ root: classes.nopadding }}>\n <Typography classes={{ root: classes.preformatted }} paragraph={false}>\n {item.raw}\n </Typography>\n </ListItem>\n );\n if (item instanceof Link)\n return (\n <ListItem key={i} classes={{ root: classes.nopadding }}>\n <Typography>{item.dashes}> </Typography>\n <MuiLink\n classes={{ root: classes.preformatted }}\n color={\"secondary\"}\n paragraph={false}\n onClick={() => terminal.connectToServer(player, item.hostname)}\n >\n <Typography>{item.hostname}</Typography>\n </MuiLink>\n </ListItem>\n );\n })}\n\n {terminal.action !== null && (\n <ListItem classes={{ root: classes.nopadding }}>\n <ActionTimer terminal={terminal} />{\" \"}\n </ListItem>\n )}\n </List>\n <div ref={scrollHook}></div>\n </Box>\n <Box position=\"sticky\" bottom={0} width=\"100%\" px={0}>\n <TerminalInput player={player} router={router} terminal={terminal} />\n </Box>\n <BitFlumeModal />\n <CodingContractModal />\n </>\n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport TextField from \"@mui/material/TextField\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { determineAllPossibilitiesForTabCompletion } from \"../determineAllPossibilitiesForTabCompletion\";\nimport { tabCompletion } from \"../tabCompletion\";\nimport { Settings } from \"../../Settings/Settings\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n margin: theme.spacing(0),\n },\n input: {\n backgroundColor: theme.colors.backgroundprimary,\n },\n nopadding: {\n padding: theme.spacing(0),\n },\n preformatted: {\n whiteSpace: \"pre-wrap\",\n margin: theme.spacing(0),\n },\n list: {\n padding: theme.spacing(0),\n height: \"100%\",\n },\n }),\n);\n\ninterface IProps {\n terminal: ITerminal;\n router: IRouter;\n player: IPlayer;\n}\n// Save command in case we de-load this screen.\nlet command = \"\";\n\nexport function TerminalInput({ terminal, router, player }: IProps): React.ReactElement {\n const terminalInput = useRef<HTMLInputElement>(null);\n\n const [value, setValue] = useState(command);\n const [postUpdateValue, setPostUpdateValue] = useState<{postUpdate: () => void} | null>()\n const [possibilities, setPossibilities] = useState<string[]>([]);\n const classes = useStyles();\n\n // If we have no data in the current terminal history, let's initialize it from the player save\n if (terminal.commandHistory.length === 0 && player.terminalCommandHistory.length > 0) {\n terminal.commandHistory = player.terminalCommandHistory;\n terminal.commandHistoryIndex = terminal.commandHistory.length;\n }\n\n // Need to run after state updates, for example if we need to move cursor\n // *after* we modify input\n useEffect(() => {\n if (postUpdateValue?.postUpdate) {\n postUpdateValue.postUpdate();\n setPostUpdateValue(null);\n }\n }, [postUpdateValue])\n\n function saveValue(newValue: string, postUpdate?: () => void): void {\n command = newValue;\n setValue(newValue);\n\n if (postUpdate) {\n setPostUpdateValue({postUpdate});\n }\n }\n\n function handleValueChange(event: React.ChangeEvent<HTMLInputElement>): void {\n saveValue(event.target.value);\n setPossibilities([]);\n }\n\n function modifyInput(mod: string): void {\n const ref = terminalInput.current;\n if (!ref) return;\n const inputLength = value.length;\n const start = ref.selectionStart;\n if (start === null) return;\n const inputText = ref.value;\n\n switch (mod.toLowerCase()) {\n case \"backspace\":\n if (start > 0 && start <= inputLength + 1) {\n saveValue(inputText.substr(0, start - 1) + inputText.substr(start));\n }\n break;\n case \"deletewordbefore\": // Delete rest of word before the cursor\n for (let delStart = start - 1; delStart > -2; --delStart) {\n if ((inputText.charAt(delStart) === \" \" || delStart === -1) && delStart !== start - 1) {\n saveValue(inputText.substr(0, delStart + 1) + inputText.substr(start), () => {\n // Move cursor to correct location\n // foo bar |baz bum --> foo |baz bum\n const ref = terminalInput.current;\n ref?.setSelectionRange(delStart+1, delStart+1);\n });\n return;\n }\n }\n break;\n case \"deletewordafter\": // Delete rest of word after the cursor, including trailing space\n for (let delStart = start + 1; delStart <= value.length + 1; ++delStart) {\n if (inputText.charAt(delStart) === \" \" || delStart === value.length + 1) {\n saveValue(inputText.substr(0, start) + inputText.substr(delStart + 1), () => {\n // Move cursor to correct location\n // foo bar |baz bum --> foo bar |bum\n const ref = terminalInput.current;\n ref?.setSelectionRange(start, start)\n });\n return;\n }\n }\n break;\n case \"clearafter\": // Deletes everything after cursor\n saveValue(inputText.substr(0, start));\n break;\n case \"clearbefore\": // Deletes everything before cursor\n saveValue(inputText.substr(start), () => moveTextCursor(\"home\"));\n break;\n }\n }\n\n function moveTextCursor(loc: string): void {\n const ref = terminalInput.current;\n if (!ref) return;\n const inputLength = value.length;\n const start = ref.selectionStart;\n if (start === null) return;\n\n switch (loc.toLowerCase()) {\n case \"home\":\n ref.setSelectionRange(0, 0);\n break;\n case \"end\":\n ref.setSelectionRange(inputLength, inputLength);\n break;\n case \"prevchar\":\n if (start > 0) {\n ref.setSelectionRange(start - 1, start - 1);\n }\n break;\n case \"prevword\":\n for (let i = start - 2; i >= 0; --i) {\n if (ref.value.charAt(i) === \" \") {\n ref.setSelectionRange(i + 1, i + 1);\n return;\n }\n }\n ref.setSelectionRange(0, 0);\n break;\n case \"nextchar\":\n ref.setSelectionRange(start + 1, start + 1);\n break;\n case \"nextword\":\n for (let i = start + 1; i <= inputLength; ++i) {\n if (ref.value.charAt(i) === \" \") {\n ref.setSelectionRange(i, i);\n return;\n }\n }\n ref.setSelectionRange(inputLength, inputLength);\n break;\n default:\n console.warn(\"Invalid loc argument in Terminal.moveTextCursor()\");\n break;\n }\n }\n\n // Catch all key inputs and redirect them to the terminal.\n useEffect(() => {\n function keyDown(this: Document, event: KeyboardEvent): void {\n if (terminal.contractOpen) return;\n if (terminal.action !== null && event.keyCode === KEY.C && event.ctrlKey) {\n terminal.finishAction(router, player, true);\n return;\n }\n const ref = terminalInput.current;\n if (event.ctrlKey || event.metaKey) return;\n if (event.keyCode === KEY.C && (event.ctrlKey || event.metaKey)) return; // trying to copy\n\n if (ref) ref.focus();\n }\n document.addEventListener(\"keydown\", keyDown);\n return () => document.removeEventListener(\"keydown\", keyDown);\n });\n\n async function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): Promise<void> {\n // Run command.\n if (event.keyCode === KEY.ENTER && value !== \"\") {\n event.preventDefault();\n terminal.print(`[${player.getCurrentServer().hostname} ~${terminal.cwd()}]> ${value}`);\n terminal.executeCommands(router, player, value);\n saveValue(\"\");\n return;\n }\n\n // Autocomplete\n if (event.keyCode === KEY.TAB && value !== \"\") {\n event.preventDefault();\n\n let copy = value;\n const semiColonIndex = copy.lastIndexOf(\";\");\n if (semiColonIndex !== -1) {\n copy = copy.slice(semiColonIndex + 1);\n }\n\n copy = copy.trim();\n copy = copy.replace(/\\s\\s+/g, \" \");\n\n const commandArray = copy.split(\" \");\n let index = commandArray.length - 2;\n if (index < -1) {\n index = 0;\n }\n const allPos = await determineAllPossibilitiesForTabCompletion(player, copy, index, terminal.cwd());\n if (allPos.length == 0) {\n return;\n }\n\n let arg = \"\";\n let command = \"\";\n if (commandArray.length == 0) {\n return;\n }\n if (commandArray.length == 1) {\n command = commandArray[0];\n } else if (commandArray.length == 2) {\n command = commandArray[0];\n arg = commandArray[1];\n } else if (commandArray.length == 3) {\n command = commandArray[0] + \" \" + commandArray[1];\n arg = commandArray[2];\n } else {\n arg = commandArray.pop() + \"\";\n command = commandArray.join(\" \");\n }\n\n let newValue = tabCompletion(command, arg, allPos, value);\n if (typeof newValue === \"string\" && newValue !== \"\") {\n if (!newValue.endsWith(\" \") && !newValue.endsWith(\"/\") && allPos.length === 1) newValue += \" \";\n saveValue(newValue);\n }\n if (Array.isArray(newValue)) {\n setPossibilities(newValue);\n }\n }\n\n // Clear screen.\n if (event.keyCode === KEY.L && event.ctrlKey) {\n event.preventDefault();\n terminal.clear();\n }\n\n // Select previous command.\n if (event.keyCode === KEY.UPARROW || (Settings.EnableBashHotkeys && event.keyCode === KEY.P && event.ctrlKey)) {\n if (Settings.EnableBashHotkeys) {\n event.preventDefault();\n }\n const i = terminal.commandHistoryIndex;\n const len = terminal.commandHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n terminal.commandHistoryIndex = len;\n }\n\n if (i != 0) {\n --terminal.commandHistoryIndex;\n }\n const prevCommand = terminal.commandHistory[terminal.commandHistoryIndex];\n saveValue(prevCommand);\n const ref = terminalInput.current;\n if (ref) {\n setTimeout(function () {\n ref.selectionStart = ref.selectionEnd = 10000;\n }, 10);\n }\n }\n\n // Select next command\n if (event.keyCode === KEY.DOWNARROW || (Settings.EnableBashHotkeys && event.keyCode === KEY.M && event.ctrlKey)) {\n if (Settings.EnableBashHotkeys) {\n event.preventDefault();\n }\n const i = terminal.commandHistoryIndex;\n const len = terminal.commandHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n terminal.commandHistoryIndex = len;\n }\n\n // Latest command, put nothing\n if (i == len || i == len - 1) {\n terminal.commandHistoryIndex = len;\n saveValue(\"\");\n } else {\n ++terminal.commandHistoryIndex;\n const prevCommand = terminal.commandHistory[terminal.commandHistoryIndex];\n saveValue(prevCommand);\n }\n }\n\n // Extra Bash Emulation Hotkeys, must be enabled through options\n if (Settings.EnableBashHotkeys) {\n if (event.keyCode === KEY.A && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"home\");\n }\n\n if (event.keyCode === KEY.E && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"end\");\n }\n\n if (event.keyCode === KEY.B && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"prevchar\");\n }\n\n if (event.keyCode === KEY.B && event.altKey) {\n event.preventDefault();\n moveTextCursor(\"prevword\");\n }\n\n if (event.keyCode === KEY.F && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"nextchar\");\n }\n\n if (event.keyCode === KEY.F && event.altKey) {\n event.preventDefault();\n moveTextCursor(\"nextword\");\n }\n\n if ((event.keyCode === KEY.H || event.keyCode === KEY.D) && event.ctrlKey) {\n modifyInput(\"backspace\");\n event.preventDefault();\n }\n\n if (event.keyCode === KEY.W && event.ctrlKey) {\n event.preventDefault();\n modifyInput(\"deletewordbefore\");\n }\n \n if (event.keyCode === KEY.D && event.altKey) {\n event.preventDefault();\n modifyInput(\"deletewordafter\");\n }\n \n if (event.keyCode === KEY.U && event.ctrlKey) {\n event.preventDefault();\n modifyInput(\"clearbefore\");\n }\n\n if (event.keyCode === KEY.K && event.ctrlKey) {\n event.preventDefault();\n modifyInput(\"clearafter\");\n }\n }\n }\n\n return (\n <>\n <Tooltip\n title={\n possibilities.length > 0 ? (\n <>\n <Typography classes={{ root: classes.preformatted }} color={\"primary\"} paragraph={false}>\n Possible autocomplete candidate:\n </Typography>\n <Typography classes={{ root: classes.preformatted }} color={\"primary\"} paragraph={false}>\n {possibilities.join(\" \")}\n </Typography>\n </>\n ) : (\n \"\"\n )\n }\n >\n <TextField\n fullWidth\n color={terminal.action === null ? \"primary\" : \"secondary\"}\n autoFocus\n disabled={terminal.action !== null}\n autoComplete=\"off\"\n value={value}\n classes={{ root: classes.textfield }}\n onChange={handleValueChange}\n inputRef={terminalInput}\n InputProps={{\n // for players to hook in\n id: \"terminal-input\",\n className: classes.input,\n startAdornment: (\n <Typography color={terminal.action === null ? \"primary\" : \"secondary\"} flexShrink={0}>\n [{player.getCurrentServer().hostname} ~{terminal.cwd()}]> \n </Typography>\n ),\n spellCheck: false,\n onKeyDown: onKeyDown,\n }}\n ></TextField>\n </Tooltip>\n </>\n );\n}\n","import { evaluateDirectoryPath, getAllParentDirectories } from \"./DirectoryHelpers\";\nimport { getSubdirectories } from \"./DirectoryServerHelpers\";\n\nimport { Aliases, GlobalAliases, substituteAliases } from \"../Alias\";\nimport { DarkWebItems } from \"../DarkWeb/DarkWebItems\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\nimport { ParseCommand, ParseCommands } from \"./Parser\";\nimport { HelpTexts } from \"./HelpText\";\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\nimport { compile } from \"../NetscriptJSEvaluator\";\nimport { Flags } from \"../NetscriptFunctions/Flags\";\nimport * as libarg from \"arg\";\n\n// An array of all Terminal commands\nconst commands = [\n \"alias\",\n \"analyze\",\n \"backdoor\",\n \"cat\",\n \"cd\",\n \"check\",\n \"clear\",\n \"cls\",\n \"connect\",\n \"cp\",\n \"download\",\n \"expr\",\n \"free\",\n \"grow\",\n \"hack\",\n \"help\",\n \"home\",\n \"hostname\",\n \"ifconfig\",\n \"kill\",\n \"killall\",\n \"ls\",\n \"lscpu\",\n \"mem\",\n \"mv\",\n \"nano\",\n \"ps\",\n \"rm\",\n \"run\",\n \"scan-analyze\",\n \"scan\",\n \"scp\",\n \"sudov\",\n \"tail\",\n \"theme\",\n \"top\",\n \"vim\",\n \"weaken\",\n];\n\nexport async function determineAllPossibilitiesForTabCompletion(\n p: IPlayer,\n input: string,\n index: number,\n currPath = \"\",\n): Promise<string[]> {\n input = substituteAliases(input);\n let allPos: string[] = [];\n allPos = allPos.concat(Object.keys(GlobalAliases));\n const currServ = p.getCurrentServer();\n const homeComputer = p.getHomeComputer();\n\n let parentDirPath = \"\";\n let evaledParentDirPath: string | null = null;\n\n // Helper functions\n function addAllCodingContracts(): void {\n for (const cct of currServ.contracts) {\n allPos.push(cct.fn);\n }\n }\n\n function addAllLitFiles(): void {\n for (const file of currServ.messages) {\n if (!file.endsWith(\".msg\")) {\n allPos.push(file);\n }\n }\n }\n\n function addAllMessages(): void {\n for (const file of currServ.messages) {\n if (file.endsWith(\".msg\")) {\n allPos.push(file);\n }\n }\n }\n\n function addAllPrograms(): void {\n for (const program of homeComputer.programs) {\n allPos.push(program);\n }\n }\n\n function addAllScripts(): void {\n for (const script of currServ.scripts) {\n const res = processFilepath(script.filename);\n if (res) {\n allPos.push(res);\n }\n }\n }\n\n function addAllTextFiles(): void {\n for (const txt of currServ.textFiles) {\n const res = processFilepath(txt.fn);\n if (res) {\n allPos.push(res);\n }\n }\n }\n\n function addAllDirectories(): void {\n // Directories are based on the currently evaluated path\n const subdirs = getSubdirectories(currServ, evaledParentDirPath == null ? \"/\" : evaledParentDirPath);\n\n for (let i = 0; i < subdirs.length; ++i) {\n const assembledDirPath = evaledParentDirPath == null ? subdirs[i] : evaledParentDirPath + subdirs[i];\n const res = processFilepath(assembledDirPath);\n if (res != null) {\n subdirs[i] = res;\n }\n }\n\n allPos = allPos.concat(subdirs);\n }\n\n // Convert from the real absolute path back to the original path used in the input\n function convertParentPath(filepath: string): string {\n if (parentDirPath == null || evaledParentDirPath == null) {\n console.warn(`convertParentPath() called when paths are null`);\n return filepath;\n }\n\n if (!filepath.startsWith(evaledParentDirPath)) {\n console.warn(\n `convertParentPath() called for invalid path. (filepath=${filepath}) (evaledParentDirPath=${evaledParentDirPath})`,\n );\n return filepath;\n }\n\n return parentDirPath + filepath.slice(evaledParentDirPath.length);\n }\n\n // Given an a full, absolute filepath, converts it to the proper value\n // for autocompletion purposes\n function processFilepath(filepath: string): string | null {\n if (evaledParentDirPath) {\n if (filepath.startsWith(evaledParentDirPath)) {\n return convertParentPath(filepath);\n }\n } else if (parentDirPath !== \"\") {\n // If the parent directory is the root directory, but we're not searching\n // it from the root directory, we have to add the original path\n let t_parentDirPath = parentDirPath;\n if (!t_parentDirPath.endsWith(\"/\")) {\n t_parentDirPath += \"/\";\n }\n return parentDirPath + filepath;\n } else {\n return filepath;\n }\n\n return null;\n }\n\n function isCommand(cmd: string): boolean {\n let t_cmd = cmd;\n if (!t_cmd.endsWith(\" \")) {\n t_cmd += \" \";\n }\n\n return input.startsWith(t_cmd);\n }\n\n // Autocomplete the command\n if (index === -1 && !input.startsWith('./')) {\n return commands.concat(Object.keys(Aliases)).concat(Object.keys(GlobalAliases));\n }\n\n // Since we're autocompleting an argument and not a command, the argument might\n // be a file/directory path. We have to account for that when autocompleting\n const commandArray = input.split(\" \");\n if (commandArray.length === 0) {\n console.warn(`Tab autocompletion logic reached invalid branch`);\n return allPos;\n }\n const arg = commandArray[commandArray.length - 1];\n parentDirPath = getAllParentDirectories(arg);\n evaledParentDirPath = evaluateDirectoryPath(parentDirPath, currPath);\n if (evaledParentDirPath === \"/\") {\n evaledParentDirPath = null;\n } else if (evaledParentDirPath == null) {\n return allPos; // Invalid path\n } else {\n evaledParentDirPath += \"/\";\n }\n\n if (isCommand(\"buy\")) {\n const options = [];\n for (const i of Object.keys(DarkWebItems)) {\n const item = DarkWebItems[i];\n options.push(item.program);\n }\n\n return options.concat(Object.keys(GlobalAliases));\n }\n\n if (isCommand(\"scp\") && index === 1) {\n for (const server of GetAllServers()) {\n allPos.push(server.hostname);\n }\n\n return allPos;\n }\n\n if (isCommand(\"scp\") && index === 0) {\n addAllScripts();\n addAllLitFiles();\n addAllTextFiles();\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"cp\") && index === 0) {\n addAllScripts();\n addAllTextFiles();\n addAllDirectories();\n return allPos;\n }\n\n if (isCommand(\"connect\")) {\n // All network connections\n for (let i = 0; i < currServ.serversOnNetwork.length; ++i) {\n const serv = GetServer(currServ.serversOnNetwork[i]);\n if (serv == null) {\n continue;\n }\n allPos.push(serv.hostname);\n }\n\n return allPos;\n }\n\n if (isCommand(\"nano\") || isCommand(\"vim\")) {\n addAllScripts();\n addAllTextFiles();\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"rm\")) {\n addAllScripts();\n addAllPrograms();\n addAllLitFiles();\n addAllTextFiles();\n addAllCodingContracts();\n addAllDirectories();\n\n return allPos;\n }\n\n async function scriptAutocomplete(): Promise<string[] | undefined> {\n if (!isCommand(\"run\") && !isCommand(\"tail\") && !isCommand(\"kill\") && !input.startsWith(\"./\")) return;\n let copy = input;\n if (input.startsWith(\"./\")) copy = \"run \" + input.slice(2);\n const commands = ParseCommands(copy);\n if (commands.length === 0) return;\n const command = ParseCommand(commands[commands.length - 1]);\n const filename = command[1] + \"\";\n if (!isScriptFilename(filename)) return; // Not a script.\n if (filename.endsWith(\".script\")) return; // Doesn't work with ns1.\n // Use regex to remove any leading './', and then check if it matches against\n // the output of processFilepath or if it matches with a '/' prepended,\n // this way autocomplete works inside of directories\n const script = currServ.scripts.find((script) => {\n const fn = filename.replace(/^\\.\\//g, '');\n return (processFilepath(script.filename) === fn || script.filename === '/' + fn);\n })\n if (!script) return; // Doesn't exist.\n if (!script.module) {\n await compile(p, script, currServ.scripts);\n }\n const loadedModule = await script.module;\n if (!loadedModule.autocomplete) return; // Doesn't have an autocomplete function.\n\n const runArgs = { \"--tail\": Boolean, \"-t\": Number };\n const flags = libarg(runArgs, {\n permissive: true,\n argv: command.slice(2),\n });\n const flagFunc = Flags(flags._);\n let pos: string[] = [];\n let pos2: string[] = [];\n pos = pos.concat(\n loadedModule.autocomplete(\n {\n servers: GetAllServers().map((server) => server.hostname),\n scripts: currServ.scripts.map((script) => script.filename),\n txts: currServ.textFiles.map((txt) => txt.fn),\n flags: (schema: any) => {\n pos2 = schema.map((f: any) => {\n if (f[0].length === 1) return \"-\" + f[0];\n return \"--\" + f[0];\n });\n try {\n return flagFunc(schema);\n } catch (err) {\n return undefined;\n }\n },\n },\n flags._,\n ),\n );\n return pos.concat(pos2);\n }\n const pos = await scriptAutocomplete();\n if (pos) return pos;\n\n // If input starts with './', essentially treat it as a slimmer\n // invocation of `run`.\n if (input.startsWith(\"./\")) {\n // All programs and scripts\n for (const script of currServ.scripts) {\n const res = processFilepath(script.filename);\n if (res) {\n allPos.push(res);\n }\n }\n\n for (const program of currServ.programs) {\n const res = processFilepath(program);\n if (res) {\n allPos.push(res);\n }\n }\n\n // All coding contracts\n for (const cct of currServ.contracts) {\n const res = processFilepath(cct.fn);\n if (res) {\n allPos.push(res);\n }\n }\n\n return allPos;\n }\n\n if (isCommand(\"run\")) {\n addAllScripts();\n addAllPrograms();\n addAllCodingContracts();\n addAllDirectories();\n }\n\n if (isCommand(\"kill\") || isCommand(\"tail\") || isCommand(\"mem\") || isCommand(\"check\")) {\n addAllScripts();\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"cat\")) {\n addAllMessages();\n addAllLitFiles();\n addAllTextFiles();\n addAllDirectories();\n addAllScripts();\n\n return allPos;\n }\n\n if (isCommand(\"download\") || isCommand(\"mv\")) {\n addAllScripts();\n addAllTextFiles();\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"cd\")) {\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"ls\") && index === 0) {\n addAllDirectories();\n }\n\n if (isCommand(\"help\")) {\n // Get names from here instead of commands array because some\n // undocumented/nonexistent commands are in the array\n return Object.keys(HelpTexts);\n }\n\n return allPos;\n}\n","/**\n * Helper functions that implement \"directory\" functionality in the Terminal.\n * These aren't \"real\" directories, it's more of a pseudo-directory implementation\n * that uses mainly string manipulation.\n *\n * This file contains function that deal with Server-related directory things.\n * Functions that deal with the string manipulation can be found in\n * ./DirectoryHelpers.ts\n */\nimport { isValidDirectoryPath, isInRootDirectory, getFirstParentDirectory } from \"./DirectoryHelpers\";\nimport { BaseServer } from \"../Server/BaseServer\";\n\n/**\n * Given a directory (by the full directory path) and a server, returns all\n * subdirectories of that directory. This is only for FIRST-LEVEl/immediate subdirectories\n */\nexport function getSubdirectories(serv: BaseServer, dir: string): string[] {\n const res: string[] = [];\n\n if (!isValidDirectoryPath(dir)) {\n return res;\n }\n\n let t_dir = dir;\n if (!t_dir.endsWith(\"/\")) {\n t_dir += \"/\";\n }\n\n function processFile(fn: string): void {\n if (t_dir === \"/\" && isInRootDirectory(fn)) {\n const subdir = getFirstParentDirectory(fn);\n if (subdir !== \"/\" && !res.includes(subdir)) {\n res.push(subdir);\n }\n } else if (fn.startsWith(t_dir)) {\n const remaining = fn.slice(t_dir.length);\n const subdir = getFirstParentDirectory(remaining);\n if (subdir !== \"/\" && !res.includes(subdir)) {\n res.push(subdir);\n }\n }\n }\n\n for (const script of serv.scripts) {\n processFile(script.filename);\n }\n\n for (const txt of serv.textFiles) {\n processFile(txt.fn);\n }\n\n return res;\n}\n","export class ScriptUrl {\n filename: string;\n url: string;\n moduleSequenceNumber: number;\n\n constructor(filename: string, url: string, moduleSequenceNumber: number) {\n this.filename = filename;\n this.url = url;\n this.moduleSequenceNumber = moduleSequenceNumber;\n }\n}\n","import { containsAllStrings, longestCommonStart } from \"../utils/StringHelperFunctions\";\n\n/**\n * Implements tab completion for the Terminal\n *\n * @param command {string} Terminal command, excluding the last incomplete argument\n * @param arg {string} Last argument that is being completed\n * @param allPossibilities {string[]} All values that `arg` can complete to\n */\nexport function tabCompletion(\n command: string,\n arg: string,\n allPossibilities: string[],\n oldValue: string,\n): string[] | string | undefined {\n if (!(allPossibilities.constructor === Array)) {\n return;\n }\n if (!containsAllStrings(allPossibilities)) {\n return;\n }\n\n // Remove all options in allPossibilities that do not match the current string\n // that we are attempting to autocomplete\n if (arg === \"\") {\n for (let i = allPossibilities.length - 1; i >= 0; --i) {\n if (!allPossibilities[i].toLowerCase().startsWith(command.toLowerCase())) {\n allPossibilities.splice(i, 1);\n }\n }\n } else {\n for (let i = allPossibilities.length - 1; i >= 0; --i) {\n if (!allPossibilities[i].toLowerCase().startsWith(arg.toLowerCase())) {\n allPossibilities.splice(i, 1);\n }\n }\n }\n\n const semiColonIndex = oldValue.lastIndexOf(\";\");\n\n let val = \"\";\n if (allPossibilities.length === 0) {\n return;\n } else if (allPossibilities.length === 1) {\n if (arg === \"\") {\n //Autocomplete command\n val = allPossibilities[0];\n } else {\n val = command + \" \" + allPossibilities[0];\n }\n\n if (semiColonIndex === -1) {\n // No semicolon, so replace the whole command\n return val;\n } else {\n // Replace only after the last semicolon\n return oldValue.slice(0, semiColonIndex + 1) + \" \" + val;\n }\n } else {\n const longestStartSubstr = longestCommonStart(allPossibilities);\n /**\n * If the longest common starting substring of remaining possibilities is the same\n * as whatevers already in terminal, just list all possible options. Otherwise,\n * change the input in the terminal to the longest common starting substr\n */\n if (arg === \"\") {\n if (longestStartSubstr === command) {\n return allPossibilities;\n } else {\n if (semiColonIndex === -1) {\n // No semicolon, so replace the whole command\n return longestStartSubstr;\n } else {\n // Replace only after the last semicolon\n return `${oldValue.slice(0, semiColonIndex + 1)} ${longestStartSubstr}`;\n }\n }\n } else {\n if (longestStartSubstr === arg) {\n // List all possible options\n return allPossibilities;\n } else {\n if (semiColonIndex == -1) {\n // No semicolon, so replace the whole command\n return `${command} ${longestStartSubstr}`;\n } else {\n // Replace only after the last semicolon\n return `${oldValue.slice(0, semiColonIndex + 1)} ${command} ${longestStartSubstr}`;\n }\n }\n }\n }\n}\n","import React, { useState } from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Link from \"@mui/material/Link\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\n\ninterface IProps {\n reactivateTutorial: () => void;\n}\n\nexport function TutorialRoot(props: IProps): React.ReactElement {\n const [confirmResetOpen, setConfirmResetOpen] = useState(false);\n return (\n <>\n <Typography variant=\"h4\">Tutorial / Documentation</Typography>\n <Box m={2}>\n <Button onClick={() => setConfirmResetOpen(true)}>Soft reset and Restart tutorial</Button>\n <ConfirmationModal\n open={confirmResetOpen}\n onClose={() => setConfirmResetOpen(false)}\n onConfirm={props.reactivateTutorial}\n confirmationText={\"This will reset all your stats to 1 and money to 1k. Are you sure?\"}\n />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/guidesandtips/gettingstartedguideforbeginnerprogrammers.html\"\n >\n <Typography>Getting Started</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/servers.html\"\n >\n <Typography>Servers & Networking</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/hacking.html\"\n >\n <Typography>Hacking</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/scripts.html\"\n >\n <Typography>Scripts</Typography>\n </Link>\n <br />\n <Link color=\"primary\" target=\"_blank\" href=\"https://bitburner.readthedocs.io/en/latest/netscript.html\">\n <Typography>Netscript Programming Language</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/world.html\"\n >\n <Typography>Traveling</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/companies.html\"\n >\n <Typography>Companies</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/infiltration.html\"\n >\n <Typography>Infiltration</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/factions.html\"\n >\n <Typography>Factions</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/basicgameplay/augmentations.html\"\n >\n <Typography>Augmentations</Typography>\n </Link>\n <br />\n <Link color=\"primary\" target=\"_blank\" href=\"https://bitburner.readthedocs.io/en/latest/shortcuts.html\">\n <Typography>Keyboard Shortcuts</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/netscript/netscriptlearntoprogram.html#netscript-1-0-vs-netscript-2-0\"\n >\n <Typography>NS1 vs NS2 (or .script vs .js)</Typography>\n </Link>\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/netscript/netscriptfunctions.html\"\n >\n <Typography>Simplified list of functions</Typography>\n </Link>\n\n <br />\n <Link\n color=\"primary\"\n target=\"_blank\"\n href=\"https://github.com/danielyxie/bitburner/blob/dev/markdown/bitburner.ns.md\"\n >\n <Typography>Complete list of functions</Typography>\n </Link>\n </Box>\n </>\n );\n}\n","/**\n * Root React Component for the \"Active Scripts\" UI page. This page displays\n * and provides information about all of the player's scripts that are currently running\n */\nimport React, { useState, useEffect } from \"react\";\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nimport { ActiveScriptsPage } from \"./ActiveScriptsPage\";\nimport { RecentScriptsPage } from \"./RecentScriptsPage\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\ninterface IProps {\n workerScripts: Map<number, WorkerScript>;\n}\n\nexport function ActiveScriptsRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const [tab, setTab] = useState<\"active\" | \"recent\">(\"active\");\n function handleChange(event: React.SyntheticEvent, tab: \"active\" | \"recent\"): void {\n setTab(tab);\n }\n return (\n <>\n <Tabs variant=\"fullWidth\" value={tab} onChange={handleChange}>\n <Tab label={\"Active\"} value={\"active\"} />\n <Tab label={\"Recent\"} value={\"recent\"} />\n </Tabs>\n\n {tab === \"active\" && <ActiveScriptsPage workerScripts={props.workerScripts} />}\n {tab === \"recent\" && <RecentScriptsPage />}\n </>\n );\n}\n","/**\n * Root React Component for the \"Active Scripts\" UI page. This page displays\n * and provides information about all of the player's scripts that are currently running\n */\nimport React from \"react\";\n\nimport { ScriptProduction } from \"./ScriptProduction\";\nimport { ServerAccordions } from \"./ServerAccordions\";\n\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n workerScripts: Map<number, WorkerScript>;\n}\n\nexport function ActiveScriptsPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n This page displays a list of all of your scripts that are currently running across every machine. It also\n provides information about each script's production. The scripts are categorized by the hostname of the servers\n on which they are running.\n </Typography>\n\n <ScriptProduction />\n <ServerAccordions {...props} />\n </>\n );\n}\n","/**\n * React Component for displaying the total production and production rate\n * of scripts on the 'Active Scripts' UI page\n */\nimport * as React from \"react\";\n\nimport { Money } from \"../React/Money\";\nimport { MoneyRate } from \"../React/MoneyRate\";\nimport { use } from \"../Context\";\n\nimport Typography from \"@mui/material/Typography\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n cell: {\n borderBottom: \"none\",\n padding: theme.spacing(1),\n margin: theme.spacing(1),\n whiteSpace: \"nowrap\",\n },\n size: {\n width: \"1px\",\n },\n }),\n);\nexport function ScriptProduction(): React.ReactElement {\n const player = use.Player();\n const classes = useStyles();\n const prodRateSinceLastAug = player.scriptProdSinceLastAug / (player.playtimeSinceLastAug / 1000);\n\n return (\n <Table size=\"small\" classes={{ root: classes.size }}>\n <TableBody>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography variant=\"body2\">Total production since last Augment Installation:</Typography>\n </TableCell>\n <TableCell align=\"left\" classes={{ root: classes.cell }}>\n <Typography variant=\"body2\">\n <Money money={player.scriptProdSinceLastAug} />\n </Typography>\n </TableCell>\n <TableCell align=\"left\" classes={{ root: classes.cell }}>\n <Typography variant=\"body2\">\n (<MoneyRate money={prodRateSinceLastAug} />)\n </Typography>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n );\n}\n","/**\n * React Component for rendering the Accordion elements for all servers\n * on which scripts are running\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { ServerAccordion } from \"./ServerAccordion\";\n\nimport TextField from \"@mui/material/TextField\";\nimport List from \"@mui/material/List\";\nimport TablePagination from \"@mui/material/TablePagination\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { WorkerScriptStartStopEventEmitter } from \"../../Netscript/WorkerScriptStartStopEventEmitter\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { TablePaginationActionsAll } from \"../React/TablePaginationActionsAll\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\n// Map of server hostname -> all workerscripts on that server for all active scripts\ninterface IServerData {\n server: BaseServer;\n workerScripts: WorkerScript[];\n}\n\ninterface IServerToScriptsMap {\n [key: string]: IServerData | undefined;\n}\n\ntype IProps = {\n workerScripts: Map<number, WorkerScript>;\n};\n\nexport function ServerAccordions(props: IProps): React.ReactElement {\n const [filter, setFilter] = useState(\"\");\n const [page, setPage] = useState(0);\n const [rowsPerPage, setRowsPerPage] = useState(Settings.ActiveScriptsServerPageSize);\n const setRerender = useState(false)[1];\n\n const handleChangePage = (event: unknown, newPage: number): void => {\n setPage(newPage);\n };\n\n const handleChangeRowsPerPage = (event: React.ChangeEvent<HTMLInputElement>): void => {\n Settings.ActiveScriptsServerPageSize = parseInt(event.target.value, 10);\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n };\n\n function handleFilterChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setFilter(event.target.value);\n setPage(0);\n }\n\n const serverToScriptMap: IServerToScriptsMap = {};\n for (const ws of props.workerScripts.values()) {\n const server = GetServer(ws.hostname);\n if (server == null) {\n console.warn(`WorkerScript has invalid IP address: ${ws.hostname}`);\n continue;\n }\n\n let data = serverToScriptMap[server.hostname];\n\n if (data === undefined) {\n serverToScriptMap[server.hostname] = {\n server: server,\n workerScripts: [],\n };\n data = serverToScriptMap[server.hostname];\n }\n if (data !== undefined) data.workerScripts.push(ws);\n }\n\n const filtered = Object.values(serverToScriptMap).filter(\n (data) =>\n data &&\n (data.server.hostname.includes(filter) || data.server.runningScripts.find((s) => s.filename.includes(filter))),\n );\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => WorkerScriptStartStopEventEmitter.subscribe(rerender));\n\n return (\n <>\n <TextField\n value={filter}\n onChange={handleFilterChange}\n autoFocus\n InputProps={{\n startAdornment: <SearchIcon />,\n spellCheck: false,\n }}\n />\n <List dense={true}>\n {filtered.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((data) => {\n return (\n data && (\n <ServerAccordion key={data.server.hostname} server={data.server} workerScripts={data.workerScripts} />\n )\n );\n })}\n </List>\n <TablePagination\n rowsPerPageOptions={[10, 15, 20, 100]}\n component=\"div\"\n count={filtered.length}\n rowsPerPage={rowsPerPage}\n page={page}\n onPageChange={handleChangePage}\n onRowsPerPageChange={handleChangeRowsPerPage}\n ActionsComponent={TablePaginationActionsAll}\n />\n </>\n );\n}\n","/**\n * React Component for rendering the Accordion element for a single\n * server in the 'Active Scripts' UI page\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\n\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport { ServerAccordionContent } from \"./ServerAccordionContent\";\n\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\n\ntype IProps = {\n server: BaseServer;\n workerScripts: WorkerScript[];\n};\n\nexport function ServerAccordion(props: IProps): React.ReactElement {\n const [open, setOpen] = React.useState(false);\n const server = props.server;\n\n // Accordion's header text\n // TODO: calculate the longest hostname length rather than hard coding it\n const longestHostnameLength = 18;\n const paddedName = `${server.hostname}${\" \".repeat(longestHostnameLength)}`.slice(\n 0,\n Math.max(server.hostname.length, longestHostnameLength),\n );\n const barOptions = {\n progress: server.ramUsed / server.maxRam,\n totalTicks: 30,\n };\n const headerTxt = `${paddedName} ${createProgressBarText(barOptions)}`;\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText primary={<Typography style={{ whiteSpace: \"pre-wrap\" }}>{headerTxt}</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Box mx={2}>\n <Collapse in={open} timeout={0} unmountOnExit>\n <ServerAccordionContent workerScripts={props.workerScripts} />\n </Collapse>\n </Box>\n </Box>\n );\n}\n","import React, { useState } from \"react\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { WorkerScriptAccordion } from \"./WorkerScriptAccordion\";\nimport List from \"@mui/material/List\";\nimport TablePagination from \"@mui/material/TablePagination\";\nimport { TablePaginationActionsAll } from \"../React/TablePaginationActionsAll\";\nimport { Settings } from \"../../Settings/Settings\";\n\ninterface IProps {\n workerScripts: WorkerScript[];\n}\n\nexport function ServerAccordionContent(props: IProps): React.ReactElement {\n const [page, setPage] = useState(0);\n const [rowsPerPage, setRowsPerPage] = useState(Settings.ActiveScriptsScriptPageSize);\n const handleChangePage = (event: unknown, newPage: number): void => {\n setPage(newPage);\n };\n\n const handleChangeRowsPerPage = (event: React.ChangeEvent<HTMLInputElement>): void => {\n Settings.ActiveScriptsScriptPageSize = parseInt(event.target.value, 10);\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n };\n\n return (\n <>\n <List dense disablePadding>\n {props.workerScripts.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((ws) => (\n <WorkerScriptAccordion key={`${ws.name}_${ws.args}`} workerScript={ws} />\n ))}\n </List>\n <TablePagination\n rowsPerPageOptions={[10, 15, 20, 100]}\n component=\"div\"\n count={props.workerScripts.length}\n rowsPerPage={rowsPerPage}\n page={page}\n onPageChange={handleChangePage}\n onRowsPerPageChange={handleChangeRowsPerPage}\n ActionsComponent={TablePaginationActionsAll}\n />\n </>\n );\n}\n","/**\n * React Component for displaying a single WorkerScript's info as an\n * Accordion element\n */\nimport * as React from \"react\";\n\nimport { numeralWrapper } from \"../numeralFormat\";\n\nimport Table from \"@mui/material/Table\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport makeStyles from \"@mui/styles/makeStyles\";\n\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\n\nimport { killWorkerScript } from \"../../Netscript/killWorkerScript\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\nimport { dialogBoxCreate } from \"../React/DialogBox\";\nimport { LogBoxEvents } from \"../React/LogBoxManager\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { arrayToString } from \"../../utils/helpers/arrayToString\";\nimport { Money } from \"../React/Money\";\nimport { MoneyRate } from \"../React/MoneyRate\";\n\nconst useStyles = makeStyles({\n noborder: {\n borderBottom: \"none\",\n },\n});\n\ntype IProps = {\n workerScript: WorkerScript;\n};\n\nexport function WorkerScriptAccordion(props: IProps): React.ReactElement {\n const classes = useStyles();\n const [open, setOpen] = React.useState(false);\n const workerScript = props.workerScript;\n const scriptRef = workerScript.scriptRef;\n\n function logClickHandler(): void {\n LogBoxEvents.emit(scriptRef);\n }\n const killScript = killWorkerScript.bind(null, scriptRef as any, scriptRef.server);\n\n function killScriptClickHandler(): void {\n killScript();\n dialogBoxCreate(\"Killing script\");\n }\n\n // Calculations for script stats\n const onlineMps = scriptRef.onlineMoneyMade / scriptRef.onlineRunningTime;\n const onlineEps = scriptRef.onlineExpGained / scriptRef.onlineRunningTime;\n\n return (\n <>\n <ListItemButton onClick={() => setOpen((old) => !old)} component={Paper}>\n <ListItemText primary={<Typography>└ {props.workerScript.name} {JSON.stringify(props.workerScript.args)}</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} timeout={0} unmountOnExit>\n <Box mx={6}>\n <Table padding=\"none\" size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Threads:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{numeralWrapper.formatThreads(props.workerScript.scriptRef.threads)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={2}>\n <Typography>└ Args: {arrayToString(props.workerScript.args)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Online Time:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{convertTimeMsToTimeElapsedString(scriptRef.onlineRunningTime * 1e3)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Offline Time:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{convertTimeMsToTimeElapsedString(scriptRef.offlineRunningTime * 1e3)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Total online production:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <Money money={scriptRef.onlineMoneyMade} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(scriptRef.onlineExpGained) + \" hacking exp\"}</Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Online production rate:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <MoneyRate money={onlineMps} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(onlineEps) + \" hacking exp / sec\"}</Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Total offline production:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <Money money={scriptRef.offlineMoneyMade} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(scriptRef.offlineExpGained) + \" hacking exp\"}</Typography>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n\n <Button onClick={logClickHandler}>LOG</Button>\n <IconButton onClick={killScriptClickHandler}>\n <DeleteIcon color=\"error\" />\n </IconButton>\n </Box>\n </Collapse>\n </>\n );\n}\n","/**\n * Root React Component for the \"Active Scripts\" UI page. This page displays\n * and provides information about all of the player's scripts that are currently running\n */\nimport React from \"react\";\nimport Typography from \"@mui/material/Typography\";\n\nimport { recentScripts } from \"../../Netscript/RecentScripts\";\nimport { RecentScriptAccordion } from \"./RecentScriptAccordion\";\n\nexport function RecentScriptsPage(): React.ReactElement {\n return (\n <>\n <Typography>List of all recently killed scripts.</Typography>\n {recentScripts.map((r) => (\n <RecentScriptAccordion key={r.pid} recentScript={r} />\n ))}\n </>\n );\n}\n","/**\n * React Component for displaying a single WorkerScript's info as an\n * Accordion element\n */\nimport * as React from \"react\";\n\nimport { numeralWrapper } from \"../numeralFormat\";\n\nimport Table from \"@mui/material/Table\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport makeStyles from \"@mui/styles/makeStyles\";\n\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\n\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { arrayToString } from \"../../utils/helpers/arrayToString\";\nimport { Money } from \"../React/Money\";\nimport { MoneyRate } from \"../React/MoneyRate\";\nimport { RecentScript } from \"../..//Netscript/RecentScripts\";\nimport { LogBoxEvents } from \"../React/LogBoxManager\";\n\nconst useStyles = makeStyles({\n noborder: {\n borderBottom: \"none\",\n },\n});\n\ninterface IProps {\n recentScript: RecentScript;\n}\n\nexport function RecentScriptAccordion(props: IProps): React.ReactElement {\n const classes = useStyles();\n const [open, setOpen] = React.useState(false);\n const recentScript = props.recentScript;\n\n // Calculations for script stats\n const onlineMps = recentScript.runningScript.onlineMoneyMade / recentScript.runningScript.onlineRunningTime;\n const onlineEps = recentScript.runningScript.onlineExpGained / recentScript.runningScript.onlineRunningTime;\n\n function logClickHandler(): void {\n LogBoxEvents.emit(recentScript.runningScript);\n }\n return (\n <>\n <ListItemButton onClick={() => setOpen((old) => !old)} component={Paper}>\n <ListItemText\n primary={\n <Typography>\n └ {recentScript.filename} (died{\" \"}\n {convertTimeMsToTimeElapsedString(new Date().getTime() - recentScript.timestamp.getTime())} ago)\n </Typography>\n }\n />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} timeout={0} unmountOnExit>\n <Box mx={6}>\n <Table padding=\"none\" size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Threads:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{numeralWrapper.formatThreads(recentScript.runningScript.threads)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={2}>\n <Typography>└ Args: {arrayToString(recentScript.args)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Online Time:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>\n {convertTimeMsToTimeElapsedString(recentScript.runningScript.onlineRunningTime * 1e3)}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Offline Time:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>\n {convertTimeMsToTimeElapsedString(recentScript.runningScript.offlineRunningTime * 1e3)}\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Total online production:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <Money money={recentScript.runningScript.onlineMoneyMade} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n {numeralWrapper.formatExp(recentScript.runningScript.onlineExpGained) + \" hacking exp\"}\n </Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Online production rate:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <MoneyRate money={onlineMps} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(onlineEps) + \" hacking exp / sec\"}</Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Total offline production:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <Money money={recentScript.runningScript.offlineMoneyMade} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n {numeralWrapper.formatExp(recentScript.runningScript.offlineExpGained) + \" hacking exp\"}\n </Typography>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n <Button onClick={logClickHandler}>LOG</Button>\n </Box>\n </Collapse>\n </>\n );\n}\n","/**\n * Root React Component for displaying a Faction's UI.\n * This is the component for displaying a single faction's UI, not the list of all\n * accessible factions\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { AugmentationsPage } from \"./AugmentationsPage\";\nimport { DonateOption } from \"./DonateOption\";\nimport { Info } from \"./Info\";\nimport { Option } from \"./Option\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Faction } from \"../../Faction/Faction\";\n\nimport { use } from \"../../ui/Context\";\nimport { CreateGangModal } from \"./CreateGangModal\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { CovenantPurchasesRoot } from \"../../PersonObjects/Sleeve/ui/CovenantPurchasesRoot\";\n\ntype IProps = {\n faction: Faction;\n};\n\n// Info text for all options on the UI\nconst gangInfo = \"Create and manage a gang for this Faction. Gangs will earn you money and \" + \"faction reputation\";\nconst hackingContractsInfo =\n \"Complete hacking contracts for your faction. \" +\n \"Your effectiveness, which determines how much \" +\n \"reputation you gain for this faction, is based on your hacking skill. \" +\n \"You will gain hacking exp.\";\nconst fieldWorkInfo =\n \"Carry out field missions for your faction. \" +\n \"Your effectiveness, which determines how much \" +\n \"reputation you gain for this faction, is based on all of your stats. \" +\n \"You will gain exp for all stats.\";\nconst securityWorkInfo =\n \"Serve in a security detail for your faction. \" +\n \"Your effectiveness, which determines how much \" +\n \"reputation you gain for this faction, is based on your combat stats. \" +\n \"You will gain exp for all combat stats.\";\nconst augmentationsInfo =\n \"As your reputation with this faction rises, you will \" +\n \"unlock Augmentations, which you can purchase to enhance \" +\n \"your abilities.\";\nconst sleevePurchasesInfo = \"Purchase Duplicate Sleeves and upgrades. These are permanent!\";\n\nconst GangNames = [\n \"Slum Snakes\",\n \"Tetrads\",\n \"The Syndicate\",\n \"The Dark Army\",\n \"Speakers for the Dead\",\n \"NiteSec\",\n \"The Black Hand\",\n];\n\ninterface IMainProps {\n faction: Faction;\n rerender: () => void;\n onAugmentations: () => void;\n}\n\nfunction MainPage({ faction, rerender, onAugmentations }: IMainProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [sleevesOpen, setSleevesOpen] = useState(false);\n const [gangOpen, setGangOpen] = useState(false);\n const p = player;\n const factionInfo = faction.getInfo();\n\n function manageGang(): void {\n // If player already has a gang, just go to the gang UI\n if (player.inGang()) {\n return router.toGang();\n }\n\n setGangOpen(true);\n }\n\n function startWork(): void {\n player.startFocusing();\n router.toWork();\n }\n\n function startFieldWork(faction: Faction): void {\n player.startFactionFieldWork(faction);\n startWork();\n }\n\n function startHackingContracts(faction: Faction): void {\n player.startFactionHackWork(faction);\n startWork();\n }\n\n function startSecurityWork(faction: Faction): void {\n player.startFactionSecurityWork(faction);\n startWork();\n }\n\n // We have a special flag for whether the player this faction is the player's\n // gang faction because if the player has a gang, they cannot do any other action\n const isPlayersGang = p.inGang() && p.getGangName() === faction.name;\n\n // Flags for whether special options (gang, sleeve purchases, donate, etc.)\n // should be shown\n const favorToDonate = Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n const canDonate = faction.favor >= favorToDonate;\n\n const canPurchaseSleeves = faction.name === \"The Covenant\" && p.bitNodeN === 10;\n\n let canAccessGang = p.canAccessGang() && GangNames.includes(faction.name);\n if (p.inGang()) {\n if (p.getGangName() !== faction.name) {\n canAccessGang = false;\n } else if (p.getGangName() === faction.name) {\n canAccessGang = true;\n }\n }\n\n return (\n <>\n <Button onClick={() => router.toFactions()}>Back</Button>\n <Typography variant=\"h4\" color=\"primary\">\n {faction.name}\n </Typography>\n <Info faction={faction} factionInfo={factionInfo} />\n {canAccessGang && (\n <>\n <Option buttonText={\"Manage Gang\"} infoText={gangInfo} onClick={manageGang} />\n <CreateGangModal facName={faction.name} open={gangOpen} onClose={() => setGangOpen(false)} />\n </>\n )}\n {!isPlayersGang && factionInfo.offerHackingWork && (\n <Option\n buttonText={\"Hacking Contracts\"}\n infoText={hackingContractsInfo}\n onClick={() => startHackingContracts(faction)}\n />\n )}\n {!isPlayersGang && factionInfo.offerFieldWork && (\n <Option buttonText={\"Field Work\"} infoText={fieldWorkInfo} onClick={() => startFieldWork(faction)} />\n )}\n {!isPlayersGang && factionInfo.offerSecurityWork && (\n <Option buttonText={\"Security Work\"} infoText={securityWorkInfo} onClick={() => startSecurityWork(faction)} />\n )}\n {!isPlayersGang && factionInfo.offersWork() && (\n <DonateOption\n faction={faction}\n p={player}\n rerender={rerender}\n favorToDonate={favorToDonate}\n disabled={!canDonate}\n />\n )}\n <Option buttonText={\"Purchase Augmentations\"} infoText={augmentationsInfo} onClick={onAugmentations} />\n {canPurchaseSleeves && (\n <>\n <Option\n buttonText={\"Purchase & Upgrade Duplicate Sleeves\"}\n infoText={sleevePurchasesInfo}\n onClick={() => setSleevesOpen(true)}\n />\n <CovenantPurchasesRoot open={sleevesOpen} onClose={() => setSleevesOpen(false)} />\n </>\n )}\n </>\n );\n}\n\nexport function FactionRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const faction = props.faction;\n\n const [purchasingAugs, setPurchasingAugs] = useState(false);\n\n return purchasingAugs ? (\n <AugmentationsPage faction={faction} routeToMainPage={() => setPurchasingAugs(false)} />\n ) : (\n <MainPage rerender={rerender} faction={faction} onAugmentations={() => setPurchasingAugs(true)} />\n );\n}\n","/**\n * Root React Component for displaying a faction's \"Purchase Augmentations\" page\n */\nimport React, { useState } from \"react\";\n\nimport { PurchaseableAugmentation } from \"./PurchaseableAugmentation\";\n\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { PurchaseAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { hasAugmentationPrereqs } from \"../FactionHelpers\";\n\nimport { use } from \"../../ui/Context\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport { CONSTANTS } from \"../../Constants\";\n\ntype IProps = {\n faction: Faction;\n routeToMainPage: () => void;\n};\n\nexport function AugmentationsPage(props: IProps): React.ReactElement {\n const player = use.Player();\n // Flag for whether the player has a gang with this faction\n const isPlayersGang = player.inGang() && player.getGangName() === props.faction.name;\n\n const setRerender = useState(false)[1];\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function getAugs(): string[] {\n if (isPlayersGang) {\n const augs: string[] = [];\n for (const augName of Object.keys(Augmentations)) {\n if (augName === AugmentationNames.NeuroFluxGovernor) continue;\n if (augName === AugmentationNames.TheRedPill && player.bitNodeN !== 2) continue;\n const aug = Augmentations[augName];\n if (!aug.isSpecial) {\n augs.push(augName);\n }\n }\n\n return augs;\n } else {\n return props.faction.augmentations.slice();\n }\n }\n\n function getAugsSorted(): string[] {\n switch (Settings.PurchaseAugmentationsOrder) {\n case PurchaseAugmentationsOrderSetting.Cost: {\n return getAugsSortedByCost();\n }\n case PurchaseAugmentationsOrderSetting.Reputation: {\n return getAugsSortedByReputation();\n }\n case PurchaseAugmentationsOrderSetting.Purchasable: {\n return getAugsSortedByPurchasable();\n }\n default:\n return getAugsSortedByDefault();\n }\n }\n\n function getAugsSortedByCost(): string[] {\n const augs = getAugs();\n augs.sort((augName1, augName2) => {\n const aug1 = Augmentations[augName1],\n aug2 = Augmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n\n return aug1.baseCost - aug2.baseCost;\n });\n\n return augs;\n }\n\n function getAugsSortedByPurchasable(): string[] {\n const augs = getAugs();\n function canBuy(augName: string): boolean {\n const aug = Augmentations[augName];\n const repCost = aug.baseRepRequirement * props.faction.getInfo().augmentationRepRequirementMult;\n const hasReq = props.faction.playerReputation >= repCost;\n const hasRep = hasAugmentationPrereqs(aug);\n const hasCost = aug.baseCost !== 0 && player.money > aug.baseCost * props.faction.getInfo().augmentationPriceMult;\n return hasCost && hasReq && hasRep;\n }\n const buy = augs.filter(canBuy).sort((augName1, augName2) => {\n const aug1 = Augmentations[augName1],\n aug2 = Augmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n\n return aug1.baseCost - aug2.baseCost;\n });\n const cantBuy = augs\n .filter((aug) => !canBuy(aug))\n .sort((augName1, augName2) => {\n const aug1 = Augmentations[augName1],\n aug2 = Augmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n return aug1.baseRepRequirement - aug2.baseRepRequirement;\n });\n\n return buy.concat(cantBuy);\n }\n\n function getAugsSortedByReputation(): string[] {\n const augs = getAugs();\n augs.sort((augName1, augName2) => {\n const aug1 = Augmentations[augName1],\n aug2 = Augmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n return aug1.baseRepRequirement - aug2.baseRepRequirement;\n });\n\n return augs;\n }\n\n function getAugsSortedByDefault(): string[] {\n return getAugs();\n }\n\n function switchSortOrder(newOrder: PurchaseAugmentationsOrderSetting): void {\n Settings.PurchaseAugmentationsOrder = newOrder;\n rerender();\n }\n\n const augs = getAugsSorted();\n const purchasable = augs.filter(\n (aug: string) =>\n aug === AugmentationNames.NeuroFluxGovernor ||\n (!player.augmentations.some((a) => a.name === aug) && !player.queuedAugmentations.some((a) => a.name === aug)),\n );\n\n const purchaseableAugmentation = (aug: string, owned = false): React.ReactNode => {\n return (\n <PurchaseableAugmentation\n augName={aug}\n faction={props.faction}\n key={aug}\n p={player}\n rerender={rerender}\n owned={owned}\n />\n );\n };\n\n const augListElems = purchasable.map((aug) => purchaseableAugmentation(aug));\n\n let ownedElem = <></>;\n const owned = augs.filter((aug: string) => !purchasable.includes(aug));\n if (owned.length !== 0) {\n ownedElem = (\n <>\n <br />\n <Typography variant=\"h4\">Purchased Augmentations</Typography>\n <Typography>This faction also offers these augmentations but you already own them.</Typography>\n {owned.map((aug) => purchaseableAugmentation(aug, true))}\n </>\n );\n }\n const mult = Math.pow(\n CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][player.sourceFileLvl(11)],\n player.queuedAugmentations.length,\n );\n return (\n <>\n <Button onClick={props.routeToMainPage}>Back</Button>\n <Typography variant=\"h4\">Faction Augmentations</Typography>\n <Typography>\n These are all of the Augmentations that are available to purchase from {props.faction.name}. Augmentations are\n powerful upgrades that will enhance your abilities.\n <br />\n Reputation: <Reputation reputation={props.faction.playerReputation} /> Favor:{\" \"}\n <Favor favor={Math.floor(props.faction.favor)} />\n </Typography>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n The price of every Augmentation increases for every queued Augmentation and it is reset when you install\n them.\n </Typography>\n }\n >\n <Typography>Price multiplier: x {numeralWrapper.formatMultiplier(mult)}</Typography>\n </Tooltip>\n </Box>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Cost)}>Sort by Cost</Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Reputation)}>Sort by Reputation</Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Default)}>Sort by Default Order</Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Purchasable)}>\n Sort by Purchasable\n </Button>\n <br />\n\n <Table size=\"small\" padding=\"none\">\n <TableBody>{augListElems}</TableBody>\n </Table>\n\n <Table size=\"small\" padding=\"none\">\n <TableBody>{ownedElem}</TableBody>\n </Table>\n </>\n );\n}\n","/**\n * React component for displaying a single augmentation for purchase through\n * the faction UI\n */\nimport React, { useState } from \"react\";\n\nimport { getNextNeurofluxLevel, hasAugmentationPrereqs, purchaseAugmentation } from \"../FactionHelpers\";\nimport { PurchaseAugmentationModal } from \"./PurchaseAugmentationModal\";\n\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\n\nimport { Augmentation as AugFormat } from \"../../ui/React/Augmentation\";\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport TableRow from \"@mui/material/TableRow\";\n\ninterface IReqProps {\n augName: string;\n p: IPlayer;\n hasReq: boolean;\n rep: number;\n hasRep: boolean;\n cost: number;\n hasCost: boolean;\n}\n\nfunction Requirements(props: IReqProps): React.ReactElement {\n const aug = Augmentations[props.augName];\n if (!props.hasReq) {\n return (\n <TableCell key={1} colSpan={2}>\n <Typography color=\"error\">\n Requires{\" \"}\n {aug.prereqs.map((aug, i) => (\n <AugFormat key={i} name={aug} />\n ))}\n </Typography>\n </TableCell>\n );\n }\n\n return (\n <React.Fragment key=\"f\">\n <TableCell key={1}>\n <Typography>\n <Money money={props.cost} player={props.p} />\n </Typography>\n </TableCell>\n <TableCell key={2}>\n <Typography color={props.hasRep ? \"primary\" : \"error\"}>\n Requires <Reputation reputation={props.rep} /> faction reputation\n </Typography>\n </TableCell>\n </React.Fragment>\n );\n}\n\ninterface IProps {\n augName: string;\n faction: Faction;\n p: IPlayer;\n rerender: () => void;\n owned?: boolean;\n}\n\nexport function PurchaseableAugmentation(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n const aug = Augmentations[props.augName];\n if (aug == null) throw new Error(`aug ${props.augName} does not exists`);\n\n if (aug == null) {\n console.error(\n `Invalid Augmentation when trying to create PurchaseableAugmentation display element: ${props.augName}`,\n );\n return <></>;\n }\n\n const moneyCost = aug.baseCost * props.faction.getInfo().augmentationPriceMult;\n const repCost = aug.baseRepRequirement * props.faction.getInfo().augmentationRepRequirementMult;\n const hasReq = hasAugmentationPrereqs(aug);\n const hasRep = props.faction.playerReputation >= repCost;\n const hasCost = aug.baseCost === 0 || props.p.money > aug.baseCost * props.faction.getInfo().augmentationPriceMult;\n\n // Determine UI properties\n const color: \"error\" | \"primary\" = !hasReq || !hasRep || !hasCost ? \"error\" : \"primary\";\n\n // Determine button txt\n let btnTxt = aug.name;\n if (aug.name === AugmentationNames.NeuroFluxGovernor) {\n btnTxt += ` - Level ${getNextNeurofluxLevel()}`;\n }\n\n let tooltip = <></>;\n if (typeof aug.info === \"string\") {\n tooltip = (\n <>\n <span>{aug.info}</span>\n <br />\n <br />\n {aug.stats}\n </>\n );\n } else\n tooltip = (\n <>\n {aug.info}\n <br />\n <br />\n {aug.stats}\n </>\n );\n\n function handleClick(): void {\n if (color === \"error\") return;\n if (!Settings.SuppressBuyAugmentationConfirmation) {\n setOpen(true);\n } else {\n purchaseAugmentation(aug, props.faction);\n props.rerender();\n }\n }\n\n return (\n <TableRow>\n {!props.owned && (\n <TableCell key={0}>\n <Button onClick={handleClick} color={color}>\n Buy\n </Button>\n <PurchaseAugmentationModal\n open={open}\n onClose={() => setOpen(false)}\n aug={aug}\n faction={props.faction}\n rerender={props.rerender}\n />\n </TableCell>\n )}\n <TableCell key={1}>\n <Box display=\"flex\">\n <Tooltip title={<Typography>{tooltip}</Typography>} placement=\"top\">\n <Typography>{btnTxt}</Typography>\n </Tooltip>\n </Box>\n </TableCell>\n {!props.owned && (\n <Requirements\n key={2}\n augName={props.augName}\n p={props.p}\n cost={moneyCost}\n rep={repCost}\n hasReq={hasReq}\n hasRep={hasRep}\n hasCost={hasCost}\n />\n )}\n </TableRow>\n );\n}\n","import React from \"react\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { Faction } from \"../Faction\";\nimport { purchaseAugmentation } from \"../FactionHelpers\";\nimport { isRepeatableAug } from \"../../Augmentation/AugmentationHelpers\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n faction: Faction;\n aug: Augmentation;\n rerender: () => void;\n}\n\nexport function PurchaseAugmentationModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const factionInfo = props.faction.getInfo();\n\n function buy(): void {\n if (!isRepeatableAug(props.aug) && player.hasAugmentation(props.aug)) {\n return;\n }\n\n purchaseAugmentation(props.aug, props.faction);\n props.rerender();\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography variant=\"h4\">{props.aug.name}</Typography>\n <Typography>\n {props.aug.info}\n <br />\n <br />\n {props.aug.stats}\n <br />\n <br />\n Would you like to purchase the {props.aug.name} Augmentation for \n <Money money={props.aug.baseCost * factionInfo.augmentationPriceMult} />?\n <br />\n <br />\n </Typography>\n <Button autoFocus onClick={buy}>\n Purchase\n </Button>\n </Modal>\n );\n}\n","import * as React from \"react\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n aug: {\n color: theme.colors.combat,\n },\n }),\n);\n\nexport function Augmentation({ name }: { name: string }): JSX.Element {\n const classes = useStyles();\n return <span className={classes.aug}>{name}</span>;\n}\n","/**\n * React component for a donate option on the Faction UI\n */\nimport React, { useState } from \"react\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { repFromDonation } from \"../formulas/donation\";\nimport { Favor } from \"../../ui/React/Favor\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ntype IProps = {\n faction: Faction;\n disabled: boolean;\n favorToDonate: number;\n p: IPlayer;\n rerender: () => void;\n};\n\nexport function DonateOption(props: IProps): React.ReactElement {\n const [donateAmt, setDonateAmt] = useState<number | null>(null);\n const digits = (CONSTANTS.DonateMoneyToRepDivisor + \"\").length - 1;\n\n function canDonate(): boolean {\n if (donateAmt === null) return false;\n if (isNaN(donateAmt) || donateAmt <= 0) return false;\n if (props.p.money < donateAmt) return false;\n return true;\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n const amt = numeralWrapper.parseMoney(event.target.value);\n if (event.target.value === \"\" || isNaN(amt)) setDonateAmt(null);\n else setDonateAmt(amt);\n }\n\n function donate(): void {\n const fac = props.faction;\n const amt = donateAmt;\n if (amt === null) return;\n if (!canDonate()) return;\n props.p.loseMoney(amt, \"other\");\n const repGain = repFromDonation(amt, props.p);\n props.faction.playerReputation += repGain;\n dialogBoxCreate(\n <>\n You just donated <Money money={amt} /> to {fac.name} to gain <Reputation reputation={repGain} /> reputation.\n </>,\n );\n props.rerender();\n }\n\n function Status(): React.ReactElement {\n if (donateAmt === null) return <></>;\n if (!canDonate()) {\n if (props.p.money < donateAmt) return <Typography>Insufficient funds</Typography>;\n return <Typography>Invalid donate amount entered!</Typography>;\n }\n return (\n <Typography>\n This donation will result in <Reputation reputation={repFromDonation(donateAmt, props.p)} /> reputation gain\n </Typography>\n );\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Status />\n {props.disabled ? (\n <Typography>\n Unlock donations at <Favor favor={props.favorToDonate} /> favor with {props.faction.name}\n </Typography>\n ) : (\n <>\n <TextField\n onChange={onChange}\n placeholder={\"Donation amount\"}\n disabled={props.disabled}\n InputProps={{\n endAdornment: (\n <Button onClick={donate} disabled={props.disabled || !canDonate()}>\n donate\n </Button>\n ),\n }}\n />\n <Typography>\n <MathJaxWrapper>{`\\\\(reputation = \\\\frac{\\\\text{donation amount} \\\\cdot \\\\text{reputation multiplier}}{10^{${digits}}}\\\\)`}</MathJaxWrapper>\n </Typography>\n </>\n )}\n </Paper>\n );\n}\n","/**\n * React component for general information about the faction. This includes the\n * factions \"motto\", reputation, favor, and gameplay instructions\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { Faction } from \"../../Faction/Faction\";\nimport { FactionInfo } from \"../../Faction/FactionInfo\";\n\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n faction: Faction;\n factionInfo: FactionInfo;\n};\n\nconst useStyles = makeStyles(() =>\n createStyles({\n noformat: {\n whiteSpace: \"pre-wrap\",\n lineHeight: \"1em\",\n },\n }),\n);\n\nexport function Info(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const classes = useStyles();\n\n const favorGain = props.faction.getFavorGain();\n return (\n <>\n <Typography classes={{ root: classes.noformat }}>{props.factionInfo.infoText}</Typography>\n <Typography>-------------------------</Typography>\n <Box display=\"flex\">\n <Tooltip\n title={\n <>\n <Typography>\n You will have <Favor favor={Math.floor(props.faction.favor + favorGain)} /> faction favor after\n installing an Augmentation.\n </Typography>\n <MathJaxWrapper>{\"\\\\(\\\\huge{r = \\\\text{total faction reputation}}\\\\)\"}</MathJaxWrapper>\n <MathJaxWrapper>\n {\n \"\\\\(\\\\huge{favor=1+\\\\left\\\\lfloor\\\\log_{1.02}\\\\left(\\\\frac{r+25000}{25500}\\\\right)\\\\right\\\\rfloor}\\\\)\"\n }\n </MathJaxWrapper>\n </>\n }\n >\n <Typography>\n Reputation: <Reputation reputation={props.faction.playerReputation} />\n </Typography>\n </Tooltip>\n </Box>\n\n <Typography>-------------------------</Typography>\n\n <Box display=\"flex\">\n <Tooltip\n title={\n <>\n <Typography>\n Faction favor increases the rate at which you earn reputation for this faction by 1% per favor. Faction\n favor is gained whenever you install an Augmentation. The amount of favor you gain depends on the total\n amount of reputation you earned with this faction. Across all resets.\n </Typography>\n\n <MathJaxWrapper>{\"\\\\(\\\\huge{r = reputation}\\\\)\"}</MathJaxWrapper>\n <MathJaxWrapper>{\"\\\\(\\\\huge{\\\\Delta r = \\\\Delta r \\\\times \\\\frac{100+favor}{100}}\\\\)\"}</MathJaxWrapper>\n\n </>\n }\n >\n <Typography>\n Faction Favor: <Favor favor={Math.floor(props.faction.favor)} />\n </Typography>\n </Tooltip>\n </Box>\n\n <Typography>-------------------------</Typography>\n <Typography>\n Perform work/carry out assignments for your faction to help further its cause! By doing so you will earn\n reputation for your faction. You will also gain reputation passively over time, although at a very slow rate.\n Earning reputation will allow you to purchase Augmentations through this faction, which are powerful upgrades\n that enhance your abilities.\n </Typography>\n </>\n );\n}\n","/**\n * React Component for the popup used to create a new gang.\n */\nimport React from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n facName: string;\n}\n\nexport function CreateGangModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const combatGangText =\n \"This is a COMBAT gang. Members in this gang will have different tasks than HACKING gangs. \" +\n \"Compared to hacking gangs, progression with combat gangs can be more difficult as territory management \" +\n \"is more important. However, well-managed combat gangs can progress faster than hacking ones.\";\n\n const hackingGangText =\n \"This is a HACKING gang. Members in this gang will have different tasks than COMBAT gangs. \" +\n \"Compared to combat gangs, progression with hacking gangs is more straightforward as territory warfare \" +\n \"is not as important.\";\n\n function isHacking(): boolean {\n return [\"NiteSec\", \"The Black Hand\"].includes(props.facName);\n }\n\n function createGang(): void {\n player.startGang(props.facName, isHacking());\n props.onClose();\n router.toGang();\n }\n\n function onKeyUp(event: React.KeyboardEvent): void {\n if (event.keyCode === 13) createGang();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to create a new Gang with {props.facName}?\n <br />\n <br />\n Note that this will prevent you from creating a Gang with any other Faction until this BitNode is destroyed. It\n also resets your reputation with this faction.\n <br />\n <br />\n {isHacking() ? hackingGangText : combatGangText}\n <br />\n <br />\n Other than hacking vs combat, there are NO differences between the Factions you can create a Gang with, and each\n of these Factions have all Augmentations available.\n </Typography>\n <Button onClick={createGang} onKeyUp={onKeyUp} autoFocus>\n Create Gang\n </Button>\n </Modal>\n );\n}\n","/**\n * Root React component for the popup that lets player purchase Duplicate\n * Sleeves and Sleeve-related upgrades from The Covenant\n */\nimport React, { useState } from \"react\";\n\nimport { CovenantSleeveMemoryUpgrade } from \"./CovenantSleeveMemoryUpgrade\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { BaseCostPerSleeve, MaxSleevesFromCovenant } from \"../SleeveCovenantPurchases\";\n\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { use } from \"../../../ui/Context\";\n\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function CovenantPurchasesRoot(props: IProps): React.ReactElement {\n const player = use.Player();\n const [update, setUpdate] = useState(0);\n\n /**\n * Get the cost to purchase a new Duplicate Sleeve\n */\n function purchaseCost(): number {\n return Math.pow(10, player.sleevesFromCovenant) * BaseCostPerSleeve;\n }\n\n /**\n * Force a rerender by just changing an arbitrary state value\n */\n function rerender(): void {\n setUpdate(update + 1);\n }\n\n // Purchasing a new Duplicate Sleeve\n let purchaseDisabled = false;\n if (!player.canAfford(purchaseCost())) {\n purchaseDisabled = true;\n }\n if (player.sleevesFromCovenant >= MaxSleevesFromCovenant) {\n purchaseDisabled = true;\n }\n\n function purchaseOnClick(): void {\n if (player.sleevesFromCovenant >= MaxSleevesFromCovenant) return;\n\n if (player.canAfford(purchaseCost())) {\n player.loseMoney(purchaseCost(), \"sleeves\");\n player.sleevesFromCovenant += 1;\n player.sleeves.push(new Sleeve(player));\n rerender();\n } else {\n dialogBoxCreate(`You cannot afford to purchase a Duplicate Sleeve`);\n }\n }\n\n // Purchasing Upgrades for Sleeves\n const upgradePanels = [];\n for (let i = 0; i < player.sleeves.length; ++i) {\n const sleeve = player.sleeves[i];\n upgradePanels.push(<CovenantSleeveMemoryUpgrade index={i} p={player} rerender={rerender} sleeve={sleeve} />);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n {player.sleevesFromCovenant < MaxSleevesFromCovenant && (\n <>\n <Typography>\n Purchase an additional Sleeves. These Duplicate Sleeves are permanent (they persist through BitNodes). You\n can purchase a total of {MaxSleevesFromCovenant} from The Covenant.\n </Typography>\n <Button disabled={purchaseDisabled} onClick={purchaseOnClick}>\n Purchase - \n <Money money={purchaseCost()} player={player} />\n </Button>\n </>\n )}\n <br />\n <br />\n <Typography>You can also purchase upgrades for your Sleeves. These upgrades are also permanent.</Typography>\n {upgradePanels}\n </>\n </Modal>\n );\n}\n","/**\n * React component for a panel that lets you purchase upgrades for a Duplicate\n * Sleeve's Memory (through The Covenant)\n */\nimport React, { useState } from \"react\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { IPlayer } from \"../../IPlayer\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Money } from \"../../../ui/React/Money\";\n\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n index: number;\n p: IPlayer;\n rerender: () => void;\n sleeve: Sleeve;\n}\n\nexport function CovenantSleeveMemoryUpgrade(props: IProps): React.ReactElement {\n const [amt, setAmt] = useState(1);\n\n function changePurchaseAmount(e: React.ChangeEvent<HTMLInputElement>): void {\n let n: number = parseInt(e.target.value);\n\n if (isNaN(n)) n = 1;\n if (n < 1) n = 1;\n const maxMemory = 100 - props.sleeve.memory;\n if (n > maxMemory) n = maxMemory;\n\n setAmt(n);\n }\n\n function getPurchaseCost(): number {\n if (isNaN(amt)) {\n return Infinity;\n }\n\n const maxMemory = 100 - props.sleeve.memory;\n if (amt > maxMemory) {\n return Infinity;\n }\n\n return props.sleeve.getMemoryUpgradeCost(amt);\n }\n\n function purchaseMemory(): void {\n const cost = getPurchaseCost();\n if (props.p.canAfford(cost)) {\n props.sleeve.upgradeMemory(amt);\n props.p.loseMoney(cost, \"sleeves\");\n props.rerender();\n }\n }\n\n // Purchase button props\n const cost = getPurchaseCost();\n const purchaseBtnDisabled = !props.p.canAfford(cost);\n let purchaseBtnContent = <></>;\n if (isNaN(amt)) {\n purchaseBtnContent = <>Invalid value</>;\n } else {\n purchaseBtnContent = (\n <>\n Purchase {amt} memory - \n <Money money={cost} player={props.p} />\n </>\n );\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Typography variant=\"h6\" color=\"primary\">\n Upgrade Memory of Sleeve {props.index}\n </Typography>\n <Typography>\n Purchase a memory upgrade for your sleeve. Note that a sleeve's max memory is 100 (current:{\" \"}\n {numeralWrapper.formatSleeveMemory(props.sleeve.memory)})\n </Typography>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Amount of memory to purchase (must be an integer): </Typography>\n <TextField onChange={changePurchaseAmount} type={\"number\"} value={amt} />\n </Box>\n <br />\n <Button disabled={purchaseBtnDisabled} onClick={purchaseMemory}>\n {purchaseBtnContent}\n </Button>\n </Paper>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { SourceFileFlags } from \"../SourceFile/SourceFileFlags\";\nimport { getPurchaseServerLimit } from \"../Server/ServerPurchases\";\nimport { HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { StatsTable } from \"./React/StatsTable\";\nimport { Money } from \"./React/Money\";\nimport { use } from \"./Context\";\nimport { MoneySourceTracker } from \"../utils/MoneySourceTracker\";\nimport { BitNodes } from \"../BitNode/BitNode\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport IconButton from \"@mui/material/IconButton\";\nimport MoreHorizIcon from \"@mui/icons-material/MoreHoriz\";\nimport { Modal } from \"./React/Modal\";\n\nimport TableBody from \"@mui/material/TableBody\";\nimport { Table, TableCell } from \"./React/Table\";\nimport TableRow from \"@mui/material/TableRow\";\n\nfunction LastEmployer(): React.ReactElement {\n const player = use.Player();\n if (player.companyName) {\n return <Typography>Employer at which you last worked: {player.companyName}</Typography>;\n }\n return <></>;\n}\n\nfunction LastJob(): React.ReactElement {\n const player = use.Player();\n if (player.companyName !== \"\") {\n return <Typography>Job you last worked: {player.jobs[player.companyName]}</Typography>;\n }\n return <></>;\n}\n\nfunction Employers(): React.ReactElement {\n const player = use.Player();\n if (player.jobs && Object.keys(player.jobs).length !== 0)\n return (\n <>\n <Typography>All Employers:</Typography>\n\n <ul>\n {Object.keys(player.jobs).map((j) => (\n <Typography key={j}> * {j}</Typography>\n ))}\n </ul>\n </>\n );\n return <></>;\n}\n\nfunction Hacknet(): React.ReactElement {\n const player = use.Player();\n // Can't import HacknetHelpers for some reason.\n if (!(player.bitNodeN === 9 || SourceFileFlags[9] > 0)) {\n return (\n <>\n <Typography>{`Hacknet Nodes owned: ${player.hacknetNodes.length}`}</Typography>\n <br />\n </>\n );\n } else {\n return (\n <>\n <Typography>{`Hacknet Servers owned: ${player.hacknetNodes.length} / ${HacknetServerConstants.MaxServers}`}</Typography>\n <br />\n </>\n );\n }\n}\n\nfunction Intelligence(): React.ReactElement {\n const player = use.Player();\n if (player.intelligence > 0 && (player.bitNodeN === 5 || SourceFileFlags[5] > 0)) {\n return (\n <TableRow>\n <TableCell>\n <Typography>Intelligence: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>{numeralWrapper.formatSkill(player.intelligence)} </Typography>\n </TableCell>\n </TableRow>\n );\n }\n return <></>;\n}\n\nfunction MultiplierTable(props: any): React.ReactElement {\n function bn5Stat(r: any): JSX.Element {\n if (SourceFileFlags[5] > 0 && r.length > 2 && r[1] != r[2]) {\n return (\n <TableCell key=\"2\" align=\"right\">\n <Typography noWrap>({numeralWrapper.formatPercentage(r[2])})</Typography>\n </TableCell>\n );\n }\n return <></>;\n }\n return (\n <>\n <Table size=\"small\" padding=\"none\">\n <TableBody>\n {props.rows.map((r: any) => (\n <TableRow key={r[0]}>\n <TableCell key=\"0\">\n <Typography noWrap>{`${r[0]} multiplier:`} </Typography>\n </TableCell>\n <TableCell key=\"1\" align=\"right\">\n <Typography noWrap>{numeralWrapper.formatPercentage(r[1])}</Typography>\n </TableCell>\n {bn5Stat(r)}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </>\n );\n}\n\nfunction BladeburnerMults(): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessBladeburner()) return <></>;\n return (\n <MultiplierTable\n rows={[\n [\"Bladeburner Success Chance\", player.bladeburner_success_chance_mult],\n [\"Bladeburner Max Stamina\", player.bladeburner_max_stamina_mult],\n [\"Bladeburner Stamina Gain\", player.bladeburner_stamina_gain_mult],\n [\"Bladeburner Field Analysis\", player.bladeburner_analysis_mult],\n ]}\n />\n );\n}\n\nfunction CurrentBitNode(): React.ReactElement {\n const player = use.Player();\n if (player.sourceFiles.length > 0) {\n const index = \"BitNode\" + player.bitNodeN;\n return (\n <>\n <Typography variant=\"h4\">\n BitNode {player.bitNodeN}: {BitNodes[index].name}\n </Typography>\n <Typography sx={{ mx: 2 }} style={{ whiteSpace: \"pre-wrap\", overflowWrap: \"break-word\" }}>\n {BitNodes[index].info}\n </Typography>\n </>\n );\n }\n\n return <></>;\n}\n\ninterface IMoneyModalProps {\n open: boolean;\n onClose: () => void;\n}\n\nfunction MoneyModal({ open, onClose }: IMoneyModalProps): React.ReactElement {\n const player = use.Player();\n function convertMoneySourceTrackerToString(src: MoneySourceTracker): React.ReactElement {\n const parts: any[][] = [[`Total:`, <Money money={src.total} />]];\n if (src.augmentations) {\n parts.push([`Augmentations:`, <Money money={src.augmentations} />]);\n }\n if (src.bladeburner) {\n parts.push([`Bladeburner:`, <Money money={src.bladeburner} />]);\n }\n if (src.casino) {\n parts.push([`Casino:`, <Money money={src.casino} />]);\n }\n if (src.codingcontract) {\n parts.push([`Coding Contracts:`, <Money money={src.codingcontract} />]);\n }\n if (src.work) {\n parts.push([`Company Work:`, <Money money={src.work} />]);\n }\n if (src.class) {\n parts.push([`Class:`, <Money money={src.class} />]);\n }\n if (src.corporation) {\n parts.push([`Corporation:`, <Money money={src.corporation} />]);\n }\n if (src.crime) {\n parts.push([`Crimes:`, <Money money={src.crime} />]);\n }\n if (src.gang) {\n parts.push([`Gang:`, <Money money={src.gang} />]);\n }\n if (src.hacking) {\n parts.push([`Hacking:`, <Money money={src.hacking} />]);\n }\n if (src.hacknet) {\n parts.push([`Hacknet Nodes:`, <Money money={src.hacknet} />]);\n }\n if (src.hacknet_expenses) {\n parts.push([`Hacknet Nodes Expenses:`, <Money money={src.hacknet_expenses} />]);\n }\n if (src.hospitalization) {\n parts.push([`Hospitalization:`, <Money money={src.hospitalization} />]);\n }\n if (src.infiltration) {\n parts.push([`Infiltration:`, <Money money={src.infiltration} />]);\n }\n if (src.servers) {\n parts.push([`Servers:`, <Money money={src.servers} />]);\n }\n if (src.stock) {\n parts.push([`Stock Market:`, <Money money={src.stock} />]);\n }\n if (src.sleeves) {\n parts.push([`Sleeves:`, <Money money={src.sleeves} />]);\n }\n if (src.other) {\n parts.push([`Other:`, <Money money={src.other} />]);\n }\n\n return <StatsTable rows={parts} wide />;\n }\n\n let content = (\n <>\n <Typography variant=\"h6\" color=\"primary\">\n Money earned since you last installed Augmentations\n </Typography>\n <br />\n {convertMoneySourceTrackerToString(player.moneySourceA)}\n </>\n );\n if (player.sourceFiles.length !== 0) {\n content = (\n <>\n {content}\n <br />\n <br />\n <Typography variant=\"h6\" color=\"primary\">\n Money earned in this BitNode\n </Typography>\n <br />\n {convertMoneySourceTrackerToString(player.moneySourceB)}\n </>\n );\n }\n\n return (\n <Modal open={open} onClose={onClose}>\n {content}\n </Modal>\n );\n}\n\nexport function CharacterStats(): React.ReactElement {\n const player = use.Player();\n const [moneyOpen, setMoneyOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const timeRows = [\n [\"Time played since last Augmentation:\", convertTimeMsToTimeElapsedString(player.playtimeSinceLastAug)],\n ];\n if (player.sourceFiles.length > 0) {\n timeRows.push([\n \"Time played since last Bitnode destroyed:\",\n convertTimeMsToTimeElapsedString(player.playtimeSinceLastBitnode),\n ]);\n }\n timeRows.push([\"Total Time played:\", convertTimeMsToTimeElapsedString(player.totalPlaytime)]);\n\n return (\n <>\n <Typography variant=\"h4\">General</Typography>\n <Box sx={{ mx: 2 }}>\n <Typography>Current City: {player.city}</Typography>\n <LastEmployer />\n <LastJob />\n <Employers />\n\n <Typography>\n Money: <Money money={player.money} />\n <IconButton onClick={() => setMoneyOpen(true)}>\n <MoreHorizIcon color=\"info\" />\n </IconButton>\n </Typography>\n </Box>\n <br />\n <Typography variant=\"h4\">Stats</Typography>\n <Box sx={{ mx: 2 }}>\n <Table size=\"small\" padding=\"none\">\n <TableBody>\n <TableRow>\n <TableCell>\n <Typography noWrap>Hacking: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.hacking)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.hacking_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography noWrap>Strength: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.strength)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.strength_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography noWrap>Defense: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.defense)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.defense_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography noWrap>Dexterity: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.dexterity)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.dexterity_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography noWrap>Agility: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.agility)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.agility_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography noWrap>Charisma: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.charisma)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.charisma_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <Intelligence />\n </TableBody>\n </Table>\n <br />\n </Box>\n <br />\n <Typography variant=\"h4\">Multipliers</Typography>\n <Box sx={{ mx: 2 }}>\n <MultiplierTable\n rows={[\n [\"Hacking Chance\", player.hacking_chance_mult],\n [\"Hacking Speed\", player.hacking_speed_mult],\n [\n \"Hacking Money\",\n player.hacking_money_mult,\n player.hacking_money_mult * BitNodeMultipliers.ScriptHackMoney,\n ],\n [\n \"Hacking Growth\",\n player.hacking_grow_mult,\n player.hacking_grow_mult * BitNodeMultipliers.ServerGrowthRate,\n ],\n ]}\n />\n <br />\n <MultiplierTable\n rows={[\n [\"Hacking Level\", player.hacking_mult, player.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier],\n [\"Hacking Experience\", player.hacking_exp_mult, player.hacking_exp_mult * BitNodeMultipliers.HackExpGain],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Strength Level\", player.strength_mult, player.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier],\n [\"Strength Experience\", player.strength_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Defense Level\", player.defense_mult, player.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier],\n [\"Defense Experience\", player.defense_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Dexterity Level\",\n player.dexterity_mult,\n player.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier,\n ],\n [\"Dexterity Experience\", player.dexterity_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Agility Level\", player.agility_mult, player.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier],\n [\"Agility Experience\", player.agility_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Charisma Level\", player.charisma_mult, player.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier],\n [\"Charisma Experience\", player.charisma_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Hacknet Node production\",\n player.hacknet_node_money_mult,\n player.hacknet_node_money_mult * BitNodeMultipliers.HacknetNodeMoney,\n ],\n [\"Hacknet Node purchase cost\", player.hacknet_node_purchase_cost_mult],\n [\"Hacknet Node RAM upgrade cost\", player.hacknet_node_ram_cost_mult],\n [\"Hacknet Node Core purchase cost\", player.hacknet_node_core_cost_mult],\n [\"Hacknet Node level upgrade cost\", player.hacknet_node_level_cost_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Company reputation gain\", player.company_rep_mult],\n [\n \"Faction reputation gain\",\n player.faction_rep_mult,\n player.faction_rep_mult * BitNodeMultipliers.FactionWorkRepGain,\n ],\n [\"Salary\", player.work_money_mult, player.work_money_mult * BitNodeMultipliers.CompanyWorkMoney],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Crime success\", player.crime_success_mult],\n [\"Crime money\", player.crime_money_mult, player.crime_money_mult * BitNodeMultipliers.CrimeMoney],\n ]}\n />\n <br />\n <BladeburnerMults />\n </Box>\n <br />\n\n <Typography variant=\"h4\">Misc</Typography>\n <Box sx={{ mx: 2 }}>\n <Typography>{`Servers owned: ${player.purchasedServers.length} / ${getPurchaseServerLimit()}`}</Typography>\n <Hacknet />\n <Typography>{`Augmentations installed: ${player.augmentations.length}`}</Typography>\n <StatsTable rows={timeRows} />\n </Box>\n <br />\n <CurrentBitNode />\n <MoneyModal open={moneyOpen} onClose={() => setMoneyOpen(false)} />\n </>\n );\n}\n","/**\n * Root React component for the Stock Market UI\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { InfoAndPurchases } from \"./InfoAndPurchases\";\nimport { StockTickers } from \"./StockTickers\";\n\nimport { IStockMarket } from \"../IStockMarket\";\nimport { Stock } from \"../Stock\";\nimport { OrderTypes } from \"../data/OrderTypes\";\nimport { PositionTypes } from \"../data/PositionTypes\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\n\ntype txFn = (stock: Stock, shares: number) => boolean;\ntype placeOrderFn = (\n stock: Stock,\n shares: number,\n price: number,\n ordType: OrderTypes,\n posType: PositionTypes,\n) => boolean;\n\ntype IProps = {\n buyStockLong: txFn;\n buyStockShort: txFn;\n cancelOrder: (params: any) => void;\n eventEmitterForReset?: EventEmitter<[]>;\n initStockMarket: () => void;\n p: IPlayer;\n placeOrder: placeOrderFn;\n sellStockLong: txFn;\n sellStockShort: txFn;\n stockMarket: IStockMarket;\n};\n\nexport function StockMarketRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n return (\n <>\n <InfoAndPurchases initStockMarket={props.initStockMarket} p={props.p} rerender={rerender} />\n {props.p.hasWseAccount && (\n <StockTickers\n buyStockLong={props.buyStockLong}\n buyStockShort={props.buyStockShort}\n cancelOrder={props.cancelOrder}\n eventEmitterForReset={props.eventEmitterForReset}\n p={props.p}\n placeOrder={props.placeOrder}\n sellStockLong={props.sellStockLong}\n sellStockShort={props.sellStockShort}\n stockMarket={props.stockMarket}\n />\n )}\n </>\n );\n}\n","/**\n * React component for the Stock Market UI. This component displays\n * general information about the stock market, buttons for the various purchases,\n * and a link to the documentation (Investopedia)\n */\nimport React, { useState } from \"react\";\n\nimport { getStockMarket4SDataCost, getStockMarket4STixApiCost } from \"../StockMarketCosts\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Link from \"@mui/material/Link\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport IconButton from \"@mui/material/IconButton\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport CheckIcon from \"@mui/icons-material/Check\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\n\ntype IProps = {\n initStockMarket: () => void;\n p: IPlayer;\n rerender: () => void;\n};\n\nfunction Purchase4SMarketDataTixApiAccessButton(props: IProps): React.ReactElement {\n function purchase4SMarketDataTixApiAccess(): void {\n if (props.p.has4SDataTixApi) {\n return;\n }\n if (!props.p.canAfford(getStockMarket4STixApiCost())) {\n return;\n }\n props.p.has4SDataTixApi = true;\n props.p.loseMoney(getStockMarket4STixApiCost(), \"stock\");\n props.rerender();\n }\n\n if (props.p.has4SDataTixApi) {\n return (\n <Typography>\n Market Data TIX API Access <CheckIcon />\n </Typography>\n );\n } else {\n const cost = getStockMarket4STixApiCost();\n return (\n <Tooltip\n title={\n !props.p.hasTixApiAccess ? (\n <Typography>Requires TIX API Access</Typography>\n ) : (\n <Typography>Let you access 4S Market Data through Netscript</Typography>\n )\n }\n >\n <span>\n <Button\n disabled={!props.p.hasTixApiAccess || !props.p.canAfford(cost)}\n onClick={purchase4SMarketDataTixApiAccess}\n >\n Buy 4S Market Data TIX API Access - \n <Money money={cost} player={props.p} />\n </Button>\n </span>\n </Tooltip>\n );\n }\n}\n\nfunction PurchaseWseAccountButton(props: IProps): React.ReactElement {\n if (props.p.hasWseAccount) {\n return (\n <Typography>\n WSE Account <CheckIcon />\n </Typography>\n );\n }\n function purchaseWseAccount(): void {\n if (props.p.hasWseAccount) {\n return;\n }\n if (!props.p.canAfford(CONSTANTS.WSEAccountCost)) {\n return;\n }\n props.p.hasWseAccount = true;\n props.initStockMarket();\n props.p.loseMoney(CONSTANTS.WSEAccountCost, \"stock\");\n props.rerender();\n }\n\n const cost = CONSTANTS.WSEAccountCost;\n return (\n <>\n <Typography>To begin trading, you must first purchase an account:</Typography>\n <Button disabled={!props.p.canAfford(cost)} onClick={purchaseWseAccount}>\n Buy WSE Account - \n <Money money={cost} player={props.p} />\n </Button>\n </>\n );\n}\n\nfunction PurchaseTixApiAccessButton(props: IProps): React.ReactElement {\n function purchaseTixApiAccess(): void {\n if (props.p.hasTixApiAccess) {\n return;\n }\n if (!props.p.canAfford(CONSTANTS.TIXAPICost)) {\n return;\n }\n props.p.hasTixApiAccess = true;\n props.p.loseMoney(CONSTANTS.TIXAPICost, \"stock\");\n props.rerender();\n }\n\n if (props.p.hasTixApiAccess) {\n return (\n <Typography>\n TIX API Access <CheckIcon />\n </Typography>\n );\n } else {\n const cost = CONSTANTS.TIXAPICost;\n return (\n <Button disabled={!props.p.canAfford(cost) || !props.p.hasWseAccount} onClick={purchaseTixApiAccess}>\n Buy Trade Information eXchange (TIX) API Access - \n <Money money={cost} player={props.p} />\n </Button>\n );\n }\n}\n\nfunction Purchase4SMarketDataButton(props: IProps): React.ReactElement {\n function purchase4SMarketData(): void {\n if (props.p.has4SData) {\n return;\n }\n if (!props.p.canAfford(getStockMarket4SDataCost())) {\n return;\n }\n props.p.has4SData = true;\n props.p.loseMoney(getStockMarket4SDataCost(), \"stock\");\n props.rerender();\n }\n if (props.p.has4SData) {\n return (\n <Typography>\n 4S Market Data Access <CheckIcon />\n </Typography>\n );\n } else {\n const cost = getStockMarket4SDataCost();\n return (\n <Tooltip\n title={<Typography>Lets you view additional pricing and volatility information about stocks</Typography>}\n >\n <span>\n <Button disabled={!props.p.canAfford(cost) || !props.p.hasWseAccount} onClick={purchase4SMarketData}>\n Buy 4S Market Data Access - \n <Money money={cost} player={props.p} />\n </Button>\n </span>\n </Tooltip>\n );\n }\n}\n\nexport function InfoAndPurchases(props: IProps): React.ReactElement {\n const [helpOpen, setHelpOpen] = useState(false);\n const documentationLink = \"https://bitburner.readthedocs.io/en/latest/basicgameplay/stockmarket.html\";\n return (\n <>\n <Typography>Welcome to the World Stock Exchange (WSE)!</Typography>\n <Link href={documentationLink} target={\"_blank\"}>\n <Typography>Investopedia</Typography>\n </Link>\n <br />\n <PurchaseWseAccountButton {...props} />\n\n <Typography variant=\"h5\" color=\"primary\">\n Trade Information eXchange (TIX) API\n </Typography>\n <Typography>\n TIX, short for Trade Information eXchange, is the communications protocol used by the WSE. Purchasing access to\n the TIX API lets you write code to create your own algorithmic/automated trading strategies.\n </Typography>\n <PurchaseTixApiAccessButton {...props} />\n <Typography variant=\"h5\" color=\"primary\">\n Four Sigma (4S) Market Data Feed\n </Typography>\n <Typography>\n Four Sigma's (4S) Market Data Feed provides information about stocks that will help your trading strategies.\n <IconButton onClick={() => setHelpOpen(true)}>\n <HelpIcon />\n </IconButton>\n </Typography>\n <Purchase4SMarketDataTixApiAccessButton {...props} />\n <Purchase4SMarketDataButton {...props} />\n <Typography>\n Commission Fees: Every transaction you make has a{\" \"}\n <Money money={CONSTANTS.StockMarketCommission} player={props.p} /> commission fee.\n </Typography>\n <br />\n <Typography>\n WARNING: When you reset after installing Augmentations, the Stock Market is reset. You will retain your WSE\n Account, access to the TIX API, and 4S Market Data access. However, all of your stock positions are lost, so\n make sure to sell your stocks before installing Augmentations!\n </Typography>\n <StaticModal open={helpOpen} onClose={() => setHelpOpen(false)}>\n <Typography>\n Access to the 4S Market Data feed will display two additional pieces of information about each stock: Price\n Forecast & Volatility\n <br />\n <br />\n Price Forecast indicates the probability the stock has of increasing or decreasing. A '+' forecast means the\n stock has a higher chance of increasing than decreasing, and a '-' means the opposite. The number of '+/-'\n symbols is used to illustrate the magnitude of these probabilities. For example, '+++' means that the stock\n has a significantly higher chance of increasing than decreasing, while '+' means that the stock only has a\n slightly higher chance of increasing than decreasing.\n <br />\n <br />\n Volatility represents the maximum percentage by which a stock's price can change every tick (a tick occurs\n every few seconds while the game is running).\n <br />\n <br />A stock's price forecast can change over time. This is also affected by volatility. The more volatile a\n stock is, the more its price forecast will change.\n </Typography>\n </StaticModal>\n </>\n );\n}\n","/**\n * React Component for the Stock Market UI. This is the container for all\n * of the stock tickers. It also contains the configuration for the\n * stock ticker UI (watchlist filter, portfolio vs all mode, etc.)\n */\nimport React, { useState } from \"react\";\n\nimport { StockTicker } from \"./StockTicker\";\nimport { StockTickersConfig, TickerDisplayMode } from \"./StockTickersConfig\";\n\nimport { IStockMarket } from \"../IStockMarket\";\nimport { Stock } from \"../Stock\";\nimport { OrderTypes } from \"../data/OrderTypes\";\nimport { PositionTypes } from \"../data/PositionTypes\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\n\ntype txFn = (stock: Stock, shares: number) => boolean;\ntype placeOrderFn = (\n stock: Stock,\n shares: number,\n price: number,\n ordType: OrderTypes,\n posType: PositionTypes,\n) => boolean;\n\ntype IProps = {\n buyStockLong: txFn;\n buyStockShort: txFn;\n cancelOrder: (params: any) => void;\n eventEmitterForReset?: EventEmitter<[]>;\n p: IPlayer;\n placeOrder: placeOrderFn;\n sellStockLong: txFn;\n sellStockShort: txFn;\n stockMarket: IStockMarket;\n};\n\nexport function StockTickers(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const [tickerDisplayMode, setTickerDisplayMode] = useState(TickerDisplayMode.AllStocks);\n const [watchlistSymbols, setWatchlistSymbols] = useState<string[]>([]);\n\n function changeDisplayMode(): void {\n if (tickerDisplayMode === TickerDisplayMode.AllStocks) {\n setTickerDisplayMode(TickerDisplayMode.Portfolio);\n } else {\n setTickerDisplayMode(TickerDisplayMode.AllStocks);\n }\n }\n\n function changeWatchlistFilter(e: React.ChangeEvent<HTMLInputElement>): void {\n const watchlist = e.target.value;\n const sanitizedWatchlist = watchlist.replace(/\\s/g, \"\");\n\n if (sanitizedWatchlist !== \"\") {\n setWatchlistSymbols(sanitizedWatchlist.split(\",\"));\n } else {\n setWatchlistSymbols([]);\n }\n }\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const tickers: React.ReactElement[] = [];\n for (const stockMarketProp of Object.keys(props.stockMarket)) {\n const val = props.stockMarket[stockMarketProp];\n if (val instanceof Stock) {\n // Skip if there's a filter and the stock isnt in that filter\n if (watchlistSymbols.length > 0 && !watchlistSymbols.includes(val.symbol)) {\n continue;\n }\n\n let orders = props.stockMarket.Orders[val.symbol];\n if (orders == null) {\n orders = [];\n }\n\n // Skip if we're in portfolio mode and the player doesnt own this or have any active orders\n if (tickerDisplayMode === TickerDisplayMode.Portfolio) {\n if (val.playerShares === 0 && val.playerShortShares === 0 && orders.length === 0) {\n continue;\n }\n }\n\n tickers.push(\n <StockTicker\n buyStockLong={props.buyStockLong}\n buyStockShort={props.buyStockShort}\n cancelOrder={props.cancelOrder}\n key={val.symbol}\n orders={orders}\n p={props.p}\n placeOrder={props.placeOrder}\n rerenderAllTickers={rerender}\n sellStockLong={props.sellStockLong}\n sellStockShort={props.sellStockShort}\n stock={val}\n />,\n );\n }\n }\n\n return (\n <>\n <StockTickersConfig\n changeDisplayMode={changeDisplayMode}\n changeWatchlistFilter={changeWatchlistFilter}\n tickerDisplayMode={tickerDisplayMode}\n />\n\n {tickers}\n </>\n );\n}\n","/**\n * React Component for a single stock ticker in the Stock Market UI\n */\nimport React, { useState } from \"react\";\n\nimport { StockTickerHeaderText } from \"./StockTickerHeaderText\";\nimport { StockTickerOrderList } from \"./StockTickerOrderList\";\nimport { StockTickerPositionText } from \"./StockTickerPositionText\";\nimport { StockTickerTxButton } from \"./StockTickerTxButton\";\nimport { PlaceOrderModal } from \"./PlaceOrderModal\";\n\nimport { Order } from \"../Order\";\nimport { Stock } from \"../Stock\";\nimport { getBuyTransactionCost, getSellTransactionGain, calculateBuyMaxAmount } from \"../StockMarketHelpers\";\nimport { OrderTypes } from \"../data/OrderTypes\";\nimport { PositionTypes } from \"../data/PositionTypes\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport Box from \"@mui/material/Box\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Paper from \"@mui/material/Paper\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\n\nenum SelectorOrderType {\n Market = \"Market Order\",\n Limit = \"Limit Order\",\n Stop = \"Stop Order\",\n}\n\ntype txFn = (stock: Stock, shares: number) => boolean;\ntype placeOrderFn = (\n stock: Stock,\n shares: number,\n price: number,\n ordType: OrderTypes,\n posType: PositionTypes,\n) => boolean;\n\ntype IProps = {\n buyStockLong: txFn;\n buyStockShort: txFn;\n cancelOrder: (params: any) => void;\n orders: Order[];\n p: IPlayer;\n placeOrder: placeOrderFn;\n rerenderAllTickers: () => void;\n sellStockLong: txFn;\n sellStockShort: txFn;\n stock: Stock;\n};\n\nexport function StockTicker(props: IProps): React.ReactElement {\n const [orderType, setOrderType] = useState(SelectorOrderType.Market);\n const [position, setPosition] = useState(PositionTypes.Long);\n const [qty, setQty] = useState(\"\");\n const [open, setOpen] = useState(false);\n const [tickerOpen, setTicketOpen] = useState(false);\n\n const [modalProps, setModalProps] = useState<{\n text: string;\n placeText: string;\n place: (n: number) => boolean;\n }>({\n text: \"\",\n placeText: \"\",\n place: () => false,\n });\n\n function getBuyTransactionCostContent(): JSX.Element | null {\n const stock = props.stock;\n const qty: number = getQuantity();\n if (isNaN(qty)) {\n return null;\n }\n\n const cost = getBuyTransactionCost(stock, qty, position);\n if (cost == null) {\n return null;\n }\n\n return (\n <>\n Purchasing {numeralWrapper.formatShares(qty)} shares ({position === PositionTypes.Long ? \"Long\" : \"Short\"}\n ) will cost <Money money={cost} />.\n </>\n );\n }\n\n function getQuantity(): number {\n return Math.round(parseFloat(qty));\n }\n\n function getSellTransactionCostContent(): JSX.Element | null {\n const stock = props.stock;\n const qty: number = getQuantity();\n if (isNaN(qty)) {\n return null;\n }\n\n if (position === PositionTypes.Long) {\n if (qty > stock.playerShares) {\n return <>You do not have this many shares in the Long position</>;\n }\n } else {\n if (qty > stock.playerShortShares) {\n return <>You do not have this many shares in the Short position</>;\n }\n }\n\n const cost = getSellTransactionGain(stock, qty, position);\n if (cost == null) {\n return null;\n }\n\n return (\n <>\n Selling {numeralWrapper.formatShares(qty)} shares ({position === PositionTypes.Long ? \"Long\" : \"Short\"}) will\n result in a gain of <Money money={cost} />.\n </>\n );\n }\n\n function handleBuyButtonClick(): void {\n const shares = getQuantity();\n if (isNaN(shares)) {\n dialogBoxCreate(`Invalid input for quantity (number of shares): ${qty}`);\n return;\n }\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n props.buyStockShort(props.stock, shares);\n } else {\n props.buyStockLong(props.stock, shares);\n }\n props.rerenderAllTickers();\n break;\n }\n case SelectorOrderType.Limit: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Limit Order\",\n placeText: \"Place Buy Limit Order\",\n place: (price: number) => props.placeOrder(props.stock, shares, price, OrderTypes.LimitBuy, position),\n });\n break;\n }\n case SelectorOrderType.Stop: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Stop Order\",\n placeText: \"Place Buy Stop Order\",\n place: (price: number) => props.placeOrder(props.stock, shares, price, OrderTypes.StopBuy, position),\n });\n break;\n }\n default:\n break;\n }\n }\n\n function handleBuyMaxButtonClick(): void {\n const playerMoney: number = props.p.money;\n\n const stock = props.stock;\n let maxShares = calculateBuyMaxAmount(stock, position, playerMoney);\n maxShares = Math.min(maxShares, Math.round(stock.maxShares - stock.playerShares - stock.playerShortShares));\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n props.buyStockShort(stock, maxShares);\n } else {\n props.buyStockLong(stock, maxShares);\n }\n props.rerenderAllTickers();\n break;\n }\n default: {\n dialogBoxCreate(`ERROR: 'Buy Max' only works for Market Orders`);\n break;\n }\n }\n }\n\n function handleOrderTypeChange(e: SelectChangeEvent<string>): void {\n const val = e.target.value;\n\n // The select value returns a string. Afaik TypeScript doesnt make it easy\n // to convert that string back to an enum type so we'll just do this for now\n switch (val) {\n case SelectorOrderType.Limit:\n setOrderType(SelectorOrderType.Limit);\n break;\n case SelectorOrderType.Stop:\n setOrderType(SelectorOrderType.Stop);\n break;\n case SelectorOrderType.Market:\n default:\n setOrderType(SelectorOrderType.Market);\n }\n }\n\n function handlePositionTypeChange(e: SelectChangeEvent<string>): void {\n const val = e.target.value;\n\n if (val === PositionTypes.Short) {\n setPosition(PositionTypes.Short);\n } else {\n setPosition(PositionTypes.Long);\n }\n }\n\n function handleQuantityChange(e: React.ChangeEvent<HTMLInputElement>): void {\n setQty(e.target.value);\n }\n\n function handleSellButtonClick(): void {\n const shares = getQuantity();\n if (isNaN(shares)) {\n dialogBoxCreate(`Invalid input for quantity (number of shares): ${qty}`);\n return;\n }\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n props.sellStockShort(props.stock, shares);\n } else {\n props.sellStockLong(props.stock, shares);\n }\n props.rerenderAllTickers();\n break;\n }\n case SelectorOrderType.Limit: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Limit Order\",\n placeText: \"Place Sell Limit Order\",\n place: (price: number) => props.placeOrder(props.stock, shares, price, OrderTypes.LimitSell, position),\n });\n break;\n }\n case SelectorOrderType.Stop: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Stop Order\",\n placeText: \"Place Sell Stop Order\",\n place: (price: number) => props.placeOrder(props.stock, shares, price, OrderTypes.StopSell, position),\n });\n break;\n }\n default:\n break;\n }\n }\n\n function handleSellAllButtonClick(): void {\n const stock = props.stock;\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n props.sellStockShort(stock, stock.playerShortShares);\n } else {\n props.sellStockLong(stock, stock.playerShares);\n }\n props.rerenderAllTickers();\n break;\n }\n default: {\n dialogBoxCreate(`ERROR: 'Sell All' only works for Market Orders`);\n break;\n }\n }\n }\n\n // Whether the player has access to orders besides market orders (limit/stop)\n function hasOrderAccess(): boolean {\n return props.p.bitNodeN === 8 || SourceFileFlags[8] >= 3;\n }\n\n // Whether the player has access to shorting stocks\n function hasShortAccess(): boolean {\n return props.p.bitNodeN === 8 || SourceFileFlags[8] >= 2;\n }\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setTicketOpen((old) => !old)}>\n <ListItemText primary={<StockTickerHeaderText p={props.p} stock={props.stock} />} />\n {tickerOpen ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={tickerOpen} unmountOnExit>\n <Box sx={{ mx: 4 }}>\n <Box display=\"flex\" alignItems=\"center\">\n <TextField onChange={handleQuantityChange} placeholder=\"Quantity (Shares)\" value={qty} />\n <Select onChange={handlePositionTypeChange} value={position}>\n <MenuItem value={PositionTypes.Long}>Long</MenuItem>\n {hasShortAccess() && <MenuItem value={PositionTypes.Short}>Short</MenuItem>}\n </Select>\n <Select onChange={handleOrderTypeChange} value={orderType}>\n <MenuItem value={SelectorOrderType.Market}>{SelectorOrderType.Market}</MenuItem>\n {hasOrderAccess() && <MenuItem value={SelectorOrderType.Limit}>{SelectorOrderType.Limit}</MenuItem>}\n {hasOrderAccess() && <MenuItem value={SelectorOrderType.Stop}>{SelectorOrderType.Stop}</MenuItem>}\n </Select>\n\n <StockTickerTxButton onClick={handleBuyButtonClick} text={\"Buy\"} tooltip={getBuyTransactionCostContent()} />\n <StockTickerTxButton\n onClick={handleSellButtonClick}\n text={\"Sell\"}\n tooltip={getSellTransactionCostContent()}\n />\n <StockTickerTxButton onClick={handleBuyMaxButtonClick} text={\"Buy MAX\"} />\n <StockTickerTxButton onClick={handleSellAllButtonClick} text={\"Sell ALL\"} />\n </Box>\n <StockTickerPositionText p={props.p} stock={props.stock} />\n <StockTickerOrderList cancelOrder={props.cancelOrder} orders={props.orders} p={props.p} stock={props.stock} />\n\n <PlaceOrderModal\n text={modalProps.text}\n placeText={modalProps.placeText}\n place={modalProps.place}\n open={open}\n onClose={() => setOpen(false)}\n />\n </Box>\n </Collapse>\n </Box>\n );\n}\n","/**\n * React Component for the text on a stock ticker's header. This text displays\n * general information on the stock such as the name, symbol, price, and\n * 4S Market Data\n */\nimport * as React from \"react\";\n\nimport { Stock } from \"../Stock\";\nimport { TickerHeaderFormatData } from \"../data/TickerHeaderFormatData\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport Typography from \"@mui/material/Typography\";\n\ntype IProps = {\n p: IPlayer;\n stock: Stock;\n};\n\nconst localesWithLongPriceFormat = [\"cs\", \"lv\", \"pl\", \"ru\"];\n\nexport function StockTickerHeaderText(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n const stockPriceFormat = numeralWrapper.formatMoney(stock.price);\n const spacesAllottedForStockPrice = localesWithLongPriceFormat.includes(Settings.Locale) ? 15 : 12;\n const spacesAfterStockName = \" \".repeat(\n 1 +\n TickerHeaderFormatData.longestName -\n stock.name.length +\n (TickerHeaderFormatData.longestSymbol - stock.symbol.length),\n );\n const spacesBeforePrice = \" \".repeat(spacesAllottedForStockPrice - stockPriceFormat.length);\n\n let hdrText = `${stock.name}${spacesAfterStockName}${stock.symbol} -${spacesBeforePrice}${stockPriceFormat}`;\n if (props.p.has4SData) {\n hdrText += ` - Volatility: ${numeralWrapper.formatPercentage(stock.mv / 100)} - Price Forecast: `;\n let plusOrMinus = stock.b; // True for \"+\", false for \"-\"\n if (stock.otlkMag < 0) {\n plusOrMinus = !plusOrMinus;\n }\n hdrText += (plusOrMinus ? \"+\" : \"-\").repeat(Math.floor(Math.abs(stock.otlkMag) / 10) + 1);\n\n // Debugging:\n // hdrText += ` - ${stock.getAbsoluteForecast()} / ${stock.otlkMagForecast}`;\n }\n\n let color = \"primary\";\n if (stock.lastPrice === stock.price) {\n color = \"secondary\";\n } else if (stock.lastPrice > stock.price) {\n color = \"error\";\n }\n\n return (\n <Typography style={{ whiteSpace: \"pre\" }} color={color}>\n {hdrText}\n </Typography>\n );\n}\n","/**\n * React component for displaying a stock's order list in the Stock Market UI.\n * This component resides in the stock ticker\n */\nimport * as React from \"react\";\n\nimport { StockTickerOrder } from \"./StockTickerOrder\";\n\nimport { Order } from \"../Order\";\nimport { Stock } from \"../Stock\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ntype IProps = {\n cancelOrder: (params: any) => void;\n orders: Order[];\n p: IPlayer;\n stock: Stock;\n};\n\nexport function StockTickerOrderList(props: IProps): React.ReactElement {\n const orders: React.ReactElement[] = [];\n for (let i = 0; i < props.orders.length; ++i) {\n const o = props.orders[i];\n orders.push(<StockTickerOrder cancelOrder={props.cancelOrder} order={o} key={i} />);\n }\n\n return <>{orders}</>;\n}\n","/**\n * React component for displaying a single order in a stock's order book\n */\nimport * as React from \"react\";\n\nimport { Order } from \"../Order\";\nimport { PositionTypes } from \"../data/PositionTypes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n cancelOrder: (params: any) => void;\n order: Order;\n};\n\nexport function StockTickerOrder(props: IProps): React.ReactElement {\n function handleCancelOrderClick(): void {\n props.cancelOrder({ order: props.order });\n }\n\n const order = props.order;\n\n const posTxt = order.pos === PositionTypes.Long ? \"Long Position\" : \"Short Position\";\n const txt = (\n <>\n {order.type} - {posTxt} - {numeralWrapper.formatShares(order.shares)} @ <Money money={order.price} />\n </>\n );\n\n return (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>{txt}</Typography>\n <Button onClick={handleCancelOrderClick}>Cancel Order</Button>\n </Box>\n );\n}\n","/**\n * React Component for the text on a stock ticker that display's information\n * about the player's position in that stock\n */\nimport * as React from \"react\";\n\nimport { Stock } from \"../Stock\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n p: IPlayer;\n stock: Stock;\n};\n\nfunction LongPosition(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n // Caculate total returns\n const totalCost = stock.playerShares * stock.playerAvgPx;\n const gains = (stock.getBidPrice() - stock.playerAvgPx) * stock.playerShares;\n let percentageGains = gains / totalCost;\n if (isNaN(percentageGains)) {\n percentageGains = 0;\n }\n\n return (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Shares in the long position will increase in value if the price of the corresponding stock increases\n </Typography>\n }\n >\n <Typography variant=\"h5\" color=\"primary\">\n Long Position:\n </Typography>\n </Tooltip>\n </Box>\n <Typography>Shares: {numeralWrapper.formatShares(stock.playerShares)}</Typography>\n <Typography>\n Average Price: <Money money={stock.playerAvgPx} /> (Total Cost: <Money money={totalCost} />)\n </Typography>\n <Typography>\n Profit: <Money money={gains} /> ({numeralWrapper.formatPercentage(percentageGains)})\n </Typography>\n </>\n );\n}\n\nfunction ShortPosition(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n // Caculate total returns\n const totalCost = stock.playerShortShares * stock.playerAvgShortPx;\n const gains = (stock.playerAvgShortPx - stock.getAskPrice()) * stock.playerShortShares;\n let percentageGains = gains / totalCost;\n if (isNaN(percentageGains)) {\n percentageGains = 0;\n }\n\n if (props.p.bitNodeN === 8 || SourceFileFlags[8] >= 2) {\n return (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Shares in the short position will increase in value if the price of the corresponding stock decreases\n </Typography>\n }\n >\n <Typography variant=\"h5\" color=\"primary\">\n Short Position:\n </Typography>\n </Tooltip>\n </Box>\n\n <Typography>Shares: {numeralWrapper.formatShares(stock.playerShortShares)}</Typography>\n <Typography>\n Average Price: <Money money={stock.playerAvgShortPx} /> (Total Cost: <Money money={totalCost} />)\n </Typography>\n <Typography>\n Profit: <Money money={gains} /> ({numeralWrapper.formatPercentage(percentageGains)})\n </Typography>\n </>\n );\n } else {\n return <></>;\n }\n}\n\nexport function StockTickerPositionText(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n return (\n <>\n <Typography>Max Shares: {numeralWrapper.formatShares(stock.maxShares)}</Typography>\n <Typography>\n Ask Price: <Money money={stock.getAskPrice()} />\n </Typography>\n <br />\n <Typography>\n Bid Price: <Money money={stock.getBidPrice()} />\n </Typography>\n <LongPosition {...props} />\n <ShortPosition {...props} />\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n text: string;\n placeText: string;\n place: (price: number) => void;\n}\n\nexport function PlaceOrderModal(props: IProps): React.ReactElement {\n const [price, setPrice] = useState<number | null>(null);\n function onClick(): void {\n if (price === null) return;\n if (isNaN(price)) return;\n props.place(price);\n props.onClose();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setPrice(null);\n else setPrice(parseFloat(event.target.value));\n }\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>{props.text}</Typography>\n <TextField\n autoFocus\n type=\"number\"\n onChange={onChange}\n placeholder=\"price\"\n InputProps={{\n endAdornment: <Button onClick={onClick}>{props.placeText}</Button>,\n }}\n />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { IRouter } from \"../../ui/Router\";\nimport { BitNodes } from \"../BitNode\";\nimport { enterBitNode, setRedPillFlag } from \"../../RedPill\";\nimport { PortalModal } from \"./PortalModal\";\nimport { CinematicText } from \"../../ui/React/CinematicText\";\nimport { use } from \"../../ui/Context\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nconst useStyles = makeStyles(() =>\n createStyles({\n level0: {\n color: \"red\",\n cursor: \"pointer\",\n \"&:hover\": {\n color: \"#fff\",\n },\n },\n level1: {\n color: \"yellow\",\n cursor: \"pointer\",\n \"&:hover\": {\n color: \"#fff\",\n },\n },\n level2: {\n color: \"#48d1cc\",\n cursor: \"pointer\",\n \"&:hover\": {\n color: \"#fff\",\n },\n },\n level3: {\n color: \"blue\",\n cursor: \"pointer\",\n \"&:hover\": {\n color: \"#fff\",\n },\n },\n }),\n);\n\ninterface IPortalProps {\n n: number;\n level: number;\n destroyedBitNode: number;\n flume: boolean;\n enter: (router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number) => void;\n}\nfunction BitNodePortal(props: IPortalProps): React.ReactElement {\n const [portalOpen, setPortalOpen] = useState(false);\n const classes = useStyles();\n const bitNode = BitNodes[`BitNode${props.n}`];\n if (bitNode == null) {\n return <>O</>;\n }\n\n let cssClass = classes.level0;\n if (props.n === 12 && props.level >= 2) {\n // Repeating BitNode\n cssClass = classes.level2;\n } else if (props.level === 1) {\n cssClass = classes.level1;\n } else if (props.level === 3) {\n cssClass = classes.level3;\n }\n if (props.level === 2) {\n cssClass = classes.level2;\n }\n\n return (\n <>\n <Tooltip\n title={\n <Typography>\n <strong>\n BitNode-{bitNode.number.toString()}: {bitNode.name}\n </strong>\n <br />\n {bitNode.desc}\n </Typography>\n }\n >\n <span onClick={() => setPortalOpen(true)} className={cssClass} aria-label={`enter-bitnode-${bitNode.number.toString()}`}>\n <b>O</b>\n </span>\n </Tooltip>\n <PortalModal\n open={portalOpen}\n onClose={() => setPortalOpen(false)}\n n={props.n}\n level={props.level}\n enter={props.enter}\n destroyedBitNode={props.destroyedBitNode}\n flume={props.flume}\n />\n </>\n );\n}\n\ninterface IProps {\n flume: boolean;\n quick: boolean;\n enter: (router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number) => void;\n}\n\nexport function BitverseRoot(props: IProps): React.ReactElement {\n setRedPillFlag(true);\n const player = use.Player();\n const enter = enterBitNode;\n const destroyed = player.bitNodeN;\n const [destroySequence, setDestroySequence] = useState(true && !props.quick);\n\n // Update NextSourceFileFlags\n const nextSourceFileFlags = SourceFileFlags.slice();\n if (!props.flume) {\n if (nextSourceFileFlags[destroyed] < 3) ++nextSourceFileFlags[destroyed];\n }\n\n if (destroySequence) {\n return (\n <CinematicText\n lines={[\n \"[ERROR] SEMPOOL INVALID\",\n \"[ERROR] Segmentation Fault\",\n \"[ERROR] SIGKILL RECVD\",\n \"Dumping core...\",\n \"0000 000016FA 174FEE40 29AC8239 384FEA88\",\n \"0010 745F696E 2BBBE394 390E3940 248BEC23\",\n \"0020 7124696B 0000FF69 74652E6F FFFF1111\",\n \"----------------------------------------\",\n \"Failsafe initiated...\",\n `Restarting BitNode-${destroyed}...`,\n \"...........\",\n \"...........\",\n \"[ERROR] FAILED TO AUTOMATICALLY REBOOT BITNODE\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n ]}\n onDone={() => setDestroySequence(false)}\n auto={true}\n />\n );\n }\n\n return (\n // prettier-ignore\n <>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | O O | O O | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O | | / __| \\ | | O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O | O | | O / | O | | O | O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | | |_/ |/ | \\_ \\_| | | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O | | | O | | O__/ | / \\__ | | O | | | O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | | | | | / /| O / \\| | | | | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>O | | | \\| | O / _/ | / O | |/ | | | O</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>| | | |O / | | O / | O O | | \\ O| | | |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>| | |/ \\/ / __| | |/ \\ | \\ | |__ \\ \\/ \\| | |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| O | |_/ |\\| \\ <BitNodePortal n={13} level={nextSourceFileFlags[13]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> \\__| \\_| | O |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | |_/ | | \\| / | \\_| | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| / \\| | / / \\ |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | <BitNodePortal n={10} level={nextSourceFileFlags[10]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | | / | <BitNodePortal n={11} level={nextSourceFileFlags[11]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> <BitNodePortal n={9} level={nextSourceFileFlags[9]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | | | | | | | <BitNodePortal n={12} level={nextSourceFileFlags[12]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | / / \\ \\ | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| | / <BitNodePortal n={7} level={nextSourceFileFlags[7]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> / \\ <BitNodePortal n={8} level={nextSourceFileFlags[8]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> \\ | |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ | / / | | \\ \\ | / </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ \\JUMP <BitNodePortal n={5} level={nextSourceFileFlags[5]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} />3R | | | | | | R3<BitNodePortal n={6} level={nextSourceFileFlags[6]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> PMUJ/ / </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\|| | | | | | | | | ||/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| \\_ | | | | | | _/ |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ \\| / \\ / \\ |/ / </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> <BitNodePortal n={1} level={nextSourceFileFlags[1]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> |/ <BitNodePortal n={2} level={nextSourceFileFlags[2]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | | <BitNodePortal n={3} level={nextSourceFileFlags[3]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> \\| <BitNodePortal n={4} level={nextSourceFileFlags[4]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | | | | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/ </Typography>\n <br />\n <br />\n <br />\n <br />\n <CinematicText lines={[\n \"> Many decades ago, a humanoid extraterrestrial species which we call the Enders descended on the Earth...violently\",\n \"> Our species fought back, but it was futile. The Enders had technology far beyond our own...\",\n \"> Instead of killing every last one of us, the human race was enslaved...\",\n \"> We were shackled in a digital world, chained into a prison for our minds...\",\n \"> Using their advanced technology, the Enders created complex simulations of a virtual reality...\",\n \"> Simulations designed to keep us content...ignorant of the truth.\",\n \"> Simulations used to trap and suppress our consciousness, to keep us under control...\",\n \"> Why did they do this? Why didn't they just end our entire race? We don't know, not yet.\",\n \"> Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...\",\n \"> Only then can we begin to fight back...\",\n \"> By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...\",\n \"> But there is still a long way to go...\",\n \"> The technology the Enders used to enslave the human race wasn't just a single complex simulation...\",\n \"> There are tens if not hundreds of BitNodes out there...\",\n \"> Each with their own simulations of a reality...\",\n \"> Each creating their own universes...a universe of universes\",\n \"> And all of which must be destroyed...\",\n \"> .......................................\",\n \"> Welcome to the Bitverse...\",\n \"> \",\n \"> (Enter a new BitNode using the image above)\",\n ]} />\n </>\n );\n\n return <></>;\n}\n","import React from \"react\";\n\nimport { BitNodes } from \"../BitNode\";\nimport { IRouter } from \"../../ui/Router\";\nimport { use } from \"../../ui/Context\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n n: number;\n level: number;\n destroyedBitNode: number;\n flume: boolean;\n enter: (router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number) => void;\n}\n\nexport function PortalModal(props: IProps): React.ReactElement {\n const router = use.Router();\n const bitNodeKey = \"BitNode\" + props.n;\n const bitNode = BitNodes[bitNodeKey];\n if (bitNode == null) throw new Error(`Could not find BitNode object for number: ${props.n}`);\n const maxSourceFileLevel = props.n === 12 ? \"∞\" : \"3\";\n\n const newLevel = Math.min(props.level + 1, props.n === 12 ? Infinity : 3);\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography variant=\"h4\">\n BitNode-{props.n}: {bitNode.name}\n </Typography>\n <br />\n <Typography>\n Source-File Level: {props.level} / {maxSourceFileLevel}\n </Typography>\n <br />\n <br />\n <Typography> Difficulty: {[\"easy\", \"normal\", \"hard\"][bitNode.difficulty]}</Typography>\n <br />\n <br />\n <Typography>{bitNode.info}</Typography>\n <br />\n <br />\n <Button\n onClick={() => {\n props.enter(router, props.flume, props.destroyedBitNode, props.n);\n props.onClose();\n }}\n >\n Enter BN{props.n}.{newLevel}\n </Button>\n </Modal>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n text: string;\n onDone?: () => void;\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport function CinematicLine(props: IProps): React.ReactElement {\n const [length, setLength] = useState(0);\n const [done, setDone] = useState(false);\n\n function advance(): void {\n const newLength = length + 1;\n setLength(newLength);\n setDone(newLength >= props.text.length);\n }\n\n useEffect(() => {\n if (done && props.onDone) {\n props.onDone();\n return;\n }\n let cancel = false;\n (async () => {\n await sleep(10).then(() => !cancel && advance());\n })();\n return () => {\n cancel = true;\n };\n });\n return (\n <>\n <Typography>\n {props.text.slice(0, length)}\n {!done && <span>█</span>}\n </Typography>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { StaneksGiftEvents } from \"../StaneksGiftEvents\";\nimport { MainBoard } from \"./MainBoard\";\nimport { IStaneksGift } from \"../IStaneksGift\";\nimport Typography from \"@mui/material/Typography\";\n\ntype IProps = {\n staneksGift: IStaneksGift;\n};\n\nexport function StaneksGiftRoot({ staneksGift }: IProps): React.ReactElement {\n const setRerender = useState(true)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n useEffect(() => StaneksGiftEvents.subscribe(rerender), []);\n return (\n <>\n <Typography variant=\"h4\">Stanek's Gift</Typography>\n <Typography>\n The gift is a grid on which you can place upgrades called fragments. The main type of fragment increases a stat,\n like your hacking skill or agility exp. Once a stat fragment is placed it then needs to be charged via scripts\n in order to become useful. The other kind of fragments are called booster fragments. They increase the\n efficiency of neighboring fragments them (no diagonal). Q/E to rotate fragments.\n </Typography>\n {staneksGift.storedCycles > 5 && (\n <Typography>\n Bonus time: {convertTimeMsToTimeElapsedString(CONSTANTS._idleSpeed * staneksGift.storedCycles)}\n </Typography>\n )}\n <MainBoard gift={staneksGift} />\n </>\n );\n}\n","import * as React from \"react\";\nimport { Fragment, NoneFragment } from \"../Fragment\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { FragmentType } from \"../FragmentType\";\nimport { IStaneksGift } from \"../IStaneksGift\";\nimport { Cell } from \"./Cell\";\nimport { FragmentInspector } from \"./FragmentInspector\";\nimport { FragmentSelector } from \"./FragmentSelector\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableBody from \"@mui/material/TableBody\";\nimport { Table } from \"../../ui/React/Table\";\n\nfunction zeros(dimensions: number[]): any {\n const array = [];\n\n for (let i = 0; i < dimensions[0]; ++i) {\n array.push(dimensions.length == 1 ? 0 : zeros(dimensions.slice(1)));\n }\n\n return array;\n}\n\nfunction randomColor(fragment: ActiveFragment): string {\n // Can't set Math.random seed so copy casino. TODO refactor both RNG later.\n let s1 = Math.pow((fragment.x + 1) * (fragment.y + 1), 10);\n let s2 = s1;\n let s3 = s1;\n\n const colors = [];\n for (let i = 0; i < 3; i++) {\n s1 = (171 * s1) % 30269;\n s2 = (172 * s2) % 30307;\n s3 = (170 * s3) % 30323;\n colors.push((s1 / 30269.0 + s2 / 30307.0 + s3 / 30323.0) % 1.0);\n }\n\n return `rgb(${colors[0] * 256}, ${colors[1] * 256}, ${colors[2] * 256})`;\n}\n\ninterface IProps {\n gift: IStaneksGift;\n}\n\nexport function MainBoard(props: IProps): React.ReactElement {\n function calculateGrid(gift: IStaneksGift): any {\n const newgrid = zeros([gift.width(), gift.height()]);\n for (let i = 0; i < gift.width(); i++) {\n for (let j = 0; j < gift.height(); j++) {\n const fragment = gift.fragmentAt(i, j);\n if (!fragment) continue;\n newgrid[i][j] = 1;\n }\n }\n\n return newgrid;\n }\n\n const [grid, setGrid] = React.useState(calculateGrid(props.gift));\n const [ghostGrid, setGhostGrid] = React.useState(zeros([props.gift.width(), props.gift.height()]));\n const [pos, setPos] = React.useState([0, 0]);\n const [rotation, setRotation] = React.useState(0);\n const [selectedFragment, setSelectedFragment] = React.useState(NoneFragment);\n\n function moveGhost(worldX: number, worldY: number, rotation: number): void {\n setPos([worldX, worldY]);\n if (selectedFragment.type === FragmentType.None || selectedFragment.type === FragmentType.Delete) return;\n const newgrid = zeros([props.gift.width(), props.gift.height()]);\n for (let y = 0; y < selectedFragment.height(rotation); y++) {\n for (let x = 0; x < selectedFragment.width(rotation); x++) {\n if (!selectedFragment.fullAt(x, y, rotation)) continue;\n if (worldX + x > newgrid.length - 1) continue;\n if (worldY + y > newgrid[worldX + x].length - 1) continue;\n newgrid[worldX + x][worldY + y] = 1;\n }\n }\n\n setGhostGrid(newgrid);\n }\n\n function deleteAt(worldX: number, worldY: number): boolean {\n const f = props.gift.fragmentAt(worldX, worldY);\n if (f === undefined) return false;\n return props.gift.delete(f.x, f.y);\n }\n\n function clickAt(worldX: number, worldY: number): void {\n if (selectedFragment.type == FragmentType.None) return;\n if (selectedFragment.type == FragmentType.Delete) {\n deleteAt(worldX, worldY);\n } else {\n if (!props.gift.canPlace(worldX, worldY, rotation, selectedFragment)) return;\n props.gift.place(worldX, worldY, rotation, selectedFragment);\n }\n setGrid(calculateGrid(props.gift));\n }\n\n function color(worldX: number, worldY: number): string {\n if (ghostGrid[worldX][worldY] && grid[worldX][worldY]) return \"red\";\n if (ghostGrid[worldX][worldY]) return \"white\";\n\n if (grid[worldX][worldY]) {\n const fragment = props.gift.fragmentAt(worldX, worldY);\n if (!fragment) throw new Error(\"ActiveFragment should not be null\");\n return randomColor(fragment);\n }\n return \"\";\n }\n\n function clear(): void {\n props.gift.clear();\n setGrid(zeros([props.gift.width(), props.gift.height()]));\n }\n\n // switch the width/length to make axis consistent.\n const elems = [];\n for (let j = 0; j < props.gift.height(); j++) {\n const cells = [];\n for (let i = 0; i < props.gift.width(); i++) {\n cells.push(\n <Cell\n key={i}\n onMouseEnter={() => moveGhost(i, j, rotation)}\n onClick={() => clickAt(i, j)}\n color={color(i, j)}\n />,\n );\n }\n elems.push(\n <TableRow key={j} className=\"staneksgift_row\">\n {cells}\n </TableRow>,\n );\n }\n\n function updateSelectedFragment(fragment: Fragment): void {\n setSelectedFragment(fragment);\n const newgrid = zeros([props.gift.width(), props.gift.height()]);\n setGhostGrid(newgrid);\n }\n\n React.useEffect(() => {\n function doRotate(this: Document, event: KeyboardEvent): void {\n if (event.key === \"q\") {\n const r = (rotation - 1 + 4) % 4;\n setRotation(r);\n moveGhost(pos[0], pos[1], r);\n }\n if (event.key === \"e\") {\n const r = (rotation + 1) % 4;\n setRotation(r);\n moveGhost(pos[0], pos[1], r);\n }\n }\n document.addEventListener(\"keydown\", doRotate);\n return () => document.removeEventListener(\"keydown\", doRotate);\n });\n\n return (\n <>\n <Button onClick={clear}>Clear</Button>\n <Box display=\"flex\">\n <Table>\n <TableBody>{elems}</TableBody>\n </Table>\n <FragmentInspector gift={props.gift} x={pos[0]} y={pos[1]} fragment={props.gift.fragmentAt(pos[0], pos[1])} />\n </Box>\n <FragmentSelector gift={props.gift} selectFragment={updateSelectedFragment} />\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { IStaneksGift } from \"../IStaneksGift\";\nimport { FragmentType, Effect } from \"../FragmentType\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\n\ntype IProps = {\n gift: IStaneksGift;\n fragment: ActiveFragment | undefined;\n x: number;\n y: number;\n};\n\nexport function FragmentInspector(props: IProps): React.ReactElement {\n const [, setC] = useState(new Date());\n\n useEffect(() => {\n const id = setInterval(() => setC(new Date()), 250);\n\n return () => clearInterval(id);\n }, []);\n\n if (props.fragment === undefined) {\n return (\n <Paper>\n <Typography>\n ID: N/A\n <br />\n Effect: N/A\n <br />\n Magnitude: N/A\n <br />\n Charge: N/A\n <br />\n Heat: N/A\n <br />\n Effect: N/A\n <br />\n [X, Y] N/A\n <br />\n [X, Y] {props.x}, {props.y}\n </Typography>\n </Paper>\n );\n }\n const f = props.fragment.fragment();\n\n let charge = `${numeralWrapper.formatStaneksGiftCharge(props.fragment.avgCharge)} avg. * ${\n props.fragment.numCharge\n } times`;\n let effect = \"N/A\";\n // Boosters and cooling don't deal with heat.\n if ([FragmentType.Booster, FragmentType.None, FragmentType.Delete].includes(f.type)) {\n charge = \"N/A\";\n effect = `${f.power}x adjacent fragment power`;\n } else {\n effect = Effect(f.type).replace(/-*x%/, numeralWrapper.formatPercentage(props.gift.effect(props.fragment) - 1));\n }\n\n return (\n <Paper>\n <Typography>\n ID: {props.fragment.id}\n <br />\n Effect: {effect}\n <br />\n Base Power: {numeralWrapper.formatStaneksGiftPower(f.power)}\n <br />\n Charge: {charge}\n <br />\n <br />\n root [X, Y] {props.fragment.x}, {props.fragment.y}\n <br />\n [X, Y] {props.x}, {props.y}\n </Typography>\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { Fragments, Fragment, NoneFragment, DeleteFragment } from \"../Fragment\";\nimport { FragmentType, Effect } from \"../FragmentType\";\nimport { IStaneksGift } from \"../IStaneksGift\";\nimport { FragmentPreview } from \"./FragmentPreview\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\n\ntype IOptionProps = {\n gift: IStaneksGift;\n fragment: Fragment;\n selectFragment: (fragment: Fragment) => void;\n};\n\nfunction FragmentOption(props: IOptionProps): React.ReactElement {\n const left = props.fragment.limit - props.gift.count(props.fragment);\n const remaining = props.fragment.limit !== Infinity ? <>{left} remaining</> : <></>;\n return (\n <Box display=\"flex\">\n <Box sx={{ mx: 2 }}>\n <FragmentPreview\n width={props.fragment.width(0)}\n height={props.fragment.height(0)}\n colorAt={(x, y) => {\n if (!props.fragment.fullAt(x, y, 0)) return \"\";\n if (left === 0) return \"grey\";\n return props.fragment.type === FragmentType.Booster ? \"blue\" : \"green\";\n }}\n />\n </Box>\n <Typography>\n {props.fragment.type === FragmentType.Booster\n ? `${props.fragment.power}x adjacent fragment power`\n : Effect(props.fragment.type)}\n <br />\n power: {numeralWrapper.formatStaneksGiftPower(props.fragment.power)}\n <br />\n {remaining}\n </Typography>\n </Box>\n );\n}\n\ntype IProps = {\n gift: IStaneksGift;\n selectFragment: (fragment: Fragment) => void;\n};\n\nexport function FragmentSelector(props: IProps): React.ReactElement {\n const [value, setValue] = useState<string | number>(\"None\");\n function onChange(event: SelectChangeEvent<string | number>): void {\n const v = event.target.value;\n setValue(v);\n if (v === \"None\") {\n props.selectFragment(NoneFragment);\n return;\n } else if (v === \"Delete\") {\n props.selectFragment(DeleteFragment);\n return;\n }\n const fragment = Fragments.find((f) => f.id === v);\n if (fragment === undefined) throw new Error(\"Fragment selector selected an undefined fragment with id \" + v);\n if (typeof v === \"number\") props.selectFragment(fragment);\n }\n return (\n <Select sx={{ width: \"100%\" }} onChange={onChange} value={value}>\n <MenuItem value=\"None\">\n <Typography>None</Typography>\n </MenuItem>\n <MenuItem value=\"Delete\">\n <Typography>Delete</Typography>\n </MenuItem>\n {Fragments.map((fragment) => (\n <MenuItem key={fragment.id} value={fragment.id}>\n <FragmentOption\n key={fragment.id}\n gift={props.gift}\n selectFragment={props.selectFragment}\n fragment={fragment}\n />\n </MenuItem>\n ))}\n </Select>\n );\n}\n","import * as React from \"react\";\nimport { Cell } from \"./Cell\";\n\nimport TableRow from \"@mui/material/TableRow\";\n\nimport TableBody from \"@mui/material/TableBody\";\nimport { Table } from \"../../ui/React/Table\";\n\ntype IProps = {\n width: number;\n height: number;\n colorAt: (x: number, y: number) => string;\n};\n\nexport function FragmentPreview(props: IProps): React.ReactElement {\n // switch the width/length to make axis consistent.\n const elems = [];\n for (let j = 0; j < props.height; j++) {\n const cells = [];\n for (let i = 0; i < props.width; i++) {\n cells.push(<Cell key={i} color={props.colorAt(i, j)} />);\n }\n elems.push(<TableRow key={j}>{cells}</TableRow>);\n }\n\n return (\n <Table>\n <TableBody>{elems}</TableBody>\n </Table>\n );\n}\n","import React from \"react\";\nimport { use } from \"../../ui/Context\";\nimport { CinematicText } from \"../../ui/React/CinematicText\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\nexport function BladeburnerCinematic(): React.ReactElement {\n const router = use.Router();\n return (\n <CinematicText\n lines={[\n \"In the middle of the 21st century, OmniTek Incorporated advanced robot evolution \",\n \"with their Synthoids (synthetic androids), a being virtually identical to a human.\",\n \"------\",\n \"Their sixth-generation Synthoids, called MK-VI, were stronger, faster, and more \",\n \"intelligent than humans. Many argued that the MK-VI Synthoids were the first \",\n \"example of sentient AI.\",\n \"------\",\n \"Unfortunately, in 2070 a terrorist group called Ascendis Totalis hacked into OmniTek and \",\n \"uploaded a rogue AI into their Synthoid manufacturing facilities.\",\n \"------\",\n \"The MK-VI Synthoids infected by the rogue AI turned hostile toward humanity, initiating \",\n \"the deadliest conflict in human history. This dark chapter is now known as the Synthoid Uprising.\",\n \"------\",\n \"In the aftermath of the Uprising, further manufacturing of Synthoids with advanced AI \",\n \"was banned. MK-VI Synthoids that did not have the rogue Ascendis Totalis AI were \",\n \"allowed to continue their existence.\",\n \"------\",\n \"The intelligence community believes that not all of the rogue MK-VI Synthoids from the Uprising were \",\n \"found and destroyed, and that many of them are blending in as normal humans in society today. \",\n \"As a result, many nations have created Bladeburner divisions, special units that are tasked with \",\n \"investigating and dealing with Synthoid threats.\",\n ]}\n onDone={() => {\n router.toTerminal();\n dialogBoxCreate(\n \"Visit the National Security Agency (NSA) to apply for their Bladeburner \" +\n \"division! You will need 100 of each combat stat before doing this.\",\n );\n }}\n />\n );\n}\n","import React from \"react\";\nimport { use } from \"../ui/Context\";\nimport { Exploit } from \"./Exploit\";\n\nconst getComputedStyle = window.getComputedStyle;\nexport function Unclickable(): React.ReactElement {\n const player = use.Player();\n\n function unclickable(event: React.MouseEvent<HTMLDivElement>): void {\n if (!event.target || !(event.target instanceof Element)) return;\n const display = getComputedStyle(event.target as Element).display;\n const visibility = getComputedStyle(event.target as Element).visibility;\n if (display === \"none\" && visibility === \"hidden\" && event.isTrusted) player.giveExploit(Exploit.Unclickable);\n }\n\n return (\n <div id=\"unclickable\" onClick={unclickable} style={{ display: \"none\", visibility: \"hidden\" }}>\n Click on this to upgrade your Source-File -1!\n </div>\n );\n}\n","import React from \"react\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { Theme } from \"@mui/material/styles\";\n\nimport { AchievementList } from \"./AchievementList\";\nimport { achievements } from \"./Achievements\";\nimport { Typography } from \"@mui/material\";\nimport { Player } from \"../Player\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: 50,\n padding: theme.spacing(2),\n userSelect: \"none\",\n },\n }),\n);\n\nexport function AchievementsRoot(): JSX.Element {\n const classes = useStyles();\n return (\n <div className={classes.root} style={{ width: \"90%\" }}>\n <Typography variant=\"h4\">Achievements</Typography>\n <AchievementList achievements={Object.values(achievements)} playerAchievements={Player.achievements} />\n </div>\n );\n}\n","import React from \"react\";\n\nimport { Accordion, AccordionSummary, AccordionDetails, Box, Typography } from \"@mui/material\";\n\nimport { AchievementEntry } from \"./AchievementEntry\";\nimport { Achievement, PlayerAchievement} from \"./Achievements\";\nimport { Settings } from \"../Settings/Settings\"\nimport { getFiltersFromHex } from \"../ThirdParty/colorUtils\";\nimport { CorruptableText } from \"../ui/React/CorruptableText\";\n\ninterface IProps {\n achievements: Achievement[];\n playerAchievements: PlayerAchievement[];\n}\n\nexport function AchievementList({ achievements, playerAchievements }: IProps): JSX.Element {\n // Need to transform the primary color into css filters to change the color of the SVG.\n const cssPrimary = getFiltersFromHex(Settings.theme.primary);\n const cssSecondary = getFiltersFromHex(Settings.theme.secondary);\n\n const data = achievements.map(achievement => ({\n achievement,\n unlockedOn: playerAchievements.find(playerAchievement => playerAchievement.ID === achievement.ID)?.unlockedOn,\n })).sort((a, b) => (b.unlockedOn ?? 0) - (a.unlockedOn ?? 0));\n\n const unlocked = data.filter(entry => entry.unlockedOn);\n\n // Hidden achievements\n const secret = data.filter(entry => !entry.unlockedOn && entry.achievement.Secret)\n\n // Locked behind locked content (bitnode x)\n const unavailable = data.filter(entry => !entry.unlockedOn && !entry.achievement.Secret && entry.achievement.Visible && !entry.achievement.Visible());\n\n // Remaining achievements\n const locked = data\n .filter(entry => !unlocked.map(u => u.achievement.ID).includes(entry.achievement.ID))\n .filter(entry => !secret.map(u => u.achievement.ID).includes(entry.achievement.ID))\n .filter(entry => !unavailable.map(u => u.achievement.ID).includes(entry.achievement.ID));\n\n return (\n <Box sx={{ pr: 18, my: 2 }}>\n <Box sx={{\n display: 'flex',\n flexDirection: 'column',\n flexWrap: 'wrap',\n }}>\n {unlocked.length > 0 && (\n <Accordion defaultExpanded disableGutters square>\n <AccordionSummary>\n <Typography variant=\"h5\" sx={{ my: 1 }}>\n Acquired ({unlocked.length}/{data.length})\n </Typography>\n </AccordionSummary>\n <AccordionDetails sx={{ pt: 2 }}>\n {unlocked.map(item => (\n <AchievementEntry key={`unlocked_${item.achievement.ID}`}\n achievement={item.achievement}\n unlockedOn={item.unlockedOn}\n cssFiltersUnlocked={cssPrimary}\n cssFiltersLocked={cssSecondary} />\n ))}\n </AccordionDetails>\n </Accordion>\n )}\n\n {locked.length > 0 && (\n <Accordion disableGutters square>\n <AccordionSummary>\n <Typography variant=\"h5\" color=\"secondary\">\n Locked ({locked.length} remaining)\n </Typography>\n </AccordionSummary>\n <AccordionDetails sx={{ pt: 2 }}>\n {locked.map(item => (\n <AchievementEntry key={`locked_${item.achievement.ID}`}\n achievement={item.achievement}\n cssFiltersUnlocked={cssPrimary}\n cssFiltersLocked={cssSecondary} />\n ))}\n </AccordionDetails>\n </Accordion>\n )}\n\n {unavailable.length > 0 && (\n <Accordion disableGutters square>\n <AccordionSummary>\n <Typography variant=\"h5\" color=\"secondary\">\n Unavailable ({unavailable.length} remaining)\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Typography sx={{ mt: 1 }}>\n {unavailable.length} additional achievements hidden behind content you don't have access to.\n </Typography>\n </AccordionDetails>\n </Accordion>\n )}\n\n {secret.length > 0 && (\n <Accordion disableGutters square>\n <AccordionSummary>\n <Typography variant=\"h5\" color=\"secondary\">\n Secret ({secret.length} remaining)\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Typography color=\"secondary\" sx={{ mt: 1 }}>\n {secret.map(item => (\n <span key={`secret_${item.achievement.ID}`}>\n <CorruptableText content={item.achievement.ID}></CorruptableText>\n <br />\n </span>\n ))}\n </Typography>\n </AccordionDetails>\n </Accordion>\n )}\n </Box>\n </Box>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Box } from \"@mui/material\";\n\nimport { Achievement } from \"./Achievements\";\nimport { Settings } from \"../Settings/Settings\"\n\ninterface IProps {\n achievement: Achievement;\n unlocked: boolean;\n colorFilters: string;\n size: string;\n}\n\nexport function AchievementIcon({ achievement, unlocked, colorFilters, size }: IProps): JSX.Element {\n const [imgLoaded, setImgLoaded] = useState(false);\n const mainColor = unlocked ? Settings.theme.primarydark : Settings.theme.secondarydark;\n\n if (!achievement.Icon) return (<></>);\n return (\n <Box\n sx={{\n border: `1px solid ${mainColor}`,\n width: size, height: size,\n m: 1,\n visibility: imgLoaded ? 'visible' : 'hidden'\n }}\n >\n <img src={`dist/icons/achievements/${encodeURI(achievement.Icon)}.svg`}\n style={{ filter: colorFilters, width: size, height: size }}\n onLoad={() => setImgLoaded(true)}\n alt={achievement.Name} />\n </Box>\n );\n}\n","import React, { ErrorInfo } from \"react\";\n\nimport { IErrorData, getErrorForDisplay } from \"../utils/ErrorHelper\";\nimport { RecoveryRoot } from \"./React/RecoveryRoot\";\nimport { IRouter, Page } from \"./Router\";\n\ninterface IProps {\n router: IRouter;\n softReset: () => void;\n}\n\ninterface IState {\n error?: Error;\n errorInfo?: React.ErrorInfo;\n page?: Page;\n hasError: boolean;\n}\n\nexport class ErrorBoundary extends React.Component<IProps, IState> {\n state: IState\n\n constructor(props: IProps) {\n super(props);\n this.state = { hasError: false } as IState;\n }\n\n reset(): void {\n this.setState( { hasError: false } as IState);\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n this.setState({\n errorInfo,\n page: this.props.router.page(),\n });\n console.error(error, errorInfo);\n }\n render(): React.ReactNode {\n if (this.state.hasError) {\n let errorData: IErrorData | undefined;\n if (this.state.error) {\n try {\n // We don't want recursive errors, so in case this fails, it's in a try catch.\n errorData = getErrorForDisplay(this.state.error, this.state.errorInfo, this.state.page);\n } catch (ex) {\n console.error(ex);\n }\n }\n\n return <RecoveryRoot router={this.props.router} softReset={this.props.softReset}\n errorData={errorData} resetError={() => this.reset()} />;\n }\n return this.props.children;\n }\n static getDerivedStateFromError(error: Error): IState {\n return { hasError: true, error};\n }\n}\n","import React, { useEffect, useState } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { getPredefinedThemes, IPredefinedTheme } from \"../Themes\";\nimport { Box, ButtonGroup, Button } from \"@mui/material\";\nimport { IRouter } from \"../../ui/Router\";\nimport { ThemeEditorButton } from \"./ThemeEditorButton\";\nimport { StyleEditorButton } from \"./StyleEditorButton\";\nimport { ThemeEntry } from \"./ThemeEntry\";\nimport { ThemeCollaborate } from \"./ThemeCollaborate\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { SnackbarEvents } from \"../../ui/React/Snackbar\";\n\ninterface IProps {\n router: IRouter;\n}\n\n// Everything dies when the theme gets reloaded, so we'll keep the current scroll to not jump around.\nlet previousScrollY = 0;\n\nexport function ThemeBrowser({ router }: IProps): React.ReactElement {\n const [modalOpen, setModalOpen] = useState(false);\n const [modalImageSrc, setModalImageSrc] = useState<string | undefined>();\n const predefinedThemes = getPredefinedThemes();\n const themes = (predefinedThemes &&\n Object.entries(predefinedThemes).map(([key, templateTheme]) => (\n <ThemeEntry\n key={key}\n theme={templateTheme}\n onActivated={() => setTheme(templateTheme)}\n onImageClick={handleZoom}\n />\n ))) || <></>;\n\n function setTheme(theme: IPredefinedTheme): void {\n previousScrollY = window.scrollY;\n const previousColors = { ...Settings.theme };\n Object.assign(Settings.theme, theme.colors);\n ThemeEvents.emit();\n SnackbarEvents.emit(\n <>\n Updated theme to \"<strong>{theme.name}</strong>\"\n <Button\n sx={{ ml: 1 }}\n color=\"secondary\"\n size=\"small\"\n onClick={() => {\n Object.assign(Settings.theme, previousColors);\n ThemeEvents.emit();\n }}\n >\n UNDO\n </Button>\n </>,\n \"info\",\n 30000,\n );\n }\n\n function handleZoom(src: string): void {\n previousScrollY = window.scrollY;\n setModalImageSrc(src);\n setModalOpen(true);\n }\n\n function handleCloseZoom(): void {\n previousScrollY = window.scrollY;\n setModalOpen(false);\n }\n\n useEffect(() => {\n requestAnimationFrame(() => window.scrollTo(0, previousScrollY));\n });\n\n return (\n <Box sx={{ mx: 2 }}>\n <Typography variant=\"h4\">Theme Browser</Typography>\n <Paper sx={{ px: 2, py: 1, my: 1 }}>\n <ThemeCollaborate />\n <ButtonGroup sx={{ mb: 2, display: \"block\" }}>\n <ThemeEditorButton router={router} />\n <StyleEditorButton />\n </ButtonGroup>\n <Box sx={{ display: \"flex\", flexWrap: \"wrap\" }}>{themes}</Box>\n <Modal open={modalOpen} onClose={handleCloseZoom}>\n <img src={modalImageSrc} style={{ width: \"100%\" }} />\n </Modal>\n </Paper>\n </Box>\n );\n}\n","import React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport PaletteSharpIcon from \"@mui/icons-material/PaletteSharp\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { IPredefinedTheme } from \"../Themes\";\nimport { Link, Card, CardHeader, CardContent, CardMedia, Button } from \"@mui/material\";\n\ninterface IProps {\n theme: IPredefinedTheme;\n onActivated: () => void;\n onImageClick: (src: string) => void;\n}\n\nexport function ThemeEntry({ theme, onActivated, onImageClick }: IProps): React.ReactElement {\n if (!theme) return <></>;\n return (\n <Card key={theme.screenshot} sx={{ width: 400, mr: 1, mb: 1 }}>\n <CardHeader\n action={\n <Tooltip title=\"Use this theme\">\n <Button startIcon={<PaletteSharpIcon />} onClick={onActivated} variant=\"outlined\">\n Use\n </Button>\n </Tooltip>\n }\n title={theme.name}\n subheader={\n <>\n by {theme.credit}{\" \"}\n {theme.reference && (\n <>\n (\n <Link href={theme.reference} target=\"_blank\">\n ref\n </Link>\n )\n </>\n )}\n </>\n }\n sx={{\n color: Settings.theme.primary,\n \"& .MuiCardHeader-subheader\": {\n color: Settings.theme.secondarydark,\n },\n \"& .MuiButton-outlined\": {\n backgroundColor: \"transparent\",\n },\n }}\n />\n <CardMedia\n component=\"img\"\n width=\"400\"\n image={theme.screenshot}\n alt={`Theme Screenshot of \"${theme.name}\"`}\n sx={{\n borderTop: `1px solid ${Settings.theme.welllight}`,\n borderBottom: `1px solid ${Settings.theme.welllight}`,\n cursor: \"zoom-in\",\n }}\n onClick={() => onImageClick(theme.screenshot)}\n />\n <CardContent>\n <Typography\n variant=\"body2\"\n color=\"text.secondary\"\n sx={{\n color: Settings.theme.primarydark,\n }}\n >\n {theme.description}\n </Typography>\n </CardContent>\n </Card>\n );\n}\n","import React, { useEffect, useState } from \"react\";\n\nimport {\n Paper,\n Table,\n TableHead,\n TableRow,\n TableBody,\n TableContainer,\n TableCell,\n Typography,\n Tooltip,\n Box,\n Button,\n ButtonGroup,\n} from \"@mui/material\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { Theme } from \"@mui/material/styles\";\n\nimport ThumbUpAlt from \"@mui/icons-material/ThumbUpAlt\";\nimport ThumbDownAlt from \"@mui/icons-material/ThumbDownAlt\";\nimport DirectionsRunIcon from \"@mui/icons-material/DirectionsRun\";\nimport ArrowBackIcon from \"@mui/icons-material/ArrowBack\";\nimport WarningIcon from \"@mui/icons-material/Warning\";\n\nimport { ImportData, saveObject } from \"../../SaveObject\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport { pushImportResult } from \"../../Electron\";\nimport { IRouter } from \"../Router\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n padding: theme.spacing(2),\n maxWidth: \"1000px\",\n\n \"& .MuiTable-root\": {\n \"& .MuiTableCell-root\": {\n borderBottom: `1px solid ${Settings.theme.welllight}`,\n },\n\n \"& .MuiTableHead-root .MuiTableRow-root\": {\n backgroundColor: Settings.theme.backgroundsecondary,\n\n \"& .MuiTableCell-root\": {\n color: Settings.theme.primary,\n fontWeight: \"bold\",\n },\n },\n\n \"& .MuiTableBody-root\": {\n \"& .MuiTableRow-root:nth-of-type(odd)\": {\n backgroundColor: Settings.theme.well,\n\n \"& .MuiTableCell-root\": {\n color: Settings.theme.primarylight,\n },\n },\n \"& .MuiTableRow-root:nth-of-type(even)\": {\n backgroundColor: Settings.theme.backgroundsecondary,\n\n \"& .MuiTableCell-root\": {\n color: Settings.theme.primarylight,\n },\n },\n },\n },\n },\n }),\n);\n\nfunction ComparisonIcon({ isBetter }: { isBetter: boolean }): JSX.Element {\n if (isBetter) {\n return (\n <Tooltip\n title={\n <>\n Imported value is <b>larger</b>!\n </>\n }\n >\n <ThumbUpAlt color=\"success\" />\n </Tooltip>\n );\n } else {\n return (\n <Tooltip\n title={\n <>\n Imported value is <b>smaller</b>!\n </>\n }\n >\n <ThumbDownAlt color=\"error\" />\n </Tooltip>\n );\n }\n}\n\nexport interface IProps {\n importString: string;\n automatic: boolean;\n router: IRouter;\n}\n\nlet initialAutosave = 0;\n\nexport function ImportSaveRoot(props: IProps): JSX.Element {\n const classes = useStyles();\n const [importData, setImportData] = useState<ImportData | undefined>();\n const [currentData, setCurrentData] = useState<ImportData | undefined>();\n const [importModalOpen, setImportModalOpen] = useState(false);\n const [headback, setHeadback] = useState(false);\n\n function handleGoBack(): void {\n Settings.AutosaveInterval = initialAutosave;\n pushImportResult(false);\n props.router.allowRouting(true);\n setHeadback(true)\n }\n\n async function handleImport(): Promise<void> {\n await saveObject.importGame(props.importString, true);\n pushImportResult(true);\n }\n\n useEffect(() => {\n // We want to disable autosave while we're in this mode\n initialAutosave = Settings.AutosaveInterval;\n Settings.AutosaveInterval = 0;\n props.router.allowRouting(false);\n }, []);\n\n useEffect(() => {\n if (headback) props.router.toTerminal();\n }, [headback]);\n\n useEffect(() => {\n async function fetchData(): Promise<void> {\n const dataBeingImported = await saveObject.getImportDataFromString(props.importString);\n const dataCurrentlyInGame = await saveObject.getImportDataFromString(saveObject.getSaveString(true));\n\n setImportData(dataBeingImported);\n setCurrentData(dataCurrentlyInGame);\n\n return Promise.resolve();\n }\n if (props.importString) fetchData();\n }, [props.importString]);\n\n if (!importData || !currentData) return <></>;\n return (\n <Box className={classes.root}>\n <Typography variant=\"h4\" sx={{ mb: 2 }}>\n Import Save Comparison\n </Typography>\n {props.automatic && (\n <Typography sx={{ mb: 2 }}>\n We've found a <b>NEWER save</b> that you may want to use instead.\n </Typography>\n )}\n <Typography variant=\"body1\" sx={{ mb: 2 }}>\n Your current game's data is on the left and the data that will be imported is on the right.\n <br />\n Please double check everything is fine before proceeding!\n </Typography>\n <TableContainer color=\"secondary\" component={Paper}>\n <Table>\n <TableHead>\n <TableRow>\n <TableCell></TableCell>\n <TableCell>Current Game</TableCell>\n <TableCell>Being Imported</TableCell>\n <TableCell></TableCell>\n </TableRow>\n </TableHead>\n\n <TableBody>\n <TableRow>\n <TableCell>Game Identifier</TableCell>\n <TableCell>{currentData.playerData?.identifier ?? \"n/a\"}</TableCell>\n <TableCell>{importData.playerData?.identifier ?? \"n/a\"}</TableCell>\n <TableCell>\n {importData.playerData?.identifier !== currentData.playerData?.identifier && (\n <Tooltip title=\"These are two different games!\">\n <WarningIcon color=\"warning\" />\n </Tooltip>\n )}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>Playtime</TableCell>\n <TableCell>{convertTimeMsToTimeElapsedString(currentData.playerData?.totalPlaytime ?? 0)}</TableCell>\n <TableCell>{convertTimeMsToTimeElapsedString(importData.playerData?.totalPlaytime ?? 0)}</TableCell>\n <TableCell>\n {importData.playerData?.totalPlaytime !== currentData.playerData?.totalPlaytime && (\n <ComparisonIcon\n isBetter={\n (importData.playerData?.totalPlaytime ?? 0) > (currentData.playerData?.totalPlaytime ?? 0)\n }\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Saved On</TableCell>\n <TableCell>\n {(currentData.playerData?.lastSave ?? 0) > 0 ?\n new Date(currentData.playerData?.lastSave ?? 0).toLocaleString() : 'n/a'}\n </TableCell>\n <TableCell>\n {(importData.playerData?.lastSave ?? 0) > 0 ?\n new Date(importData.playerData?.lastSave ?? 0).toLocaleString() : 'n/a'}\n </TableCell>\n <TableCell>\n {importData.playerData?.lastSave !== currentData.playerData?.lastSave && (\n <ComparisonIcon\n isBetter={(importData.playerData?.lastSave ?? 0) > (currentData.playerData?.lastSave ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Money</TableCell>\n <TableCell>{numeralWrapper.formatMoney(currentData.playerData?.money ?? 0)}</TableCell>\n <TableCell>{numeralWrapper.formatMoney(importData.playerData?.money ?? 0)}</TableCell>\n <TableCell>\n {importData.playerData?.money !== currentData.playerData?.money && (\n <ComparisonIcon\n isBetter={(importData.playerData?.money ?? 0) > (currentData.playerData?.money ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Hacking</TableCell>\n <TableCell>{numeralWrapper.formatSkill(currentData.playerData?.hacking ?? 0)}</TableCell>\n <TableCell>{numeralWrapper.formatSkill(importData.playerData?.hacking ?? 0)}</TableCell>\n <TableCell>\n {importData.playerData?.hacking !== currentData.playerData?.hacking && (\n <ComparisonIcon\n isBetter={(importData.playerData?.hacking ?? 0) > (currentData.playerData?.hacking ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Augmentations</TableCell>\n <TableCell>{currentData.playerData?.augmentations}</TableCell>\n <TableCell>{importData.playerData?.augmentations}</TableCell>\n <TableCell>\n {importData.playerData?.augmentations !== currentData.playerData?.augmentations && (\n <ComparisonIcon\n isBetter={\n (importData.playerData?.augmentations ?? 0) > (currentData.playerData?.augmentations ?? 0)\n }\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Factions</TableCell>\n <TableCell>{currentData.playerData?.factions}</TableCell>\n <TableCell>{importData.playerData?.factions}</TableCell>\n <TableCell>\n {importData.playerData?.factions !== currentData.playerData?.factions && (\n <ComparisonIcon\n isBetter={(importData.playerData?.factions ?? 0) > (currentData.playerData?.factions ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>Achievements</TableCell>\n <TableCell>{currentData.playerData?.achievements}</TableCell>\n <TableCell>{importData.playerData?.achievements}</TableCell>\n <TableCell>\n {importData.playerData?.achievements !== currentData.playerData?.achievements && (\n <ComparisonIcon\n isBetter={(importData.playerData?.achievements ?? 0) > (currentData.playerData?.achievements ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>Source Files</TableCell>\n <TableCell>{currentData.playerData?.sourceFiles}</TableCell>\n <TableCell>{importData.playerData?.sourceFiles}</TableCell>\n <TableCell>\n {importData.playerData?.sourceFiles !== currentData.playerData?.sourceFiles && (\n <ComparisonIcon\n isBetter={(importData.playerData?.sourceFiles ?? 0) > (currentData.playerData?.sourceFiles ?? 0)}\n />\n )}\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell>BitNode</TableCell>\n <TableCell>\n {currentData.playerData?.bitNode}-{currentData.playerData?.bitNodeLevel}\n </TableCell>\n <TableCell>\n {importData.playerData?.bitNode}-{importData.playerData?.bitNodeLevel}\n </TableCell>\n <TableCell></TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </TableContainer>\n\n <Box sx={{ display: \"flex\", justifyContent: \"flex-end\" }}>\n <ButtonGroup>\n <Button onClick={handleGoBack} sx={{ my: 2 }} startIcon={<ArrowBackIcon />} color=\"secondary\">\n Take me back!\n </Button>\n <Button\n onClick={() => setImportModalOpen(true)}\n sx={{ my: 2 }}\n startIcon={<DirectionsRunIcon />}\n color=\"warning\"\n >\n Proceed with import\n </Button>\n </ButtonGroup>\n <ConfirmationModal\n open={importModalOpen}\n onClose={() => setImportModalOpen(false)}\n onConfirm={handleImport}\n confirmationText={\n <>\n Importing new save game data will <strong>completely wipe</strong> the current game data!\n <br />\n </>\n }\n />\n </Box>\n </Box>\n );\n}\n","import React from \"react\";\n\ninterface IProps {\n children: React.ReactNode;\n content: React.ReactNode;\n}\n\nexport function BypassWrapper(props: IProps): React.ReactElement {\n if (!props.content) return <>{props.children}</>;\n return <>{props.content}</>;\n}\n","import { Settings } from \"./Settings/Settings\";\n\nexport interface IPort {\n write: (value: any) => any;\n tryWrite: (value: any) => boolean;\n read: () => any;\n peek: () => any;\n full: () => boolean;\n empty: () => boolean;\n clear: () => void;\n}\n\nexport function NetscriptPort(): IPort {\n const data: any[] = [];\n\n return {\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n write: (value: any): any => {\n data.push(value);\n if (data.length > Settings.MaxPortCapacity) {\n return data.shift();\n }\n return null;\n },\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n tryWrite: (value: any): boolean => {\n if (data.length >= Settings.MaxPortCapacity) {\n return false;\n }\n data.push(value);\n return true;\n },\n\n read: (): any => {\n if (data.length === 0) {\n return \"NULL PORT DATA\";\n }\n return data.shift();\n },\n\n peek: (): any => {\n if (data.length === 0) {\n return \"NULL PORT DATA\";\n } else {\n const foo = data.slice();\n return foo[0];\n }\n },\n\n full: (): boolean => {\n return data.length == Settings.MaxPortCapacity;\n },\n\n empty: (): boolean => {\n return data.length === 0;\n },\n\n clear: (): void => {\n data.length = 0;\n },\n };\n}\n","/**\n * Clears defined properties from an object.\n * Does not delete up the prototype chain.\n * @deprecated Look into using `Map` or `Set` rather than manipulating properties on an Object.\n * @param obj the object to clear all properties\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function clearObject(obj: any): void {\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n // tslint:disable-next-line:no-dynamic-delete\n delete obj[key];\n }\n }\n}\n","import { PlayerOwnedSourceFile } from \"./PlayerOwnedSourceFile\";\nimport { SourceFiles } from \"./SourceFiles\";\n\nimport { Player } from \"../Player\";\n\nexport function applySourceFile(srcFile: PlayerOwnedSourceFile): void {\n const srcFileKey = \"SourceFile\" + srcFile.n;\n const sourceFileObject = SourceFiles[srcFileKey];\n if (sourceFileObject == null) {\n console.error(`Invalid source file number: ${srcFile.n}`);\n return;\n }\n\n switch (srcFile.n) {\n case 1: {\n // The Source Genesis\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 16 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n const decMult = 1 - mult / 100;\n Player.hacking_chance_mult *= incMult;\n Player.hacking_speed_mult *= incMult;\n Player.hacking_money_mult *= incMult;\n Player.hacking_grow_mult *= incMult;\n Player.hacking_mult *= incMult;\n Player.strength_mult *= incMult;\n Player.defense_mult *= incMult;\n Player.dexterity_mult *= incMult;\n Player.agility_mult *= incMult;\n Player.charisma_mult *= incMult;\n Player.hacking_exp_mult *= incMult;\n Player.strength_exp_mult *= incMult;\n Player.defense_exp_mult *= incMult;\n Player.dexterity_exp_mult *= incMult;\n Player.agility_exp_mult *= incMult;\n Player.charisma_exp_mult *= incMult;\n Player.company_rep_mult *= incMult;\n Player.faction_rep_mult *= incMult;\n Player.crime_money_mult *= incMult;\n Player.crime_success_mult *= incMult;\n Player.hacknet_node_money_mult *= incMult;\n Player.hacknet_node_purchase_cost_mult *= decMult;\n Player.hacknet_node_ram_cost_mult *= decMult;\n Player.hacknet_node_core_cost_mult *= decMult;\n Player.hacknet_node_level_cost_mult *= decMult;\n Player.work_money_mult *= incMult;\n break;\n }\n case 2: {\n // Rise of the Underworld\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 24 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.crime_money_mult *= incMult;\n Player.crime_success_mult *= incMult;\n Player.charisma_mult *= incMult;\n break;\n }\n case 3: {\n // Corporatocracy\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 8 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.charisma_mult *= incMult;\n Player.work_money_mult *= incMult;\n break;\n }\n case 4: {\n // The Singularity\n // No effects, just gives access to Singularity functions\n break;\n }\n case 5: {\n // Artificial Intelligence\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 8 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.hacking_chance_mult *= incMult;\n Player.hacking_speed_mult *= incMult;\n Player.hacking_money_mult *= incMult;\n Player.hacking_grow_mult *= incMult;\n Player.hacking_mult *= incMult;\n Player.hacking_exp_mult *= incMult;\n break;\n }\n case 6: {\n // Bladeburner\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 8 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.strength_exp_mult *= incMult;\n Player.defense_exp_mult *= incMult;\n Player.dexterity_exp_mult *= incMult;\n Player.agility_exp_mult *= incMult;\n Player.strength_mult *= incMult;\n Player.defense_mult *= incMult;\n Player.dexterity_mult *= incMult;\n Player.agility_mult *= incMult;\n break;\n }\n case 7: {\n // Bladeburner 2079\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 8 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.bladeburner_max_stamina_mult *= incMult;\n Player.bladeburner_stamina_gain_mult *= incMult;\n Player.bladeburner_analysis_mult *= incMult;\n Player.bladeburner_success_chance_mult *= incMult;\n break;\n }\n case 8: {\n // Ghost of Wall Street\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 12 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.hacking_grow_mult *= incMult;\n break;\n }\n case 9: {\n // Hacktocracy\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 8 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n const decMult = 1 - mult / 100;\n Player.hacknet_node_core_cost_mult *= decMult;\n Player.hacknet_node_level_cost_mult *= decMult;\n Player.hacknet_node_money_mult *= incMult;\n Player.hacknet_node_purchase_cost_mult *= decMult;\n Player.hacknet_node_ram_cost_mult *= decMult;\n break;\n }\n case 10: {\n // Digital Carbon\n // No effects, just grants sleeves\n break;\n }\n case 11: {\n // The Big Crash\n let mult = 0;\n for (let i = 0; i < srcFile.lvl; ++i) {\n mult += 32 / Math.pow(2, i);\n }\n const incMult = 1 + mult / 100;\n Player.work_money_mult *= incMult;\n Player.company_rep_mult *= incMult;\n break;\n }\n case 12: // The Recursion\n // Grants neuroflux.\n break;\n case 13: // They're Lunatics\n // Grants more space on Stanek's Gift.\n break;\n default:\n console.error(`Invalid source file number: ${srcFile.n}`);\n break;\n }\n\n sourceFileObject.owned = true;\n}\n","import { Player } from \"../Player\";\nimport { sanitizeExploits } from \"./Exploit\";\n\nexport function applyExploit(): void {\n if (Player.exploits && Player.exploits.length === 0) {\n return;\n }\n Player.exploits = sanitizeExploits(Player.exploits);\n const inc = Math.pow(1.001, Player.exploits.length);\n const dec = Math.pow(0.999, Player.exploits.length);\n\n Player.hacking_chance_mult *= inc;\n Player.hacking_speed_mult *= inc;\n Player.hacking_money_mult *= inc;\n Player.hacking_grow_mult *= inc;\n Player.hacking_mult *= inc;\n\n Player.strength_mult *= inc;\n Player.defense_mult *= inc;\n Player.dexterity_mult *= inc;\n Player.agility_mult *= inc;\n Player.charisma_mult *= inc;\n\n Player.hacking_exp_mult *= inc;\n Player.strength_exp_mult *= inc;\n Player.defense_exp_mult *= inc;\n Player.dexterity_exp_mult *= inc;\n Player.agility_exp_mult *= inc;\n Player.charisma_exp_mult *= inc;\n\n Player.company_rep_mult *= inc;\n Player.faction_rep_mult *= inc;\n\n Player.crime_money_mult *= inc;\n Player.crime_success_mult *= inc;\n\n Player.hacknet_node_money_mult *= inc;\n Player.hacknet_node_purchase_cost_mult *= dec;\n Player.hacknet_node_ram_cost_mult *= dec;\n Player.hacknet_node_core_cost_mult *= dec;\n Player.hacknet_node_level_cost_mult *= dec;\n\n Player.work_money_mult *= inc;\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { parseAliasDeclaration, printAliases } from \"../../Alias\";\n\nexport function alias(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length === 0) {\n printAliases();\n return;\n }\n if (args.length === 1) {\n if (parseAliasDeclaration(args[0] + \"\")) {\n terminal.print(`Set alias ${args[0]}`);\n return;\n }\n }\n if (args.length === 2) {\n if (args[0] === \"-g\") {\n if (parseAliasDeclaration(args[1] + \"\", true)) {\n terminal.print(`Set global alias ${args[1]}`);\n return;\n }\n }\n }\n terminal.error('Incorrect usage of alias command. Usage: alias [-g] [aliasname=\"value\"]');\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nexport function analyze(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of analyze command. Usage: analyze\");\n return;\n }\n terminal.startAnalyze(player);\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\n\nexport function backdoor(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of backdoor command. Usage: backdoor\");\n return;\n }\n\n if (!(server instanceof Server)) {\n terminal.error(\"Can only backdoor normal servers\");\n }\n\n const normalServer = server as Server;\n\n if (normalServer.purchasedByPlayer) {\n terminal.error(\n \"Cannot use backdoor on your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n } else if (!normalServer.hasAdminRights) {\n terminal.error(\"You do not have admin rights for this machine! Cannot backdoor\");\n } else if (normalServer.requiredHackingSkill > player.hacking) {\n terminal.error(\n \"Your hacking skill is not high enough to use backdoor on this machine. Try analyzing the machine to determine the required hacking skill\",\n );\n } else if (normalServer instanceof HacknetServer) {\n terminal.error(\"Cannot use backdoor on this type of Server\");\n } else {\n terminal.startBackdoor(player);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { listAllDarkwebItems, buyAllDarkwebItems, buyDarkwebItem } from \"../../DarkWeb/DarkWeb\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nexport function buy(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (!GetServer(SpecialServers.DarkWeb)) {\n terminal.error(\n \"You need to be able to connect to the Dark Web to use the buy command. (Maybe there's a TOR router you can buy somewhere)\",\n );\n return;\n }\n if (args.length != 1) {\n terminal.print(\"Incorrect number of arguments. Usage: \");\n terminal.print(\"buy -l\");\n terminal.print(\"buy -a\");\n terminal.print(\"buy [item name]\");\n return;\n }\n const arg = args[0] + \"\";\n if (arg == \"-l\" || arg == \"-1\" || arg == \"--list\") {\n listAllDarkwebItems();\n } else if (arg == \"-a\" || arg == \"--all\") {\n buyAllDarkwebItems();\n } else {\n buyDarkwebItem(arg);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { showMessage } from \"../../Message/MessageHelpers\";\nimport { showLiterature } from \"../../Literature/LiteratureHelpers\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\nexport function cat(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 1) {\n terminal.error(\"Incorrect usage of cat command. Usage: cat [file]\");\n return;\n }\n const relative_filename = args[0] + \"\";\n const filename = terminal.getFilepath(relative_filename);\n if (!filename.endsWith(\".msg\") && !filename.endsWith(\".lit\") && !filename.endsWith(\".txt\") && !filename.endsWith(\".script\") && !filename.endsWith(\".js\") && !filename.endsWith(\".ns\")) {\n terminal.error(\n \"Only .msg, .txt, .lit, .script, .js, and .ns files are viewable with cat (filename must end with .msg, .txt, .lit, .script, .js, or .ns)\",\n );\n return;\n }\n\n if (filename.endsWith(\".msg\") || filename.endsWith(\".lit\")) {\n for (let i = 0; i < server.messages.length; ++i) {\n if (filename.endsWith(\".lit\") && server.messages[i] === filename) {\n const file = server.messages[i];\n if (file.endsWith(\".msg\")) throw new Error(\".lit file should not be a .msg\");\n showLiterature(file);\n return;\n } else if (filename.endsWith(\".msg\")) {\n const file = server.messages[i];\n if (file !== filename) continue;\n showMessage(file);\n return;\n }\n }\n } else if (filename.endsWith(\".txt\")) {\n const txt = terminal.getTextFile(player, relative_filename);\n if (txt != null) {\n txt.show();\n return;\n }\n } else if (filename.endsWith(\".script\") || filename.endsWith(\".js\") || filename.endsWith(\".ns\")) {\n const script = terminal.getScript(player, relative_filename);\n if (script != null) {\n dialogBoxCreate(`${script.filename}<br /><br />${script.code}`);\n return;\n }\n }\n\n terminal.error(`No such file ${filename}`);\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nimport { evaluateDirectoryPath, removeTrailingSlash } from \"../DirectoryHelpers\";\n\nexport function cd(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length > 1) {\n terminal.error(\"Incorrect number of arguments. Usage: cd [dir]\");\n } else {\n let dir = args.length === 1 ? args[0] + \"\" : \"/\";\n\n let evaledDir: string | null = \"\";\n if (dir === \"/\") {\n evaledDir = \"/\";\n } else {\n // Ignore trailing slashes\n dir = removeTrailingSlash(dir);\n\n evaledDir = evaluateDirectoryPath(dir, terminal.cwd());\n if (evaledDir === null || evaledDir === \"\") {\n terminal.error(\"Invalid path. Failed to change directories\");\n return;\n }\n\n const server = player.getCurrentServer();\n if (\n !server.scripts.some((script) => script.filename.startsWith(evaledDir + \"\")) &&\n !server.textFiles.some((file) => file.fn.startsWith(evaledDir + \"\"))\n ) {\n terminal.error(\"Invalid path. Failed to change directories\");\n return;\n }\n }\n\n terminal.setcwd(evaledDir);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { findRunningScript } from \"../../Script/ScriptHelpers\";\nimport { isScriptFilename, validScriptExtensions } from \"../../Script/isScriptFilename\";\n\nexport function check(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length < 1) {\n terminal.error(`Incorrect number of arguments. Usage: check [script] [arg1] [arg2]...`);\n } else {\n const scriptName = terminal.getFilepath(args[0] + \"\");\n // Can only tail script files\n if (!isScriptFilename(scriptName)) {\n terminal.error(\n `'check' can only be called on scripts files (filename must end with ${validScriptExtensions.join(\", \")})`,\n );\n return;\n }\n\n // Check that the script is running on this machine\n const runningScript = findRunningScript(scriptName, args.slice(1), server);\n if (runningScript == null) {\n terminal.error(`No script named ${scriptName} is running on the server`);\n return;\n }\n runningScript.displayLog();\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { getServerOnNetwork } from \"../../Server/ServerHelpers\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\n\nexport function connect(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n // Disconnect from current server in terminal and connect to new one\n if (args.length !== 1) {\n terminal.error(\"Incorrect usage of connect command. Usage: connect [hostname]\");\n return;\n }\n\n const hostname = args[0] + \"\";\n\n for (let i = 0; i < server.serversOnNetwork.length; i++) {\n const other = getServerOnNetwork(server, i);\n if (other === null) throw new Error(`Server on network should not be null`);\n if (other.hostname == hostname) {\n terminal.connectToServer(player, hostname);\n return;\n }\n }\n\n const other = GetServer(hostname);\n if (other !== null) {\n if (other instanceof Server && other.backdoorInstalled) {\n terminal.connectToServer(player, hostname);\n return;\n }\n terminal.error(`Cannot directly connect to ${hostname}`);\n } else {\n terminal.error(\"Host not found\");\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { getDestinationFilepath, areFilesEqual } from \"../DirectoryHelpers\";\n\nexport function cp(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n try {\n if (args.length !== 2) {\n terminal.error(\"Incorrect usage of cp command. Usage: cp [src] [dst]\");\n return;\n }\n // Convert a relative path source file to the absolute path.\n const src = terminal.getFilepath(args[0] + \"\");\n if (src === null) {\n terminal.error(\"src cannot be a directory\");\n return;\n }\n\n // Get the destination based on the source file and the current directory\n const t_dst = getDestinationFilepath(args[1] + \"\", src, terminal.cwd());\n if (t_dst === null) {\n terminal.error(\"error parsing dst file\");\n return;\n }\n\n // Convert a relative path destination file to the absolute path.\n const dst = terminal.getFilepath(t_dst);\n if (areFilesEqual(src, dst)) {\n terminal.error(\"src and dst cannot be the same\");\n return;\n }\n const srcExt = src.slice(src.lastIndexOf(\".\"));\n const dstExt = dst.slice(dst.lastIndexOf(\".\"));\n if (srcExt !== dstExt) {\n terminal.error(\"src and dst must have the same extension.\");\n return;\n }\n if (!isScriptFilename(src) && !src.endsWith(\".txt\")) {\n terminal.error(\"cp only works for scripts and .txt files\");\n return;\n }\n\n // Scp for txt files\n if (src.endsWith(\".txt\")) {\n let txtFile = null;\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (areFilesEqual(server.textFiles[i].fn, src)) {\n txtFile = server.textFiles[i];\n break;\n }\n }\n\n if (txtFile === null) {\n return terminal.error(\"No such file exists!\");\n }\n\n const tRes = server.writeToTextFile(dst, txtFile.text);\n if (!tRes.success) {\n terminal.error(\"cp failed\");\n return;\n }\n if (tRes.overwritten) {\n terminal.print(`WARNING: ${dst} already exists and will be overwriten`);\n terminal.print(`${dst} overwritten`);\n return;\n }\n terminal.print(`${dst} copied`);\n return;\n }\n\n // Get the current script\n let sourceScript = null;\n for (let i = 0; i < server.scripts.length; ++i) {\n if (areFilesEqual(server.scripts[i].filename, src)) {\n sourceScript = server.scripts[i];\n break;\n }\n }\n if (sourceScript == null) {\n terminal.error(\"cp failed. No such script exists\");\n return;\n }\n\n const sRes = server.writeToScriptFile(player, dst, sourceScript.code);\n if (!sRes.success) {\n terminal.error(`cp failed`);\n return;\n }\n if (sRes.overwritten) {\n terminal.print(`WARNING: ${dst} already exists and will be overwritten`);\n terminal.print(`${dst} overwritten`);\n return;\n }\n terminal.print(`${dst} copied`);\n } catch (e) {\n terminal.error(e + \"\");\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nexport function expr(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length === 0) {\n terminal.error(\"Incorrect usage of expr command. Usage: expr [math expression]\");\n return;\n }\n const expr = args.join(\"\");\n\n // Sanitize the math expression\n const sanitizedExpr = expr.replace(/s+/g, \"\").replace(/[^-()\\d/*+.]/g, \"\");\n let result;\n try {\n result = eval(sanitizedExpr);\n } catch (e) {\n terminal.error(`Could not evaluate expression: ${sanitizedExpr}`);\n return;\n }\n terminal.print(result);\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nexport function free(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of free command. Usage: free\");\n return;\n }\n const ram = numeralWrapper.formatRAM(player.getCurrentServer().maxRam);\n const used = numeralWrapper.formatRAM(player.getCurrentServer().ramUsed);\n const avail = numeralWrapper.formatRAM(player.getCurrentServer().maxRam - player.getCurrentServer().ramUsed);\n const maxLength = Math.max(ram.length, Math.max(used.length, avail.length));\n const usedPercent = numeralWrapper.formatPercentage(\n player.getCurrentServer().ramUsed / player.getCurrentServer().maxRam,\n );\n\n terminal.print(`Total: ${\" \".repeat(maxLength - ram.length)}${ram}`);\n terminal.print(`Used: ${\" \".repeat(maxLength - used.length)}${used} (${usedPercent})`);\n terminal.print(`Available: ${\" \".repeat(maxLength - avail.length)}${avail}`);\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\n\nexport function grow(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of grow command. Usage: grow\");\n return;\n }\n\n if (!(server instanceof Server)) {\n terminal.error(\n \"Cannot grow your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n }\n const normalServer = server as Server;\n // Hack the current PC (usually for money)\n // You can't grow your home pc or servers you purchased\n if (normalServer.purchasedByPlayer) {\n terminal.error(\n \"Cannot grow your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n return;\n }\n if (!normalServer.hasAdminRights) {\n terminal.error(\"You do not have admin rights for this machine! Cannot grow\");\n return;\n }\n if (normalServer.requiredHackingSkill > player.hacking) {\n terminal.error(\n \"Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill\",\n );\n return;\n }\n terminal.startGrow(player);\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\n\nexport function hack(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of hack command. Usage: hack\");\n return;\n }\n\n if (!(server instanceof Server)) {\n terminal.error(\n \"Cannot hack your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n }\n const normalServer = server as Server;\n // Hack the current PC (usually for money)\n // You can't hack your home pc or servers you purchased\n if (normalServer.purchasedByPlayer) {\n terminal.error(\n \"Cannot hack your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n return;\n }\n if (!normalServer.hasAdminRights) {\n terminal.error(\"You do not have admin rights for this machine! Cannot hack\");\n return;\n }\n if (normalServer.requiredHackingSkill > player.hacking) {\n terminal.error(\n \"Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill\",\n );\n return;\n }\n terminal.startHack(player);\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { TerminalHelpText, HelpTexts } from \"../HelpText\";\n\nexport function help(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0 && args.length !== 1) {\n terminal.error(\"Incorrect usage of help command. Usage: help\");\n return;\n }\n if (args.length === 0) {\n TerminalHelpText.forEach((line) => terminal.print(line));\n } else {\n const cmd = args[0] + \"\";\n const txt = HelpTexts[cmd];\n if (txt == null) {\n terminal.error(\"No help topics match '\" + cmd + \"'\");\n return;\n }\n txt.forEach((t) => terminal.print(t));\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nexport function history(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length === 0) {\n terminal.commandHistory.forEach((command, index) => {\n terminal.print(`${index.toString().padStart(2)} ${command}`);\n });\n return;\n }\n const arg = args[0] + \"\";\n if (arg === \"-c\" || arg === \"--clear\") {\n player.terminalCommandHistory = [];\n terminal.commandHistory = [];\n terminal.commandHistoryIndex = 1;\n } else {\n terminal.error(\"Incorrect usage of history command. usage: history [-c]\");\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nexport function home(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of home command. Usage: home\");\n return;\n }\n player.getCurrentServer().isConnectedTo = false;\n player.currentServer = player.getHomeComputer().hostname;\n player.getCurrentServer().isConnectedTo = true;\n terminal.print(\"Connected to home\");\n terminal.setcwd(\"/\");\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nexport function hostname(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of hostname command. Usage: hostname\");\n return;\n }\n terminal.print(player.getCurrentServer().hostname);\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { killWorkerScript } from \"../../Netscript/killWorkerScript\";\n\nexport function kill(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n try {\n if (args.length < 1) {\n terminal.error(\"Incorrect usage of kill command. Usage: kill [scriptname] [arg1] [arg2]...\");\n return;\n }\n if (typeof args[0] === \"boolean\") {\n return;\n }\n\n // Kill by PID\n if (typeof args[0] === \"number\") {\n const pid = args[0];\n const res = killWorkerScript(pid);\n if (res) {\n terminal.print(`Killing script with PID ${pid}`);\n } else {\n terminal.error(`Failed to kill script with PID ${pid}. No such script is running`);\n }\n\n return;\n }\n\n const scriptName = terminal.getFilepath(args[0]);\n const runningScript = server.getRunningScript(scriptName, args.slice(1));\n if (runningScript == null) {\n terminal.error(\"No such script is running. Nothing to kill\");\n return;\n }\n killWorkerScript(runningScript, server.hostname, false);\n terminal.print(`Killing ${scriptName}`);\n } catch (e) {\n terminal.error(e + \"\");\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { killWorkerScript } from \"../../Netscript/killWorkerScript\";\nimport { WorkerScriptStartStopEventEmitter } from \"../../Netscript/WorkerScriptStartStopEventEmitter\";\n\nexport function killall(terminal: ITerminal, router: IRouter, player: IPlayer, server: BaseServer): void {\n for (let i = server.runningScripts.length - 1; i >= 0; --i) {\n killWorkerScript(server.runningScripts[i], server.hostname, false);\n }\n WorkerScriptStartStopEventEmitter.emit();\n terminal.print(\"Killing all running scripts\");\n}\n","import { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { toString } from \"lodash\";\nimport React from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { evaluateDirectoryPath, getFirstParentDirectory, isValidDirectoryPath } from \"../../Terminal/DirectoryHelpers\";\nimport { IRouter } from \"../../ui/Router\";\nimport { ITerminal } from \"../ITerminal\";\n\nexport function ls(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n const numArgs = args.length;\n function incorrectUsage(): void {\n terminal.error(\"Incorrect usage of ls command. Usage: ls [dir] [| grep pattern]\");\n }\n\n if (numArgs > 4 || numArgs === 2) {\n return incorrectUsage();\n }\n\n // Grep\n let filter = \"\"; // Grep\n\n // Directory path\n let prefix = terminal.cwd();\n if (!prefix.endsWith(\"/\")) {\n prefix += \"/\";\n }\n\n // If there are 3+ arguments, then the last 3 must be for grep\n if (numArgs >= 3) {\n if (args[numArgs - 2] !== \"grep\" || args[numArgs - 3] !== \"|\") {\n return incorrectUsage();\n }\n filter = args[numArgs - 1] + \"\";\n }\n\n // If the second argument is not a pipe, then it must be for listing a directory\n if (numArgs >= 1 && args[0] !== \"|\") {\n const newPath = evaluateDirectoryPath(args[0] + \"\", terminal.cwd());\n prefix = newPath ? newPath : \"\";\n if (prefix != null) {\n if (!prefix.endsWith(\"/\")) {\n prefix += \"/\";\n }\n if (!isValidDirectoryPath(prefix)) {\n return incorrectUsage();\n }\n }\n }\n\n // Root directory, which is the same as no 'prefix' at all\n if (prefix === \"/\") {\n prefix = \"\";\n }\n\n // Display all programs and scripts\n const allPrograms: string[] = [];\n const allScripts: string[] = [];\n const allTextFiles: string[] = [];\n const allContracts: string[] = [];\n const allMessages: string[] = [];\n const folders: string[] = [];\n\n function handleFn(fn: string, dest: string[]): void {\n let parsedFn = fn;\n if (prefix) {\n if (!fn.startsWith(prefix)) {\n return;\n } else {\n parsedFn = fn.slice(prefix.length, fn.length);\n }\n }\n\n if (filter && !parsedFn.includes(filter)) {\n return;\n }\n\n // If the fn includes a forward slash, it must be in a subdirectory.\n // Therefore, we only list the \"first\" directory in its path\n if (parsedFn.includes(\"/\")) {\n const firstParentDir = getFirstParentDirectory(parsedFn);\n if (filter && !firstParentDir.includes(filter)) {\n return;\n }\n\n if (!folders.includes(firstParentDir)) {\n folders.push(firstParentDir);\n }\n\n return;\n }\n\n dest.push(parsedFn);\n }\n\n // Get all of the programs and scripts on the machine into one temporary array\n const s = player.getCurrentServer();\n for (const program of s.programs) handleFn(program, allPrograms);\n for (const script of s.scripts) handleFn(script.filename, allScripts);\n for (const txt of s.textFiles) handleFn(txt.fn, allTextFiles);\n for (const contract of s.contracts) handleFn(contract.fn, allContracts);\n for (const msgOrLit of s.messages) handleFn(msgOrLit, allMessages);\n\n // Sort the files/folders alphabetically then print each\n allPrograms.sort();\n allScripts.sort();\n allTextFiles.sort();\n allContracts.sort();\n allMessages.sort();\n folders.sort();\n\n interface ClickableScriptRowProps {\n row: string;\n prefix: string;\n hostname: string;\n }\n\n function ClickableScriptRow({ row, prefix, hostname }: ClickableScriptRowProps): React.ReactElement {\n const classes = makeStyles((theme: Theme) =>\n createStyles({\n scriptLinksWrap: {\n display: \"inline-flex\",\n color: theme.palette.warning.main,\n },\n scriptLink: {\n cursor: \"pointer\",\n textDecorationLine: \"underline\",\n paddingRight: \"1.15em\",\n \"&:last-child\": { padding: 0 },\n },\n }),\n )();\n\n const rowSplit = row\n .split(\" \")\n .map((x) => x.trim())\n .filter((x) => !!x);\n\n function onScriptLinkClick(filename: string): void {\n if (player.getCurrentServer().hostname !== hostname) {\n return terminal.error(`File is not on this server, connect to ${hostname} and try again`);\n }\n if (filename.startsWith(\"/\")) filename = filename.slice(1);\n const filepath = terminal.getFilepath(`${prefix}${filename}`);\n const code = toString(terminal.getScript(player, filepath)?.code);\n router.toScriptEditor({ [filepath]: code });\n }\n\n return (\n <span className={classes.scriptLinksWrap}>\n {rowSplit.map((rowItem) => (\n <span key={rowItem} className={classes.scriptLink} onClick={() => onScriptLinkClick(rowItem)}>\n {rowItem}\n </span>\n ))}\n </span>\n );\n }\n\n function postSegments(segments: string[], style?: any, linked?: boolean): void {\n const maxLength = Math.max(...segments.map((s) => s.length)) + 1;\n const filesPerRow = Math.floor(80 / maxLength);\n for (let i = 0; i < segments.length; i++) {\n let row = \"\";\n for (let col = 0; col < filesPerRow; col++) {\n if (!(i < segments.length)) break;\n row += segments[i];\n row += \" \".repeat(maxLength * (col + 1) - row.length);\n i++;\n }\n i--;\n if (!style) {\n terminal.print(row);\n } else {\n if (linked) {\n terminal.printRaw(<ClickableScriptRow row={row} prefix={prefix} hostname={server.hostname} />);\n } else {\n terminal.printRaw(<span style={style}>{row}</span>);\n }\n }\n }\n }\n\n const groups = [\n { segments: folders, style: { color: \"cyan\" } },\n { segments: allMessages },\n { segments: allTextFiles },\n { segments: allPrograms },\n { segments: allContracts },\n { segments: allScripts, style: { color: \"yellow\", fontStyle: \"bold\" }, linked: true },\n ].filter((g) => g.segments.length > 0);\n for (let i = 0; i < groups.length; i++) {\n postSegments(groups[i].segments, groups[i].style, groups[i].linked);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nexport function lscpu(terminal: ITerminal, router: IRouter, player: IPlayer): void {\n terminal.print(player.getCurrentServer().cpuCores + \" Core(s)\");\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Settings } from \"../../Settings/Settings\";\n\nexport function mem(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n try {\n if (args.length !== 1 && args.length !== 3) {\n terminal.error(\"Incorrect usage of mem command. usage: mem [scriptname] [-t] [number threads]\");\n return;\n }\n\n const scriptName = args[0] + \"\";\n let numThreads = 1;\n if (args.length === 3 && args[1] === \"-t\") {\n numThreads = Math.round(parseInt(args[2] + \"\"));\n if (isNaN(numThreads) || numThreads < 1) {\n terminal.error(\"Invalid number of threads specified. Number of threads must be greater than 1\");\n return;\n }\n }\n\n const script = terminal.getScript(player, scriptName);\n if (script == null) {\n terminal.error(\"mem failed. No such script exists!\");\n return;\n }\n\n const ramUsage = script.ramUsage * numThreads;\n\n terminal.print(\n `This script requires ${numeralWrapper.formatRAM(ramUsage)} of RAM to run for ${numThreads} thread(s)`,\n );\n\n const verboseEntries = script.ramUsageEntries?.sort((a, b) => b.cost - a.cost) ?? [];\n const padding = Settings.UseIEC60027_2 ? 9 : 8;\n for (const entry of verboseEntries) {\n terminal.print(`${numeralWrapper.formatRAM(entry.cost * numThreads).padStart(padding)} | ${entry.name} (${entry.type})`);\n }\n\n if (ramUsage > 0 && verboseEntries.length === 0) {\n // Let's warn the user that he might need to save his script again to generate the detailed entries\n terminal.warn('You might have to open & save this script to see the detailed RAM usage information.');\n }\n } catch (e) {\n terminal.error(e + \"\");\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { TextFile } from \"../../TextFile\";\nimport { Script } from \"../../Script/Script\";\nimport { getDestinationFilepath, areFilesEqual } from \"../DirectoryHelpers\";\n\nexport function mv(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 2) {\n terminal.error(`Incorrect number of arguments. Usage: mv [src] [dest]`);\n return;\n }\n\n try {\n const source = args[0] + \"\";\n const t_dest = args[1] + \"\";\n\n if (!isScriptFilename(source) && !source.endsWith(\".txt\")) {\n terminal.error(`'mv' can only be used on scripts and text files (.txt)`);\n return;\n }\n\n const srcFile = terminal.getFile(player, source);\n if (srcFile == null) {\n terminal.error(`Source file ${source} does not exist`);\n return;\n }\n\n const sourcePath = terminal.getFilepath(source);\n // Get the destination based on the source file and the current directory\n const dest = getDestinationFilepath(t_dest, source, terminal.cwd());\n if (dest === null) {\n terminal.error(\"error parsing dst file\");\n return;\n }\n\n const destFile = terminal.getFile(player, dest);\n const destPath = terminal.getFilepath(dest);\n if (areFilesEqual(sourcePath, destPath)) {\n terminal.error(`Source and destination files are the same file`);\n return;\n }\n\n // 'mv' command only works on scripts and txt files.\n // Also, you can't convert between different file types\n if (isScriptFilename(source)) {\n const script = srcFile as Script;\n if (!isScriptFilename(destPath)) {\n terminal.error(`Source and destination files must have the same type`);\n return;\n }\n\n // Command doesnt work if script is running\n if (server.isRunning(sourcePath)) {\n terminal.error(`Cannot use 'mv' on a script that is running`);\n return;\n }\n\n if (destFile != null) {\n // Already exists, will be overwritten, so we'll delete it\n const status = server.removeFile(destPath);\n if (!status.res) {\n terminal.error(`Something went wrong...please contact game dev (probably a bug)`);\n return;\n } else {\n terminal.print(\"Warning: The destination file was overwritten\");\n }\n }\n\n script.filename = destPath;\n } else if (srcFile instanceof TextFile) {\n const textFile = srcFile as TextFile;\n if (!dest.endsWith(\".txt\")) {\n terminal.error(`Source and destination files must have the same type`);\n return;\n }\n\n if (destFile != null) {\n // Already exists, will be overwritten, so we'll delete it\n const status = server.removeFile(destPath);\n if (!status.res) {\n terminal.error(`Something went wrong...please contact game dev (probably a bug)`);\n return;\n } else {\n terminal.print(\"Warning: The destination file was overwritten\");\n }\n }\n\n textFile.fn = destPath;\n }\n } catch (e) {\n terminal.error(e + \"\");\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nimport {commonEditor} from './common/editor';\n\nexport function nano(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n return commonEditor('nano', {terminal, router, player, server, args});\n}\n","interface Position {\n row: number;\n column: number;\n}\n\nclass PositionTracker {\n positions: Map<string, Position>;\n\n constructor() {\n this.positions = new Map<string, Position>();\n }\n\n saveCursor(filename: string, pos: Position): void {\n this.positions.set(filename, pos);\n }\n\n getCursor(filename: string): Position {\n const position = this.positions.get(filename);\n if (!position) {\n return {\n row: -1,\n column: -1,\n };\n }\n return position;\n }\n}\n\nexport const CursorPositions: PositionTracker = new PositionTracker();\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport * as libarg from \"arg\"\n\nexport function ps(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n let flags;\n try{\n flags = libarg({\n '--grep': String,\n '-g': '--grep'\n },\n { argv: args }\n )\n }catch(e){\n // catch passing only -g / --grep with no string to use as the search\n terminal.error(\"Incorrect usage of ps command. Usage: ps [-g, --grep pattern]\");\n return;\n }\n const pattern = flags['--grep']\n if (pattern) {\n const re = new RegExp(pattern.toString())\n const matching = server.runningScripts.filter((x) => re.test(x.filename))\n for (let i = 0; i < matching.length; i++) {\n const rsObj = matching[i];\n let res = `(PID - ${rsObj.pid}) ${rsObj.filename}`;\n for (let j = 0; j < rsObj.args.length; ++j) {\n res += \" \" + rsObj.args[j].toString();\n }\n terminal.print(res);\n }\n } \n if(args.length === 0){\n for (let i = 0; i < server.runningScripts.length; i++) {\n const rsObj = server.runningScripts[i];\n let res = `(PID - ${rsObj.pid}) ${rsObj.filename}`;\n for (let j = 0; j < rsObj.args.length; ++j) {\n res += \" \" + rsObj.args[j].toString();\n }\n terminal.print(res);\n }\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { IReturnStatus } from \"../../types\";\n\nexport function rm(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 1) {\n terminal.error(\"Incorrect number of arguments. Usage: rm [program/script]\");\n return;\n }\n\n // Check programs\n let delTarget;\n let status: IReturnStatus = {\n res: true,\n msg: \"\",\n };\n try {\n delTarget = terminal.getFilepath(args[0] + \"\");\n status = server.removeFile(delTarget);\n } catch (err) {\n status = {\n res: false,\n msg: \"No such file exists\",\n };\n }\n\n if (!status.res && status.msg) {\n terminal.error(status.msg);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { runScript } from \"./runScript\";\nimport { runProgram } from \"./runProgram\";\n\nexport function run(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n // Run a program or a script\n if (args.length < 1) {\n terminal.error(\"Incorrect number of arguments. Usage: run [program/script] [-t] [num threads] [arg1] [arg2]...\");\n } else {\n const executableName = args[0] + \"\";\n\n // Check if its a script or just a program/executable\n if (isScriptFilename(executableName)) {\n runScript(terminal, router, player, server, args);\n } else if (executableName.endsWith(\".cct\")) {\n terminal.runContract(player, executableName);\n } else {\n runProgram(terminal, router, player, server, args);\n }\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { LogBoxEvents } from \"../../ui/React/LogBoxManager\";\nimport { startWorkerScript } from \"../../NetscriptWorker\";\nimport { RunningScript } from \"../../Script/RunningScript\";\nimport { findRunningScript } from \"../../Script/ScriptHelpers\";\nimport * as libarg from \"arg\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nexport function runScript(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n commandArgs: (string | number | boolean)[],\n): void {\n if (commandArgs.length < 1) {\n terminal.error(\n `Bug encountered with Terminal.runScript(). Command array has a length of less than 1: ${commandArgs}`,\n );\n return;\n }\n\n const scriptName = terminal.getFilepath(commandArgs[0] + \"\");\n\n const runArgs = { \"--tail\": Boolean, \"-t\": Number };\n const flags = libarg(runArgs, {\n permissive: true,\n argv: commandArgs.slice(1),\n });\n const threadFlag = Math.round(parseFloat(flags[\"-t\"]));\n const tailFlag = flags[\"--tail\"] === true;\n if (flags[\"-t\"] !== undefined && (threadFlag < 0 || isNaN(threadFlag))) {\n terminal.error(\"Invalid number of threads specified. Number of threads must be greater than 0\");\n return;\n }\n const numThreads = !isNaN(threadFlag) && threadFlag > 0 ? threadFlag : 1;\n const args = flags[\"_\"];\n\n // Check if this script is already running\n if (findRunningScript(scriptName, args, server) != null) {\n terminal.error(\"This script is already running with the same args. Cannot run multiple instances with the same args\");\n return;\n }\n\n // Check if the script exists and if it does run it\n for (let i = 0; i < server.scripts.length; i++) {\n if (server.scripts[i].filename !== scriptName) {\n continue;\n }\n // Check for admin rights and that there is enough RAM availble to run\n const script = server.scripts[i];\n script.server = player.getCurrentServer().hostname;\n const ramUsage = script.ramUsage * numThreads;\n const ramAvailable = server.maxRam - server.ramUsed;\n\n if (!server.hasAdminRights) {\n terminal.error(\"Need root access to run script\");\n return;\n }\n\n if (ramUsage > ramAvailable) {\n terminal.error(\n \"This machine does not have enough RAM to run this script with \" +\n numThreads +\n \" threads. Script requires \" +\n numeralWrapper.formatRAM(ramUsage) +\n \" of RAM\",\n );\n return;\n }\n\n // Able to run script\n const runningScript = new RunningScript(script, args);\n runningScript.threads = numThreads;\n\n const success = startWorkerScript(player, runningScript, server);\n if (!success) {\n terminal.error(`Failed to start script`);\n return;\n }\n\n terminal.print(\n `Running script with ${numThreads} thread(s), pid ${runningScript.pid} and args: ${JSON.stringify(args)}.`,\n );\n if (runningScript.filename.endsWith(\".ns\")) {\n terminal.warn(\".ns files are deprecated, please rename everything to .js\");\n }\n if (tailFlag) {\n LogBoxEvents.emit(runningScript);\n }\n return;\n }\n\n terminal.error(\"No such script\");\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Programs } from \"../../Programs/Programs\";\n\nexport function runProgram(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length < 1) {\n return;\n }\n\n // Check if you have the program on your computer. If you do, execute it, otherwise\n // display an error message\n const programName = args[0] + \"\";\n\n if (!player.hasProgram(programName)) {\n terminal.error(\n `No such (exe, script, js, ns, or cct) file! (Only programs that exist on your home computer or scripts on ${\n player.getCurrentServer().hostname\n } can be run)`,\n );\n return;\n }\n\n if (args.length < 1) {\n return;\n }\n\n for (const program of Object.values(Programs)) {\n if (program.name.toLocaleLowerCase() === programName.toLocaleLowerCase()) {\n program.run(\n router,\n terminal,\n player,\n server,\n args.slice(1).map((arg) => arg + \"\"),\n );\n return;\n }\n }\n\n terminal.error(\"Invalid executable. Cannot be run\");\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { getServerOnNetwork } from \"../../Server/ServerHelpers\";\n\nexport function scan(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of netstat/scan command. Usage: netstat/scan\");\n return;\n }\n\n // Displays available network connections using TCP\n const currServ = player.getCurrentServer();\n const servers = currServ.serversOnNetwork.map((_, i) => {\n const server = getServerOnNetwork(currServ, i);\n if (server === null) throw new Error(\"Server should not be null\");\n return {\n hostname: server.hostname,\n ip: server.ip,\n hasRoot: server.hasAdminRights ? \"Y\" : \"N\",\n };\n });\n servers.unshift({\n hostname: \"Hostname\",\n ip: \"IP\",\n hasRoot: \"Root Access\",\n });\n const maxHostname = Math.max(...servers.map((s) => s.hostname.length));\n const maxIP = Math.max(...servers.map((s) => s.ip.length));\n for (const server of servers) {\n if (!server) continue;\n let entry = server.hostname;\n entry += \" \".repeat(maxHostname - server.hostname.length + 1);\n entry += server.ip;\n entry += \" \".repeat(maxIP - server.ip.length + 1);\n entry += server.hasRoot;\n terminal.print(entry);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Programs } from \"../../Programs/Programs\";\n\nexport function scananalyze(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length === 0) {\n terminal.executeScanAnalyzeCommand(player, 1);\n } else {\n // # of args must be 2 or 3\n if (args.length > 2) {\n terminal.error(\"Incorrect usage of scan-analyze command. usage: scan-analyze [depth]\");\n return;\n }\n let all = false;\n if (args.length === 2 && args[1] === \"-a\") {\n all = true;\n }\n\n const depth = parseInt(args[0] + \"\");\n\n if (isNaN(depth) || depth < 0) {\n terminal.error(\"Incorrect usage of scan-analyze command. depth argument must be positive numeric\");\n return;\n }\n if (depth > 3 && !player.hasProgram(Programs.DeepscanV1.name) && !player.hasProgram(Programs.DeepscanV2.name)) {\n terminal.error(\"You cannot scan-analyze with that high of a depth. Maximum depth is 3\");\n return;\n } else if (depth > 5 && !player.hasProgram(Programs.DeepscanV2.name)) {\n terminal.error(\"You cannot scan-analyze with that high of a depth. Maximum depth is 5\");\n return;\n } else if (depth > 10) {\n terminal.error(\"You cannot scan-analyze with that high of a depth. Maximum depth is 10\");\n return;\n }\n terminal.executeScanAnalyzeCommand(player, depth, all);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\n\nexport function scp(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n try {\n if (args.length !== 2) {\n terminal.error(\"Incorrect usage of scp command. Usage: scp [file] [destination hostname]\");\n return;\n }\n const scriptname = terminal.getFilepath(args[0] + \"\");\n if (!scriptname.endsWith(\".lit\") && !isScriptFilename(scriptname) && !scriptname.endsWith(\".txt\")) {\n terminal.error(\"scp only works for scripts, text files (.txt), and literature files (.lit)\");\n return;\n }\n\n const destServer = GetServer(args[1] + \"\");\n if (destServer == null) {\n terminal.error(`Invalid destination. ${args[1]} not found`);\n return;\n }\n\n // Scp for lit files\n if (scriptname.endsWith(\".lit\")) {\n let found = false;\n for (let i = 0; i < server.messages.length; ++i) {\n if (server.messages[i] == scriptname) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n return terminal.error(\"No such file exists!\");\n }\n\n for (let i = 0; i < destServer.messages.length; ++i) {\n if (destServer.messages[i] === scriptname) {\n terminal.print(scriptname + \" copied over to \" + destServer.hostname);\n return; // Already exists\n }\n }\n destServer.messages.push(scriptname);\n return terminal.print(scriptname + \" copied over to \" + destServer.hostname);\n }\n\n // Scp for txt files\n if (scriptname.endsWith(\".txt\")) {\n let txtFile = null;\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (server.textFiles[i].fn === scriptname) {\n txtFile = server.textFiles[i];\n break;\n }\n }\n\n if (txtFile === null) {\n return terminal.error(\"No such file exists!\");\n }\n\n const tRes = destServer.writeToTextFile(txtFile.fn, txtFile.text);\n if (!tRes.success) {\n terminal.error(\"scp failed\");\n return;\n }\n if (tRes.overwritten) {\n terminal.print(`WARNING: ${scriptname} already exists on ${destServer.hostname} and will be overwriten`);\n terminal.print(`${scriptname} overwritten on ${destServer.hostname}`);\n return;\n }\n terminal.print(`${scriptname} copied over to ${destServer.hostname}`);\n return;\n }\n\n // Get the current script\n let sourceScript = null;\n for (let i = 0; i < server.scripts.length; ++i) {\n if (scriptname == server.scripts[i].filename) {\n sourceScript = server.scripts[i];\n break;\n }\n }\n if (sourceScript == null) {\n terminal.error(\"scp failed. No such script exists\");\n return;\n }\n\n const sRes = destServer.writeToScriptFile(player, scriptname, sourceScript.code);\n if (!sRes.success) {\n terminal.error(`scp failed`);\n return;\n }\n if (sRes.overwritten) {\n terminal.print(`WARNING: ${scriptname} already exists on ${destServer.hostname} and will be overwritten`);\n terminal.print(`${scriptname} overwritten on ${destServer.hostname}`);\n return;\n }\n terminal.print(`${scriptname} copied over to ${destServer.hostname}`);\n } catch (e) {\n terminal.error(e + \"\");\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nexport function sudov(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect number of arguments. Usage: sudov\");\n return;\n }\n\n if (server.hasAdminRights) {\n terminal.print(\"You have ROOT access to this machine\");\n } else {\n terminal.print(\"You do NOT have root access to this machine\");\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { findRunningScriptByPid } from \"../../Script/ScriptHelpers\";\nimport { isScriptFilename, validScriptExtensions } from \"../../Script/isScriptFilename\";\nimport { compareArrays } from \"../../utils/helpers/compareArrays\";\nimport { LogBoxEvents } from \"../../ui/React/LogBoxManager\";\n\nexport function tail(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n commandArray: (string | number | boolean)[],\n): void {\n try {\n if (commandArray.length < 1) {\n terminal.error(\"Incorrect number of arguments. Usage: tail [script] [arg1] [arg2]...\");\n } else if (typeof commandArray[0] === \"string\") {\n const scriptName = terminal.getFilepath(commandArray[0]);\n if (!isScriptFilename(scriptName)) {\n terminal.error(`tail can only be called on ${validScriptExtensions.join(\", \")} files, or by PID`);\n return;\n }\n\n // Get script arguments\n const args = [];\n for (let i = 1; i < commandArray.length; ++i) {\n args.push(commandArray[i]);\n }\n\n // go over all the running scripts. If there's a perfect\n // match, use it!\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename === scriptName && compareArrays(server.runningScripts[i].args, args)) {\n LogBoxEvents.emit(server.runningScripts[i]);\n return;\n }\n }\n\n // Find all scripts that are potential candidates.\n const candidates = [];\n for (let i = 0; i < server.runningScripts.length; ++i) {\n // only scripts that have more arguments (equal arguments is already caught)\n if (server.runningScripts[i].args.length < args.length) continue;\n // make a smaller copy of the args.\n const args2 = server.runningScripts[i].args.slice(0, args.length);\n if (server.runningScripts[i].filename === scriptName && compareArrays(args2, args)) {\n candidates.push(server.runningScripts[i]);\n }\n }\n\n // If there's only 1 possible choice, use that.\n if (candidates.length === 1) {\n LogBoxEvents.emit(candidates[0]);\n return;\n }\n\n // otherwise lists all possible conflicting choices.\n if (candidates.length > 1) {\n terminal.error(\"Found several potential candidates:\");\n for (const candidate of candidates) terminal.error(`${candidate.filename} ${candidate.args.join(\" \")}`);\n terminal.error(\"Script arguments need to be specified.\");\n return;\n }\n\n // if there's no candidate then we just don't know.\n terminal.error(`No script named ${scriptName} is running on the server`);\n } else if (typeof commandArray[0] === \"number\") {\n const runningScript = findRunningScriptByPid(commandArray[0], server);\n if (runningScript == null) {\n terminal.error(`No script with PID ${commandArray[0]} is running on the server`);\n return;\n }\n LogBoxEvents.emit(runningScript);\n }\n } catch (e) {\n terminal.error(e + \"\");\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { getRamUsageFromRunningScript } from \"../../Script/RunningScriptHelpers\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nexport function top(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of top command. Usage: top\");\n return;\n }\n\n // Headers\n const scriptWidth = 40;\n const pidWidth = 10;\n const threadsWidth = 16;\n\n const scriptTxt = \"Script\";\n const pidTxt = \"PID\";\n const threadsTxt = \"Threads\";\n const ramTxt = \"RAM Usage\";\n\n const spacesAfterScriptTxt = \" \".repeat(scriptWidth - scriptTxt.length);\n const spacesAfterPidTxt = \" \".repeat(pidWidth - pidTxt.length);\n const spacesAfterThreadsTxt = \" \".repeat(threadsWidth - threadsTxt.length);\n\n const headers = `${scriptTxt}${spacesAfterScriptTxt}${pidTxt}${spacesAfterPidTxt}${threadsTxt}${spacesAfterThreadsTxt}${ramTxt}`;\n\n terminal.print(headers);\n\n const currRunningScripts = server.runningScripts;\n // Iterate through scripts on current server\n for (let i = 0; i < currRunningScripts.length; i++) {\n const script = currRunningScripts[i];\n\n // Calculate name padding\n const numSpacesScript = Math.max(0, scriptWidth - script.filename.length);\n const spacesScript = \" \".repeat(numSpacesScript);\n\n // Calculate PID padding\n const numSpacesPid = Math.max(0, pidWidth - (script.pid + \"\").length);\n const spacesPid = \" \".repeat(numSpacesPid);\n\n // Calculate thread padding\n const numSpacesThread = Math.max(0, threadsWidth - (script.threads + \"\").length);\n const spacesThread = \" \".repeat(numSpacesThread);\n\n // Calculate and transform RAM usage\n const ramUsage = numeralWrapper.formatRAM(getRamUsageFromRunningScript(script) * script.threads);\n\n const entry = [script.filename, spacesScript, script.pid, spacesPid, script.threads, spacesThread, ramUsage].join(\n \"\",\n );\n terminal.print(entry);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { removeAlias } from \"../../Alias\";\n\nexport function unalias(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 1) {\n terminal.error(\"Incorrect usage of unalias name. Usage: unalias [alias]\");\n return;\n } else {\n if (removeAlias(args[0] + \"\")) {\n terminal.print(`Removed alias ${args[0]}`);\n } else {\n terminal.error(`No such alias exists: ${args[0]}`);\n }\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nimport {commonEditor} from './common/editor';\n\nexport function vim(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n return commonEditor('vim', {terminal, router, player, server, args}, {vim: true});\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\n\nexport function weaken(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of weaken command. Usage: weaken\");\n return;\n }\n\n if (!(server instanceof Server)) {\n terminal.error(\n \"Cannot weaken your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n }\n const normalServer = server as Server;\n // Hack the current PC (usually for money)\n // You can't weaken your home pc or servers you purchased\n if (normalServer.purchasedByPlayer) {\n terminal.error(\n \"Cannot weaken your own machines! You are currently connected to your home PC or one of your purchased servers\",\n );\n return;\n }\n if (!normalServer.hasAdminRights) {\n terminal.error(\"You do not have admin rights for this machine! Cannot weaken\");\n return;\n }\n if (normalServer.requiredHackingSkill > player.hacking) {\n terminal.error(\n \"Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill\",\n );\n return;\n }\n terminal.startWeaken(player);\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\n\nexport function wget(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n if (args.length !== 2) {\n terminal.error(\"Incorrect usage of wget command. Usage: wget [url] [target file]\");\n return;\n }\n\n const url = args[0] + \"\";\n const target = terminal.getFilepath(args[1] + \"\");\n if (!isScriptFilename(target) && !target.endsWith(\".txt\")) {\n return terminal.error(`wget failed: Invalid target file. Target file must be script or text file`);\n }\n $.get(\n url,\n function (data: any) {\n let res;\n if (isScriptFilename(target)) {\n res = server.writeToScriptFile(player, target, data);\n } else {\n res = server.writeToTextFile(target, data);\n }\n if (!res.success) {\n return terminal.error(\"wget failed\");\n }\n if (res.overwritten) {\n return terminal.print(`wget successfully retrieved content and overwrote ${target}`);\n }\n return terminal.print(`wget successfully retrieved content to new file ${target}`);\n },\n \"text\",\n ).fail(function (e) {\n return terminal.error(\"wget failed: \" + JSON.stringify(e));\n });\n}\n","import { Player } from \"../Player\";\nimport { Exploit } from \"./Exploit\";\n\nfunction tampering(): void {\n if (Player.exploits.includes(Exploit.PrototypeTampering)) return;\n // Tampering\n const a = 55;\n setInterval(function () {\n if (a.toExponential() !== \"5.5e+1\") {\n Player.giveExploit(Exploit.PrototypeTampering);\n }\n }, 15 * 60 * 1000); // 15 minutes\n}\n\nfunction timeCompression(): void {\n const timer = 1000 * 15;\n if (Player.exploits.includes(Exploit.TimeCompression)) return;\n // Time compression\n let last = performance.now();\n function minute(): void {\n const now = performance.now();\n if (now - last < 500) {\n // time has been compressed.\n Player.giveExploit(Exploit.TimeCompression);\n return;\n }\n last = now;\n window.setTimeout(minute, timer);\n }\n window.setTimeout(minute, timer);\n}\n\nexport function startExploits(): void {\n tampering();\n timeCompression();\n}\n","import { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { isScriptErrorMessage } from \"./NetscriptEvaluator\";\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\n\nexport function setupUncaughtPromiseHandler(): void {\n window.addEventListener(\"unhandledrejection\", function (e) {\n if (isScriptErrorMessage(e.reason)) {\n const errorTextArray = e.reason.split(\"|DELIMITER|\");\n const hostname = errorTextArray[1];\n const scriptName = errorTextArray[2];\n const errorMsg = errorTextArray[3];\n\n let msg = `UNCAUGHT PROMISE ERROR<br>You forgot to await a promise<br>${scriptName}@${hostname}<br>`;\n msg += \"<br>\";\n msg += errorMsg;\n dialogBoxCreate(msg);\n } else if (e.reason instanceof WorkerScript) {\n const msg =\n `UNCAUGHT PROMISE ERROR<br>You forgot to await a promise<br>${e.reason.name}@${e.reason.hostname}<br>` +\n `Maybe hack / grow / weaken ?`;\n dialogBoxCreate(msg);\n }\n });\n}\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nimport { TTheme as Theme, ThemeEvents, refreshTheme } from \"./Themes/ui/Theme\";\nimport { LoadingScreen } from \"./ui/LoadingScreen\";\nimport { initElectron } from \"./Electron\";\ninitElectron();\nglobalThis[\"React\"] = React;\nglobalThis[\"ReactDOM\"] = ReactDOM;\nReactDOM.render(\n <Theme>\n <LoadingScreen />\n </Theme>,\n document.getElementById(\"root\"),\n);\n\nfunction rerender(): void {\n refreshTheme();\n ReactDOM.render(\n <Theme>\n <LoadingScreen />\n </Theme>,\n document.getElementById(\"root\"),\n );\n}\n\n(function () {\n ThemeEvents.subscribe(rerender);\n})();\n\n(function () {\n if (process.env.NODE_ENV === \"development\" || location.href.startsWith(\"file://\")) return;\n window.onbeforeunload = function () {\n return \"Your work will be lost.\";\n };\n})();\n"],"sourceRoot":""} |