mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-24 15:12:27 +01:00
1 line
5.1 MiB
1 line
5.1 MiB
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/Player.ts","webpack:///./src/Faction/data/FactionNames.ts","webpack:///./src/ui/numeralFormat.ts","webpack:///./src/Settings/Settings.ts","webpack:///./src/Locations/data/LocationNames.ts","webpack:///./src/Constants.ts","webpack:///./src/Augmentation/data/AugmentationNames.ts","webpack:///./src/ui/React/DialogBox.tsx","webpack:///./src/Locations/data/CityNames.ts","webpack:///./src/BitNode/BitNodeMultipliers.ts","webpack:///./src/ui/React/Money.tsx","webpack:///./src/utils/StringHelperFunctions.ts","webpack:///./src/Server/AllServers.ts","webpack:///./src/ui/Router.ts","webpack:///./src/Faction/Factions.ts","webpack:///./src/utils/helpers/keyCodes.ts","webpack:///./src/utils/JSONReviver.ts","webpack:///./src/ui/Context.ts","webpack:///./src/Company/data/companypositionnames.ts","webpack:///./src/utils/helpers/getRandomInt.ts","webpack:///./src/utils/WorkType.ts","webpack:///./src/Augmentation/Augmentation.tsx","webpack:///./src/ui/React/Modal.tsx","webpack:///./src/Corporation/data/Constants.ts","webpack:///./src/Hacknet/data/Constants.ts","webpack:///./src/Netscript/RamCostGenerator.ts","webpack:///./src/Bladeburner/data/ActionTypes.ts","webpack:///./src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx","webpack:///./src/InteractiveTutorial.ts","webpack:///./src/Server/Server.ts","webpack:///./src/Corporation/EmployeePositions.ts","webpack:///./src/Corporation/ui/Context.ts","webpack:///./src/Corporation/IndustryData.tsx","webpack:///./src/Locations/LocationTypeEnum.ts","webpack:///./src/Hacknet/HacknetHelpers.tsx","webpack:///./src/Bladeburner/data/BlackOperationNames.ts","webpack:///./src/Bladeburner/data/Constants.ts","webpack:///./src/CotMG/FragmentType.ts","webpack:///./src/Corporation/Actions.ts","webpack:///./src/Literature/data/LiteratureNames.ts","webpack:///./src/Programs/Programs.ts","webpack:///./src/PersonObjects/Sleeve/SleeveTaskTypesEnum.ts","webpack:///./src/Company/Companies.ts","webpack:///./src/ui/React/StatsRow.tsx","webpack:///./src/StockMarket/data/PositionTypes.ts","webpack:///./src/ui/React/Table.tsx","webpack:///./src/Augmentation/StaticAugmentations.ts","webpack:///./src/Gang/AllGangs.ts","webpack:///./src/Terminal/DirectoryHelpers.ts","webpack:///./src/Terminal.ts","webpack:///./src/Server/data/SpecialServers.ts","webpack:///./src/Crime/Crimes.ts","webpack:///./src/Casino/utils.ts","webpack:///./src/ui/GameRoot.tsx","webpack:///./src/Hacknet/HacknetServer.ts","webpack:///./src/Company/CompanyPositions.ts","webpack:///./src/ui/React/Snackbar.tsx","webpack:///./src/StockMarket/data/StockSymbols.ts","webpack:///./src/Script/isScriptFilename.ts","webpack:///./src/CotMG/Helper.tsx","webpack:///./src/Hacking.ts","webpack:///./src/StockMarket/StockMarket.tsx","webpack:///./src/Faction/FactionHelpers.tsx","webpack:///./src/Exploits/Exploit.ts","webpack:///./src/NetscriptEvaluator.ts","webpack:///./src/SaveObject.tsx","webpack:///./src/ui/React/MoneyRate.tsx","webpack:///./src/CodingContracts.ts","webpack:///./src/StockMarket/data/OrderTypes.ts","webpack:///./src/Augmentation/AugmentationHelpers.tsx","webpack:///./src/CotMG/Fragment.ts","webpack:///./src/ScriptEditor/ui/themes.ts","webpack:///./src/utils/EventEmitter.ts","webpack:///./src/ui/React/Reputation.tsx","webpack:///./src/DevMenu/ui/Adjuster.tsx","webpack:///./src/Infiltration/utils.ts","webpack:///./src/Corporation/data/BaseResearchTree.ts","webpack:///./src/Server/ServerHelpers.ts","webpack:///./src/Bladeburner/data/SkillNames.ts","webpack:///./src/Bladeburner/BlackOperation.ts","webpack:///./src/Gang/ui/Context.ts","webpack:///./src/Netscript/killWorkerScript.ts","webpack:///./src/Corporation/ui/MoneyCost.tsx","webpack:///./src/utils/helpers/isString.ts","webpack:///./src/BitNode/BitNode.tsx","webpack:///./src/StockMarket/Stock.ts","webpack:///./src/Locations/Cities.ts","webpack:///./src/Hacknet/formulas/HacknetServers.ts","webpack:///./src/Alias.ts","webpack:///./src/ui/React/OptionSwitch.tsx","webpack:///./src/Literature/Literature.ts","webpack:///./src/ui/React/CopyableText.tsx","webpack:///./src/Themes/ui/Theme.tsx","webpack:///./src/Settings/SettingEnums.ts","webpack:///./src/ui/React/LogBoxManager.tsx","webpack:///./src/Corporation/MaterialSizes.ts","webpack:///./src/Netscript/ScriptDeath.ts","webpack:///./src/PersonObjects/formulas/skill.ts","webpack:///./src/Gang/data/upgrades.ts","webpack:///./src/Faction/Faction.ts","webpack:///./src/Locations/Locations.ts","webpack:///./src/Gang/data/Constants.ts","webpack:///./src/Faction/FactionWorkTypeEnum.ts","webpack:///./src/NetscriptWorker.ts","webpack:///./src/Netscript/WorkerScripts.ts","webpack:///./src/ui/React/StatsTable.tsx","webpack:///./src/Corporation/Material.ts","webpack:///./src/Gang/formulas/formulas.ts","webpack:///./src/Infiltration/ui/GameTimer.tsx","webpack:///./src/Bladeburner/Bladeburner.tsx","webpack:///./src/Hacknet/formulas/HacknetNodes.ts","webpack:///./src/Casino/Game.tsx","webpack:///./src/CotMG/data/Shapes.ts","webpack:///./src/Infiltration/ui/Difficulty.ts","webpack:///./src/Infiltration/ui/KeyHandler.tsx","webpack:///./src/ui/React/Hashes.tsx","webpack:///./src/Hacknet/HacknetNode.ts","webpack:///./src/Server/ServerPurchases.ts","webpack:///./src/TextFile.ts","webpack:///./src/Bladeburner/Skills.ts","webpack:///./src/StockMarket/StockMarketHelpers.ts","webpack:///./src/Gang/GangMemberUpgrades.ts","webpack:///./src/PersonObjects/ITaskTracker.ts","webpack:///./src/StockMarket/StockMarketCosts.ts","webpack:///./src/Script/ScriptHelpers.ts","webpack:///./src/Company/Company.ts","webpack:///./src/Hacknet/HashUpgrades.ts","webpack:///./src/Gang/GangMemberTasks.ts","webpack:///./src/Corporation/Warehouse.ts","webpack:///./src/PersonObjects/formulas/reputation.ts","webpack:///./src/StockMarket/BuyingAndSelling.tsx","webpack:///./src/Terminal/ITerminal.tsx","webpack:///./src/Bladeburner/Skill.ts","webpack:///./src/ui/React/ConfirmationModal.tsx","webpack:///./src/utils/helpers/createProgressBarText.ts","webpack:///./src/hash/hash.ts","webpack:///./src/Script/Script.ts","webpack:///./src/utils/helpers/arrayToString.ts","webpack:///./src/DarkWeb/DarkWebItems.ts","webpack:///./src/Bladeburner/GeneralActions.tsx","webpack:///./src/Casino/CardDeck/Card.ts","webpack:///./src/Bladeburner/ActionIdentifier.ts","webpack:///./src/SourceFile/SourceFile.ts","webpack:///./src/MathJaxWrapper.tsx","webpack:///./src/utils/helpers/exceptionAlert.ts","webpack:///./src/Corporation/data/CorporationUnlockUpgrades.ts","webpack:///./src/PersonObjects/Grafting/GraftingHelpers.ts","webpack:///./src/Bladeburner/BlackOperations.tsx","webpack:///./src/CotMG/ActiveFragment.ts","webpack:///./src/Crime/Crime.ts","webpack:///./src/Netscript/APIWrapper.ts","webpack:///./src/PersonObjects/formulas/intelligence.ts","webpack:///./src/Corporation/ResearchMap.ts","webpack:///./src/GameOptions/GameOptionsTab.ts","webpack:///./src/ui/React/HashRate.tsx","webpack:///./src/Message/Message.ts","webpack:///./src/Locations/ui/ApplyToJobButton.tsx","webpack:///./src/Netscript/WorkerScriptStartStopEventEmitter.ts","webpack:///./src/Electron.tsx","webpack:///./src/Achievements/Achievements.ts","webpack:///./src/ui/React/CharacterOverview.tsx","webpack:///./src/utils/helpers/addOffset.ts","webpack:///./src/DarkWeb/DarkWebItem.ts","webpack:///./src/Casino/RNG.ts","webpack:///./src/utils/helpers/compareArrays.ts","webpack:///./src/Corporation/IndustryUpgrades.ts","webpack:///./src/ui/React/Favor.tsx","webpack:///./src/PersonObjects/Sleeve/Sleeve.ts","webpack:///./src/Script/RamCalculationErrorCodes.ts","webpack:///./src/Terminal/TerminalEvents.ts","webpack:///./src/StockMarket/OrderProcessing.tsx","webpack:///./src/Themes/Themes.ts","webpack:///./src/ui/React/AlertManager.tsx","webpack:///./src/utils/IPAddress.ts","webpack:///./src/Augmentation/PlayerOwnedAugmentation.ts","webpack:///./src/db.tsx","webpack:///./src/Message/MessageHelpers.ts","webpack:///./src/Faction/formulas/favor.ts","webpack:///./src/ExportBonus.tsx","webpack:///./src/Faction/ui/Option.tsx","webpack:///./src/Bladeburner/Operation.ts","webpack:///./src/Augmentation/data/AugmentationCreator.tsx","webpack:///./src/Server/data/servers.ts","webpack:///./src/Company/CompanyPosition.ts","webpack:///./src/Script/RunningScript.ts","webpack:///./src/utils/helpers/checkEnum.ts","webpack:///./src/SourceFile/SourceFiles.tsx","webpack:///./src/Bladeburner/ui/StartButton.tsx","webpack:///./src/utils/helpers/formatTime.ts","webpack:///./src/Faction/FactionInfo.tsx","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/Corporation/data/CorporationUpgrades.ts","webpack:///./src/utils/Validator.ts","webpack:///./src/Infiltration/formulas/victory.ts","webpack:///./src/utils/MoneySourceTracker.ts","webpack:///./src/utils/CompressionContracts.ts","webpack:///./src/ui/React/StatsProgressBar.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectGangMethods.ts","webpack:///./src/Themes/Styles.ts","webpack:///./src/Hospital/Hospital.ts","webpack:///./src/ui/React/PromptManager.tsx","webpack:///./src/Corporation/Product.ts","webpack:///./src/Corporation/ui/Helpers.tsx","webpack:///./src/Programs/ui/ProgramsRoot.tsx","webpack:///./src/Faction/ui/FactionsRoot.tsx","webpack:///./src/ui/React/Progress.tsx","webpack:///./src/RedPill.tsx","webpack:///./src/ui/React/RecoveryRoot.tsx","webpack:///./src/NetworkShare/Share.tsx","webpack:///./src/Netscript/WorkerScript.ts","webpack:///./src/Corporation/Corporation.tsx","webpack:///./src/Bladeburner/City.ts","webpack:///./src/Locations/City.ts","webpack:///./src/GameOptions/ui/OptionsSlider.tsx","webpack:///./src/StockMarket/ui/StockTickersConfig.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectServerMethods.ts","webpack:///./src/Prestige.ts","webpack:///./src/Bladeburner/Action.tsx","webpack:///./src/Netscript/RecentScripts.ts","webpack:///./src/ui/Apr1.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/Literature/LiteratureHelpers.ts","webpack:///./src/DarkWeb/DarkWeb.tsx","webpack:///./src/Hacking/netscriptCanHack.ts","webpack:///./src/Infiltration/formulas/game.ts","webpack:///./src/PersonObjects/Grafting/GraftableAugmentation.ts","webpack:///./src/ui/React/ReputationRate.tsx","webpack:///./src/Terminal/Parser.ts","webpack:///./src/ui/React/CinematicText.tsx","webpack:///./src/PersonObjects/Sleeve/SleeveCovenantPurchases.tsx","webpack:///./src/Script/RamCalculations.ts","webpack:///./src/utils/helpers/roundToTwo.ts","webpack:///./src/Netscript/Pid.ts","webpack:///./src/NetscriptFunctions.ts","webpack:///./src/StockMarket/PlayerInfluencing.ts","webpack:///./src/Gang/Gang.ts","webpack:///./src/Faction/formulas/donation.ts","webpack:///./src/Company/GetJobRequirementText.ts","webpack:///./src/Terminal/HelpText.ts","webpack:///./src/utils/ErrorHelper.ts","webpack:///./src/utils/helpers/getRandomByte.ts","webpack:///./src/Bladeburner/data/Growths.ts","webpack:///./src/Locations/createCityMap.ts","webpack:///./src/GameOptions/ui/GameOptionsPage.tsx","webpack:///./src/Casino/CardDeck/Hand.ts","webpack:///./src/StockMarket/ui/StockTickerTxButton.tsx","webpack:///./src/CotMG/ui/DummyGrid.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/ui/InvitationModal.tsx","webpack:///./src/ThirdParty/JSInterpreter.js","webpack:///./src/Server/formulas/grow.ts","webpack:///./src/Gang/GangMemberTask.ts","webpack:///./src/PersonObjects/Sleeve/SleeveHelpers.ts","webpack:///./src/CotMG/StaneksGiftEvents.ts","webpack:///./src/Locations/data/LocationsMetadata.ts","webpack:///./src/Terminal/commands/download.ts","webpack:///./src/SourceFile/PlayerOwnedSourceFile.ts","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/Themes/ui/StyleEditorButton.tsx","webpack:///./src/Themes/ui/ThemeEditorButton.tsx","webpack:///./src/Themes/ui/ThemeCollaborate.tsx","webpack:///./src/ui/React/DeleteGameButton.tsx","webpack:///./src/ui/React/SoftResetButton.tsx","webpack:///./src/Augmentation/ui/PurchasableAugmentations.tsx","webpack:///./src/Locations/ui/TravelAgencyRoot.tsx","webpack:///./src/ScriptEditor/ui/ScriptEditorRoot.tsx","webpack:///./src/Terminal/DirectoryServerHelpers.ts","webpack:///./src/NetscriptJSEvaluator.ts","webpack:///./src/NetscriptFunctions/Flags.ts","webpack:///./src/NetscriptFunctions/toNative.ts","webpack:///./src/ui/React/TablePaginationActionsAll.tsx","webpack:///./src/BitNode/ui/BitnodeMultipliersDescription.tsx","webpack:///./src/CotMG/ui/Cell.tsx","webpack:///./src/CotMG/ui/Grid.tsx","webpack:///./src/Script/RunningScriptHelpers.ts","webpack:///./src/Terminal/commands/common/editor.ts","webpack:///./src/utils/HammingCodeTools.ts","webpack:///./src/Bladeburner/Contract.ts","webpack:///./src/Bladeburner/data/Help.ts","webpack:///./src/Corporation/ResearchTree.ts","webpack:///./src/StockMarket/StockMarketConstants.ts","webpack:///./src/CotMG/data/Constants.ts","webpack:///./src/Company/GetNextCompanyPosition.ts","webpack:///./src/PersonObjects/Player/PlayerObjectBladeburnerMethods.ts","webpack:///./src/PersonObjects/Player/PlayerObjectCorporationMethods.ts","webpack:///./src/engine.tsx","webpack:///./src/Themes/data/index.ts","webpack:///./src/ui/LoadingScreen.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectAugmentationMethods.ts","webpack:///./src/utils/helpers/isValidNumber.ts","webpack:///./src/StockMarket/Order.ts","webpack:///./src/CotMG/StaneksGift.ts","webpack:///./src/Locations/Location.ts","webpack:///./src/PersonObjects/Sleeve/ui/StatsElement.tsx","webpack:///./src/ui/React/ServerDropdown.tsx","webpack:///./src/Casino/Blackjack.tsx","webpack:///./src/Casino/CardDeck/ReactCard.tsx","webpack:///./src/Milestones/Milestones.ts","webpack:///./src/PersonObjects/formulas/work.ts","webpack:///./src/StockMarket/data/TickerHeaderFormatData.ts","webpack:///./src/Achievements/AchievementEntry.tsx","webpack:///./src/ThirdParty/colorUtils.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/Heap.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/utils/helpers/getTimestamp.ts","webpack:///./src/NetworkShare/formulas/share.tsx","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/Gang/data/tasks.ts","webpack:///./src/Gang/GangMember.ts","webpack:///./src/Gang/GangMemberUpgrade.ts","webpack:///./src/Gang/data/power.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/NetscriptFunctions/Infiltration.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/Grafting.ts","webpack:///./src/utils/v1APIBreak.ts","webpack:///./src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx","webpack:///./src/ui/InteractiveTutorial/NSSelection.tsx","webpack:///./src/ui/React/Overview.tsx","webpack:///./src/Sidebar/ui/SidebarRoot.tsx","webpack:///./src/Programs/ProgramHelpers.ts","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/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/DevMenu/ui/Entropy.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/Gang/ui/GangMemberStats.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/TerritoryInfoModal.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/modals/UpgradeOfficeSizeModal.tsx","webpack:///./src/Corporation/ui/modals/ThrowPartyModal.tsx","webpack:///./src/Corporation/ui/IndustryOverview.tsx","webpack:///./src/Corporation/ui/modals/MakeProductModal.tsx","webpack:///./src/Corporation/ui/modals/ResearchModal.tsx","webpack:///./src/Corporation/ui/IndustryWarehouse.tsx","webpack:///./src/Corporation/ui/modals/SmartSupplyModal.tsx","webpack:///./src/Corporation/ui/ProductElem.tsx","webpack:///./src/Corporation/ui/modals/DiscontinueProductModal.tsx","webpack:///./src/Corporation/ui/modals/LimitProductProductionModal.tsx","webpack:///./src/Corporation/ui/modals/SellProductModal.tsx","webpack:///./src/Corporation/ui/modals/ProductMarketTaModal.tsx","webpack:///./src/Corporation/ui/modals/CancelProductModal.tsx","webpack:///./src/Corporation/ui/MaterialElem.tsx","webpack:///./src/Corporation/ui/modals/ExportModal.tsx","webpack:///./src/Corporation/ui/modals/MaterialMarketTaModal.tsx","webpack:///./src/Corporation/ui/modals/SellMaterialModal.tsx","webpack:///./src/Corporation/ui/modals/PurchaseMaterialModal.tsx","webpack:///./src/Corporation/ui/modals/LimitMaterialProductionModal.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/modals/BribeFactionModal.tsx","webpack:///./src/Corporation/ui/modals/SellSharesModal.tsx","webpack:///./src/Corporation/ui/modals/BuybackSharesModal.tsx","webpack:///./src/Corporation/ui/modals/IssueDividendsModal.tsx","webpack:///./src/Corporation/ui/modals/IssueNewSharesModal.tsx","webpack:///./src/Corporation/ui/modals/FindInvestorsModal.tsx","webpack:///./src/Corporation/ui/modals/GoPublicModal.tsx","webpack:///./src/Infiltration/ui/InfiltrationRoot.tsx","webpack:///./src/Infiltration/ui/Game.tsx","webpack:///./src/Infiltration/ui/BackwardGame.tsx","webpack:///./src/Infiltration/ui/BracketGame.tsx","webpack:///./src/Infiltration/ui/BribeGame.tsx","webpack:///./src/Infiltration/ui/CheatCodeGame.tsx","webpack:///./src/Infiltration/ui/Countdown.tsx","webpack:///./src/Infiltration/ui/Cyberpunk2077Game.tsx","webpack:///./src/Infiltration/ui/MinesweeperGame.tsx","webpack:///./src/Infiltration/ui/SlashGame.tsx","webpack:///./src/Infiltration/ui/Victory.tsx","webpack:///./src/Infiltration/ui/WireCuttingGame.tsx","webpack:///./src/Infiltration/ui/Intro.tsx","webpack:///./src/PersonObjects/Grafting/ui/GraftingRoot.tsx","webpack:///./src/ui/WorkInProgressRoot.tsx","webpack:///./src/GameOptions/ui/GameOptionsRoot.tsx","webpack:///./src/GameOptions/ui/CurrentOptionsPage.tsx","webpack:///./src/GameOptions/ui/GameOptionsSidebar.tsx","webpack:///./src/Diagnostic/FileDiagnosticModal.tsx","webpack:///./src/Themes/ui/StyleEditorModal.tsx","webpack:///./src/Themes/ui/ThemeEditorModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveElem.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreEarningsModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreStatsModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveAugmentationsModal.tsx","webpack:///./src/Augmentation/ui/PurchaseAugmentationModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TaskSelector.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TravelModal.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/data/CompanyPositionsMetadata.ts","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/modals/CreateCorporationModal.tsx","webpack:///./src/utils/helpers/N00dles.ts","webpack:///./src/Arcade/ui/ArcadeRoot.tsx","webpack:///./src/Arcade/ui/BBCabinet.tsx","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/ThemeEditorModal.tsx","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/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/DonateOption.tsx","webpack:///./src/Faction/ui/Info.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantSleeveMemoryUpgrade.tsx","webpack:///./src/PersonObjects/Person.ts","webpack:///./src/SourceFile/applySourceFile.ts","webpack:///./src/Exploits/applyExploits.ts","webpack:///./src/Faction/ui/GangButton.tsx","webpack:///./src/Faction/ui/CreateGangModal.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/CotMG/ui/ActiveFragmentSummary.tsx","webpack:///./src/CotMG/DummyGift.ts","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/NetscriptFunctions/Singularity.ts","webpack:///./src/NetscriptPort.ts","webpack:///./src/utils/helpers/clearObject.ts","webpack:///./src/PersonObjects/Grafting/EntropyAccumulation.ts","webpack:///./src/Corporation/CorporationState.ts","webpack:///./src/Literature/Literatures.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/Terminal/commands/apr1.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","FactionNames","extraFormats","extraNotations","gigaMultiplier","numeralWrapper","constructor","this","defaultLocale","updateLocale","numeral","locale","console","warn","format","Math","abs","answer","formatBigNumber","formatReallyBigNumber","decimalPlaces","nAbs","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","parseCustomLargeNumber","numericRegExp","RegExp","join","match","NaN","number","notation","notationIndex","indexOf","largestAbsoluteNumber","n1","n2","n3","isNaN","max","parseMoney","numeralValue","parsed","selfParsed","defaultSettings","ActiveScriptsServerPageSize","ActiveScriptsScriptPageSize","AutosaveInterval","CodeInstructionRunTime","DisableASCIIArt","DisableHotkeys","DisableTextEffects","DisableOverviewProgressBars","EnableBashHotkeys","TimestampsFormat","InfinityLoopSafety","Locale","MaxRecentScriptsCapacity","MaxLogCapacity","MaxPortCapacity","MaxTerminalCapacity","SaveGameOnFileSave","SuppressBuyAugmentationConfirmation","SuppressFactionInvites","SuppressMessages","SuppressTravelConfirmation","SuppressBladeburnerPopup","SuppressTIXPopup","SuppressSavedGameToast","SuppressAutosaveDisabledWarnings","ExcludeRunningScriptsFromSave","IsSidebarOpened","theme","defaultTheme","styles","defaultStyles","overview","x","y","opened","EditorTheme","defaultMonacoTheme","OwnedAugmentationsOrder","OwnedAugmentationsOrderSetting","AcquirementTime","PurchaseAugmentationsOrder","PurchaseAugmentationsOrderSetting","Default","MonacoTheme","MonacoInsertSpaces","MonacoFontSize","MonacoVim","MonacoWordWrap","init","assign","load","save","LocationName","CONSTANTS","VersionString","VersionNumber","_idleSpeed","MaxSkillLevel","MilliPerCycle","CorpFactionRepRequirement","BaseCostFor1GBOfRamHome","BaseCostFor1GBOfRamServer","TravelCost","BaseFavorToDonate","DonateMoneyToRepDivisor","FactionReputationToFavorBase","FactionReputationToFavorMult","CompanyReputationToFavorBase","CompanyReputationToFavorMult","NeuroFluxGovernorLevelMult","NumNetscriptPorts","HomeComputerMaxRam","ServerBaseGrowthRate","ServerMaxGrowthRate","ServerFortifyAmount","ServerWeakenAmount","PurchasedServerLimit","PurchasedServerMaxRam","MultipleAugMultiplier","TorRouterCost","WSEAccountCost","TIXAPICost","MarketData4SCost","MarketDataTixApi4SCost","StockMarketCommission","HospitalCostPerHp","IntelligenceCrimeWeight","IntelligenceInfiltrationWeight","IntelligenceCrimeBaseExpGain","IntelligenceProgramBaseExpGain","IntelligenceGraftBaseExpGain","IntelligenceTerminalHackBaseExpGain","IntelligenceSingFnBaseExpGain","IntelligenceClassBaseExpGain","MillisecondsPer20Hours","GameCyclesPer20Hours","MillisecondsPer10Hours","GameCyclesPer10Hours","MillisecondsPer8Hours","GameCyclesPer8Hours","MillisecondsPer4Hours","GameCyclesPer4Hours","MillisecondsPer2Hours","GameCyclesPer2Hours","MillisecondsPerHour","GameCyclesPerHour","MillisecondsPerHalfHour","GameCyclesPerHalfHour","MillisecondsPerQuarterHour","GameCyclesPerQuarterHour","MillisecondsPerFiveMinutes","GameCyclesPerFiveMinutes","BaseFocusBonus","ClassDataStructuresBaseCost","ClassNetworksBaseCost","ClassAlgorithmsBaseCost","ClassManagementBaseCost","ClassLeadershipBaseCost","ClassGymBaseCost","ClassStudyComputerScienceBaseExp","ClassDataStructuresBaseExp","ClassNetworksBaseExp","ClassAlgorithmsBaseExp","ClassManagementBaseExp","ClassLeadershipBaseExp","CodingContractBaseFactionRepGain","CodingContractBaseCompanyRepGain","CodingContractBaseMoneyGain","AugmentationGraftingCostMult","AugmentationGraftingTimeBase","SoACostMult","SoARepMult","EntropyEffect","TotalNumBitNodes","InfiniteLoopLimit","Donations","LatestUpdate","AugmentationNames","dialogBoxCreate","txt","AlertEvents","emit","component","sx","dangerouslySetInnerHTML","__html","CityName","BitNodeMultipliers","defaultMultipliers","useStyles","makeStyles","createStyles","unbuyable","color","palette","action","disabled","colors","Money","props","classes","undefined","player","Error","canAfford","className","convertTimeMsToTimeElapsedString","time","showMilli","floor","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","arr","every","isString","formatNumber","num","numFractionDigits","toLocaleString","maximumFractionDigits","minimumFractionDigits","generateRandomString","chars","random","cyrb53","seed","h1","h2","ch","charCodeAt","imul","toString","capitalizeFirstLetter","capitalizeEachWord","split","map","word","AllServers","GetServer","server","isValidIPAddress","hostname","keys","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","WorldDaemonDifficulty","networkLayer","linkNetworkLayers","network1","selectServer","server1","server2","serversOnNetwork","getRandomArrayItem","prestigeAllServers","member","loadAllServers","saveAllServers","excludeRunningScripts","TempAllServers","stringify","runningScripts","runningScriptObj","logs","Page","Factions","loadFactions","faction","getInfo","err","error","factionExists","initFactions","FactionInfos","resetFaction","Faction","newFactionObject","factionName","favor","AddToFactions","KEY","KEYCODE","ctor","constructors","fromJSON","obj","validationData","validateObject","Generic_toJSON","ctorName","index","Generic_fromJSON","Context","React","createContext","Router","use","useContext","SoftwareCompanyPositions","ITCompanyPositions","SecurityEngineerCompanyPositions","NetworkEngineerCompanyPositions","BusinessCompanyPositions","SecurityCompanyPositions","AgentCompanyPositions","MiscCompanyPositions","SoftwareConsultantCompanyPositions","BusinessConsultantCompanyPositions","PartTimeCompanyPositions","lower","upper","WorkType","PlayerFactionWorkType","ClassType","CrimeType","Augmentation","params","info","moneyCost","repCost","factions","prereqs","baseRepRequirement","freeze","baseCost","isSpecial","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","infiltration_base_rep_increase","infiltration_rep_mult","infiltration_trade_mult","infiltration_sell_mult","infiltration_timer_mult","infiltration_damage_reduction_mult","stats","programs","startingMoney","f","decimals","desc","ShadowsOfAnarchy","generateStatsDescription","addToFactions","factionList","augmentations","getCost","augmentationReference","StaticAugmentations","NeuroFluxGovernor","nextLevel","getLevel","multiplier","AugmentationRepCost","AugmentationMoneyCost","queuedAugmentations","getBaseAugmentationPriceMultiplier","includes","soaAugmentationNames","initSoAAugmentations","augmentation","soaMultiplier","filter","augmentationName","hasAugmentation","find","getGenericAugmentationPriceMultiplier","currLevel","level","addToAllFactions","fac","facObj","special","toJSON","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","AllCorporationStates","CorporationConstants","INITIALSHARES","SHARESPERPRICEUPDATE","IssueNewSharesCooldown","SellSharesCooldown","CyclesPerMarketCycle","CyclesPerIndustryStateCycle","SecsPerMarketCycle","Cities","Aevum","Chongqing","Sector12","NewTokyo","Ishima","Volhaven","WarehouseInitialCost","WarehouseInitialSize","WarehouseUpgradeBaseCost","OfficeInitialCost","OfficeInitialSize","OfficeUpgradeBaseCost","BribeThreshold","BribeToRepRatio","ProductProductionCostRatio","DividendMaxPercentage","EmployeeSalaryMultiplier","CyclesPerEmployeeRaise","EmployeeRaiseAmount","BaseMaxProducts","AllMaterials","FundingRoundShares","FundingRoundMultiplier","AvgProfitLength","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","RamCostConstants","ScriptBaseRamCost","ScriptDomRamCost","ScriptCorporationRamCost","ScriptHackRamCost","ScriptHackAnalyzeRamCost","ScriptGrowRamCost","ScriptGrowthAnalyzeRamCost","ScriptWeakenRamCost","ScriptWeakenAnalyzeRamCost","ScriptScanRamCost","ScriptRecentScriptsRamCost","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","ScriptClearTerminalCost","ScriptSingularityFn1RamCost","ScriptSingularityFn2RamCost","ScriptSingularityFn3RamCost","ScriptGangApiBaseRamCost","ScriptBladeburnerApiBaseRamCost","ScriptStanekWidth","ScriptStanekHeight","ScriptStanekCharge","ScriptStanekFragmentDefinitions","ScriptStanekPlacedFragments","ScriptStanekClear","ScriptStanekCanPlace","ScriptStanekPlace","ScriptStanekFragmentAt","ScriptStanekDeleteAt","ScriptInfiltrationCalculateDifficulty","ScriptInfiltrationCalculateRewards","ScriptInfiltrationGetLocations","ScriptInfiltrationGetInfiltrations","ScriptStanekAcceptGift","SF4Cost","cost","bitNodeN","sf4","sourceFileLvl","stock","getSymbols","getPrice","getAskPrice","getBidPrice","getPosition","getMaxShares","getPurchaseCost","getSaleGain","buy","sell","short","sellShort","placeOrder","cancelOrder","getOrders","getVolatility","getForecast","purchase4SMarketData","purchase4SMarketDataTixApi","purchaseWseAccount","purchaseTixApi","singularity","universityCourse","gymWorkout","travelToCity","goToLocation","purchaseTor","purchaseProgram","getCurrentServer","connect","manualHack","installBackdoor","getDarkwebProgramCost","getDarkwebPrograms","getStats","getCharacterInformation","hospitalize","isBusy","stopAction","upgradeHomeRam","upgradeHomeCores","getUpgradeHomeRamCost","getUpgradeHomeCoresCost","workForCompany","applyToCompany","quitJob","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","b1tflum3","destroyW0r1dD43m0n","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","infiltration","calculateDifficulty","calculateRewards","calculateGetLocations","calculateGetInfiltrations","codingcontract","attempt","getContractType","getData","getDescription","getNumTriesRemaining","sleeve","getNumSleeves","setToShockRecovery","setToSynchronize","setToCommitCrime","setToUniversityCourse","travel","setToCompanyWork","setToFactionWork","setToGymWorkout","getSleeveStats","getTask","getInformation","getSleeveAugmentations","getSleevePurchasableAugs","purchaseSleeveAug","setToBladeburnerAction","stanek","giftWidth","giftHeight","chargeFragment","fragmentDefinitions","activeFragments","clearGift","canPlaceFragment","placeFragment","getFragment","removeFragment","acceptGift","RamCosts","hacknet","numNodes","purchaseNode","getPurchaseNodeCost","getNodeStats","upgradeLevel","upgradeRam","upgradeCore","upgradeCache","getLevelUpgradeCost","getRamUpgradeCost","getCoreUpgradeCost","getCacheUpgradeCost","numHashes","hashCost","spendHashes","maxNumNodes","ui","getTheme","setTheme","resetTheme","getStyles","setStyles","resetStyles","getGameInfo","grafting","getAugmentationGraftPrice","getAugmentationGraftTime","getGraftableAugmentations","graftAugmentation","sprintf","vsprintf","scan","hack","hackAnalyzeThreads","hackAnalyze","hackAnalyzeSecurity","hackAnalyzeChance","sleep","asleep","share","getSharePower","grow","growthAnalyze","growthAnalyzeSecurity","weaken","weakenAnalyze","print","printf","tprint","clearLog","disableLog","enableLog","isLogEnabled","getScriptLogs","clearTerminal","nuke","brutessh","ftpcrack","relaysmtp","httpworm","sqlinject","run","exec","spawn","kill","killall","exit","atExit","scp","ls","ps","getRecentScripts","hasRootAccess","getIp","getHostname","getHackingLevel","getHackingMultipliers","getHacknetMultipliers","getBitNodeMultipliers","getServer","getServerMoneyAvailable","getServerSecurityLevel","getServerBaseSecurityLevel","getServerMinSecurityLevel","getServerRequiredHackingLevel","getServerMaxMoney","getServerGrowth","getServerNumPortsRequired","getServerRam","getServerMaxRam","getServerUsedRam","serverExists","fileExists","isRunning","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","tFormat","getTimeSinceLastAug","prompt","wget","getFavorToDonate","getPlayer","mv","getOwnedSourceFiles","tail","toast","heart","break","getRamCost","args","curr","currType","ActionTypes","Idle","Contract","Operation","BlackOp","BlackOperation","Training","Recruitment","FieldAnalysis","Diplomacy","t_homeComp","safetlyCreateUniqueServer","adminRights","isConnectedTo","purchasedByPlayer","currentServer","Home","getHomeComputer","Programs","NukeProgram","prestigeAugmentation","numPeopleKilled","hacking","strength","defense","dexterity","agility","charisma","hacking_exp","strength_exp","defense_exp","dexterity_exp","agility_exp","charisma_exp","city","location","TravelAgency","companyName","jobs","purchasedServers","factionInvitations","numSleeves","sleevesFromCovenant","sleeves","Sleeve","shock","synchronize","shockRecovery","isWorking","currentWorkFactionName","currentWorkFactionDescription","createProgramName","None","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","entropy","karma","sync","resetGangs","hasWseAccount","hasTixApiAccess","has4SData","has4SDataTixApi","corporation","moneySourceB","playtimeSinceLastBitnode","receiveInvite","calculateSkill","exp","mult","calculateSkillF","calculateSkillProgress","calculateSkillProgressF","updateSkillLevels","HackingLevelMultiplier","StrengthLevelMultiplier","DefenseLevelMultiplier","DexterityLevelMultiplier","AgilityLevelMultiplier","CharismaLevelMultiplier","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","gainStats","retValue","def","dex","agi","cha","int","queryStatFromString","tempStr","resetWorkStatus","generalType","group","workType","factionWorkType","singularityStopWork","workMoneyLossRate","timeWorkedCreateProgram","timeWorkedGraftAugmentation","graftAugmentationName","processWorkEarnings","numCycles","focusBonus","focus","hackExpGain","strExpGain","defExpGain","dexExpGain","agiExpGain","chaExpGain","moneyGain","startWork","Company","getWorkHackExpGain","getWorkStrExpGain","getWorkDefExpGain","getWorkDexExpGain","getWorkAgiExpGain","getWorkChaExpGain","getWorkRepGain","getWorkMoneyGain","timeNeededToCompleteWork","process","router","toFaction","CreateProgram","createProgramWork","toTerminal","StudyClass","takeClass","toCity","Crime","toLocation","Locations","Slums","CompanyPartTime","workPartTime","GraftAugmentation","graftAugmentationWork","toGrafting","work","cancelationPenalty","specialName","backdoorInstalled","overMax","comp","Companies","influenceStockThroughCompanyWork","finishWork","cancelled","sing","penaltyString","playerReputation","content","reputation","startWorkPartTime","finishWorkPartTime","startFocusing","stopFocusing","startFactionWork","favorMult","FactionWorkRepGain","startFactionHackWork","Hacking","FactionWorkExpGain","getHackingWorkRepGain","startFactionFieldWork","Field","getFactionFieldWorkRepGain","startFactionSecurityWork","Security","getFactionSecurityWorkRepGain","finishFactionWork","bn11Mult","company","companyPositionName","companyPosition","CompanyPositions","baseSalary","salaryMultiplier","CompanyWorkMoney","hackingExpGain","expMultiplier","CompanyWorkExpGain","strengthExpGain","defenseExpGain","dexterityExpGain","agilityExpGain","charismaExpGain","jobPerformance","calculateJobPerformance","startCreateProgramWork","reqLevel","createProgramReqLvl","programFile","startsWith","endsWith","percComplete","Number","reqLvl","skillMult","getIntelligenceBonus","finishCreateProgramWork","incompleteName","startGraftAugmentationWork","craftAugmentationWork","NeuroreceptorManager","graftingIntBonus","finishGraftAugmentationWork","augName","applyAugmentation","CongruityImplant","applyEntropy","startClass","costMult","expMult","workCostMult","workExpMult","earnings","calculateClassEarnings","finishClass","startCrime","hackExp","strExp","defExp","dexExp","agiExp","chaExp","workerscript","committingCrimeThruSingFn","singFnCrimeWorkerScript","CrimeExpGain","CrimeMoney","toWork","finishCrime","determineCrimeSuccess","crime","Crimes","type","kills","ws","disableLogs","ALL","scriptRef","log","takeDamage","regenerateHp","getHospitalizationCost","SnackbarEvents","ToastVariant","WARNING","applyForJob","entryPosType","pos","isQualified","getJobRequirementText","hasPosition","nextPos","getNextCompanyPositionHelper","reqText","getNextCompanyPosition","currCompany","currentPositionName","currentPosition","isSoftwareJob","isITJob","isBusinessJob","isSecurityEngineerJob","isNetworkEngineerJob","isSecurityJob","isAgentJob","isSoftwareConsultantJob","isBusinessConsultantJob","isPartTimeJob","_sing","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","playerAug","reapplyAllSourceFiles","sourceFiles","srcFileKey","SourceFiles","applySourceFile","applyExploit","checkForFactionInvitations","invitedFactions","numAugmentations","allCompanies","allPositions","values","checkMegacorpRequirements","repNeeded","illuminatiFac","Illuminati","isBanned","isMember","alreadyInvited","daedalusFac","Daedalus","DaedalusAugsRequirement","covenantFac","TheCovenant","ecorpFac","ECorp","AevumECorp","megacorpFac","MegaCorp","Sector12MegaCorp","bachmanandassociatesFac","BachmanAssociates","AevumBachmanAndAssociates","bladeindustriesFac","BladeIndustries","Sector12BladeIndustries","nwoFac","NWO","VolhavenNWO","clarkeincorporatedFac","ClarkeIncorporated","AevumClarkeIncorporated","omnitekincorporatedFac","OmniTekIncorporated","VolhavenOmniTekIncorporated","foursigmaFac","FourSigma","Sector12FourSigma","kuaigonginternationalFac","KuaiGongInternational","ChongqingKuaiGongInternational","fulcrumsecrettechonologiesFac","FulcrumSecretTechnologies","fulcrumSecretServer","AevumFulcrumTechnologies","bitrunnersFac","BitRunners","bitrunnersServer","BitRunnersServer","theblackhandFac","TheBlackHand","blackhandServer","TheBlackHandServer","nitesecFac","NiteSec","nitesecServer","NiteSecServer","chongqingFac","sector12Fac","newtokyoFac","aevumFac","ishimaFac","volhavenFac","speakersforthedeadFac","SpeakersForTheDead","Sector12CIA","Sector12NSA","thedarkarmyFac","TheDarkArmy","thesyndicateFac","TheSyndicate","silhouetteFac","Silhouette","tetradsFac","Tetrads","slumsnakesFac","SlumSnakes","netburnersFac","Netburners","totalHacknetRam","totalHacknetCores","totalHacknetLevels","v","hserver","HacknetServer","cores","ram","tiandihuiFac","TianDiHui","cybersecFac","CyberSec","cybersecServer","CyberSecServer","setBitNodeNumber","queueAugmentation","aug","PlayerOwnedAugmentation","gainCodingContractReward","reward","difficulty","CodingContractRewardType","FactionReputation","FactionReputationAll","repGain","totalGain","specialFactions","Bladeburners","gainPerFaction","facName","CompanyReputation","CodingContractMoney","to","gotoLocation","canAccessGrafting","giveExploit","exploit","SUCCESS","giveAchievement","achievementId","achievement","achievements","ID","unlockedOn","Name","weight","calculateIntelligenceBonus","getCasinoWinnings","casino","getMult","setMult","canAccessCotMG","sf","lvl","iTutorialSteps","ITutorial","currStep","Start","stepIsDone","NSSelection","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","LiteratureNames","HackersStartingHandbook","BaseServer","super","createRandomString","moneyAvailable","ServerStartingMoney","moneyMax","ServerMaxMoney","hackDifficulty","ServerStartingSecurity","baseDifficulty","minDifficulty","serverGrowth","capDifficulty","changeMinimumSecurity","perc","changeMaximumMoney","aboveCap","fortify","ServerWeakenRate","EmployeePositions","Operations","Engineer","Business","Management","RandD","Unassigned","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","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","processAllHacknetServerEarnings","total","processSingleHacknetNodeEarnings","processAllHacknetNodeEarnings","totalEarnings","nodes","updateCapacity","hashCapacity","purchaseHashUpgrade","upgName","upgTarget","upg","refundUpgrade","funds","target","e","division","divisions","sciResearch","qty","changeRank","skillPoints","generateRandomContract","BlackOperationNames","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","FragmentType","Effect","tpe","HackingChance","HackingSpeed","HackingMoney","HackingGrow","Strength","Defense","Dexterity","Agility","Charisma","HacknetMoney","HacknetCost","Rep","WorkMoney","Bladeburner","NewIndustry","industry","Industry","NewCity","offices","OfficeSpace","loc","size","UnlockUpgrade","price","unlockUpgrades","unlock","LevelUpgrade","basePrice","priceMult","upgrades","IssueDividends","percent","dividendPercentage","SellMaterial","mat","replace","temp","bCost","eval","sCost","q","tempQty","maxsll","prd","sllman","SellProduct","product","all","cities","tempCity","SetSmartSupply","warehouse","smartSupply","smartSupplyEnabled","SetSmartSupplyUseLeftovers","material","useLeftover","smartSupplyUseLeftovers","BuyMaterial","BulkPurchase","matSize","MaterialSizes","maxAmount","sizeUsed","SellShares","numShares","public","shareSaleCooldown","stockSaleResults","calculateShareSale","profit","newSharePrice","newSharesUntilUpdate","issuedShares","sharePrice","shareSalesUntilPriceUpdate","BuyBackShares","buybackPrice","AssignJob","employee","job","UpgradeOfficeSize","office","initialPriceMult","ThrowParty","costPerEmployee","totalCost","employees","throwParty","PurchaseWarehouse","warehouses","Warehouse","UpgradeWarehouseCost","Array","from","reduce","acc","UpgradeWarehouse","sizeUpgradeCost","updateSize","BuyCoffee","IndustryUpgrades","HireAdVert","MakeProduct","productName","designInvest","marketingInvest","makesProducts","maxProducts","hasResearch","products","Product","trim","createCity","designCost","advCost","Research","researchName","researchTree","getAllNodes","research","ResearchMap","researched","ExportMaterial","divisionName","cityName","sanitizedAmt","isRelevantMaterial","exportObj","ind","CancelExportMaterial","LimitProductProduction","prdman","LimitMaterialProduction","SetMaterialMarketTA1","on","marketTa1","SetMaterialMarketTA2","marketTa2","SetProductMarketTA1","SetProductMarketTA2","CorporationManagementHandbook","HistoryOfSynthoids","AGreenTomorrow","AlphaOmega","SimulatedReality","BeyondMan","BrighterThanTheSun","DemocracyIsDead","Sector12Crime","ManAndMachine","SecretSocieties","TheFailedFrontier","CodedIntelligence","SyntheticMuscles","TensionsInTechRace","CostOfImmortality","TheHiddenWorld","TheNewGod","NewTriads","TheSecretWar","programsMetadata","Program","SleeveTaskType","initCompanies","oldCompanies","companiesMetadata","forEach","loadCompanies","StatsRow","root","cellNone","style","align","PositionTypes","borderBottom","small","width","TableCell","Table","AllGangs","power","territory","loadAllGangs","removeLeadingSlash","removeTrailingSlash","isValidFilename","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","Terminal","TTerminal","TheDarkArmyServer","DaedalusServer","DarkWeb","Shoplift","dexterity_success_weight","agility_success_weight","RobStore","hacking_success_weight","Mug","strength_success_weight","defense_success_weight","Larceny","DealDrugs","Drugs","charisma_success_weight","BondForgery","TraffickArms","Homicide","GrandTheftAuto","Kidnap","Assassination","Heist","trusted","event","isTrusted","htmlLocation","margin","spacing","flexGrow","minHeight","boxSizing","uninitialized","isInitialized","page","allowRouting","toActiveScripts","toAugmentations","toBitVerse","toBladeburner","toStats","toCorporation","toCreateProgram","toDevMenu","toFactions","toGameOptions","toGang","toHacknetNodes","toInfiltration","toJob","toMilestones","toScriptEditor","toSleeves","toStockMarket","toTravel","toTutorial","toBladeburnerCinematic","toStaneksGift","toAchievements","toThemeBrowser","toImportSave","GameRoot","engine","terminal","files","vim","setEditorOptions","useState","setPage","RecoveryMode","Recovery","Work","determineStartPage","setRerender","augPage","setAugPage","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","Augmentations","Stats","DevMenu","Options","Gang","Hacknet","Milestones","Grafting","options","ScriptEditor","Sleeves","StockMarket","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","eventEmitterForUiReset","initStockMarket","initStockMarketFn","sellStockLong","sellStock","sellStockShort","stockMarket","export","onExport","exportGame","forceKill","exportGameFn","installAugmentationsFn","Provider","killScripts","flexDirection","onToggled","isOpened","updateHashCapacity","seconds","onlineTimeSeconds","hashRate","totalHashesGenerated","prodMult","cpuCores","runScript","script","updateRamUsed","calculateHashGainRate","ramUsed","companyPositionMetadata","CompanyPosition","snackbar","zIndex","logBoxBaseZIndex","alignSelf","SnackbarProvider","dense","maxSnack","anchorOrigin","horizontal","vertical","autoHideDuration","containerRoot","EventEmitter","Snackbar","enqueueSnackbar","closeSnackbar","useSnackbar","variant","duration","id","severity","k","onClick","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","loadStaneksGift","zeros","dimensions","array","calculateGrid","gift","newgrid","height","fragmentAt","calculateHackingChance","difficultyMult","chance","calculateHackingExpGain","expGain","HackExpGain","calculatePercentMoneyHacked","percentMoneyHacked","ScriptHackMoney","calculateHackingTime","skillFactor","calculateGrowTime","calculateWeakenTime","Orders","storedCycles","ticksUntilCycle","SymbolToStockMap","shares","workerScript","Stock","order","Order","symbol","orders","stk","processOrderRefs","symbolToStockMap","processOrders","stockOrders","stockSymbol","orderTxt","loadStockMarket","deleteStockMarket","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","inviteToFaction","InvitationEvent","allFactions","factionInfo","enemy","enemies","hasAugmentationPrereqs","hasPrereqs","augCosts","queuedAugmentation","req","processPassiveFactionRepGain","offersWork","getGangName","hRep","sRep","fRep","rate","FactionPassiveRepGain","getFactionAugmentationsFiltered","hasGangWith","augs","TheRedPill","rng","SFC32RNG","uniqueFilter","GangUniqueAugs","Exploit","names","Bypass","EditSaveFile","PrototypeTampering","TimeCompression","Unclickable","UndocumentedFunctionCall","RealityAlteration","N00dles","YoureNotMeantToAccessThis","TrueRecursion","INeedARainbow","ExploitName","Set","netscriptDelay","delayReject","Promise","resolve","reject","delay","infiniteLoopSafetyCounter","env","stopFlag","ScriptDeath","makeRuntimeRejectMsg","msg","scriptUrl","dependencies","url","resolveNetscriptRequestedThreads","functionName","requestedThreads","threads","requestedThreadsAsInt","isScriptErrorMessage","BitburnerSaveObject","getSaveString","PlayerSave","AllServersSave","CompaniesSave","FactionsSave","AliasesSave","Aliases","GlobalAliasesSave","GlobalAliases","StockMarketSave","SettingsSave","VersionSave","LastExportBonus","ExportBonus","StaneksGiftSave","AllGangsSave","btoa","unescape","encodeURIComponent","emitToastEvent","savedOn","lastSave","then","saveData","playerIdentifier","identifier","getSaveFileName","pushGameSaved","INFO","catch","isRecovery","epochTime","now","bn","download","importGame","base64Save","getImportStringFromFile","file","reader","FileReader","promise","onload","readAsText","newSave","parsedSave","atob","base64","importedPlayer","playerData","totalPlaytime","current","bitNode","bitNodeLevel","loadGame","navigator","userAgent","setInterval","decodeURIComponent","escape","saveObj","loadAliases","loadGlobalAliases","ver","anyPlayer","positionName","companyPositions","changes","convert","code","change","scripts","v1APIBreak","nf","revenue","expenses","lastCycleRevenue","lastCycleExpenses","thisCycleRevenue","thisCycleExpenses","resleeves","contract","contracts","ownedNFGs","newNFG","nfg","darkweb","evaluateVersionCompatibility","href","resets","createNewUpdateText","whiteSpace","paddingLeft","lineHeight","Blob","msSaveOrOpenBlob","document","createElement","URL","createObjectURL","body","appendChild","click","removeChild","revokeObjectURL","MoneyRate","CodingContractType","gen","solver","diff","numTries","generate","CodingContractTypes","md","codingContractTypesMetadata","CodingContractResult","CodingContract","getDifficulty","getMaxNumTries","getType","isSolution","solution","Cancelled","onAttempt","val","Success","Failure","CodingContractEvent","initAugmentations","resetFactionAugmentations","clearObject","initNeuroFluxGovernor","initUnstableCircadianModulator","initGeneralAugmentations","initBladeburnerAugmentations","ChurchOfTheMachineGod","initChurchOfTheMachineGodAugmentations","resetAugmentation","augmentationExists","AddToStaticAugmentations","reapply","staticAugmentation","ownedNfg","pAug","ownedAug","force","augmentationList","nfgIndex","isRepeatableAug","Fragments","Fragment","shape","limit","fullAt","rotation","sy","mx","my","qx","qy","neighboors","candidates","add","coord","cells","candidate","cell","copy","FragmentById","fragment","_","X","Shapes","S","Z","T","I","J","O","Booster","NoneFragment","DeleteFragment","Delete","base","inherit","common","accent","bg","fg","syntax","tag","entity","string","regexp","markup","keyword","comment","constant","line","panel","selected","selection","colorRegExp","sanitizeTheme","entries","repairBlock","block","makeTheme","themeRules","token","foreground","themeColors","fromEntries","rules","async","loadThemes","monaco","editor","defineTheme","fontStyle","uuidv4","uuid","subscribers","sub","rep","Reputation","Adjuster","setValue","label","placeholder","subtract","tons","onChange","InputProps","startAdornment","title","transform","endAdornment","upArrowSymbol","downArrowSymbol","leftArrowSymbol","rightArrowSymbol","getArrow","UP_ARROW","W","LEFT_ARROW","DOWN_ARROW","RIGHT_ARROW","D","getInverseArrow","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","numCycleForGrowth","growth","ajdGrowthRate","serverGrowthPercentage","coreBonus","ServerGrowthRate","numCycleForGrowthCorrected","targetMoney","startMoney","adjGrowthRate","exponentialBase","coreMultiplier","threadMultiplier","w","ey","cycles","bt","corr","bct","opc","fca","cca","ceil","processSingleServerGrowth","calculateServerGrowth","oldMoneyAvailable","isValidNumber","usedCycles","prestigeHomeComputer","homeComp","hasBitflume","BitFlume","updateRamUsage","getServerOnNetwork","isBackdoorInstalled","SkillNames","BladesIntuition","Cloak","Marksman","WeaponProficiency","ShortCircuit","DigitalObserver","Tracer","Overclock","Reaper","EvasiveSystem","Datamancer","CybersEdge","HandsOfMidas","Hyperdrive","count","getActionTimePenalty","getChaosCompetencePenalty","getChaosDifficultyBonus","useGang","killWorkerScript","rerenderUi","WorkerScript","stopAndCleanUpWorkerScript","RunningScript","killWorkerScriptByPid","pid","compareArrays","clearTimeout","killNetscriptDelay","runningScript","rs","ramUsage","delete","AddRecentScript","WorkerScriptStartStopEventEmitter","removeWorkerScript","MoneyCost","String","BitNode","BitNodes","HomeComputerRamCost","PurchasedServerCost","PurchasedServerSoftcap","HacknetNodeMoney","ManualHackMoney","ScriptHackMoneyGain","ClassGymExpGain","RepToDonateToFaction","InfiltrationMoney","InfiltrationRep","FourSigmaMarketDataCost","FourSigmaMarketDataApiCost","CorporationValuation","CorporationSoftcap","BladeburnerRank","BladeburnerSkillCost","GangSoftcap","StaneksGiftPowerMultiplier","StaneksGiftExtraSize","inc","dec","initBitNodeMultipliers","defaultConstructorParams","initPrice","marketCap","spreadPerc","range","divisor","lastPrice","playerShares","playerAvgPx","playerShortShares","playerAvgShortPx","otlkMagForecast","getAbsoluteForecast","totalSharesUnrounded","totalShares","maxShares","changeForecastForecast","newff","newPrice","changeAmt","increaseChance","getForecastIncreaseChance","influenceForecast","influenceForecastForecast","startingLevel","extraLevels","totalMultiplier","startingRam","numUpgrades","currentRam","startingCores","currentCores","startingCache","currentCache","printAliases","parseAliasDeclaration","global","matches","addGlobalAlias","addAlias","getAlias","getGlobalAlias","removeAlias","substituteAliases","origCommand","commandArray","somethingSubstituted","depth","alias","OptionSwitch","checked","tooltip","control","Literature","CopyableText","setOpen","copyText","select","setSelectionRange","execCommand","ThemeEvents","refreshTheme","createTheme","combat","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","fontSize","disableInteractive","MuiSlider","valueLabel","MuiDrawer","paperAnchorDockedLeft","borderRight","welllight","MuiDivider","MuiFormControlLabel","MuiSwitch","switchBase","track","MuiPaper","MuiTablePagination","selectLabel","displayedRows","MuiTab","textColorPrimary","MuiTabs","scrollButtons","opacity","TabIndicatorProps","MuiAlert","standardSuccess","standardError","standardWarning","standardInfo","TTheme","injectFirst","layerCounter","LogBoxEvents","LogBoxCloserEvents","LogBoxClearEvents","LogBoxManager","closePid","LogWindow","close","_theme","overflowY","overflowX","titleButton","draggableRef","useRef","rootRef","setScript","container","minimized","setMinimized","findRunningScript","startWorkerScript","updateLayer","full","maxLength","minimize","clearInterval","addEventListener","onResize","removeEventListener","debounce","isOnScreen","resetPosition","bounds","getBoundingClientRect","right","bottom","left","innerWidth","top","outerWidth","state","setState","minConstraints","handle","onDrag","clientX","clientY","innerHeight","ref","onMouseDown","flexFlow","minWidth","cursor","textOverflow","has","onTouchEnd","Water","Plants","Metal","Hardware","Chemicals","Robots","AICores","errorMessage","calculateExp","skill","currentSkill","nextSkill","baseExperience","nextExperience","progress","currentExperience","remainingExperience","experience","UpgradeType","gangMemberUpgradesMetadata","upgType","Weapon","Armor","Vehicle","Rootkit","gainFavor","getFavorGain","totalRep","favorToRep","repToFavor","constructLocation","asciiArt","LocationsMetadata","addLocation","GangConstants","GangRespectToReputationRatio","MaximumGangMembers","CyclesPerTerritoryAndPowerUpdate","AscensionMultiplierRatio","Names","GangKarmaRequirement","FactionWorkType","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","errorTextArray","errorMsg","setProperty","createAsyncFunction","createNativeFunction","nativeToPseudo","interpreter","Interpreter","runInterpreter","more","step","parent","createAndAddWorkerScript","oneRamUsage","getRamUsageFromRunningScript","roundToTwo","arrayToString","generateNextPid","set","scriptExecution","runningFn","wrap","propName","finally","wrapObject","vars","tree","isArray","executeJSScript","SyntaxError","message","stack","startNetscript2Script","onlineExpGained","onlineMoneyMade","updateOnlineScriptTimes","onlineRunningTime","loadAllRunningScripts","skipScriptLoad","markUpdated","scriptCalculateOfflineProduction","runScriptFromScript","caller","scriptname","arg","ramAvailable","hasAdminRights","Map","StatsTable","rows","wide","MuiTable","row","elem","noWrap","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","GameTimer","setV","totalMillis","WKSharmonizer","millis","intervalId","onExpire","noPaper","mb","ActionIdentifier","general","ops","blackops","events","updateSkillMultipliers","calculateMaxStamina","stamina","maxStamina","getCurrentCity","calculateStaminaPenalty","canAttemptBlackOp","actionId","getActionObject","reqdRank","rank","nm","BlackOperations","isAvailable","person","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","Skills","multKeys","skillMultipliers","Skill","currentLevel","pointCost","calculateCost","maxLvl","executeLogConsoleCommand","flag","logging","executeHelpConsoleCommand","ConsoleHelpText","helpList","helpText","executeAutomateConsoleCommand","variable","highLow","automateActionHigh","automateActionLow","automateThreshHigh","automateThreshLow","automateEnabled","parseCommandArguments","command","start","endQuote","SPACE","substr","triggerMigration","sourceCityName","destCityName","destCity","sourceCity","rand","percentage","triggerPotentialMigration","randomEvent","chaos","getActionStats","successMult","unweightedGain","unweightedIntGain","weights","getDiplomacyEffectiveness","getRecruitmentSuccessChance","teamSize","sleeveSize","effCharisma","effCha","charismaFactor","sleeveSupport","joining","resetSkillMultipliers","successChanceAll","successChanceStealth","successChanceKill","successChanceContract","successChanceOperation","successChanceEstimate","actionTime","effHack","effStr","effDef","effDex","effAgi","effInt","multiplierNames","multiplierName","getMultiplier","multiplierValue","completeOperation","teamCount","losses","sup","bbAction","teamLost","improvePopulationEstimateByPercentage","changePopulationByPercentage","changeEstEqually","nonZero","changeChaosByCount","changeChaosByPercentage","changePopulationByCount","estChange","estOffset","completeContract","actionIdent","improvePopulationEstimateByCount","completeAction","isPlayer","createTaskTracker","isOperation","difficultyMultiplier","rewardMultiplier","rewardFac","successes","setMaxLevel","rankGain","gain","addOffset","whoAmI","failures","loss","damage","rankLoss","hpLoss","hpLost","calculateHospitalizationCost","numHosp","moneyLost","logLossText","autoLevel","teamLossMax","staminaGain","staminaBonus","eff","successChance","recruitTime","growthF","Growths","operation","infiltrateSynthoidCommunities","infilSleeves","maxRank","bladeburnersFactionName","favorBonus","rankNeededForSp","totalSkillPoints","gainedSkillPoints","processAction","actionTimeOverflow","OperationDaedalus","calculateStaminaGainPerSecond","effAgility","maxStaminaBonus","oldMax","difficultyFac","decays","isStealth","isKill","BladesSimulacrum","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","calculateMoneyGainRate","startingCore","sanitizedCores","coreBaseCost","win","reachedLimit","reached","Game","interpolate","settings","out","lerpD","lerp","Trivial","Normal","Hard","Impossible","KeyHandler","press","onKeyDown","Hashes","updateMoneyGainRate","moneyGainRatePerSecond","totalMoneyGenerated","minMax","getPurchaseServerCost","sanitizedRam","isPowerOfTwo","sign","getPurchaseServerMaxRam","getPurchaseServerLimit","clz32","newServ","purchaseRamForHomeComputer","TextFile","append","show","getTextFile","textFiles","createTextFile","costInc","getBuyTransactionCost","posType","getSellTransactionGain","processTransactionForecastMovement","firstShares","remainingShares","numIterations","forecastChange","forecastForecastChange","calculateBuyMaxAmount","isLong","remainingMoney","currPrice","GangMemberUpgrades","GangMemberUpgrade","getStockMarket4SDataCost","getStockMarket4STixApiCost","getStockMarketWseCost","getStockMarketTixApiCost","timePassed","confidence","dataMap","serv","timesGrown","host","offlineRunningTime","offlineExpGained","timesWeakened","findRunningScriptByPid","DefaultConstructorParams","isPlayerEmployed","isMegacorp","hasAgentPositions","hasBusinessConsultantPositions","hasBusinessPositions","hasEmployeePositions","hasITPositions","hasSecurityPositions","hasSoftwareConsultantPositions","hasSoftwarePositions","hasWaiterPositions","HashUpgradesMetadata","HashUpgrade","GangMemberTasks","gangMemberTasksMetadata","GangMemberTask","isHacking","isCombat","materials","updateMaterialSizeUsed","matName","getStorageMultiplier","CalculateShareMult","opts","suppressDialog","totalPrice","origTotal","newTotal","rerenderFn","resultTxt","gains","netProfit","origCost","Output","formatTime","RawOutput","raw","Link","dashes","TTimer","timeLeft","ConfirmationModal","confirmationText","onConfirm","additionalButton","createProgressBarText","derived","totalTicks","bars","hash","__COMMIT_HASH__","globalModuleSequenceNumber","Script","otherScripts","moduleSequenceNumber","saveScript","formatCode","dependent","dependents","dependentScript","calculateRamUsage","ramUsageEntries","imports","vals","DarkWebItems","BruteSSHProgram","DarkWebItem","FTPCrackProgram","RelaySMTPProgram","HTTPWormProgram","SQLInjectProgram","ServerProfiler","DeepscanV1","DeepscanV2","AutolinkProgram","AutoLink","FormulasProgram","Formulas","actionNames","actionName","Action","Suit","Card","suit","formatValue","isRedSuit","Hearts","Diamonds","getStringRepresentation","SourceFile","bitnodeKey","bitnode","MathJaxWrapper","version","src","lineNumber","CorporationUnlockUpgradeIndex","CorporationUnlockUpgrades","Export","SmartSupply","MarketResearchDemand","MarketDataCompetition","VeChain","ShadyAccounting","GovernmentPartnership","WarehouseAPI","OfficeAPI","getGraftingAvailableAugs","calculateGraftingTimeWithBonus","OperationTyphoon","OperationZero","OperationX","OperationTitan","OperationAres","OperationArchangel","OperationJuggernaut","OperationRedDragon","OperationK","OperationDeckard","OperationTyrell","OperationWallace","OperationShoulderOfOrion","OperationHyron","OperationMorpheus","OperationIonStorm","OperationAnnihilus","OperationUltron","OperationCenturion","OperationVindictus","ActiveFragment","highestCharge","numCharge","collide","other","thisFragment","otherFragment","dx","dy","fragSize","worldX","worldY","commit","div","successRate","wrapFunction","helpers","wrappedAPI","functionPath","ctx","makeRuntimeErrorMsg","function","helper","argName","boolean","checkSingularityAccess","getValidPort","safetyEnabled","branch","getNestedProperty","updateDynamicRam","writable","wrapAPI","getOwnPropertyNames","setNestedProperty","researchMetadata","GameOptionsTab","HashRate","Message","ApplyToJobButton","getJobRequirementTooltip","initElectron","normalizeFileName","getFiles","deleteFile","removeFile","saveFile","Buffer","overwritten","writeToScriptFile","initWebserver","funcs","typesFn","appNotifier","initAppNotifier","triggerSave","triggerGameExport","ERROR","triggerScriptsExport","exportScripts","getSaveData","getSaveInfo","getImportDataFromString","pushSaveData","appSaveFns","initSaveFunctions","bridge","electronBridge","receive","send","initElectronBridge","pushGameReady","playtime","game","pushImportResult","wasImported","pushDisableRestore","achievementData","bitNodeFinishedState","wd","hasAccessToSF","knowsAboutBitverse","Icon","Condition","THE_BLACK_HAND","THE_COVENANT","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","GymStrength","GymDefense","GymDexterity","GymAgility","TOR","hasTorRouter","HOSPITALIZED","hospitalization","GANG","FULL_GANG","members","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","StaneksGift1","DEVMENU","RAINBOW","TRUE_RECURSION","playerAchievements","missingAchievements","flatMap","Intelligence","useTheme","colSpan","WorkInProgressOverview","onClickFocus","header","workCell","workHeader","pt","pb","workSubtitles","mt","details","innerText","textAlign","CharacterOverview","killOpen","setKillOpen","hackingProgress","strengthProgress","defenseProgress","dexterityProgress","agilityProgress","charismaProgress","borderTop","flex","aria-label","midpoint","program","description","BadRNG","WHRNG","s1","s2","s3","genSeed","Favor","Person","crimeKey","currentTask","finishTask","resetTaskStatus","gainRatesForTask","currentTaskLocation","currentTaskMaxTime","currentTaskTime","successGainRates","keysForIteration","gainExperience","bb","bbContract","bbRetValue","fromOtherSleeve","multFac","pHackExp","pStrExp","pDefExp","pDexExp","pAgiExp","pChaExp","pIntExp","earningsForPlayer","earningsForTask","earningsForSleeves","getMemoryUpgradeCost","memory","currCost","currMemory","getRepGain","getFactionHackingWorkRepGain","installAugmentation","updateStatLevels","cyclesUsed","Class","Gym","updateTaskGainRates","Synchro","retVal","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","getBladeburnerActionTime","recruitmentSuccessChance","contractGainRates","contractSuccessChance","chances","RamCalculationErrorCode","TerminalEvents","TerminalClearEvents","orderType","refs","orderBook","executeOrder","isBuy","predefined","getPredefinedThemes","AlertManager","alerts","setAlerts","sha256","getMessageHash","overflowWrap","getRandomByte","getDB","indexedDB","indexedDbRequest","onupgradeneeded","createObjectStore","onerror","ev","onsuccess","db","transaction","objectStore","request","put","deleteGame","sendMessage","forced","showMessage","recvd","addMessageToServer","Messages","checkForMessagesToSend","jumper0","MessageFilenames","Jumper0","jumper1","Jumper1","jumper2","Jumper2","jumper3","Jumper3","jumper4","Jumper4","cybersecTest","CyberSecTest","nitesecTest","NiteSecTest","bitrunnersTest","BitRunnersTest","truthGazer","TruthGazer","redpill","RedPill","worldDaemon","flightName","Flight","canGetBonus","setLastExportBonus","unixTime","Option","buttonText","infoText","getTeamSuccessBonus","inst","getActionTypeSkillSuccessBonus","MightOfAres","WisdomOfAthena","ChaosOfDionysus","BeautyOfAphrodite","TrickeryOfHermes","FloodOfPoseidon","HuntOfArtemis","KnowledgeOfApollo","HemoRecirculator","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","NuoptimalInjectorImplant","SpeechEnhancement","FocusWire","PCDNI","PCDNIOptimizer","PCDNINeuralNetwork","ADRPheromone1","ADRPheromone2","ShadowsSimulacrum","HacknetNodeCPUUpload","HacknetNodeCacheUpload","HacknetNodeNICUpload","HacknetNodeKernelDNI","HacknetNodeCoreDNI","Neurotrainer1","Neurotrainer2","Neurotrainer3","Hypersight","LuminCloaking1","LuminCloaking2","SmartSonar","PowerRecirculator","QLink","SPTN97","HiveMind","CordiARCReactor","SmartJaw","Neotra","Xanipher","HydroflameLeftArm","nextSENS","OmniTekInfoLoad","PhotosyntheticCells","Neurolink","CRTX42AA","Neuregen","CashRoot","NutriGen","PCMatrix","INFRARet","DermaForce","GrapheneBrachiBlades","BrachiBlades","GrapheneBionicArms","BionicArms","SNA","EsperEyewear","EMS4Recombination","OrionShoulder","HyperionV1","HyperionV2","GolemSerum","VangelisVirus","VangelisVirus3","INTERLINKED","BladeRunner","BladeArmor","BladeArmorPowerCells","BladeArmorEnergyShielding","BladeArmorUnibeam","BladeArmorOmnibeam","BladeArmorIPU","StaneksGift2","StaneksGift3","donationBonus","randomBonuses","bonuses","randomNumber","getRandomBonus","UnstableCircadianModulatorParams","UnstableCircadianModulator","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","checkEnum","enumVariable","StartButton","fmt","FactionInfo","keep","keepOnInstall","assignment","getUpgrade","getUpgradeCost","newCap","problemType","getRandomProblemType","getRandomReward","randServer","getRandomServer","contractFn","getRandomFilename","addContract","generateRandomContractOnHome","generateContract","problemTypes","rewardType","factionsThatAllowHacking","sanitizeRewardType","numFactions","randFaction","allJobs","randIndex","found","findCrime","roughName","atCapacity","marketCycles","emp","hireRandomEmployee","calculateTotalEmployees","maxEne","maxHap","maxMor","perfMult","hasAutobrew","hasAutoparty","salaryPaid","mor","hap","ene","calculateEmployeeProductivity","employeeJobs","employeeProd","prod","calculateProductivity","getElementById","cre","sal","Employee","creativity","efficiency","salary","assignEmployeeToJob","unassignEmployeeFromJob","setEmployeeToJob","amount","jobCount","CorporationUpgradeIndex","CorporationUpgrades","SmartFactories","benefit","SmartStorage","DreamSense","WilsonAnalytics","NuoptimalNootropicInjectorImplants","SpeechProcessorImplants","NeuralAccelerators","FocusWires","ABCSalesBots","ProjectInsight","validator","paramValidator","calculateSellInformationCashReward","levelBonus","calculateTradeInformationRepReward","calculateInfiltratorsRepReward","startingSecurityLevel","infiltrationData","sanitizedSource","comprGenChar","comprLZGenerate","plain","comprLZEncode","cur_state","fill","new_state","new_offset","tmp_state","len","comprLZDecode","compr","literal_length","backref_length","backref_offset","StatsProgressBar","remaining","StatsProgressOverviewCell","characterOverviewStyles","paddingBottom","canAccessGang","isAwareOfGang","getGangFaction","startGang","oldhp","PromptEvent","PromptManager","setPrompt","PromptMenuText","PromptMenuSelect","PromptContent","PromptMenuBoolean","paddingTop","submit","autoFocus","onInput","stopPropagation","ENTER","preventDefault","choices","getItems","createCityMap","demand","competition","quality","per","performance","dur","durability","rel","reliability","aes","aesthetics","fea","features","siz","reqMats","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","prodMats","ProgramsSeen","ProgramsRoot","getHackingLevelRemaining","disableGutters","gridTemplateColumns","curCompletion","getProgCompletion","Paper","flexWrap","mr","InvitationsSeen","WorkTypesOffered","FactionElement","facInfo","joined","gap","openFaction","openFactionAugPage","acceptInvitation","ml","justifyItems","gridAutoFlow","FactionsRoot","allJoinedFactions","invitations","breakpoints","down","gridTemplateRows","gridAutoRows","ProgressBar","withStyles","bar","transition","LinearProgress","destroyedBitNode","newBitNode","bitNodeNumber","sourceFileKey","sourceFile","alreadyOwned","ownedSourceFile","playerSrcFile","PlayerOwnedSourceFile","giveSourceFile","ActivateRecoveryMode","RecoveryRoot","errorData","resetError","issueUrl","newIssueUrl","startIcon","onTriggered","px","multiline","fullWidth","sharePower","StartSharing","CSM","nsFuncsGenerator","sanitizedPid","Environment","getScriptOnServer","shouldLog","CorporationState","numUnlockUpgrades","upgradeMultipliers","addFunds","getState","gameCycles","issueNewSharesCooldown","avgProfit","cycleProfit","retainedEarnings","getDividends","updateSharePrice","nextState","dividendsPerShare","dividends","determineValuation","getTargetSharePrice","targetPrice","immediatelyUpdateSharePrice","sharesTracker","sharesUntilUpdate","sharesSold","maxIterations","convertCooldownToString","cd","upgN","dividendTaxPercentage","upgradeAmt","getProductionMultiplier","getDreamSenseGain","getAdvertisingMultiplier","getEmployeeCreMultiplier","getEmployeeChaMultiplier","getEmployeeIntMultiplier","getEmployeeEffMultiplier","getSalesMultiplier","getScientificResearchMultiplier","getStarterGuide","hasHandbook","handbookFn","showLiterature","popEst","locations","OptionsSlider","initialValue","_evt","newValue","onChangeCommitted","callback","valueLabelDisplay","marks","TickerDisplayMode","DisplayModeButton","tickerDisplayMode","Portfolio","changeDisplayMode","StockTickersConfig","changeWatchlistFilter","maintainMembership","finishAction","penalty","hack_asc_points","str_asc_points","def_asc_points","dex_asc_points","agi_asc_points","cha_asc_points","resetPidCounter","setMaxRam","sum","EPSILON","decay","getSuccessChance","baseTime","skillFac","effDexterity","statFac","est","clamp","real","low","high","competence","playerStatLvl","effMultiplier","getSuccessesNeededForNextLevel","baseSuccessesPerLevel","recentScripts","killedTime","unshift","timeOfDeath","frames","Apr1Events","Apr1","getMonth","getDate","isApr1","setN","allow","currentCity","onTravel","WorldMap","SuccessChance","estimatedSuccessChance","StaticModal","char","CorruptableText","setContent","counter","timers","letter","randFrom","randomize","timerId","litObj","Literatures","checkIfConnectedToDarkweb","listAllDarkwebItems","item","printRaw","buyDarkwebItem","itemName","pushProgram","buyAllDarkwebItems","itemsToBuy","baseCheck","netscriptCanHack","initialCheck","netscriptCanGrow","netscriptCanWeaken","calculateRawDiff","startingDifficulty","calculateReward","GraftableAugmentation","antiLog","ReputationRate","isNumber","ParseCommands","allCommands","flat","ParseCommand","inQuote","prevChar","escaped","DOUBLE_QUOTE","QUOTE","CinematicText","setI","done","setDone","lines","onDone","newI","auto","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","commonVisitors","Identifier","DoWhileStatement","ForStatement","update","IfStatement","consequent","alternate","MemberExpression","importModuleName","spec","imported","codeCopy","decimal","pidCounter","tempCounter","MAX_SAFE_INTEGER","ramCost","dynamicLoadedFns","dynamicRamUsage","safeGetServer","callingFnName","scriptArgs","getRunningScriptByPid","createPublicRunningScript","offlineMoneyMade","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","funcName","iport","extra","NetscriptExtra","formulas","NetscriptFormulas","NetscriptGang","NetscriptSleeve","NetscriptHacknet","NetscriptBladeburner","NetscriptCodingContract","NetscriptInfiltration","NetscriptStanek","NetscriptCorporation","NetscriptSingularity","stockmarket","NetscriptStockMarket","NetscriptUserInterface","NetscriptGrafting","_hostname","_hackAmount","hackAmount","_threads","_time","growTime","moneyBefore","moneyAfter","logGrowPercent","influenceStockThroughServerGrow","_growth","_cores","maxThreadsNeeded","weakenTime","end","_format","tprintf","_fn","possibleLogs","arguments","closeTail","_pid","openPortCount","sshPortOpen","ftpPortOpen","smtpPortOpen","httpPortOpen","sqlPortOpen","_scriptname","scriptServer","spawnDelay","killByPid","_safetyguard","safetyguard","scriptsKilled","_hostname1","hostname2","hostname1","destServer","currServ","txtFile","newFile","sourceScript","oldScript","newScript","_grep","grep","allFiles","processes","speed","production","purchaseCost","coreCost","levelCost","_filename","_ram","_name","hostnameStr","_port","_mode","tryWrite","_file","clearPort","status","suc","_n","_milliseconds","_milliPrecision","milliseconds","milliPrecision","alert","_message","_variant","_txt","_url","_target","$","writeToTextFile","fail","tor","inBladeburner","hasCorporation","_host","_source","_destination","source_is_txt","dest_is_txt","source_file","dest_file","flags","Flags","enums","getFunctionNames","functionNames","moneyHacked","orgName","percTotalMoneyHacked","moneyGrown","percTotalMoneyGrown","performanceMult","cyclesOfWork","compName","isHackingGang","respectGainRate","wantedGainRate","moneyGainRate","storedTerritoryAndPowerCycles","territoryClashChance","territoryWarfareEngaged","notifyMemberDeath","getPower","getTerritory","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","earnedRespect","ascend","getDiscount","discount","getAllTaskNames","taskName","repFromDonation","tooltiptext","reqRep","TerminalHelpText","TemplatedHelpTexts","HelpTexts","analyze","backdoor","cat","check","cls","cp","expr","free","help","history","lscpu","mem","nano","sudov","unalias","GameEnv","Platform","getErrorForDisplay","errorInfo","isElectron","Production","toDisplay","language","cookiesEnabled","cookieEnabled","doNotTrack","indexedDb","platform","Steam","Browser","environment","getErrorMetadata","Development","componentStack","Tracking","Retirement","Investigation","Raid","initValue","GameOptionsPage","disablePadding","uniqueId","Hand","cards","addCards","removeByIndex","StockTickerTxButton","DummyGrid","DummyGift","fragments","activeGrid","ghostGrid","getContract","contractName","removeContract","existingPartialExeIndex","findIndex","ret","CodingContractModal","setProps","setAnswer","contractType","tries","BitFlumeEvent","BitFlumeModal","terminalCommandHistory","generalMethods","augmentationMethods","canAccessBladeburner","bladeburnerMethods","startBladeburner","canAccessCorporation","corporationMethods","startCorporation","gangMethods","serverMethods","InvitationModal","opt_initFunc","sourceCode","sourceCodeLineOffset","acorn","PARSE_OPTIONS","initFunc_","paused_","polyfills_","functionCounter_","stepFunctions_","stepMatch","methodName","createScope","stripLocations_","State","stateStack","nodeConstructor","READONLY_DESCRIPTOR","configurable","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","search","newSubstr","BOOLEAN","NUMBER","numConsts","fractionDigits","toExponential","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","numServerGrowthCyclesAdjusted","findSleevePurchasableAugs","ownedAugNames","availableAugs","isAvailableForSleeve","validMults","StaneksGiftEvents","maxClearanceLevel","TechVendor","techVendorMaxRam","techVendorMinRam","University","AevumCasino","Casino","Special","NewTokyoArcade","Sector12CarmichaelSecurity","Sector12CityHall","Hospital","WorldStockExchange","ChongqingChurchOfTheMachineGod","IshimaGlitch","matchEnding","zip","JSZip","zipFiles","fileNames","fileContents","zipFn","generateAsync","FileSaver","saveAs","stealthIcon","xmlns","viewBox","killIcon","ActionLevel","isActive","canIncrease","canDecrease","Autolevel","TeamSizeButton","BlinkingCursor","setOn","StyleEditorButton","styleEditorOpen","setStyleEditorOpen","ThemeEditorButton","themeEditorOpen","setThemeEditorOpen","ThemeCollaborate","DeleteGameButton","modalOpened","setModalOpened","SoftResetButton","noConfirmation","PreReqs","ownedPreReqs","hasPreReqs","preAug","Requirement","Exclusive","PurchasableAugmentations","augNames","PurchasableAugmentation","owned","sleeveAugs","canPurchase","float","TravelAgencyRoot","setDestination","startTravel","symbolsLoaded","symbols","SetupTextEditor","populate","exclude","OpenScript","lastPosition","model","openScripts","currentScript","Root","editorRef","monacoRef","vimStatusRef","vimEditor","setVimEditor","setEditor","setFilter","searchExpanded","setSearchExpanded","setRAM","ramEntries","setRamEntries","updatingRam","setUpdatingRam","decorations","setDecorations","optionsOpen","setOptionsOpen","setOptions","insertSpaces","wordWrap","ramInfoOpen","setRamInfoOpen","setDimensions","regenerateModel","createModel","debouncedHandleResize","updateRAM","keydown","ctrlKey","metaKey","require","initVimMode","VimMode","Vim","defineEx","defineAction","_cm","nTabs","currIndex","currentTabIndex","onTabClick","nextIndex","mapCommand","context","dispose","debouncedSetRAM","useMemo","newCode","entriesDisp","scriptToSave","textFile","cleanCode","ns1","ns2","curIndex","isDisposed","setModel","setPosition","revealLineInCenter","onTabClose","closingScript","savedScriptIndex","savedScriptCode","serverScriptIndex","indexOffset","getServerCode","openScript","serverScript","handleFilterChange","handleExpandSearch","filteredOpenScripts","editorHeight","tabMaxWidth","tabTextWidth","tabIconWidth","onDragEnd","items","startIndex","endIndex","removed","reorder","droppableId","direction","provided","snapshot","innerRef","droppableProps","isDraggingOver","spellCheck","externalScript","colorProps","borderColor","iconButtonStyle","scriptTabText","serverScriptCode","dirty","draggableId","disableInteractiveElementBlocking","draggableProps","dragHandleProps","flexShrink","onTabUpdate","beforeMount","languages","registerCompletionItemProvider","provideCompletionItems","suggestions","kind","CompletionItemKind","insertText","insertTextRules","CompletionItemInsertTextRule","InsertAsSnippet","getLanguages","loader","tokenizer","libSource","typescript","javascriptDefaults","addExtraLib","typescriptDefaults","onMount","Position","loading","defaultLanguage","defaultValue","newPos","newArr","tempScript","awaitWarning","newDecorations","deltaDecorations","startLineNumber","startColumn","endLineNumber","endColumn","isWholeLine","glyphMarginClassName","glyphMarginHoverMessage","infLoop","glyphMargin","getAction","getSubdirectories","t_dir","processFile","subdir","containsFiles","dirWithTrailingSlash","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","BitnodeMultiplierDescription","BitNodeMultipliersDisplay","maxSfLevel","columnCount","columnGap","GeneralMults","SkillMults","FactionMults","AugmentationMults","HackingMults","PurchasedServersMults","StockMults","CrimeMults","InfiltrationMults","CompanyMults","GangMults","CorporationMults","BladeburnerMults","StanekMults","BNMultTable","rowsArray","rowData","_value","marginBottom","sectionName","extraSize","StnakesGiftPowerMultiplier","Cell","cellProps","onMouseEnter","Grid","randomColor","elems","newNs2Template","detectSimpleScriptGlob","globString","globDatabase","parsedGlob","glob","preGlob","postGlob","globError","globMatches","globAgainst","parseSimpleScriptGlob","commonEditor","scriptEditorRouteOptions","filesToLoadOrCreate","globSearch","isEmpty","filepath","getFilepath","fileIsNs2","isNs2","CursorPositions","saveCursor","column","HammingEncode","_data","_sumParity","_lengthOfDBits","_build","_tempcount","_temparray","_tempdata","_temp","HammingDecode","_testArray","_overallParity","_tempIndex","_tempStep","_tempData","_tempArray","_tempParity","_fixIndex","truth","automate","stop","createTreantMarkup","childrenArray","htmlClass","HTMLclass","innerHTML","findNode","setParent","chart","nodeStructure","queue","getMultiplierHelper","getProductProductionMultiplier","StanekConstants","RAMBonus","BaseSize","MaxSize","currPos","nextPosName","corpName","additionalShares","warehouseApi","OfficeApi","Engine","_lastUpdate","updateGame","expForOtherSleeves","decrementAllCounters","checkCounters","Counters","autoSaveCounter","updateSkillLevelsCounter","updateDisplays","updateDisplaysLong","updateActiveScriptsDisplay","createProgramNotifications","augmentationsNotifications","passiveFactionGrowth","mechanicProcess","contractGeneration","achievementsCounter","counterName","warningToast","warnAutosaveDisabled","adjustedCycles","startExploits","setupUncaughtPromiseHandler","timeOffline","numCyclesOffline","offlineReputation","offlineHackingIncome","offlineProductionFromHacknetNodes","hacknetProdInfo","timeOfflineString","_thisUpdate","requestAnimationFrame","LoadingScreen","setShow","loaded","setLoaded","reason","doLoad","ignoreQueued","stacks","newMultipliers","calculateEntropy","typ","invalidArgs","baseSize","charge","af","cotmg","inBonus","updateMults","effect","boost","neighboor","CalculateEffect","canPlace","rootX","rootY","newFrag","aFrag","place","findFragment","clearCharge","Void","StatsElement","EarningsElement","ServerType","All","Foreign","Owned","Purchased","ServerDropdown","isValidServer","purchased","serverType","purchase","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","gameCPS","StudyComputerScience","DataStructures","Networks","Algorithms","Leadership","TickerHeaderFormatData","longestName","longestSymbol","AchievementEntry","cssFiltersUnlocked","cssFiltersLocked","isUnlocked","mainColor","achievedOn","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","Theme","credit","screenshot","img1","reference","outputHistory","startHack","startGrow","startWeaken","startBackdoor","startAnalyze","finishHack","oldSec","newSec","finishGrow","finishWeaken","finishBackdoor","finishAnalyze","isHacknet","org","canRunScripts","hackingSkill","security","hackingChance","numPort","getProgressText","getFile","getLitFile","lit","currDir","setcwd","contractOpen","executeScanAnalyzeCommand","visited","depthQueue","newS","titleDashes","connectToServer","executeCommands","commandHistory","commandHistoryIndex","executeCommand","n00dlesServ","commandName","scananalyze","apr1","removeBracketsFromArrayString","strCpy","removeQuotesFromString","convert2DArrayToString","ans","nums","ways","maxLen","padStart","spiral","u","col","playerAns","reach","jumps","lastJump","jumpedFrom","intervals","numIntervals","interval","sanitizedResult","sanitizedAns","B","C","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","dstY","dstX","minPathLength","distanceFactor","distance","MinHeap","validPosition","neighbors","yN","xN","changeWeight","yQ","xQ","ansX","ansY","roll","dfs","pair","sanitizedPlayerAnsArr","resultInAnswer","numDigits","digitsArray","evaluated","multed","_alteredBit","_buildArray","_randomIndex","edges","shuffle","vertexShuffler","neighbourhood","vertex","adjLeft","adjRight","coloring","initialVertex","frontier","validColors","aColor","bColor","plaintext","ans_plain","run_length","compressed","BinHeap","heapifyUp","heapifyDown","predicate","heapOrderABeforeB","tmp","toSwap","weightA","weightB","requireHackingLevel","targetServer","numAugReq","ipaddress","byteRange","formattedHours","getHours","formattedMinutes","getMinutes","formattedSeconds","getSeconds","AllSoftwarePositions","AllITPositions","AllNetworkEngineerPositions","SecurityEngineerPositions","AllTechnologyPositions","AllBusinessPositions","AllAgentPositions","AllSecurityPositions","AllSoftwareConsultantPositions","AllBusinessConsultantPositions","SoftwarePositionsUpToHeadOfEngineering","SoftwarePositionsUpToLeadDeveloper","BusinessPositionsUpToOperationsManager","WaiterOnly","EmployeeOnly","PartTimeWaiterOnly","PartTimeEmployeeOnly","OperationsManagerOnly","CEOOnly","advertisingMult","employeeChaMult","employeeCreMult","employeeEffMult","employeeIntMult","productionMult","productProductionMult","salesMult","sciResearchMult","storageMult","effectText","costPerLevel","hasTargetServer","lookup","checkGangApiAccess","getGangMember","_faction","wantedLevelGainRate","wantedPenalty","cpy","_memberName","memberName","hack_exp","str_exp","def_exp","dex_exp","agi_exp","cha_exp","hack_mult","str_mult","def_mult","dex_mult","agi_mult","cha_mult","hack_asc_mult","str_asc_mult","def_asc_mult","dex_asc_mult","agi_asc_mult","cha_asc_mult","respectGain","wantedLevelGain","recruited","tasks","_taskName","assignToTask","getGangTask","_equipName","equipName","equipment","typecheck","buyUpgrade","canAscend","getAscensionResults","_engage","engage","_otherGang","playerPower","unassignFromTask","difficultyPerCycles","getGainedAscensionPoints","getCurrentAscensionMults","getAscensionMultsAfterAscend","postAscend","preAscend","applyUpgrade","respectToDeduct","createDescription","checkSleeveAPIAccess","checkSleeveNumber","sleeveNumber","sl","_sleeveNumber","_crimeRoughName","crimeRoughName","_universityName","_className","_cityName","acompanyName","_factionName","_workType","_gymName","_stat","jobTitle","maxHp","agilityExp","charismaExp","companyRep","crimeMoney","crimeSuccess","defenseExp","dexterityExp","factionRep","hackingExp","strengthExp","workMoney","workHackExpGain","workStrExpGain","workDefExpGain","workDexExpGain","workAgiExpGain","workChaExpGain","workMoneyGain","workRepGain","purchasableAugs","_augName","_action","_contract","openDevMenu","devMenu","bypass","doc","completely_unused_field","real_document","alterReality","recur","rainbow","guess","bcrypt","getHacknetNode","hi","_i","hasUpgraded","timeOnline","totalProduction","_upgName","_upgTarget","getHashUpgrades","getHashUpgradeLevel","checkStanekAPIAccess","_ctx","_rootX","_rootY","_rotation","_fragmentId","fragmentId","getLocationsWithInfiltrations","getPossibleLocations","getInfiltration","_location","locationName","tradeRep","sellCash","SoARep","calculateInfiltrationData","newTheme","currentTheme","errors","newStyles","currentStyles","checkBladeburnerAccess","skipjoined","apiDenied","bladeburnerDenied","checkBladeburnerCity","getBladeburnerActionObject","_blackOpName","blackOpName","_type","_level","_autoLevel","_skillName","_size","getCodingContract","returnReward","is2DArray","answerComponents","creward","hasUnlockUpgrade","upgradeName","getCorporation","hasResearched","getDivision","getOffice","getWarehouse","getMaterial","materialName","getProduct","getEmployee","employeeName","checkAccess","api","getSafeDivision","getPurchaseWarehouseCost","getUpgradeWarehouseCost","_divisionName","_amt","hasWarehouse","_materialName","sll","_productName","pCost","cityData","developmentProgress","purchaseWarehouse","upgradeWarehouse","sellMaterial","_price","sellProduct","_all","discontinueProduct","setSmartSupply","_enabled","enabled","setSmartSupplyUseLeftovers","buyMaterial","bulkPurchase","makeProduct","_designInvest","_marketingInvest","limitProductProduction","_qty","exportMaterial","_sourceDivision","_sourceCity","_targetDivision","_targetCity","sourceDivision","targetDivision","targetCity","cancelExportMaterial","limitMaterialProduction","setMaterialMarketTA1","_on","setMaterialMarketTA2","setProductMarketTA1","setProductMarketTA2","getHireAdVertCost","getHireAdVertCount","getResearchCost","_researchName","setAutoJobAssignment","_job","_amount","getOfficeSizeUpgradeCost","assignJob","_employeeName","hireEmployee","upgradeOfficeSize","_costPerEmployee","buyCoffee","hireAdVert","minEne","minHap","expandIndustry","_industryName","industryName","expandCity","unlockUpgrade","_upgradeName","levelUpgrade","issueDividends","_percent","createCorporation","_corporationName","_selfFund","corporationName","selfFund","getUnlockUpgradeCost","getUpgradeLevel","getUpgradeLevelCost","getExpandIndustryCost","getExpandCityCost","getInvestmentOffer","fundingRound","percShares","acceptInvestmentOffer","funding","investShares","goPublic","_numShares","initialSharePrice","sellShares","buyBackShares","bribe","_amountCash","_amountShares","amountCash","amountShares","startingCost","reFac","robFac","aiFac","advFac","hwFac","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","reqMatName","normQty","producableFrac","reqMatQtyNeeded","fooProd","fooI","businessFactor","getBusinessFactor","advertisingFactor","getAdvertisingFactors","marketFactor","getMarketFactor","markupLimit","numerator","sqrtNumerator","sqrtDenominator","denominator","sqrt","optimalPrice","marketTa2Price","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","calculateFavorToRep","_favor","calculateRepToFavor","_rep","_exp","_mult","_skill","hackPercent","growPercent","hackTime","levelUpgradeCost","_startingLevel","_extraLevels","_costMult","ramUpgradeCost","_startingRam","coreUpgradeCost","_startingCore","_extraCores","extraCores","hacknetNodeCost","constants","hacknetServers","hashGainRate","_ramUsed","_maxRam","HScalculateHashGainRate","HScalculateLevelUpgradeCost","HScalculateRamUpgradeCost","HScalculateCoreUpgradeCost","cacheUpgradeCost","_startingCache","_extraCache","extraCache","HScalculateCacheUpgradeCost","hashUpgradeCost","hacknetServerCost","HScalculateServerCost","ascensionPointsGain","ascensionMultiplier","_points","checkTixApiAccess","getStockFromSymbol","_symbol","_shares","_posType","sanitizedPosType","_pos","orderPos","ltype","lpos","stockMarketOrders","forecast","checkGraftingAPIAccess","graftableAug","_focus","wasFocusing","craftableAug","detect","hasChanges","orig","fl","backups","textfield","Language","InteractiveTutorialRoot","nsSelectionOpen","setNSSelectionOpen","setLanguage","tutorialScriptName","NS1","contents","canNext","square","tab","updateOptions","readOnly","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","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","getAvailableCreatePrograms","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","E","H","R","P","F","U","G","anchor","timeout","unmountOnExit","clsx","badgeContent","NeuroFluxDisplay","EntropyDisplay","AugmentationsRoot","installOpen","setInstallOpen","InstalledAugmentations","sourceAugs","selectedAug","setSelectedAug","Alphabetically","aug1","aug2","BitNodeModifiedStats","MultiplierList","listItems","augmented","bnMult","py","disableTypography","PlayerMultipliers","augP","augObj","calculateAugmentedStats","leftColData","rightColData","PurchasedAugmentations","displayName","enterNextDelay","safeGetSf","sfNum","sfObj","getMaxLevel","SourceFilesElement","sourceSfs","sf1","sf2","selectedSf","setSelectedSf","DevMenuRoot","General","setError","setCorporationName","gangFaction","setGangFaction","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","modifyCorporationFunds","modifyCorporationCycles","CodingContracts","setCodingcontract","cc","stockPrice","setStockPrice","setStockSymbol","processStocks","inputSymbols","SM","stocks","sleeveSetStoredCycles","Stanek","modCycles","modCharge","TimeSkip","timeskip","playerAchievement","setPlayerAchievements","achieved","grantAchievement","removeAchievement","Entropy","BladeburnerRoot","travelOpen","setTravelOpen","inFaction","wordBreak","TravelModal","nopadding","preformatted","Line","Console","setCommand","consoleInput","consoleHistoryIndex","setConsoleHistoryIndex","Logs","tabIndex","inputRef","prevCommand","currentTarget","scrollHook","scrollTop","scrollHeight","AllPages","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","ascendOnly","setAscendOnly","onRecruit","GangMemberCard","GangMemberCardContent","ascendOpen","setAscendOpen","borderRightWidth","onAscend","borderLeftWidth","onTaskChange","GangMemberStats","asc","KillScriptsModal","TaskSelector","setCurrentTask","contextMember","TaskDescription","AscensionModal","RecruitButton","RecruitModal","setName","recruit","onKeyUp","TerritorySubpage","gangNames","infoOpen","setInfoOpen","formatTerritory","OtherGangTerritory","clashVictoryChance","TerritoryInfoModal","NextReveal","PurchasedUpgrade","UpgradeButton","GangMemberUpgradePanel","currentCategory","setCurrentCategory","filterUpgrades","weaponUpgrades","armorUpgrades","vehicleUpgrades","rootkitUpgrades","augUpgrades","categories","Weapons","Vehicles","Rootkits","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","retainHeight","WarehouseRoot","smartSupplyOpen","setSmartSupplyOpen","canAffordUpgrade","stateText","mats","isInStock","isRelevant","breakdownItems","breakdown","previous","IndustryWarehouse","EmptyWarehouse","Leftover","setChecked","SmartSupplyModal","ProductElem","sellOpen","setSellOpen","limitOpen","setLimitOpen","discontinueOpen","setDiscontinueOpen","cancelOpen","setCancelOpen","marketTaOpen","setMarketTaOpen","nfB","hasUpgradeDashboard","sellButtonText","limitProductionButtonText","DiscontinueProductModal","LimitProductProductionModal","setLimit","SellProductModal","iQty","setQty","setPx","initialPrice","MarketTA2","ProductMarketTaModal","CancelProductModal","MaterialElem","purchaseMaterialOpen","setPurchaseMaterialOpen","exportOpen","setExportOpen","sellMaterialOpen","setSellMaterialOpen","materialMarketTaOpen","setMaterialMarketTaOpen","limitProductionOpen","setLimitProductionOpen","tutorial","purchaseButtonText","limitMaterialButtonText","disablePurchaseLimit","ExportModal","possibleDivisions","defaultDivision","setIndustry","setAmt","removeExport","currentDivision","possibleCities","newCost","setNewCost","MaterialMarketTaModal","SellMaterialModal","setPrice","BulkPurchaseSection","setBuyAmt","setDisabled","BulkPurchaseText","parsedAmt","PurchaseMaterialModal","purchaseMaterial","LimitMaterialProductionModal","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","xs","UU","BribeFactionModal","setStock","selectedFaction","setSelectedFaction","getRepText","SellSharesModal","setShares","ProfitIndicator","BuybackSharesModal","CostIndicator","IssueDividendsModal","setPercent","canIssue","maxNewSharesUnrounded","maxNewShares","newShares","IssueNewSharesModal","issueNewShares","privateShares","FindInvestorsModal","GoPublicModal","InfiltrationRoot","setStart","StartingDifficulty","Difficulty","Reward","cancel","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","words","makeAnswer","setGuess","hasAugment","BACKSPACE","shiftKey","ignorableKeyboardEvent","nextGuess","setRight","OPEN_BRACKET","LESS_THAN","OPEN_PARENTHESIS","OPEN_BRACE","generateLeftSide","CLOSE_PARENTHESIS","CLOSE_BRACKET","CLOSE_BRACE","GREATER_THAN","getChar","positive","option","negative","shuffleArray","makeChoices","correctIndex","setCorrectIndex","setIndex","currentChoice","choice","defaultColor","disabledColor","upColor","downColor","choiceColor","upIndex","upDistance","downIndex","downDistance","onCorrectIndex","newIndex","arrows","arrow","generateCode","puzzle","randChar","generatePuzzle","answers","generateAnswers","currentAnswerIndex","setCurrentAnswerIndex","setPos","flatGrid","isCorrectAnswer","optionColor","move","mines","minefield","field","generateEmptyField","generateMinefield","memoryPhase","setMemoryPhase","flagged","marked","fieldEquals","phase","setPhase","phaseZeroTime","timeUntilAttacking","Victory","quitInfiltration","handleInfiltrators","soa","infiltrationRepGain","isMemberOfInfiltrators","wiresmin","wiresmax","PIPE","DOT","FORWARD_SLASH","HYPHEN","HASH","colorNames","blue","wires","numWires","wireColors","generateWires","cutWires","setCutWires","questions","numQuestions","questionGenerators","randomPositionQuestion","randomColorQuestion","generateQuestion","checkWire","wireNum","shouldCut","wiresToBeCut","shouldBeCut","question","isCorrectWire","wire","wireColor","cutColor","arrowPart","Intro","GraftableAugmentations","canGraft","AugPreReqsChecklist","GraftingRoot","graftOpen","setGraftOpen","selectedAugmentation","switchSortOrder","newOrder","Cost","getAugsSorted","CYCLES_PER_SEC","WorkInProgressRoot","expGains","workInfo","unfocus","buttons","stopText","elapsed","stopTooltip","completion","tooltipInfo","GameOptionsRoot","currentTab","setCurrentTab","SYSTEM","setTab","CurrentOptionsPage","execTime","setExecTime","recentScriptsSize","setRecentScriptsSize","logSize","setLogSize","portSize","setPortSize","terminalSize","setTerminalSize","autosaveInterval","setAutosaveInterval","timestampFormat","setTimestampFormat","setLocale","INTERFACE","GAMEPLAY","MISC","SideBarTab","sideBarProps","tabName","GameOptionsSidebar","importInput","diagnosticOpen","setDiagnosticOpen","importSaveOpen","setImportSaveOpen","importData","setImportData","gridTemplateAreas","gridArea","File","FileList","ii","ex","confirmedImportGame","method","alt","ServerAccordion","FileDiagnosticModal","FontFamilyField","refreshId","errorText","setErrorText","setFontFamily","LineHeightField","setLineHeight","StyleEditorModal","setRefreshId","customStyle","setCustomStyle","persistToSettings","endIcon","ColorEditor","onColorChange","hideTextfield","deferred","newColor","disableAlpha","ThemeEditorModal","customTheme","setCustomTheme","setTemplateTheme","placement","maxRows","importedTheme","SleeveRoot","FAQOpen","setFAQOpen","SleeveElem","statsOpen","setStatsOpen","earningsOpen","setEarningsOpen","augmentationsOpen","setAugmentationsOpen","abc","setABC","doing","MoreEarningsModal","MoreStatsModal","SleeveAugmentationsModal","_showModal","PurchaseAugmentationModal","universitySelectorOptions","gymSelectorOptions","bladeburnerSelectorOptions","possibleJobs","forbiddenCompanies","otherSleeve","possibleFactions","forbiddenFactions","factionObj","second","universities","gyms","possibleContracts","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","base_increase","modded_increase","upgradeCacheCost","HashUpgradeModal","serversMap","HacknetUpgradeElem","selectedServer","setSelectedServer","MultiplierButton","MultiplierButtons","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","handleGrafting","CreateCorporation","handleCotMG","renderBladeburner","toStanek","renderCotMG","CreateCorporationModal","canSelfFund","n00dlePower","ArcadeRoot","Megabyteburner2000","currentGame","BBCabinetRoot","origin","joystick","borderStyle","borderWidth","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","drawCard","CoinFlip","investment","setInvestment","setResult","setStatus","playLock","setPlayLock","play","correct","redNumbers","strategies","Red","payout","Black","Odd","Even","High","Low","Third1","Third2","Third3","Single","canPlay","setCanPlay","lock","setLock","strategy","playerWin","isRed","currentNumber","getPayout","payLines","SlotMachine","locks","setLocks","stoppedOne","getPaylineData","payline","point","countSequence","checkWinnings","getTable","LocationLetter","ASCIICity","locationLettersRegex","letterMap","K","M","N","Q","V","Y","lineElems","startI","endI","locationI","ListCity","locationButtons","LocationCity","OptionsModal","setInsertSpaces","setFontSize","setWordWrap","setVim","themePath","themeCopy","setThemeCopy","MilestonesRoot","milestones","highestMilestone","milestone","ActionTimer","paragraph","TerminalRoot","setKey","doScroll","hook","scrollIntoView","lineClass","ansiCodeStyle","COLOR_MAP_BRIGHT","1","2","3","4","5","6","7","COLOR_MAP_DARK","codeParts","nextStyleKey","codePart","ir","ig","ib","grey","ansi2rgb","textDecoration","debounced","maxWait","unsubscribe","scrollId","parts","ANSI_ESCAPE","groups","matchAll","stopIndex","partText","part","spanStyle","parseOutputText","TerminalInput","terminalInput","postUpdateValue","setPostUpdateValue","possibilities","setPossibilities","saveValue","postUpdate","modifyInput","mod","inputLength","selectionStart","inputText","delStart","moveTextCursor","keyDown","autoComplete","onBlur","TAB","semiColonIndex","allPos","determineAllPossibilitiesForTabCompletion","tabCompletion","selectionEnd","anchorEl","parentDirPath","evaledParentDirPath","addAllCodingContracts","cct","addAllLitFiles","addAllPrograms","addAllScripts","processFilepath","addAllTextFiles","addAllDirectories","subdirs","t_parentDirPath","convertParentPath","isCommand","cmd","t_cmd","autocomplete","runArgs","permissive","flagFunc","autocompleteData","txts","schema","pos2","scriptAutocomplete","addAllMessages","allPossibilities","oldValue","longestStartSubstr","TutorialRoot","confirmResetOpen","setConfirmResetOpen","ActiveScriptsRoot","ScriptProduction","prodRateSinceLastAug","ServerAccordions","setRowsPerPage","serverToScriptMap","filtered","rowsPerPageOptions","newPage","onRowsPerPageChange","ActionsComponent","paddedName","barOptions","headerTxt","ServerAccordionContent","noborder","WorkerScriptAccordion","killScript","onlineMps","onlineEps","RecentScriptsPage","recentScript","RecentScriptAccordion","MainPage","onAugmentations","sleevesOpen","setSleevesOpen","isPlayersGang","favorToDonate","canDonate","canPurchaseSleeves","startHackingContracts","startFieldWork","startSecurityWork","FactionRoot","purchasingAugs","setPurchasingAugs","routeToMainPage","AugmentationsPage","getAugs","augName1","augName2","getAugsSortedByCost","getAugsSortedByReputation","Purchasable","canBuy","hasReq","hasRep","cantBuy","getAugsSortedByPurchasable","purchasable","multiplierComponent","costs","showModal","DonateOption","donateAmt","setDonateAmt","Status","noformat","DefaultAssignment","Info","Assignment","CovenantPurchasesRoot","setUpdate","purchaseDisabled","upgradePanels","CovenantSleeveMemoryUpgrade","maxMemory","purchaseBtnDisabled","purchaseBtnContent","calculateStat","srcFile","sourceFileObject","incMult","decMult","GangButton","gangOpen","setGangOpen","CreateGangModal","EmployersModal","MultiplierTable","noMargin","effValue","CurrentBitNode","MoneyModal","convertMoneySourceTrackerToString","CharacterStats","moneyOpen","setMoneyOpen","employersOpen","setEmployersOpen","timeRows","showBitNodeMults","isEqual","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","portal","level0","level1","level2","level3","BitNodePortal","portalOpen","setPortalOpen","cssClass","aria-description","BitverseRoot","destroyed","destroySequence","setDestroySequence","nextSourceFileLvl","PortalModal","bitNodeKey","maxSourceFileLevel","newLevel","CinematicLine","setLength","ms","newLength","advance","StaneksGiftRoot","MainBoard","setGrid","setGhostGrid","setRotation","selectedFragment","setSelectedFragment","moveGhost","clickAt","deleteAt","doRotate","selectFragment","FragmentInspector","setC","effectAmt","FragmentOption","colorAt","FragmentSelector","FragmentPreview","ActiveFragmentSummary","summary","coordinate","formatEffect","_width","_height","getComputedStyle","Element","visibility","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","getAugmentation","getFaction","getCompany","runAfterReset","cbScript","_purchased","_facName","_cbScript","_locationName","_programName","baseserver","installTime","jobTitles","_companyName","wasFocused","_field","repNeededToDonate","_nextBN","_callbackScript","nextBN","callbackScript","hackingRequirements","empty","multipliers","normalServer","relative_filename","evaledDir","t_dst","dst","srcExt","tRes","sRes","sanitizedExpr","used","avail","usedPercent","incorrectUsage","newPath","allPrograms","allScripts","allTextFiles","allContracts","allMessages","folders","handleFn","dest","parsedFn","firstParentDir","msgOrLit","ClickableScriptRow","scriptLinksWrap","scriptLink","textDecorationLine","paddingRight","rowSplitArray","rowItem","onScriptLinkClick","ClickableMessageRow","linksWrap","link","onMessageLinkClick","FileType","postSegments","segments","linked","filesPerRow","Folder","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,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,OAAQgB,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BX,EAAgBY,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOpB,IAAK,GAC5Be,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,E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,EAAK,KAAOD,EAAU,IAAMC,EAAK,KAAOD,EAAU,KAC3ED,EAAMz5E,KAAK05E,GAGb,OAAOD,EAGTG,OACE,OAAOj6E,OAAO2L,OAAO,GAAIrH,OAItB,SAAS41E,EAAazU,GAC3B,IAAK,MAAM0U,KAAYpB,EACrB,GAAIoB,EAAS1U,KAAOA,EAAI,OAAO0U,EAEjC,OAAO,MAGT,WACE,MAAMC,GAAI,EACJC,GAAI,EACVtB,EAAU14E,KACR,IAAI24E,EACF,EACAsB,IAAOC,EACPnvB,IAAa3d,QACb,EACA,IAGJsrC,EAAU14E,KACR,IAAI24E,EACF,EACAsB,IAAOE,EACPpvB,IAAa3d,QACb,EACA,IAGJsrC,EAAU14E,KACR,IAAI24E,EACF,EACAsB,IAAOG,EACPrvB,IAAaI,aACb,IACA,IAIJutB,EAAU14E,KACR,IAAI24E,EACF,EACAsB,IAAOI,EACPtvB,IAAaK,aACb,EACA,IAGJstB,EAAU14E,KACR,IAAI24E,EACF,EACAsB,IAAOK,EACPvvB,IAAaM,YACb,GACA,IAGJqtB,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAOG,EACPrvB,IAAaO,SACb,EACA,IAGJotB,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAO/lE,EACP62C,IAAaQ,QACb,EACA,IAGJmtB,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAO/lE,EACP62C,IAAaS,UACb,EACA,IAGJktB,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAOC,EACPnvB,IAAaU,QACb,EACA,IAGJitB,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAOC,EACPnvB,IAAaW,SACb,EACA,IAGJgtB,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAOI,EACPtvB,IAAaY,aACb,EACA,IAGJ+sB,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAOM,EACPxvB,IAAaa,YACb,EACA,IAGJ8sB,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAOK,EACPvvB,IAAac,IACb,GACA,IAGJ6sB,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAOK,EACPvvB,IAAae,UACb,GACA,IAGJ4sB,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAO/lE,EACP62C,IAAa3f,MACb,EACA,IAGJstC,EAAU14E,KACR,IAAI24E,EACF,GACAsB,IAAOC,EACPnvB,IAAagB,YACb,GACA,IAGJ2sB,EAAU14E,KACR,IAAI24E,EACF,IACA,CAEE,CAACoB,EAAGC,EAAGA,GACP,CAACA,EAAGA,EAAGD,GACP,CAACA,EAAGC,EAAGD,IAEThvB,IAAayvB,QACb,IACA,KAGJ9B,EAAU14E,KACR,IAAI24E,EACF,IACA,CAEE,CAACqB,EAAGA,EAAGA,EAAGA,GACV,CAACA,EAAGD,EAAGA,EAAGA,IAEZhvB,IAAayvB,QACb,IACA,KAGJ9B,EAAU14E,KACR,IAAI24E,EACF,IACA,CAEE,CAACoB,EAAGC,EAAGA,EAAGA,GACV,CAACA,EAAGA,EAAGD,EAAGA,IAEZhvB,IAAayvB,QACb,IACA,KAGJ9B,EAAU14E,KACR,IAAI24E,EACF,IACA,CAEE,CAACqB,EAAGA,EAAGA,EAAGD,GACV,CAACA,EAAGA,EAAGC,EAAGA,IAEZjvB,IAAayvB,QACb,IACA,KAGJ9B,EAAU14E,KACR,IAAI24E,EACF,IACA,CAEE,CAACoB,EAAGC,EAAGA,GACP,CAACD,EAAGC,EAAGD,GACP,CAACC,EAAGA,EAAGD,IAEThvB,IAAayvB,QACb,IACA,KAGJ9B,EAAU14E,KACR,IAAI24E,EACF,IACA,CAEE,CAACoB,EAAGA,EAAGC,GACP,CAACD,EAAGC,EAAGA,GACP,CAACA,EAAGA,EAAGD,IAEThvB,IAAayvB,QACb,IACA,KAGJ9B,EAAU14E,KACR,IAAI24E,EACF,IACA,CAEE,CAACqB,EAAGD,EAAGA,GACP,CAACC,EAAGA,EAAGA,GACP,CAACA,EAAGD,EAAGA,IAEThvB,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AAc,IACdT,SAAU,CACR1Z,IAAa01C,sBACb11C,IAAa61C,0BACb71C,IAAam3C,mBACbn3C,IAAa80C,IACb90C,IAAag0C,YACbh0C,IAAa6zC,SACb7zC,IAAawzC,WACbxzC,IAAa20C,mBAGjB,IAAIt7B,IAAa,CACfzb,KAAMuP,IAAkBg/G,WACxB1yG,QAAS,KACTD,UAAW,OACXD,KACE,wIAEFW,cAAe,IACfC,aAAc,IACdT,SAAU,CACR1Z,IAAa+3C,WACb/3C,IAAau3C,YACbv3C,IAAay3C,aACbz3C,IAAauhB,SACbvhB,IAAashB,OACbthB,IAAao1C,oBACbp1C,IAAa01C,sBACb11C,IAAa20C,mBAGjB,IAAIt7B,IAAa,CACfzb,KAAMuP,IAAkBi/G,WACxB3yG,QAAS,MACTD,UAAW,KACXD,KACE,iKAEFI,QAAS,CAACxM,IAAkBg/G,YAC5BjyG,cAAe,KACfC,aAAc,KACdT,SAAU,CACR1Z,IAAau3C,YACbv3C,IAAay3C,aACbz3C,IAAauhB,SACbvhB,IAAao1C,oBACbp1C,IAAa01C,sBACb11C,IAAa20C,mBAGjB,IAAIt7B,IAAa,CACfzb,KAAMuP,IAAkBk/G,WACxB5yG,QAAS,KACTD,UAAW,KACXD,KACE,uLAEFI,QAAS,CAACxM,IAAkBi/G,WAAYj/G,IAAkBg/G,YAC1DjyG,cAAe,KACfC,aAAc,KACdT,SAAU,CACR1Z,IAAau3C,YACbv3C,IAAay3C,aACbz3C,IAAao1C,oBACbp1C,IAAa01C,sBACb11C,IAAa20C,gBACb30C,IAAag0C,eAGjB,IAAI36B,IAAa,CACfzb,KAAMuP,IAAkBm/G,eACxB7yG,QAAS,MACTD,UAAW,MACXD,KACE,sKAEFW,cAAe,IACfC,aAAc,IACdT,SAAU,CACR1Z,IAAau3C,YACbv3C,IAAay3C,aACbz3C,IAAao1C,oBACbp1C,IAAa20C,gBACb30C,IAAa24C,UACb34C,IAAam3C,mBACbn3C,IAAa61C,6BAGjB,IAAIx8B,IAAa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A,4CAA2CA,kDAC3C,kBAAiBA,yEACjB,IACA,YACA,IACA,OAAMA,YACN,OAAMA,qBACN,IACA,OAAMA,WACN,OAAMA,iBACN,KAKMi/C,EAA4B,CACvCv4D,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,KAEFw4D,QAAS,CACP,iBACA,IACA,0GACA,mHACA,kHACA,gCACA,KAEFC,SAAU,CACR,kBACA,IACA,6FACA,IACA,+BACA,KAEFx1H,IAAK,CACH,iCACA,IACA,yEACA,IACA,oHACA,oDACA,IACA,+FACA,IACA,wGACA,KAEFy1H,IAAK,CACH,oBACA,IACA,6EACA,IACA,iBACA,IACA,kBACA,IACA,sBACA,KAEF5Z,GAAI,CACF,kBACA,IACA,yGACA,iFACA,IACA,yBACA,IACA,eACA,IACA,aACA,KAEF6Z,MAAO,CACL,uCACA,IACA,+HACA,uDACA,kIACA,IACA,oCACA,IACA,gGACA,IACA,sCACA,KAEF9kH,MAAO,CACL,eACA,IACA,mIACA,uIACA,KAEF+kH,IAAK,CACH,aACA,IACA,mIACA,yIACA,KAEFt0H,QAAS,CACP,4BACA,IACA,+FACA,oIACA,8GACA,KAEFu0H,GAAI,CAAC,wBAAyB,IAAK,wEAAyE,KAC5GrxE,SAAU,CACR,qCACA,IACA,mFACA,IACA,4GACA,IACA,kDACA,IACA,0CACA,IACA,0CACA,KAEFsxE,KAAM,CACJ,wCACA,IACA,oFACA,IACA,oBACA,IACA,WACA,IACA,wBACA,IACA,qFACA,KAEFC,KAAM,CACJ,cACA,IACA,gIACA,gCACA,KAEFjpH,KAAM,CACJ,cACA,IACA,6GACA,2CACA,KAEFT,KAAM,CACJ,cACA,IACA,uHACA,KAEF2pH,KAAM,CACJ,wBACA,IACA,yHACA,0HACA,mEACA,IACA,iBACA,IACA,wBACA,KAEFC,QAAS,CACP,sBACA,IACA,6GACA,KAEF/7G,KAAM,CACJ,cACA,IACA,sGACA,KAEF5wB,SAAU,CAAC,kBAAmB,IAAK,4CAA6C,KAChF+kB,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,KAEFI,GAAI,CACF,wCACA,IACA,iIACA,sDACA,IACA,8FACA,IACA,gFACA,IACA,yHACA,IACA,YACA,IACA,wEACA,IACA,2BACA,IACA,iEACA,IACA,yBACA,IACA,uFACA,IACA,oCACA,KAEFwnH,MAAO,CAAC,eAAgB,IAAK,wDAAyD,KAEtFC,IAAK,CACH,4CACA,IACA,6HACA,2HACA,gFACA,IACA,qBACA,IACA,2BACA,IACA,4HACA,iFACA,KAEFhkH,GAAI,CACF,yBACA,IACA,6FACA,6FACA,kCACA,IACA,kFACA,kBACA,aACA,IACA,qEACA,IACA,oCACA,KAEFikH,KAAMd,EAAgC,QACtC3mH,GAAI,CAAC,YAAa,IAAK,4DAA6D,KACpFsC,GAAI,CACF,mBACA,IACA,6GACA,IACA,kDACA,KAEF/C,IAAK,CACH,sDACA,IACA,gDACA,IACA,sHACA,2GACA,gEACA,2DACA,2FACA,IACA,kHACA,iFACA,KAEF9B,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,KAEFqC,IAAK,CACH,4CACA,IACA,8EACA,2GACA,oCACA,2FACA,IACA,6BACA,IACA,wCACA,KAEF4nH,MAAO,CAAC,eAAgB,IAAK,oEAAqE,KAElGhkH,KAAM,CACJ,sCACA,IACA,oHACA,uHACA,oEACA,IACA,8BACA,IACA,gFACA,IACA,+BACA,KAEFizD,IAAK,CAC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2BvoJ,KAAK4mJ,MAAO,UAAWL,GAEvDA,EAAU,SAAU4D,EAAeC,GACjC,OAAOt9F,MAAMnxD,UAAUy3D,YAAYh3D,MAAM4D,KAAK0oJ,WAAYrT,YAE5Dr1I,KAAKuoJ,2BAA2BvoJ,KAAK4mJ,MAAO,cAAeL,GAE3DA,EAAU,WAER,OADAz5F,MAAMnxD,UAAUmU,KAAKjU,KAAKmE,KAAK0oJ,YACxB1oJ,MAETA,KAAKuoJ,2BAA2BvoJ,KAAK4mJ,MAAO,OAAQL,GAEpDvmJ,KAAK0jJ,WAAW3nJ,KAGd,kDACA,8CACA,kCACA,oEACA,YACA,wBACA,4BACA,yCACA,SACA,oBACA,+DACA,OACA,IACA,eACA,IACA,MAIA,mDACA,8CACA,+BACA,wFACA,wBACA,4BACA,gBACA,+DACA,kCACA,gBACA,kBACA,mDACA,IACA,IACA,cACA,IACA,MAKA,+BACA,mDACA,+BACA,sBACA,0DACA,IACA,wBACA,4BACA,yCACA,uDACA,IACA,8BACA,aACA,oBACA,qBACA,+CACA,iBACA,IACA,OACA,IACA,oBACA,KACA,sBACA,iBACA,MACA,IAKA,oCACA,wDACA,+BACA,sBACA,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,OAC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A,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,6BCzTF,yIAmBA,MAAMF,EAKF,CACFx2G,QAAS,CAAEy2G,MAAO,IAAMjsM,IAAK,EAAG1P,IAAK,GACrCmlG,OAAQ,CAAEw2G,MAAO,IAAMjsM,IAAK,EAAG1P,IAAK,GACpColG,KAAM,CAAEu2G,MAAO,IAAMjsM,IAAK,EAAG1P,IAAK,GAClCqlG,WAAY,CAAEs2G,MAAO,KAAMjsM,IAAK,EAAG1P,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IAEf32O,IAAOg7C,YAAYgvB,IAAQK,kBAG7BssK,EAAOtoK,EACPxuE,OAAOq8D,WAAW06K,EAZN,eAmBdC,K,6BClCF,gEAIO,SAAStqE,IACd1sK,OAAO4uF,iBAAiB,sBAAsB,SAAU/oC,GACtD,GAAIymB,YAAqBzmB,EAAE2nH,QAAS,CAClC,MAAM93E,EAAiB7vC,EAAE2nH,OAAOv6J,MAAM,eAChCO,EAAWkiF,EAAe,GAC1BrB,EAAaqB,EAAe,GAC5BC,EAAWD,EAAe,GAEhC,IAAI7pB,EAAO,8DAA6DwoB,KAAc7gF,QACtFq4D,GAAO,OACPA,GAAO8pB,EACPznF,YAAgB29D,QACX,GAAIhmB,EAAE2nH,kBAAkB7hG,IAAa,CAC1C,MAAME,EACH,8DAA6DhmB,EAAE2nH,OAAO9uK,QAAQmnD,EAAE2nH,OAAOh6J,mBAAmBqyC,EAAE2nH,OAAO3rF,uCAEtH3zE,YAAgB29D,S,yGCpBtB,wEAgBA,SAAS7P,IACP+rB,cACAkvJ,IAASllE,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEFv/F,SAASymD,eAAe,SAhB5BzgB,cACA0+H,WAAU,MAAYr+N,IACtBq+N,WAAU,SAAeD,IACzBA,IAASllE,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEFv/F,SAASymD,eAAe,SAcxBnxC,IAAYtrB,UAAUR,GAIwB98B,SAAS8yC,KAAKzlC,WAAW,aACvEvsC,OAAOm3O,eAAiB,WACtB,MAAO,4BAKTn3O,OAAOq3B,MAAQ,KACb,MAAM,IAAI1nB,MAAM,8D","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([1536,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","export enum FactionNames {\n Illuminati = \"Illuminati\",\n Daedalus = \"Daedalus\",\n TheCovenant = \"The Covenant\",\n ECorp = \"ECorp\",\n MegaCorp = \"MegaCorp\",\n BachmanAssociates = \"Bachman & Associates\",\n BladeIndustries = \"Blade Industries\",\n NWO = \"NWO\",\n ClarkeIncorporated = \"Clarke Incorporated\",\n OmniTekIncorporated = \"OmniTek Incorporated\",\n FourSigma = \"Four Sigma\",\n KuaiGongInternational = \"KuaiGong International\",\n FulcrumSecretTechnologies = \"Fulcrum Secret Technologies\",\n BitRunners = \"BitRunners\",\n TheBlackHand = \"The Black Hand\",\n NiteSec = \"NiteSec\",\n Aevum = \"Aevum\",\n Chongqing = \"Chongqing\",\n Ishima = \"Ishima\",\n NewTokyo = \"New Tokyo\",\n Sector12 = \"Sector-12\",\n Volhaven = \"Volhaven\",\n SpeakersForTheDead = \"Speakers for the Dead\",\n TheDarkArmy = \"The Dark Army\",\n TheSyndicate = \"The Syndicate\",\n Silhouette = \"Silhouette\",\n Tetrads = \"Tetrads\",\n SlumSnakes = \"Slum Snakes\",\n Netburners = \"Netburners\",\n TianDiHui = \"Tian Di Hui\",\n CyberSec = \"CyberSec\",\n Bladeburners = \"Bladeburners\",\n ChurchOfTheMachineGod = \"Church of the Machine God\",\n ShadowsOfAnarchy = \"Shadows of Anarchy\",\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\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 const nAbs = Math.abs(n);\n if (n === Infinity) return \"∞\";\n for (let i = 0; i < extraFormats.length; i++) {\n if (extraFormats[i] < nAbs && nAbs <= extraFormats[i] * 1000) {\n return this.format(n / extraFormats[i], \"0.\" + \"0\".repeat(decimalPlaces)) + extraNotations[i];\n }\n }\n if (nAbs < 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 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 parseCustomLargeNumber(str: string): number {\n const numericRegExp = new RegExp(\"^(-?\\\\d+\\\\.?\\\\d*)([\" + extraNotations.join(\"\") + \"]?)$\");\n const match = str.match(numericRegExp);\n if (match == null) {\n return NaN;\n }\n const [, number, notation] = match;\n const notationIndex = extraNotations.indexOf(notation);\n if (notationIndex === -1) {\n return NaN;\n }\n return parseFloat(number) * extraFormats[notationIndex];\n }\n\n largestAbsoluteNumber(n1: number, n2 = 0, n3 = 0): number {\n if (isNaN(n1)) n1 = 0;\n if (isNaN(n2)) n2 = 0;\n if (isNaN(n3)) n3 = 0;\n const largestAbsolute = Math.max(Math.abs(n1), Math.abs(n2), Math.abs(n3));\n switch (largestAbsolute) {\n case Math.abs(n1):\n return n1;\n case Math.abs(n2):\n return n2;\n case Math.abs(n3):\n return n3;\n }\n return 0;\n }\n\n parseMoney(s: string): number {\n // numeral library does not handle formats like 1s (returns 1) and 1e10 (returns 110) well,\n // so if more then 1 return a valid number, return the one farthest from 0\n const numeralValue = numeral(s).value();\n const parsed = parseFloat(s);\n const selfParsed = this.parseCustomLargeNumber(s);\n // Check for one or more NaN values\n if (isNaN(parsed) && isNaN(selfParsed)) {\n if (numeralValue === null) {\n // 3x NaN\n return NaN;\n }\n // 2x NaN\n return numeralValue;\n } else if (numeralValue === null && isNaN(selfParsed)) {\n // 2x NaN\n return parsed;\n } else if (isNaN(parsed)) {\n if (numeralValue === null) {\n // 2x NaN\n return selfParsed;\n }\n // 1x NaN\n return this.largestAbsoluteNumber(numeralValue, selfParsed);\n } else if (numeralValue === null) {\n // 1x NaN\n return this.largestAbsoluteNumber(parsed, selfParsed);\n } else if (isNaN(selfParsed)) {\n // 1x NaN\n return this.largestAbsoluteNumber(numeralValue, parsed);\n } else {\n // no NaN\n return this.largestAbsoluteNumber(numeralValue, parsed, selfParsed);\n }\n }\n}\n\nexport const numeralWrapper = new NumeralFormatter();\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\";\nimport { defaultMonacoTheme, IScriptEditorTheme } from \"../ScriptEditor/ui/themes\";\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 * Infinite loop safety net\n */\n InfinityLoopSafety: 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 recently killed script entries being tracked.\n */\n MaxRecentScriptsCapacity: number;\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 user should be displayed a toast warning when the autosave is disabled.\n */\n SuppressAutosaveDisabledWarnings: 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 * Script editor theme data\n */\n EditorTheme: IScriptEditorTheme;\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 InfinityLoopSafety: true,\n Locale: \"en\",\n MaxRecentScriptsCapacity: 50,\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 SuppressAutosaveDisabledWarnings: 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 EditorTheme: defaultMonacoTheme,\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 InfinityLoopSafety: defaultSettings.InfinityLoopSafety,\n Locale: \"en\",\n MaxRecentScriptsCapacity: defaultSettings.MaxRecentScriptsCapacity,\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 SuppressAutosaveDisabledWarnings: defaultSettings.SuppressAutosaveDisabledWarnings,\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 EditorTheme: { ...defaultMonacoTheme },\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.EditorTheme, save.EditorTheme);\n delete save.EditorTheme;\n Object.assign(Settings, save);\n },\n};\n","/**\n * Names of all locations\n */\nexport enum LocationName {\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 NewTokyoArcade = \"Arcade\",\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","/**\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 IntelligenceGraftBaseExpGain: 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 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 CodingContractBaseFactionRepGain: number;\n CodingContractBaseCompanyRepGain: number;\n CodingContractBaseMoneyGain: number;\n AugmentationGraftingCostMult: number;\n AugmentationGraftingTimeBase: number;\n SoACostMult: number;\n SoARepMult: number;\n EntropyEffect: number;\n TotalNumBitNodes: number;\n InfiniteLoopLimit: number;\n Donations: number; // number of blood/plasma/palette donation the dev have verified., boosts NFG\n LatestUpdate: string;\n} = {\n VersionString: \"1.7.0\",\n VersionNumber: 19,\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 IntelligenceGraftBaseExpGain: 0.05,\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\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 // Coding Contract\n // TODO: Move this into Coding contract implementation?\n CodingContractBaseFactionRepGain: 2500,\n CodingContractBaseCompanyRepGain: 4000,\n CodingContractBaseMoneyGain: 75e6,\n\n // Augmentation grafting multipliers\n AugmentationGraftingCostMult: 3,\n AugmentationGraftingTimeBase: 3600000,\n\n // SoA mults\n SoACostMult: 7,\n SoARepMult: 1.3,\n\n // Value raised to the number of entropy stacks, then multiplied to player multipliers\n EntropyEffect: 0.98,\n\n // BitNode/Source-File related stuff\n TotalNumBitNodes: 24,\n\n InfiniteLoopLimit: 1000,\n\n Donations: 7,\n\n LatestUpdate: `\n ## [draft] v1.7.0 - 2022-04-13 to 2022-05-20\n\n#### Information\n\nModifications included between **2022-04-13** and **2022-05-20** 'b5e4d70' to '0fbe4a1').\n\n_[See Pull Requests on GitHub](https://github.com/search?q=user%3Adanielyxie%20repo%3Abitburner%20is%3Apr%20is%3Amerged%20merged%3A%222022-04-13T16%3A32%3A26.000Z..2022-05-20T06%3A08%3A51.000Z%22)_\n\n#### Merged Pull Requests\n\n- [Feature] Monaco Theme Editor (by @nickofolas) #[3438](https://github.com/danielyxie/bitburner/pull/3438)\n- [Fix] Dummy Stanek grid width (by @nickofolas) #[3442](https://github.com/danielyxie/bitburner/pull/3442)\n- [Fix] Theme browser assets not loading (by @nickofolas) #[3446](https://github.com/danielyxie/bitburner/pull/3446)\n- Accept valid JSON arrays in coding contracts (by @Savlik) #[3247](https://github.com/danielyxie/bitburner/pull/3247)\n- another dark theme? (by @hydroflame) #[3450](https://github.com/danielyxie/bitburner/pull/3450)\n- API: Add repFromDonation() to the Formula API (by @Hoekstraa) #[3461](https://github.com/danielyxie/bitburner/pull/3461)\n- API: Add safeguard to ns.killall(), preventing killing itself by default (by @Hoekstraa) #[3607](https://github.com/danielyxie/bitburner/pull/3607)\n- API: FIX #2993 sleeve.travel with invalid city names (by @TheMas3212) #[3458](https://github.com/danielyxie/bitburner/pull/3458)\n- API: Fix inconsistent return value in 'ns.grafting.getAugmentationGraftTime' (by @nickofolas) #[3539](https://github.com/danielyxie/bitburner/pull/3539)\n- API: Fix leak of real Employee object in hireEmployee (by @TheMas3212) #[3483](https://github.com/danielyxie/bitburner/pull/3483)\n- API: replace a number of references to workerscript.log with \\_ctx.log (by @TheMas3212) #[3470](https://github.com/danielyxie/bitburner/pull/3470)\n- API: Terminal screen can now be cleared from within scripts with ns.ui.clearTerminal() (by @Hoekstraa) #[3618](https://github.com/danielyxie/bitburner/pull/3618)\n- AUGMENTATIONS: Fix 'isSpecial' filter in helper (Removes NeuroFlux, Stanek's Gift, etc from gangs) (by @nickofolas) #[3565](https://github.com/danielyxie/bitburner/pull/3565)\n- AUGMENTATIONS: Fix Augmentation rep req not being properly influenced by BitNode multipliers (by @nickofolas) #[3652](https://github.com/danielyxie/bitburner/pull/3652)\n- AUGMENTATIONS: Fix NeuroFlux being applied improperly and migrate broken saves (by @nickofolas) #[3613](https://github.com/danielyxie/bitburner/pull/3613)\n- AUGMENTATIONS: Fix reputation check for faction augs (by @nickofolas) #[3609](https://github.com/danielyxie/bitburner/pull/3609)\n- AUGMENTATIONS: Tweak a couple small UI elements (by @nickofolas) #[3614](https://github.com/danielyxie/bitburner/pull/3614)\n- basic doc no longer hacker themed (by @hydroflame) #[3449](https://github.com/danielyxie/bitburner/pull/3449)\n- BITNODE: FIX #3546 BitVerse now shows proper BN level when accessed via flume (by @nickofolas) #[3550](https://github.com/danielyxie/bitburner/pull/3550)\n- BLADEBURNER: fixes #3648 : Automate console command capitalisation inconsistent (by @Vic1970) #[3647](https://github.com/danielyxie/bitburner/pull/3647)\n- BLADEBURNER: Fix #3594 Blade's Simulacrum worked without being installed (by @Undeemiss) #[3639](https://github.com/danielyxie/bitburner/pull/3639)\n- blood (by @hydroflame) #[3495](https://github.com/danielyxie/bitburner/pull/3495)\n- BUGFIX: getAugmentationCost response backwards (by @phyzical) #[3617](https://github.com/danielyxie/bitburner/pull/3617)\n- BUGFIX: Handle edge case in LZ compression code and fix docs (by @stalefishies) #[3581](https://github.com/danielyxie/bitburner/pull/3581)\n- BUGFIX: make bonustime for gang in miliseconds (by @phyzical) #[3578](https://github.com/danielyxie/bitburner/pull/3578)\n- BUGFIX: sleeve stale object refence during augmentation (by @phyzical) #[3601](https://github.com/danielyxie/bitburner/pull/3601)\n- Bugfix/corp updates (by @phyzical) #[3321](https://github.com/danielyxie/bitburner/pull/3321)\n- Bump async from 2.6.3 to 2.6.4 (by @dependabot[bot]) #[3463](https://github.com/danielyxie/bitburner/pull/3463)\n- CODINGCONTRACT: Fix #3391 Double contract reward exploit (by @Undeemiss) #[3646](https://github.com/danielyxie/bitburner/pull/3646)\n- CODINGCONTRACT: FIX #3484 BREAKING Fixed capitalization in contract name (by @Undeemiss) #[3537](https://github.com/danielyxie/bitburner/pull/3537)\n- CODINGCONTRACT: New \"Proper 2-Coloring of a Graph\" contract (by @Undeemiss) #[3530](https://github.com/danielyxie/bitburner/pull/3530)\n- CODINGCONTRACT: Three new compression contracts (by @stalefishies) #[3541](https://github.com/danielyxie/bitburner/pull/3541)\n- CODINGCONTRACT: Typo & clarity fixes to description of Encoded Binary to Integer contract (by @ActuallyCurtis) #[3469](https://github.com/danielyxie/bitburner/pull/3469)\n- CODINGCONTRACT: Updated description of 2-coloring contract (by @Undeemiss) #[3531](https://github.com/danielyxie/bitburner/pull/3531)\n- COMPANY: Fix #3551 Applying for a new job will not change active employer if player is performing company work (by @Snarling) #[3552](https://github.com/danielyxie/bitburner/pull/3552)\n- CORPORATIONS: Expose makeProducts on NSDivision interface (by @DavidGrinberg) #[3570](https://github.com/danielyxie/bitburner/pull/3570)\n- CORPORATIONS: Expose sales cost on NSMaterial interface (by @DavidGrinberg) #[3574](https://github.com/danielyxie/bitburner/pull/3574)\n- Corrected example grids found in Stanek help (by @Undeemiss) #[3441](https://github.com/danielyxie/bitburner/pull/3441)\n- Create program action no longer creates duplicates (by @Undeemiss) #[3436](https://github.com/danielyxie/bitburner/pull/3436)\n- DOCUMENTATION: Add descriptions for compression contracts (by @stalefishies) #[3559](https://github.com/danielyxie/bitburner/pull/3559)\n- DOCUMENTATION: Add new coding contract descriptions (by @stalefishies) #[3542](https://github.com/danielyxie/bitburner/pull/3542)\n- DOCUMENTATION: Clarify definition for installAugmentations() (by @PSEUDOSTAGE) #[3560](https://github.com/danielyxie/bitburner/pull/3560)\n- DOCUMENTATION: FIX #3516 \"cannot\" misspelled as \"cannnot\" (by @Undeemiss) #[3533](https://github.com/danielyxie/bitburner/pull/3533)\n- EDITOR: FIX #3502 Editor theme migration crash (by @nickofolas) #[3503](https://github.com/danielyxie/bitburner/pull/3503)\n- FEATURE: added logic to allow quitJob to be called from singularity (by @phyzical) #[3577](https://github.com/danielyxie/bitburner/pull/3577)\n- fix #3395 donating to special factions possible via singularity (by @TheMas3212) #[3456](https://github.com/danielyxie/bitburner/pull/3456)\n- fix b1tflum3 and destroyW0r1dD43m0n singularity functions to check for sf4 (by @TheMas3212) #[3443](https://github.com/danielyxie/bitburner/pull/3443)\n- Fix inconsistancy with trying to work for gang factions while running a gang (by @TheMas3212) #[3454](https://github.com/danielyxie/bitburner/pull/3454)\n- Fix infiltration rep BN mult calculation (by @trambelus) #[3632](https://github.com/danielyxie/bitburner/pull/3632)\n- Fix script editor settings. (by @hydroflame) #[3504](https://github.com/danielyxie/bitburner/pull/3504)\n- Fix test/jest/Netscript/DynamicRamCalculation.test.js (by @TheMas3212) #[3455](https://github.com/danielyxie/bitburner/pull/3455)\n- GRAFTING: Fix Grafting not being handled in singularity stop work (by @nickofolas) #[3568](https://github.com/danielyxie/bitburner/pull/3568)\n- GRAFTING: Implement sorting options (by @nickofolas) #[3654](https://github.com/danielyxie/bitburner/pull/3654)\n- INFILTRATION: Added new faction called infiltrators that provide infiltration specific augs. (by @phyzical) #[3241](https://github.com/danielyxie/bitburner/pull/3241)\n- INFILTRATION: Fix minigame cycle (by @nickofolas) #[3549](https://github.com/danielyxie/bitburner/pull/3549)\n- INFILTRATION: Fix phyzical WKS aug effects being applied before aug is installed (by @nickofolas) #[3555](https://github.com/danielyxie/bitburner/pull/3555)\n- INFILTRATION: Fix rep reward being substantially higher than intended (by @nickofolas) #[3562](https://github.com/danielyxie/bitburner/pull/3562)\n- INFILTRATION: New faction, Shadows of Anarchy, provides various augs to help infiltrations. (by @hydroflame) #[3543](https://github.com/danielyxie/bitburner/pull/3543)\n- INFILTRATION: Update gameplay UI (by @nickofolas) #[3587](https://github.com/danielyxie/bitburner/pull/3587)\n- keeping up to date (by @hydroflame) #[3432](https://github.com/danielyxie/bitburner/pull/3432)\n- Keeping up to date. (by @hydroflame) #[3561](https://github.com/danielyxie/bitburner/pull/3561)\n- Make .lit and .msg files clickable (by @Chris380) #[3453](https://github.com/danielyxie/bitburner/pull/3453)\n- MESSAGES: Added the name of NiteSec's server to their .msg (by @Undeemiss) #[3466](https://github.com/danielyxie/bitburner/pull/3466)\n- MISC: add better typing to Electron.tsx (by @taralx) #[3540](https://github.com/danielyxie/bitburner/pull/3540)\n- MISC: Added NS function closeTail to close tail windows (by @Undeemiss) #[3666](https://github.com/danielyxie/bitburner/pull/3666)\n- MISC: Adjust deps to current usage (by @taralx) #[3519](https://github.com/danielyxie/bitburner/pull/3519)\n- MISC: Close some GitHub issues that do not need action (by @Undeemiss) #[3640](https://github.com/danielyxie/bitburner/pull/3640)\n- MISC: Closing more GitHub issues I missed last time (by @Undeemiss) #[3665](https://github.com/danielyxie/bitburner/pull/3665)\n- MISC: Correct BB Skill point achievement name (by @Undeemiss) #[3571](https://github.com/danielyxie/bitburner/pull/3571)\n- MISC: Correct typos in getScriptRam docs. (by @nzdjb) #[3590](https://github.com/danielyxie/bitburner/pull/3590)\n- MISC: Fix #3125 BREAKING Renamed BN mult CorporationSoftCap to CorporationSoftcap (by @Undeemiss) #[3638](https://github.com/danielyxie/bitburner/pull/3638)\n- MISC: FIX #3593 Float errors can no longer prevent full usage of a server's available ram. (by @Snarling) #[3619](https://github.com/danielyxie/bitburner/pull/3619)\n- MISC: fix typing conflict between jest and cypress (by @taralx) #[3518](https://github.com/danielyxie/bitburner/pull/3518)\n- MISC: fix typing conflict between jest and cypress (by @taralx) #[3644](https://github.com/danielyxie/bitburner/pull/3644)\n- MISC: Fixed typo in exceptionAlert.ts (by @Undeemiss) #[3572](https://github.com/danielyxie/bitburner/pull/3572)\n- MISC: Fixed typos in game options (by @notacompsciguy) #[3584](https://github.com/danielyxie/bitburner/pull/3584)\n- MISC: HammingCodingContracts need rework (by @Hedrauta) #[3479](https://github.com/danielyxie/bitburner/pull/3479)\n- MISC: Implemented infinite loop safety net. (by @hydroflame) #[3624](https://github.com/danielyxie/bitburner/pull/3624)\n- MISC: make jQuery use explicit (by @taralx) #[3517](https://github.com/danielyxie/bitburner/pull/3517)\n- MISC: Make tutorial explain ns1 vs ns2 better (by @hydroflame) #[3586](https://github.com/danielyxie/bitburner/pull/3586)\n- MISC: Remove comments that describe nonexistent augs (by @Undeemiss) #[3569](https://github.com/danielyxie/bitburner/pull/3569)\n- MISC: update @types/numeral and fix type errors (by @taralx) #[3521](https://github.com/danielyxie/bitburner/pull/3521)\n- MISC: Update logic for stats page BitNode level (by @nickofolas) #[3512](https://github.com/danielyxie/bitburner/pull/3512)\n- MISC: upgrade to eslint v8 (by @taralx) #[3523](https://github.com/danielyxie/bitburner/pull/3523)\n- MISC: Wrap most of the API in the new api wrapper (by @hydroflame) #[3627](https://github.com/danielyxie/bitburner/pull/3627)\n- OPTIONS: Fix sliders not sliding correctly (by @nickofolas) #[3642](https://github.com/danielyxie/bitburner/pull/3642)\n- REFACTOR: augmentation cost, rep cost and level to be calculated in place (by @phyzical) #[3544](https://github.com/danielyxie/bitburner/pull/3544)\n- REFACTOR: augmentation isSpecial adjustments (by @phyzical) #[3564](https://github.com/danielyxie/bitburner/pull/3564)\n- Reran npm format and lint to fix formatting (by @Undeemiss) #[3434](https://github.com/danielyxie/bitburner/pull/3434)\n- Revert \"MISC: fix typing conflict between jest and cypress\" (by @hydroflame) #[3608](https://github.com/danielyxie/bitburner/pull/3608)\n- Revert \"MISC: HammingCodingContracts need rework\" (by @hydroflame) #[3500](https://github.com/danielyxie/bitburner/pull/3500)\n- revert theme (by @hydroflame) #[3451](https://github.com/danielyxie/bitburner/pull/3451)\n- Singularity: Fix #3489 Disable checkTixApiAccess for purchase4SMarketData (by @DavidGrinberg) #[3490](https://github.com/danielyxie/bitburner/pull/3490)\n- SLEEVES: Fix issues with Sleeve UI crashing when Sleeve task faction becomes gang faction (by @nickofolas) #[3557](https://github.com/danielyxie/bitburner/pull/3557)\n- STANEK: Fix #3196 Charging booster fragments throws an error (by @Undeemiss) #[3637](https://github.com/danielyxie/bitburner/pull/3637)\n- STANEK: FIX #3277 Can no longer overlap rotated fragments (by @Undeemiss) #[3460](https://github.com/danielyxie/bitburner/pull/3460)\n- STANEK: FIX #3282 Added NS function stanek.acceptGift (by @Undeemiss) #[3513](https://github.com/danielyxie/bitburner/pull/3513)\n- STANEK: Properly reapply entropy in Stanek's Gift (by @nickofolas) #[3673](https://github.com/danielyxie/bitburner/pull/3673)\n- STANEK: Stanek NS functions correctly throw errors when stanek not installed (by @Undeemiss) #[3660](https://github.com/danielyxie/bitburner/pull/3660)\n- Started collecting lore so that additions to it are simpler (by @Undeemiss) #[3465](https://github.com/danielyxie/bitburner/pull/3465)\n- TERMINAL: FIX #3492 Allow cd .. even when destination directory is empty (by @Snarling) #[3525](https://github.com/danielyxie/bitburner/pull/3525)\n- TERMINAL: FIX #3651 Make directory name regex more flexible (by @Dane-Horn) #[3653](https://github.com/danielyxie/bitburner/pull/3653)\n- TOOLING: Add GitHub action to validate PR titles (by @MartinFournier) #[3471](https://github.com/danielyxie/bitburner/pull/3471)\n- UI FIX #3485 - Allow bulk purchasing when smart supply is enabled (by @phyzical) #[3486](https://github.com/danielyxie/bitburner/pull/3486)\n- UI: Change text color of Augmentations page backup button (by @nickofolas) #[3511](https://github.com/danielyxie/bitburner/pull/3511)\n- UI: FIX #1754 Stanek effect summary & slight tweak. (by @borisflagell) #[3622](https://github.com/danielyxie/bitburner/pull/3622)\n- UI: FIX #2228,#2958 Fix tab highlights and highlight files not on home. (by @phyzical) #[2989](https://github.com/danielyxie/bitburner/pull/2989)\n- UI: FIX #2256 Hacknet server's upgrade tooltip were not handling RAM… (by @borisflagell) #[3532](https://github.com/danielyxie/bitburner/pull/3532)\n- UI: FIX #2741 Allow using modifier keys inside the typing infiltration (by @Dane-Horn) #[3634](https://github.com/danielyxie/bitburner/pull/3634)\n- UI: FIX #2829 Remove defeated NPC gangs from territory page (by @Dane-Horn) #[3633](https://github.com/danielyxie/bitburner/pull/3633)\n- UI: FIX #3313 Streamline the GraftingRoot page by making it rerender. (by @borisflagell) #[3558](https://github.com/danielyxie/bitburner/pull/3558)\n- UI: FIX #3341 Enable touch-clicks in react-draggable (by @Snarling) #[3488](https://github.com/danielyxie/bitburner/pull/3488)\n- UI: FIX #3415 Tweak Manage Gang button visibility (by @borisflagell) #[3528](https://github.com/danielyxie/bitburner/pull/3528)\n- UI: FIX #3457 autocomplete suggestions no longer require hovering terminal input (by @Snarling) #[3493](https://github.com/danielyxie/bitburner/pull/3493)\n- UI: FIX #3473 'mv' now says destination script is running instead of returning an error (by @Hoekstraa) #[3474](https://github.com/danielyxie/bitburner/pull/3474)\n- UI: FIX #3522 realigned autocomplete popup (by @Snarling) #[3524](https://github.com/danielyxie/bitburner/pull/3524)\n- UI: FIX #3592 Sidebar and bash shortcuts now work on MacOS with US-like layouts (by @Hoekstraa) #[3605](https://github.com/danielyxie/bitburner/pull/3605)\n- UI: Fix Agility BitNode multiplier not appearing in UI (by @nickofolas) #[3662](https://github.com/danielyxie/bitburner/pull/3662)\n- UI: Fix exclusive augs not always showing as purchasable through gangs when they should (by @nickofolas) #[3676](https://github.com/danielyxie/bitburner/pull/3676)\n- UI: Fix the achievement covenant icon was not shown (by @Risenafis) #[3510](https://github.com/danielyxie/bitburner/pull/3510)\n- UI: Fix z-index of modals overriding everything (by @nickofolas) #[3620](https://github.com/danielyxie/bitburner/pull/3620)\n- UI: lightweight description update on \"increase maximum money\" hash spending option. (by @borisflagell) #[3547](https://github.com/danielyxie/bitburner/pull/3547)\n- UI: Minor improvements to log boxes (by @nickofolas) #[3641](https://github.com/danielyxie/bitburner/pull/3641)\n- UI: Overhaul GameOptions UI (by @nickofolas) #[3505](https://github.com/danielyxie/bitburner/pull/3505)\n- UI: Positioning improved for tail titlebar buttons, and tail window has minimum size constraints. (by @Snarling) #[3548](https://github.com/danielyxie/bitburner/pull/3548)\n- UI: Redesign purchasable Augmentations (by @nickofolas) #[3545](https://github.com/danielyxie/bitburner/pull/3545)\n- UI: Refactor and redesign WorkInProgress interface (by @nickofolas) #[3611](https://github.com/danielyxie/bitburner/pull/3611)\n- UI: Refactors, redesigns, and new section to stats page (by @nickofolas) #[3626](https://github.com/danielyxie/bitburner/pull/3626)\n- UI: Sort and color Graft Augmentation list (by @jaype87) #[3616](https://github.com/danielyxie/bitburner/pull/3616)\n- UI: Update Factions list interface (by @nickofolas) #[3675](https://github.com/danielyxie/bitburner/pull/3675)\n- WORK: FIX #3435 Quitting the active job now sets first remaining job as active (by @Snarling) #[3507](https://github.com/danielyxie/bitburner/pull/3507)\n- WORK: Refactor work types to use 'enum's instead of constants (by @nickofolas) #[3612](https://github.com/danielyxie/bitburner/pull/3612)\n\n#### Other Changes\n\n- increase donation counter (by @hydroflame) - [8456410](https://github.com/danielyxie/bitburner/commit/84564100e90c46ae4b816853c2cdea0bc309af4d)\n- allbuild commit 7f9e3775 (by @hydroflame) - [791c19c](https://github.com/danielyxie/bitburner/commit/791c19c4fe447c9231bfb423b9fc48114e783b43)\n- allbuild commit bcbda22a (by @hydroflame) - [032c440](https://github.com/danielyxie/bitburner/commit/032c440eaeb069eecd720ec2f8e069f705a0c1b4)\n- fix documentation for getDarkwebPrograms (by @hydroflame) - [4056956](https://github.com/danielyxie/bitburner/commit/4056956c2ada37946333bdad44cb0b6eb3909bf8)\n- support ASNI (by @hydroflame) - [36c7ef1](https://github.com/danielyxie/bitburner/commit/36c7ef1ad7ea8bb69fca23bce5883a3c2e23f1e0)\n- allbuild commit 22b6d0d5 (by @hydroflame) - [b46718d](https://github.com/danielyxie/bitburner/commit/b46718d188880ecf716ae045861d81d61e00af4b)\n- allbuild commit 36c7ef1a (by @hydroflame) - [d0ebf5e](https://github.com/danielyxie/bitburner/commit/d0ebf5e14e0498cb063fde35d63c9f59f2c01e35)\n- Update documentation for employee (by @hydroflame) - [100e81c](https://github.com/danielyxie/bitburner/commit/100e81c8ab4a408f74cc9bd9ffe2b8bad3d03462)\n- allbuild commit c799b291 (by @hydroflame) - [f5f5879](https://github.com/danielyxie/bitburner/commit/f5f5879fc380678d978e2b0a29ba7b6f0b4c9ec0)\n- ideas (by @hydroflame) - [0121fee](https://github.com/danielyxie/bitburner/commit/0121fee6e4c690d01650d1e68a80ea363bb48bce)\n- allbuild commit 0121fee6 (by @hydroflame) - [5c417e9](https://github.com/danielyxie/bitburner/commit/5c417e9b4df236df8bf3e2f8262b7bce87c934df)\n- Update codebase for stanek (by @hydroflame) - [c2b4a5b](https://github.com/danielyxie/bitburner/commit/c2b4a5b52a2162d2e49c7317b0a60a349984eb47)\n- fix lint (by @hydroflame) - [4cc518f](https://github.com/danielyxie/bitburner/commit/4cc518f37723aafb3168b64cd689408afdb74877)\n- Fix (by @hydroflame) - [9af553f](https://github.com/danielyxie/bitburner/commit/9af553f63cb1380795550648b0134b608564fab8)\n- Fix stanek leaking classes (by @hydroflame) - [fda3f02](https://github.com/danielyxie/bitburner/commit/fda3f02d73dba27034128c9be5e810a51e475e38)\n- fix conflicts (by @hydroflame) - [ca1a2aa](https://github.com/danielyxie/bitburner/commit/ca1a2aad333fa838b6d0e57f89e1cedba086a4a0)\n- Nerf noodle bar.\n\n`,\n};\n","export enum AugmentationNames {\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 CongruityImplant = \"nickofolas Congruity Implant\",\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 // Infiltrators MiniGames\n MightOfAres = \"SoA - Might of Ares\", // slash\n WisdomOfAthena = \"SoA - Wisdom of Athena\", // bracket\n TrickeryOfHermes = \"SoA - Trickery of Hermes\", // cheatcode\n BeautyOfAphrodite = \"SoA - Beauty of Aphrodite\", // bribe\n ChaosOfDionysus = \"SoA - Chaos of Dionysus\", // reverse\n FloodOfPoseidon = \"SoA - Flood of Poseidon\", // hex\n HuntOfArtemis = \"SoA - Hunt of Artemis\", // mine\n KnowledgeOfApollo = \"SoA - Knowledge of Apollo\", // wire\n WKSharmonizer = \"SoA - phyzical WKS harmonizer\",\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","/**\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 { defaultMultipliers } from \"./BitNode\";\n\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 */\nexport interface 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 * Percentage of unique augs that the gang has.\n */\n GangUniqueAugs: 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 /**\n * Influences corporation dividends.\n */\n CorporationSoftcap: 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 = Object.assign({}, defaultMultipliers);\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../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 { 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\nfunction capitalizeFirstLetter(s: string): string {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\nfunction capitalizeEachWord(s: string): string {\n return s\n .split(\" \")\n .map((word) => capitalizeFirstLetter(word))\n .join(\" \");\n}\n\nexport {\n convertTimeMsToTimeElapsedString,\n longestCommonStart,\n containsAllStrings,\n formatNumber,\n generateRandomString,\n cyrb53,\n capitalizeFirstLetter,\n capitalizeEachWord,\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 if (AllServers.hasOwnProperty(s)) {\n const server = AllServers[s];\n if (server) return server;\n }\n\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 let ip: string;\n // Repeat generating ip, until unique one is found\n do {\n ip = createRandomIp();\n } while (ipExists(ip));\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 { 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 Grafting,\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 isInitialized: boolean;\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, augPage?: boolean): 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 toGrafting(): 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","/**\n * Keyboard key codes as returned by event.key\n */\nexport enum KEY {\n //SHIFT: 16, // Check by `&& event.shiftKey`\n //CTRL: 17, // Check by `&& event.ctrlKey`\n //ALT: 18, // Check by `&& event.altKey`\n ENTER = \"Enter\",\n ESC = \"Escape\",\n TAB = \"Tab\",\n SPACE = \" \",\n BACKSPACE = \"Backspace\",\n UP_ARROW = \"ArrowUp\",\n DOWN_ARROW = \"ArrowDown\",\n LEFT_ARROW = \"ArrowLeft\",\n RIGHT_ARROW = \"ArrowRight\",\n\n QUOTE = \"'\",\n DOUBLE_QUOTE = '\"',\n OPEN_BRACKET = \"[\",\n CLOSE_BRACKET = \"]\",\n LESS_THAN = \"<\",\n GREATER_THAN = \">\",\n OPEN_PARENTHESIS = \"(\",\n CLOSE_PARENTHESIS = \")\",\n OPEN_BRACE = \"{\",\n CLOSE_BRACE = \"}\",\n\n PIPE = \"|\",\n DOT = \".\",\n FORWARD_SLASH = \"/\",\n HYPHEN = \"-\",\n HASH = \"#\",\n\n k0 = \"0\",\n k1 = \"1\",\n k2 = \"2\",\n k3 = \"3\",\n k4 = \"4\",\n k5 = \"5\",\n k6 = \"6\",\n k7 = \"7\",\n k8 = \"8\",\n k9 = \"9\",\n\n A = \"a\",\n B = \"b\",\n C = \"c\",\n D = \"d\",\n E = \"e\",\n F = \"f\",\n G = \"g\",\n H = \"h\",\n I = \"i\",\n J = \"j\",\n K = \"k\",\n L = \"l\",\n M = \"m\",\n N = \"n\",\n O = \"o\",\n P = \"p\",\n Q = \"q\",\n R = \"r\",\n S = \"s\",\n T = \"t\",\n U = \"u\",\n V = \"v\",\n W = \"w\",\n X = \"x\",\n Y = \"y\",\n Z = \"z\",\n}\n\n/**\n * Keyboard key codes as returned by event.code\n */\nexport enum KEYCODE {\n //SHIFT: 16, // Check by `&& event.shiftKey`\n //CTRL: 17, // Check by `&& event.ctrlKey`\n //ALT: 18, // Check by `&& event.altKey`\n ENTER = \"Enter\",\n ESC = \"Escape\",\n TAB = \"Tab\",\n SPACE = \"Space\",\n BACKSPACE = \"Backspace\",\n UP_ARROW = \"ArrowUp\",\n DOWN_ARROW = \"ArrowDown\",\n LEFT_ARROW = \"ArrowLeft\",\n RIGHT_ARROW = \"ArrowRight\",\n\n BACKWARD_SLASH = \"Backslash\",\n BACKQUOTE = \"Backquote\",\n COMMA = \"Comma\",\n DOT = \"Period\",\n EQUAL = \"Equal\",\n FORWARD_SLASH = \"Slash\",\n HYPHEN = \"Minus\",\n SEMICOLON = \"Semicolon\",\n QUOTE = \"Quote\",\n\n k0 = \"Digit0\",\n k1 = \"Digit1\",\n k2 = \"Digit2\",\n k3 = \"Digit3\",\n k4 = \"Digit4\",\n k5 = \"Digit5\",\n k6 = \"Digit6\",\n k7 = \"Digit7\",\n k8 = \"Digit8\",\n k9 = \"Digit9\",\n\n A = \"KeyA\",\n B = \"KeyB\",\n C = \"KeyC\",\n D = \"KeyD\",\n E = \"KeyE\",\n F = \"KeyF\",\n G = \"KeyG\",\n H = \"KeyH\",\n I = \"KeyI\",\n J = \"KeyJ\",\n K = \"KeyK\",\n L = \"KeyL\",\n M = \"KeyM\",\n N = \"KeyN\",\n O = \"KeyO\",\n P = \"KeyP\",\n Q = \"KeyQ\",\n R = \"KeyR\",\n S = \"KeyS\",\n T = \"KeyT\",\n U = \"KeyU\",\n V = \"KeyV\",\n W = \"KeyW\",\n X = \"KeyX\",\n Y = \"KeyY\",\n Z = \"KeyZ\",\n}\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 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","export enum WorkType {\n None = \"\",\n Company = \"Working for Company\",\n CompanyPartTime = \"Working for Company part-time\",\n Faction = \"Working for Faction\",\n CreateProgram = \"Working on Create a Program\",\n StudyClass = \"Studying or Taking a class at university\",\n Crime = \"Committing a crime\",\n GraftAugmentation = \"Grafting an Augmentation\",\n}\n\nexport enum PlayerFactionWorkType {\n None = \"\",\n Hacking = \"Faction Hacking Work\",\n Field = \"Faction Field Work\",\n Security = \"Faction Security Work\",\n}\n\nexport enum ClassType {\n None = \"\",\n StudyComputerScience = \"studying Computer Science\",\n DataStructures = \"taking a Data Structures course\",\n Networks = \"taking a Networks course\",\n Algorithms = \"taking an Algorithms course\",\n\n Management = \"taking a Management course\",\n Leadership = \"taking a Leadership course\",\n\n GymStrength = \"training your strength at a gym\",\n GymDefense = \"training your defense at a gym\",\n GymDexterity = \"training your dexterity at a gym\",\n GymAgility = \"training your agility at a gym\",\n}\n\nexport enum CrimeType {\n None = \"\",\n Shoplift = \"shoplift\",\n RobStore = \"rob a store\",\n Mug = \"mug someone\",\n Larceny = \"commit larceny\",\n Drugs = \"deal drugs\",\n BondForgery = \"forge corporate bonds\",\n TraffickArms = \"traffick illegal arms\",\n Homicide = \"commit homicide\",\n GrandTheftAuto = \"commit grand theft auto\",\n Kidnap = \"kidnap someone for ransom\",\n Assassination = \"assassinate a high-profile target\",\n Heist = \"pull off the ultimate heist\",\n}\n","// Class definition for a single Augmentation object\nimport * as React from \"react\";\nimport { IMap } from \"../types\";\n\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\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { AugmentationNames } from \"./data/AugmentationNames\";\nimport { CONSTANTS } from \"../Constants\";\nimport { StaticAugmentations } from \"./StaticAugmentations\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { getBaseAugmentationPriceMultiplier, getGenericAugmentationPriceMultiplier } from \"./AugmentationHelpers\";\nimport { initSoAAugmentations } from \"./data/AugmentationCreator\";\n\nexport interface AugmentationCosts {\n moneyCost: number;\n repCost: number;\n}\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 factions: string[];\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 infiltration_base_rep_increase?: number;\n infiltration_rep_mult?: number;\n infiltration_trade_mult?: number;\n infiltration_sell_mult?: number;\n infiltration_timer_mult?: number;\n infiltration_damage_reduction_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 if (mults.infiltration_base_rep_increase)\n desc = (\n <>\n {desc}\n <br />+{f(mults.infiltration_base_rep_increase - 1)} Infiltration {FactionNames.ShadowsOfAnarchy} Reputation\n base reward\n </>\n );\n if (mults.infiltration_rep_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.infiltration_rep_mult - 1)} Infiltration {FactionNames.ShadowsOfAnarchy} Reputation reward\n </>\n );\n if (mults.infiltration_trade_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.infiltration_trade_mult - 1)} Infiltration Reputation for trading information\n </>\n );\n if (mults.infiltration_sell_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.infiltration_sell_mult - 1)} Infiltration cash reward for selling information\n </>\n );\n if (mults.infiltration_timer_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.infiltration_timer_mult - 1)} Infiltration time per minigame\n </>\n );\n if (mults.infiltration_damage_reduction_mult)\n desc = (\n <>\n {desc}\n <br />\n {f(mults.infiltration_damage_reduction_mult - 1)} Infiltration health lost per failed minigame\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 before multipliers\n baseCost = 0;\n\n // How much faction reputation is required to unlock this before multipliers\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 // Name of Augmentation\n name = \"\";\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 // Factions that offer this aug.\n factions: string[] = [];\n\n constructor(\n params: IConstructorParams = {\n info: \"\",\n moneyCost: 0,\n name: \"\",\n repCost: 0,\n factions: [],\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;\n Object.freeze(this.baseRepRequirement);\n this.baseCost = params.moneyCost;\n Object.freeze(this.baseCost);\n this.factions = params.factions;\n\n if (params.isSpecial) {\n this.isSpecial = true;\n }\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.infiltration_base_rep_increase) {\n this.mults.infiltration_base_rep_increase = params.infiltration_base_rep_increase;\n }\n if (params.infiltration_rep_mult) {\n this.mults.infiltration_rep_mult = params.infiltration_rep_mult;\n }\n if (params.infiltration_trade_mult) {\n this.mults.infiltration_trade_mult = params.infiltration_trade_mult;\n }\n if (params.infiltration_sell_mult) {\n this.mults.infiltration_sell_mult = params.infiltration_sell_mult;\n }\n if (params.infiltration_timer_mult) {\n this.mults.infiltration_timer_mult = params.infiltration_timer_mult;\n }\n if (params.infiltration_damage_reduction_mult) {\n this.mults.infiltration_damage_reduction_mult = params.infiltration_damage_reduction_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 getCost(player: IPlayer): AugmentationCosts {\n const augmentationReference = StaticAugmentations[this.name];\n let moneyCost = augmentationReference.baseCost;\n let repCost = augmentationReference.baseRepRequirement;\n\n if (augmentationReference.name === AugmentationNames.NeuroFluxGovernor) {\n let nextLevel = this.getLevel(player);\n --nextLevel;\n const multiplier = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel);\n repCost = augmentationReference.baseRepRequirement * multiplier * BitNodeMultipliers.AugmentationRepCost;\n moneyCost = augmentationReference.baseCost * multiplier * BitNodeMultipliers.AugmentationMoneyCost;\n\n for (let i = 0; i < player.queuedAugmentations.length; ++i) {\n moneyCost *= getBaseAugmentationPriceMultiplier();\n }\n } else if (augmentationReference.factions.includes(FactionNames.ShadowsOfAnarchy)) {\n const soaAugmentationNames = initSoAAugmentations().map((augmentation) => augmentation.name);\n const soaMultiplier = Math.pow(\n CONSTANTS.SoACostMult,\n soaAugmentationNames.filter((augmentationName) => player.hasAugmentation(augmentationName)).length,\n );\n moneyCost = augmentationReference.baseCost * soaMultiplier;\n if (soaAugmentationNames.find((augmentationName) => augmentationName === augmentationReference.name)) {\n repCost = augmentationReference.baseRepRequirement * soaMultiplier;\n }\n } else {\n moneyCost =\n augmentationReference.baseCost *\n getGenericAugmentationPriceMultiplier() *\n BitNodeMultipliers.AugmentationMoneyCost;\n repCost = augmentationReference.baseRepRequirement * BitNodeMultipliers.AugmentationRepCost;\n }\n return { moneyCost, repCost };\n }\n\n getLevel(player: IPlayer): number {\n // Get current Neuroflux level based on Player's augmentations\n if (this.name === AugmentationNames.NeuroFluxGovernor) {\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 return 0;\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","import { Theme } from \"@mui/material\";\nimport Box from \"@mui/material/Box\";\nimport Fade from \"@mui/material/Fade\";\nimport M from \"@mui/material/Modal\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { SxProps } from \"@mui/system\";\nimport React from \"react\";\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 sx?: SxProps<Theme>;\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 sx={props.sx}\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 { CityName } from \"./../../Locations/data/CityNames\";\nconst 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 AvgProfitLength: 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: [\n CityName.Aevum,\n CityName.Chongqing,\n CityName.Sector12,\n CityName.NewTokyo,\n CityName.Ishima,\n CityName.Volhaven,\n ],\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: [0.1, 0.35, 0.25, 0.2],\n FundingRoundMultiplier: [4, 3, 3, 2.5],\n\n AvgProfitLength: 1,\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","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 ScriptRecentScriptsRamCost: 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 ScriptClearTerminalCost: 0.2,\n\n ScriptSingularityFn1RamCost: 2,\n ScriptSingularityFn2RamCost: 3,\n ScriptSingularityFn3RamCost: 5,\n\n ScriptGangApiBaseRamCost: 4,\n\n ScriptBladeburnerApiBaseRamCost: 4,\n\n ScriptStanekWidth: 0.4,\n ScriptStanekHeight: 0.4,\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 ScriptInfiltrationCalculateDifficulty: 2.5,\n ScriptInfiltrationCalculateRewards: 2.5,\n ScriptInfiltrationGetLocations: 5,\n ScriptInfiltrationGetInfiltrations: 15,\n ScriptStanekAcceptGift: 2,\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\n// Hacknet API\nconst hacknet: IMap<any> = {\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 maxNumNodes: 0,\n};\n\n// Stock API\nconst stock: IMap<any> = {\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 purchaseWseAccount: RamCostConstants.ScriptBuySellStockRamCost,\n purchaseTixApi: RamCostConstants.ScriptBuySellStockRamCost,\n};\n\n// Singularity API\nconst singularity: IMap<any> = {\n universityCourse: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n gymWorkout: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n travelToCity: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n goToLocation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\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 getDarkwebProgramCost: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n getDarkwebPrograms: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\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 quitJob: 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 b1tflum3: SF4Cost(16),\n destroyW0r1dD43m0n: SF4Cost(32),\n};\n\n// Gang API\nconst gang: IMap<any> = {\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\nconst bladeburner: IMap<any> = {\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\nconst infiltration: IMap<any> = {\n calculateDifficulty: RamCostConstants.ScriptInfiltrationCalculateDifficulty,\n calculateRewards: RamCostConstants.ScriptInfiltrationCalculateRewards,\n calculateGetLocations: RamCostConstants.ScriptInfiltrationGetLocations,\n calculateGetInfiltrations: RamCostConstants.ScriptInfiltrationGetInfiltrations,\n};\n\n// Coding Contract API\nconst codingcontract: IMap<any> = {\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\nconst sleeve: IMap<any> = {\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 setToBladeburnerAction: RamCostConstants.ScriptSleeveBaseRamCost,\n};\n\n// Stanek API\nconst stanek: IMap<any> = {\n giftWidth: RamCostConstants.ScriptStanekWidth,\n giftHeight: RamCostConstants.ScriptStanekHeight,\n chargeFragment: RamCostConstants.ScriptStanekCharge,\n fragmentDefinitions: RamCostConstants.ScriptStanekFragmentDefinitions,\n activeFragments: RamCostConstants.ScriptStanekPlacedFragments,\n clearGift: RamCostConstants.ScriptStanekClear,\n canPlaceFragment: RamCostConstants.ScriptStanekCanPlace,\n placeFragment: RamCostConstants.ScriptStanekPlace,\n getFragment: RamCostConstants.ScriptStanekFragmentAt,\n removeFragment: RamCostConstants.ScriptStanekDeleteAt,\n acceptGift: RamCostConstants.ScriptStanekAcceptGift,\n};\n\n// UI API\nconst ui: IMap<any> = {\n getTheme: 0,\n setTheme: 0,\n resetTheme: 0,\n getStyles: 0,\n setStyles: 0,\n resetStyles: 0,\n getGameInfo: 0,\n};\n\n// Grafting API\nconst grafting: IMap<any> = {\n getAugmentationGraftPrice: 3.75,\n getAugmentationGraftTime: 3.75,\n getGraftableAugmentations: 5,\n graftAugmentation: 7.5,\n};\n\nexport const RamCosts: IMap<any> = {\n hacknet,\n stock,\n singularity,\n ...singularity, // singularity is in namespace & toplevel\n gang,\n bladeburner,\n infiltration,\n codingcontract,\n sleeve,\n stanek,\n ui,\n grafting,\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 asleep: 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 clearTerminal: RamCostConstants.ScriptClearTerminalCost,\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 atExit: 0,\n scp: RamCostConstants.ScriptScpRamCost,\n ls: RamCostConstants.ScriptScanRamCost,\n ps: RamCostConstants.ScriptScanRamCost,\n getRecentScripts: RamCostConstants.ScriptRecentScriptsRamCost,\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 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 tFormat: 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 tail: 0,\n toast: 0,\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","// 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 { IPlayer } from \"../IPlayer\";\nimport { PlayerObject } from \"./PlayerObject\";\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 \"../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 { 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, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { calculateClassEarnings } from \"../formulas/work\";\nimport { achievements } from \"../../Achievements/Achievements\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { ITaskTracker } from \"../ITaskTracker\";\nimport { IPerson } from \"../IPerson\";\nimport { Player } from \"../../Player\";\nimport { graftingIntBonus } from \"../Grafting/GraftingHelpers\";\n\nimport { WorkType, PlayerFactionWorkType, ClassType, CrimeType } from \"../../utils/WorkType\";\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 + CONSTANTS.Donations;\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 const numSleeves = Math.min(3, this.sourceFileLvl(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 = ClassType.None;\n this.crimeType = CrimeType.None;\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.entropy = 0;\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: IPerson, 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: IPerson, 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: IPerson, 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: IPerson, 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: IPerson, 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: IPerson, 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: IPerson, 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: IPerson, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERROR: NaN passed into Player.gainIntelligenceExp()\");\n return;\n }\n if (Player.sourceFileLvl(5) > 0 || this.intelligence > 0) {\n this.intelligence_exp += exp;\n this.intelligence = Math.floor(this.calculateSkill(this.intelligence_exp, 1));\n }\n}\n\nexport function gainStats(this: IPerson, retValue: ITaskTracker): void {\n this.gainHackingExp(retValue.hack * this.hacking_exp_mult);\n this.gainStrengthExp(retValue.str * this.strength_exp_mult);\n this.gainDefenseExp(retValue.def * this.defense_exp_mult);\n this.gainDexterityExp(retValue.dex * this.dexterity_exp_mult);\n this.gainAgilityExp(retValue.agi * this.agility_exp_mult);\n this.gainCharismaExp(retValue.cha * this.charisma_exp_mult);\n this.gainIntelligenceExp(retValue.int);\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?: WorkType, group?: string, workType?: string): void {\n if (this.workType !== WorkType.Faction && generalType === this.workType && group === this.companyName) 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 this.timeWorkedGraftAugmentation = 0;\n\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n this.createProgramName = \"\";\n this.graftAugmentationName = \"\";\n this.className = ClassType.None;\n this.workType = WorkType.None;\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(WorkType.Company, companyName);\n this.isWorking = true;\n this.companyName = companyName;\n this.workType = WorkType.Company;\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 === WorkType.Faction) {\n if (this.workForFaction(numCycles)) {\n router.toFaction(Factions[this.currentWorkFactionName]);\n }\n } else if (this.workType === WorkType.CreateProgram) {\n if (this.createProgramWork(numCycles)) {\n router.toTerminal();\n }\n } else if (this.workType === WorkType.StudyClass) {\n if (this.takeClass(numCycles)) {\n router.toCity();\n }\n } else if (this.workType === WorkType.Crime) {\n if (this.commitCrime(numCycles)) {\n router.toLocation(Locations[LocationName.Slums]);\n }\n } else if (this.workType === WorkType.CompanyPartTime) {\n if (this.workPartTime(numCycles)) {\n router.toCity();\n }\n } else if (this.workType === WorkType.GraftAugmentation) {\n if (this.graftAugmentationWork(numCycles)) {\n router.toGrafting();\n }\n } else if (this.work(numCycles)) {\n router.toCity();\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(WorkType.CompanyPartTime, companyName);\n this.isWorking = true;\n this.companyName = companyName;\n this.workType = WorkType.CompanyPartTime;\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 = WorkType.Faction;\n this.currentWorkFactionName = faction.name;\n\n this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer20Hours;\n}\n\nexport function startFactionHackWork(this: IPlayer, faction: Faction): void {\n this.resetWorkStatus(WorkType.Faction, faction.name, PlayerFactionWorkType.Hacking);\n\n this.workHackExpGainRate = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workRepGainRate = getHackingWorkRepGain(this, faction);\n\n this.factionWorkType = PlayerFactionWorkType.Hacking;\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(WorkType.Faction, faction.name, PlayerFactionWorkType.Field);\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 = PlayerFactionWorkType.Field;\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(WorkType.Faction, faction.name, PlayerFactionWorkType.Security);\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 = PlayerFactionWorkType.Security;\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 if (!faction) {\n return false;\n }\n\n //Constantly update the rep gain rate\n switch (this.factionWorkType) {\n case PlayerFactionWorkType.Hacking:\n this.workRepGainRate = getHackingWorkRepGain(this, faction);\n break;\n case PlayerFactionWorkType.Field:\n this.workRepGainRate = getFactionFieldWorkRepGain(this, faction);\n break;\n case PlayerFactionWorkType.Security:\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 let res = \"\";\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 } else {\n 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\n this.isWorking = false;\n this.resetWorkStatus();\n return res;\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 (this.sourceFileLvl(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(this: IPlayer, programName: string, time: number, reqLevel: number): void {\n this.resetWorkStatus();\n this.isWorking = true;\n this.workType = WorkType.CreateProgram;\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) {\n //Complete case\n this.gainIntelligenceExp((CONSTANTS.IntelligenceProgramBaseExpGain * this.timeWorked) / 1000);\n dialogBoxCreate(`You've finished creating ${programName}!<br>The new program can be found on your home computer.`);\n\n if (!this.getHomeComputer().programs.includes(programName)) {\n this.getHomeComputer().programs.push(programName);\n }\n } else if (!this.getHomeComputer().programs.includes(programName)) {\n //Incomplete case\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 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\nexport function startGraftAugmentationWork(this: IPlayer, augmentationName: string, time: number): void {\n this.resetWorkStatus();\n this.isWorking = true;\n this.workType = WorkType.GraftAugmentation;\n\n this.timeNeededToCompleteWork = time;\n this.graftAugmentationName = augmentationName;\n}\n\nexport function craftAugmentationWork(this: IPlayer, numCycles: number): boolean {\n let focusBonus = 1;\n if (!this.hasAugmentation(AugmentationNames.NeuroreceptorManager)) {\n focusBonus = this.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n\n let skillMult = graftingIntBonus(this);\n skillMult *= focusBonus;\n\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n this.timeWorkedGraftAugmentation += CONSTANTS._idleSpeed * numCycles * skillMult;\n\n if (this.timeWorkedGraftAugmentation >= this.timeNeededToCompleteWork) {\n this.finishGraftAugmentationWork(false);\n return true;\n }\n return false;\n}\n\nexport function finishGraftAugmentationWork(this: IPlayer, cancelled: boolean, singularity = false): string {\n const augName = this.graftAugmentationName;\n if (cancelled === false) {\n applyAugmentation({ name: augName, level: 1 });\n\n if (!this.hasAugmentation(AugmentationNames.CongruityImplant)) {\n this.entropy += 1;\n this.applyEntropy(this.entropy);\n }\n\n dialogBoxCreate(\n `You've finished grafting ${augName}.<br>The augmentation has been applied to your body` +\n (this.hasAugmentation(AugmentationNames.CongruityImplant) ? \".\" : \", but you feel a bit off.\"),\n );\n } else if (cancelled && singularity === false) {\n dialogBoxCreate(`You cancelled the grafting of ${augName}.<br>Your money was not returned to you.`);\n }\n\n // Intelligence gain\n if (!cancelled) {\n this.gainIntelligenceExp((CONSTANTS.IntelligenceGraftBaseExpGain * this.timeWorked) / 10000);\n }\n\n this.isWorking = false;\n this.resetWorkStatus();\n return `Grafting of ${augName} has ended.`;\n}\n\n/* Studying/Taking Classes */\nexport function startClass(this: IPlayer, costMult: number, expMult: number, className: ClassType): void {\n this.resetWorkStatus();\n this.isWorking = true;\n this.workType = WorkType.StudyClass;\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: CrimeType,\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 = WorkType.Crime;\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 = CrimeType.None;\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 WorkType.StudyClass:\n res = this.finishClass(true);\n break;\n case WorkType.Company:\n res = this.finishWork(true, true);\n break;\n case WorkType.CompanyPartTime:\n res = this.finishWorkPartTime(true);\n break;\n case WorkType.Faction:\n res = this.finishFactionWork(true, true);\n break;\n case WorkType.CreateProgram:\n res = this.finishCreateProgramWork(true);\n break;\n case WorkType.Crime:\n res = this.finishCrime(true);\n break;\n case WorkType.GraftAugmentation:\n res = this.finishGraftAugmentationWork(true, 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: IPerson, 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)}`, ToastVariant.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 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 if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position<br>\" + getJobRequirementText(company, pos));\n }\n return false;\n }\n\n if (!company.hasPosition(pos)) {\n console.error(`Company ${company.name} does not have position ${pos}. Player.applyToCompany() failed`);\n return false;\n }\n\n while (true) {\n const nextPos = getNextCompanyPositionHelper(pos);\n if (nextPos == null) break;\n if (company.hasPosition(nextPos) && this.isQualified(company, nextPos)) {\n pos = nextPos;\n } else break;\n }\n\n //Check if player already has the assigned job\n if (this.jobs[company.name] === pos.name) {\n if (!sing) {\n const nextPos = getNextCompanyPositionHelper(pos);\n if (nextPos == null || !company.hasPosition(nextPos)) {\n dialogBoxCreate(\"You are already at the highest position for your field! No promotion available\");\n } else {\n const reqText = getJobRequirementText(company, nextPos);\n dialogBoxCreate(\"Unfortunately, you do not qualify for a promotion<br>\" + reqText);\n }\n }\n return false;\n }\n\n this.jobs[company.name] = pos.name;\n if (!this.isWorking || this.workType !== WorkType.Company) this.companyName = company.name;\n\n if (!sing) {\n dialogBoxCreate(\"Congratulations! You were offered a new job at \" + company.name + \" 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, _sing = false): void {\n if (this.isWorking == true && this.workType !== WorkType.Company && this.companyName == company) {\n this.finishWork(true);\n }\n delete this.jobs[company];\n if (this.companyName === company) {\n this.companyName = this.hasJob() ? Object.keys(this.jobs)[0] : \"\";\n }\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(\"Unfortunately, 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(\"Unfortunately, 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(\"Unfortunately, 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(\"Unfortunately, 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(\"Unfortunately, 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(\"Unfortunately, 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(\"Unfortunately, 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 return (\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}\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 playerAug = this.augmentations[i];\n const augName = playerAug.name;\n\n if (augName == AugmentationNames.NeuroFluxGovernor) {\n for (let j = 0; j < playerAug.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[FactionNames.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[FactionNames.Daedalus];\n if (\n !daedalusFac.isBanned &&\n !daedalusFac.isMember &&\n !daedalusFac.alreadyInvited &&\n numAugmentations >= 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[FactionNames.TheCovenant];\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[FactionNames.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[FactionNames.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[FactionNames.BachmanAssociates];\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[FactionNames.BladeIndustries];\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[FactionNames.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[FactionNames.ClarkeIncorporated];\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[FactionNames.OmniTekIncorporated];\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[FactionNames.FourSigma];\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[FactionNames.KuaiGongInternational];\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[FactionNames.FulcrumSecretTechnologies];\n const fulcrumSecretServer = GetServer(SpecialServers.FulcrumSecretTechnologies);\n if (!(fulcrumSecretServer instanceof Server))\n throw new Error(`${FactionNames.FulcrumSecretTechnologies} should be normal server`);\n if (fulcrumSecretServer == null) {\n console.error(`Could not find ${FactionNames.FulcrumSecretTechnologies} Server`);\n } else 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 //BitRunners\n const bitrunnersFac = Factions[FactionNames.BitRunners];\n const bitrunnersServer = GetServer(SpecialServers.BitRunnersServer);\n if (!(bitrunnersServer instanceof Server)) throw new Error(`${FactionNames.BitRunners} should be normal server`);\n if (bitrunnersServer == null) {\n console.error(`Could not find ${FactionNames.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[FactionNames.TheBlackHand];\n const blackhandServer = GetServer(SpecialServers.TheBlackHandServer);\n if (!(blackhandServer instanceof Server)) throw new Error(`${FactionNames.TheBlackHand} should be normal server`);\n if (blackhandServer == null) {\n console.error(`Could not find ${FactionNames.TheBlackHand} 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[FactionNames.NiteSec];\n const nitesecServer = GetServer(SpecialServers.NiteSecServer);\n if (!(nitesecServer instanceof Server)) throw new Error(`${FactionNames.NiteSec} should be normal server`);\n if (nitesecServer == null) {\n console.error(`Could not find ${FactionNames.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[FactionNames.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[FactionNames.Sector12];\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[FactionNames.NewTokyo];\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[FactionNames.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[FactionNames.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[FactionNames.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[FactionNames.SpeakersForTheDead];\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[FactionNames.TheDarkArmy];\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[FactionNames.TheSyndicate];\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[FactionNames.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[FactionNames.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[FactionNames.SlumSnakes];\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[FactionNames.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[FactionNames.TianDiHui];\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[FactionNames.CyberSec];\n const cybersecServer = GetServer(SpecialServers.CyberSecServer);\n if (!(cybersecServer instanceof Server)) throw new Error(`${FactionNames.CyberSec} should be normal server`);\n if (cybersecServer == null) {\n console.error(`Could not find ${FactionNames.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) {\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 = [FactionNames.Bladeburners as string];\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 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 canAccessGrafting(this: IPlayer): boolean {\n return this.bitNodeN === 10 || this.sourceFileLvl(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!\", ToastVariant.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}\"`, ToastVariant.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 || this.sourceFileLvl(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","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 NSSelection,\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.NSSelection]: 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.NSSelection]: 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","// 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 { 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","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 = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Tobacco = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Chemical = getBaseResearchTreeCopy();\n IndustryResearchTrees.Pharmaceutical = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Computer = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Robotics = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Software = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Healthcare = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.RealEstate = getProductIndustryResearchTreeCopy();\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\";\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 || player.sourceFileLvl(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 enum BlackOperationNames {\n OperationTyphoon = \"Operation Typhoon\",\n OperationZero = \"Operation Zero\",\n OperationX = \"Operation X\",\n OperationTitan = \"Operation Titan\",\n OperationAres = \"Operation Ares\",\n OperationArchangel = \"Operation Archangel\",\n OperationJuggernaut = \"Operation Juggernaut\",\n OperationRedDragon = \"Operation Red Dragon\",\n OperationK = \"Operation K\",\n OperationDeckard = \"Operation Deckard\",\n OperationTyrell = \"Operation Tyrell\",\n OperationWallace = \"Operation Wallace\",\n OperationShoulderOfOrion = \"Operation Shoulder of Orion\",\n OperationHyron = \"Operation Hyron\",\n OperationMorpheus = \"Operation Morpheus\",\n OperationIonStorm = \"Operation Ion Storm\",\n OperationAnnihilus = \"Operation Annihilus\",\n OperationUltron = \"Operation Ultron\",\n OperationCenturion = \"Operation Centurion\",\n OperationVindictus = \"Operation Vindictus\",\n OperationDaedalus = \"Operation Daedalus\",\n}\n","import { CityName } from \"./../../Locations/data/CityNames\";\nexport 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: [\n CityName.Aevum,\n CityName.Chongqing,\n CityName.Sector12,\n CityName.NewTokyo,\n CityName.Ishima,\n CityName.Volhaven,\n ],\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","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 }\n case FragmentType.HackingSpeed: {\n return \"+x% faster hack(), grow(), and weaken()\";\n }\n case FragmentType.HackingMoney: {\n return \"+x% hack() power\";\n }\n case FragmentType.HackingGrow: {\n return \"+x% grow() power\";\n }\n case FragmentType.Hacking: {\n return \"+x% hacking skill\";\n }\n case FragmentType.Strength: {\n return \"+x% strength skill\";\n }\n case FragmentType.Defense: {\n return \"+x% defense skill\";\n }\n case FragmentType.Dexterity: {\n return \"+x% dexterity skill\";\n }\n case FragmentType.Agility: {\n return \"+x% agility skill\";\n }\n case FragmentType.Charisma: {\n return \"+x% charisma skill\";\n }\n case FragmentType.HacknetMoney: {\n return \"+x% hacknet production\";\n }\n case FragmentType.HacknetCost: {\n return \"-x% cheaper hacknet cost\";\n }\n case FragmentType.Rep: {\n return \"+x% reputation from factions and companies\";\n }\n case FragmentType.WorkMoney: {\n return \"+x% work money\";\n }\n case FragmentType.Crime: {\n return \"+x% crime money\";\n }\n case FragmentType.Bladeburner: {\n return \"+x% all bladeburner stats\";\n }\n }\n throw new Error(\"Calling effect for fragment type that doesn't have an effect \" + tpe);\n}\n","import { IPlayer } from \"src/PersonObjects/IPlayer\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { 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\";\nimport { isRelevantMaterial } from \"./ui/Helpers\";\n\nexport function NewIndustry(corporation: ICorporation, industry: string, name: string): void {\n if (corporation.divisions.find(({ type }) => industry == type))\n throw new Error(`You have already expanded into the ${industry} industry!`);\n\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 }\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 }\n if (division.offices[city]) {\n throw new Error(`You have already expanded into ${city} for ${division.name}`);\n }\n corporation.funds = corporation.funds - CorporationConstants.OfficeInitialCost;\n division.offices[city] = new OfficeSpace({\n loc: city,\n size: CorporationConstants.OfficeInitialSize,\n });\n}\n\nexport function UnlockUpgrade(corporation: ICorporation, upgrade: CorporationUnlockUpgrade): void {\n if (corporation.funds < upgrade.price) {\n throw new Error(\"Insufficient funds\");\n }\n if (corporation.unlockUpgrades[upgrade.index] === 1) {\n throw new Error(`You have already unlocked the ${upgrade.name} upgrade!`);\n }\n corporation.unlock(upgrade);\n}\n\nexport function LevelUpgrade(corporation: ICorporation, upgrade: CorporationUpgrade): void {\n const baseCost = upgrade.basePrice;\n const priceMult = upgrade.priceMult;\n const level = corporation.upgrades[upgrade.index];\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, mat.maxsll.toString());\n tempQty = tempQty.replace(/PROD/g, mat.prd.toString());\n try {\n tempQty = eval(tempQty);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell quantity field: \" + e);\n }\n\n if (tempQty == null || isNaN(parseFloat(tempQty)) || parseFloat(tempQty) < 0) {\n throw new Error(\"Invalid value or expression for sell quantity 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 'PROD' 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 price field: \" + e);\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 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, product.maxsll.toString());\n temp = temp.replace(/PROD/g, product.data[city][1].toString());\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell quantity field: \" + e);\n }\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 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 or 'PROD' or 'MAX'\");\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 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\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 BulkPurchase(corp: ICorporation, warehouse: Warehouse, material: Material, amt: number): void {\n const matSize = MaterialSizes[material.name];\n const maxAmount = (warehouse.size - warehouse.sizeUsed) / matSize;\n if (isNaN(amt) || amt < 0) {\n throw new Error(`Invalid input amount`);\n }\n if (amt > maxAmount) {\n throw new Error(`You do not have enough warehouse size to fit this purchase`);\n }\n const cost = amt * material.bCost;\n if (corp.funds >= cost) {\n corp.funds = corp.funds - cost;\n material.qty += amt;\n } else {\n throw new Error(`You cannot afford this purchase.`);\n }\n}\n\nexport function SellShares(corporation: ICorporation, player: IPlayer, numShares: number): number {\n if (isNaN(numShares)) throw new Error(\"Invalid value for number of shares\");\n if (numShares < 0) throw new Error(\"Invalid value for number of shares\");\n if (numShares > corporation.numShares) throw new Error(\"You don't have that many shares to sell!\");\n if (!corporation.public) throw new Error(\"You haven't gone public!\");\n if (corporation.shareSaleCooldown) throw new Error(\"Share sale on cooldown!\");\n const stockSaleResults = corporation.calculateShareSale(numShares);\n const profit = stockSaleResults[0];\n const newSharePrice = stockSaleResults[1];\n const newSharesUntilUpdate = stockSaleResults[2];\n\n corporation.numShares -= numShares;\n corporation.issuedShares += numShares;\n corporation.sharePrice = newSharePrice;\n corporation.shareSalesUntilPriceUpdate = newSharesUntilUpdate;\n corporation.shareSaleCooldown = CorporationConstants.SellSharesCooldown;\n player.gainMoney(profit, \"corporation\");\n return profit;\n}\n\nexport function BuyBackShares(corporation: ICorporation, player: IPlayer, numShares: number): boolean {\n if (isNaN(numShares)) throw new Error(\"Invalid value for number of shares\");\n if (numShares < 0) throw new Error(\"Invalid value for number of shares\");\n if (numShares > corporation.issuedShares) throw new Error(\"You don't have that many shares to buy!\");\n if (!corporation.public) throw new Error(\"You haven't gone public!\");\n const buybackPrice = corporation.sharePrice * 1.1;\n if (player.money < numShares * buybackPrice) throw new Error(\"You cant afford that many shares!\");\n corporation.numShares += numShares;\n corporation.issuedShares -= numShares;\n player.loseMoney(numShares * buybackPrice, \"corporation\");\n return true;\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 UpgradeWarehouseCost(warehouse: Warehouse, amt: number): number {\n return Array.from(Array(amt).keys()).reduce(\n (acc, index) => acc + CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, warehouse.level + 1 + index),\n 0,\n );\n}\n\nexport function UpgradeWarehouse(corp: ICorporation, division: IIndustry, warehouse: Warehouse, amt = 1): void {\n const sizeUpgradeCost = UpgradeWarehouseCost(warehouse, amt);\n if (corp.funds < sizeUpgradeCost) return;\n warehouse.level += amt;\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 (!division.makesProducts) {\n throw new Error(\"You cannot create products for this industry!\");\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 let maxProducts = 3;\n if (division.hasResearch(\"uPgrade: Capacity.II\")) {\n maxProducts = 5;\n } else if (division.hasResearch(\"uPgrade: Capacity.I\")) {\n maxProducts = 4;\n }\n const products = division.products;\n if (Object.keys(products).length >= maxProducts) {\n throw new Error(`You are already at the max products (${maxProducts}) for division: ${division.name}!`);\n }\n\n const product = new Product({\n name: productName.replace(/[<>]/g, \"\").trim(), //Sanitize for HTMl elements\n createCity: city,\n designCost: designInvest,\n advCost: marketingInvest,\n });\n if (products[product.name] instanceof Product) {\n throw new Error(`You already have a product with this name!`);\n }\n\n corp.funds = corp.funds - (designInvest + marketingInvest);\n 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(\n divisionName: string,\n cityName: string,\n material: Material,\n amt: string,\n division?: Industry,\n): 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\n if (!division || !isRelevantMaterial(material.name, division)) {\n throw new Error(`You cannot export material: ${material.name} to division: ${divisionName}!`);\n }\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 product.prdman[cityName][1] = 0;\n } else {\n product.prdman[cityName][0] = true;\n product.prdman[cityName][1] = qty;\n }\n}\n\nexport function LimitMaterialProduction(material: Material, qty: number): void {\n if (qty < 0 || isNaN(qty)) {\n material.prdman[0] = false;\n material.prdman[1] = 0;\n } else {\n material.prdman[0] = true;\n material.prdman[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 { 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","/**\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 Bladeburner,\n Recovery,\n Synchro,\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 React from \"react\";\n\nimport { Typography, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { characterOverviewStyles as useStyles } from \"./CharacterOverview\";\n\ninterface ITableRowData {\n content?: string;\n level?: number;\n exp?: number;\n}\n\ninterface IProps {\n name: string;\n color: string;\n classes?: any;\n data?: ITableRowData;\n children?: React.ReactElement;\n}\n\nexport const StatsRow = ({ name, color, classes = useStyles(), children, data }: IProps): React.ReactElement => {\n let content = \"\";\n\n if (data) {\n if (data.content !== undefined) {\n content = data.content;\n } else if (data.level !== undefined && data.exp !== undefined) {\n content = `${formatNumber(data.level, 0)} (${numeralWrapper.formatExp(data.exp)} exp)`;\n } else if (data.level !== undefined && data.exp === undefined) {\n content = `${formatNumber(data.level, 0)}`;\n }\n }\n\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 {content ? <Typography style={{ color: color }}>{content}</Typography> : <></>}\n {children}\n </TableCell>\n </TableRow>\n );\n};\n","export enum PositionTypes {\n Long = \"L\",\n Short = \"S\",\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 { Augmentation } from \"./Augmentation\";\nimport { IMap } from \"../types\";\n\nexport const StaticAugmentations: IMap<Augmentation> = {};\n","import { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Reviver } from \"../utils/JSONReviver\";\n\ninterface GangTerritory {\n power: number;\n territory: number;\n}\n\nexport let AllGangs: {\n [key: string]: GangTerritory;\n} = {\n [FactionNames.SlumSnakes]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.Tetrads]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheSyndicate]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheDarkArmy]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.SpeakersForTheDead]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.NiteSec]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheBlackHand]: {\n power: 1,\n territory: 1 / 7,\n },\n};\n\nexport function resetGangs(): void {\n AllGangs = {\n [FactionNames.SlumSnakes]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.Tetrads]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheSyndicate]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheDarkArmy]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.SpeakersForTheDead]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.NiteSec]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheBlackHand]: {\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","/**\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 // A valid directory name:\n // Must be at least 1 character long\n // Can only include characters in the character set [-.%a-zA-Z0-9_]\n // Cannot end with a '.'\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) {\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 { Terminal as TTerminal } from \"./Terminal/Terminal\";\n\nexport const Terminal = new TTerminal();\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 { Crime } from \"./Crime\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { IMap } from \"../types\";\n\nimport { CrimeType } from \"../utils/WorkType\";\n\nexport const Crimes: IMap<Crime> = {\n Shoplift: new Crime(\"Shoplift\", CrimeType.Shoplift, 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\", CrimeType.RobStore, 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\", CrimeType.Mug, 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\", CrimeType.Larceny, 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\", CrimeType.Drugs, 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\", CrimeType.BondForgery, 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\", CrimeType.TraffickArms, 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\", CrimeType.Homicide, 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\", CrimeType.GrandTheftAuto, 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\", CrimeType.Kidnap, 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\", CrimeType.Assassination, 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\", CrimeType.Heist, 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 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 initStockMarketFn,\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 { GraftingRoot } from \"../PersonObjects/Grafting/ui/GraftingRoot\";\nimport { WorkInProgressRoot } from \"./WorkInProgressRoot\";\nimport { GameOptionsRoot } from \"../GameOptions/ui/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 \"./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\";\nimport { Apr1 } from \"./Apr1\";\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\nconst uninitialized = (): any => {\n throw new Error(\"Router called before initialization\");\n};\n\nexport let Router: IRouter = {\n isInitialized: false,\n page: uninitialized,\n allowRouting: uninitialized,\n toActiveScripts: uninitialized,\n toAugmentations: uninitialized,\n toBitVerse: uninitialized,\n toBladeburner: uninitialized,\n toStats: uninitialized,\n toCity: uninitialized,\n toCorporation: uninitialized,\n toCreateProgram: uninitialized,\n toDevMenu: uninitialized,\n toFaction: uninitialized,\n toFactions: uninitialized,\n toGameOptions: uninitialized,\n toGang: uninitialized,\n toHacknetNodes: uninitialized,\n toInfiltration: uninitialized,\n toJob: uninitialized,\n toMilestones: uninitialized,\n toGrafting: uninitialized,\n toScriptEditor: uninitialized,\n toSleeves: uninitialized,\n toStockMarket: uninitialized,\n toTerminal: uninitialized,\n toTravel: uninitialized,\n toTutorial: uninitialized,\n toWork: uninitialized,\n toBladeburnerCinematic: uninitialized,\n toLocation: uninitialized,\n toStaneksGift: uninitialized,\n toAchievements: uninitialized,\n toThemeBrowser: uninitialized,\n toImportSave: uninitialized,\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 [augPage, setAugPage] = useState<boolean>(false);\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 isInitialized: true,\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, augPage = false) => {\n setAugPage(augPage);\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 toGrafting: () => setPage(Page.Grafting),\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 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 installAugmentations(true);\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} augPage={augPage} />;\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.Grafting: {\n mainPage = <GraftingRoot />;\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={initStockMarketFn}\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 }}\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 = <ImportSaveRoot importString={importString} automatic={importAutomatic} router={Router} />;\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 <Apr1 />\n </SnackbarProvider>\n </BypassWrapper>\n </ErrorBoundary>\n </Context.Router.Provider>\n </Context.Player.Provider>\n );\n}\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 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\nexport enum ToastVariant {\n SUCCESS = \"success\",\n WARNING = \"warning\",\n ERROR = \"error\",\n INFO = \"info\",\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\n dense\n maxSnack={9}\n anchorOrigin={{ horizontal: \"right\", vertical: \"bottom\" }}\n autoHideDuration={2000}\n classes={{ containerRoot: classes.snackbar }}\n >\n {props.children}\n </SB>\n );\n}\n\nexport const SnackbarEvents = new EventEmitter<[string | React.ReactNode, ToastVariant, 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 { 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 { 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\nexport function 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\nexport function calculateGrid(gift: IStaneksGift): number[][] {\n const newgrid = zeros([gift.width(), gift.height()]) as unknown as number[][];\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","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 =\n (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 initStockMarketFn(): void {\n initStockMarket();\n initSymbolToStockMap();\n}\n\nexport const eventEmitterForUiReset = new EventEmitter<[]>();\n","import { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\nimport { PlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\nimport { Faction } from \"./Faction\";\nimport { Factions } from \"./Factions\";\nimport { Player } from \"../Player\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Settings } from \"../Settings/Settings\";\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"../PersonObjects/formulas/reputation\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { InvitationEvent } from \"./ui/InvitationModal\";\nimport { FactionNames } from \"./data/FactionNames\";\nimport { SFC32RNG } from \"../Casino/RNG\";\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 allFactions = Object.values(FactionNames).map((faction) => faction as string);\n Player.factions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b));\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 return aug.prereqs.every((aug) => Player.hasAugmentation(aug));\n}\n\nexport function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = false): string {\n const hasPrereqs = hasAugmentationPrereqs(aug);\n const augCosts = aug.getCost(Player);\n if (!hasPrereqs) {\n const txt = `You must first purchase or install ${aug.prereqs\n .filter((req) => !Player.hasAugmentation(req))\n .join(\",\")} before you can purchase this one.`;\n if (sing) {\n return txt;\n } else {\n dialogBoxCreate(txt);\n }\n } else if (augCosts.moneyCost !== 0 && Player.money < augCosts.moneyCost) {\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 < augCosts.repCost) {\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 (augCosts.moneyCost === 0 || Player.money >= augCosts.moneyCost) {\n const queuedAugmentation = new PlayerOwnedAugmentation(aug.name);\n if (aug.name == AugmentationNames.NeuroFluxGovernor) {\n queuedAugmentation.level = aug.getLevel(Player);\n }\n Player.queuedAugmentations.push(queuedAugmentation);\n\n Player.loseMoney(augCosts.moneyCost, \"augmentations\");\n\n if (sing) {\n return \"You purchased \" + aug.name;\n } else 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 } 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 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\nexport const getFactionAugmentationsFiltered = (player: IPlayer, faction: Faction): string[] => {\n // If player has a gang with this faction, return (almost) all augmentations\n if (player.hasGangWith(faction.name)) {\n let augs = Object.values(StaticAugmentations);\n\n // Remove special augs\n augs = augs.filter((a) => !a.isSpecial && a.name !== AugmentationNames.CongruityImplant);\n\n if (player.bitNodeN === 2) {\n // TRP is not available outside of BN2 for Gangs\n augs.push(StaticAugmentations[AugmentationNames.TheRedPill]);\n }\n\n const rng = SFC32RNG(`BN${player.bitNodeN}.${player.sourceFileLvl(player.bitNodeN)}`);\n // Remove faction-unique augs that don't belong to this faction\n const uniqueFilter = (a: Augmentation): boolean => {\n // Keep all the non-unique one\n if (a.factions.length > 1) {\n return true;\n }\n // Keep all the ones that this faction has anyway.\n if (faction.augmentations.includes(a.name)) {\n return true;\n }\n\n return rng() >= 1 - BitNodeMultipliers.GangUniqueAugs;\n };\n augs = augs.filter(uniqueFilter);\n\n return augs.map((a) => a.name);\n }\n\n return faction.augmentations.slice();\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 TrueRecursion = \"TrueRecursion\",\n INeedARainbow = \"INeedARainbow\",\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 TrueRecursion: \"by truly recursing.\",\n INeedARainbow: \"by using the power of the rainbow.\",\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 { isString } from \"./utils/helpers/isString\";\nimport { GetServer } from \"./Server/AllServers\";\nimport { ScriptDeath } from \"./Netscript/ScriptDeath\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\n\nexport function netscriptDelay(time: number, workerScript: WorkerScript): Promise<void> {\n // Cancel any pre-existing netscriptDelay'ed function call\n // TODO: the rejection almost certainly ends up in the uncaught rejection handler.\n // Maybe reject with a stack-trace'd error message?\n if (workerScript.delayReject) workerScript.delayReject();\n\n return new Promise(function (resolve, reject) {\n workerScript.delay = window.setTimeout(() => {\n workerScript.delay = null;\n workerScript.delayReject = undefined;\n\n workerScript.infiniteLoopSafetyCounter = 0;\n if (workerScript.env.stopFlag) reject(new ScriptDeath(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 return splitMsg.length == 4;\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 { Player, loadPlayer } from \"./Player\";\nimport {\n saveAllServers,\n loadAllServers,\n GetAllServers,\n createUniqueRandomIp,\n AddToAllServers,\n GetServer,\n} from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { loadStockMarket, StockMarket } from \"./StockMarket/StockMarket\";\nimport { staneksGift, loadStaneksGift } from \"./CotMG/Helper\";\n\nimport { SnackbarEvents, ToastVariant } 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\";\nimport { defaultMonacoTheme } from \"./ScriptEditor/ui/themes\";\nimport { FactionNames } from \"./Faction/data/FactionNames\";\nimport { Faction } from \"./Faction/Faction\";\nimport { safetlyCreateUniqueServer } from \"./Server/ServerHelpers\";\nimport { SpecialServers } from \"./Server/data/SpecialServers\";\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 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.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!\", ToastVariant.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${Player.sourceFileLvl(bn) + 1}.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\") {\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 if (ver < 12) {\n if (anyPlayer.resleeves !== undefined) {\n delete anyPlayer.resleeves;\n }\n }\n if (ver < 15) {\n (Settings as any).EditorTheme = { ...defaultMonacoTheme };\n }\n //Fix contract names\n if (ver < 16) {\n Factions[FactionNames.ShadowsOfAnarchy] = new Faction(FactionNames.ShadowsOfAnarchy);\n //Iterate over all contracts on all servers\n for (const server of GetAllServers()) {\n for (const contract of server.contracts) {\n //Rename old \"HammingCodes: Integer to encoded Binary\" contracts\n //to \"HammingCodes: Integer to Encoded Binary\"\n if (contract.type == \"HammingCodes: Integer to encoded Binary\") {\n contract.type = \"HammingCodes: Integer to Encoded Binary\";\n }\n }\n }\n }\n\n // Fix bugged NFG accumulation in owned augmentations\n if (ver < 17) {\n let ownedNFGs = [...Player.augmentations];\n ownedNFGs = ownedNFGs.filter((aug) => aug.name === AugmentationNames.NeuroFluxGovernor);\n const newNFG = new PlayerOwnedAugmentation(AugmentationNames.NeuroFluxGovernor);\n newNFG.level = 0;\n\n for (const nfg of ownedNFGs) {\n newNFG.level += nfg.level;\n }\n\n Player.augmentations = [\n ...Player.augmentations.filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor),\n newNFG,\n ];\n\n Player.reapplyAllAugmentations(true);\n Player.reapplyAllSourceFiles();\n }\n if (ver < 20) {\n // Create the darkweb for everyone but it won't be linked\n const dw = GetServer(SpecialServers.DarkWeb);\n if (!dw) {\n const darkweb = safetlyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: SpecialServers.DarkWeb,\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: false,\n purchasedByPlayer: false,\n maxRam: 1,\n });\n AddToAllServers(darkweb);\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(\"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 React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Money } from \"./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 { Augmentation } from \"./Augmentation\";\nimport { StaticAugmentations } from \"./StaticAugmentations\";\nimport { PlayerOwnedAugmentation, IPlayerOwnedAugmentation } from \"./PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"./data/AugmentationNames\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { Factions, factionExists } from \"../Faction/Factions\";\nimport { Player } from \"../Player\";\nimport { prestigeAugmentation } from \"../Prestige\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { clearObject } from \"../utils/helpers/clearObject\";\n\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport {\n initBladeburnerAugmentations,\n initChurchOfTheMachineGodAugmentations,\n initGeneralAugmentations,\n initSoAAugmentations,\n initNeuroFluxGovernor,\n initUnstableCircadianModulator,\n} from \"./data/AugmentationCreator\";\nimport { Router } from \"../ui/GameRoot\";\n\nexport function AddToStaticAugmentations(aug: Augmentation): void {\n const name = aug.name;\n StaticAugmentations[name] = aug;\n}\n\nfunction createAugmentations(): void {\n [\n initNeuroFluxGovernor(),\n initUnstableCircadianModulator(),\n ...initGeneralAugmentations(),\n ...initSoAAugmentations(),\n ...(factionExists(FactionNames.Bladeburners) ? initBladeburnerAugmentations() : []),\n ...(factionExists(FactionNames.ChurchOfTheMachineGod) ? initChurchOfTheMachineGodAugmentations() : []),\n ].map(resetAugmentation);\n}\n\nfunction resetFactionAugmentations(): void {\n for (const name of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(name)) {\n Factions[name].augmentations = [];\n }\n }\n}\n\nfunction initAugmentations(): void {\n resetFactionAugmentations();\n clearObject(StaticAugmentations);\n createAugmentations();\n Player.reapplyAllAugmentations();\n}\n\nexport function getBaseAugmentationPriceMultiplier(): number {\n return CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][Player.sourceFileLvl(11)];\n}\nexport function getGenericAugmentationPriceMultiplier(): number {\n return Math.pow(getBaseAugmentationPriceMultiplier(), Player.queuedAugmentations.length);\n}\n\n//Resets an Augmentation during (re-initizliation)\nfunction resetAugmentation(aug: Augmentation): void {\n aug.addToFactions(aug.factions);\n const name = aug.name;\n if (augmentationExists(name)) {\n delete StaticAugmentations[name];\n }\n AddToStaticAugmentations(aug);\n}\n\nfunction applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void {\n const staticAugmentation = StaticAugmentations[aug.name];\n\n // Apply multipliers\n for (const mult of Object.keys(staticAugmentation.mults)) {\n const v = Player.getMult(mult) * staticAugmentation.mults[mult];\n Player.setMult(mult, v);\n }\n\n // Special logic for Congruity Implant\n if (aug.name === AugmentationNames.CongruityImplant && !reapply) {\n Player.entropy = 0;\n Player.applyEntropy(Player.entropy);\n }\n\n // Special logic for NeuroFlux Governor\n const ownedNfg = Player.augmentations.find((pAug) => pAug.name === AugmentationNames.NeuroFluxGovernor);\n if (aug.name === AugmentationNames.NeuroFluxGovernor && !reapply && ownedNfg) {\n ownedNfg.level = aug.level;\n return;\n }\n\n // Push onto Player's Augmentation list\n if (!reapply) {\n const ownedAug = new PlayerOwnedAugmentation(aug.name);\n\n Player.augmentations.push(ownedAug);\n }\n}\n\nfunction installAugmentations(force?: boolean): boolean {\n if (Player.queuedAugmentations.length == 0 && !force) {\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 = StaticAugmentations[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 if (!force) {\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 }\n prestigeAugmentation();\n Router.toTerminal();\n return true;\n}\n\nfunction augmentationExists(name: string): boolean {\n return StaticAugmentations.hasOwnProperty(name);\n}\n\nexport function isRepeatableAug(aug: Augmentation): boolean {\n const augName = aug instanceof Augmentation ? aug.name : aug;\n return augName === AugmentationNames.NeuroFluxGovernor;\n}\n\nexport { installAugmentations, initAugmentations, applyAugmentation, augmentationExists };\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 Object.assign({}, this);\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","export interface IScriptEditorTheme {\n [key: string]: any;\n base: string;\n inherit: boolean;\n common: {\n [key: string]: string;\n accent: string;\n bg: string;\n fg: string;\n };\n syntax: {\n [key: string]: string;\n tag: string;\n entity: string;\n string: string;\n regexp: string;\n markup: string;\n keyword: string;\n comment: string;\n constant: string;\n error: string;\n };\n ui: {\n [key: string]: any;\n line: string;\n panel: {\n [key: string]: string;\n bg: string;\n selected: string;\n border: string;\n };\n selection: {\n [key: string]: string;\n bg: string;\n };\n };\n}\n\nexport const defaultMonacoTheme: IScriptEditorTheme = {\n base: \"vs-dark\",\n inherit: true,\n common: {\n accent: \"B5CEA8\",\n bg: \"1E1E1E\",\n fg: \"D4D4D4\",\n },\n syntax: {\n tag: \"569CD6\",\n entity: \"569CD6\",\n string: \"CE9178\",\n regexp: \"646695\",\n markup: \"569CD6\",\n keyword: \"569CD6\",\n comment: \"6A9955\",\n constant: \"569CD6\",\n error: \"F44747\",\n },\n ui: {\n line: \"1E1E1E\",\n panel: {\n bg: \"252526\",\n selected: \"252526\",\n border: \"1E1E1E\",\n },\n selection: {\n bg: \"ADD6FF26\",\n },\n },\n};\n\n// Regex used for token color validation\n// https://github.com/microsoft/vscode/blob/973684056e67153952f495fce93bf50d0ec0b892/src/vs/editor/common/languages/supports/tokenization.ts#L153\nconst colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;\n\n// Recursively sanitize the theme data to prevent errors\n// Invalid data will be replaced with FF0000 (bright red)\nexport const sanitizeTheme = (theme: IScriptEditorTheme): void => {\n for (const [k, v] of Object.entries(theme)) {\n switch (k) {\n case \"base\":\n if (![\"vs-dark\", \"vs\"].includes(theme.base)) theme.base = \"vs-dark\";\n continue;\n case \"inherit\":\n if (typeof theme.inherit !== \"boolean\") theme.inherit = true;\n continue;\n }\n\n const repairBlock = (block: { [key: string]: any }): void => {\n for (const [k, v] of Object.entries(block)) {\n if (typeof v === \"object\") {\n repairBlock(v as { [key: string]: string });\n } else if (!v.match(colorRegExp)) block[k] = \"FF0000\";\n }\n };\n repairBlock(v);\n }\n};\n\nexport function makeTheme(theme: IScriptEditorTheme): any {\n const themeRules = [\n {\n token: \"\",\n background: theme.ui.line,\n foreground: theme.common.fg,\n },\n {\n token: \"identifier\",\n foreground: theme.common.accent,\n },\n {\n token: \"keyword\",\n foreground: theme.syntax.keyword,\n },\n {\n token: \"string\",\n foreground: theme.syntax.string,\n },\n {\n token: \"string.escape\",\n foreground: theme.syntax.regexp,\n },\n {\n token: \"comment\",\n foreground: theme.syntax.comment,\n },\n {\n token: \"constant\",\n foreground: theme.syntax.constant,\n },\n {\n token: \"entity\",\n foreground: theme.syntax.entity,\n },\n {\n token: \"type\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"tag\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"regexp\",\n foreground: theme.syntax.regexp,\n },\n {\n token: \"attribute\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"constructor\",\n foreground: theme.syntax.markup,\n },\n {\n token: \"invalid\",\n foreground: theme.syntax.error,\n },\n {\n token: \"number\",\n foreground: theme.common.accent,\n },\n {\n token: \"delimiter\",\n foreground: theme.common.fg,\n },\n // Custom tokens\n {\n token: \"ns\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"netscriptfunction\",\n foreground: theme.syntax.markup,\n },\n {\n token: \"otherkeywords\",\n foreground: theme.syntax.keyword,\n },\n {\n token: \"otherkeyvars\",\n foreground: theme.common.accent,\n },\n {\n token: \"this\",\n foreground: theme.syntax.tag,\n },\n ];\n\n const themeColors = Object.fromEntries(\n [\n [\"editor.background\", theme.common.bg],\n [\"editor.foreground\", theme.common.fg],\n [\"editor.lineHighlightBackground\", theme.ui.line],\n [\"editor.selectionBackground\", theme.ui.selection.bg],\n\n [\"editorSuggestWidget.background\", theme.ui.panel.bg],\n [\"editorSuggestWidget.border\", theme.ui.panel.border],\n [\"editorSuggestWidget.selectedBackground\", theme.ui.panel.selected],\n\n [\"editorHoverWidget.background\", theme.ui.panel.bg],\n [\"editorHoverWidget.border\", theme.ui.panel.border],\n\n [\"editorWidget.background\", theme.ui.panel.bg],\n [\"editorWidget.border\", theme.ui.panel.border],\n\n [\"input.background\", theme.ui.panel.bg],\n [\"input.border\", theme.ui.panel.border],\n ].map(([k, v]) => [k, \"#\" + v]),\n );\n\n return { base: theme.base, inherit: theme.inherit, rules: themeRules, colors: themeColors };\n}\n\nexport 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","/**\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 * as React from \"react\";\nimport { numeralWrapper } from \"../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","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 { KEY } from \"../utils/helpers/keyCodes\";\n\nexport function random(min: number, max: number): number {\n return Math.random() * (max - min) + min;\n}\n\nexport const upArrowSymbol = \"↑\";\nexport const downArrowSymbol = \"↓\";\nexport const leftArrowSymbol = \"←\";\nexport const rightArrowSymbol = \"→\";\n\nexport function getArrow(event: KeyboardEvent): string {\n switch (event.key) {\n case KEY.UP_ARROW:\n case KEY.W:\n return upArrowSymbol;\n case KEY.LEFT_ARROW:\n case KEY.A:\n return leftArrowSymbol;\n case KEY.DOWN_ARROW:\n case KEY.S:\n return downArrowSymbol;\n case KEY.RIGHT_ARROW:\n case KEY.D:\n return rightArrowSymbol;\n }\n return \"\";\n}\n\nexport function getInverseArrow(event: KeyboardEvent): string {\n switch (event.key) {\n case KEY.DOWN_ARROW:\n case KEY.S:\n return upArrowSymbol;\n case KEY.RIGHT_ARROW:\n case KEY.D:\n return leftArrowSymbol;\n case KEY.UP_ARROW:\n case KEY.W:\n return downArrowSymbol;\n case KEY.LEFT_ARROW:\n case KEY.A:\n return rightArrowSymbol;\n }\n return \"\";\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","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/**\n * Replacement function for the above function that accounts for the +$1/thread functionality of grow\n * with parameters that are the same (for compatibility), but functionality is slightly different.\n * This function can ONLY be used to calculate the threads needed for a given server in its current state,\n * and so wouldn't be appropriate to use for formulas.exe or ns.growthAnalyze (as those are meant to\n * provide theoretical scenarios, or inverse hack respectively). Players COULD use this function with a\n * custom server object with the correct moneyAvailable and moneyMax amounts, combined with a multiplier\n * correctly calculated to bring the server to a new moneyAvailable (ie, passing in moneyAvailable 300 and x2\n * when you want the number of threads required to grow that particular server from 300 to 600), and this\n * function would pass back the correct number of threads. But the key thing is that it doesn't just\n * inverse/undo a hack (since the amount hacked from/to matters, not just the multiplier).\n * The above is also a rather unnecessarily obtuse way of thinking about it for a formulas.exe type of\n * application, so another function with different parameters is provided for that case below this one.\n * Instead this function is meant to hand-off from the old numCycleForGrowth function to the new one\n * where used internally for pro-rating or the like. Where you have applied a grow and want to determine\n * how many threads were needed for THAT SPECIFIC grow case using a multiplier.\n * Ideally, this function, and the original function above will be depreciated to use the methodology\n * and inputs of the new function below this one. Even for internal cases (it's actually easier to do so).\n * @param server - Server being grown\n * @param growth - How much the server money is expected to be multiplied by (e.g. 1.5 for *1.5 / +50%)\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowthTransition(server: Server, growth: number, p: IPlayer, cores = 1): number {\n return numCycleForGrowthCorrected(server, server.moneyAvailable * growth, server.moneyAvailable, p, cores);\n}\n\n/**\n * This function calculates the number of threads needed to grow a server from one $amount to a higher $amount\n * (ie, how many threads to grow this server from $200 to $600 for example). Used primarily for a formulas (or possibly growthAnalyze)\n * type of application. It lets you \"theorycraft\" and easily ask what-if type questions. It's also the one that implements the\n * main thread calculation algorithm, and so is the function all helper functions should call.\n * It protects the inputs (so putting in INFINITY for targetMoney will use moneyMax, putting in a negative for start will use 0, etc.)\n * @param server - Server being grown\n * @param targetMoney - How much you want the server grown TO (not by), for instance, to grow from 200 to 600, input 600\n * @param startMoney - How much you are growing the server from, for instance, to grow from 200 to 600, input 200\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowthCorrected(\n server: Server,\n targetMoney: number,\n startMoney: number,\n p: IPlayer,\n cores = 1,\n): number {\n if (startMoney < 0) {\n startMoney = 0;\n } // servers \"can't\" have less than 0 dollars on them\n if (targetMoney > server.moneyMax) {\n targetMoney = server.moneyMax;\n } // can't grow a server to more than its moneyMax\n if (targetMoney <= startMoney) {\n return 0;\n } // no growth --> no threads\n\n // exponential base adjusted by security\n const adjGrowthRate = 1 + (CONSTANTS.ServerBaseGrowthRate - 1) / server.hackDifficulty;\n const exponentialBase = Math.min(adjGrowthRate, CONSTANTS.ServerMaxGrowthRate); // cap growth rate\n\n // total of all grow thread multipliers\n const serverGrowthPercentage = server.serverGrowth / 100.0;\n const coreMultiplier = 1 + (cores - 1) / 16;\n const threadMultiplier =\n serverGrowthPercentage * p.hacking_grow_mult * coreMultiplier * BitNodeMultipliers.ServerGrowthRate;\n\n /* To understand what is done below we need to do some math. I hope the explanation is clear enough.\n * First of, the names will be shortened for ease of manipulation:\n * n:= targetMoney (n for new), o:= startMoney (o for old), b:= exponentialBase, t:= threadMultiplier, c:= cycles/threads\n * c is what we are trying to compute.\n *\n * After growing, the money on a server is n = (o + c) * b^(c*t)\n * c appears in an exponent and outside it, this is usually solved using the productLog/lambert's W special function\n * this function will be noted W in the following\n * The idea behind lambert's W function is W(x)*exp(W(x)) = x, or in other words, solving for y, y*exp(y) = x, as a function of x\n * This function is provided in some advanced math library but we will compute it ourself here.\n *\n * Let's get back to solving the equation. It cannot be rewrote using W immediately because the base of the exponentiation is b\n * b^(c*t) = exp(ln(b)*c*t) (this is how a^b is defined on reals, it matches the definition on integers)\n * so n = (o + c) * exp(ln(b)*c*t) , W still cannot be used directly. We want to eliminate the other terms in 'o + c' and 'ln(b)*c*t'.\n *\n * A change of variable will do. The idea is to add an equation introducing a new variable (w here) in the form c = f(w) (for some f)\n * With this equation we will eliminate all references to c, then solve for w and plug the result in the new equation to get c.\n * The change of variable performed here should get rid of the unwanted terms mentionned above, c = w/(ln(b)*t) - o should help.\n * This change of variable is allowed because whatever the value of c is, there is a value of w such that this equation holds:\n * w = (c + o)*ln(b)*t (see how we used the terms we wanted to eliminate in order to build this variable change)\n *\n * We get n = (o + w/(ln(b)*t) - o) * exp(ln(b)*(w/(ln(b)*t) - o)*t) [ = w/(ln(b)*t) * exp(w - ln(b)*o*t) ]\n * The change of variable exposed exp(w - o*ln(b)*t), we can rewrite that with exp(a - b) = exp(a)/exp(b) to isolate 'w*exp(w)'\n * n = w/(ln(b)*t) * exp(w)/exp(ln(b)*o*t) [ = w*exp(w) / (ln(b) * t * b^(o*t)) ]\n * Almost there, we just need to cancel the denominator on the right side of the equation:\n * n * ln(b) * t * b^(o*t) = w*exp(w), Thus w = W(n * ln(b) * t * b^(o*t))\n * Finally we invert the variable change: c = W(n * ln(b) * t * b^(o*t))/(ln(b)*t) - o\n *\n * There is still an issue left: b^(o*t) doesn't fit inside a double precision float\n * because the typical amount of money on servers is arround 10^6~10^9\n * We need to get an approximation of W without computing the power when o is huge\n * Thankfully an approximation giving ~30% error uses log immediately so we will use\n * W(n * ln(b) * t * b^(o*t)) ~= log(n * ln(b) * t * b^(o*t)) = log(n * ln(b) * t) + log(exp(ln(b) * o * t))\n * = log(n * ln(b) * t) + ln(b) * o * t\n * (thanks to Drak for the grow formula, f4113nb34st and Wolfram Alpha for the rewrite, dwRchyngqxs for the explanation)\n */\n const x = threadMultiplier * Math.log(exponentialBase);\n const y = startMoney * x + Math.log(targetMoney * x);\n /* Code for the approximation of lambert's W function is adapted from\n * https://git.savannah.gnu.org/cgit/gsl.git/tree/specfunc/lambert.c\n * using the articles [1] https://doi.org/10.1007/BF02124750 (algorithm above)\n * and [2] https://doi.org/10.1145/361952.361970 (initial approximation when x < 2.5)\n */\n let w;\n if (y < Math.log(2.5)) {\n /* exp(y) can be safely computed without overflow.\n * The relative error on the result is better when exp(y) < 2.5\n * using Padé rational fraction approximation [2](5)\n */\n const ey = Math.exp(y);\n w = (ey + (4 / 3) * ey * ey) / (1 + (7 / 3) * ey + (5 / 6) * ey * ey);\n } else {\n /* obtain initial approximation from rough asymptotic [1](4.18)\n * w = y [- log y when 0 <= y]\n */\n w = y;\n if (y > 0) w -= Math.log(y);\n }\n let cycles = w / x - startMoney;\n\n /* Iterative refinement, the goal is to correct c until |(o + c) * b^(c*t) - n| < 1\n * or the correction on the approximation is less than 1\n * The Newton-Raphson method will be used, this method is a classic to find roots of functions\n * (given f, find c such that f(c) = 0).\n *\n * The idea of this method is to take the horizontal position at which the horizontal axis\n * intersects with of the tangent of the function's curve as the next approximation.\n * It is equivalent to treating the curve as a line (it is called a first order approximation)\n * If the current approximation is c then the new approximated value is c - f(c)/f'(c)\n * (where f' is the derivative of f).\n *\n * In our case f(c) = (o + c) * b^(c*t) - n, f'(c) = d((o + c) * b^(c*t) - n)/dc\n * = (ln(b)*t * (c + o) + 1) * b^(c*t)\n * And the update step is c[new] = c[old] - ((o + c) * b^(c*t) - n)/((ln(b)*t * (o + c) + 1) * b^(c*t))\n *\n * The main question to ask when using this method is \"does it converges?\"\n * (are the approximations getting better?), if it does then it does quickly.\n * DOES IT CONVERGES? In the present case it does. The reason why doesn't help explaining the algorithm.\n * If you are intrested then check out the wikipedia page.\n */\n const bt = exponentialBase ** threadMultiplier;\n let corr = Infinity;\n // Two sided error because we do not want to get stuck if the error stays on the wrong side\n do {\n // c should be above 0 so Halley's method can't be used, we have to stick to Newton-Raphson\n const bct = bt ** cycles;\n const opc = startMoney + cycles;\n const diff = opc * bct - targetMoney;\n corr = diff / (opc * x + 1.0) / bct;\n cycles -= corr;\n } while (Math.abs(corr) >= 1);\n /* c is now within +/- 1 of the exact result.\n * We want the ceiling of the exact result, so the floor if the approximation is above,\n * the ceiling if the approximation is in the same unit as the exact result,\n * and the ceiling + 1 if the approximation is below.\n */\n const fca = Math.floor(cycles);\n if (targetMoney <= (startMoney + fca) * Math.pow(exponentialBase, fca * threadMultiplier)) {\n return fca;\n }\n const cca = Math.ceil(cycles);\n if (targetMoney <= (startMoney + cca) * Math.pow(exponentialBase, cca * threadMultiplier)) {\n return cca;\n }\n return cca + 1;\n}\n\n/**\n * This function calculates the number of threads needed to grow a server based on a pre-hack money and hackAmt\n * (ie, if you're hacking a server with $1e6 moneyAvail for 60%, this function will tell you how many threads to regrow it\n * A good replacement for the current ns.growthAnalyze if you want players to have more control/responsibility\n * @param server - Server being grown\n * @param hackProp - the proportion of money hacked (total, not per thread, like 0.60 for hacking 60% of available money)\n * @param prehackMoney - how much money the server had before being hacked (like 200000 for hacking a server that had $200000 on it at time of hacking)\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed to reverse the described hack\n */\nexport function numCycleForGrowthByHackAmt(\n server: Server,\n hackProp: number,\n prehackMoney: number,\n p: IPlayer,\n cores = 1,\n): number {\n if (prehackMoney > server.moneyMax) prehackMoney = server.moneyMax;\n const posthackMoney = Math.floor(prehackMoney * Math.min(1, Math.max(0, 1 - hackProp)));\n return numCycleForGrowthCorrected(server, prehackMoney, posthackMoney, p, cores);\n}\n\n/**\n * This function calculates the number of threads needed to grow a server based on an expected growth multiplier assuming it will max out\n * (ie, if you expect to grow a server by 60% to reach maxMoney, this function will tell you how many threads to grow it)\n * PROBABLY the best replacement for the current ns.growthAnalyze to maintain existing scripts\n * @param server - Server being grown\n * @param growth - How much the server is being grown by, as a multiple in DECIMAL form (e.g. 1.5 rather than 50). Infinity is acceptable.\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowthByMultiplier(server: Server, growth: number, p: IPlayer, cores = 1): number {\n if (growth < 1.0) growth = 1.0;\n const targetMoney = server.moneyMax;\n const startingMoney = server.moneyMax / growth;\n return numCycleForGrowthCorrected(server, targetMoney, startingMoney, p, cores);\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 let usedCycles = numCycleForGrowthCorrected(server, server.moneyAvailable, oldMoneyAvailable, p, cores);\n // Growing increases server security twice as much as hacking\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","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","/**\n * Stops an actively-running script (represented by a WorkerScript object)\n * and removes it from the global pool of active scripts.\n */\nimport { ScriptDeath } from \"./ScriptDeath\";\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(new ScriptDeath(workerScript));\n }\n }\n }\n}\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 * 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 from \"react\";\nimport { BitNodeMultipliers, IBitNodeMultipliers } from \"./BitNodeMultipliers\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IMap } from \"../types\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { CityName } from \"../Locations/data/CityNames\";\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 Certain Factions ({FactionNames.SlumSnakes}, {FactionNames.Tetrads}, {FactionNames.TheSyndicate},{\" \"}\n {FactionNames.TheDarkArmy}, {FactionNames.SpeakersForTheDead}, {FactionNames.NiteSec}, {FactionNames.TheBlackHand}\n ) 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 <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.\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 <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 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. Higher Intelligence levels will boost your production for many actions\n 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 FactionNames.Bladeburners,\n \"Like Tears in Rain\",\n (\n <>\n In the middle of the 21st century, {FactionNames.OmniTekIncorporated} began designing and manufacturing advanced\n synthetic androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth\n generation of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was\n the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more\n intelligent than the humans that had created them.\n <br />\n <br />\n In this BitNode you will be able to access the {FactionNames.Bladeburners} Division at the NSA, which provides a\n new mechanic for progression.\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 {FactionNames.Bladeburners} Division\n in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your\n 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);\nBitNodes[\"BitNode7\"] = new BitNode(\n 7,\n 2,\n `${FactionNames.Bladeburners} 2079`,\n \"More human than humans\",\n (\n <>\n In the middle of the 21st century, you were doing cutting-edge work at {FactionNames.OmniTekIncorporated} as part\n of the AI design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major\n technological 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 {FactionNames.Bladeburners} API, which allows you to access{\" \"}\n {FactionNames.Bladeburners}\n functionality through Netscript.\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 {FactionNames.Bladeburners} Netscript API in\n other BitNodes. In addition, this Source-File will increase all of your {FactionNames.Bladeburners} multipliers\n 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 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 <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 {FactionNames.FulcrumSecretTechnologies} released their open-source Linux distro Chapeau, it quickly became\n the OS of choice for the underground hacking community. Chapeau became especially notorious for powering the\n Hacknet, a global, decentralized network used for nefarious purposes. {FactionNames.FulcrumSecretTechnologies}{\" \"}\n quickly abandoned the project and dissociated 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 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. Grafting: Visit VitaLife in New Tokyo to be able to obtain Augmentations without needing to install\n <br />\n 2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks\n synchronously.\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 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{\" \"}\n {FactionNames.ChurchOfTheMachineGod} has 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 {CityName.Chongqing} and gain her trust.\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 {FactionNames.ChurchOfTheMachineGod} appear in other\n BitNodes.\n <br />\n <br />\n Each level of this Source-File increases the size of Stanek's Gift.\n </>\n ),\n);\n\nexport const defaultMultipliers: 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 GangUniqueAugs: 1,\n\n DaedalusAugsRequirement: 30,\n\n StaneksGiftPowerMultiplier: 1,\n StaneksGiftExtraSize: 0,\n\n WorldDaemonDifficulty: 1,\n};\n\nObject.freeze(defaultMultipliers);\n\nexport function getBitNodeMultipliers(n: number, lvl: number): IBitNodeMultipliers {\n const mults = Object.assign({}, defaultMultipliers);\n switch (n) {\n case 1: {\n return mults;\n }\n case 2: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.8,\n ServerGrowthRate: 0.8,\n ServerMaxMoney: 0.2,\n ServerStartingMoney: 0.4,\n CrimeMoney: 3,\n InfiltrationMoney: 3,\n FactionWorkRepGain: 0.5,\n FactionPassiveRepGain: 0,\n StaneksGiftPowerMultiplier: 2,\n StaneksGiftExtraSize: -6,\n PurchasedServerSoftcap: 1.3,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 5,\n });\n }\n case 3: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.8,\n RepToDonateToFaction: 0.5,\n AugmentationRepCost: 3,\n AugmentationMoneyCost: 3,\n ServerMaxMoney: 0.2,\n ServerStartingMoney: 0.2,\n ServerGrowthRate: 0.2,\n ScriptHackMoney: 0.2,\n CompanyWorkMoney: 0.25,\n CrimeMoney: 0.25,\n HacknetNodeMoney: 0.25,\n HomeComputerRamCost: 1.5,\n PurchasedServerCost: 2,\n StaneksGiftPowerMultiplier: 0.75,\n StaneksGiftExtraSize: -2,\n PurchasedServerSoftcap: 1.3,\n GangSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.5,\n });\n }\n case 4: {\n return Object.assign(mults, {\n ServerMaxMoney: 0.15,\n ServerStartingMoney: 0.75,\n ScriptHackMoney: 0.2,\n CompanyWorkMoney: 0.1,\n CrimeMoney: 0.2,\n HacknetNodeMoney: 0.05,\n CompanyWorkExpGain: 0.5,\n ClassGymExpGain: 0.5,\n FactionWorkExpGain: 0.5,\n HackExpGain: 0.4,\n CrimeExpGain: 0.5,\n FactionWorkRepGain: 0.75,\n StaneksGiftPowerMultiplier: 1.5,\n StaneksGiftExtraSize: 0,\n PurchasedServerSoftcap: 1.2,\n WorldDaemonDifficulty: 3,\n GangUniqueAugs: 0.5,\n });\n }\n case 5: {\n return Object.assign(mults, {\n ServerMaxMoney: 2,\n ServerStartingSecurity: 2,\n ServerStartingMoney: 0.5,\n ScriptHackMoney: 0.15,\n HacknetNodeMoney: 0.2,\n CrimeMoney: 0.5,\n InfiltrationRep: 1.5,\n InfiltrationMoney: 1.5,\n AugmentationMoneyCost: 2,\n HackExpGain: 0.5,\n CorporationValuation: 0.5,\n StaneksGiftPowerMultiplier: 1.3,\n StaneksGiftExtraSize: 0,\n PurchasedServerSoftcap: 1.2,\n WorldDaemonDifficulty: 1.5,\n GangUniqueAugs: 0.5,\n });\n }\n case 6: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.35,\n ServerMaxMoney: 0.4,\n ServerStartingMoney: 0.5,\n ServerStartingSecurity: 1.5,\n ScriptHackMoney: 0.75,\n CompanyWorkMoney: 0.5,\n CrimeMoney: 0.75,\n InfiltrationMoney: 0.75,\n CorporationValuation: 0.2,\n HacknetNodeMoney: 0.2,\n HackExpGain: 0.25,\n DaedalusAugsRequirement: 35,\n PurchasedServerSoftcap: 2,\n StaneksGiftPowerMultiplier: 0.5,\n StaneksGiftExtraSize: 2,\n GangSoftcap: 0.7,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.2,\n });\n }\n case 7: {\n return Object.assign(mults, {\n BladeburnerRank: 0.6,\n BladeburnerSkillCost: 2,\n AugmentationMoneyCost: 3,\n HackingLevelMultiplier: 0.35,\n ServerMaxMoney: 0.4,\n ServerStartingMoney: 0.5,\n ServerStartingSecurity: 1.5,\n ScriptHackMoney: 0.5,\n CompanyWorkMoney: 0.5,\n CrimeMoney: 0.75,\n InfiltrationMoney: 0.75,\n CorporationValuation: 0.2,\n HacknetNodeMoney: 0.2,\n HackExpGain: 0.25,\n FourSigmaMarketDataCost: 2,\n FourSigmaMarketDataApiCost: 2,\n DaedalusAugsRequirement: 35,\n PurchasedServerSoftcap: 2,\n StaneksGiftPowerMultiplier: 0.9,\n StaneksGiftExtraSize: -1,\n GangSoftcap: 0.7,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.2,\n });\n }\n case 8: {\n return Object.assign(mults, {\n ScriptHackMoney: 0.3,\n ScriptHackMoneyGain: 0,\n ManualHackMoney: 0,\n CompanyWorkMoney: 0,\n CrimeMoney: 0,\n HacknetNodeMoney: 0,\n InfiltrationMoney: 0,\n RepToDonateToFaction: 0,\n CorporationValuation: 0,\n CodingContractMoney: 0,\n StaneksGiftExtraSize: -99,\n PurchasedServerSoftcap: 4,\n GangSoftcap: 0,\n CorporationSoftcap: 0,\n GangUniqueAugs: 0,\n });\n }\n case 9: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.5,\n StrengthLevelMultiplier: 0.45,\n DefenseLevelMultiplier: 0.45,\n DexterityLevelMultiplier: 0.45,\n AgilityLevelMultiplier: 0.45,\n CharismaLevelMultiplier: 0.45,\n PurchasedServerLimit: 0,\n HomeComputerRamCost: 5,\n CrimeMoney: 0.5,\n ScriptHackMoney: 0.1,\n HackExpGain: 0.05,\n ServerStartingMoney: 0.1,\n ServerMaxMoney: 0.1,\n ServerStartingSecurity: 2.5,\n CorporationValuation: 0.5,\n FourSigmaMarketDataCost: 5,\n FourSigmaMarketDataApiCost: 4,\n BladeburnerRank: 0.9,\n BladeburnerSkillCost: 1.2,\n StaneksGiftPowerMultiplier: 0.5,\n StaneksGiftExtraSize: 2,\n GangSoftcap: 0.8,\n CorporationSoftcap: 0.7,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.25,\n });\n }\n case 10: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.35,\n StrengthLevelMultiplier: 0.4,\n DefenseLevelMultiplier: 0.4,\n DexterityLevelMultiplier: 0.4,\n AgilityLevelMultiplier: 0.4,\n CharismaLevelMultiplier: 0.4,\n CompanyWorkMoney: 0.5,\n CrimeMoney: 0.5,\n HacknetNodeMoney: 0.5,\n ManualHackMoney: 0.5,\n ScriptHackMoney: 0.5,\n CodingContractMoney: 0.5,\n InfiltrationMoney: 0.5,\n CorporationValuation: 0.5,\n AugmentationMoneyCost: 5,\n AugmentationRepCost: 2,\n HomeComputerRamCost: 1.5,\n PurchasedServerCost: 5,\n PurchasedServerLimit: 0.6,\n PurchasedServerMaxRam: 0.5,\n BladeburnerRank: 0.8,\n StaneksGiftPowerMultiplier: 0.75,\n StaneksGiftExtraSize: -3,\n PurchasedServerSoftcap: 1.1,\n GangSoftcap: 0.9,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.25,\n });\n }\n case 11: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.6,\n HackExpGain: 0.5,\n ServerMaxMoney: 0.1,\n ServerStartingMoney: 0.1,\n ServerGrowthRate: 0.2,\n ServerWeakenRate: 2,\n CrimeMoney: 3,\n CompanyWorkMoney: 0.5,\n HacknetNodeMoney: 0.1,\n AugmentationMoneyCost: 2,\n InfiltrationMoney: 2.5,\n InfiltrationRep: 2.5,\n CorporationValuation: 0.1,\n CodingContractMoney: 0.25,\n FourSigmaMarketDataCost: 4,\n FourSigmaMarketDataApiCost: 4,\n PurchasedServerSoftcap: 2,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 1.5,\n GangUniqueAugs: 0.75,\n });\n }\n case 12: {\n const inc = Math.pow(1.02, lvl);\n const dec = 1 / inc;\n\n return Object.assign(mults, {\n DaedalusAugsRequirement: Math.floor(Math.min(mults.DaedalusAugsRequirement + inc, 40)),\n\n HackingLevelMultiplier: dec,\n StrengthLevelMultiplier: dec,\n DefenseLevelMultiplier: dec,\n DexterityLevelMultiplier: dec,\n AgilityLevelMultiplier: dec,\n CharismaLevelMultiplier: dec,\n\n ServerMaxMoney: dec,\n ServerStartingMoney: dec,\n ServerGrowthRate: dec,\n ServerWeakenRate: dec,\n\n //Does not scale, otherwise security might start at 300+\n ServerStartingSecurity: 1.5,\n\n HomeComputerRamCost: inc,\n\n PurchasedServerCost: inc,\n PurchasedServerLimit: dec,\n PurchasedServerMaxRam: dec,\n PurchasedServerSoftcap: inc,\n\n ManualHackMoney: dec,\n ScriptHackMoney: dec,\n CompanyWorkMoney: dec,\n CrimeMoney: dec,\n HacknetNodeMoney: dec,\n CodingContractMoney: dec,\n\n CompanyWorkExpGain: dec,\n ClassGymExpGain: dec,\n FactionWorkExpGain: dec,\n HackExpGain: dec,\n CrimeExpGain: dec,\n\n FactionWorkRepGain: dec,\n FactionPassiveRepGain: dec,\n RepToDonateToFaction: inc,\n\n AugmentationRepCost: inc,\n AugmentationMoneyCost: inc,\n\n InfiltrationMoney: dec,\n InfiltrationRep: dec,\n\n FourSigmaMarketDataCost: inc,\n FourSigmaMarketDataApiCost: inc,\n\n CorporationValuation: dec,\n\n BladeburnerRank: dec,\n BladeburnerSkillCost: inc,\n\n StaneksGiftPowerMultiplier: inc,\n StaneksGiftExtraSize: inc,\n GangSoftcap: 0.8,\n CorporationSoftcap: 0.8,\n WorldDaemonDifficulty: inc,\n\n GangUniqueAugs: dec,\n });\n }\n case 13: {\n return Object.assign(mults, {\n PurchasedServerSoftcap: 1.6,\n\n HackingLevelMultiplier: 0.25,\n StrengthLevelMultiplier: 0.7,\n DefenseLevelMultiplier: 0.7,\n DexterityLevelMultiplier: 0.7,\n AgilityLevelMultiplier: 0.7,\n\n ServerMaxMoney: 0.45,\n ServerStartingMoney: 0.75,\n\n ServerStartingSecurity: 3,\n\n ScriptHackMoney: 0.2,\n CompanyWorkMoney: 0.4,\n CrimeMoney: 0.4,\n HacknetNodeMoney: 0.4,\n CodingContractMoney: 0.4,\n\n CompanyWorkExpGain: 0.5,\n ClassGymExpGain: 0.5,\n FactionWorkExpGain: 0.5,\n HackExpGain: 0.1,\n CrimeExpGain: 0.5,\n\n FactionWorkRepGain: 0.6,\n\n FourSigmaMarketDataCost: 10,\n FourSigmaMarketDataApiCost: 10,\n\n CorporationValuation: 0.001,\n\n BladeburnerRank: 0.45,\n BladeburnerSkillCost: 2,\n StaneksGiftPowerMultiplier: 2,\n StaneksGiftExtraSize: 1,\n GangSoftcap: 0.3,\n CorporationSoftcap: 0.3,\n WorldDaemonDifficulty: 3,\n GangUniqueAugs: 0.1,\n });\n }\n default: {\n throw new Error(\"Invalid BitNodeN\");\n }\n }\n}\n\nexport function initBitNodeMultipliers(p: IPlayer): void {\n Object.assign(BitNodeMultipliers, getBitNodeMultipliers(p.bitNodeN, p.sourceFileLvl(p.bitNodeN)));\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 if (this.b) {\n // Forecast decreases\n this.otlkMag -= changeAmt;\n } else {\n this.otlkMag += changeAmt;\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 { 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","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","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","/**\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, { 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","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 root: {\n backgroundColor: Settings.theme.backgroundsecondary,\n border: \"1px solid \" + Settings.theme.well,\n margin: \"3px\",\n\n \"&.Mui-selected\": {\n backgroundColor: Settings.theme.button,\n },\n },\n },\n },\n MuiTabs: {\n styleOverrides: {\n scrollButtons: {\n backgroundColor: Settings.theme.backgroundsecondary,\n color: Settings.theme.secondary,\n margin: \"3px\",\n opacity: 1,\n width: \"fit-content\",\n\n \"&.Mui-disabled\": {\n opacity: 0.5,\n },\n },\n },\n defaultProps: {\n TabIndicatorProps: {\n style: {\n display: \"none\",\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","// 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 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\";\nimport { Settings } from \"../../Settings/Settings\";\n\nlet layerCounter = 0;\n\nexport const LogBoxEvents = new EventEmitter<[RunningScript]>();\nexport const LogBoxCloserEvents = new EventEmitter<[number]>();\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 //Event used by ns.closeTail to close tail windows\n useEffect(\n () =>\n LogBoxCloserEvents.subscribe((pid: number) => {\n closePid(pid);\n }),\n [],\n );\n\n useEffect(() =>\n LogBoxClearEvents.subscribe(() => {\n logs = [];\n rerender();\n }),\n );\n\n //Close tail windows by their id\n function close(id: string): void {\n logs = logs.filter((l) => l.id !== id);\n rerender();\n }\n\n //Close tail windows by their pid\n function closePid(pid: number): void {\n logs = logs.filter((log) => log.script.pid != pid);\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 logs: {\n overflowY: \"scroll\",\n overflowX: \"hidden\",\n scrollbarWidth: \"auto\",\n flexDirection: \"column-reverse\",\n whiteSpace: \"pre-wrap\",\n },\n titleButton: {\n padding: \"1px 0\",\n height: \"100%\",\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 // () =>\n // WorkerScriptStartStopEventEmitter.subscribe(() => {\n // setTimeout(() => {\n // const server = GetServer(script.server);\n // if (server === null) return;\n // const exisitingScript = findRunningScript(script.filename, script.args, server);\n // if (exisitingScript) {\n // exisitingScript.logs = script.logs.concat(exisitingScript.logs)\n // setScript(exisitingScript)\n // }\n // rerender();\n // }, 100)\n // }),\n // [],\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 lineColor(s: string): string {\n if (s.match(/(^\\[[^\\]]+\\] )?ERROR/) || s.match(/(^\\[[^\\]]+\\] )?FAIL/)) {\n return Settings.theme.error;\n }\n if (s.match(/(^\\[[^\\]]+\\] )?SUCCESS/)) {\n return Settings.theme.success;\n }\n if (s.match(/(^\\[[^\\]]+\\] )?WARN/)) {\n return Settings.theme.warning;\n }\n if (s.match(/(^\\[[^\\]]+\\] )?INFO/)) {\n return Settings.theme.info;\n }\n return Settings.theme.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 || bounds.bottom < 0 || bounds.left > innerWidth || 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 || e.clientY < 0 || e.clientX > innerWidth || e.clientY > innerHeight) return false;\n };\n\n // Max [width, height]\n const minConstraints: [number, number] = [250, 33];\n\n return (\n <Draggable handle=\".drag\" onDrag={boundToBody} ref={rootRef} onMouseDown={updateLayer}>\n <Box\n display=\"flex\"\n sx={{\n flexFlow: \"column\",\n position: \"fixed\",\n left: \"40%\",\n top: \"30%\",\n zIndex: 1400,\n minWidth: `${minConstraints[0]}px`,\n minHeight: `${minConstraints[1]}px`,\n ...(minimized\n ? {\n border: \"none\",\n margin: 0,\n maxHeight: 0,\n padding: 0,\n }\n : {\n border: `1px solid ${Settings.theme.welllight}`,\n }),\n }}\n ref={container}\n >\n <ResizableBox\n height={500}\n width={500}\n minConstraints={minConstraints}\n handle={\n <span\n style={{\n position: \"absolute\",\n right: \"-10px\",\n bottom: \"-16px\",\n cursor: \"nw-resize\",\n display: minimized ? \"none\" : \"inline-block\",\n }}\n >\n <ArrowForwardIosIcon color=\"primary\" style={{ transform: \"rotate(45deg)\", fontSize: \"1.75rem\" }} />\n </span>\n }\n >\n <>\n <Paper className=\"drag\" sx={{ display: \"flex\", alignItems: \"center\", cursor: \"grab\" }} ref={draggableRef}>\n <Typography\n variant=\"h6\"\n sx={{ marginRight: \"auto\", textOverflow: \"ellipsis\", whiteSpace: \"nowrap\", overflow: \"hidden\" }}\n title={title(true)}\n >\n {title(true)}\n </Typography>\n\n <span style={{ minWidth: \"fit-content\", height: `${minConstraints[1]}px` }}>\n {!workerScripts.has(script.pid) ? (\n <Button className={classes.titleButton} onClick={run} onTouchEnd={run}>\n Run\n </Button>\n ) : (\n <Button className={classes.titleButton} onClick={kill} onTouchEnd={kill}>\n Kill\n </Button>\n )}\n <Button className={classes.titleButton} onClick={minimize} onTouchEnd={minimize}>\n {minimized ? \"\\u{1F5D6}\" : \"\\u{1F5D5}\"}\n </Button>\n <Button className={classes.titleButton} onClick={props.onClose} onTouchEnd={props.onClose}>\n Close\n </Button>\n </span>\n </Paper>\n\n <Paper\n className={classes.logs}\n sx={{ height: `calc(100% - ${minConstraints[1]}px)`, display: minimized ? \"none\" : \"flex\" }}\n >\n <span style={{ display: \"flex\", flexDirection: \"column\" }}>\n {script.logs.map(\n (line: string, i: number): JSX.Element => (\n <Typography key={i} sx={{ color: lineColor(line) }}>\n {line}\n <br />\n </Typography>\n ),\n )}\n </span>\n </Paper>\n </>\n </ResizableBox>\n </Box>\n </Draggable>\n );\n}\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 { WorkerScript } from \"./WorkerScript\";\n\n/**\n * Script death marker.\n *\n * IMPORTANT: the game engine should not base any of it's decisions on the data\n * carried in a ScriptDeath instance.\n *\n * This is because ScriptDeath instances are thrown through player code when a\n * script is killed. Which grants the player access to the class and the ability\n * to construct new instances with arbitrary data.\n */\nexport class ScriptDeath {\n /** Process ID number. */\n pid: number;\n\n /** Filename of the script. */\n name: string;\n\n /** IP Address on which the script was running */\n hostname: string;\n\n /** Status message in case of script error. */\n errorMessage = \"\";\n\n constructor(ws: WorkerScript) {\n this.pid = ws.pid;\n this.name = ws.name;\n this.hostname = ws.hostname;\n this.errorMessage = ws.errorMessage;\n\n Object.freeze(this);\n }\n}\n\nObject.freeze(ScriptDeath);\nObject.freeze(ScriptDeath.prototype);\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,\n nextSkill: 0,\n baseExperience: 0,\n experience: 0,\n nextExperience: 0,\n currentExperience: 0,\n 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 { 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","/**\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 [arcade] E [defcomm] \n \\\\ \n o--x---A--x--o [travel agency] \n 7 8 10 H \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--F--x-----x-----x---+---x----x--I--x-o \n | \n | \n o 17 \n \n \n \n G [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","import { FactionNames } from \"../../Faction/data/FactionNames\";\n\nexport const GangConstants: {\n GangRespectToReputationRatio: number;\n MaximumGangMembers: number;\n CyclesPerTerritoryAndPowerUpdate: number;\n AscensionMultiplierRatio: number;\n Names: string[];\n GangKarmaRequirement: number;\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 FactionNames.SlumSnakes,\n FactionNames.Tetrads,\n FactionNames.TheSyndicate,\n FactionNames.TheDarkArmy,\n FactionNames.SpeakersForTheDead,\n FactionNames.NiteSec,\n FactionNames.TheBlackHand,\n ],\n GangKarmaRequirement: -54000,\n};\n","export enum FactionWorkType {\n Field,\n Hacking,\n None,\n Security,\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 { ScriptDeath } from \"./Netscript/ScriptDeath\";\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<void> {\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 new ScriptDeath(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 new ScriptDeath(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 function wrapObject(vars: any, ...tree: string[]): void {\n for (const prop of Object.keys(vars)) {\n switch (typeof vars[prop]) {\n case \"function\": {\n vars[prop] = wrap([...tree, prop].join(\".\"), vars[prop]);\n break;\n }\n case \"object\": {\n if (Array.isArray(vars[prop])) continue;\n wrapObject(vars[prop], ...tree, prop);\n break;\n }\n }\n }\n }\n wrapObject(workerScript.env.vars);\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<void>((resolve, reject) => {\n executeJSScript(player, workerScript.getServer().scripts, workerScript)\n .then(() => {\n resolve();\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 new ScriptDeath(workerScript);\n } else if (isScriptErrorMessage(e)) {\n workerScript.errorMessage = e;\n throw new ScriptDeath(workerScript);\n } else if (e instanceof ScriptDeath) {\n throw e;\n }\n\n // Don't know what to do with it, let's try making an error message out of it\n workerScript.errorMessage = makeRuntimeRejectMsg(workerScript, \"\" + e);\n throw new ScriptDeath(workerScript);\n });\n}\n\nfunction startNetscript1Script(workerScript: WorkerScript): Promise<void> {\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();\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 (\n [\"hack\", \"grow\", \"weaken\", \"sleep\", \"prompt\", \"manualHack\", \"scp\", \"write\", \"share\", \"wget\"].includes(name)\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 - 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 ScriptDeath)) {\n console.error(err);\n const errorTextArray = err.split(\"|DELIMITER|\");\n const hostname = errorTextArray[1];\n const scriptName = errorTextArray[2];\n const errorMsg = errorTextArray[3];\n let msg = `${scriptName}@${hostname}<br>`;\n msg += \"<br>\";\n msg += errorMsg;\n dialogBoxCreate(msg);\n workerScript.env.stopFlag = true;\n workerScript.running = false;\n killWorkerScript(workerScript);\n return Promise.resolve();\n }\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();\n }\n\n return new Promise(function (resolve, reject) {\n function runInterpreter(): void {\n try {\n if (workerScript.env.stopFlag) {\n return reject(new ScriptDeath(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();\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(new ScriptDeath(workerScript));\n }\n }\n\n try {\n runInterpreter();\n } catch (e: any) {\n if (isString(e)) {\n workerScript.errorMessage = e;\n return reject(new ScriptDeath(workerScript));\n } else if (e instanceof ScriptDeath) {\n return reject(e);\n } else {\n console.error(e);\n return reject(new ScriptDeath(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 + 0.001) {\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 workerScript = new WorkerScript(runningScriptObj, pid, NetscriptFunctions);\n workerScript.ramUsage = oneRamUsage;\n\n // Add the WorkerScript to the global pool\n workerScripts.set(pid, workerScript);\n WorkerScriptStartStopEventEmitter.emit();\n\n // Start the script's execution\n let scriptExecution: Promise<void> | null = null; // Script's resulting promise\n if (workerScript.name.endsWith(\".js\") || workerScript.name.endsWith(\".ns\")) {\n scriptExecution = startNetscript2Script(player, workerScript);\n } else {\n scriptExecution = startNetscript1Script(workerScript);\n if (!(scriptExecution 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 scriptExecution\n .then(function () {\n workerScript.running = false;\n workerScript.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(workerScript);\n workerScript.log(\"\", () => \"Script finished running\");\n })\n .catch(function (e) {\n if (e 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: \" + e.toString());\n return;\n } else if (e instanceof ScriptDeath) {\n if (isScriptErrorMessage(workerScript.errorMessage)) {\n const errorTextArray = workerScript.errorMessage.split(\"|DELIMITER|\");\n if (errorTextArray.length != 4) {\n console.error(\"ERROR: Something wrong with Error text in evaluator...\");\n console.error(\"Error text: \" + workerScript.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} (PID - ${workerScript.pid})<br>`;\n if (workerScript.args.length > 0) {\n msg += `Args: ${arrayToString(workerScript.args)}<br>`;\n }\n msg += \"<br>\";\n msg += errorMsg;\n\n dialogBoxCreate(msg);\n workerScript.log(\"\", () => \"Script crashed with runtime error\");\n } else {\n workerScript.log(\"\", () => \"Script killed\");\n return; // Already killed, so stop here\n }\n } else if (isScriptErrorMessage(e)) {\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 e.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(e);\n }\n\n killWorkerScript(workerScript);\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 + 0.001) {\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 }\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\n workerScript.log(caller, () => `Could not find script '${scriptname}' on '${server.hostname}'`);\n return 0;\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 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 { 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 // Determines the maximum amount of this material that can be sold in one market cycle\n maxsll = 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, 99];\n this.cmp = 90;\n this.cmpR = [80, 99];\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, 99];\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 { Paper } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { use } from \"../../ui/Context\";\nimport { ProgressBar } from \"../../ui/React/Progress\";\n\ninterface IProps {\n millis: number;\n onExpire: () => void;\n noPaper?: boolean;\n}\n\nexport function GameTimer(props: IProps): React.ReactElement {\n const player = use.Player();\n const [v, setV] = useState(100);\n const totalMillis = (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.3 : 1) * props.millis;\n\n const tick = 200;\n useEffect(() => {\n const intervalId = setInterval(() => {\n setV((old) => {\n if (old <= 0) props.onExpire();\n return old - (tick / totalMillis) * 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 props.noPaper ? (\n <ProgressBar variant=\"determinate\" value={v} color=\"primary\" />\n ) : (\n <Paper sx={{ p: 1, mb: 1 }}>\n <ProgressBar variant=\"determinate\" value={v} color=\"primary\" />\n </Paper>\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 { createTaskTracker, ITaskTracker } from \"../PersonObjects/ITaskTracker\";\nimport { IPerson } from \"../PersonObjects/IPerson\";\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 { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { getTimestamp } from \"../utils/helpers/getTimestamp\";\nimport { joinFaction } from \"../Faction/FactionHelpers\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { BlackOperationNames } from \"./data/BlackOperationNames\";\nimport { KEY } from \"../utils/helpers/keyCodes\";\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 sleeveSize = 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(person: IPerson, 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, person);\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, person);\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, person);\n } catch (e: any) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"Recruitment\"]:\n this.actionTimeToComplete = this.getRecruitmentTime(person);\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 }\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[FactionNames.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 }\n return null;\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 }\n return null;\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 }\n return null;\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].toLowerCase(); // allows Action Type to be with or without capitalisation.\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) === KEY.SPACE)) {\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) === KEY.SPACE)) {\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 === KEY.SPACE) {\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 * Return stat to be gained from Contracts, Operations, and Black Operations\n * @param action(Action obj) - Derived action class\n * @param success(bool) - Whether action was successful\n */\n getActionStats(action: IAction, success: boolean): ITaskTracker {\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\n return {\n hack: unweightedGain * action.weights.hack * skillMult,\n str: unweightedGain * action.weights.str * skillMult,\n def: unweightedGain * action.weights.def * skillMult,\n dex: unweightedGain * action.weights.dex * skillMult,\n agi: unweightedGain * action.weights.agi * skillMult,\n cha: unweightedGain * action.weights.cha * skillMult,\n int: unweightedIntGain * action.weights.int * skillMult,\n money: 0,\n };\n }\n\n getDiplomacyEffectiveness(person: IPerson): 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(person.charisma, CharismaExponentialFactor) + person.charisma / CharismaLinearFactor;\n return (100 - charismaEff) / 100;\n }\n\n getRecruitmentSuccessChance(person: IPerson): number {\n return Math.pow(person.charisma, 0.45) / (this.teamSize - this.sleeveSize + 1);\n }\n\n getRecruitmentTime(person: IPerson): number {\n const effCharisma = person.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 sleeveSupport(joining: boolean): void {\n if (joining) {\n this.sleeveSize += 1;\n this.teamSize += 1;\n } else {\n this.sleeveSize -= 1;\n this.teamSize -= 1;\n }\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, player: IPlayer): 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 if (this.teamSize < this.sleeveSize) {\n const sup = player.sleeves.filter((x) => x.bbAction == \"Support main sleeve\");\n for (let i = 0; i > this.teamSize - this.sleeveSize; i--) {\n const r = Math.floor(Math.random() * sup.length);\n sup[r].takeDamage(sup[r].max_hp);\n sup.splice(r, 1);\n }\n this.teamSize += this.sleeveSize;\n }\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, actionIdent: IActionIdentifier): void {\n if (actionIdent.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 (actionIdent.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: \" + actionIdent.name);\n }\n }\n }\n\n completeAction(player: IPlayer, person: IPerson, actionIdent: IActionIdentifier, isPlayer = true): ITaskTracker {\n let retValue = createTaskTracker();\n switch (actionIdent.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]: {\n try {\n const isOperation = actionIdent.type === ActionTypes[\"Operation\"];\n const action = this.getActionObject(actionIdent);\n if (action == null) {\n throw new Error(\"Failed to get Contract/Operation Object for: \" + actionIdent.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 if (isPlayer) {\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\n // Process Contract/Operation success/failure\n if (action.attempt(this, person)) {\n retValue = this.getActionStats(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 retValue.money = moneyGain;\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(person, gain);\n if (isOperation && this.logging.ops) {\n this.log(\n `${person.whoAmI()}: ` +\n action.name +\n \" successfully completed! Gained \" +\n formatNumber(gain, 3) +\n \" rank\",\n );\n } else if (!isOperation && this.logging.contracts) {\n this.log(\n `${person.whoAmI()}: ` +\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, player) : this.completeContract(true, actionIdent);\n } else {\n retValue = this.getActionStats(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(person, -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 (person.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(`${person.whoAmI()}: ` + action.name + \" failed! \" + logLossText);\n } else if (!isOperation && this.logging.contracts) {\n this.log(`${person.whoAmI()}: ` + action.name + \" contract failed! \" + logLossText);\n }\n isOperation ? this.completeOperation(false, player) : this.completeContract(false, actionIdent);\n }\n if (action.autoLevel) {\n action.level = action.maxLevel;\n } // Autolevel\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(actionIdent);\n if (action == null || !(action instanceof BlackOperation)) {\n throw new Error(\"Failed to get BlackOperation Object for: \" + actionIdent.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, person)) {\n retValue = this.getActionStats(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(person, rankGain);\n }\n teamLossMax = Math.ceil(teamCount / 2);\n\n if (this.logging.blackops) {\n this.log(\n `${person.whoAmI()}: ` + action.name + \" successful! Gained \" + formatNumber(rankGain, 1) + \" rank\",\n );\n }\n } else {\n retValue = this.getActionStats(action, false);\n let rankLoss = 0;\n let damage = 0;\n if (action.rankLoss) {\n rankLoss = addOffset(action.rankLoss, 10);\n this.changeRank(person, -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 (person.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 `${person.whoAmI()}: ` +\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 if (this.teamSize < this.sleeveSize) {\n const sup = player.sleeves.filter((x) => x.bbAction == \"Support main sleeve\");\n for (let i = 0; i > this.teamSize - this.sleeveSize; i--) {\n const r = Math.floor(Math.random() * sup.length);\n sup[r].takeDamage(sup[r].max_hp);\n sup.splice(r, 1);\n }\n this.teamSize += this.sleeveSize;\n }\n this.teamLost += losses;\n if (this.logging.blackops) {\n this.log(`${person.whoAmI()}: 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 * person.strength_exp_mult,\n defExpGain = 30 * person.defense_exp_mult,\n dexExpGain = 30 * person.dexterity_exp_mult,\n agiExpGain = 30 * person.agility_exp_mult,\n staminaGain = 0.04 * this.skillMultipliers.stamina;\n retValue.str = strExpGain;\n retValue.def = defExpGain;\n retValue.dex = dexExpGain;\n retValue.agi = agiExpGain;\n this.staminaBonus += staminaGain;\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\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 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(person.hacking, 0.3) +\n 0.04 * Math.pow(person.intelligence, 0.9) +\n 0.02 * Math.pow(person.charisma, 0.3);\n eff *= person.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 * person.hacking_exp_mult;\n const charismaExpGain = 20 * person.charisma_exp_mult;\n const rankGain = 0.1 * BitNodeMultipliers.BladeburnerRank;\n retValue.hack = hackingExpGain;\n retValue.cha = charismaExpGain;\n retValue.int = BladeburnerConstants.BaseIntGain;\n this.changeRank(person, rankGain);\n this.getCurrentCity().improvePopulationEstimateByPercentage(eff * this.skillMultipliers.successChanceEstimate);\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n `Field analysis completed. Gained ${formatNumber(rankGain, 2)} rank, ` +\n `${formatNumber(hackingExpGain, 1)} hacking exp, and ` +\n `${formatNumber(charismaExpGain, 1)} charisma exp`,\n );\n }\n break;\n }\n case ActionTypes[\"Recruitment\"]: {\n const successChance = this.getRecruitmentSuccessChance(person);\n const recruitTime = this.getRecruitmentTime(person) * 1000;\n if (Math.random() < successChance) {\n const expGain = 2 * BladeburnerConstants.BaseStatGain * recruitTime;\n retValue.cha = expGain;\n ++this.teamSize;\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n \"Successfully recruited a team member! Gained \" +\n formatNumber(expGain, 1) +\n \" charisma exp\",\n );\n }\n } else {\n const expGain = BladeburnerConstants.BaseStatGain * recruitTime;\n retValue.cha = expGain;\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n \"Failed to recruit a team member. Gained \" +\n formatNumber(expGain, 1) +\n \" charisma exp\",\n );\n }\n }\n break;\n }\n case ActionTypes[\"Diplomacy\"]: {\n const eff = this.getDiplomacyEffectiveness(person);\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 `${person.whoAmI()}: Diplomacy completed. Chaos levels in the current city fell by ${numeralWrapper.formatPercentage(\n 1 - eff,\n )}`,\n );\n }\n break;\n }\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]: {\n person.regenerateHp(BladeburnerConstants.HrcHpGain);\n\n const staminaGain = this.maxStamina * (BladeburnerConstants.HrcStaminaGain / 100);\n this.stamina = Math.min(this.maxStamina, this.stamina + staminaGain);\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: 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(`${person.whoAmI()}: 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 break;\n }\n default:\n console.error(`Bladeburner.completeAction() called for invalid action: ${actionIdent.type}`);\n break;\n }\n return retValue;\n }\n\n infiltrateSynthoidCommunities(p: IPlayer): void {\n const infilSleeves = p.sleeves.filter((s) => s.bbAction === \"Infiltrate synthoids\").length;\n const amt = Math.pow(infilSleeves, -0.5) / 2;\n for (const contract of Object.keys(this.contracts)) {\n this.contracts[contract].count += amt;\n }\n for (const operation of Object.keys(this.operations)) {\n this.operations[operation].count += amt;\n }\n if (this.logging.general) {\n this.log(`Sleeve: Infiltrate the synthoid communities.`);\n }\n }\n\n changeRank(person: IPerson, 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 = FactionNames.Bladeburners;\n if (factionExists(bladeburnersFactionName)) {\n const bladeburnerFac = Factions[bladeburnersFactionName];\n if (!(bladeburnerFac instanceof Faction)) {\n throw new Error(\n `Could not properly get ${FactionNames.Bladeburners} Faction object in ${FactionNames.Bladeburners} UI Overview Faction button`,\n );\n }\n if (bladeburnerFac.isMember) {\n const favorBonus = 1 + bladeburnerFac.favor / 100;\n bladeburnerFac.playerReputation +=\n BladeburnerConstants.RankToFactionRepFactor * change * person.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 const action = this.getActionObject(this.action);\n const retValue = this.completeAction(player, player, this.action);\n player.gainMoney(retValue.money, \"bladeburner\");\n player.gainStats(retValue);\n // Operation Daedalus\n if (action == null) {\n throw new Error(\"Failed to get BlackOperation Object for: \" + this.action.name);\n } else if (action.name === BlackOperationNames.OperationDaedalus && this.blackops[action.name]) {\n this.resetAction();\n router.toBitVerse(false, false);\n } else if (this.action.type != ActionTypes[\"BlackOperation\"] && this.action.type != ActionTypes[\"BlackOp\"]) {\n this.startAction(player, this.action); // Repeat action\n }\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 race condition when the engine checks the processing counters and attempts to route before the router is initialized.\n if (!router.isInitialized) return;\n\n // Edge case condition...if Operation Daedalus is complete trigger the BitNode\n if (router.page() !== Page.BitVerse && this.blackops.hasOwnProperty(BlackOperationNames.OperationDaedalus)) {\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 (!player.hasAugmentation(AugmentationNames.BladesSimulacrum, true) && 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(person: IPerson, type: string, name: string): number | string {\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n return \"bladeburner.getActionTime\";\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n return \"bladeburner.getActionTime\";\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, person) * 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(person) * 1000;\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n return 60000;\n default:\n return \"bladeburner.getActionTime\";\n }\n }\n\n getActionEstimatedSuccessChanceNetscriptFn(person: IPerson, type: string, name: string): [number, number] | string {\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n return \"bladeburner.getActionEstimatedSuccessChance\";\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n return \"bladeburner.getActionEstimatedSuccessChance\";\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, person);\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(person);\n return [recChance, recChance];\n }\n default:\n return \"bladeburner.getActionEstimatedSuccessChance\";\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[FactionNames.Bladeburners];\n if (bladeburnerFac.isMember) {\n return true;\n } else if (this.rank >= BladeburnerConstants.RankNeededForFaction) {\n joinFaction(bladeburnerFac);\n workerScript.log(\"bladeburner.joinBladeburnerFaction\", () => `Joined ${FactionNames.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 { 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","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","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 * as React from \"react\";\nimport { numeralWrapper } from \"../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","/**\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 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 (\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 */\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 */\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: \"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","/**\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","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","// 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 int: 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 int: 0,\n money: 0,\n };\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\nexport function getStockMarketWseCost(): number {\n return CONSTANTS.WSEAccountCost;\n}\n\nexport function getStockMarketTixApiCost(): number {\n return CONSTANTS.TIXAPICost;\n}\n","import { CONSTANTS } from \"../Constants\";\nimport { Player } from \"../Player\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { Server } from \"../Server/Server\";\nimport { RunningScript } from \"./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 { 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","/**\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 { 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","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 { 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 * (p.strength + p.defense + p.dexterity + p.agility + (p.hacking + p.intelligence) * CalculateShareMult())) /\n 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.strength +\n p.defense +\n p.dexterity +\n p.agility +\n p.charisma +\n (p.hacking + p.intelligence) * CalculateShareMult())) /\n 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 = `Bought ${numeralWrapper.formatShares(shares)} shares of ${\n stock.symbol\n } for ${numeralWrapper.formatMoney(totalPrice)}. Paid ${numeralWrapper.formatMoney(\n CONSTANTS.StockMarketCommission,\n )} 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","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","/**\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","export function hash(): string {\n try {\n if (__COMMIT_HASH__) {\n return __COMMIT_HASH__;\n }\n } catch (err) {}\n return \"DEV\";\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 { 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 { 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}\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","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 \"save doesn't get corrupted\",\n );\n}\n","export interface CorporationUnlockUpgrade {\n index: number;\n price: number;\n name: string;\n desc: string;\n}\n\nexport enum CorporationUnlockUpgradeIndex {\n Export = 0,\n SmartSupply = 1,\n MarketResearchDemand = 2,\n MarketDataCompetition = 3,\n VeChain = 4,\n ShadyAccounting = 5,\n GovernmentPartnership = 6,\n WarehouseAPI = 7,\n OfficeAPI = 8,\n}\n\n// Corporation Unlock Upgrades\n// Upgrades for entire corporation, unlocks features, either you have it or you dont\nexport const CorporationUnlockUpgrades: Record<CorporationUnlockUpgradeIndex, CorporationUnlockUpgrade> = {\n //Lets you export goods\n [CorporationUnlockUpgradeIndex.Export]: {\n index: 0,\n price: 20e9,\n name: \"Export\",\n desc:\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 [CorporationUnlockUpgradeIndex.SmartSupply]: {\n index: 1,\n price: 25e9,\n name: \"Smart Supply\",\n desc:\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 [CorporationUnlockUpgradeIndex.MarketResearchDemand]: {\n index: 2,\n price: 5e9,\n name: \"Market Research - Demand\",\n desc:\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 [CorporationUnlockUpgradeIndex.MarketDataCompetition]: {\n index: 3,\n price: 5e9,\n name: \"Market Data - Competition\",\n desc:\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 [CorporationUnlockUpgradeIndex.VeChain]: {\n index: 4,\n price: 10e9,\n name: \"VeChain\",\n desc:\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 [CorporationUnlockUpgradeIndex.ShadyAccounting]: {\n index: 5,\n price: 500e12,\n name: \"Shady Accounting\",\n desc:\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 [CorporationUnlockUpgradeIndex.GovernmentPartnership]: {\n index: 6,\n price: 2e15,\n name: \"Government Partnership\",\n desc:\n \"Help national governments further their agendas in exchange for lowered taxes. \" +\n \"This reduces the dividend tax rate by 10%\",\n },\n [CorporationUnlockUpgradeIndex.WarehouseAPI]: {\n index: 7,\n price: 50e9,\n name: \"Warehouse API\",\n desc: \"Enables the warehouse API.\",\n },\n [CorporationUnlockUpgradeIndex.OfficeAPI]: {\n index: 8,\n price: 50e9,\n name: \"Office API\",\n desc: \"Enables the office API.\",\n },\n};\n","import { StaticAugmentations } from \"../../Augmentation/StaticAugmentations\";\nimport { GraftableAugmentation } from \"./GraftableAugmentation\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport const getGraftingAvailableAugs = (player: IPlayer): string[] => {\n const augs: string[] = [];\n\n for (const [augName, aug] of Object.entries(StaticAugmentations)) {\n if (aug.isSpecial) continue;\n augs.push(augName);\n }\n\n return augs.filter((augmentation: string) => !player.hasAugmentation(augmentation));\n};\n\nexport const graftingIntBonus = (player: IPlayer): number => {\n return 1 + (player.getIntelligenceBonus(3) - 1) / 3;\n};\n\nexport const calculateGraftingTimeWithBonus = (player: IPlayer, aug: GraftableAugmentation): number => {\n const baseTime = aug.time;\n return baseTime / graftingIntBonus(player);\n};\n","import { BlackOperation } from \"./BlackOperation\";\nimport { IMap } from \"../types\";\nimport { BlackOperationNames } from \"./data/BlackOperationNames\";\n\nexport const BlackOperations: IMap<BlackOperation> = {};\n\n(function () {\n BlackOperations[BlackOperationNames.OperationTyphoon] = new BlackOperation({\n name: BlackOperationNames.OperationTyphoon,\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[BlackOperationNames.OperationZero] = new BlackOperation({\n name: BlackOperationNames.OperationZero,\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[BlackOperationNames.OperationX] = new BlackOperation({\n name: BlackOperationNames.OperationX,\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[BlackOperationNames.OperationTitan] = new BlackOperation({\n name: BlackOperationNames.OperationTitan,\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[BlackOperationNames.OperationAres] = new BlackOperation({\n name: BlackOperationNames.OperationAres,\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[BlackOperationNames.OperationArchangel] = new BlackOperation({\n name: BlackOperationNames.OperationArchangel,\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[BlackOperationNames.OperationJuggernaut] = new BlackOperation({\n name: BlackOperationNames.OperationJuggernaut,\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[BlackOperationNames.OperationRedDragon] = new BlackOperation({\n name: BlackOperationNames.OperationRedDragon,\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[BlackOperationNames.OperationK] = new BlackOperation({\n name: BlackOperationNames.OperationK,\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[BlackOperationNames.OperationDeckard] = new BlackOperation({\n name: BlackOperationNames.OperationDeckard,\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[BlackOperationNames.OperationTyrell] = new BlackOperation({\n name: BlackOperationNames.OperationTyrell,\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[BlackOperationNames.OperationWallace] = new BlackOperation({\n name: BlackOperationNames.OperationWallace,\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[BlackOperationNames.OperationShoulderOfOrion] = new BlackOperation({\n name: BlackOperationNames.OperationShoulderOfOrion,\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[BlackOperationNames.OperationHyron] = new BlackOperation({\n name: BlackOperationNames.OperationHyron,\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[BlackOperationNames.OperationMorpheus] = new BlackOperation({\n name: BlackOperationNames.OperationMorpheus,\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[BlackOperationNames.OperationIonStorm] = new BlackOperation({\n name: BlackOperationNames.OperationIonStorm,\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[BlackOperationNames.OperationAnnihilus] = new BlackOperation({\n name: BlackOperationNames.OperationAnnihilus,\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[BlackOperationNames.OperationUltron] = new BlackOperation({\n name: BlackOperationNames.OperationUltron,\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[BlackOperationNames.OperationCenturion] = new BlackOperation({\n name: BlackOperationNames.OperationCenturion,\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[BlackOperationNames.OperationVindictus] = new BlackOperation({\n name: BlackOperationNames.OperationVindictus,\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[BlackOperationNames.OperationDaedalus] = new BlackOperation({\n name: BlackOperationNames.OperationDaedalus,\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 { 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 highestCharge: 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.highestCharge = 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.highestCharge = 0;\n this.numCharge = 0;\n this.rotation = 0;\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 const fragSize = Math.max(thisFragment.shape.length, thisFragment.shape[0].length);\n for (let j = 0; j < fragSize; j++) {\n for (let i = 0; i < fragSize; 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 return Object.assign({}, this);\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","import { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IPerson } from \"../PersonObjects/IPerson\";\nimport { IRouter } from \"../ui/Router\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { CrimeType } from \"../utils/WorkType\";\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: CrimeType;\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(\n name = \"\",\n type: CrimeType,\n time = 0,\n money = 0,\n difficulty = 0,\n karma = 0,\n params: IConstructorParams = {},\n ) {\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: IPerson): 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 { getRamCost } from \"./RamCostGenerator\";\nimport type { IPort } from \"../NetscriptPort\";\nimport type { BaseServer } from \"../Server/BaseServer\";\nimport type { WorkerScript } from \"./WorkerScript\";\nimport { makeRuntimeRejectMsg } from \"../NetscriptEvaluator\";\nimport { Player } from \"../Player\";\nimport { CityName } from \"src/Locations/data/CityNames\";\nimport { Settings } from \"../Settings/Settings\";\nimport { CONSTANTS } from \"../Constants\";\n\ntype ExternalFunction = (...args: any[]) => any;\ntype ExternalAPI = {\n [string: string]: ExternalAPI | ExternalFunction;\n};\n\ntype InternalFunction<F extends (...args: unknown[]) => unknown> = (ctx: NetscriptContext) => F;\nexport type InternalAPI<API> = {\n [Property in keyof API]: API[Property] extends ExternalFunction\n ? InternalFunction<API[Property]>\n : API[Property] extends ExternalAPI\n ? InternalAPI<API[Property]>\n : never;\n};\n\ntype WrappedNetscriptFunction = (...args: unknown[]) => unknown;\ntype WrappedNetscriptAPI = {\n readonly [string: string]: WrappedNetscriptAPI | WrappedNetscriptFunction;\n};\n\nexport type NetscriptContext = {\n makeRuntimeErrorMsg: (message: string) => string;\n log: (message: () => string) => void;\n workerScript: WorkerScript;\n function: string;\n helper: WrappedNetscriptHelpers;\n};\n\ntype NetscriptHelpers = {\n updateDynamicRam: (fnName: string, ramCost: number) => void;\n makeRuntimeErrorMsg: (caller: string, msg: string) => string;\n string: (funcName: string, argName: string, v: unknown) => string;\n number: (funcName: string, argName: string, v: unknown) => number;\n city: (funcName: string, argName: string, v: unknown) => CityName;\n boolean: (v: unknown) => boolean;\n getServer: (hostname: string, callingFnName: string) => BaseServer;\n checkSingularityAccess: (func: string) => void;\n hack: (hostname: any, manual: any, { threads: requestedThreads, stock }?: any) => Promise<number>;\n getValidPort: (funcName: string, port: any) => IPort;\n};\n\ntype WrappedNetscriptHelpers = {\n makeRuntimeErrorMsg: (msg: string) => string;\n string: (argName: string, v: unknown) => string;\n number: (argName: string, v: unknown) => number;\n city: (argName: string, v: unknown) => CityName;\n boolean: (v: unknown) => boolean;\n getServer: (hostname: string) => BaseServer;\n checkSingularityAccess: () => void;\n hack: (hostname: any, manual: any, { threads: requestedThreads, stock }?: any) => Promise<number>;\n getValidPort: (port: any) => IPort;\n};\n\nfunction wrapFunction(\n helpers: NetscriptHelpers,\n wrappedAPI: any,\n workerScript: WorkerScript,\n func: (_ctx: NetscriptContext) => (...args: unknown[]) => unknown,\n ...tree: string[]\n): void {\n const functionPath = tree.join(\".\");\n const functionName = tree.pop();\n if (typeof functionName !== \"string\") {\n throw makeRuntimeRejectMsg(workerScript, \"Failure occured while wrapping netscript api\");\n }\n const ctx = {\n makeRuntimeErrorMsg: (message: string) => {\n return helpers.makeRuntimeErrorMsg(functionPath, message);\n },\n log: (message: () => string) => {\n workerScript.log(functionPath, message);\n },\n workerScript,\n function: functionName,\n helper: {\n makeRuntimeErrorMsg: (msg: string) => helpers.makeRuntimeErrorMsg(functionPath, msg),\n string: (argName: string, v: unknown) => helpers.string(functionPath, argName, v),\n number: (argName: string, v: unknown) => helpers.number(functionPath, argName, v),\n city: (argName: string, v: unknown) => helpers.city(functionPath, argName, v),\n boolean: helpers.boolean,\n getServer: (hostname: string) => helpers.getServer(hostname, functionPath),\n checkSingularityAccess: () => helpers.checkSingularityAccess(functionName),\n hack: helpers.hack,\n getValidPort: (port: any) => helpers.getValidPort(functionPath, port),\n },\n };\n const safetyEnabled = Settings.InfinityLoopSafety;\n function wrappedFunction(...args: unknown[]): unknown {\n helpers.updateDynamicRam(ctx.function, getRamCost(Player, ...tree, ctx.function));\n if (safetyEnabled) workerScript.infiniteLoopSafetyCounter++;\n if (workerScript.infiniteLoopSafetyCounter > CONSTANTS.InfiniteLoopLimit)\n throw new Error(\n `Infinite loop without sleep detected. ${CONSTANTS.InfiniteLoopLimit} ns functions were called without sleep. This will cause your UI to hang.`,\n );\n return func(ctx)(...args);\n }\n const parent = getNestedProperty(wrappedAPI, ...tree);\n Object.defineProperty(parent, functionName, {\n value: wrappedFunction,\n writable: true,\n enumerable: true,\n });\n}\n\nexport function wrapAPI(\n helpers: NetscriptHelpers,\n wrappedAPI: ExternalAPI,\n workerScript: WorkerScript,\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n namespace: any,\n ...tree: string[]\n): WrappedNetscriptAPI {\n if (typeof namespace !== \"object\") throw new Error(\"Invalid namespace?\");\n for (const property of Object.getOwnPropertyNames(namespace)) {\n switch (typeof namespace[property]) {\n case \"function\": {\n wrapFunction(helpers, wrappedAPI, workerScript, namespace[property], ...tree, property);\n break;\n }\n case \"object\": {\n wrapAPI(helpers, wrappedAPI, workerScript, namespace[property], ...tree, property);\n break;\n }\n default: {\n setNestedProperty(wrappedAPI, namespace[property], ...tree, property);\n }\n }\n }\n return wrappedAPI;\n}\n\nfunction setNestedProperty(root: any, value: any, ...tree: string[]): any {\n let target = root;\n const key = tree.pop();\n if (typeof key !== \"string\") {\n throw new Error(\"Failure occured while wrapping netscript api (setNestedProperty)\");\n }\n for (const branch of tree) {\n if (target[branch] === undefined) {\n target[branch] = {};\n }\n target = target[branch];\n }\n target[key] = value;\n}\n\nfunction getNestedProperty(root: any, ...tree: string[]): any {\n let target = root;\n for (const branch of tree) {\n if (target[branch] === undefined) {\n target[branch] = {};\n }\n target = target[branch];\n }\n return target;\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","export enum GameOptionsTab {\n SYSTEM,\n INTERFACE,\n GAMEPLAY,\n MISC,\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Hashes } from \"./Hashes\";\n\nexport function HashRate({ hashes }: { hashes: number }): React.ReactElement {\n return <Hashes hashes={`${numeralWrapper.formatHashes(hashes)} h / s`} />;\n}\n","import { MessageFilenames } from \"./MessageHelpers\";\n\nexport class Message {\n // Name of Message file\n filename: MessageFilenames;\n\n // The text contains in the Message\n msg: string;\n\n constructor(filename: MessageFilenames, msg: string) {\n this.filename = filename;\n this.msg = msg;\n }\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 { removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { Terminal } from \"./Terminal\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\nimport { IMap, IReturnStatus } from \"./types\";\nimport { GetServer } from \"./Server/AllServers\";\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\ninterface IReturnWebStatus extends IReturnStatus {\n data?: Record<string, unknown>;\n}\n\ndeclare global {\n interface Window {\n appNotifier: {\n terminal: (message: string, type?: string) => void;\n toast: (message: string, type: ToastVariant, duration?: number) => void;\n };\n appSaveFns: {\n triggerSave: () => Promise<void>;\n triggerGameExport: () => void;\n triggerScriptsExport: () => void;\n getSaveData: () => { save: string; fileName: string };\n getSaveInfo: (base64save: string) => Promise<ImportPlayerData | undefined>;\n pushSaveData: (base64save: string, automatic?: boolean) => void;\n };\n electronBridge: {\n send: (channel: string, data?: unknown) => void;\n receive: (channel: string, func: (...args: any[]) => void) => void;\n };\n }\n interface Document {\n getFiles: () => IReturnWebStatus;\n deleteFile: (filename: string) => IReturnWebStatus;\n saveFile: (filename: string, code: string) => IReturnWebStatus;\n }\n}\n\nexport function initElectron(): void {\n const userAgent = navigator.userAgent.toLowerCase();\n if (userAgent.indexOf(\" electron/\") > -1) {\n // Electron-specific code\n document.achievements = [];\n initWebserver();\n initAppNotifier();\n initSaveFunctions();\n initElectronBridge();\n }\n}\n\nfunction initWebserver(): void {\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.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.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.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: ToastVariant, duration = 2000) => SnackbarEvents.emit(message, type, duration),\n };\n\n // Will be consumud by the electron wrapper.\n window.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.\", ToastVariant.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.appSaveFns = funcs;\n}\n\nfunction initElectronBridge(): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n bridge.receive(\"get-save-data-request\", () => {\n const data = window.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.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.appSaveFns.pushSaveData(save, automatic);\n });\n bridge.receive(\"trigger-save\", () => {\n return window.appSaveFns\n .triggerSave()\n .then(() => {\n bridge.send(\"save-completed\");\n })\n .catch((error: unknown) => {\n console.log(error);\n SnackbarEvents.emit(\"Could not save game.\", ToastVariant.ERROR, 2000);\n });\n });\n bridge.receive(\"trigger-game-export\", () => {\n try {\n window.appSaveFns.triggerGameExport();\n } catch (error) {\n console.log(error);\n SnackbarEvents.emit(\"Could not export game.\", ToastVariant.ERROR, 2000);\n }\n });\n bridge.receive(\"trigger-scripts-export\", () => {\n try {\n window.appSaveFns.triggerScriptsExport();\n } catch (error) {\n console.log(error);\n SnackbarEvents.emit(\"Could not export scripts.\", ToastVariant.ERROR, 2000);\n }\n });\n}\n\nexport function pushGameSaved(data: SaveData): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n bridge.send(\"push-game-saved\", data);\n}\n\nexport function pushGameReady(): void {\n const bridge = window.electronBridge;\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.electronBridge;\n if (!bridge) return;\n\n bridge.send(\"push-import-result\", { wasImported });\n pushDisableRestore();\n}\n\nexport function pushDisableRestore(): void {\n const bridge = window.electronBridge;\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\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { BlackOperationNames } from \"../Bladeburner/data/BlackOperationNames\";\nimport { ClassType } from \"../utils/WorkType\";\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 (\n Player.bladeburner !== null && Player.bladeburner.blackops.hasOwnProperty(BlackOperationNames.OperationDaedalus)\n );\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 [FactionNames.CyberSec.toUpperCase()]: {\n ...achievementData[FactionNames.CyberSec.toUpperCase()],\n Icon: \"CSEC\",\n Condition: () => Player.factions.includes(FactionNames.CyberSec),\n },\n [FactionNames.NiteSec.toUpperCase()]: {\n ...achievementData[FactionNames.NiteSec.toUpperCase()],\n Icon: FactionNames.NiteSec,\n Condition: () => Player.factions.includes(FactionNames.NiteSec),\n },\n THE_BLACK_HAND: {\n ...achievementData[\"THE_BLACK_HAND\"],\n Icon: \"TBH\",\n Condition: () => Player.factions.includes(FactionNames.TheBlackHand),\n },\n [FactionNames.BitRunners.toUpperCase()]: {\n ...achievementData[FactionNames.BitRunners.toUpperCase()],\n Icon: FactionNames.BitRunners.toLowerCase(),\n Condition: () => Player.factions.includes(FactionNames.BitRunners),\n },\n [FactionNames.Daedalus.toUpperCase()]: {\n ...achievementData[FactionNames.Daedalus.toUpperCase()],\n Icon: FactionNames.Daedalus.toLowerCase(),\n Condition: () => Player.factions.includes(FactionNames.Daedalus),\n },\n THE_COVENANT: {\n ...achievementData[\"THE_COVENANT\"],\n Icon: FactionNames.TheCovenant.toLowerCase().replace(/ /g, \"\"),\n Condition: () => Player.factions.includes(FactionNames.TheCovenant),\n },\n [FactionNames.Illuminati.toUpperCase()]: {\n ...achievementData[FactionNames.Illuminati.toUpperCase()],\n Icon: FactionNames.Illuminati.toLowerCase(),\n Condition: () => Player.factions.includes(FactionNames.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 [ClassType.GymStrength, ClassType.GymDefense, ClassType.GymDexterity, ClassType.GymAgility].includes(\n Player.className,\n ),\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: () =>\n 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 && Player.sourceFileLvl(10) === 3,\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 RAINBOW: {\n ...achievementData[\"RAINBOW\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.INeedARainbow),\n },\n TRUE_RECURSION: {\n ...achievementData[\"TRUE_RECURSION\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.TrueRecursion),\n },\n};\n\n// Steam has a limit of 100 achievement. So these were planned but commented for now.\n// { ID: FactionNames.ECorp.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.ECorp) },\n// { ID: FactionNames.MegaCorp.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.MegaCorp) },\n// { ID: \"BACHMAN_&_ASSOCIATES\", Condition: () => Player.factions.includes(FactionNames.BachmanAssociates) },\n// { ID: \"BLADE_INDUSTRIES\", Condition: () => Player.factions.includes(FactionNames.BladeIndustries) },\n// { ID: FactionNames.NWO.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.NWO) },\n// { ID: \"CLARKE_INCORPORATED\", Condition: () => Player.factions.includes(FactionNames.ClarkeIncorporated) },\n// { ID: \"OMNITEK_INCORPORATED\", Condition: () => Player.factions.includes(FactionNames.OmniTekIncorporated) },\n// { ID: \"FOUR_SIGMA\", Condition: () => Player.factions.includes(FactionNames.FourSigma) },\n// { ID: \"KUAIGONG_INTERNATIONAL\", Condition: () => Player.factions.includes(FactionNames.KuaiGongInternational) },\n// { ID: \"FULCRUM_SECRET_TECHNOLOGIES\", Condition: () => Player.factions.includes(FactionNames.FulcrumSecretTechnologies) },\n// { ID: FactionNames.Aevum.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Aevum) },\n// { ID: FactionNames.Chongqing.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Chongqing) },\n// { ID: FactionNames.Ishima.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Ishima) },\n// { ID: \"NEW_TOKYO\", Condition: () => Player.factions.includes(FactionNames.NewTokyo) },\n// { ID: \"SECTOR-12\", Condition: () => Player.factions.includes(FactionNames.Sector12) },\n// { ID: FactionNames.Volhaven.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Volhaven) },\n// { ID: \"SPEAKERS_FOR_THE_DEAD\", Condition: () => Player.factions.includes(FactionNames.SpeakersForTheDead) },\n// { ID: \"THE_DARK_ARMY\", Condition: () => Player.factions.includes(FactionNames.TheDarkArmy) },\n// { ID: \"THE_SYNDICATE\", Condition: () => Player.factions.includes(FactionNames.TheSyndicate) },\n// { ID: FactionNames.Silhouette.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Silhouette) },\n// { ID: FactionNames.Tetrads.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Tetrads) },\n// { ID: \"SLUM_SNAKES\", Condition: () => Player.factions.includes(FactionNames.SlumSnakes) },\n// { ID: FactionNames.Netburners.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Netburners) },\n// { ID: \"TIAN_DI_HUI\", Condition: () => Player.factions.includes(FactionNames.TianDiHui) },\n// { ID: FactionNames.Bladeburners.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.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// { ID: \"INFILTRATORS\", Condition: () => Player.factions.includes(FactionNames.Infiltrators) },\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.achievements = [...Player.achievements.map((a) => a.ID)];\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 \"../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\";\n\nimport { WorkType } from \"../../utils/WorkType\";\n\ninterface IProps {\n save: () => void;\n killScripts: () => void;\n}\n\nfunction Intelligence(): React.ReactElement {\n const theme = useTheme();\n const player = use.Player();\n const classes = useStyles();\n if (player.intelligence === 0) return <></>;\n const progress = player.calculateSkillProgress(player.intelligence_exp);\n\n return (\n <>\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 <TableRow>\n {!Settings.DisableOverviewProgressBars && (\n <StatsProgressOverviewCell progress={progress} color={theme.colors.int} />\n )}\n </TableRow>\n </>\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 switch (player.workType) {\n case WorkType.CompanyPartTime:\n case WorkType.Company:\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 break;\n case WorkType.Faction:\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 break;\n case WorkType.StudyClass:\n details = <>{player.workType}</>;\n header = <>You are {player.className}</>;\n innerText = <>{convertTimeMsToTimeElapsedString(player.timeWorked)}</>;\n break;\n case WorkType.CreateProgram:\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 break;\n case WorkType.GraftAugmentation:\n details = <>Grafting {player.graftAugmentationName}</>;\n header = <>Grafting an Augmentation</>;\n innerText = (\n <>\n <strong>{((player.timeWorkedGraftAugmentation / player.timeNeededToCompleteWork) * 100).toFixed(2)}%</strong>{\" \"}\n done\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={Settings.AutosaveInterval !== 0 ? \"Save game\" : \"Save game (auto-saves are disabled!)\"}>\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","/**\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 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","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\nexport function SFC32RNG(seed: string): () => number {\n let h = 1779033703 ^ seed.length;\n for (let i = 0; i < seed.length; i++) {\n h = Math.imul(h ^ seed.charCodeAt(i), 3432918353);\n h = (h << 13) | (h >>> 19);\n }\n const genSeed = (): number => {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n\n let a = genSeed();\n let b = genSeed();\n let c = genSeed();\n let d = genSeed();\n return (): number => {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\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 \"../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","/**\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 } from \"../Person\";\nimport { ITaskTracker, createTaskTracker } from \"../ITaskTracker\";\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\";\nimport { BladeburnerConstants } from \"../../Bladeburner/data/Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { capitalizeFirstLetter, capitalizeEachWord } from \"../../utils/StringHelperFunctions\";\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 * Bladeburner: success chance\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 * String that stores what stat the sleeve is training at the gym\n */\n bbAction = \"\";\n\n /**\n * String that stores what stat the sleeve is training at the gym\n */\n bbContract = \"\";\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(p);\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.int = crime.intelligence_exp;\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(p);\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 if (this.currentTask === SleeveTaskType.Bladeburner) {\n if (this.currentTaskMaxTime === 0) {\n this.currentTaskTime = 0;\n return retValue;\n }\n // For bladeburner, all experience and money is gained at the end\n const bb = p.bladeburner;\n if (bb === null) {\n const errorLogText = `bladeburner is null`;\n console.error(`Function: sleeves.finishTask; Message: '${errorLogText}'`);\n this.resetTaskStatus(p);\n return retValue;\n }\n\n if (this.currentTaskTime >= this.currentTaskMaxTime) {\n if (this.bbAction === \"Infiltrate synthoids\") {\n bb.infiltrateSynthoidCommunities(p);\n this.currentTaskTime = 0;\n return retValue;\n }\n let type: string;\n let name: string;\n if (this.bbAction === \"Take on contracts\") {\n type = \"Contracts\";\n name = this.bbContract;\n } else {\n type = \"General\";\n name = this.bbAction;\n }\n\n const actionIdent = bb.getActionIdFromTypeAndName(type, name);\n if (actionIdent === null) {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n console.error(`Function: sleeves.finishTask; Message: '${errorLogText}'`);\n this.resetTaskStatus(p);\n return retValue;\n }\n\n const action = bb.getActionObject(actionIdent);\n if ((action?.count ?? 0) > 0) {\n const bbRetValue = bb.completeAction(p, this, actionIdent, false);\n if (bbRetValue) {\n retValue = this.gainExperience(p, bbRetValue);\n this.gainMoney(p, bbRetValue);\n\n // Do not reset task to IDLE\n this.currentTaskTime = 0;\n return retValue;\n }\n }\n }\n }\n\n this.resetTaskStatus(p);\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 const pIntExp = exp.int * multFac;\n\n // Experience is gained by both this sleeve and player\n if (pHackExp > 0) {\n this.gainHackingExp(pHackExp);\n p.gainHackingExp(pHackExp);\n this.earningsForPlayer.hack += pHackExp;\n this.earningsForTask.hack += pHackExp;\n }\n\n if (pStrExp > 0) {\n this.gainStrengthExp(pStrExp);\n p.gainStrengthExp(pStrExp);\n this.earningsForPlayer.str += pStrExp;\n this.earningsForTask.str += pStrExp;\n }\n\n if (pDefExp > 0) {\n this.gainDefenseExp(pDefExp);\n p.gainDefenseExp(pDefExp);\n this.earningsForPlayer.def += pDefExp;\n this.earningsForTask.def += pDefExp;\n }\n\n if (pDexExp > 0) {\n this.gainDexterityExp(pDexExp);\n p.gainDexterityExp(pDexExp);\n this.earningsForPlayer.dex += pDexExp;\n this.earningsForTask.dex += pDexExp;\n }\n\n if (pAgiExp > 0) {\n this.gainAgilityExp(pAgiExp);\n p.gainAgilityExp(pAgiExp);\n this.earningsForPlayer.agi += pAgiExp;\n this.earningsForTask.agi += pAgiExp;\n }\n\n if (pChaExp > 0) {\n this.gainCharismaExp(pChaExp);\n p.gainCharismaExp(pChaExp);\n this.earningsForPlayer.cha += pChaExp;\n this.earningsForTask.cha += pChaExp;\n }\n\n if (pIntExp > 0) {\n this.gainIntelligenceExp(pIntExp);\n p.gainIntelligenceExp(pIntExp);\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 int: pIntExp * (this.sync / 100),\n money: exp.money,\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(p);\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 Location\n\n this.city = CityName.Sector12;\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 // If the player has a gang with the faction the sleeve is working\n // for, we need to reset the sleeve's task\n if (p.gang) {\n if (fac.name === p.gang.facName) {\n this.resetTaskStatus(p);\n }\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(p);\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(p);\n break;\n default:\n break;\n }\n\n if (this.currentTaskMaxTime !== 0 && this.currentTaskTime >= this.currentTaskMaxTime) {\n if (this.currentTask === SleeveTaskType.Crime || this.currentTask === SleeveTaskType.Bladeburner) {\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(p: IPlayer): void {\n if (this.bbAction == \"Support main sleeve\") {\n p.bladeburner?.sleeveSupport(false);\n }\n if (this.currentTask == SleeveTaskType.Class) {\n const retVal = createTaskTracker();\n retVal.int = CONSTANTS.IntelligenceClassBaseExpGain * Math.round(this.currentTaskTime / 1000);\n const r = this.gainExperience(p, retVal);\n p.sleeves.filter((s) => s != this).forEach((s) => s.gainExperience(p, r, 1, true));\n }\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 this.bbAction = \"\";\n this.bbContract = \"------\";\n }\n\n shockRecovery(p: IPlayer): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus(p);\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(p);\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(p);\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.baseCost)) {\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.baseCost, \"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(p);\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 const faction = Factions[factionName];\n if (factionName === \"\" || !faction || !(faction 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(p);\n }\n\n const factionInfo = faction.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(p);\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 * Begin a bladeburner task\n */\n bladeburner(p: IPlayer, action: string, contract: string): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus(p);\n }\n\n this.gainRatesForTask.hack = 0;\n this.gainRatesForTask.str = 0;\n this.gainRatesForTask.def = 0;\n this.gainRatesForTask.dex = 0;\n this.gainRatesForTask.agi = 0;\n this.gainRatesForTask.cha = 0;\n this.gainRatesForTask.money = 0;\n this.currentTaskLocation = \"\";\n\n let time = 0;\n\n this.bbContract = \"------\";\n switch (action) {\n case \"Field analysis\":\n time = this.getBladeburnerActionTime(p, \"General\", action);\n this.gainRatesForTask.hack = 20 * this.hacking_exp_mult;\n this.gainRatesForTask.cha = 20 * this.charisma_exp_mult;\n break;\n case \"Recruitment\":\n time = this.getBladeburnerActionTime(p, \"General\", action);\n this.gainRatesForTask.cha =\n 2 * BladeburnerConstants.BaseStatGain * (p.bladeburner?.getRecruitmentTime(this) ?? 0) * 1000;\n this.currentTaskLocation = `(Success Rate: ${numeralWrapper.formatPercentage(\n this.recruitmentSuccessChance(p),\n )})`;\n break;\n case \"Diplomacy\":\n time = this.getBladeburnerActionTime(p, \"General\", action);\n break;\n case \"Infiltrate synthoids\":\n time = 60000;\n this.currentTaskLocation = \"This will generate additional contracts and operations\";\n break;\n case \"Support main sleeve\":\n p.bladeburner?.sleeveSupport(true);\n time = 0;\n break;\n case \"Take on contracts\":\n time = this.getBladeburnerActionTime(p, \"Contracts\", contract);\n this.contractGainRates(p, \"Contracts\", contract);\n this.currentTaskLocation = this.contractSuccessChance(p, \"Contracts\", contract);\n this.bbContract = capitalizeEachWord(contract.toLowerCase());\n break;\n }\n\n this.bbAction = capitalizeFirstLetter(action.toLowerCase());\n this.currentTaskMaxTime = time;\n this.currentTask = SleeveTaskType.Bladeburner;\n return true;\n }\n\n recruitmentSuccessChance(p: IPlayer): number {\n return Math.max(0, Math.min(1, p.bladeburner?.getRecruitmentSuccessChance(this) ?? 0));\n }\n\n contractSuccessChance(p: IPlayer, type: string, name: string): string {\n const bb = p.bladeburner;\n if (bb === null) {\n const errorLogText = `bladeburner is null`;\n console.error(`Function: sleeves.contractSuccessChance; Message: '${errorLogText}'`);\n return \"0%\";\n }\n const chances = bb.getActionEstimatedSuccessChanceNetscriptFn(this, type, name);\n if (typeof chances === \"string\") {\n console.error(`Function: sleeves.contractSuccessChance; Message: '${chances}'`);\n return \"0%\";\n }\n if (chances[0] >= 1) {\n return \"100%\";\n } else {\n return `${numeralWrapper.formatPercentage(chances[0])} - ${numeralWrapper.formatPercentage(chances[1])}`;\n }\n }\n\n contractGainRates(p: IPlayer, type: string, name: string): void {\n const bb = p.bladeburner;\n if (bb === null) {\n const errorLogText = `bladeburner is null`;\n console.error(`Function: sleeves.contractGainRates; Message: '${errorLogText}'`);\n return;\n }\n const actionIdent = bb.getActionIdFromTypeAndName(type, name);\n if (actionIdent === null) {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n console.error(`Function: sleeves.contractGainRates; Message: '${errorLogText}'`);\n this.resetTaskStatus(p);\n return;\n }\n const action = bb.getActionObject(actionIdent);\n if (action === null) {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n console.error(`Function: sleeves.contractGainRates; Message: '${errorLogText}'`);\n this.resetTaskStatus(p);\n return;\n }\n const retValue = bb.getActionStats(action, true);\n this.gainRatesForTask.hack = retValue.hack;\n this.gainRatesForTask.str = retValue.str;\n this.gainRatesForTask.def = retValue.def;\n this.gainRatesForTask.dex = retValue.dex;\n this.gainRatesForTask.agi = retValue.agi;\n this.gainRatesForTask.cha = retValue.cha;\n const rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n this.gainRatesForTask.money =\n BladeburnerConstants.ContractBaseMoneyGain * rewardMultiplier * bb.skillMultipliers.money;\n }\n\n getBladeburnerActionTime(p: IPlayer, type: string, name: string): number {\n //Maybe find workerscript and use original\n const bb = p.bladeburner;\n if (bb === null) {\n const errorLogText = `bladeburner is null`;\n console.error(`Function: sleeves.getBladeburnerActionTime; Message: '${errorLogText}'`);\n return -1;\n }\n\n const time = bb.getActionTimeNetscriptFn(this, type, name);\n if (typeof time === \"string\") {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n console.error(`Function: sleeves.getBladeburnerActionTime; Message: '${errorLogText}'`);\n return -1;\n } else {\n return time;\n }\n }\n\n takeDamage(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.shock += 0.5;\n this.hp = this.max_hp;\n return true;\n } else {\n return false;\n }\n }\n\n whoAmI(): string {\n return \"Sleeve\";\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","export enum RamCalculationErrorCode {\n SyntaxError = -1,\n ImportError = -2,\n URLImportError = -3,\n}\n","import { EventEmitter } from \"../utils/EventEmitter\";\nexport const TerminalEvents = new EventEmitter<[]>();\nexport const TerminalClearEvents = new EventEmitter<[]>();\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 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","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 React, { useState, useEffect } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Modal } from \"./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 component={\"span\"}>{alerts[0].text}</Typography>\n </Box>\n </Modal>\n )}\n </>\n );\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","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","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 { Message } from \"./Message\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { Router } from \"../ui/GameRoot\";\nimport { Programs } from \"../Programs/Programs\";\nimport { Player } from \"../Player\";\nimport { Page } from \"../ui/Router\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Settings } from \"../Settings/Settings\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Server } from \"../Server/Server\";\n\n//Sends message to player, including a pop up\nfunction sendMessage(msg: Message, forced = false): void {\n if (forced || !Settings.SuppressMessages) {\n showMessage(msg.filename);\n }\n addMessageToServer(msg);\n}\n\nfunction showMessage(name: MessageFilenames): void {\n const msg = Messages[name];\n if (!(msg instanceof Message)) 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): void {\n //Short-circuit if the message has already been saved\n if (recvd(msg)) {\n return;\n }\n const server = GetServer(\"home\");\n if (server == null) {\n throw new Error(\"The home server doesn't exist. You done goofed.\");\n }\n server.messages.push(msg.filename);\n}\n\n//Returns whether the given message has already been received\nfunction recvd(msg: Message): boolean {\n const server = GetServer(\"home\");\n if (server == null) {\n throw new Error(\"The home server doesn't exist. You done goofed.\");\n }\n return server.messages.includes(msg.filename);\n}\n\n//Checks if any of the 'timed' messages should be sent\nfunction checkForMessagesToSend(): void {\n if (Router.page() === Page.BitVerse) 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 truthGazer = Messages[MessageFilenames.TruthGazer];\n const redpill = Messages[MessageFilenames.RedPill];\n\n if (Player.hasAugmentation(AugmentationNames.TheRedPill)) {\n //Get the world daemon required hacking level\n const worldDaemon = GetServer(SpecialServers.WorldDaemon);\n if (!(worldDaemon instanceof Server)) {\n throw new Error(\"The world daemon is not a server???? Please un-break reality\");\n }\n //If the daemon can be hacked, send the player icarus.msg\n if (Player.hacking >= worldDaemon.requiredHackingSkill) {\n sendMessage(redpill, Player.sourceFiles.length === 0);\n }\n //If the daemon cannot be hacked, send the player truthgazer.msg a single time.\n else if (!recvd(truthGazer)) {\n sendMessage(truthGazer);\n }\n } else if (!recvd(jumper0) && 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 (!recvd(jumper1) && Player.hacking >= 40) {\n sendMessage(jumper1);\n } else if (!recvd(cybersecTest) && Player.hacking >= 50) {\n sendMessage(cybersecTest);\n } else if (!recvd(jumper2) && Player.hacking >= 175) {\n sendMessage(jumper2);\n } else if (!recvd(nitesecTest) && Player.hacking >= 200) {\n sendMessage(nitesecTest);\n } else if (!recvd(jumper3) && Player.hacking >= 350) {\n sendMessage(jumper3);\n } else if (!recvd(jumper4) && Player.hacking >= 490) {\n sendMessage(jumper4);\n } else if (!recvd(bitrunnersTest) && Player.hacking >= 500) {\n sendMessage(bitrunnersTest);\n }\n}\n\nexport enum 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 TruthGazer = \"truthgazer.msg\",\n RedPill = \"icarus.msg\",\n}\n\n//Reset\nconst Messages: Record<MessageFilenames, Message> = {\n //jump3R Messages\n [MessageFilenames.Jumper0]: 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 [MessageFilenames.Jumper1]: new Message(\n MessageFilenames.Jumper1,\n `Soon you will be contacted by a hacking group known as ${FactionNames.NiteSec}. ` +\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 [MessageFilenames.Jumper2]: 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 ${FactionNames.NiteSec}.` +\n \"<br><br>-jump3R\",\n ),\n\n [MessageFilenames.Jumper3]: 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 ${FactionNames.TheBlackHand}. <br><br>` +\n \"I.I.I.I <br><br>-jump3R\",\n ),\n\n [MessageFilenames.Jumper4]: 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 //Messages from hacking factions\n [MessageFilenames.CyberSecTest]: 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 `-${FactionNames.CyberSec}`,\n ),\n\n [MessageFilenames.NiteSecTest]: 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, avmnite-02h. Then, we will contact you again.\" +\n `<br><br>-${FactionNames.NiteSec}`,\n ),\n\n [MessageFilenames.BitRunnersTest]: 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 //Messages to guide players to the daemon\n [MessageFilenames.TruthGazer]: new Message(\n MessageFilenames.TruthGazer,\n //\"THE TRUTH CAN NO LONGER ESCAPE YOUR GAZE\"\n \"@&*($#@&__TH3__#@A&#@*)__TRU1H__(*)&*)($#@&()E&R)W&<br>\" +\n \"%@*$^$()@&$)$*@__CAN__()(@^#)@&@)#__N0__(#@&#)@&@&(<br>\" +\n \"*(__LON6ER__^#)@)(()*#@)@__ESCAP3__)#(@(#@*@()@(#*$<br>\" +\n \"()@)#$*%)$#()$#__Y0UR__(*)$#()%(&(%)*!)($__GAZ3__#(\",\n ),\n\n [MessageFilenames.RedPill]: new Message(\n MessageFilenames.RedPill,\n //\"FIND THE-CAVE\"\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\nexport { Messages, checkForMessagesToSend, showMessage };\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","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 return now - LastExportBonus > bonusTimer;\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","/**\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","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","import { Augmentation, IConstructorParams } from \"../Augmentation\";\nimport { AugmentationNames } from \"./AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Programs } from \"../../Programs/Programs\";\nimport { WHRNG } from \"../../Casino/RNG\";\nimport React from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { CONSTANTS } from \"../../Constants\";\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\nexport const initSoAAugmentations = (): Augmentation[] => [\n new Augmentation({\n name: AugmentationNames.WKSharmonizer,\n repCost: 1e4,\n moneyCost: 1e6,\n info:\n `A copy of the WKS harmonizer from the MIA leader of the ${FactionNames.ShadowsOfAnarchy} ` +\n \"injects *Γ-based cells that provides general enhancement to the body.\",\n stats: (\n <>\n This augmentation makes many aspect of infiltration easier and more productive. Such as increased timer,\n rewards, reduced damage taken, etc.\n </>\n ),\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.MightOfAres,\n repCost: 1e4,\n moneyCost: 1e6,\n info:\n \"Extra-occular neurons taken from old martial art master. Injecting the user the ability to \" +\n \"predict enemy attack before they even know it themself.\",\n stats: (\n <>This augmentation makes the Slash minigame easier by showing you via an indictor when the slash in coming.</>\n ),\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.WisdomOfAthena,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"A connective brain implant to SASHA that focuses in pattern recognition and predictive templating.\",\n stats: <>This augmentation makes the Bracket minigame easier by removing all '[' ']'.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.ChaosOfDionysus,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Opto-occipito implant to process visual signal before brain interpretation.\",\n stats: <>This augmentation makes the Backwards minigame easier by flipping the words.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.BeautyOfAphrodite,\n repCost: 1e4,\n moneyCost: 1e6,\n info:\n \"Pheromone extruder injected in the thoracodorsal nerve. Emits pleasing scent guaranteed to \" +\n \"make conversational partners more agreeable.\",\n stats: <>This augmentation makes the Bribe minigame easier by indicating the incorrect paths.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.TrickeryOfHermes,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Penta-dynamo-neurovascular-valve inserted in the carpal ligament, enhances dexterity.\",\n stats: <>This augmentation makes the Cheat Code minigame easier by allowing the opposite character.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.FloodOfPoseidon,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Transtinatium VVD reticulator used in optico-sterbing recognition.\",\n stats: <>This augmentation makes the Symbol matching minigame easier by indicating the correct choice.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.HuntOfArtemis,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"magneto-turboencabulator based on technology by Micha Eike Siemon, increases the users electro-magnetic sensitivity.\",\n stats: (\n <>\n This augmentation makes the Minesweeper minigame easier by showing the location of all mines and keeping their\n position.\n </>\n ),\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.KnowledgeOfApollo,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Neodynic retention fjengeln spoofer using -φ karmions, net positive effect on implantees delta wave.\",\n stats: <>This augmentation makes the Wire Cutting minigame easier by indicating the incorrect wires.</>,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n];\n\nexport const initGeneralAugmentations = (): Augmentation[] => [\n 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 factions: [FactionNames.Tetrads, FactionNames.TheDarkArmy, FactionNames.TheSyndicate],\n }),\n 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 factions: [\n FactionNames.SlumSnakes,\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Sector12,\n FactionNames.Ishima,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n 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 factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Sector12,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n 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, AugmentationNames.Targeting1],\n dexterity_mult: 1.3,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n FactionNames.TheCovenant,\n ],\n }),\n 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 factions: [\n FactionNames.KuaiGongInternational,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.SpeakersForTheDead,\n FactionNames.NWO,\n FactionNames.TheCovenant,\n FactionNames.Daedalus,\n FactionNames.Illuminati,\n ],\n }),\n 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 factions: [\n FactionNames.KuaiGongInternational,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.SpeakersForTheDead,\n FactionNames.NWO,\n FactionNames.TheCovenant,\n FactionNames.Daedalus,\n FactionNames.Illuminati,\n FactionNames.BladeIndustries,\n ],\n }),\n 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 factions: [\n FactionNames.SlumSnakes,\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Volhaven,\n FactionNames.Ishima,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n 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 factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Volhaven,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n 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, AugmentationNames.CombatRib1],\n strength_mult: 1.18,\n defense_mult: 1.18,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n FactionNames.TheCovenant,\n ],\n }),\n 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 factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.OmniTekIncorporated,\n FactionNames.BladeIndustries,\n FactionNames.TianDiHui,\n FactionNames.SpeakersForTheDead,\n FactionNames.FulcrumSecretTechnologies,\n ],\n }),\n 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 factions: [\n FactionNames.TheSyndicate,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.Illuminati,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n ],\n }),\n 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 factions: [\n FactionNames.TianDiHui,\n FactionNames.SlumSnakes,\n FactionNames.Sector12,\n FactionNames.Volhaven,\n FactionNames.Aevum,\n FactionNames.Ishima,\n FactionNames.TheSyndicate,\n FactionNames.TheDarkArmy,\n FactionNames.SpeakersForTheDead,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBoneLacings,\n repCost: 1.125e6,\n moneyCost: 4.25e9,\n info: \"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 factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.TheCovenant],\n }),\n 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 factions: [\n FactionNames.SpeakersForTheDead,\n FactionNames.TheSyndicate,\n FactionNames.KuaiGongInternational,\n FactionNames.OmniTekIncorporated,\n FactionNames.BladeIndustries,\n ],\n }),\n 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 factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.ECorp],\n }),\n 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 factions: [\n FactionNames.SpeakersForTheDead,\n FactionNames.TheSyndicate,\n FactionNames.KuaiGongInternational,\n FactionNames.OmniTekIncorporated,\n FactionNames.BladeIndustries,\n ],\n }),\n 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 factions: [FactionNames.MegaCorp, FactionNames.ECorp, FactionNames.FulcrumSecretTechnologies],\n }),\n 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 factions: [\n FactionNames.TianDiHui,\n FactionNames.Chongqing,\n FactionNames.Sector12,\n FactionNames.NewTokyo,\n FactionNames.Aevum,\n FactionNames.Ishima,\n FactionNames.Volhaven,\n FactionNames.Silhouette,\n ],\n }),\n 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 factions: [FactionNames.Silhouette],\n }),\n 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 factions: [\n FactionNames.BachmanAssociates,\n FactionNames.NWO,\n FactionNames.ClarkeIncorporated,\n FactionNames.OmniTekIncorporated,\n FactionNames.FourSigma,\n ],\n }),\n 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 factions: [FactionNames.CyberSec, FactionNames.NiteSec],\n }),\n 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 factions: [FactionNames.BitRunners, FactionNames.FulcrumSecretTechnologies],\n }),\n 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 factions: [FactionNames.TheBlackHand, FactionNames.NiteSec],\n }),\n 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 factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.BitRunners, FactionNames.TheBlackHand],\n }),\n 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 factions: [FactionNames.CyberSec, FactionNames.Aevum],\n }),\n 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 factions: [FactionNames.NiteSec],\n }),\n 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 factions: [\n FactionNames.BitRunners,\n FactionNames.TheBlackHand,\n FactionNames.NiteSec,\n FactionNames.Chongqing,\n FactionNames.NewTokyo,\n ],\n }),\n 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 factions: [\n FactionNames.BitRunners,\n FactionNames.TheBlackHand,\n FactionNames.NiteSec,\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.BladeIndustries,\n ],\n }),\n 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 factions: [\n FactionNames.BitRunners,\n FactionNames.TheBlackHand,\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.BladeIndustries,\n ],\n }),\n 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, AugmentationNames.ENM],\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 factions: [\n FactionNames.BitRunners,\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.BladeIndustries,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n ],\n }),\n 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, AugmentationNames.ENMCore, AugmentationNames.ENM],\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 factions: [\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n FactionNames.Illuminati,\n ],\n }),\n 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 factions: [\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n FactionNames.Illuminati,\n ],\n }),\n 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 factions: [\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n FactionNames.Illuminati,\n ],\n }),\n 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 factions: [\n FactionNames.TheBlackHand,\n FactionNames.Chongqing,\n FactionNames.Sector12,\n FactionNames.NewTokyo,\n FactionNames.Aevum,\n FactionNames.Ishima,\n FactionNames.Volhaven,\n FactionNames.BachmanAssociates,\n FactionNames.ClarkeIncorporated,\n FactionNames.FourSigma,\n ],\n }),\n 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 factions: [FactionNames.BitRunners],\n }),\n 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 factions: [FactionNames.CyberSec, FactionNames.NiteSec],\n }),\n 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 factions: [FactionNames.CyberSec, FactionNames.NiteSec],\n }),\n 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, AugmentationNames.CranialSignalProcessorsG1],\n hacking_speed_mult: 1.02,\n hacking_money_mult: 1.15,\n hacking_mult: 1.09,\n factions: [FactionNames.NiteSec, FactionNames.TheBlackHand, FactionNames.BitRunners],\n }),\n 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: [\n AugmentationNames.CranialSignalProcessorsG3,\n AugmentationNames.CranialSignalProcessorsG2,\n AugmentationNames.CranialSignalProcessorsG1,\n ],\n hacking_speed_mult: 1.02,\n hacking_money_mult: 1.2,\n hacking_grow_mult: 1.25,\n factions: [FactionNames.TheBlackHand, FactionNames.BitRunners],\n }),\n 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: [\n AugmentationNames.CranialSignalProcessorsG4,\n AugmentationNames.CranialSignalProcessorsG3,\n AugmentationNames.CranialSignalProcessorsG2,\n AugmentationNames.CranialSignalProcessorsG1,\n ],\n hacking_mult: 1.3,\n hacking_money_mult: 1.25,\n hacking_grow_mult: 1.75,\n factions: [FactionNames.BitRunners],\n }),\n 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 factions: [FactionNames.ClarkeIncorporated],\n }),\n 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 factions: [\n FactionNames.TianDiHui,\n FactionNames.Volhaven,\n FactionNames.NewTokyo,\n FactionNames.Chongqing,\n FactionNames.ClarkeIncorporated,\n FactionNames.FourSigma,\n FactionNames.BachmanAssociates,\n ],\n }),\n 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 factions: [\n FactionNames.TianDiHui,\n FactionNames.SpeakersForTheDead,\n FactionNames.FourSigma,\n FactionNames.KuaiGongInternational,\n FactionNames.ClarkeIncorporated,\n FactionNames.BachmanAssociates,\n ],\n }),\n 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 factions: [\n FactionNames.BachmanAssociates,\n FactionNames.ClarkeIncorporated,\n FactionNames.FourSigma,\n FactionNames.KuaiGongInternational,\n ],\n }),\n 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 factions: [\n FactionNames.FourSigma,\n FactionNames.OmniTekIncorporated,\n FactionNames.ECorp,\n FactionNames.BladeIndustries,\n ],\n }),\n 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 factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.ECorp, FactionNames.BladeIndustries],\n }),\n 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 factions: [FactionNames.FulcrumSecretTechnologies],\n }),\n 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 factions: [\n FactionNames.TianDiHui,\n FactionNames.TheSyndicate,\n FactionNames.NWO,\n FactionNames.MegaCorp,\n FactionNames.FourSigma,\n ],\n }),\n 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 factions: [\n FactionNames.Silhouette,\n FactionNames.FourSigma,\n FactionNames.BachmanAssociates,\n FactionNames.ClarkeIncorporated,\n ],\n }),\n 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 factions: [FactionNames.TheSyndicate, FactionNames.TheDarkArmy, FactionNames.SpeakersForTheDead],\n }),\n 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 factions: [FactionNames.Netburners],\n }),\n 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 factions: [FactionNames.Netburners],\n }),\n 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 factions: [FactionNames.Netburners],\n }),\n 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 factions: [FactionNames.Netburners],\n }),\n 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 factions: [FactionNames.Netburners],\n }),\n 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 factions: [FactionNames.CyberSec, FactionNames.Aevum],\n }),\n 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 factions: [FactionNames.BitRunners, FactionNames.NiteSec],\n }),\n 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 factions: [FactionNames.NWO, FactionNames.FourSigma],\n }),\n 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 factions: [FactionNames.BladeIndustries, FactionNames.KuaiGongInternational],\n }),\n 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 factions: [FactionNames.SlumSnakes, FactionNames.Tetrads],\n }),\n 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 factions: [FactionNames.SlumSnakes, FactionNames.Tetrads],\n }),\n 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 factions: [FactionNames.SlumSnakes],\n }),\n 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 factions: [FactionNames.Tetrads, FactionNames.TheDarkArmy, FactionNames.TheSyndicate, FactionNames.NWO],\n }),\n 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 ${FactionNames.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 factions: [FactionNames.Illuminati],\n }),\n 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 factions: [FactionNames.TheCovenant],\n }),\n new Augmentation({\n name: AugmentationNames.HiveMind,\n repCost: 1.5e6,\n moneyCost: 5.5e9,\n info:\n `A brain implant developed by ${FactionNames.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 factions: [FactionNames.ECorp],\n }),\n 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 isSpecial: true,\n factions: [FactionNames.Daedalus],\n }),\n 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 factions: [FactionNames.MegaCorp],\n }),\n 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 factions: [FactionNames.BachmanAssociates],\n }),\n 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 factions: [FactionNames.BladeIndustries],\n }),\n 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 factions: [FactionNames.NWO],\n }),\n 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 user's strength to unbelievable levels. The augmentation \" +\n \"gets more powerful over time for seemingly no reason.\",\n strength_mult: 2.7,\n factions: [FactionNames.NWO],\n }),\n 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 factions: [FactionNames.ClarkeIncorporated],\n }),\n 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 factions: [FactionNames.OmniTekIncorporated],\n }),\n 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 factions: [FactionNames.KuaiGongInternational],\n }),\n 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 ${FactionNames.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 factions: [FactionNames.BitRunners],\n }),\n 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 factions: [FactionNames.TheBlackHand],\n }),\n 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 factions: [FactionNames.NiteSec],\n }),\n 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 factions: [FactionNames.Chongqing],\n }),\n 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 factions: [FactionNames.Sector12],\n }),\n 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 factions: [FactionNames.NewTokyo],\n }),\n 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 factions: [FactionNames.Aevum],\n }),\n 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 factions: [FactionNames.Ishima],\n }),\n 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 factions: [FactionNames.Volhaven],\n }),\n 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 factions: [FactionNames.SpeakersForTheDead],\n }),\n 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 factions: [FactionNames.TheDarkArmy],\n }),\n 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 factions: [FactionNames.TheSyndicate],\n }),\n new Augmentation({\n name: AugmentationNames.BionicArms,\n repCost: 6.25e4,\n moneyCost: 2.75e8,\n info: \"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 factions: [FactionNames.Tetrads],\n }),\n 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 factions: [FactionNames.TianDiHui],\n }),\n 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 factions: [FactionNames.TianDiHui],\n }),\n\n // Grafting-exclusive Augmentation\n new Augmentation({\n name: AugmentationNames.CongruityImplant,\n repCost: Infinity,\n moneyCost: 50e12,\n info: (\n <>\n Developed by a pioneer in Grafting research, this implant generates pulses of stability which seem to have a\n nullifying effect versus the Entropy virus.\n <br />\n <br />\n <b>Note:</b> For unknown reasons, the lowercase <code>n</code> appears to be an integral component to its\n functionality.\n </>\n ),\n stats: <>This Augmentation removes the Entropy virus, and prevents it from affecting you again.</>,\n factions: [],\n }),\n];\n\nexport const initBladeburnerAugmentations = (): Augmentation[] => [\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 ${FactionNames.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 factions: [FactionNames.Bladeburners],\n }),\n 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 ${FactionNames.Bladeburners} 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n 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 factions: [FactionNames.Bladeburners],\n }),\n];\n\nexport const initChurchOfTheMachineGodAugmentations = (): Augmentation[] => [\n 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 factions: [FactionNames.ChurchOfTheMachineGod],\n }),\n 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 factions: [FactionNames.ChurchOfTheMachineGod],\n }),\n 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, AugmentationNames.StaneksGift1],\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: <>Stanek's Gift has no penalty.</>,\n factions: [FactionNames.ChurchOfTheMachineGod],\n }),\n];\n\nexport function initNeuroFluxGovernor(): Augmentation {\n const donationBonus = CONSTANTS.Donations / 1e6 / 100; // 1 millionth of a percent per donation\n return new Augmentation({\n name: AugmentationNames.NeuroFluxGovernor,\n repCost: 500,\n moneyCost: 750e3,\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% (+{(donationBonus * 100).toFixed(6)}% boosted by real life blood donations), stacking\n multiplicatively.\n </>\n ),\n isSpecial: true,\n hacking_chance_mult: 1.01 + donationBonus,\n hacking_speed_mult: 1.01 + donationBonus,\n hacking_money_mult: 1.01 + donationBonus,\n hacking_grow_mult: 1.01 + donationBonus,\n hacking_mult: 1.01 + donationBonus,\n strength_mult: 1.01 + donationBonus,\n defense_mult: 1.01 + donationBonus,\n dexterity_mult: 1.01 + donationBonus,\n agility_mult: 1.01 + donationBonus,\n charisma_mult: 1.01 + donationBonus,\n hacking_exp_mult: 1.01 + donationBonus,\n strength_exp_mult: 1.01 + donationBonus,\n defense_exp_mult: 1.01 + donationBonus,\n dexterity_exp_mult: 1.01 + donationBonus,\n agility_exp_mult: 1.01 + donationBonus,\n charisma_exp_mult: 1.01 + donationBonus,\n company_rep_mult: 1.01 + donationBonus,\n faction_rep_mult: 1.01 + donationBonus,\n crime_money_mult: 1.01 + donationBonus,\n crime_success_mult: 1.01 + donationBonus,\n hacknet_node_money_mult: 1.01 + donationBonus,\n hacknet_node_purchase_cost_mult: 1 / (1.01 + donationBonus),\n hacknet_node_ram_cost_mult: 1 / (1.01 + donationBonus),\n hacknet_node_core_cost_mult: 1 / (1.01 + donationBonus),\n hacknet_node_level_cost_mult: 1 / (1.01 + donationBonus),\n work_money_mult: 1.01 + donationBonus,\n factions: Object.values(FactionNames).filter(\n (factionName) =>\n ![FactionNames.ShadowsOfAnarchy, FactionNames.Bladeburners, FactionNames.ChurchOfTheMachineGod].includes(\n factionName,\n ),\n ),\n });\n}\n\nexport function initUnstableCircadianModulator(): Augmentation {\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 factions: [FactionNames.SpeakersForTheDead],\n };\n Object.keys(randomBonuses.bonuses).forEach(\n (key) => ((UnstableCircadianModulatorParams as any)[key] = randomBonuses.bonuses[key]),\n );\n\n return new Augmentation(UnstableCircadianModulatorParams);\n}\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\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: LocationName.AevumECorp.toLowerCase(),\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: LocationName.Sector12MegaCorp.toLowerCase(),\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: LocationName.VolhavenNWO.toLowerCase(),\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: LocationName.NewTokyoVitaLife.toLowerCase(),\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: LocationName.AevumAeroCorp.toLowerCase(),\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: LocationName.Sector12DeltaOne.toLowerCase(),\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: LocationName.VolhavenCompuTek.toLowerCase(),\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: LocationName.Sector12FoodNStuff.toLowerCase(),\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: `${LocationName.Sector12IronGym} 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: FactionNames.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: FactionNames.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 hostname: SpecialServers.DarkWeb,\n moneyAvailable: 0,\n numOpenPortsRequired: 5,\n organizationName: SpecialServers.DarkWeb,\n requiredHackingSkill: 1,\n specialName: SpecialServers.DarkWeb,\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","/**\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","export function checkEnum<T extends string, TEnumValue extends string>(\n enumVariable: { [key in T]: TEnumValue },\n value: string,\n): value is TEnumValue {\n return Object.values(enumVariable).includes(value);\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. Higher Intelligence levels will boost your production for many actions in the game. In addition, this\n Source-File will unlock:\n <br />\n <ul>\n <li>\n The <code>getBitNodeMultipliers()</code> Netscript function\n </li>\n <li>Permanent access to Formulas.exe</li>\n <li>\n Access to BitNode multiplier information on the <b>Stats</b> page\n </li>\n </ul>\n It 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);\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, and the Grafting API in other BitNodes. Each level of this Source-File\n also grants you a 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","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","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 React from \"react\";\nimport { IMap } from \"../types\";\nimport { FactionNames } from \"./data/FactionNames\";\nimport { use } from \"../ui/Context\";\nimport { Option } from \"./ui/Option\";\nimport { Typography } from \"@mui/material\";\n\ninterface FactionInfoParams {\n infoText?: JSX.Element;\n enemies?: string[];\n offerHackingWork?: boolean;\n offerFieldWork?: boolean;\n offerSecurityWork?: boolean;\n special?: boolean;\n keepOnInstall?: boolean;\n assignment?: () => React.ReactElement;\n}\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 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 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 /**\n * The data to display on the faction screen.\n */\n assignment?: () => React.ReactElement;\n\n constructor(params: FactionInfoParams) {\n this.infoText = params.infoText ?? <></>;\n this.enemies = params.enemies ?? [];\n this.offerHackingWork = params.offerHackingWork ?? false;\n this.offerFieldWork = params.offerFieldWork ?? false;\n this.offerSecurityWork = params.offerSecurityWork ?? false;\n\n this.keep = params.keepOnInstall ?? false;\n this.special = params.special ?? false;\n this.assignment = params.assignment;\n }\n\n offersWork(): boolean {\n return this.offerFieldWork || 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 [FactionNames.Illuminati]: new FactionInfo({\n infoText: (\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 offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.Daedalus]: new FactionInfo({\n infoText: <>Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.TheCovenant]: new FactionInfo({\n infoText: (\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 offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n // Megacorporations, each forms its own faction\n [FactionNames.ECorp]: new FactionInfo({\n infoText: (\n <>\n {FactionNames.ECorp}'s mission is simple: to connect the world of today with the technology of tomorrow. With\n our wide range of Internet-related software and commercial hardware, {FactionNames.ECorp} makes the world's\n information universally accessible.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.MegaCorp]: new FactionInfo({\n infoText: (\n <>\n {FactionNames.MegaCorp} does what no other dares to do. We imagine. We create. We invent. We create what others\n have never even dreamed of. Our work fills the world's needs for food, water, power, and transportation on an\n unprecedented scale, in ways that no other company can.\n <br />\n <br />\n In our labs and factories and on the ground with customers, {FactionNames.MegaCorp} is ushering in a new era for\n the world.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.BachmanAssociates]: new FactionInfo({\n infoText: (\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 offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.BladeIndustries]: new FactionInfo({\n infoText: <>Augmentation is Salvation.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.NWO]: new FactionInfo({\n infoText: (\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 offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.ClarkeIncorporated]: new FactionInfo({\n infoText: <>The Power of the Genome - Unlocked.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.OmniTekIncorporated]: new FactionInfo({\n infoText: <>Simply put, our mission is to design and build robots that make a difference.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.FourSigma]: new FactionInfo({\n infoText: (\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 {FactionNames.FourSigma}.\n </>\n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.KuaiGongInternational]: new FactionInfo({\n infoText: <>Dream big. Work hard. Make history.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n // Other Corporations\n [FactionNames.FulcrumSecretTechnologies]: new FactionInfo({\n infoText: (\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 offerHackingWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n // Hacker groups\n [FactionNames.BitRunners]: new FactionInfo({\n infoText: (\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 offerHackingWork: true,\n }),\n\n [FactionNames.TheBlackHand]: new FactionInfo({\n infoText: (\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 offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n // prettier-ignore\n [FactionNames.NiteSec]: new FactionInfo({\n infoText:(<>\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 offerHackingWork: true,\n offerFieldWork: false,\n offerSecurityWork: false,\n special: false,\n keepOnInstall: false,\n }),\n\n // City factions, essentially governments\n [FactionNames.Aevum]: new FactionInfo({\n infoText: <>The Silicon City.</>,\n enemies: [FactionNames.Chongqing, FactionNames.NewTokyo, FactionNames.Ishima, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Chongqing]: new FactionInfo({\n infoText: <>Serve the People.</>,\n enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Ishima]: new FactionInfo({\n infoText: <>The East Asian Order of the Future.</>,\n enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.NewTokyo]: new FactionInfo({\n infoText: <>Asia's World City.</>,\n enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Sector12]: new FactionInfo({\n infoText: <>The City of the Future.</>,\n enemies: [FactionNames.Chongqing, FactionNames.NewTokyo, FactionNames.Ishima, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Volhaven]: new FactionInfo({\n infoText: <>Benefit, Honor, and Glory.</>,\n enemies: [\n FactionNames.Chongqing,\n FactionNames.Sector12,\n FactionNames.NewTokyo,\n FactionNames.Aevum,\n FactionNames.Ishima,\n ],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n // Criminal Organizations/Gangs\n [FactionNames.SpeakersForTheDead]: new FactionInfo({\n infoText: <>It is better to reign in Hell than to serve in Heaven.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n [FactionNames.TheDarkArmy]: new FactionInfo({\n infoText: <>The World doesn't care about right or wrong. It only cares about power.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.TheSyndicate]: new FactionInfo({\n infoText: <>Honor holds you back.</>,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n [FactionNames.Silhouette]: new FactionInfo({\n infoText: (\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 offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.Tetrads]: new FactionInfo({\n infoText: <>Following the mandate of Heaven and carrying out the way.</>,\n\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n [FactionNames.SlumSnakes]: new FactionInfo({\n infoText: <>{FactionNames.SlumSnakes} rule!</>,\n\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n // Earlygame factions - factions the player will prestige with early on that don't belong in other categories.\n [FactionNames.Netburners]: new FactionInfo({\n infoText: <>{\"~~//*>H4CK||3T 8URN3R5**>?>\\\\~~\"}</>,\n offerHackingWork: true,\n }),\n\n [FactionNames.TianDiHui]: new FactionInfo({\n infoText: <>Obey Heaven and work righteously.</>,\n offerHackingWork: true,\n\n offerSecurityWork: true,\n }),\n\n [FactionNames.CyberSec]: new FactionInfo({\n infoText: (\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 offerHackingWork: true,\n }),\n\n // Special Factions\n [FactionNames.Bladeburners]: new FactionInfo({\n infoText: (\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 {FactionNames.Bladeburners} actions.{\" \"}\n Completing {FactionNames.Bladeburners} contracts/operations will increase your reputation.\n </>\n ),\n\n special: true,\n assignment: (): React.ReactElement => {\n const router = use.Router();\n return (\n <Option\n buttonText={\"Open Bladeburner headquarters\"}\n infoText={\"You can gain reputation with bladeburner by completing contracts and operations.\"}\n onClick={() => router.toBladeburner()}\n />\n );\n },\n }),\n\n [FactionNames.ChurchOfTheMachineGod]: new FactionInfo({\n // prettier-ignore\n infoText:(<>\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 offerHackingWork: false,\n offerFieldWork: false,\n offerSecurityWork: false,\n special: true,\n keepOnInstall: true,\n assignment: (): React.ReactElement => {\n const router = use.Router();\n return (\n <Option\n buttonText={\"Open Staneks Gift\"}\n infoText={\n \"Stanek's Gift is a powerful augmentation that powers up the stat you chose to boost.\" +\n \"Gaining reputation with the Church of the Machine God can only be done by charging the gift.\"\n }\n onClick={() => router.toStaneksGift()}\n />\n );\n },\n }),\n [FactionNames.ShadowsOfAnarchy]: new FactionInfo({\n infoText: (\n <>\n The government is ruled by the corporations that we have allowed to consume it. To release the world from its\n shackles, the gods grant us their strength.\n </>\n ),\n special: true,\n keepOnInstall: true,\n assignment: (): React.ReactElement => {\n return <Typography>{FactionNames.ShadowsOfAnarchy} can only gain reputation by infiltrating.</Typography>;\n },\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 return Math.random() <= chance;\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(\"traffic\") || roughName.includes(\"illegal\")) && 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(\"assassin\")) {\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 employeeJobs: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n [EmployeePositions.Training]: 0,\n [EmployeePositions.Unassigned]: 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 this.calculateTotalEmployees();\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 calculateTotalEmployees(): void {\n //Reset\n for (const name of Object.keys(this.employeeJobs)) {\n this.employeeJobs[name] = 0;\n }\n\n for (let i = 0; i < this.employees.length; ++i) {\n const employee = this.employees[i];\n this.employeeJobs[employee.pos]++;\n }\n this.employeeJobs.total = this.employees.length;\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 jobCount = this.employees.reduce((acc, employee) => (employee.pos === job ? acc + 1 : acc), 0);\n\n for (const employee of this.employees) {\n if (jobCount == amount) return true;\n if (employee.pos === EmployeePositions.Unassigned && jobCount <= amount) {\n employee.pos = job;\n jobCount++;\n } else if (employee.pos === job && jobCount >= amount) {\n employee.pos = EmployeePositions.Unassigned;\n jobCount--;\n }\n }\n return jobCount === amount;\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 interface CorporationUpgrade {\n index: number;\n basePrice: number;\n priceMult: number;\n benefit: number;\n name: string;\n desc: string;\n}\n\nexport enum CorporationUpgradeIndex {\n SmartFactories = 0,\n SmartStorage = 1,\n DreamSense = 2,\n WilsonAnalytics = 3,\n NuoptimalNootropicInjectorImplants = 4,\n SpeechProcessorImplants = 5,\n NeuralAccelerators = 6,\n FocusWires = 7,\n ABCSalesBots = 8,\n ProjectInsight = 9,\n}\n\n// Corporation Upgrades\n// Upgrades for entire corporation, levelable upgrades\nexport const CorporationUpgrades: Record<CorporationUpgradeIndex, CorporationUpgrade> = {\n //Smart factories, increases production\n [CorporationUpgradeIndex.SmartFactories]: {\n index: CorporationUpgradeIndex.SmartFactories,\n basePrice: 2e9,\n priceMult: 1.06,\n benefit: 0.03,\n name: \"Smart Factories\",\n desc:\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 [CorporationUpgradeIndex.SmartStorage]: {\n index: CorporationUpgradeIndex.SmartStorage,\n basePrice: 2e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Smart Storage\",\n desc:\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 [CorporationUpgradeIndex.DreamSense]: {\n index: CorporationUpgradeIndex.DreamSense,\n basePrice: 4e9,\n priceMult: 1.1,\n benefit: 0.001,\n name: \"DreamSense\",\n desc:\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 [CorporationUpgradeIndex.WilsonAnalytics]: {\n index: CorporationUpgradeIndex.WilsonAnalytics,\n basePrice: 4e9,\n priceMult: 1.5,\n benefit: 0.005,\n name: \"Wilson Analytics\",\n desc:\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 [CorporationUpgradeIndex.NuoptimalNootropicInjectorImplants]: {\n index: CorporationUpgradeIndex.NuoptimalNootropicInjectorImplants,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Nuoptimal Nootropic Injector Implants\",\n desc:\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 [CorporationUpgradeIndex.SpeechProcessorImplants]: {\n index: CorporationUpgradeIndex.SpeechProcessorImplants,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Speech Processor Implants\",\n desc:\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 [CorporationUpgradeIndex.NeuralAccelerators]: {\n index: CorporationUpgradeIndex.NeuralAccelerators,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Neural Accelerators\",\n desc:\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 [CorporationUpgradeIndex.FocusWires]: {\n index: CorporationUpgradeIndex.FocusWires,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"FocusWires\",\n desc:\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 [CorporationUpgradeIndex.ABCSalesBots]: {\n index: CorporationUpgradeIndex.ABCSalesBots,\n basePrice: 1e9,\n priceMult: 1.07,\n benefit: 0.01,\n name: \"ABC SalesBots\",\n desc:\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 [CorporationUpgradeIndex.ProjectInsight]: {\n index: CorporationUpgradeIndex.ProjectInsight,\n basePrice: 5e9,\n priceMult: 1.07,\n benefit: 0.05,\n name: \"Project Insight\",\n desc:\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","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> =\n | ParameterValidatorObject<Type, Key>\n | ParameterValidatorFunction<Type, Key>;\n\nexport function validateObject<Type extends Record<string, unknown>, Key extends keyof Type>(\n obj: Type,\n validator: ObjectValidator<Type>,\n): 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 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\nexport function minMax<Type, Key extends keyof Type>(\n def: number,\n min: number,\n max: number,\n): (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>(\n def: Value,\n options: Value[],\n): (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>(\n options: Value[],\n): (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","import { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { LocationsMetadata } from \"../../Locations/data/LocationsMetadata\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Faction } from \"../../Faction/Faction\";\n\nexport function calculateSellInformationCashReward(\n player: IPlayer,\n reward: number,\n maxLevel: number,\n difficulty: number,\n): number {\n const levelBonus = maxLevel * Math.pow(1.01, maxLevel);\n\n return (\n Math.pow(reward + 1, 2) *\n Math.pow(difficulty, 3) *\n 3e3 *\n levelBonus *\n (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.5 : 1) *\n BitNodeMultipliers.InfiltrationMoney\n );\n}\n\nexport function calculateTradeInformationRepReward(\n player: IPlayer,\n reward: number,\n maxLevel: number,\n difficulty: number,\n): number {\n const levelBonus = maxLevel * Math.pow(1.01, maxLevel);\n\n return (\n Math.pow(reward + 1, 1.1) *\n Math.pow(difficulty, 1.2) *\n 30 *\n levelBonus *\n (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.5 : 1) *\n BitNodeMultipliers.InfiltrationRep\n );\n}\n\nexport function calculateInfiltratorsRepReward(player: IPlayer, faction: Faction, difficulty: number): number {\n const maxStartingSecurityLevel = LocationsMetadata.reduce((acc, data): number => {\n const startingSecurityLevel = data.infiltrationData?.startingSecurityLevel || 0;\n return acc > startingSecurityLevel ? acc : startingSecurityLevel;\n }, 0);\n const baseRepGain = (difficulty / maxStartingSecurityLevel) * 5000;\n\n return (\n baseRepGain * (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 2 : 1) * (1 + faction.favor / 100)\n );\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","// choose random character for generating plaintexts to compress\nexport function comprGenChar(): string {\n const r = Math.random();\n if (r < 0.4) {\n return \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"[Math.floor(26 * Math.random())];\n } else if (r < 0.8) {\n return \"abcdefghijklmnopqrstuvwxyz\"[Math.floor(26 * Math.random())];\n } else {\n return \"01234567689\"[Math.floor(10 * Math.random())];\n }\n}\n\n// generate plaintext which is amenable to LZ encoding\nexport function comprLZGenerate(): string {\n const length = 50 + Math.floor(25 * (Math.random() + Math.random()));\n let plain = \"\";\n\n while (plain.length < length) {\n if (Math.random() < 0.8) {\n plain += comprGenChar();\n } else {\n const length = 1 + Math.floor(9 * Math.random());\n const offset = 1 + Math.floor(9 * Math.random());\n if (offset > plain.length) {\n continue;\n }\n\n for (let i = 0; i < length; ++i) {\n plain += plain[plain.length - offset];\n }\n }\n }\n\n return plain.substring(0, length);\n}\n\n// compress plaintest string\nexport function comprLZEncode(plain: string): string {\n // for state[i][j]:\n // if i is 0, we're adding a literal of length j\n // else, we're adding a backreference of offset i and length j\n let cur_state: (string | null)[][] = Array.from(Array(10), () => Array(10).fill(null));\n let new_state: (string | null)[][] = Array.from(Array(10), () => Array(10));\n\n function set(state: (string | null)[][], i: number, j: number, str: string): void {\n const current = state[i][j];\n if (current == null || str.length < current.length) {\n state[i][j] = str;\n } else if (str.length === current.length && Math.random() < 0.5) {\n // if two strings are the same length, pick randomly so that\n // we generate more possible inputs to Compression II\n state[i][j] = str;\n }\n }\n\n // initial state is a literal of length 1\n cur_state[0][1] = \"\";\n\n for (let i = 1; i < plain.length; ++i) {\n for (const row of new_state) {\n row.fill(null);\n }\n const c = plain[i];\n\n // handle literals\n for (let length = 1; length <= 9; ++length) {\n const string = cur_state[0][length];\n if (string == null) {\n continue;\n }\n\n if (length < 9) {\n // extend current literal\n set(new_state, 0, length + 1, string);\n } else {\n // start new literal\n set(new_state, 0, 1, string + \"9\" + plain.substring(i - 9, i) + \"0\");\n }\n\n for (let offset = 1; offset <= Math.min(9, i); ++offset) {\n if (plain[i - offset] === c) {\n // start new backreference\n set(new_state, offset, 1, string + length + plain.substring(i - length, i));\n }\n }\n }\n\n // handle backreferences\n for (let offset = 1; offset <= 9; ++offset) {\n for (let length = 1; length <= 9; ++length) {\n const string = cur_state[offset][length];\n if (string == null) {\n continue;\n }\n\n if (plain[i - offset] === c) {\n if (length < 9) {\n // extend current backreference\n set(new_state, offset, length + 1, string);\n } else {\n // start new backreference\n set(new_state, offset, 1, string + \"9\" + offset + \"0\");\n }\n }\n\n // start new literal\n set(new_state, 0, 1, string + length + offset);\n\n // end current backreference and start new backreference\n for (let new_offset = 1; new_offset <= Math.min(9, i); ++new_offset) {\n if (plain[i - new_offset] === c) {\n set(new_state, new_offset, 1, string + length + offset + \"0\");\n }\n }\n }\n }\n\n const tmp_state = new_state;\n new_state = cur_state;\n cur_state = tmp_state;\n }\n\n let result = null;\n\n for (let len = 1; len <= 9; ++len) {\n let string = cur_state[0][len];\n if (string == null) {\n continue;\n }\n\n string += len + plain.substring(plain.length - len, plain.length);\n if (result == null || string.length < result.length) {\n result = string;\n } else if (string.length == result.length && Math.random() < 0.5) {\n result = string;\n }\n }\n\n for (let offset = 1; offset <= 9; ++offset) {\n for (let len = 1; len <= 9; ++len) {\n let string = cur_state[offset][len];\n if (string == null) {\n continue;\n }\n\n string += len + \"\" + offset;\n if (result == null || string.length < result.length) {\n result = string;\n } else if (string.length == result.length && Math.random() < 0.5) {\n result = string;\n }\n }\n }\n\n return result ?? \"\";\n}\n\n// decompress LZ-compressed string, or return null if input is invalid\nexport function comprLZDecode(compr: string): string | null {\n let plain = \"\";\n\n for (let i = 0; i < compr.length; ) {\n const literal_length = compr.charCodeAt(i) - 0x30;\n\n if (literal_length < 0 || literal_length > 9 || i + 1 + literal_length > compr.length) {\n return null;\n }\n\n plain += compr.substring(i + 1, i + 1 + literal_length);\n i += 1 + literal_length;\n\n if (i >= compr.length) {\n break;\n }\n const backref_length = compr.charCodeAt(i) - 0x30;\n\n if (backref_length < 0 || backref_length > 9) {\n return null;\n } else if (backref_length === 0) {\n ++i;\n } else {\n if (i + 1 >= compr.length) {\n return null;\n }\n\n const backref_offset = compr.charCodeAt(i + 1) - 0x30;\n if ((backref_length > 0 && (backref_offset < 1 || backref_offset > 9)) || backref_offset > plain.length) {\n return null;\n }\n\n for (let j = 0; j < backref_length; ++j) {\n plain += plain[plain.length - backref_offset];\n }\n\n i += 2;\n }\n }\n\n return plain;\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({\n min,\n max,\n current,\n remaining,\n progress,\n color,\n}: 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","import { Factions } from \"../../Faction/Factions\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Gang } from \"../../Gang/Gang\";\nimport { IPlayer } from \"../IPlayer\";\nimport { GangConstants } from \"../../Gang/data/Constants\";\n\nexport function canAccessGang(this: IPlayer): boolean {\n if (this.bitNodeN === 2) {\n return true;\n }\n if (this.sourceFileLvl(2) <= 0) {\n return false;\n }\n\n return this.karma <= GangConstants.GangKarmaRequirement;\n}\n\nexport function isAwareOfGang(this: IPlayer): boolean {\n return this.bitNodeN === 2 || this.sourceFileLvl(2) >= 1;\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","import { IStyleSettings } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport const defaultStyles: IStyleSettings = {\n lineHeight: 1.5,\n fontFamily:\n \"Lucida Console, Lucida Sans Unicode, Fira Mono, Consolas, Courier New, Courier, monospace, Times New Roman\",\n};\n","import { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { CONSTANTS } from \"../Constants\";\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 \"./Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\nexport const PromptEvent = new EventEmitter<[Prompt]>();\n\ninterface Prompt {\n txt: string;\n options?: { type?: string; choices?: string[] };\n resolve: (result: boolean | string) => void;\n}\n\nexport function PromptManager(): React.ReactElement {\n const [prompt, setPrompt] = useState<Prompt | null>(null);\n useEffect(() => {\n return PromptEvent.subscribe((p: Prompt) => {\n setPrompt(p);\n });\n }, []);\n\n if (prompt === null) {\n return <></>;\n }\n\n function close(): void {\n if (prompt === null) return;\n if ([\"text\", \"select\"].includes(prompt?.options?.type ?? \"\")) {\n prompt.resolve(\"\");\n } else {\n prompt.resolve(false);\n }\n setPrompt(null);\n }\n\n const types: { [key: string]: any } = {\n text: PromptMenuText,\n select: PromptMenuSelect,\n };\n\n let PromptContent = PromptMenuBoolean;\n if (prompt?.options?.type && [\"text\", \"select\"].includes(prompt?.options?.type))\n PromptContent = types[prompt?.options?.type];\n const resolve = (value: boolean | string): void => {\n prompt.resolve(value);\n setPrompt(null);\n };\n\n return (\n <Modal open={true} onClose={close}>\n <pre>\n <Typography>{prompt.txt}</Typography>\n </pre>\n <PromptContent prompt={prompt} resolve={resolve} />\n </Modal>\n );\n}\n\ninterface IContentProps {\n prompt: Prompt;\n resolve: (value: boolean | string) => void;\n}\n\nfunction PromptMenuBoolean({ resolve }: IContentProps): React.ReactElement {\n const yes = (): void => resolve(true);\n const no = (): void => resolve(false);\n\n return (\n <>\n <div style={{ display: \"flex\", justifyContent: \"center\", alignItems: \"center\", paddingTop: \"10px\" }}>\n <Button style={{ marginRight: \"auto\" }} onClick={yes}>\n Yes\n </Button>\n <Button onClick={no}>No</Button>\n </div>\n </>\n );\n}\n\nfunction PromptMenuText({ resolve }: IContentProps): React.ReactElement {\n const [value, setValue] = useState(\"\");\n\n const submit = (): void => resolve(value);\n\n const onInput = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setValue(event.target.value);\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n event.stopPropagation();\n\n if (event.key === KEY.ENTER) {\n event.preventDefault();\n submit();\n }\n };\n\n return (\n <>\n <div style={{ display: \"flex\", alignItems: \"center\", paddingTop: \"10px\" }}>\n <TextField\n autoFocus\n value={value}\n onInput={onInput}\n onKeyDown={onKeyDown}\n style={{ flex: \"1 0 auto\" }}\n InputProps={{\n endAdornment: <Button onClick={submit}>Confirm</Button>,\n }}\n />\n </div>\n </>\n );\n}\n\nfunction PromptMenuSelect({ prompt, resolve }: IContentProps): React.ReactElement {\n const [value, setValue] = useState(\"\");\n\n const submit = (): void => resolve(value);\n\n const onChange = (event: SelectChangeEvent<string>): void => {\n setValue(event.target.value);\n };\n\n const getItems = (choices: string[]): React.ReactElement[] => {\n const content = [];\n for (const i of choices) {\n // @ts-ignore\n content.push(\n <MenuItem key={i} value={i}>\n {i}\n </MenuItem>,\n );\n }\n return content;\n };\n\n return (\n <>\n <div style={{ display: \"flex\", alignItems: \"center\", paddingTop: \"10px\" }}>\n <Select onChange={onChange} value={value} style={{ flex: \"1 0 auto\" }}>\n {getItems(prompt?.options?.choices || [])}\n </Select>\n <Button onClick={submit} disabled={value === \"\"}>\n Confirm\n </Button>\n </div>\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 // Determines the maximum amount of this product that can be sold in one market cycle\n maxsll = 0;\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 { 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\", \"AI Cores\", \"Real Estate\"];\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, { useState, useEffect } from \"react\";\nimport { find } from \"lodash\";\n\nimport { Box, Typography, Button, Container, Paper } from \"@mui/material\";\nimport { Check, Lock, Create } from \"@mui/icons-material\";\n\nimport { use } from \"../../ui/Context\";\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { Programs } from \"../Programs\";\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 = [...Object.values(Programs)]\n .filter((prog) => {\n const create = prog.create;\n if (create === null) return false;\n if (prog.name === \"b1t_flum3.exe\") {\n return create.req(player);\n }\n return true;\n })\n .sort((a, b) => {\n if (player.hasProgram(a.name)) return 1;\n if (player.hasProgram(b.name)) return -1;\n return (a.create?.level ?? 0) - (b.create?.level ?? 0);\n });\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 const getHackingLevelRemaining = (lvl: number): number => {\n return Math.ceil(Math.max(lvl - (player.hacking + player.intelligence / 2), 0));\n };\n\n const getProgCompletion = (name: string): number => {\n const programFile = find(player.getHomeComputer().programs, (p) => {\n return p.startsWith(name) && p.endsWith(\"%-INC\");\n });\n if (!programFile) return -1;\n\n const res = programFile.split(\"-\");\n if (res.length != 3) return -1;\n const percComplete = Number(res[1].slice(0, -1));\n if (isNaN(percComplete) || percComplete < 0 || percComplete >= 100) {\n return -1;\n }\n return percComplete;\n };\n\n return (\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0, mb: 10 }}>\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\", gridTemplateColumns: \"repeat(3, 1fr)\", my: 1 }}>\n {programs.map((program) => {\n const create = program.create;\n if (create === null) return <></>;\n const curCompletion = getProgCompletion(program.name);\n\n return (\n <Box\n component={Paper}\n sx={{ p: 1, opacity: player.hasProgram(program.name) ? 0.75 : 1 }}\n key={program.name}\n >\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n {(player.hasProgram(program.name) && <Check sx={{ mr: 1 }} />) ||\n (create.req(player) && <Create sx={{ mr: 1 }} />) || <Lock sx={{ mr: 1 }} />}\n {program.name}\n </Typography>\n {!player.hasProgram(program.name) && create.req(player) && (\n <Button\n sx={{ my: 1, width: \"100%\" }}\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 Create program\n </Button>\n )}\n {player.hasProgram(program.name) || getHackingLevelRemaining(create.level) === 0 || (\n <Typography color={Settings.theme.hack}>\n <b>Unlocks in:</b> {getHackingLevelRemaining(create.level)} hacking levels\n </Typography>\n )}\n {curCompletion !== -1 && (\n <Typography color={Settings.theme.infolight}>\n <b>Current completion:</b> {curCompletion}%\n </Typography>\n )}\n <Typography>{create.tooltip}</Typography>\n </Box>\n );\n })}\n </Box>\n </Container>\n );\n}\n","import { Explore, Info, LastPage, LocalPolice, NewReleases, Report, SportsMma } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography, useTheme } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { IRouter } from \"../../ui/Router\";\nimport { FactionNames } from \"../data/FactionNames\";\nimport { Faction } from \"../Faction\";\nimport { getFactionAugmentationsFiltered, joinFaction } from \"../FactionHelpers\";\nimport { Factions } from \"../Factions\";\n\nexport const InvitationsSeen: string[] = [];\n\nconst getAugsLeft = (faction: Faction, player: IPlayer): number => {\n const augs = getFactionAugmentationsFiltered(player, faction);\n\n return augs.filter((augmentation: string) => !player.hasAugmentation(augmentation)).length;\n};\n\ninterface IWorkTypeProps {\n faction: Faction;\n}\n\nconst fontSize = \"small\";\nconst marginRight = 0.5;\n\nconst WorkTypesOffered = (props: IWorkTypeProps): React.ReactElement => {\n const info = props.faction.getInfo();\n\n return (\n <>\n {info.offerFieldWork && (\n <Tooltip title=\"This Faction offers field work\">\n <Explore sx={{ color: Settings.theme.info, mr: marginRight }} fontSize={fontSize} />\n </Tooltip>\n )}\n {info.offerHackingWork && (\n <Tooltip title=\"This Faction offers hacking work\">\n <LastPage sx={{ color: Settings.theme.hack, mr: marginRight }} fontSize={fontSize} />\n </Tooltip>\n )}\n {info.offerSecurityWork && (\n <Tooltip title=\"This Faction offers security work\">\n <LocalPolice sx={{ color: Settings.theme.combat, mr: marginRight }} fontSize={fontSize} />\n </Tooltip>\n )}\n </>\n );\n};\n\ninterface IFactionProps {\n player: IPlayer;\n router: IRouter;\n faction: Faction;\n\n joined: boolean;\n\n rerender: () => void;\n}\n\nconst FactionElement = (props: IFactionProps): React.ReactElement => {\n const facInfo = props.faction.getInfo();\n\n function openFaction(faction: Faction): void {\n props.router.toFaction(faction);\n }\n\n function openFactionAugPage(faction: Faction): void {\n props.router.toFaction(faction, true);\n }\n\n function acceptInvitation(event: React.MouseEvent<HTMLButtonElement, MouseEvent>, faction: string): void {\n if (!event.isTrusted) return;\n joinFaction(Factions[faction]);\n props.rerender();\n }\n\n return (\n <Paper\n sx={{\n display: \"grid\",\n p: 1,\n alignItems: \"center\",\n gridTemplateColumns: \"minmax(0, 4fr)\" + (props.joined ? \" 1fr\" : \"\"),\n }}\n >\n <Box display=\"flex\" sx={{ alignItems: \"center\" }}>\n {props.joined ? (\n <Box\n display=\"grid\"\n sx={{\n mr: 1,\n gridTemplateColumns: \"1fr 1fr\",\n minWidth: \"fit-content\",\n gap: 0.5,\n \"& .MuiButton-root\": { height: \"48px\" },\n }}\n >\n <Button onClick={() => openFaction(props.faction)}>Details</Button>\n <Button onClick={() => openFactionAugPage(props.faction)}>Augments</Button>\n </Box>\n ) : (\n <Button sx={{ height: \"48px\", mr: 1 }} onClick={(e) => acceptInvitation(e, props.faction.name)}>\n Join!\n </Button>\n )}\n\n <span style={{ maxWidth: props.joined ? \"70%\" : \"95%\" }}>\n <Typography\n variant=\"h6\"\n sx={{\n mr: 1,\n display: \"grid\",\n gridTemplateColumns: \"fit-content(100vw) max-content\",\n alignItems: \"center\",\n }}\n >\n <span\n style={{ overflow: \"hidden\", whiteSpace: \"nowrap\", textOverflow: \"ellipsis\" }}\n title={props.faction.name}\n >\n {props.faction.name}\n </span>\n\n <span style={{ display: \"flex\", alignItems: \"center\" }}>\n {props.player.hasGangWith(props.faction.name) && (\n <Tooltip title=\"You have a gang with this Faction\">\n <SportsMma sx={{ color: Settings.theme.hp, ml: 1 }} />\n </Tooltip>\n )}\n\n {facInfo.special && (\n <Tooltip title=\"This is a special Faction\">\n <NewReleases sx={{ ml: 1, color: Settings.theme.money, transform: \"rotate(180deg)\" }} />\n </Tooltip>\n )}\n\n {!props.joined && facInfo.enemies.length > 0 && (\n <Tooltip\n title={\n <Typography>\n This Faction is enemies with:\n <ul>\n {facInfo.enemies.map((enemy) => (\n <li key={enemy}>{enemy}</li>\n ))}\n </ul>\n Joining this Faction will prevent you from joining its enemies\n </Typography>\n }\n >\n <Report sx={{ ml: 1, color: Settings.theme.error }} />\n </Tooltip>\n )}\n </span>\n </Typography>\n\n <span style={{ display: \"flex\", alignItems: \"center\" }}>\n {!props.player.hasGangWith(props.faction.name) && <WorkTypesOffered faction={props.faction} />}\n\n {props.joined && (\n <Typography variant=\"body2\" sx={{ display: \"flex\" }}>\n {getAugsLeft(props.faction, props.player)} Augmentations left\n </Typography>\n )}\n </span>\n </span>\n </Box>\n\n {props.joined && (\n <Box display=\"grid\" sx={{ alignItems: \"center\", justifyItems: \"left\", gridAutoFlow: \"row\" }}>\n <Typography sx={{ color: Settings.theme.rep }}>\n {numeralWrapper.formatFavor(props.faction.favor)} favor\n </Typography>\n <Typography sx={{ color: Settings.theme.rep }}>\n {numeralWrapper.formatReputation(props.faction.playerReputation)} rep\n </Typography>\n </Box>\n )}\n </Paper>\n );\n};\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n}\n\nexport function FactionsRoot(props: IProps): React.ReactElement {\n const theme = useTheme();\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 const allFactions = Object.values(FactionNames).map((faction) => faction as string);\n const allJoinedFactions = [...props.player.factions];\n allJoinedFactions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b));\n const invitations = props.player.factionInvitations;\n\n return (\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0, mb: 10 }}>\n <Typography variant=\"h4\">\n Factions\n <Tooltip\n title={\n <Typography>\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\n cause is crucial to progressing in the game and unlocking endgame content.\n </Typography>\n }\n >\n <Info sx={{ ml: 1, mb: 0 }} color=\"info\" />\n </Tooltip>\n </Typography>\n\n <Box\n display=\"grid\"\n sx={{\n gap: 1,\n gridTemplateColumns: (invitations.length > 0 ? \"1fr \" : \"\") + \"2fr\",\n [theme.breakpoints.down(\"lg\")]: { gridTemplateColumns: \"1fr\", \"& > span:nth-child(1)\": { order: 1 } },\n gridTemplateRows: \"minmax(0, 1fr)\",\n \"& > span > .MuiBox-root\": {\n display: \"grid\",\n gridAutoRows: \"70px\",\n gap: 1,\n },\n }}\n >\n {invitations.length > 0 && (\n <span>\n <Typography variant=\"h5\" color=\"primary\">\n Faction Invitations\n </Typography>\n <Box>\n {invitations.map((facName) => {\n if (!Factions.hasOwnProperty(facName)) return null;\n return (\n <FactionElement\n key={facName}\n faction={Factions[facName]}\n player={props.player}\n router={props.router}\n joined={false}\n rerender={rerender}\n />\n );\n })}\n </Box>\n </span>\n )}\n\n <span>\n <Typography variant=\"h5\" color=\"primary\">\n Your Factions\n </Typography>\n <Box>\n {allJoinedFactions.length > 0 ? (\n allJoinedFactions.map((facName) => {\n if (!Factions.hasOwnProperty(facName)) return null;\n return (\n <FactionElement\n key={facName}\n faction={Factions[facName]}\n player={props.player}\n router={props.router}\n joined={true}\n rerender={rerender}\n />\n );\n })\n ) : (\n <Typography>You have not yet joined any Factions.</Typography>\n )}\n </Box>\n </span>\n </Box>\n </Container>\n );\n}\n","import LinearProgress from \"@mui/material/LinearProgress\";\nimport { Theme } from \"@mui/material/styles\";\nimport withStyles from \"@mui/styles/withStyles\";\n\nexport const ProgressBar = 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","/**\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 { SourceFiles } from \"./SourceFile/SourceFiles\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { IRouter } from \"./ui/Router\";\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 if (Player.sourceFileLvl(5) === 0 && newBitNode !== 5) {\n Player.intelligence = 0;\n Player.intelligence_exp = 0;\n }\n if (newBitNode === 5 && Player.intelligence === 0) {\n Player.intelligence = 1;\n }\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","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 and\n 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\">\n File an issue on github\n </Link>\n </Typography>\n <Typography>\n <Link href=\"https://www.reddit.com/r/Bitburner/\" target=\"_blank\">\n Make a reddit post\n </Link>\n </Typography>\n <Typography>\n <Link href=\"https://discord.gg/TFc3hKD\" target=\"_blank\">\n Post in the #bug-report channel on Discord.\n </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 />}>\n Disable Recovery Mode\n </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\">{errorData.title}</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 />\n </Box>\n <Tooltip title=\"Submitting an issue to GitHub really help us improve the game!\">\n <Button\n component={Link}\n startIcon={<GitHubIcon />}\n color=\"info\"\n sx={{ px: 2 }}\n href={errorData.issueUrl ?? newIssueUrl}\n target={\"_blank\"}\n >\n Submit Issue to GitHub\n </Button>\n </Tooltip>\n </Paper>\n )}\n </Box>\n );\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 * 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.\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 * hostname 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 /**\n * Once this counter reaches it's limit the script crashes. It is reset when a promise completes.\n */\n infiniteLoopSafetyCounter = 0;\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 { 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 avgProfit = 0;\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 this.avgProfit =\n (this.avgProfit * (CorporationConstants.AvgProfitLength - 1) + profit) / CorporationConstants.AvgProfitLength;\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.avgProfit;\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.index,\n price = upgrade.price;\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.index,\n basePrice = upgrade.basePrice,\n priceMult = upgrade.priceMult,\n upgradeAmt = upgrade.benefit; //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 { 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","/**\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 { Slider, Tooltip, Typography, Box } from \"@mui/material\";\nimport React, { useState } from \"react\";\n\ninterface IProps {\n initialValue: any;\n callback: (event: any, newValue: number | number[]) => void;\n step: number;\n min: number;\n max: number;\n tooltip: React.ReactElement;\n label: string;\n marks?: boolean;\n}\n\nexport const OptionsSlider = (props: IProps): React.ReactElement => {\n const [value, setValue] = useState(props.initialValue);\n\n const onChange = (_evt: Event, newValue: number | Array<number>): void => {\n setValue(newValue);\n };\n\n return (\n <Box>\n <Tooltip title={<Typography>{props.tooltip}</Typography>}>\n <Typography>{props.label}</Typography>\n </Tooltip>\n <Slider\n value={value}\n onChange={onChange}\n onChangeCommitted={props.callback}\n step={props.step}\n min={props.min}\n max={props.max}\n valueLabelDisplay=\"auto\"\n sx={{\n \"& .MuiSlider-thumb\": {\n height: \"12px\",\n width: \"12px\",\n },\n }}\n marks={props.marks}\n />\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 this.getHomeComputer().serversOnNetwork.includes(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 { FactionNames } from \"./Faction/data/FactionNames\";\nimport { CityName } from \"./Locations/data/CityNames\";\nimport { StaticAugmentations } from \"./Augmentation/StaticAugmentations\";\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 { 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 { 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) && Player.hasAugmentation(AugmentationNames.Neurolink)) {\n homeComp.programs.push(Programs.FTPCrackProgram.name);\n homeComp.programs.push(Programs.RelaySMTPProgram.name);\n }\n if (augmentationExists(AugmentationNames.CashRoot) && Player.hasAugmentation(AugmentationNames.CashRoot)) {\n Player.setMoney(1e6);\n homeComp.programs.push(Programs.BruteSSHProgram.name);\n }\n if (augmentationExists(AugmentationNames.PCMatrix) && Player.hasAugmentation(AugmentationNames.PCMatrix)) {\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 // Apply entropy from grafting\n Player.applyEntropy(Player.entropy);\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 || Player.sourceFileLvl(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) && Player.hasAugmentation(AugmentationNames.TheRedPill)) {\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) && Player.hasAugmentation(AugmentationNames.StaneksGift1)) {\n joinFaction(Factions[FactionNames.ChurchOfTheMachineGod]);\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\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 (Player.sourceFileLvl(9) >= 2) {\n homeComp.setMaxRam(128);\n } else if (Player.sourceFileLvl(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(StaticAugmentations)) {\n if (StaticAugmentations.hasOwnProperty(name)) {\n delete StaticAugmentations[name];\n }\n }\n\n // Give levels of NeuroFluxGoverner for Source-File 12. Must be done here before Augmentations are recalculated\n if (Player.sourceFileLvl(12) > 0) {\n Player.augmentations.push({\n name: AugmentationNames.NeuroFluxGovernor,\n level: Player.sourceFileLvl(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 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 || Player.sourceFileLvl(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 ${CityName.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 (Player.sourceFileLvl(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 (Player.sourceFileLvl(5) !== 0 && !flume) Player.gainIntelligenceExp(300);\n\n resetPidCounter();\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\";\nimport { IPerson } from \"../PersonObjects/IPerson\";\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(`Invalid decays when constructing Action ${this.name}. Decay value cannot be greater than 1`);\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, person: IPerson): boolean {\n return Math.random() < this.getSuccessChance(inst, person);\n }\n\n // To be implemented by subtypes\n getActionTimePenalty(): number {\n return 1;\n }\n\n getActionTime(inst: IBladeburner, person: IPerson): number {\n const difficulty = this.getDifficulty();\n let baseTime = difficulty / BladeburnerConstants.DifficultyToTimeFactor;\n const skillFac = inst.skillMultipliers.actionTime; // Always < 1\n\n const effAgility = person.agility * inst.skillMultipliers.effAgi;\n const effDexterity = person.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, person: IPerson): [number, number] {\n function clamp(x: number): number {\n return Math.max(0, Math.min(x, 1));\n }\n const est = this.getSuccessChance(inst, person, { est: true });\n const real = this.getSuccessChance(inst, person);\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, person: IPerson, 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 = person.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 { RunningScript } from \"src/Script/RunningScript\";\nimport { Settings } from \"../Settings/Settings\";\nimport { WorkerScript } from \"./WorkerScript\";\n\nexport const recentScripts: RecentScript[] = [];\n\nexport function AddRecentScript(workerScript: WorkerScript): void {\n if (recentScripts.find((r) => r.runningScript.pid === workerScript.pid)) return;\n\n const killedTime = new Date();\n recentScripts.unshift({\n timeOfDeath: killedTime,\n runningScript: workerScript.scriptRef,\n });\n\n while (recentScripts.length > Settings.MaxRecentScriptsCapacity) {\n recentScripts.pop();\n }\n}\n\nexport interface RecentScript {\n timeOfDeath: Date;\n runningScript: RunningScript;\n}\n","import React, { useEffect, useState } from \"react\";\nimport { EventEmitter } from \"../utils/EventEmitter\";\nimport { Modal } from \"./React/Modal\";\n\nconst frames = [\n \"ttftfffttttttttttfffffffttftt1ttttttt111tttt1111111tttt1tt111tttt111111tttt1ttttttttttttttt111111111\\nttfttttttttttttttttfLLLftfffffffffftttt111tt11111ttffffftttt1111111111111111ttttttfttttttttt111111t1\\nttttttttttttttttffffLfftffffffffLLffttttttftt111ttfffffftttttttt111111ttttttffffttfffttttttt111111tt\\nttttttttttttttttfffLfttffffffLLffffttttttttttt1tfffffffffftttttt111111tffffffffftttfffftttt11111ttt1\\nttttttttttttffLfttfffttfffffffffttfftttttt1t1tt11tfffffftttttt111t111111ttffffLLffttfffftt111111tttt\\nttttttttttffLLLLfttttffLLLfttttftfLftttttttffffttttffffttttfftt11t111tt111ttfffLffttfftttttt1111tttt\\nttttttttffLLLLLLLffttfLLffttfffftfLfttttttffttt11111ttttffffffftt1111tft11111ttffffttt11tfftt11ttttt\\ntttttttfffLLLLLLLLfftffttttffLffftfftttttft1i;;::::;iitffffffffftt111tft1tttt1ttffLfttttfffffttttttt\\ntttttttfffLLLLLLLLfttttffftffffftfttttttff1:,,,,,,,,::itfffffffft11111111ttttttttttt1tfffffffffffttt\\ntttffttffLLLLLLLLLfttfftffffffffLLLftttttt;::,:::;;;;::1tfffftfft11111ttt1ttt1tfttt11ttffffffffLfttt\\ntffffffffLLLLLLLffftfLfffttfLLffLLLfttttti;;;iii11111;:i11ttffft111111tfft11t11tt1tttttfffLLLLLLfttf\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttfti:;;;iiiiiiii;it111tt111t1111tffttfftt11ttftttfffLLLLLLffff\\nttttfttttffffftttttttttttttfLLLffLLfttttt1;;;;;;iiiiii;1tft11tt1111111tfftfffftttttttttttfLLfffttfff\\ntfffffffffftttfffffffffttffttLLfffLfttttt11i;;;;iiiiiii1tt11tfftt11111ttt1fffttt1tttttttttfffftttttt\\nttffffffffftttfffffffffttffftffttftttttff1ii;;;;iii1iii111tt1ttttt1111t111ffttffttfffffLffttttffffff\\nttffffffffttttffffffffttttttttttffftttttft1ii;;;ii1iii111tfft11ttt111111t1tt1tfft1ttffffLLftttLLLLLL\\ntttffffffffttfffffffftttttttt11fffftttt1t111iiii;iiiii11ttffft11111111ttttttt1tt11ttffffLfftttfLLLLf\\ntttttttffffttfffttttttttffttt11tffttttttt11ttii;;;iiii11i1ffftt1111111tttt111tttt11ttttffffftffLLLff\\ntfttttttttttttttttttttfffftttt11tfftttttt111t1i;;;iiii1i,,:;i1111t1111ttt111t1tfftt11111ttfftffffftt\\nttttfffftttttttfffftttffffttffttttft111tt11111i;;;iiii1;,,....,:::;i11tt111tt11tffftttttttt1tttttttt\\nt11ttffffftttffffffttttfffttffttttft1111111111;;;;;;;it;,...........,:it111ttt1tffftttttfft11ttfffff\\ntt1ttfffftt1ttfffft111tffttfttttttt1111t1i;:;11i1i;;1t1:,,............,itt11tt1tfftt1tfffffft1tffLLf\\ntfttttfttttt11tttt1ttt11ttttttftt111111i:,..:1111iii11;,...............;tt111t11ttttttttffttt11ffLLf\\ntfftttttttfftttttttffftt111ttffftt11i;,.,...,iiii;;;;:,,...............:1ttt1111ttfffttttft1tt1ttfft\\nttttttttttttttt11ttttttttttfffffft1:,..........::::::,,,...............,1ttttt11ttfffffttttffftttttt\\ntfffttttffffftt11ttttttttttfffffft1:...........:;::;:..................,1tttttt1ttfffffttttttttftttf\\ntfffttttfffffft1ttftttfftttttffft11:...........,:::::..................,1tttft11tfffffffttfffffffttf\\ntfffttttffffff11tttttttttttttttttt1;...........,::::,...................;t1t1111tfffffLfttfffffffttf\\ntfffttttfftttt11tttttttt1tfftttttt1:...........,::::,...... ............,1111tt11fffffLftttffttffttf\\ntttttttttttttt11tttttttt1tffftttft1:...........,:::,,....................it1ttt11tfffffftttffttffttt\\nttttt1tttttttt11ttttttttttffttttttt:...........,::,,.....................:111tt11tttttttt1tttttttttt\\nttttt1tttttttt11tftttttftttttttttt1;,:;:.......,:,,,....................,,1111t11ttttttt11ttttttfttt\\n1tttt1ttfffttt11ttffffffttttfffft11ii1i:.......,:,,,.....................,1tt1111ttttttt111tttttfttt\\n1ttt11tttttttt11tttttttttttttttttti;;;;:.......,:,,,....... .............,itt1111tttt11t111ttttttt1t\\n111111tttttttt11111111ttttttttttt1i;;;;:.......,:,,,......................itt11111111111111111111111\\n1111111111111111111111ttttttttttt1;;;;;:...... ,:,,,,.....................itt11t11111111111111111111\\n1111111111111111111111tttttttttt1;:,::;,...... ,:...,.....................ittttt11111111111111111111\\n111111111111111111111111tttttttt1i,..... .... .:........................,i1tttt11111111111111111111\\n1111111111111111111111111t11t11111;,....,,.... ,:::,,,...................,11ttttt11t1111111t11111111\\n11111111111111111111111111111111111iiiiii. ... .::::::,..................,11t1ttt111t11111tttttt1111\\n1111111111111111111111111111111111111111:.,.....::::::,..................:111tttttt1tttt11tttttt1111\\n1111111111111111111111111111111111111111:::,...,::::;::,..,,.............:11tt1ttttttttttttttttt1111\\n\",\n \"ttftfffttttttttttffffffftfftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttftfLLLftfffffffffftt11111tt11111ttffffttttt1111111111111111ttttttfttttttttt111111tt\\nttftttttttttttttffffLftttfffffffLLLfttttttftt111ttfffffftttttttt111111tttttffffftfffftttttt1111111tt\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1tffffffffffttttttt11111tffffffffftttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttfftttttt1tttt1ttftfffftt1ttt111t111111ttffffLLffttfffft1111111tttt\\nttttttttttffLLLLfttttffLLLfttttttfLftttttttfft11i;;:;;i11ttfftt11t111tt111tttffffftttttttttt111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLttttttfff1;,,,,,,,,:;tffffft11111tft11111ttffffttt11tffftt1ttttt\\ntttttttfffLLLLLLLLfftffttttffLffftfftttttfft1;:,,,,,::::,;tffftttt111tft1tttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffffftfftttttfffti:;;;iiii11i;:tffffft11111111ttftttttttt1ttffffffffffttt\\ntttffttffLLLLLLLLLftffftfLftfftfLLLftttttfft::i;iiiiii11i:1ffftft11111ttt1ttt1ttttt11ttfffffLLfLfttt\\nttfLfffffLLLLLLLLfftfLLfffffLfffLLLfttttt1tt;:;;;;;iiiiiii1tffft11111tffft11t11tt1tttttfffLLLLLLffff\\ntffftfttttfLLLffttttfffffttLLLLfLLLftttft111i;;;;;;iiiiii111tt111t1111tffttfftt11tfft1tfffLLLLLLLffL\\ntttfftttttffLftttttttttttttfLfLffLLfttttttt1iii;;;;;ii11i1t11t11111111tffttfffttttttt11ttfLLLLffftff\\nttfLffffffftttfffffffffttfftfLLfffLftttttfft1ii;;;;iii1i1tt1tfftt11111ttt1tffttt1ttt1tttttffffttffft\\nttffffffffftttffffffffttfffftffffftttttfffft111;;;;iiii1111t1ttttt1111tt11ffttfftttfffffLfttttfffffL\\nttffffffffttttffffffffttttttttttffftttttttt11ttii;iiiiii11tft11ttt111111t11t1tfft1tfffffLLftttLLLLLL\\n1ttffffffffttfffffffftttttttt11ffffttttt1111tftiii;;iiii1;,;1111111111tttt11111111ttffffLfftttffLLLf\\nttttttttfffttfffttttttttffttt11tffftttttt11ttf1;;;i;iiii1:,,.,,::;ii11tttt111tttt11ttffffffftffLLLff\\ntfttttttttttttttttttttfffftttt11tfftttttt111tt1;;;i;;ii1t:,,........,:;1t111t1tfftt11111ttfftffffftt\\ntftttffffttttttfftftttffffttffttttftt11tt111i;;;;;;;;;it1,,............,;11tt11tffffttttttt1tttttttt\\ntttttffffftttfffffft1ttffftfffttttft111111;:,.;iii;;;i11,.,.............,1tttt1tffftttttfft111tfffff\\n1tttffffftt1ttfffftt11tffttfttttttt1111i;,....,1iii;ii;,................,111tt1tfft11tffffftt1tLffLf\\ntftttfftt1ttt1tttt1tttt1ttttttttt1111;:,.......i1;;;:::.................,it11t11ttttttttffftt11fffLf\\ntfftttttttfftt1111ttfftt11ttfffftt1ti..........:i;::;:,..................ittt111t1tffttttft1tt1tffft\\nttttttttttttttt11tttttttt1tffffffftti,.........,::::::,..................itttt11ttffffftttttfftttttt\\ntfffttttfffffft11ttttttttttffffffft1i,.........,:,:::,...................,1tttt11tfffffttttttttffttf\\ntfffttttfffffft11tftttfftttttffft1111:.........,:,:::,....................;tt111tfffffffttfffffffttf\\ntfffttttfffffft1tttttttftttttttttt111;.........,:,::,,....................,111111fffffLfttfffffffttf\\ntffftttttttffft11tttttttttffttttfft11i.........,:.:,,......................:1tt11fffffLftttffttffttf\\ntttttttttttttt111ttttttt1tffftttfft111:....... ,:.:,,.......................1tt11tfffffftttffftffttt\\nttttt1tttttttt11ttttttttttfttttttft111i,...... ,:,,,,......................,itt11ttttttt11ttttttfttt\\nttttt1tttttttt11tfttttfftttttffttt1111i,...... ,:.,,,......................:11111ttttttt11ttttttfttt\\n1tttt1ttftfttt11tfffffffttttfffft11111,....... ,,.,,....... ...............it1111ttttttt111tttttfttt\\n1tttt1tttttttt11ttttttttttttttttt1111;,....... ,,.,,......................:tt11111ttt11t111ttttttt1t\\n11t111tttttttt111t1111tttttttttt1iiii:,,...... ,,.........................;t111111111111111111111111\\n111111111tt11111111111ttttttttt1;;iiii:....... ,,............ ...........;tttt1111111111111111111111\\n1111111111111111111111ttttttttt1;;;iii;... ....,::::,....,:::,,.........;1ttttt111111111111111111111\\n111111111111111111111111tttttttt1i;;ii: .,....,:::::... .;;;;;:,.....,;1ttttttttt111111111111111111\\n1111111111111111111111111tt1111111i,,.,:;i: ...,:::::.....:;;;;;:.....,1ttttttttt11t1111111t11111111\\n11111111111111111111111111111111111:.:1tti,....,:::::.... ,;;;;;;,.....ittttttttt111t11111ttttt11111\\n1111111111111111111111111111111111111ttt;,,....,:::::,... .,;;;;:,.,,..:ttttttttttt1tttt11tttttt1111\\n11111111111111111111111111111111111111t1,,,....:;;::::,.....:;;;:......,1ttttttttttttttttttttttt1111\\n\",\n \"ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt1tt111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftfffffffffttt11111tt11111ttfffft1ttt1111111111111111tttttffttttttttt111111tt\\nttftttttttttttttffffLffttfffffffLLLfttttttfttt11tffffffftttttttt111111tttttffffftfffftttttt1111111tt\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1ttt1iiiii1tttttttt11111tffffffffftttfffffttt1111t1tt1\\nttttttttttttffffttffftffffffffffttffttttt11tttt1i::,,,,,,:;111111t111111ttffffLLffttfLfftt11111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfft1i;,,,,,,,,,:;ttt11t111tt111tttffffftttftttttt111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLtttttffffti;::;;;;;iii::1ftt11111tft11111ttffffttt11tffftt1ttttt\\ntttttttfffLLLLLLLLLftffttttffLffftffttttffffft;:;iiii11111i:iftttt111ttt1tttt11tffLfttttfffffttttttt\\ntttttttffLLLLLLLLLfttttffftffLLftfftttttffffft;:;;;;;iiiiii;1fftt11111111ttftttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttffffti;;;;;;;ii;iiitffft11111ttt1ttt1tfttt11ttfffffLLfLfttt\\nttfLfffffLLLLLLLLffffLLfffffLfffLLLLtttttttff1iii;;i;;iii111tfft111111ffft11t11tt1tttttfffLLLLLLffff\\ntffftftttffLLLffttttfffffttLLLLfLLLffttftt11t1iii;;;;;iiiii1tt111t1111tffttfftt11tfft1tfffLLLLLLLfff\\nttffftttttffLftttttttttttttfLLLffLLftttttttft111i;;;;iiii1111111111111tffttfffttttttt11ttfLLffffftff\\nttfLffffffftttfffffffffttfttfLLfffLftttttfffft11i;;;;iiii1t1ttttt11111ttt1tffttt11ttttttttfffftfttft\\nttffffffffftttffffffffttfffftffffftttttfffft11t1i;;;;;iii1ii1ttttt1111t111ffttfft1tfffffLfttttfffffL\\nttffffffffttttffffffffttttttttttffftttttttt11tft1i;;;;iii1i,:;i1ttt11111t11t1tfft1ttffffLLfttfLLLLLL\\ntttffffffffttfffffffftttttttt11ffffttttt1111tfti;ii;;iiii1;,,...,:;ii1tttt1111tt11ttffffffftttffLLLf\\nttttttttfffttfffttttttttffttt11tffftttttt11t1iii;;ii;;;i1t:,.........,:;1t111ttt111ttffffffftffLLLLf\\ntfttttttttttttttttttttfffftttt11tfftt11tt1i:,.:;;;i;;;itti,,............,;1111ttttt11111ttfftffffftt\\ntfttfffftttttttfffftttffffttffttttft1111i:....,;;;ii;i11;.,,.............:1tt1ttffffttttttt1ttttttft\\ntttttffffftttffftffttttffftfffttttft1i:,.......:;;;;;;;:,................:tttt1tffftttttfft11ttfffff\\n1t1tffffftt1ttfffftt11tffttftttttttt1,.........,ii;;;;;,.................:11tt1tfft11tfffffft1fLLfLf\\ntftttfftt1ttt1tftt1ttt11ttttttttt111i,.........,11;:;;:,.................,1t1t11ttttttttfftt111fffLf\\ntfftttttttffttt111ttfftt11ttffffftt11,.........,i;::::,..................,1tt11111ffft1ttt11tt1tffft\\nttttttttttttttt11tttttttt1tffffffft11;..........::::::,...................;tt1111tfffftttttffftttttt\\ntfffttttfffffft11ttttttttttffffffft11:..........:::::,..,;:,...............ittt1tttttffttttttttffttf\\ntfffttttfffffft11tftttffttttfffft1111:..........:::::,..;1i;:,..............1t11tfffffffttfffffffttf\\ntfffttttfffffft1tttttttftttttttttt111;..........::,:,...;ii;;;,.............:1111tffffLfttfffffffttf\\ntffftttttttfft11ttttttttttfftttttft11i,.........::,,,...;;;;;i:..............;111tffffLfttfffttffttf\\ntttttttttttttt111tttttttttffftttfft11i,.........::,,,...;;;;;i:..............:111tfffffftttffttffttt\\ntttttttttttttt11ttttttttttfftttttft111:.........:,,,....::;;;;:.............,1t11ttttttt11tttttffttt\\nttttt1tttttttt11tfttttfftttttfftttt111:.........:,,,......,::::..,.........,i1111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfffffffttttfffft1111i:,........:,,,..... .......,,...... .it1111ttttttt111tttttft1t\\n1tttt1tttttttt11ttttttttttttttttt1iiii;,........:........... ...........:itt11111ttt1t1111ttttttt1t\\n111111tttttttt111tt111tttttttttti;;;iii:... ....:,,...................:i1tttt11111111111111111111111\\n111111111tt11111111111tttttttttt1;;;;;;;. .,....::::..................:1tttttt1111111111111111111111\\n1111111111111111111111ttttttttttt1i;;::..:;1,...::::...................;ttttttt111111111111111111111\\n1111111111111111111111111tttttttt111i,.,it1;....::::,..................,1ttttttttt111111111111111111\\n1111111111111111111111111tttt11111111ii1t1i:...,::::,........,..........itttttttt11t1111111tt1t11111\\n11111111111111111111111111111111111111tt1;:....::::;:.......,...........:1ttttttt111t11111ttttt11111\\n111111111111111111111111111111111111111ti,,....:;:;::,..................,ittttttttt1tttt11tttttt1111\\n111111111111111111111111111111111111111t:,:.,.:;;;;:::,..................;111t1ttttttttttttttttt1111\\n\",\n \"ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt11t111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftfffffffffttttt1111t11111ttffffftttt1111111111111111tttttfftttttttt1111111tt\\nttftttttttttttttffffLffttffffffffLLfttttttfttt11ttt1iiii;i11tttt111111tttttffffftffffttttttt111111tt\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1tt1::,,,,,,:;1ttt111111tfftfffffftttfffffttt1111t1tt1\\nttttttttttttffffttffftffffffffffttfftttttt1ttt11i;:,,,,,,,,,:1111t1111111tffffLLffttfLfftt11111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1;:::;;;;;;;::it11t111tt111tttffffftttfttttt1111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLtttttfffffti:;;ii111111i:itt11111tft11111ttffffttt1ttffftt1ttttt\\ntttttttfffLLLLLLLLLftffftttffLffftffttttfffffft;:;;;;;iiiiii;ittt1111ttt1tttt11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLLftfftttttffffffti;;;;;;;ii;iiitttt11111111ttftttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttfffff1iii;;i;;i1i1i1tttt11111ttt1ttt1tfttt111tfffffLLfLfttt\\nttfLffffffLLLLLLLffffLLfffffLfffLLLftttttttfft1i;;;;;;;iiiiitfft111111ffft11t11tt1tttttffffLLLLLffft\\ntffftfttttfLLLffttttffffftfLLLLfLLLftttftt1111111i;;;;iiii111t111t1111tffttfftt11tfft1tffLLLLLLLLfff\\nttffftttttffLftttttttttttttfLLLffLLftttt1tttt11tti;;;iiiii111111111111tffttffftttttttt1ttfLLLfffffff\\nttfLffffffftttfffffffffttfttfLLfffLftttttffft1111i;;;;;ii111tfttt11111ttt1tffttt11ttttttttfLfftfttft\\nttffffffffftttfffffffffttffftffffftttttfffft11t11i;;;;iii1i:;1ttft11111111ffttfftttfffffLfttttfffffL\\nttffffffffttttffffffffttttttttttffftttttft111tttiii;;iiii1;,,,:;i1111111111t1tfft1ttffffLLftttfLLLLL\\ntttffffffffttffffffffttttttttttfffftttt1111i;:;iiii;;;i;11:,,.....,:;i1tft1111tt111tffffLfftttffLLLf\\nttttttttfffttfffttttttttfftt111tfffttt11i;,,..:i;;;i;ii1t1,,..........,:i1111ttt1111tffffffftffLLLLf\\ntfttttttttttttttttttttffffttttt1tffti;:,,.....,;;;iiii1ti,,,.............;1111ttttt11111ttfftffffftt\\ntttttffffttttttfffftttffffttffttttf1:.........,;:;;;;;;;,.,,,............:1tt1ttffff11ttttt1ttttttft\\ntttttffffftttffftfft1ttffftfffttttf1,..........,;;;;;;;:.:ii;;:,.........:tttt1tfffttttffft111tfffff\\n1tttffffftt1ttfffftt11tffttfttttt1t1,...........ii;;;::,,;i;;ii:.........:tttt1tfft11tfffffft1fLLfLf\\ntftttffttttt11tftt1tttt1ttttttttt11i,..........,1i;;::,.:i;;;;i:.........,1t1t11ttttttttfftt111fffLf\\ntfftttttttffttt11tttffttt1tttffft11i,..........,ii;:::,.,:;;iii:..........it111111tfft1ttt11tt1tffft\\nttttttttttttttt11tttttttt1tfffffftti,...........:::::,....:;;ii:..........:tt111ttfffftttttffftttttt\\ntfffttttfffffft11ttttttttttfffffft1i,...........:::::,.....,:;;:.... ......,1t111ttttffttttttttffttf\\ntfffttttfffffft11tftttffttttfffft111:...........:::::,........,..,..........,1111tffffffttfffffffttf\\ntfffttttfffffft1tttttttftttttttttt11:...........::,:,........ ...:;,.........:111tffffLfttfffttffttf\\ntffftttttttfft11ttttttttttffttttttti,...........:::,,.............,...........,i1tffffLfttfffttffttf\\ntttttttttttttt111tttttttttffftttfft;,:;:........:::,.............. ...........:11tfffffftttffttffttt\\ntttttttttttttt11ttttttttttfftttttftii1i;:.......:::,.......... ..............:t111tttttt11tttttffttt\\nttttt1tttttttt11tfttttfftttttffttt1ii;ii;,......::,,........................:1111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfffffffttttfffft11i;;ii;,......:,,,..........:........ .;t1111ttttttt111tttttft1t\\n1tttt1tttttttt11tttttttttttttttttt11;:;i:,,.....:,.................. .;i;;1tt1111tttt1t1111ttttttt1t\\n111111tttttttt111t111ttttttttttttt11i:,,:1;....,::....................:1ttttt11111111111111111111111\\n111111111tt1111111111tttttttttttttt11i;;1t:....:::::...................;tttttttt11111111111111111111\\n1111111111111111111111ttttttttttttt111ttt1,,,.,:::::,..................,1ttttttt11111111111111111111\\n111111111111111111111111tttttttttt1111111i,::.,;::;:,...................;ttttttttt111111111111111111\\n1111111111111111111111111ttttttt11111111t;.,,.,;;;;;,...................,1ttttttt11t1111111tttt11111\\n111111111111111111111111111111111111111t1:..,,:;;;;;:,...................;ttttttt111t11111ttttt11111\\n111111111111111111111111111111111111111ti,,,::;;;;;;;:,..................,1tttttttt1tttt11tttttt1111\\n111111111111111111111111111111111111111t;,,::,;;;ii;;::,..................it1tttttttttttttttttt11111\\n\",\n \"ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt111111tttt1111111ttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftfffffffffttttt111tt11111ttffffftttt1111111111111111tttttfftttttttt1111111tt\\nttftttttttttttttffffLffttfffffffLLLftttttttttt11ttt1iiii;i11tttt111111ttttttfffftffffttttttt111111t1\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1ttt;:,,,,,,,:itttt11111tfftfffffftttfffffttt1111t1ttt\\nttttttttttttffffttffftffffffffffttfftttttt1tttt11i:,,,,,,,,,:i111t1111111tffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1;::;;;;;;;;;,;t111111tt111tttffffftttftt1tt1111ttttt\\nttttttttffLLLLLLLffttfLLffttfffftfLLtttttffffff1,:iiii111111;:tt11111tft11111ttffffttt11tffft11ttttt\\ntttttttfffLLLLLLLLLftffftttffLffftffttttfffffffi:;;;;;iiiii1;;ttt1111ttt1tttt11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLLftfftttttfffffff1;;;;;;;ii;;ii1ttt11111111ttftttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLffffftfLftffffLLLftttttfffff1iiiiii;;iiii1itttt11111ttt1ttt11tttt11ttfffffLLfLfttt\\ntffLLffffLLLLLLLLffffLLftffLLLffLLLftttttttffftiii;;;;;ii1ii1tft111111ffft11t11tt1tttttffffLLLLLffft\\ntfffffttftfLLLffttttfffffttLLLLfLLLftttft111tt111i;;;;iiiii1tt111t1111tffttfftt11tfft1tffLLLLLLLLfff\\nttttfttfffffLftttttttttttttfLLLffLLftttt1tttt11tti;;;iiiii111t11111111tffttffftttttttt1ttfLLLfffffff\\nttffffffffftttfffffffffttfftfLLfffLftttttffft11t1i;;;;;iii11ttttt11111ttt1tffttt11ttttttttfLfftftttt\\nttffffffffftttfffffffffttffftffftftttttffft111t11i;;;;iii1ii11tttt1111tt11ffttfftttfffffLfttttffffff\\nttffffffffttttffffffffttttttttttffftttttttt11111iii;;iiii1;,:;1tttt11111t11t1tfft1ttffffLLftttfLLLLL\\ntttffffffffttffffffffttttttttt1tffftttt11i;:,:i;;i;;;;;i11,,..,,:;i111tttt1111tt11ttffffLfftttffLLLf\\nttttttttfffttfffttttttttffttt11ttff1ii;:,....,;::;i;;i11ti,,.......,:;ittt111ttt1111ttffffffttfLLLLf\\ntfttttttttttttttttttttfffftttt11tff;,,........;;;;iii1tti,,,,:;;::,....,i11111ttttt11111ttfftffffftt\\ntfttfffffttttttfffft1tffffttfft1ttt:..........:;;;;;;;i;...,;i;iii:.....,i1tt1ttffff11ttt1t1ttttttft\\nttttfffffftttfffffft11tffftffftttti,..........,:;;;;;;;,...,;;iiii,......;tttt1tffftttttftt111tfffff\\n1tttffffftt1ttfffftt111ffttft11tt1;,...........;i;;;;;:,.....:;iii,......;tttt1tfft11tffffftt1fLLfLf\\ntttttffttttt11tftt1tttt1tttt1tttti,............;1;::;;,......,;iii,......;t11t11ttttttttfftt111fffLf\\ntfftttttttffttt111ttfftt111ttfffti.............;i;::::,.......,;;;,......;ttt11111tfft1tttt1tt1tffft\\nttttttttttttttt11ttttttt11tffffffi,............,::;:::,..........,.......:ttt1111tfffftt1tttfftttttt\\ntfffttttfffffft11tttttttttttffffti,............,:::::,..............,....,ittt11ttttttft1ttttttffttf\\ntfffttttfffffft11tffttff11t1tfff1;...... ....,.,:::::,.....................;11111tffffffttfffffffttf\\ntfffttttfffffft1tttttttfttttttti:,......:iiii;,,:::,:.......................,;111tffffffttfffttffttf\\ntffftttttttfft11ttftttttttfftti,,::,.,:;1i;;;;.,::::,.........................,i1tffffLfttfffttffttf\\ntttttttttttttt111ttttttt1ttfft1:::,,,:,:;;;;i:.,:::,,..........................;1tfffffftttffttffttt\\nttttt1tttttttt11ttttttttttfttt1;,...,...:;;;:, ,:::,..........................;11ttttttt11ttttttfttt\\nttttt1tttttttt11tfttttfftttttfti,..,....,,,....,:::,.........................:111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfffffffttttffft1;::::,,.......,:,:,.................. .:1111ttttttt111tttttfttt\\n1tttt1tttttttt11ttttttttttttttttttt11111:......,:,,,..................,::,:1tt1111ttt1t1111ttttttt1t\\n111111tttttttt111t1111tttttttttttt111111:......,,.....................,1tttttt1111111111111111111111\\n1111111111t11111111111ttttttttttttt11111:......,:,,....................:1t1ttttt11111111111111111111\\n1111111111111111111111ttttttttttttt1111t:......,;;::....................:1ttttttt1111111111111111111\\n111111111111111111111111ttttttttt1111111:......,::::,...................,itttttt11111111111111111111\\n111111111111111111111111111tttt111111111:......,;;::,....................:1ttttttt1tt11111ttttt11111\\n1111111111111111111111111111111111111111:......:;;;::,...................,ittttttt11t11111ttttt11111\\n11111111111111111111111111111111111111t1:......:;i;;::,...................:11tttttt1tttt11ttttt11111\\n1111111111111111111111111111111111111111,......:;;;;;::,..................,1tttttttttttttttttttt1111\\n\",\n \"ttftfffttttttttttfffffLftfftttttttttt111tttt1111111tttt111111ttttt11111tttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftffffffffftttttt111111111ttfffftt1tt1111111111111111ttttttftttttttt1111111tt\\nttftttttttttttttffffLftttfffffffLLLft1tttttft111tfftttfttttttttt111111ttttttfffftffffttttttt11111tt1\\nttttttttttttttttfffLfttffffffLLffffttttttttttt1ttti;;;;::;i1tttt111111tffffffffftttfffffttt11111ttt1\\ntttttttttttfffffttffftffffffffffttfftttttt1ttt111i,,,,,,,,,;11111t1111111tffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1i::,,,,,,,,,:1t11t111tt1111ttffffftttftt1tt1111ttttt\\nttttttttffLLLLLLLffttfLLLfttfLfftfLLtttttfffffti:;;iiiiiiii::1tt11111tftt1111ttffffttt11tffft11ttttt\\ntttttttfffLLLLLLLLLftffftttffLffftfftttttffffft::;;iii1i111i:1ttt1111ttt1tttt11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftfftttttfffffft;;;;;;;iiiiii;tttt11111111ttftttttttt11tffffffffffttt\\ntttfftfffLLLLLLLLLfttfftfLfffffffLLftttttfffft1ii;;;;;iiiiiitfttt11111ttt1ttt11tttt11ttfffffLLfLfttt\\nttfLLfffffLLLLLLLfftfLLftfffLLffLLLftttttttfftiii;;i;;ii111itfft111111tfft11t11tt1tttttfffLLLLLLLfff\\ntfffffttftfLLLffttttffffftfLLLLfLLLftttft111tt1iii;;;;iiiii1tt111tt111tffttfftt11tfftttffLLLLLLLLfff\\nttttfttffttffftttttttttttttfLLLffLLftttt1tttt11t1i;;;iiii1111t11111111tffttffftttttttt1ttfLLLfffffff\\nttfLffffffftttfffffffffttftttfLfffLftttttfffft11i;;;;iiii111tfttt11111ttt1fffttt1ttt1tttttfLLffftttt\\nttffffffffftttfffffffffttfftttfttttttttffft11111i;;;;;iii1tt11tttt1111t111ffttffttfffffLLfttttfLffff\\nttffffffffttttffffffffttttttttttffftt11ttt1111t1i;;;iii1i1itt11ttt111111t11t1ttft1ttffffLLftttfLLLLL\\ntttffffffffttfffffffftttttt1111tffftttt11i;::i1iii;;;iii1i,:;i11t11111tttt1111tt11ttffffLfftttffLLLf\\nttttttttfffttfffttttttttffttt11ttft1ii;:,....;i;;;ii;;i1t:,...,:;i1111tttt111ttt1111tttffffftfLLLLLf\\ntfttttttttttttttttttttfffftttt11t1:,,........ii:;;iii1tt1,,,......,,;i1tt11111ttttt11111ttfftffffftt\\ntfttfffffttttttfffft1tffffttfft11;,..........:;::;ii11t1:,,,...,,:,...,it11tt11tffffttttttt1ttttffft\\nttttfffffftttfffffft11tfffttfttt1,....,,......,:;;;;;;i,.......:iii;;,.,1t1ttt1tffftttttfftt11tfffff\\n1tttffffftt1ttfffft1111tfttft11ti,.............;i;;;;;:........:iiiii:..it11tt1tfftt1tfffffft1fLffLf\\ntttttffttttt11tttt1tttt1tttt1tt;,..............i1;;;;;,........,;iii;,..it111t11ttttttttfftt111fffLf\\ntfftttttttfftt1111ttfft11111tft:...............;i;;;;:,.........:;ii:..,ittt111111tfftttttt1tt1tffft\\nttttttttttttttt11ttttttt11ttff1,...............,::::::......... ,;ii:...itttt111ttffffft1tttfttttttt\\ntfffttttffftttt11ttttttt111tft;,........... ..,:;:::,...........,:;:...;ttttt11ttfffffttttttttffttf\\ntfffttttfffffft11ttttttf11111;:,..... .....,:::::::::...............,...:1ttt1111fffffffttfffffffttf\\ntfffttttfffffft11ttttttt11ti,,...........,:;i;;;:::::..................,.:tt11111tffffffttfffffffttf\\ntffftttttttfff111ttttttt111,.,,,,...,,..,;;;;;i;:,::,....................,;i1t111tffffLfttfffftffttt\\ntttttttttttttt111ttttttt11t:.......,....,:;;;;;:::,:,.......................:1t11tfffffftttffttffttt\\nttttt11ttttttt11tttttttt11t1,............,,,...,::::.........................:111ttttttt11ttttttfttt\\nttttt1tttttttt11ttttttfft1t1:,............ .. ,:::,........................,i111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfftttfftttttt1;::,,::.........,:,,,........................i1111ttttttt111tttttfttt\\n1ttt11tttttttt11tttttttttttttttttt111i.........,::,,................. . .;t11111ttt1tt111ttttttt1t\\n11t111tttt1tt111111111tttttttttttt111i,........,:,,...................,..,itttt111111111111111111111\\n1111111111111111111111tttttttttttt111i,....... ,:....................i111ttttttt11111111111111111111\\n1111111111111111111111ttttttttttt1111i,....... ,:,::,................,i1t11tttttt1t11111111111111111\\n111111111111111111111111tttttttt11111i,........,::;:,..................;1ttttttt11111111111111111111\\n1111111111111111111111111tttt11111111i........ ,,:::,..................,1ttttttttttt1111111tt1t11111\\n1111111111111111111111111111111111111i,........,,:::,...................it111ttttt11t11111ttttt11111\\n111111111111111111111111111111111111t1,........,,,:::,..................,1t1ttttttt1tttt11ttttt11111\\n11111111111111111111111111111111111111,........,,,;;::,..................i111ttttttttttttttttttt1111\\n\",\n \"ttftffftttttttffffffffLfttftttttttttt111tttt1111111tttt111111tttt1111111ttttttttttttttttttt11111111t\\nttfttttttttttttttftfLLLftffftffffftttttt111111111ttfffftt1tt1111111111111111ttftttftttttttt1111111tt\\nttftttttttttttttffffLftttfffffffLLLft11tttfft111tfffffffttt1ttttt11111ttttttfffftffffttttttt11111tt1\\nttttttttttttttttfffffttffffffLLffffttt1ttttttt1tt111ii11tft1ttttt11111tfftfffffftttfffffttt11111ttt1\\nttttttttttttffffttfffttfffffffffttffftttt111ttt1:,,,,,,,:i1111111t111111ttffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLLfttttttftt1;:,,,,,,,,,;1tt111t1111t111tttffffftttftt1ttt111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLfttttffft1i;;;;;;;;;;::1tttt11111ttt11111ttffffttt11tffft11ttttt\\ntttttttfffLLLLLLLLLftffftttffLLfftfftttttffffi:;iii111111i:ittttt1111ttt1tttt11tfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftfftttttfffff;:;;;;iiiiiii:ittttt11111111ttttttttttt11tffffffffffttt\\ntttffftffLLLLLLLLLfttfftfLftfffffLLftttttffff1i;;;;;ii;iiiittttft11111ttt1ttt1ttttt11ttfffffLLfLfttt\\nttfLLfffffLLLLLLLfftfLLftfffLfffLLLftttttttf1i1i;i;;iiii1i1tffft111111tfft11t11tt1tttttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft1111iii;;;;ii1i1i11tt111t1111tffttfftt11tfftttfffLLLLLLLfff\\ntttffttfftffLftttttttttttttfLLLffLLfttttttttt11i;;;;iiii11t11111111111tffttfffttttttt11ttfLLLfffffff\\nttfLffffffftttfffffffffttftttfLfffLftttttffft11i;;;iiiii1t11ttttt11111ttt1fffttt1tttttttttfLLftftttt\\nttffffffffftttfffffffffttffttfffttttttttfft1111i;;;;iii1111111tttt1111tt11ffttffttfffffLffttftffffff\\nttffffffffttttffffffffttttttttttffftt11tttt11t1ii;;;iii11tfft11ttt111111t11tttfft1ttffffLLfttffLLLLL\\ntttffffffffttfffffffftt1ttt1111fffft1tt11iiii1iiii;iiii1i:1tft11111111tttt111ttt11ttffffLfftttffLLLf\\nttttttttfffttfffttttt1ttfft11111tft11i;:,..,;ti;;;i;iii1;,,,:;i1111111tttt111ttt1111tffffffftfLLLLLf\\ntfttttttttttttttttttttfffftttt11i;::,,......iti::;i;iitt:,,....,:;i111ttt111t1ttttt11111ttfftffffftt\\ntfttfffffttttttfffftttffffttft11:...........;ii::;i11tti,,,,.......,:itt111tt1ttffff11ttt111ttttttft\\nttttfffffftttffftfft11tfffttftt;,............,:;;;;;11;,..............;1111ttt1tffftttttfftt1ttfffLf\\n1t1tffffft11ttfffft1111tfttft11:.............,:ii;;;;;,...............:11t11tt1tfft11tfffffft1ffffLf\\ntttttfftt1tt11tttt1ttt11t1111t;,..............:i1;;;;:,...............,111111t11ftttttttfftt11tfffLf\\ntfftttttttfftt1111tttft11111t1,...............:ii;;;;,............,,,.,1tttt11111ttfftttttt1tt1tffft\\nttttttttttttttt11ttttttt11ttfi................:;::;::,...........,;i;;:1tttttt11ttffffftttttfftttttf\\ntfffttttftttttt11ttttttt11ttfi................,;;:::,............,;iiii1tttttft1ttffftfttttttttftttf\\ntfffttttfffffft11ttttttt11111;........ .......:;:::,............:iiiii11ttftt11tfffffffttfffffffttf\\ntfffttttftffff111ttttttt11ti:,....... ,:::;;:,.,;:::,............:;;ii:i11tt1111tfffffffttfffffffttf\\ntffftttttfffft111ttttttt11i,.........,iii;;;,..,:::,.............::;;,.it1111tt11tffffffttfffftffttf\\ntttttttttttttt111ttttttt11,.,,,,..,,,:;;;;;;,..,:::,.............,::;..:i111ttt11tfffffftttffttffttt\\nttttt1tttttttt111ttttttt11;,,,...... .:;;;;:...,:,,,.....................:111tt11ttttttt11tttttffttt\\nttttt1tttttttt11tttttttt111,..........,,,,.....,:,,.......................:111111ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfft11i:,.....,.... .....,::,......................,1t11111ttttttt111tttttft1t\\n1tttt1tttttttt11ttttttttttttt1ii;;;:...........,:,,.....................,it111111ttttttt111ttttttt1t\\n11t1111tttttt111111111tt1tttttttt11:...........,:,,.............. .;t11111111111111111111111111\\n1111111111111111111111ttttttttttt11,.......... ,,................,:,,,:i1tttt1t111111111111111111111\\n1111111111111111111111tttttttttt11i,...........,,,,..............:1t11ttttttttttt1111111111111111111\\n111111111111111111111111tttttt1111;........... ,,:;,..............:11ttttttttttttt111111111111111111\\n11111111111111111111111111tttt1111;........... ,,:;:...............:111tttttttttt11t1111111tttt11111\\n1111111111111111111111111111111111;....,,......,,,::................i1ttttttttttttt1t11111ttttt11111\\n1111111111111111111111111111111111;............:,,;:,...............;1tttttttttttttttttt11ttttt11111\\n1111111111111111111111111111111111:............,,:;;:...............,1t1tttttttttttttttttttttttt1111\\n\",\n \"ttftffftttttttfffffttfLfttftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttftffLLftffffffffttttttt111111111ttfffft1ttt1111111111111111ttttttftttttttt111111ttt\\nttftttttttttttttffffLftttfffffffLLLftt1tttttt111ttfffffftttttttt111111tttttffffftffffttttttt111tttt1\\nttttttttttttttttfffLfttffffffLLffffttt1tttttt11tffffffffffttttttt11111tffffffffftttfffffttt11111tttt\\nttttttttttttffffttfffttfffffffffttffftttt11111111i;i11ttt11tt1111t111111ttffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLLfttttttfti:::,,,,:;i1ttfttt11t111tt111tttffffftttftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLftttttft1;,,,,,,,,,,;tffffft11111tft11111ttffLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLfLftffttttfffti;:;;;;iii;::1fffffttt111ttt1tttt1ttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLfftfftttttfffi;;iiiii1111i:iffffftt11111111ttttttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttffi:;;;;iiiiiii:1ftttfftt1111ttt1ttt1ttttt111tffffffLfLfttt\\ntffLLfffffLLLLLLLfftfLLftftfLfffLLLLttttt1t1i;;;;;ii;iiii1ttffft111111tfft1tt11tt1tt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft11i1i;;;;i111iii111tt111t1111fffttfftt11tfftttfffLLLLLLLffL\\ntttffttfftffLftttttttttttttfLLLffLLftttt1tti1i;;;;ii1iii1tt11111111111tffttffftttttttttttfLLLLfffffL\\nttfLfffffffttffffffffffttftttfLfffLftttttfftt1;;;;iiii11ttt1ttftt11111tfttffftt111ttttttttfLLftftttt\\nttffffffffftttfffffffffttffttfftttttttttfft111i;;;iiii1t111t1ttttt1111tt11ffttffttfffffLLfttffffffff\\nttffffffffttttffffffffttttttttttfffttt1tft1111i;;;iiii111tfft11ttt111111t11tttfft1tfffffLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt1111tffft11t111111iiii;;iii111fffft11111111ttft111ttt11tfffffLfftttfLLLLf\\ntttttttttffttfffttttt1ttfft1t11ttfftttt1iiii1i;;;iii1i1i,;i1ttt1111111tttt111tttt111tffffffftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tff11i;:,,,:11i;;iii;it;....,:;i111111ttt111t1ttftt11111ttfftffffftt\\ntfttfffffttttttfffftttffffttfft1ii;:,,.....:11;:;;;;1tt;,,,.....,,;i11tt111tt1ttfffftttttt11ttttttft\\nttttfffffftttffftfft11tfffttft1;,..........:1ii;;ii1tti,,,..........,it1111ttt1tfffttttffftt1ttfffLf\\n1tttffffftt1ttfffft1111tfttft1i,............,:;ii;;i1i,..............:111111tt1tfft11tfffffft1ffffLf\\ntftttffttttt11tttt1ttt11t1111t;..............,;1i;;;;,...............,1111111t11ftttttttfftt11tfffLf\\ntfftttttttfftt1111ttttt11111tt:............. ,;ii;;;:,...............,i111tt11111tffftttttt1tttttfft\\nttttttttttttttt11ttttttt11ttft,...............;;;;;:,.................ittttttt11ttffffftttttfffttttt\\ntfffftttftttttt11ttttttt11ttf1,...............:;;;::,.......,,,.......;tttttfftttfffftfttttttttffttf\\ntfffttttfffffft11ttttttt1111t1,...............:;;;::........,;i;:,....;t1ttfttt1tfffffffttfffffffttf\\ntfffttttftffft111ttttttt11t111,...............,::::,........:iiiii:...;t11tt1111tffffLffttfffffffttf\\ntffft1tttfffft111ttttttt11ttt1,..... ..........::::,.......,;iiii;,...it11111tt1tfffLfLfttfffftffttf\\ntttttttttttttt111ttttttt11tt1:... .,..........,:::.........:;;i;,...,1t1t11tft11tfffffftttffttffttt\\nttttt1tttttttt111ttttttt1tt1:,...:;ii:.........,::,.........,:;;:.....,it1111tt11ttttttt11tttttffttt\\nttttt1tttttttt11ttttttttt1t;::,;iiii;,.........,:,,...........,,,......,;11111111ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfft1ti:,,;;;:;;,.........,:,,.......... ..........:tttt1111ttttttt111tttttfttt\\n11ttt1tttttttt11ttttttttttt1,.,::::;;:.........,:,,...............,....;ttttt1111ttttttt111ttttttt1t\\n11tt11tttt1tt111111111111ttti:,,,::;:..........,:,,............ ......;ttttt11111111111111111111t111\\n1111111111111111111111tttttttt1:,,,............,:,.............,. .,;11tttttt1111111111111111111111\\n1111111111111111111111tttttttttt1:.............,,............ .11ii1ttttttt1111111111111111111111111\\n111111111111111111111111tttttt111,.............,::,,...........ittttttttttttt11111111111111111111111\\n11111111111111111111111111111111;..............,;;;:,..........:11tttttttttttttt11111111111111t11111\\n11111111111111111111111111111111;..............,;;;:,...........:11tttttttttttttttt1111111ttttt11111\\n11111111111111111111111111111111:..............,;;;;:...........:1ttttttttttttttttttttttt1ttttt11111\\n11111111111111111111111111111111:..............,;i;::,..........,1tttttttttttttttttttttttttttttt1111\\n\",\n \"ttftffftttttttfffffttfffttftttttttttt111tttt1111111ttttt11111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttftffLLftffffffffttttttt111111111ttfffffttttt111111111111111ttffttftttttttt11111tttt\\ntfttttttttttttttffffLffttfffffffLLLft11tttttt111tfffffffttttttttt11111ttttfffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffLfttffffffLLffffttt1ttttttt1ttfffffffffttttttt1111ttfftffffLftttfffffttt11111tttt\\nttttttttttttffffttfffttffffffffftttfttttt111ttt1ttffffffttttt1111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttfLLLfftttttffLftttttttt11ii11fffft1ttfftt11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLfttttt1i:;:,,::;i1tttffffftt11111tft11111ttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttffLffftffttttfti:,,,,,,,,,:;tfffffttttt111tftttttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftffttttttti:::::;;;;;,,1ffttffttt11111111ttttttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLfftfftffftffffLLLfttttti;iiiii11111;:1ttfffffftt1111ttt1ttt1tftttt11tfffffLLfLfttt\\nttfLLffffLLLLLLLLfftfLLftttfffffLLLLttttt;;i;;iiiiii1;:i11tfffft111111ffft1tt11tt1tt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft1ii;;;ii;;iii;tt11ttt111t1111tffttfftt11tfftttffLLLLLLLLffL\\ntttffttfftffLftttttttttttttfLLLffLLftttt11ti;;;iiii1iii1ttt1ttt1111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttftttfLfffLfttttt11i;;;iii1iii1tttt1tfftt11111tfttffftt11tttttttttfLLffftttt\\nttffffffffftttfffffffffttfftttfftffttttfft11;;;iiiii11tt111ttttttt1111tt1tffttffttfffffLLfttftfLffff\\nttffffffffttttffffffffttttttttttfffttt1tft11i;iii11i11111tfft11ttt11111tt11tttfft1tffffLLLfttfLLLLLL\\nttfffffffffttfffffffftt1ttt111tfffftttt11111i;i;iiii111ttfffft11111111tttt11tttt11tffffLLfftttfLLLLf\\nttttttttfffttfffttttt1ttfftt111tfffttt111111;;i;;iii11i1ttffft11111111tttt111tttt11ttfffffLftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tffttt1t1ii1;;i;;iiii1;,::i11tt1tt1111ttt11tt1tfftt11111ttfftfLffftt\\ntfttfffffttttttfffft1tffffttfft11tft11i::,,1ii;:;ii;it:,,...,,:;i11111tt111tt1ttfffftttttt11tttttfft\\nttttfffffftttffftfft11tfffttfttttt1i:,....,it1i;;;;i1t;,,,,.......,;111t111ttt1tfffttttffftt11tffLLf\\n1tttffffftt1ttfffft111ttfttft11i;:,........i1tt1ii1tt1:,,...........:1111111tt1tfftt1tfffffft1ffffLf\\ntftttffttttt11tttt1ttt11t1111t;,...........,;;;11;;;;:..............,1t111111t1tftttttttfftt11tfffLf\\ntfftttttttfftt1111ttttt11111tt:..............:;ii;;:,................it111tt11111tffftttttt1tttttfft\\nttttttttttttttt11ttttttt11ttf1,..............,;;;;::,................it1tttttt1ttfffffftttttfffttttt\\ntfffttttffttttt11ttttttt11ttfi................;;;:::,,:;:,...........;tttttttftttffffffttttttttffttf\\ntfffttttfffffft11ttttttt1111ti................:;:::,.:;iii;,.........:111ttfftt1tfffffffttfffffffttf\\ntfffttttftffff111ttttttt11t11;................,;:::,.;iiiii:.........:tt11ttt111tfffLfLfttfffffffttf\\ntffft1tttfffft111ttttttt1tttt;................,::::,.:;;ii;,.........;ttt1111tt1tfffLLLfttfffftffttf\\ntttttttttttttt111tttt1tt11ttti.................:::,...,;;i;,.........itttt11ttt11ffffffftttfftfffttt\\ntttttttttttttt111ttttttt11tt1;.................:::,....,:;:,.........,1tt1111tt11ttttttt11tttttffttt\\nttttt1tttttttt11ttttttttt1t11:.................:::,.... ..............:1111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfft11ti;,................,::,.........,......... :ttttt1111ttttttt111tttttfttt\\n11tt11tttttttt11tttttttt1tt1iiii:..............::,,...................:1tttt111111tttttt111ttttttt1t\\n11t1111tttttt1111111111t111iiiiii:.............,:,,,.................:1ttttt11111111111111111111t111\\n11111111111111111111111t11i;;iiii;.............,:,,,........... .,;ttttttttt1111111111111111111111\\n1111111111111111111111tt1t1i;;ii;,.............,,........... :i;;i1tttttttt1111111111111111111111111\\n1111111111111111111111111ttti:,,...............,,,.......... :ttttttttttttttt1t111111111111111111111\\n11111111111111111111111111111;::...............:;;::,........,i11ttttttttttttttt1111111111111tt11111\\n111111111111111111111111111111t;...............:ii;;:,........;t1tttttttttttttttt1t1111111ttttt11111\\n1111111111111111111111111111111:...............:;i;:::........:tttttttttttttttttttt1ttttt1ttttt11111\\n1111111111111111111111111111111:............. ,;ii;;;:,..,,...:ttttttttttttttttttttttttttttttttt1111\\n\",\n \"ttfttfftttttttffffftfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttttffLLttffffffftttttt1t111111111tfffffftttt1111111111111111ttffttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt111ttttt\\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt11111tfffffffLftttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttffttttt1111tt1ttffffffttttt1111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffttttffffftttffftt11t111tt111ttfffLLftttftt1tt111tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLftttttt11i;;;;i1tftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttffLLfftffttttti:::,,,,::;i1tffffffffttt111tft1tttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftfftttt11;,,,,,,,:,,,;tffffffffttt1111t11ttttttttttt1ttffffffLfffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttt1i;;;;iiiii:,:1tttfffffftt1111ttt1ttt1tfttt111tfffffLLfLfttt\\nttfLfffffLLLLLLLLfftfLLftttfLfffLLLLttt1i1iiiii1111i::1111ttffft111111ffft1tt11tt1tt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt11;;;iiiiiii:;ttt111tt111tt111tffttfftt11tfftttffLLLLLLLLffL\\ntttffttffttfLftttttttttttttfLLLffLLftttt1i;;;iii;iii;ittfft11tt1111111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttfffffffffttfttfLLfffLfttt111;;;i111111iitfttt1tfftt11111tfttfffttt1tttttttttfLLftfttft\\nttffffffffftttfffffffffttffttffftfftttttt1i;;iiiii1i1tft11tttttttt1111tt1tffttffttfffffLLfttftffffff\\nttffffffffftttffffffffttttttttttfffttt1ttti;;;i111iitt111tfft11ttt111111t1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111tfffftttt111ii;iii;ii11111tfffft11111111tfft11tttt11tffffLLfftttfLLLLL\\nttttttttfffttfffttttt1ttfft1111tffftttt1111;;;i;;;i111ttttffftt1111111tttt111tttt11ttfffffLftfLLLLLf\\ntfttttttttttttttttt1ttfffftttt11tfft111tt1i;;;i;;i1i1;i11tffftt11t1111ttt11tt1tfftt11111ttfftfLffftt\\ntfttffffftt11ttfffftttffffttfft11tft11ii;ii;;;;:;iii1,.,,,:;iii1ttt111tt111tt1ttfffftttttt11ttttfftt\\nttttfffffftttffftfft11tfffttftttttt1;:,..:11;;i;;;;11:,,,.....,,:i1111tt111ttt1tffftttttfftt1ttffLLf\\ntt1tffffftt1ttfffft1111tfttft1111i:,.....,i11iiiii1tt:.,..........:111111t11tt1tffft1tfffffft1fLffLf\\ntftttffttttt11tttt1ttt11t11111;:,.........;i11i1111t;..............;t11111111t1tfttttttfffftt1tfffLf\\ntfftttttttfftt1111ttfft111111:.............,::;ii;;:...............:111111ttt111ttffftttfft1tttttfft\\nttttttttttttttt11ttttttt11tt1,..............::;;;;;,...............,1111tttttt11tffLffftttttfftttttt\\ntfffftttffttttt11ttttttt11tfi,..............,::;;::,,...............i111ttttfftttffffffttttttttffttf\\ntfffttttfffffft11ttttttt111ti................::::::,:;;::,..........it111ttffttttfffLfLfttfffffffttf\\ntfffttttftffff111ttttttt1tt1;................,;::::.:iiiii,.........;11111ttt11ttfffLfLfttfffffffttf\\ntffft1tttfffft111ttttttt11tti,................::::,.:ii;ii:.........;tttt1111ttttfffLLLfttfffftffttf\\ntttttttttttttt111ttttttt1ttf1.................,:::,.,:;iii:.. ......:ttttt11tft11tfffffftttfftfffttt\\ntttttttttttttt111ttttttt1ttt;::...............,:::,. .:;ii:..........;ttt1111tt11tttttft11tttttffttt\\nttttt1tttttttt11ttttttttt1t111i;,..............:::,....,::,...........;1111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfftt1iiiiii:.............:::,.... ............. :ttttt1111ttttttt111ttttffttt\\nt1ttt1tttttttt111ttttttttt1i;iiii;,............,:,,,................. ,1tttt111111tttttt111ttttttt1t\\n11t1111tt1ttt11111111111111i;iii1i,............,::,,.................:1tttt11111111111111111111tt111\\n11111111111111111111111111t1;;;;;,.............,:,,,.......... .:1tttttt111111111111111111111111\\n1111111111111111111111111t11;,.................,:,,..........,;:::;1ttttttt1111111111111111111111111\\n11111111111111111111111111111:..,..............,,............:ttttttttttttttttt111111111111111111111\\n111111111111111111111111111111ii;..............,::,...........i111ttttttttttt11111t11111111111111111\\n111111111111111111111111111111t;...............,;ii;::,.......:1ttttttttttttt11t1tt1111111ttttt11111\\n111111111111111111111111111111i,...............:;ii;;;:,......,1ttttttttttttttttttt111111tttttt11111\\n11111111111111111111111111111ti,...............:;ii;;;;:,..:..,1ttttttttttttttttttttttttttttttt11111\\n\",\n \"ttfttfffttttttffffttfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLttffffffffftttttt111111111tfffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt1111ttfffffffLftttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttffftttt1111tt1ttffffffttttt1111t111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1ttfffftttffftt11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLftttttfttttttttttftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttffLffftffttttt1ii::::;111tttffffffffttt111tft1tttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLfftffttttt1:,,,,,,,,:;ittffffffffttt1111t11ttttttttttt1ttffffffffffttt\\ntttffttffLLLLLLLLLftffftfLftffffLLLftttti::,::::::,,,;ttttfffffftt1111tft1ttt1tffttt11tfffffLLfLfttt\\nttfLffffffLLLLLLLfftfLLftttfLfffLLLfftt11iiiii111i;,,;t111tfffft111111ffft1tt11ttttt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt1iiiii1111i:,iftt111ttt11tt111tffttfftt11tfftttffLLLLLLLLffL\\nttttftttttffLftttttttttttttfLLLffLLftttti;;;ii;iiii::1ttttt11tt1111111tfftfffftttttttttttfLLLLffffff\\nttfLfffffffttffffffffffttfttfLLfffLfttt1i;;i1i;iiii:;tftttt1tfftt11111tfttfffttt1tttttttttfLLftftttt\\nttffffffffftttffffffffftfffttffftffttttti;;iii111i1iitft11tttttttt1111tt11ffttffttfffffLLfttftfffffL\\nttffffffffftttffffffffttttttttttfffttttti;;;ii1111ii1t111tfft11ttt111111t11tttfft1tfffffLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111tfffftttt1i;;;iiiiii11111ttfffft11111111tfftt1tttt11tfffffLfftttfLLLLf\\nttttttttfffttfffttttt1ttfft1111ttffttt111i;;ii;;;itt11ttttfffft1111111tttt111tttt11tttfffffftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tfft1t1t1i;;;ii;;it111ttttffftt11t1111ttt111t1tfftt11111ttfftfLffftt\\ntfttffffftt11ttfffftttffffttfft1ttft11ii1;;;;i;:;i1;;i11tttft111tt1111tt111tt1tffffftttttt11ttttfftt\\nttttfffffftttffftfft11tfffttftttt1i;:,,:1i;;;;i;;;1;.,,,;;i11111111111tt111ttt1tffftttttfftt1ttffLLf\\n1tttffffftt1ttfffft111tffttft1ii:,.....,11iiiiiii1t:,,,.....,:;i111111111t11tt1tffft1tfffffft1fLffLf\\ntftttffttttt11tttt1ttt11t11i;:,........,i1tt1ii11tt:,,,,........:t11111111111t1tfftttttfffftt1tfffLf\\ntfftttttttfftt1111ttfftt11i,............::;;iiiii1;,,............it1111111ttt111ttffftttfft1tttttfft\\nttttttttttttttt11ttttttt11;...............:;;;;:;;...............:111111tttttttttffLffftttttfftttttt\\ntfffftttffttttt11ttttttt11:...............,;;;;;;:,..............,111111ttttfftttffffffttttttttffttf\\ntfffttttfffffft11ttttttt11,...............,:;;;;:,...............,1111111ttffttttfffLfLfttfffffffttf\\ntfffttttftffff111ttttttt11:...... ........:;;;;:,...............,11111111ttt1tttfffLfLfttfffffffttf\\ntffft1tttfffft111ttttttt11:.......:;;;:....,;;::::.......,::,....,1tt11tt1111tt1tfffLLLfttfffftffttf\\ntttttttttttttt111ttttttt11:.....:;;;;;:.....:;:::,.......,:iii;,.,1t1t11tt11tft1tffffffftttfftfffttt\\ntttttttttttttt111ttttttt1i,.....:;:;;;:.....,::::,........;;iii;..;t1111t1111tt11tttttftt1tttttffttt\\nttttt1tttttttt11tttttttt1i,.....:::;;;,......::::,.......,;;ii;:..,;1t11111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttttti....,,,,:;;,.......,:::,,.......,;;;;,....,it11tttt1111ttttttt111ttttffttt\\n11tt11tttttttt111ttttttt1:,,.,,,..,,,.........::::,........,:;,..... ,1tttttt11111ttttt1111ttttttt1t\\n1111111tttttt11111111111i,,..,,,.... .........::::,..................itttt111111111111111111111tt111\\n1111111111111111111111111,...,,...............,::,,,...........,,...;tttttt1111111111111111111111111\\n11111111111111111111111111,..... .............,::,,,......... . .:1tttttt1111111111111111111111111\\n1111111111111111111111111ti,,,.,,..............::,,..........,,,::i1tttttttttt1111111111111111111111\\n11111111111111111111111111111i11;..............:,............,1tttttttttttttt11111111111111111111111\\n1111111111111111111111111111111i...............:;:::::,.......;tttttttttttttt11t1ttt111111ttttt11111\\n1111111111111111111111111111111:...............:iiii;;::,......ittttttttttttttttttttt1111tttttt11111\\n1111111111111111111111111111111,...............:iiiii;;:,......,1tttttttttttttttttttttttttttttt11111\\n\",\n \"tttttfftttttttffffftfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLftfffffffffttt1tt111111111tfffffftttt1111111111111111ttftttftttttttt11111tttt\\nttttttttttttttttfffffftttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttfftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1tffffftttffftt11t111tt111ttfffLLffttfft1tt111tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffttttftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttfLLffftfftttttftttttttffttttffffffffftt111tftttttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftffttttttiii;::::i1ttttffffffffftt1111t11ttttttttttttttffffffffffttt\\ntttffttffLLLLLLLLLftffftfLfttfffLLLfttt11:,,,,,,,:::itttttfffffft11111tft1ttt1tffttt11tfffffLLfLfttt\\ntffLffffffLLLLLLLfftfLLftttfLfffLLLLfttt1i::::,,::,,,itt11tfffft111111ffft1tt11tt1tt1ttffLLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttttiiiiii1i;:,,:ttt111ttt11tt111tffttfftt1ttfftttffLLLLLLLLffL\\nttttftttttffLftttttttttttttfLLLffLLftttti;iiii111i;:,iftftt11ttt11111tffftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttfttfLLfffLfttt1;;;ii;iiii;::1ffttt1tffft11111ffttfffttt11ttttttttfLfftftttt\\nttffffffffftttffffffffftfffttffftfftttt1;;i1i;;iii;:itft11tttttfttt111tt1tffttffttfffffLLftfftfffffL\\nttffffffffftttffffffffttttttttttffftttt1;;iiii111iii1t111tfft1tttt111111t1ttttfftttfffffLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111ttffftttti;;iiiiiiiii1111ttfffft11111111tffttttttt11tfffffLfftttfLLLLL\\nttttttttfffttfffttttt1ttfft1111ttfftttt1;;;iiii;;itt11tffffffft1111111tttt111tftt11tttfffffftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tfftttt1i;;;;ii;;it1111tftfffft11t1111ttt111t1tfftt11111ttfftfLffftt\\ntfttfffffttt1ttfffftttffftttfft11tft111i;;;;;ii;;i111111tttft111tt1111ttt11tt1tffffftttttt11ttttffft\\nttttfffffftttffftfft11tfffttfttt11i;;:ii;;;;iiiii1;11tt111t11111tt1111tt111tft1tffffttfffftt11tffLLf\\n1tttffffft11ttfffft1111tfttftii;:,....;1i;;;;ii111,,:;i1tt11tt11111111111t11tt1tffft1tfffffft1fLffLf\\ntftttffttttt11ttt11ttt1111i;:,.......,i1tiiii;;11i,,,..,:;i1t1t111t1111111111t1tfftttttfffftt1tfffLf\\ntfftttttttffttt111ttttt1i:...........,ii111iii11i:.,,......,:;1t111111111tttt111ttfLftttfftttttttfft\\nttttttttttttttt11tttt11t;..............,::;;i1ti:,............,1t1111111tttffttttffLfffttttffffttttt\\ntfffttttfftfttt11tttttt1,...............:;:;;;;;:..............;tt111111tttffftttffffffftttttttffttf\\ntfffttttfffffft11tttttt1................,;;;;;;;:..............:t11111111ttffttttffLLfLfttfffffffttf\\ntfffttttfttftt111tttttti............... .:;;;;;:,..............:1111111111tttttttffLLfLfttfffffffttf\\ntffft1ttttttft111tttttt;............. .:;;;;;;:::..............:111tt11tt111ttt1tfffLLLfttfffftffttf\\ntttttttttttttt111ttttt1,..............:;i;;i;::::..............:1ttt1111tt11tff1tffffffftttfftfffttt\\nttttttttttt1tt111ttttt;..............:;;;;;i:::::..............;1111111111111tt11tttttftt1tttttffttt\\nttttt1tttttttt11tttttt:..............:;;;::;:::::..............;t1111111111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttt1,........... .,,:,...,:::::..............,11i;;i111tttt1111ttttttt111ttttffttt\\n11tt11ttttttt1111tttt;............,..... ...,::::...............:i;:;;i1ttttt11111tttttt111ttttttt1t\\n11111111t1tt111111111,............,.........,::::,..............,:::;ii1tt111111111111111111111tt111\\n111111111111111111111,............ .........,,,::,..............::::;i11tt11111111111111111111111111\\n1111111111111111111111:....... .............,,:,,..............,::::i111t11111111111111111111111111\\n11111111111111111111111:....,,,,.............,:::,,..................,1t1111111111111111111111111111\\n111111111111111111111111iiii11t; .............,:,..,........ ..:1tttttt11111111111111111111111\\n111111111111111111111111111111t:...............:,,,:,,......,,,,,:;;1tttttttt1t111tt1111111tttt11111\\n111111111111111111111111111111t: .............::;ii;::,.....,i111ttttttttttttttt11ttt111111tttt11111\\n111111111111111111111111111111t:..............:;;iiii;:,.....,i1ttttttttttttttttttttttttttttttt11111\\n\",\n \"tttttfttttttttffffffffffffftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLftfffffffffttt1tt111111t11tfffffftttt1111111111111111ttftttftttttttt111111ttt\\nttttttttttttttttffffLftttfffffffLLLfttttttttt111tfffffffftttttttt11111tttttffffftffLfttttttt11111ttt\\nttttttttttttttttfffffttffffffLLffffttt1ttttttt1tffffffffffttttttt11111tfffffffLffttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttfftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1ttfffffttffftt11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffttttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLffftfftttttfftffffffftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftfftttttt1iii::;i1ttttfffffffffftt1111t11ttttttttttttttffffffffffttt\\nttttfttfLLLLLLLLLLfftfftfLfttfffLLLfttt11:,::,,,,,:;1tttttfffffftt1111tft1ttt1tffttt11tfffffLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLLffLLLffttt1;:,,,,,,,,,;ttt11tfffft111111ffft1tt11ttttt1ttffLLLLLLLLfff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt1iiiiiiii;:,,iftt111ttt11tt111tffttfftt11tfftttffLLLLLLLLffL\\nttttftttttffLftttttttttttttfLLLffLLfttt1i;iii1111i:,:1ftfft11ttt111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttfLfffLfttt1;;;i;iii1i:,;tffttt1tffft11111tfttfffttt11ttttttttfLLftfttft\\nttffffffffftttffffffffftffftttfffffttt11;;;ii;;iii::1fft11tttttfttt111tt1tffttffttfffffLLffffffffffL\\nttffffffffftttffffffffttttttttttfffttt1i;;iiiii11i;itt111tfft1tttt111111t1ttttfftttffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111ttfffttt1i;;iiiiiiiii1111ttfffft11t11111tffttttttt11ttffffLfftttfLLLLL\\nttttttttfffttfffttttt1ttfft1111ttffttt1i;;;iiii;;;1t11tffffffft1111111ttttt1ttfft11ttffffLfftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tfftt111;;iiiii;;;1111ttftfffft11t1111tttt1tt1tffttt1111ttfftfLffftt\\ntfttfffffttt1ttftfftttffftttfft11tft1i1i;;;;iii;;;111111tttft111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffftttt11tfftttfttt11i;;;1;;;;;iiii;i1t11t111t11111tt1111tt111tft1fffffttfffftt11tffLLf\\n1t1tffffft11ttffttt1111tftttti;:,,...:1i;;;;iiii1i:;i1ttt111tt11111111111t11tt1tffft1tffffffttfLffLf\\ntftttfftt11t11ttt11ttt111i;:,,.......:11ii;;ii;11i,.,,:;11tt11tt11t1111111111t1tffttttffffftt1tfffLf\\ntffttttttttftt1111ttttt1:............:1111iiii1ti;,,....,,;i1tttt11111111tttt111ttfLffttfftttttttfft\\nttttttttttttttt111ttt1t;...............,:;;i1tt1;,..........,itttt111111tttttttttffLfffttttffffttttf\\ntfffttttfftfttt11ttttt1,................:::::;i;:,...........,1ttt111111ttttfftttffffffftttttttffttf\\ntffft1ttffffff111ttttti.................,;;;;;;;:,...........,1t111111111ttffttttffLLfLfttfffffffttf\\ntffft1ttfttttt111ttttti................,,;;;;;;::,............it1111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttt;.............:;iii;;:;;:::,............it1111111tt111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111tttti,............,;;iiii::;::::,...........,1ttttt111ttt11tft1tfffffLftttfftfffttt\\nttttt1tttt11tt111ttt1:.............:;;;iii;::::::............,1tttt1111111111tt1tttfttftt1tttttffttt\\nttttt1tttttttt11tttti..............,;;;;:,,:::,,:............:tt11t11111111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11tttt:............. ,::,. .::,,,:........... :t1111111t111ttt1111ttttttt111ttttffttt\\n11tt11tttttt111111ti.......................,:::::.............it111t11111tttt1111tttttt1111ttttttt1t\\n1111111111111111111,.............,.........,:::::.............:1t11ii;:;11111111111111111111111tt111\\n1111111111111111111:........................,,:::..............;ii;:;:;ii111111111111111111111111111\\n11111111111111111111:....... ..............,,,:,...............,:::::;i1111111111111111111111111111\\n111111111111111111111:......,,..............,,,:,...............:::;::;i11t1111111111111111111111111\\n1111111111111111111111iiiiii1;...............,,,,.,..............,::::;11111111111111111111111111111\\n11111111111111111111111111111;................,,:,,,...... .it1111111111111111111111111111\\n1111111111111111111111111111t;...............;i;;;::,.....,,.....,,,;i1ttttttttt11tt111111ttttt11111\\n1111111111111111111111111111t;...............:i;;i;::,....:i111111tttttttttttttttttttttttttttttt1111\\n\",\n \"tttttfttttttttffffftfffftfftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLftfffffffftttt1t1111111t11tfffffftttt1111111111111111ttftttftttttttt111111ttt\\nttttttttttttttttffffLftttfffffffLLfftt1tttttt111tfffffffftttttttt11111tttttffffftffLfttttttt11111ttt\\nttttttttttttttttfffffttffffffLLLfffttt1ttttttt1tffffffffffttttttt11111tfffffffLffttfffffttt1111ttttt\\nttttttttttttffffttfffttffffffffftttftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfffttttt1tfffft1ttfffffttfffft11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLftttttttfffffftttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLffftffttttt111i;iitfftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftfftttt1;:,::,,,:;ittttffffffffftt1111t11ttttttttttttttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttfffLLLftt1i:,,,,,,,,,,:1tttttfffffftt1111tft1ttt1tffttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLLffLLLftt1i;;;;;;;i;:,:tftt11tfffft11111tffft1tt11ttttt1ttfffLLLLLLLfff\\ntfffffttttfLLLffttttfffffttLLLLfLLLft1;iiiii11111i::tffft11tttt11t111tfffttfftt1ttfftttffLLLLLLLLffL\\ntttfftttttffLftttttttttttttfLLLffLLftt11;;;iiiiiii:;tffffft11tt1111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttLLfffLft11i;;;;i;;iii;tffffttt1tffft11111tfttfffttt1tttttttttfLLftffttt\\nttffffffffftttffffffffftffffttfftfttt11i;;;i1iii1iitffft11tttttfft1111tt1tffttffttfffffLLfffftfLffLL\\nttffffffffftttffffffffttttttttttffftt11i;;;iii111ii1tt111tfft1ttft111111t1ttttfftttffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111ttffftttti;;;;iiiiii11111ttfffft11t11111tfftttttttt1tfffffLLftttfLLLLf\\nttttttttfffttfffttttt1ttfft1111ttffttt1i;;;iiii;;itt11tffffffft1111111ttttt1ttfft11ttffffLfftfLLLLLf\\ntftttttttttttt1tttt11tfffft1tt11tfft111;;;;;iii;;it111ttfffffft11t1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttffffftt11ttftfftttffftttfft11tti;;1;;;:;iii::i111111ttfft111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffftttt11tfftttft1i;:,..,1i;;;;iii;i;:;;1t111t11111tt1111tt111tft1fffffttfffftt11tffLLf\\n1tttffffft11ttffftt1111tt1ii:,,......,i1i;;;ii;11;...,:;i111tt11111111111t11tf1tfffttfffffffttfLffLf\\ntfttttftt11t11ttt11ttt11;,,..........,11t1iiii1t1:,,.....,:i111111t1111111111t1tffttttffffttt1tfffLf\\ntffttttttttfttt111ttttti,.............:;;iii11t1i,,.........,ittt11111111tttt11tttfLffttffttttttffft\\nttttttttttttttt111tttt1:................:;;;;;i;:,...........:ttt1111111tttffttttffLLffttttffftttttf\\ntfffttttftttttt11ttttti.................,;;;ii;;:............,1ttt11111ttttffftttffffffttttttttffttf\\ntffft1ttfffftf111ttttti..................:;;;i;;:,...........,1tt11111111ttffttttffLLfLfttfffffffttf\\ntffft1ttfttttt111ttttt;..................,;;;;;::,...........,1t1111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttt;...........,,.....,;;:;:::............,111111111tt111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111tttti,........,;ii:......:;:::::............,ittttt111ttt11tft1tfffffLftttfftfffttt\\nttttt1tttt111t111tttt;........:;;;;:,.....,;:::::.............ittttt1111t1111tt1ttfttttttttttttffttt\\nttttt1tttttttt11tttt1,.......,:::;;;,......::::::.............;tt1t1111111ttt1tttfttttttt1tttttffttt\\n1tttt1tttttttt11tttti.........,:::;:.......,:::::..........,,:;1t11111111ttff1111ttttttt111ttttffttt\\n111111tttttt111111t1,..........,:::........,:::::..........,:;;i1111t111ttttt11111ttttt1111ttttttt1t\\n1111111111111111111;............,,.........,::::,.........,:;;;i1111111111111111111111111111111tt111\\n11111111111111111111:.......................,:::,.. ......,:;;ii111111111111111111111111111111111111\\n111111111111111111111:.......,..............,:::,..........,::i11t1111111111111111111111111111111111\\n1111111111111111111111:,,..,, ..............,,,::,............,1111111111111111111111111111111111111\\n1111111111111111111111111i11:...............,..,:,,..... ..:1t11111111111111111111111111111111111\\n111111111111111111111111111;................,::::,,.....::::;i11tttt111111t1111111111111111111111111\\n111111111111111111111111111,.................ii;;::,....:1tttt1ttttttttttttttttt11tt111111ttttt11111\\n1111111111111111111111111ti..................;i;;;:,.....;t1ttttttttttttttttttttt1ttttttttttttt11111\\n\",\n \"ttffftfffttttttttftttfffttftttttttttt111tttt111111tttttttt111tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLLftfffffffftttt1t111t111t11tfffffftttt111111111111111tttftttfttttttttt1111tttt\\nttttttttttttttttffffLftttfffffffLLffttttttttt111tfffffffftttttttt11111ttttfffffftfLLfttttttt111tttt1\\nttttttttttttttftfffffttffffffLLffffttttttttttt1tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttffffttfffttffffffffftttfttttt1111tt1ttffffffttttt1111tt11111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttffftttt11tttffttttfffffttfffft11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLftt11ii;i;;ii1tttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLffftfftt1:,,,,,,,,:iftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftff1i;;:,,,,,,,,:;ttttfffffffffftt1111t11ttttttttttttttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttfffLLLt;,,:;;;;;iiii:ittttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLLffLLLfi,:iiii111111;1ffftt11tfffft11111tffftt1t1tttttt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfffffi:;;;;;iiiiiiitffffft11tttt11t111tfffttffft1ttfftttffLLLLLLLLffL\\ntttfftttttfffftttttttttttttfLLLffLLti;;;;;i;;iiii1ftffffftt11tt1111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttfLfffLtii;;;ii;;i1111tfffffttt1tffft11111tfttffftttttttttttttfLLfffffft\\nttffffffffftttffffffffftffffttfftftt1ii;;;;;;iii11ttffft11tttttfftt111tt1tffttffttfffffLLffffffLffLL\\nttffffffffftttffffffffttttttttttffftt11i;;;;;i111111tt111tfft1ttft11111tt1ttttfftttffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt1111tfffttti;;;;;;iiiii11111ttfffft11t11111tfftttttttt1ttfffLLLftttfLLLLf\\nttttttttfffttfffttttt1ttfft11111tfft11i;;;:;;ii;;itt11ttfffffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntftttttttttttt1tttt11ttffft1tt11ttti::i;;;:;iii;;;i;i1ttftfffft1tt1111tttt1tt1tffftt1111tffftfLffftt\\ntfttffffftt11ttftfft1tffftttff1i;:,...;1;;;;;i;:;i,..,:;i1tft111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffftttt11tfft11i;:,......,11;iii;;iii,,,....,:;i1111t1111tt111tft1fffffttfffftt11tffLLf\\n1tttffffft11ttffftt1111t1;;,..........,i1t11ii11i:.,........,111111111111t11tt1tfffttfffffffttfLffLf\\ntfttttftt11t11ttt11ttt11:..............;iiiiiii11,,,......,,,itt11t1111111111t1tffttttffffftt1tfffLf\\ntffttttttttfttt111ttttt;................,;;;i;;ii,...........;ttt11111111ttt111tttfLffttfft1ttttffft\\nttttttttttttttt111ttt11:.................:;;;i;::............;ttt1111111tttftttttffLLffttttffffttttf\\ntfffttttftttttt11ttttt1,.................,;;;;;;:............:ttttt11111tttffftttffffffftttttttffttf\\ntffft1ttfffftf111ttttt1,..................:;;;:::............:1tt11111111ttffttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttti...................,;;::::............,111111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttt:...................,::::::,:::,.......,1t1t11111tt111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111tttt1,....................,::::::;;;ii:......ittt11111ttt1ttff1tfffffLftttfftfffttt\\nttttt1ttttt11t111tttti.....................,:::::,;;;ii;,.....itttt1111tt111tttttttttttttttttttffttt\\nttttt1tttttttt11ttttt;........ .............:::::,;;;ii;,.....:1t1t1111111tttttttfttttttt1tttttffttt\\n1tttt1tttttttt11ttttt:.... :i;:.............:::::..,;;i:.......it11111111ttff1111tfttttt11tttttffttt\\n11tt11tttttt1111111t1,...,;iiii;, ..........::::,. .,:,......;111111111ttttt1111ttttttt111ttttttt1t\\n11111111111111111111i..,.,;;;iii;...........:::::.......,....itt1111111111111111111111111111111tt111\\n11t111111111111111111;....::;;ii;...........::::,..........,;111111111111111111111111111111111111111\\n1111111111111111111111, ...,:;;;,............,,:,.....,,:;11tt11111111111111111111111111111111111111\\n1111111111111111111111i:,....... ............,,:,.....:1tttttt11111111111111111111111111111111111111\\n1111111111111111111111111;.,. ..............;;;:,,....,it11ttt11111111111t11111111111111111111111111\\n111111111111111111111111i,..................;ii;:,.....,1t1ttttt1111111111t1111111111111111111111111\\n111111111111111111111111:...................;ii;;:......;ttttttttttt11tttt1t111111tt11111111ttt11111\\n111111111111111111111111:...................:i;:;;,.....:t1tttttttttttttttttttttt1tttttttttttttt1111\\n\",\n \"ttffftfffttttttttttttfffttftt111ttttt111tttt111111ttttttttt11tttt111111ttttttttttttttttttttt111111tt\\nttfftttttttttttttttffLLftfffffffftttt111111111t11tffffffttttt11111111111111tttftttfttttttttt1111tttt\\nttttttttttttttttffffLftttfffffffLLfft111ttttt111tfffffffftttttttt11111ttttfffffftfLLfttttttt111ttttt\\nttttttttttttttttfffffttffffffLLLfffttt1ttttttt1tffffffffffttttttt1111ttffffffLffttffffffttt1111tttt1\\nttttttttttttfffftttffttffffffffftttftt1t1iii11111tfffffftttttt11tt111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttffft11i:,,,::::;1tfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfft1;:,,,,,,,,,:tttttttffffffftt1111tftt111tttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffLfftt1::,,,,,:::::;itfttttffffffffftt111tft1ttfttttfLLfttttfffffftttttt\\ntttttttfLLLLLLLLLLfttttffftffffttf1,,,,:;iii1111itftttfffffffffftt1111t11ttffttttttttttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttffffft:,,,:;iii111ii1tttttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLfffLft:,,:;;;;iiiiii1tffftt11tfffft111111ffftt1t1tttttttttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttfLLfffft;:::;;;iii;iii1tffffft11tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\\ntttfftttttfffftttttttttttttfLLLffffti;;;i;;iii;iitfffffffft1tttt1t1111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttfLftfft1i;;;;;iiiii11ffffftttt1tffft11111tfttffftttttttttttttfLLffffftt\\nttffffffffftttfffffffftttfftttftttttt1;;;;;iiiii11ttffft11tttttfftt111tt1tffttffttfffffLLffffffLffLL\\nttffffffffftttffffffffttttttttttfftt11i;;;;;;ii1111ttt111tfft1ttft11111tt1ttttfftttffffLLLfttffLLLLL\\ntttffffffffttfffffffft11ttt1111ttff1;i;;;;;;;ii;iiii111ttfffft11t11111tfftttttttt1tffffLLLftttfLLLLf\\nttttttttfffttffftt1tt1tttft1111tt1;,.:i;;;;;iii::;;,,:;i1tfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntfttttttttttttttttt11ttffft1tti;:,...,ii;;;;ii;::;;.....,:itftt1tt1111tttt1tt1tffftt1111tffftfLffftt\\ntfttffffftt11ttftfft1tttft1i;:,.......:11iiii;;;:;:,,,,,,..;t111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffttttt11tti;:,..........,1tt1ii11i;;,,.,.,,,,,1111t11111tt111tft1tffffttfffftt11tffLLf\\n1tttffffft11ttttttt1111;...............:11iiii;;1;.,.,,.,..,1t11111111111t11tf1tfffttfffffffttfLffLf\\ntfttttftt11t11ttt111tt1,................,;;;ii;i1:.........,111t1111111111111t1tffttttffffftt1tfffLf\\ntffttttttttftt11111ttt;..................:;;;;:;i:..........itttt11111111ttt111tttfLffttfft1tttttfft\\ntttttttttttttt1111ttt1:..................,;;;;:::,..,.......;tttt1111111tttffttttffLLffttttffftttttf\\ntfffttttftttttt11tttt;....................:;;::::,,.........:ttttt111111ttttfftttffffffftttttttffttf\\ntffft1ttfftttt111tttt:....................,;:::,:;;;;:,.....:1ttt11111111ttffttttffLLfLfttfffffffttf\\ntffft1ttfttttt111ttt1,.....................:::,,::;iii;,.....itt1111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttt;......................,::,,::;;;i;,.....:111111111tt111tttttfffLLLfttfffftffttf\\nttttt11ttttttt111tt1:......................,:,..:,:;;i;.......:tttt1111ttt1ttffttffffffftttfftfffttt\\nttttt1ttttt111111tt1:......................,:,..:. .:;:......,itttt1111tt111ttttttfttffft1tftttffttt\\nttttt1tttttttt111tt1:........... .........,,,.,:...........,1tt11tt111111ttt1ttttffftttt1tftttffttt\\nttttt1tttttttt11ttti,......... .,..........,,,.,:..........,it11111111111ttft1111ttttttt11tttttffttt\\n11tt11ttttt111111tt:..........,::;,........,,,.,:......,:i11t11111111111ttttt1111ttttttt111ttttttt1t\\n11111111111111111111:........:;;ii;.........,,.,,.....i1ttt11t11t111111111111111111111111111111tt111\\n1111111111111111111ti........,:;;i;,...........,,.....;t11111111111111111111111111111111111111111111\\n11111111111111111111ti;,......,:;;;. ......,:,.,:.....,1t1t11111111111111111111111111111111111111111\\n11111111111111111111111;........,,,........:;::,,......;t1tttt11111111111111111111111111111111111111\\n1111111111111111111111i......... ........:;;::,......,1ttttt11111111111t11111111111111111111111111\\n1111111111111111111111:........ ...........:;;;::.......it1ttttt1111111111t1111111111111111111111111\\n111111111111111111111i,........,......... ,ii;;::,......:ttttttttttt11ttt1tt11t111tt111111t1tttt1111\\n11111111111111111111t;.........,..........:iiii;::,.....,1ttttttttttttttt1ttt1ttt1tttttttttttttt1111\\n\",\n \"ttttftfffttttttttttttfffttttt111ttttt111tttt111111ttttttttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11tffffffttttt11111111111111tttftttfttttttttt1111tttt\\nttttttttttttttttfffffftttfffffffLLLft111tttttt11tfffffffftttttttt11111ttttfffffftfLLfttttttt111ttttt\\nttttttttttttttttfffffttfffffffffffft11111;:::;;i1tffffffffttttttt1111ttffffffLffttffffffttt1111tttt1\\nttttttttttttfffftttffttffffffffftttft1;::,,,,,,,,ifffffftttttt11tt111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttff1;:,,,,,,,,,,:itfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffttt1:,,,,:::;;i;;1tttftttffffffftt1111tftt111tttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffLfftt;,,,,,:;ii11t11tfttttffffffffftt111tft1ttfttttfLLfttttfffffftttttt\\ntttttttfLLLLLLLLLLfttttffffffffttt;,,,,:;;;iii1111ttttfffffffffftt1111t11ttffttttttt1ttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttttfft:,,,,:;;;iiiiii1tttttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfffftttfLftfLfi;;;;;;;iii1iii1tffftt11tfffft111111ffftt1t1tttttttttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttfLLftfffi;;;i;;;;iiiii1fffffft11tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\\ntttfftttttffffttttttttttttttffftffft;;;;;;;;iiii1tttfffffft1tttt1t1111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttfffffffffttftttffftfft1;;;;;;;;iii1ttfffffttt1tffft11111tfttfLftttttttttttttfLLftffftt\\nttffffffffftttfffffffftttfftttftttt1i;;;;;;;;ii111tffftt11tttttfftt111tt1tffttffttfffffLLffffffLffLL\\nttffffffffttttfffffffft1tt1111ttt1::i;;;;;;;i1i;i111ttt11tfft1ttft11111tt1ttttfftttffffLLLfttffLLLLL\\ntttffffffffttffffffftt111tt111i;:,..;i;;i;iii11;;;;,::;1tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\nttttttttfffttffttttt111ttt1;:,......,ii;;iii;11;:;;,...,:1fffft1111111ttftt1ttfft11ttffffffftfLLLLLf\\ntftttttttttttt11tt111tt1;:,..........;11iii;1t1;:;;,,,,,.:tfttt1tt1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttffffftt11tttttt111:..............:1tt1ii11i::;:,,,,,,,if1111tt1111ttt11tf1tfffffttttttttttttffft\\n111tfffffft1tfftttt11;................:ii;;i;:,,;;,.,,.,..it1111111111tt111tft1tffffttfffftt1ttffLLf\\n1tttffffft111tttttt1i,............,....:;;;;;;:,1i,..,,,..;ttt11111111111t11tt1tfffttfffffffttfLfLLL\\ntfttttftt1t111ttt111;..................,;;;;;:,:1i,.......it111t11t1111111111t1tffttttffffftt1tffLLf\\ntffttttttttft1111111,...................:;;;::,,;;,.......it1tttt11111111ttt111tttfLffttfft1tttttfft\\ntttttttttttttt1111t;....................,;;:::,.:,..,.....:tttttt1111111tttffttttffLLffttttffffttttf\\ntfffttttfttttt111t1,.....................;;:::..:,........,1tttttt111111ttttfftttffffffftttttttffttf\\ntffft1ttfftttt111ti......................::::,..:,.....,:::i1ttt111111111ttffttttffLLfLfttfffffffttf\\nttfft1tttttttt111t:......................,:::,..:,....,:;iiiitt11111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt1111;.......................,:,...:,....:;;iiii1111111111tt111tftttfffLLLfttfffftffttf\\nttttt11ttttttt111t;...................,,,,,,,...,......,;;ii1111ttt1111ttt1tfffttffffffftttfftfffttt\\nttttt11tt11111111i,.................,::::::,....:........,,:i1111tt1111tt111ttttttfffffft1tftttffttt\\nttttt11ttttttt11t;.................,:;;;;;;,....:.... .. .,1t11ttt1111111ttt1ttttffffttt1tftttffttt\\nttttt11ttttttt1111:................,::::;i:.....:.,..,,,:;i11tttt111111111tft1111ttttttt11tttttffttt\\n111tt11ttt1111111t1:. ............::::;:.....,:....it11111tt1tt1111111ttttt1111ttttttt111ttttttt1t\\n11111111111111111111i:,..............,,,,......,:....:1tt111111t1111111111111111111111111111111tt111\\n11111111111111111111t11:........,.... . ..,....:.....it1t111t11111111111111111111111111111111111111\\n11111111111111111111111:,..................:....:.....:1ttt11t11t11111111111111111111111111111111111\\n1111111111111111111111i,...................:....:......it1ttttt1tt11111111111t1111111111111111111111\\n1111111111111111111111;....................,,..,:,.....:tttttttt111111111111111111111111111111111111\\n1111111111111111111111:.................. .::..,:......,1t1ttttt11t1t11111t1111111111111111111111111\\n11111111111111111111ti,.................. ,;::,,:.......itttttttttttt111t1tt11t111tt111tttt1tttt1111\\n11111111111111111111t;....................,;;;:,:.......:tttttttttttttttt1ttt1ttt1tttttttttttttt1111\\n\",\n \"tttttttttttttttttttttffftttt1111111tt1111tt1111111ttttttttt11tttt1111111ttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLfttffttfffttttt1111111111111tffffftttt111111111111111tttffttftttttttt11111tttt\\nttttttttttttttttffffLftttfffffffffftt11111iii1i11ffffffffttttttt111111tttttffffftfLLfttttttt111ttttt\\nttttttttttttttttffffftttffffffffffttt11;::,,,,,:;1ffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffttttt1;:,,,,,,,,,,:tffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLfttttttft;,,,,,,,,:::,:itfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffttt;,,,,,,:;ii1111tttttttffffffftt1111tftt111tttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffffft1:,,,,,:;iii11111fttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLLLLLLLLLffttttffftfffftt1:,,,,,:;;;iiiii1ftttfffffffffftt1111t11ttffttttttt1ttffffffffffttt\\ntttffttfLLLLLLLLLLfttfttffftttttft::;;::;;iiiiiii1ttttttttfffffftt1111tft1ttt1tffttt11tffffLLLLLfttt\\nttffffffffLLLLLLffftfffttttffftfLfi:;i;;;;;iiiiii1tffftt11tfffft111111ffftt1tt1tt1tttttfffLLLLLLffff\\ntffftfttttfLLLfftttttffffttfLLftfff;:;;;;;;;iiiii1tffffftt1tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\\ntttttttttttfffttttttttttttttffffffft;;;;;;;;iiii1ttffffffft1ttt1111111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttfffffffffttft1tfffttt1i;;;;;;;;iii1ttfffftttt1tffft11111tfttffftttttttttttttfLLfffffft\\nttffffffffftttfffffffftttffttttti::i;;;i;;;;ii1111tttttt11tttttfftt111tt1tffttffttfffffLLffffffLLfLL\\nttffffffffttttfffffffft1ttt11i;:,.,ii;;iiiii11:i1111tt111tfft1ttft11111tt1ttttffttttfffLLLfttfLLLLLL\\ntttffffffffttffffffftt111i;:,......:11;;iiiii1::;;;::;i1ttffft11t11111tfftttttttt1ttffffLfftttLLLLLf\\nttttttttfffttfttt1111ii;:,.........,it1iii;;1ti::;;,..,:1tfffft1111111ttttt11tfft11ttffffffftfLLLLLf\\ntfttttttttt1tt111111;,..............;1111ii1ti:;:;;,,,,.:tffftt11t1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttfffftt1111ttttti,................:;;;i;;;,,:;;:,,,,,,itt1111tt1111ttt11tf1tffffftttttt1tttttffft\\n111tfffffft1ttttttt:..........,,......:;;;;;;,.,i;,,,,,,.;t111111111111t111tft1tffffttfffftt1ttffLLf\\n111ttfffft111ttttt1,............,.....,;;;;;:,.:1i,......;11t111111111111t11tt1tfffttfffffffttfLfLLL\\ntttt1tftt11111tt11;....................:;;;;:,.:1i,......:tt11111111111111111t1tffttttffffftt1tffLLf\\nttft11ttttttt1111i,....................,:;:;:.,,;:,......:111tttt11111111tttt11tttfLffttfft1tttttfft\\ntttttt1ttttttt111;......................,;:;:..,:,.......:11tttttt111111tttffttttffLLffttttffffttttf\\ntffft11ttttttt11i,.......................:::,..,:,.......,1tttttttt11111ttttfftttffffffftttftttffttf\\ntffft11ttttttt11;........................,:::,..:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt11;......................,:;;;;;;,:,........,111tt1111111111tttttttffLLfLfttfffffffttf\\ntfttt11ttttttt11i.....................:::;;;;;:.:,....... ,1t11111111111t111tftttfffLLLfttfffftffttf\\ntttt111ttttttt11:....................,:::;;;;;.,:,..........,:;iii11111ttt11tffttffffffftttfftfffttt\\nttttt11tt1111111,....................,:::;;;;,.,:.......... .::;;;;ii11111ttftttftfffft1tftttffttt\\nttttt11ttttttt11i................. ....,,,,.....:.... ........,:::;;;;ii111tt1tttfffffttt1tftttffttt\\nttttt11ttttttt11ti,. .........,... .. ....,..:,.. ....,:::;;;iii1ttt1111ttttttt11tttttffttt\\n11111111ttt111111t1ii;;;,.......................:..,.:1;:,,.. ..,;i1i1t1ttt1111ttttttt111ttttttt1t\\n1111111111111111111ttttt:,......................:.. ,tttt111i;;;;i1tt1111111111111111111111111tt111\\n111111111111111111111111:,..................,...:.....it1t1ttttttttt11111111111111111111111111111111\\n111111111111111111111111;,..................,...:.... ;tttt11t11t11111111111111111111111111111111111\\n111111111111111111111111:...................,..,:.....:ttttttttttt1111111111111111111111111111111111\\n11111111111111111111111i,...................:,.,:.....,1ttttttttt11111111111111111111111111111111111\\n11111111111111111111111;...................,::..:.....,1ttttttttt1t11t1111t1111111111111111111111111\\n11111111111111111111111:.................. :;:,,:......itttttttttttttt111ttt11t1111t111t1ttttttt1111\\n111111111111111111111t1:.................. :;;:::......;ttttttttttttttttt1ttt1ttt11ttttttttttttt1111\\n\",\n \"tttftttttttttttttttttffftttt1111111tt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfftfftttffttttt111111111111ttffffftttt1111111111111111ttffttfttttttttt1111tttt\\ntttttttttttttttttffffftttffffffffffft111tt111111ttffffffttttttttt11111tttttffffftfLLftttttt11111ttt1\\nttttttttttttttttffffftttffffffLffftt111i;;:::::;1tffffffffttttttt11111tfffffffLfftfffffftttt111ttttt\\nttttttttttttfffftttffttffffffffttttt1i;,,,,,,,,,,;fffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLftttttttti:,,,,,,,,,,,,;tfffftttfffft11t111tt111tttffLLfttfftt1tt111tttttt\\nttttttttffLLLLLLLffttfLLffttfffttti,,,,,,:;;;ii;itttttttffffffftt1111tftt1tttttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffffft1:,,,,::;i111tt1tfttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLfLLLLLLLLfttttffftfffftti,,,,,,:;;iiii1i1ftttfffffffffft11111t11ttftttttttttttfffffLLfLfttt\\ntttffttfLLLLLLLLLLfttfttffftttttf1,,::,:;iiiiiiii1ttttttttfffffftt1111tft1ttt1ttfttt11tffffLLLLLfttt\\nttfffftfffLLLLLfffftfffttttffftfLf;:ii;;;;iii11ii1tfffft11tfffft111111ffft11t1ttt1tt1tffffLLLLLLLfff\\ntffftfttttfLLLfttttttffffttfLLftff1:;ii;;;;iiiiii1ffffftt11tttt1ttt111fffttfffttttfft1tffLLLLLLLLffL\\ntttttttttttfffttttttttttttttfffffff1;;;;;;;iiiii1tffffffftt1ttt1111111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttffffffffftttt1tffftft1i;;;;;;;iiii1ttfffffttt1tffft11111tfttfffttt1tttttttttfLLftfffft\\nttffffffffttttfffffffft1tftt1tft1;ii;;;;;;;;ii1111ttftft11tttttfft1111tt1tffttffttfffffLLffffffLffLL\\nttffffffffttttfffffffft1tttt1ii;,.:i;;;i;iii111t111ttt111tffttttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffftfttt111ii;:,....,i1;;iiiii1i:;;;i11111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\ntttttttttffttfttt1111ii;:,.........;11iiii;;11;::;;,:;1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntft1ttttttt1t1111111:,.............:1tt1iii1t1;;:;:,,.,:1tffftt11t1111ttt11tt1tffftt1111ttfftfLLfftt\\ntttttffttt1111ttttt;................:iiiiii11,:;:;:,,,,.:tttt111tt1111ttt11tf1tffffftttttt1ttttttfft\\n1tttfffffft1tftttt1,.................,;;;;:;:.,:i:,,,,,,,it11111111111tt111tft1tffffttfffftt11tffLLf\\n111ttfffft111ttttti...................:;;;;;:,,:1;.......;t1tt11111111111t11tf1tfffttfffffffttfLfLLf\\ntttt1tftt11111ttt1:...................,;:;;;:..;1;.......:tt111t11t1111111111t1tffttttffffftt11ffLLf\\nttft1111ttttt1111;.....................:;:;;,..,;:.......,111tttt11111111tttt11tttfLffttfft1tt1tffft\\n1tttt11ttttttt111,.....................,::;;,..,:,.......,1ttttttt111111tttffttttffLLffttttffffttttf\\ntfftt11ttttttt11;.......................:::;,..,:,........itttttttt1111tttttfftttffffffftttftttffttf\\nttfft11ttttttt11,.......................,;;;;:,,:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt1i,.....................,::;i;;;,,:.........:111tt1111111111tttttttffLLfLfttfffffffttf\\nttttt11ttttttt1i.....................,:::;i;i:.,:,........,1t1111t111111t111ttfttffLLLLfttfffttffttf\\ntttt111ttt11t11;.....................,:::;;;;,.,:..........1tt111tt11111ttt1tffttffffffftttffftffttt\\nttttt11t1111111:......................:::::,...,:..........:i1tttt1tt111t1111tttttfttffft1tttttffttt\\nttttt11tttt11t1i.......................... ....,,.......... .,,:i11iii11111tt1t1ttffffttt1ttttttfttt\\nttttt11tttttt111;... ......................,:............ .,:::;iiii1111111tfttttt11ttttttfttt\\n11111111t1111111t1i;;::::......................,:..,:.. .......,::;;;;;;iii11111tttttt111ttttttt1t\\n11111111111111111ttttttt1,.....................,:......:,.. ..,:;;;:;;;iiii11111111111111111tt111\\n111111111111111111111111i,.................,::..,.... ,tt1ii;,,.. ..,:i;;iii111111111111111111111111\\n111111111111111111111111i,.................,;:,,,......1tttttt11i;;::itt11t1111111111111111111111111\\n111111111111111111111111i,................ ,;:::,......it1t1tttttttttt11tt11t111111111111111111t1111\\n111111111111111111111111;................. ,;;::,......it1tttttttt1111111t11111111111111111111111111\\n111111111111111111111111:................. .;;:::......;t1ttttttt1ttttt111t1111111111111111111111111\\n111111111111111111111111,...................;i;::,.....;tt1ttttttttttt11tttttttt111t111111tttttt1111\\n111111111111111111111111:...................:i;:::.....ittttttttttttttttttttt1ttt111tttttttttttt1111\\n\",\n \"tttftttttttttttttttttffftttt1111111tt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfftfftttffttttt111111111111ttffffftttt1111111111111111ttffttfttttttttt1111tttt\\ntttttttttttttttttffffftttffffffffffft1111tttt111ttffffffttttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttffffftttffffffLffftt11111i;iiii1tfffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffttttt11;::,,,,,,::1fffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLftttttttf1;:,,,,,,,,,,,itfffftttfffft11t111tt111tttffLLfttfftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLffttfffttt1,,,,,,,::::::itttftttffffffftt1111tftt11t11tfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffLfft1:,,,,,:;ii11111ffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLfLLLLLLLLfttttffftfffftt1:,,,,:;;iii1111fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfLLLLLLLLLLfttfttffftttttf1,,,,,:;iiii;iii1ttttttttfffffftt1111ttt1ttt1ttfttt11tfffffLLLLfttt\\nttfffftfffLLLLLfffftfffttttffftfLt:;;;:;;iiiiiii11tfffft11tfffft111111ffft1tt1ttt1tt1tfffLLLLLLLffff\\ntffftfttttfLLLfttttttffftttfLLftff1;;;i;;;iii1iiitfffffft11tttt1ttt111fffttfffttttfftttffLLLLLLLLffL\\ntttttttttttfffttttttttttttttffftfffi;;;;;;iiiiii1tffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttffffffffftttt1tffftffti;;;;;;iiiii1tttffffttt1tffft11111tfttfffttt1tttttttttfLLftfffft\\nttffffffffftttfffffffftttftt1tftt111i;;;;;;;;ii111tfftft11tttttfft1111tt1tffttffttfffffLLffffffLffLL\\ntttfffffffttttfffffffft1tt111111i::i;;;i;;;;i11t111ttt111tffttttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffftfftt111111i;:,..,ii;;iiiii11:;;;111111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\ntttttttttffttfttt1111111i;:,.......:11;iiii;11;::;;,:i1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntfttttttttt1t1111111i;:,...........:1t1iii;itt;;;;:.,,,:itffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\\ntttttffftt1111ttttt1:..............,i111ii1tti:;;;:,,,,.,1tft111tt1111ttt11tf1tffffftttttt1ttttttftt\\n111tfffffft1tfttttt;.................:;;;;;;;,.:i:.,,,,,.;t11111111111tt111tft1tffffttfffftt11tfffLf\\n111ttfffft111ttttt1,..................:;;;;;:,.:1;.....,.:11tt11111111111t11tf1tfffttfffffffttfLfLLf\\ntttt1tftt111111tt11,..................,;;;;;:,.;1;.......,1t111t11t1111111111tttffttttffffftt11fffLf\\ntttt111tttttt11111;....................::;;;,..,;:.......,i11tttt11111111tttt11tttfLffttfft1tt1tffft\\n1tttt11ttttttt111i.....................,::;;,..,:.........ittttttt111111tttffttttffLLffttttffffttttf\\ntfftt11ttttttt111,......................::::,..,:,........itttttttt11111ttttfftttffffffftttttttffttf\\nttfft11ttttttt11;.......................,:::,..,:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt11:........................,:,,..,:,........,111tt1111111111tftttttffLLfLfttfffffffttf\\nttttt11ttttttt11,.......................,,::,..,:..........it11111t11111t111tttttffLLLLfttffftfffttf\\ntttt111tttt1t11i......................::;;;;;:.,:..........;t11tttt11111tt11tffttffffffftttffftffttt\\nttttt11tt111111:....................,:::;i;;i,.,:..........;ttttttt1111111111tttttfttffft1tttttffttt\\nttttt11ttttttt1;....................,:::;i;;:..,,...........:;iii1111111111tt1t1ttfffttt11ttttttfttt\\nttttt11tttttt111:...................,:::;;;;...,,........... .,:;;;:;i1111ttt1111ttttttt11ttttttfttt\\n11111111t11t11111;,.. ...............,,,....,:.... .......,:::::;;11tt11111111tt1tt1111ttttttt1t\\n11111111111111111t11i;;;:.......,..... ......,,....,,. ...,::;::;i1111111111111111111111111tt111\\n11111111111111111111tttti,...................,.,,... :1i:,. .,,;;i1111111111111111111111111111111\\n111111111111111111111111i,...................:,,,.....ittt1i:,.. ,1tttt111111111111111111111111t1111\\n111111111111111111111111;,...................,,::.... .111tttt1ii1ttt11111111t11111111111111111t1111\\n111111111111111111111111;....................,:::......it1t11ttttt1111111111111111111111111111111111\\n111111111111111111111111;....................,::,......;t1tttttt11tt1tt111t1111111111111111111111111\\n11111111111111111111111t:....................::::......:1111ttttttttttt1tt11ttt11111111111tttttt1111\\n11111111111111111111111t:....................:;::,.....,1tttttttttttttttttttttttt111tttttttttttt1111\\n\",\n \"tttftttttttttttttttttffftttttt11ttttt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfftfffttffttttt111111111t11ttffffftttt1111111111111111ttffttfttttttttt1111tttt\\ntttttttttttttttttffffftttffffffffffft1111tttt111tfffffffttttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttffffftttffffffLfffttt1111ttttt1tffffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttftttffffffffttttft1i;:;;;;;i11tfffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLfttttttfft1;:,,,,,,,,:1ttfffftttfffft11t111tt111tttffLLfttffft1ttt11tttttt\\nttttttttfffLLLLLLffttfLLffttfffttti::,,,,,,,,,,;ttttftttffffffftt1111tftt11t11tfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfffffti,,,,::;;;iiiii1ffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLLLLLLLLLLftttttfftfffftt1:,,,;iii1111111fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfttffftttttff:,,:;;;iiii1ii1tttttttttfffffftt1111ttt1ttt1ttfttt11tfffffLLLLfttt\\nttfffftfffLLLLLfffttfffttttffftfLt;:,:;;;;iiiiii11tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffftfttttfLLffttttttffftttfLLftff1;;;;;iiiii;i11ttfffftt11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttfffLtfffii;;;;;ii;;iittffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttft1tffftffti;;;;;iiiii1ttttffffttt1tffft11111tfttfffttt1tttttttttfLLfffffft\\nttffffffffftttfffffffftttfttttfttttti;;;;;iiii1111tfftft11ttttffff1111tt1tffttffttfffffLLffffffLffLL\\nttffffffffttttfffffffft1tt11111tft11i;;;;;;;iit11111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffftttfffftfftt1111111111i:,;i;;;;;;ii1i;;;111111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\nttttt1tttffttfttt11t111tttt1i;:,...:1i;ii;ii;1i:;;i;;i1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntfttttttttt1tt1111111ttt1;:,,.......;ti;iii;it1;;;;,..,:i1fffft11t1111ttt11tt1tffftt1111ttfftfLffftt\\nttttfffftt1111ttttt111;:,...........;tt11iii1t1::;;,,,,,.,1ft111tt1111ttt11tf1tffffftttttt1ttttttftt\\n111tfffffft1ttttttt11,..............:i11iii111:,;;,,,,,,,.;t1111t11111tt111tft1tffffttfffftt11tfffLf\\n111ttfffft111ttttttt;.................:;;;;;;:.,ii,....,,.:1tt11111111111t11tf1tfffttfffffffttfLfLLf\\ntttt1tftt11111ttt111:.................,;;i;;;,.,1i,.......:t111111t1111111111tttffttttffffftt11fffLf\\ntttt11ttttttt1111111,..................:;;;;;,,,;;,.......:11tttt11111111tttt11tttfLffttfft1tt1tffft\\n1tttt11ttttttt11111i...................,;;;;:,..:,........:1tttttt111111tttffttttfLLLLfttttffffttttf\\ntfftt11ttttttt11111:....................:i;;:,.,:,........,1ttttttt1111ttttffftttffffffftttttttffttf\\nttfft11ttftttt111ti,.....................;;::,..:,........,i1tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt111t;......................,::,...:,.........;11t11111111111ttt1tttffLLLLfttfffffffttf\\nttttt11ttttttt111t:......................,::,...:,...,,....it11111111111t111tttttfffLLLfttfffftffttf\\ntttt11tttt11tt1111,.......................,,,...:,...,:;;;;itt11ttt1111ttt1ttftttffffffftttffftffttt\\nttttt11t111111111i.........................,,...:,...,:;iiii11111t111111t111tttttttttffft1tftttffttt\\nttttt11ttttttt111,.........................,,...:....,:;;iii11111111111111ttttt1ttfffttt11ttttttfttt\\nttttt11ttttttt111;...................,,,,..,....,......,:;ii1ttt1111111111ttt1111tfttttt11ttttttfttt\\n11111111t11t11111t;...............,:::::::..,...:.........,,it11tt1111111tttt1111ttt1tt1111ttttttt1t\\n1111111111111111111,.............:::::;;i:......:..... :1ttttt111111111111111111111111111111t111\\n11111111111111111111;,.. ........,::::;;:.......,... ,i;;;i1tttt111111111111111111111111111111111111\\n11111111111111111111t11i,.........,:::;;. ..,:,.:.....itttttttt1111111t111111111111111111111111t1111\\n11111111111111111111111t;...........,,,.... ,:,,:......it1111ttt1111111111111111111111111111111t1111\\n111111111111111111111111;.......... .... .:,,:,. ...:tttt11tt111111111111111111111111111111111111\\n111111111111111111111111;....................::::..,,..,1tttttttt1tttt1111t1111111111111111111111111\\n11111111111111111111111t;....................::::..,,...;t1tttttttttttt1t11ttttt111t111111tttttt1111\\n11111111111111111111111ti....................:;::,......:11tttttttttttttttttttttt11t11t1111ttttt1111\\n\",\n \"tttftftttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfttfffttffttttt111111111t11tfffffftttt1111111111111111ttffttfttttttttt1111tttt\\nttttttttttttttttfffffftttffffffffffftt11ttttt111tffffffftttttttt11111ttttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttffffftttffffffLfffttttt11tttt11tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffftttft1tttt11ttt1ttfffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLftttttttfft11iiiiiittt1ttfffffttfffft11t111tt111tttffLLfttffft1ttt11tttttt\\nttttttttfffLLLLLLffttfLLffttfffttfft;::,,,,,,:itttttffttffffffftt1111tftt11t11tfLLftttt1tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffffft11i:,,,,,,,,:,;fffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttfffttffftt1;:::::;;;iii;:tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfttfLfttttfft;:;iii111111i;1ttttttttffffffftt1111ttt1ttt1ttftt11ttfffffLLLLfttt\\nttfffftfffLLLLLLffftfffttttfffffLf;:;;;;ii1iiiii11tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffffftttffLLffftttttffffttfLLffffi:i;;;;;ii;ii11ttffffft11tttt1ttt11tfffttffft1ttfftttffLLLLLLLLffL\\ntttttttttttffftttttttttttttfLfftffi;ii;ii;i11111tfffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttftttfLftf1;;;;;;;;i1111tttffffftttttffft11111tfttfffttt1tttttttttfLLfffffft\\nttffffffffftttfffffffftttfftttftttt1i;;;;;iiii1111ttftft11ttttffff1111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffft1ttt1111tfftt1i;;;;iii1tt111ttt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttffffttftt111t11111ttfft1;;;;;;ii1ti;;i11111ttffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\\nttttt1tttffttfttt111111tttt11111tti:i;;;;;;iii1;:;i1i1ttftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntfttttttttt1tt11t1111ttfftt1tt1i;:..;i;;;;;iii1i:;;:,,:;i1ffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\\ntfttfffftt1111tttttt1tttttt1i;,.....:11;ii;;;iti:;;,,,...,:1t111tt1111ttt11tf1tffffftttttt1tttttfftt\\n1t1tfffffft1tttttttt111tti:,....,...,i11iii;i1ti;i,,,,,,,,.,i111t11111tt111tft1tffffttfffftt11tffLLf\\n1t1ttfffft111tttttt1111:,...........,i1t1iii11i,;1,....,,...;t11111111111t11tf1tfffttfffffffttfLLLLf\\ntftt1tftt1tt11ttt111tt;..............,:;i;;;;;,.i1,.........:11111t1111111111tttffttttffffftt1tffLLf\\ntfftttttttttt111111ttt:................,;;i;;:,,:;,.........:tttt11111111tttt11tttfLffttfft1tt1tffft\\ntttttt1ttttttt1111ttti,................,:;;;;:,.,:..........,ttttt111111tttffttttfLLLLfttttffffttttf\\ntffft11ttttttt1111ttt;..................,;;;::,.,,..........,1tttt111111tttffftttffffffftttttttffttf\\ntffft11ttftttt111tttt:...................:;;::..::,,.........ittt11111111ttffttttffLLfLfttfffffffttf\\ntffft11ttttttt111ttt1:...................,;::,,::;;;i;,......;t11111111111ttt1tttffLLLLfttfffffffttf\\ntttft11ttttttt111ttt1,....................,::,,::;;iii;. ...,it11tt11111t111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111t1ti.....................,:,,,,::;iii;.....,it11tt1111ttt1ttftttffffffftttffftffttt\\nttttt11tt11111111t1ti......................,:,. ,,,:;i:.......;11tt11111t111tttttttttffft1tttttffttt\\nttttt11tttt11t11tttt;......................,,,..,, .,,.......,;11111111111ttttt1ttfffttt11ttttttfttt\\nttttt1tttttttt111ttt:.......................,,..,,.....,....:1ttt111111111ttt1111tfttttt11ttttttfttt\\n1111111ttt1t11111tt1,.......................,,..:,.........:1t11111111111tttt1111ttt1ttt111ttttttt1t\\n11111111111111111111;....... ............,,..:,.....,;ii1t1t111111111111111111111111111111111t111\\n111111111111111111111,.... .,::,................:....,11ttt11tt11t1111111111111111111111111111111111\\n111111111111111111111;.....;i;;;,...............:,....it1111ttt1tt1111t111111111111111111111111t1111\\n1111111111111111111111i:.,iii;;i:.......... ,::,:......itttttttt1111111111111111111111111111111t1111\\n111111111111111111111111i,:;;;ii;,......... ,;;::,.....:1ttttttt11111111111t111111111111111111111111\\n111111111111111111111111i,.,::;;:.......... ,;;;::......itttttttt1tttt11t1tt111111111111111111111111\\n111111111111111111111111i..,.................;;;::,.,,..:1tt1tttttttttttt11ttttt11111111tttttttt1111\\n111111111111111111111111i..... .............;i;:::,.....itttttttttttttt1tttttttt11t11t1111ttttt1111\\n\",\n \"tttfttfttttttttttttttfffttttt1111tttt111tttt111111ttttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLfftfftttffftttt111111111111tfffffftttt111111111111111tttffttfttttttttt11111ttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tffffffffttttttt111111ttttffffLfffLLfttttttt1111t1t1\\nttttttttttttttttffffftttffffffLffffttttttttttt1tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffftttftttttt11ttt1ttfffffftttttt111t111111ttffffLLffttfLLfft111111tttt\\nttttttttttffLLLLftttttfLLLftttttttfftttttttfffft1tffffftttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftffft11i;ii1ttffttttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffLfLftti;:;:,,,:;;itffftttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffffftt1;,,,,,,,,::,:tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfftfLftttffff1;::::;;iii;,:1ttttttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\\nttfffftfffLLLLLfffftfffftttfLfffLfi;iiii11111i;:i1tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffffftttffLLfffttttfffffttfLLffLf;;;;iiiiiiii;:1tfffffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttffLLffLt;;:;;ii;;iii;ttffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttftttfLftf11i;;;i1ii11ii1tfffffftttttffft11111tfttfffttt1tttttttttfLLfffffft\\nttffffffffftttfffffffftttfftttfttt11i;;;;i1111i111ttffft11ttttffft1111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffftttttt111tfft11;;;;iiiii1t1111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffffffft111tt1111ttfft1i;;;iiiii1;;;111111ttffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\\nttttt1tttffttfftttttt11ttttt111tttft1i;;;;iiiii;;;1t11ttftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tffftt1tt11tff1ii;;;;;iiii:;;i;;i1tttffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\\nttttffffttt11tttttft1tttttt1ttt11i;,:i;;;;;iii;;;;:...,,,:;i1111tt1111ttt11tt1tffffftttttt1ttttttftt\\n111tfffffft1ttfftttt11tttt1tfti;,...,i1i;;ii;;i1i;,.........,i11111111tt111tft1tffffttfffftt11tffLLf\\n1t1ttfffft111tftttt1111ttt11;:,......;11iii;;1t11;......,.,,.,i1111111111t11tt1tfffttfffffffttfLLLLf\\ntftt1tftt1tt11ttt11ttt11i;:,.........:1tt1i;i1111;............;t11t1111111111tttffttttffffftt1tffLLf\\ntfftttttttttt111111tttt1,.............:;;;;;;;;:;:............:tt11111111tttt11tttffftttfft1tt1tffft\\n1ttttt1ttttttt1111tt11ti................:;;;;;:,:,............,1tt111111tttffttttfLLLLfttttffffttttf\\ntffftttttttttt111tttt1ti................,;;;;::,:,.............ittt11111tttffftttffffffftttttttffttf\\ntfffttttfftttt111tttttt;.................:;;:::,:,.............:tt1111111ttffttttffLLfLfttfffffffttf\\ntffftttttttttt111tttttt;.................,:;:::,:.,:,,.........,it11111111ttt1tttffLLLLfttfffffffttf\\ntttft11ttttttt111tttttt:..................,::::,:,,;;;;;:,......itt11111t111tttttffLLLLfttfffftffttf\\nttttt1tttttttt1111t1ttt;...................,::,,:,:;;;iii;.....,1tt1111ttt11tftttffffffftttffftffttt\\nttttt11tt1111t111tt1ttt:...................,::,,:::;;iiii;,.....:i1t1111t111tttttttttffft1tftttffttt\\nttttt11ttttttt11ttttttt:....................::,,:..,,:;ii:...... .1t111111ttttt1ttffffft11ttttttfttt\\nttttt1tttttttt111tttttt:....................,::,:. ..::,......,1t1111111ttt1111tfttttt11ttttttfttt\\n1111111tttttt1111ttt1tt:.... ...............,:,,:..............,1t1111111tttt1111ttt1ttt111ttttttt1t\\n11111111111111111111111;;;;:,...............,:,,:....... ...,,:1ttt11111111111111111111111111111t111\\n11111111111111111111111iiiiii:...............,,,:........,:i11tt1tt111111111111111111111111111111111\\n11111111111111111111111iiiiiii...............,,,:.......,1tttt11tt1111t111111111111111111111111t1111\\n1111111111111111111111i;iiiiii,..............,.,:........ittt11t111111111111111111111111111111111111\\n111111111111111111111111iiii;,...............::::,,......:1ttttt11t111111111111111111111111111111111\\n1111111111111111111111111i:,. ...............:i;:::,......itttttt1ttt111t1tt111111111111111111111111\\n11111111111111111111111111:................. :i;;;::,.....;ttttttttttttttt1ttttt111111111ttttttt1111\\n11111111111111111111111111:................. :i;;;;::,....:tttttttttttttttttttttt11t11t1111ttttt1111\\n\",\n \"tttftttttttttttttttttfffttttt1t1ttttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11tfffffftttt1111111111111111ttffttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttfffffffLLfttttttt111tttt1\\nttttttttttttttttfffffttfffffffLffffttttttttttt1tffffffffffttttttt1111ttffffffLLfttffffffttt1111tttt1\\nttttttttttttfffftttftttffffffffftttfttttt111ttt1ttfffffftttttt111tt11111ttffffLLffttfLLff111111ttttt\\nttttttttttffLLLLftttttfLLLftttttttffttttttttffft1tffffftttfffft11tt11tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLffttfffftfffttttttfffffftfttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffffffttft111i;ii1ttfffftttffffffffffft111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftft1i:::,,,,::;;1fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfftfLffftfffLf1;,,,,,,,::,,:1tttttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\\nttfLfftfffLLLLLfffftfLfftttfffffLLf1;;;;;iiiii:,:1tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffffftttffLLfffttttfffffttfLLLffLfiiiii111111i::1tffffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttftttttttffftttttttttttttfffLffLfii;;;iiiiiii;:1ftffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttfttffLfffLti;:;;ii;ii1;;ttffffftttttffft11111tfttffftttttttttttttfLLfffftft\\nttffffffffftttfffffffftttfftttftttt1i;;;ii11111ii1ttffft11ttttffft1111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffftttttt111tfff1ii;;;iiiiiii1111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\n1tfffffffffttfffffffftt1ttt1111tffft1i;;;iiiiii;;i111111tfffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\\ntttttttttffttfftttttt1ttfft1111tttftt1;;;iiiiii;:;tt11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tfffft1tt11ttft11;;;;;iiii;;;1t11ttttffftt11t1111tftt1tt1tffftt1111ttfftfLffftt\\nttttffffttt11tttttft1ttfffttfft11tftiii;;;;iiii;;;;:;ii1tttft111tt1111ttt11tt1tffffftttttttttttttftt\\n111tfffffft1ttfttttt11tfftttfttt11i:,ii;;;;;iii;i:.....,,::;i111t11111tt111tft1fffffttfffftt11tffLLf\\n1t1ttfffft111tffttt1111tft1ft1i;:,...;1i;;;;;;i11:...........,;1111111111t11tt1tfffttfffffffttfLLLLf\\ntftt1tftt1tt11tft11ttt111111;:,......,111ii;;i1t1:........,,...;11t1111111111tttffttttffffftt1tffLLf\\ntffttttttttttt1111ttttt11;:,.........,i111i;i1t1;,.............,1t1111111tttt11t1tfLftttfft1tt1tffft\\n1ttttttttttttt1111ttt11ti,............,::::;;;i;:,..............it111111tttffttttfLLLffttttffffttttf\\ntfffttttffttttt11ttttttti...............,;;;;;;;:...............:t111111tttffftttffffffftttttttffttf\\ntfffttttfffttft11ttttttt;...............,:;;;;:::...............,1t111111ttffttttffLLfLfttfffffffttf\\ntffft1ttttttttt11ttttttt:................,;;;;:::................it1111111ttt1tttffLLLLfttfffffffttf\\ntffft1tttttttt111ttttttt:................,:;;::::................:t1111tt111tttttffLLLLfttfffftffttf\\nttttt1tttttttt111111tt1t;.................,::::::................,1t111ttt11tftttfffffffttfffftffttt\\nttttt1tttt11tt111ttttttt:.,:;:............,::::::................,itt111t111ttt1tttttfft11tftttffttt\\nttttt1tttttttt11tttttttt;:;iii:............,:::::...........,:,....:1t11111tttt11tfffttt11ttttttfttt\\nttttt1tttttttt111ttttttt;;iiiii:. ..........:::::...........,;;;;:..it1111tft1111ttttttt11ttttttfttt\\n1111111tttttt1111ttttttt:;iiiii;............,::::,........,::;;iii;it111ttttt11111tt1ttt111ttttttt1t\\n111111111111111111111111:;;iiii;,...........,:,::,.........,;;iiii;it111111111111111111111111111tt11\\n111111111111111111111111;:;:;;;,............,::::,...........:;;ii;it1111111111111111111111111111111\\n111111111111111111111111;::.... .............,:::,,......... .,,:i1t1111111111111111111111111111111\\n111111111111111111111111i;,..................,,,:,,....... .;,..,;11111111111111111111111111111t1111\\n1111111111111111111111111i;:;i;,..............,,:,,,........1tii11t111111111111111111111111111111111\\n111111111111111111111111111111:..............,:::;;:,.......;ttttttttt11t1tt111111111111111111111111\\n11111111111111111111111111111;,..............:i;;ii;;:,.....,1ttt1tttttttt1ttttt1111111111tttttt1111\\n1111111111111111111111111111i,...............,i;;iiii;:......ittttttttttttttttttt11t11t1111ttttt1111\\n\",\n \"tttftttttttttttttttttfffttttt1t1ttttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt111tttt1\\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt1111ttfffffffLftttfffffttt1111tttt1\\nttttttttttttfffftttftttffffffffftttfttttt111ttt1ttfffffftttttt111tt11111ttffffLLffttfLLff111111ttttt\\nttttttttttffLLLLftttttfLLLftttttttffttttttttffft1ttfffffttfffft11tt11tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftffftttttfffffffffttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffLffftfftttttfftffffffftttffffffffffft111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftfftt11iii;:;;i1tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfLLLLLLLLLLfttfftfLffttfffLLft1;:::,,,,::;;1ttttttffffffftt1111ttt1ttt1ttfttt1ttffffLLLLLfttt\\nttfLLftfffLLLLLLLfftfLfftttfLfffLLLfti;,,,,:::::,,;fffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntfffffttttfLLfffttttfffffttLLLLffLLf1ii;;iiii11i:,;tfffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttfffLffLLf1iiiiiii1111;:;tffffftt1ttt111111tffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttfttffLfffLf111;;;ii;;i1i:itfffftttttffft11111tfttffftttttttttttttfLLfffftft\\nttffffffffftttffffffffttffftttftttttt1i;;;iii;iii;ifftft11tttttffft111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffftttttt111tffft11i;;;ii11111111tt111tffftttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\n1tfffffffffttfffffffftt1ttt1111fffft111i;;;iiiiiii11111ttfffft11111111tfft1tttttt1tfffffLfftttfLLLLL\\ntttttttttffttfftttttt1ttftt1111ttffttt1i;;;iiii;;;1t11ttttfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt1ttfffftttt11ttft1t1i;;iiiii;:;1t111tttffftt11t1111tftt1tt1tffftt1111ttfftfLffftt\\nttttfffftttt1ttttfft1tffffttfft11tft111i;;;;;ii;:;i11111ttttt1111t1111ttt11tt1tfffffttttttttttttffft\\n111tfffffftttffftttt11tfftttfttt1ttt1i1i;;;;iiiiii::;i111tt11111t11111tt111tft1fffffttfffftt1ttfLLLf\\n1t1ttfffft111tffttt1111tfttft11tti;::,i1;;;;;iii11:...,,::;i1tt1111111111t11tt1tfffttfffffffttfLLLLf\\ntttt1tftt1tt11ttt11ttt1111tt11i;,,....;1i;;;;;;i11:.,.......,,:i11t1111111111tttffttttffffftt1tffLLf\\ntffttttttttttt1111ttttt111i;:,........;1t1ii;;i1ii,.............;t1111111tttt11t1tfLftttfft1tt1tffft\\n1ttttttttttttt1111tttttt11:...........:iiiiii1tti,..............,1t11111tttttttttfLLLffttttffffttttf\\ntfffttttffttttt11ttttttt1i,.............,:::;;ii;,...............;t11111ttttfftttffffffftttttttffttf\\ntfffttttfffffft11ttttttt1;..............,:;;;;;;:,...............,1111111ttffttttffLLfLfttfffffffttf\\ntffftttttttttt111ttttttt1:.......... ....:;;;;;;:,................it111111tttttttffLLLLfttfffffffttf\\ntffft1tttttttt111ttttttt1,........,,:;:,.,;;;;;:;,................;t1111t111tttttffffLLfttfffffffttf\\nttttt1tttttttt1111t1tttt1,.......;;;;;:,..:;;::::,................,1t11ttt11tftttfffffffttfffftffttt\\nttttt1tttt11tt111ttttttt1:......;;;;;;;:,.:;;::::,................,it111t1111tt11ttttfft11tftttffttt\\nttttt1tttttttt11tttttttti,......:;:;;;:...,:;::::,.................:1t11111tt1t11tfffttt11ttttttfttt\\nttttt1tttttttt11tttttttti,......:;:;;:.....,:::::,..................:11111ttt1111ttttttt11ttttttfttt\\n1t1t111tttttt111111ttttt;...,,,.,:::. ......:::::,...................,111tttt11111ttttt1111ttttttt1t\\n111111111111111111111111,,,,,,,.............,:::::,..................,1t111111111111111111111111tt11\\n11111111111111111111111i,,..:,..............,,::::,,.................,11tt11111111111111111111111111\\n111111111111111111111111;...................,:,,::,,.................,;ii11t111111111111111111111111\\n111111111111111111111111i,..................,:::::,,................:::;;;i111t111111111111111111111\\n1111111111111111111111111i;;;;i1:............::,:,,,,........... ..::;;;;i1111111111111111111111111\\n111111111111111111111111111111t1,............,.,:,,,:,,........:,,..,:;;;i11t11111111111111111111111\\n1111111111111111111111111111111i.............,,::;;;i;:,...... :111i;::;;;1ttttt11t1111111tttttt1111\\n111111111111111111111111111111ti.............:1;;1iiii;:,.......i1tttt11111tt1tt111111t1111ttttt1111\\n\",\n \"tttttttttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt11111tffffffffftttfffffttt11111ttt1\\nttttttttttttfffftttffttffffffffftttfttttt111ttt1ttfffffftttttt11tt111111ttffffLLffttfLLff111111ttttt\\nttttttttttffLLLLftttttfLLLfttttttffffttttttfffft1tffffffttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfffttttttfffffftfttfftffffffffttt111tftt11t11tfLLLftt11tffft1tttttt\\ntttttttfLfLLLLLLLLffttfttttffLLfftffttttffffffffffftttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLLftffttttttt11i;ii1tftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfLLLLLLLLLLfttfftfffffffffLLfttt1i;::,,,,:;;1tttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\\nttfLLftfffLLLLLLLfftfLfftttfLfffLLLLttt1;,,,,,,,::,:iftt11tfffft11111tffft1tt11tt1ttttfffLLLLLLLLfff\\ntfffffttttfLLfffttttfffffttLLLLfLLLftt1i;;;;;;iiii:,;fftt11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttffLLffLLftt1;iiiii11111i::tfffft1ttt111111tffftfffftttttttt1ttfLLLLffffff\\nttfLffffffftttfffffffffttfttffLfffLftt1;i;;;iiiiiii;;tfftttttffft11111tfttffftttttttttttttfLLftfffft\\nttffffffffftttffffffffftffftttfttftttttii;;;;ii;;ii;iftt11tttttfft1111tt1tffttffttfffffLLfffffffffLL\\nttffffffffttttfffffffftttttt11ttfffttt11ii;;ii1111ii11111tffftttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\n1ttffffffffttfffffffftt1ttt111tffffttt1i1i;;;iiiiii1111ttfffft11t11111tfft1tttttt1ttffffLfftttfLLLLf\\ntttttttttffttfftttttt1ttfff1111ttffttttt1i;;;;i;:;it11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tfffftttt11tfftt11tt1;;;ii;;;1t111tttffftt11t1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttfffftttt1ttttfft1tffffttfftt1tft1111t1;;;;i;:;i11111tttft111tt1111ttt11tt1tfffffttttttttttttffft\\n1tttfffffftttffftfft11tfffttfttttttt11111i;;:;iiii1i;i1t1tt11111t11111tt111tft1fffffttfffftt1ttffLLf\\n1t1tffffft111tffttt1111tfttft11tt1t1i;;;1i;;;;ii1ii1,.,:;ii1tt11111111111t11tt1tfffttfffffffttfLfLLf\\ntfttttftt1tt11ttt11ttt11t1t11tt11i:,...,11;;;;;it111,,.....,:;i11tt1111111111tttffttttffffftt1tffLLf\\ntffttttttttttt1111ttftt111111i;:,......:1t1i;;;;i1t1,..........,:i1111111tttt11t1tfLftttfft1tt1tffft\\n1ttttttttttttt1111ttttt111tt;..........:1111iii1;11:.............,it1111tttttt1ttfLLLffttttffffttttf\\ntfffttttffttttt11ttttttt11t1,...........,,:::;;i;;:...............:t1111ttttfft1tffffffftttttttffttf\\ntfffttttfffffft11ttttttt111i..............:;:::;;::...............,1t1111ttffttttffLLfLfttfffffffttf\\ntfffttttttttttt11ttttttt111:..............,;;;;;;:,................;t11111ttt1t1tffLLLLfttfffffffttf\\ntffft1tttttttt111ttttttt11i,..........,::::;;;;;;:,................,1t11t111tttttffffLLfttfffffffttf\\nttttt1tttttttt111tt1tttt11i.........:;;;;:,;;::::::.................;t1ttt11tftttffffffftttffftffttt\\nttttt1tttt11tt111ttttttt111,.......;;;;;;:,:;::::::,................:tttt1111tt11ttfttft11tftttffttt\\nttttt1tttttttt11tttttttt11;,......,;;;;;;:::;::::::,................,itt111t11t11ttftttt11ttttttfttt\\nttttt1tttttttt11tttttttt11;,......:;;;;i;...,:::::,,.................:tt1tttt1111ttttttt11ttttttfttt\\n1t1t111tttttt111tttttttt1;,.,.....,:;:......,:::::,,..................it1tttt11111tttt11111ttttttt1t\\n1111111111111111111111111:,,,......,,. .....,,::::,,..................,1t11111111111111111111111tt11\\n1111111111111111111111111,,....,,...........,,,:::::,..................itt11111111111111111111111111\\n1111111111111111111111111;,.................,:::::::,,................:1tt11111111111111111111111111\\n11111111111111111111111111:.... ............,:::,:,,.................,1tt11111111111111111111111111\\n11111111111111111111111111ii;;;;;i, .........,,::,,,,,................,:;;1tt11111111111111111111111\\n11111111111111111111111111111111t1,..........,,,:,,:,:,,. ...........,:::;;i11tt11111111111111111111\\n11111111111111111111111111111111t;.............,:::;;;;:,........ .,:::;;:;i1t111111111ttttttt11111\\n111111111111111111111111111111111:...........,;;;i1iiii;:,.......::,,::::;;i1ttt111t11t1111ttttt1111\\n\",\n \"tttftttttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt11111111t\\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttftttttttttttttffffLffttfffffffLfffttttttttt111tfffffffftttttttt11111ttttttfffftfLLfttttttt111tttt1\\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt11111tfffffffffttffffffttt11111ttt1\\ntttttttttttffffftttffttffffffffftttfttttt111ttt1ttfffffftttttt11tt111111ttffffLLffttfLLfft11111ttttt\\nttttttttttffLLLLftttttfLLLfttttttffLftttttttffft1ttfffffttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffffftftttfffffffttt111tftt11t11tfLLfftt11tffft11ttttt\\ntttttttfffLLLLLLLLffttfttttfLLLfftffttttffftt1iii11tttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLffffftttttfti;;::,,,:;i1tffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttfffffLLLLLLLLLLfttfftfLfffffffLLfttttt1;,,,,,,,::,:ittffffffftt1111ttt1ttt1tftttt1ttffffLLLLLfttt\\nttfLLffffLLLLLLLLfftfLfftttfLfffLLLLfttt1i;:::;;iiii;,;t11tfffft11111tffft1tt1ttt1ttttfffLLLLLLLLfff\\ntffffftttffLLLffttttfffffttLLLLfLLLffttf1;;iiii11111i::1t11tttt1ttt11tfffttfftttttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttfffLffLLftttti:;;;;iiiiiii;;tftt1ttt111111tffftfffftttttttt1ttfLLLLffffff\\nttfLffffffftttfffffffffttfttffLfffLfttttti;;;;;iii;i1iiftttttffft11111tfttffftttttttttttttfLLftfffft\\nttffffffffftttffffffffftfffftffffftttttft11i;;;iiii1iiit11tttttfft1111tt11ffttffttfffffLLfffffffffLL\\nttffffffffttttfffffffftttttt1tttffftttttti1i;;;ii11iii111tffftttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\n1ttffffffffttfffffffftt1ttt1111tfffftttt111i;;iiiiii111ttfffft11t11111tfftttttttt1ttffffLfftttfLLLLf\\ntttttttttffttfftttttt1ttfftttt1ttfftttttt111i;i;:;ii11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tfffftttt11tfftt1ttt111;;i;;;iii1ttttffftt11t1111ttt11tt1tffttt1111ttfftfLffftt\\ntfttffffttt11tttttft1tffffttffttttft111ttt11;;;;:;i1i1;;11tft111tt1111tt111tt1tfffffttttt11tttttffft\\n1tttfffffftttffftfft11tfftttffttttft1111iii1;;;i;iiii1i,,,:;;i11tt1111tt111tft1fffffttfffftt11tffLLf\\n111ttfffftt1ttffttt1111tfttft11tt1t1i;:,,,;1i;;i1ii;iti,,.....,:;i1t11111t11tt1tfffttffffffft1fffLLf\\ntfttttftt1tt11tft11ttt11tttt1tt11i;:,.....;11i;i1i;1tt;,,.........,:i11111111t1tffttttffffftt1tfffLf\\ntffttttttttftt1111ttttt11111tft;,.........;11111i1ttti,.............,1111tttt1111tffftttfft1tt1tffft\\n1ttttttttttttt1111tttttt11tfff1,...........,:;;;;;11i:...............itttttttt1ttfffLffttttffffttttf\\ntfffttttffttttt11ttttttt11tfffi............ ,:;;;;;;;,...............;t1ttttfft1tffffffftttttttffttf\\ntfffttttfffffft11tttttttttt1tf;..............:;;;;;;;,...............:111ttttttttfffLfLfttfffffffttf\\ntfffttttftftft111ttttttt11t111:..............:;;;;;::,...............,1t11ttt1t1tffLLLLfttfffffffttf\\ntfffttttfttttt111ttttttt11ttt1:..............,;;;::;::................itt111tttttffffLLfttfffffffttf\\ntttttttttttttt111ttttttt1ttfft:..............,;;;;::::................:1tt11tft1tffffffftttffttffttt\\nttttt1tttt11tt11tttttttt1tttt1;.,::,..........:;:::;::,...............,1t1111tt11tttttft11tfttttfttt\\nttttt1tttttttt11ttttttttt1ttt1;,:;;:..........,::::::,,................it11111111ttftttt11ttttttfttt\\nttttt1tttttttt11tttttttttttttiiiiii;,.........,:::::::,................:ttttt1111ttttttt11ttttttfttt\\n1t1111tttttttt11tttttttt1ttt1;;;;ii;,.........,:::::::,.................ittttt1111tttt11111ttttttt1t\\n11111111111111111111111111tt1;;;;ii;...........::::::::................ :1t111111111111111111111t111\\n11111111111111111111111111tt1;::;;i:...........,:::::::,...............,itttt11111111111111111111111\\n11111111111111111111111tttttt;,,,::............,::::::,,...............ittttt11111111111111111111111\\n1111111111111111111111111tttt1:,,..............,:::::,,,,.......,:;::,:1t1111111111111111111111t1111\\n11111111111111111111111111111111i;;i:..........,:,,,.,,.,.......::;;i;it1ttt111111111111111111111111\\n1111111111111111111111111111111111ti...........,,.,:,:;::,......,:;;ii1ttttt11111111111111111t111111\\n1111111111111111111111111111111111t;...........,;iiiiiii;:,......:;;;i1ttttt111t1111111111tttttt1111\\n11111111111111111111111111111111111:...........,;i11iiii;:,.......,:i1tttttt1ttttt1t11t1111ttttt1111\\n\",\n];\n\nfunction isApr1(): boolean {\n const d = new Date();\n // Months are 0 indexed\n return d.getMonth() === 3 && d.getDate() === 1;\n}\n\nexport const Apr1Events = new EventEmitter();\n\nexport function Apr1(): React.ReactElement {\n const [open, setOpen] = useState(isApr1());\n const [n, setN] = useState(0);\n\n useEffect(() => {\n const id = setInterval(() => setN((n) => (n + 1) % frames.length), 100);\n return () => clearInterval(id);\n }, []);\n\n useEffect(\n () =>\n Apr1Events.subscribe(() => {\n setOpen(true);\n }),\n [],\n );\n\n if (!open) return <></>;\n\n return (\n <Modal open={open} onClose={() => setOpen(false)}>\n <pre style={{ color: \"#0f0\" }}>{frames[n]}</pre>\n <div style={{ display: \"none\" }}>\n <iframe\n width=\"560\"\n height=\"315\"\n src=\"https://www.youtube.com/embed/a3Z7zEc7AXQ?autoplay=1\"\n title=\"YouTube video player\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n ></iframe>\n </div>\n </Modal>\n );\n}\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 onClick={() => props.onTravel(props.city)} className={classes.travel}>\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\";\nimport { Player } from \"../../Player\";\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, Player);\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(\n window.setTimeout(() => {\n setContent((content) => replace(content, index, letter));\n }, 500),\n );\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 { 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 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 Player.getHomeComputer().pushProgram(item.program);\n // Cancel if the program is in progress of writing\n if (Player.createProgramName === item.program) {\n Player.isWorking = false;\n Player.resetWorkStatus();\n }\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(\n \"Not enough money to purchase remaining programs, \" + numeralWrapper.formatMoney(cost) + \" required\",\n );\n return;\n }\n\n for (const item of itemsToBuy) {\n buyDarkwebItem(item.program);\n }\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 { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { calculateSkill } from \"../../PersonObjects/formulas/skill\";\n\nfunction calculateRawDiff(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\nexport function calculateDifficulty(player: IPlayer, startingSecurityLevel: number): number {\n const totalStats = player.strength + player.defense + player.dexterity + player.agility + player.charisma;\n return calculateRawDiff(player, totalStats, startingSecurityLevel);\n}\n\nexport function calculateReward(player: IPlayer, startingSecurityLevel: 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 calculateRawDiff(player, total, startingSecurityLevel);\n}\n","import { sum } from \"lodash\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { CONSTANTS } from \"../../Constants\";\n\nexport interface IConstructorParams {\n augmentation: Augmentation;\n readonly cost: number;\n readonly time: number;\n}\n\nexport class GraftableAugmentation {\n // The augmentation that this craftable corresponds to\n augmentation: Augmentation;\n\n constructor(augmentation: Augmentation) {\n this.augmentation = augmentation;\n }\n\n get cost(): number {\n return this.augmentation.baseCost * CONSTANTS.AugmentationGraftingCostMult;\n }\n\n get time(): number {\n // Time = 1 hour * log_2(sum(aug multipliers) || 1) + 30 minutes\n const antiLog = Math.max(sum(Object.values(this.augmentation.mults)), 1);\n\n const mult = Math.log2(antiLog);\n return (CONSTANTS.AugmentationGraftingTimeBase * mult + CONSTANTS.MillisecondsPerHalfHour) / 2;\n }\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Reputation } from \"./Reputation\";\n\nexport function ReputationRate({ reputation }: { reputation: number }): React.ReactElement {\n return <Reputation reputation={`${numeralWrapper.formatReputation(reputation)} / sec`} />;\n}\n","import { KEY } from \"../utils/helpers/keyCodes\";\nimport { 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 === KEY.DOUBLE_QUOTE) {\n // Double quotes\n if (!escaped && prevChar === KEY.SPACE) {\n const endQuote = command.indexOf(KEY.DOUBLE_QUOTE, i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === KEY.SPACE)) {\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 (inQuote === ``) {\n inQuote = KEY.DOUBLE_QUOTE;\n } else if (inQuote === KEY.DOUBLE_QUOTE) {\n inQuote = ``;\n }\n } else if (c === KEY.QUOTE) {\n // Single quotes, same thing as above\n if (!escaped && prevChar === KEY.SPACE) {\n const endQuote = command.indexOf(KEY.QUOTE, i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === KEY.SPACE)) {\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 (inQuote === ``) {\n inQuote = KEY.QUOTE;\n } else if (inQuote === KEY.QUOTE) {\n inQuote = ``;\n }\n } else if (c === KEY.SPACE && 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","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","/**\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\";\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[] = [\n { type: \"misc\", name: \"baseCost\", cost: RamCostConstants.ScriptBaseRamCost },\n ];\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.infiltration) {\n func = workerScript.env.vars.infiltration[ref];\n refDetail = `infiltration.${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 if (ref in workerScript.env.vars.grafting) {\n func = workerScript.env.vars.grafting[ref];\n refDetail = `grafting.${ref}`;\n } else if (ref in workerScript.env.vars.singularity) {\n func = workerScript.env.vars.singularity[ref];\n refDetail = `singularity.${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","/**\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 { 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 $ from \"jquery\";\nimport { 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 numCycleForGrowthCorrected,\n processSingleServerGrowth,\n safetlyCreateUniqueServer,\n} from \"./Server/ServerHelpers\";\nimport { getPurchaseServerCost, getPurchaseServerLimit, getPurchaseServerMaxRam } from \"./Server/ServerPurchases\";\nimport { Server } from \"./Server/Server\";\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, LogBoxCloserEvents } 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 { NetscriptInfiltration } from \"./NetscriptFunctions/Infiltration\";\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 { NetscriptGrafting } from \"./NetscriptFunctions/Grafting\";\nimport { IPort } from \"./NetscriptPort\";\n\nimport {\n NS as INS,\n Singularity as ISingularity,\n Player as INetscriptPlayer,\n Gang as IGang,\n Bladeburner as IBladeburner,\n Stanek as IStanek,\n Sleeve as ISleeve,\n Infiltration as IInfiltration,\n RunningScript as IRunningScript,\n RecentScript as IRecentScript,\n SourceFileLvl,\n BasicHGWOptions,\n ProcessInfo,\n HackingMultipliers,\n HacknetMultipliers,\n BitNodeMultipliers as IBNMults,\n Server as IServerDef,\n RunningScript as IRunningScriptDef,\n Grafting as IGrafting,\n UserInterface as IUserInterface,\n TIX as ITIX,\n Corporation as ICorporation,\n CodingContract as ICodingContract,\n Hacknet as IHacknet,\n // ToastVariant,\n} from \"./ScriptEditor/NetscriptDefinitions\";\nimport { NetscriptSingularity } from \"./NetscriptFunctions/Singularity\";\n\nimport { toNative } from \"./NetscriptFunctions/toNative\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\nimport { checkEnum } from \"./utils/helpers/checkEnum\";\n\nimport { Flags } from \"./NetscriptFunctions/Flags\";\nimport { calculateIntelligenceBonus } from \"./PersonObjects/formulas/intelligence\";\nimport { CalculateShareMult, StartSharing } from \"./NetworkShare/Share\";\nimport { recentScripts } from \"./Netscript/RecentScripts\";\nimport { CityName } from \"./Locations/data/CityNames\";\nimport { wrapAPI } from \"./Netscript/APIWrapper\";\n\ninterface NS extends INS {\n [key: string]: any;\n gang: IGang;\n bladeburner: IBladeburner;\n stanek: IStanek;\n infiltration: IInfiltration;\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 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: ${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: string,\n hostname: string,\n callingFnName: string,\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: number, callingFnName: string): 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 * Sanitizes a `RunningScript` to remove sensitive information, making it suitable for\n * return through an NS function.\n * @see NS.getRecentScripts\n * @see NS.getRunningScript\n * @param runningScript Existing, internal RunningScript\n * @returns A sanitized, NS-facing copy of the RunningScript\n */\n const createPublicRunningScript = function (runningScript: RunningScript): IRunningScript {\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\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: string, hostname: string, 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: BaseServer, callingFn = \"\"): 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 = async function (\n hostname: string,\n manual: boolean,\n { threads: requestedThreads, stock }: any = {},\n ): 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: unknown): 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: unknown): number => {\n if (typeof v === \"string\") {\n const x = parseFloat(v);\n if (!isNaN(x)) return x; // otherwise it wasn't even a string representing a number.\n } else if (typeof v === \"number\") {\n if (isNaN(v)) throw makeRuntimeErrorMsg(funcName, `${argName} is NaN.`);\n return v;\n }\n throw makeRuntimeErrorMsg(funcName, `${argName} should be a number.`);\n },\n boolean: (v: unknown): boolean => {\n return !!v; // Just convert it to boolean.\n },\n city: (funcName: string, argName: string, v: unknown): CityName => {\n if (typeof v !== \"string\") throw makeRuntimeErrorMsg(funcName, `${argName} should be a city name.`);\n const s = v as CityName;\n if (!Object.values(CityName).includes(s))\n throw makeRuntimeErrorMsg(funcName, `${argName} should be a city name.`);\n return s;\n },\n getServer: safeGetServer,\n checkSingularityAccess: checkSingularityAccess,\n hack: hack,\n getValidPort: (funcName: string, port: number): 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 extra = NetscriptExtra(Player, workerScript, helper);\n const formulas = NetscriptFormulas(Player, workerScript, helper);\n\n const gang = wrapAPI(helper, {}, workerScript, NetscriptGang(Player, workerScript), \"gang\").gang as unknown as IGang;\n const sleeve = wrapAPI(helper, {}, workerScript, NetscriptSleeve(Player), \"sleeve\").sleeve as unknown as ISleeve;\n const hacknet = wrapAPI(helper, {}, workerScript, NetscriptHacknet(Player, workerScript), \"hacknet\")\n .hacknet as unknown as IHacknet;\n const bladeburner = wrapAPI(helper, {}, workerScript, NetscriptBladeburner(Player, workerScript), \"bladeburner\")\n .bladeburner as unknown as IBladeburner;\n const codingcontract = wrapAPI(\n helper,\n {},\n workerScript,\n NetscriptCodingContract(Player, workerScript),\n \"codingcontract\",\n ).codingcontract as unknown as ICodingContract;\n const infiltration = wrapAPI(helper, {}, workerScript, NetscriptInfiltration(Player), \"infiltration\")\n .infiltration as unknown as IInfiltration;\n const stanek = wrapAPI(helper, {}, workerScript, NetscriptStanek(Player, workerScript, helper), \"stanek\")\n .stanek as unknown as IStanek;\n const corporation = wrapAPI(helper, {}, workerScript, NetscriptCorporation(Player, workerScript), \"corporation\")\n .corporation as unknown as ICorporation;\n const singularity = wrapAPI(helper, {}, workerScript, NetscriptSingularity(Player, workerScript), \"singularity\")\n .singularity as unknown as ISingularity;\n const stockmarket = wrapAPI(helper, {}, workerScript, NetscriptStockMarket(Player, workerScript), \"stock\")\n .stock as unknown as ITIX;\n const ui = wrapAPI(helper, {}, workerScript, NetscriptUserInterface(), \"ui\").ui as unknown as IUserInterface;\n const grafting = wrapAPI(helper, {}, workerScript, NetscriptGrafting(Player), \"grafting\")\n .grafting as unknown as IGrafting;\n\n const base: INS = {\n ...singularity,\n\n singularity: singularity,\n gang: gang,\n bladeburner: bladeburner,\n codingcontract: codingcontract,\n sleeve: sleeve,\n corporation: corporation,\n stanek: stanek,\n infiltration: infiltration,\n ui: ui,\n formulas: formulas,\n stock: stockmarket,\n grafting: grafting,\n args: workerScript.args,\n hacknet: hacknet,\n sprintf: sprintf,\n vsprintf: vsprintf,\n scan: function (_hostname: unknown = workerScript.hostname): string[] {\n updateDynamicRam(\"scan\", getRamCost(Player, \"scan\"));\n const hostname = helper.string(\"scan\", \"hostname\", _hostname);\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: unknown, { threads: requestedThreads, stock }: BasicHGWOptions = {}): Promise<number> {\n updateDynamicRam(\"hack\", getRamCost(Player, \"hack\"));\n const hostname = helper.string(\"hack\", \"hostname\", _hostname);\n return hack(hostname, false, { threads: requestedThreads, stock: stock });\n },\n hackAnalyzeThreads: function (_hostname: unknown, _hackAmount: unknown): number {\n updateDynamicRam(\"hackAnalyzeThreads\", getRamCost(Player, \"hackAnalyzeThreads\"));\n const hostname = helper.string(\"hackAnalyzeThreads\", \"hostname\", _hostname);\n const hackAmount = helper.number(\"hackAnalyzeThreads\", \"hackAmount\", _hackAmount);\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 if (percentHacked === 0 || server.moneyAvailable === 0) {\n return 0; // To prevent returning infinity below\n }\n\n return hackAmount / Math.floor(server.moneyAvailable * percentHacked);\n },\n hackAnalyze: function (_hostname: unknown): number {\n updateDynamicRam(\"hackAnalyze\", getRamCost(Player, \"hackAnalyze\"));\n const hostname = helper.string(\"hackAnalyze\", \"hostname\", _hostname);\n\n const server = safeGetServer(hostname, \"hackAnalyze\");\n if (!(server instanceof Server)) {\n workerScript.log(\"hackAnalyze\", () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n return calculatePercentMoneyHacked(server, Player);\n },\n hackAnalyzeSecurity: function (_threads: unknown, _hostname?: unknown): number {\n updateDynamicRam(\"hackAnalyzeSecurity\", getRamCost(Player, \"hackAnalyzeSecurity\"));\n let threads = helper.number(\"hackAnalyzeSecurity\", \"threads\", _threads);\n if (_hostname) {\n const hostname = helper.string(\"hackAnalyzeSecurity\", \"hostname\", _hostname);\n const server = safeGetServer(hostname, \"hackAnalyze\");\n if (!(server instanceof Server)) {\n workerScript.log(\"hackAnalyzeSecurity\", () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n\n if (percentHacked > 0) {\n // thread count is limited to the maximum number of threads needed\n threads = Math.min(threads, Math.ceil(1 / percentHacked));\n }\n }\n\n return CONSTANTS.ServerFortifyAmount * threads;\n },\n hackAnalyzeChance: function (_hostname: unknown): number {\n updateDynamicRam(\"hackAnalyzeChance\", getRamCost(Player, \"hackAnalyzeChance\"));\n const hostname = helper.string(\"hackAnalyzeChance\", \"hostname\", _hostname);\n\n const server = safeGetServer(hostname, \"hackAnalyzeChance\");\n if (!(server instanceof Server)) {\n workerScript.log(\"hackAnalyzeChance\", () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n return calculateHackingChance(server, Player);\n },\n sleep: async function (_time: unknown = 0): Promise<true> {\n updateDynamicRam(\"sleep\", getRamCost(Player, \"sleep\"));\n const time = helper.number(\"sleep\", \"time\", _time);\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: unknown = 0): Promise<true> {\n updateDynamicRam(\"asleep\", getRamCost(Player, \"asleep\"));\n const time = helper.number(\"asleep\", \"time\", _time);\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(true), time));\n },\n grow: async function (\n _hostname: unknown,\n { threads: requestedThreads, stock }: BasicHGWOptions = {},\n ): Promise<number> {\n updateDynamicRam(\"grow\", getRamCost(Player, \"grow\"));\n const hostname = helper.string(\"grow\", \"hostname\", _hostname);\n const threads = resolveNetscriptRequestedThreads(\n workerScript,\n \"grow\",\n requestedThreads ?? workerScript.scriptRef.threads,\n );\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 Promise.resolve(0);\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: unknown, _growth: unknown, _cores: unknown = 1): number {\n updateDynamicRam(\"growthAnalyze\", getRamCost(Player, \"growthAnalyze\"));\n const hostname = helper.string(\"growthAnalyze\", \"hostname\", _hostname);\n const growth = helper.number(\"growthAnalyze\", \"growth\", _growth);\n const cores = helper.number(\"growthAnalyze\", \"cores\", _cores);\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 0;\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: unknown, _hostname?: unknown, _cores?: unknown): number {\n updateDynamicRam(\"growthAnalyzeSecurity\", getRamCost(Player, \"growthAnalyzeSecurity\"));\n let threads = helper.number(\"growthAnalyzeSecurity\", \"threads\", _threads);\n if (_hostname) {\n const cores = helper.number(\"growthAnalyzeSecurity\", \"cores\", _cores) || 1;\n const hostname = helper.string(\"growthAnalyzeSecurity\", \"hostname\", _hostname);\n const server = safeGetServer(hostname, \"growthAnalyzeSecurity\");\n\n if (!(server instanceof Server)) {\n workerScript.log(\"growthAnalyzeSecurity\", () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n const maxThreadsNeeded = Math.ceil(\n numCycleForGrowthCorrected(server, server.moneyMax, server.moneyAvailable, Player, cores),\n );\n\n threads = Math.min(threads, maxThreadsNeeded);\n }\n\n return 2 * CONSTANTS.ServerFortifyAmount * threads;\n },\n weaken: async function (_hostname: unknown, { threads: requestedThreads }: BasicHGWOptions = {}): Promise<number> {\n updateDynamicRam(\"weaken\", getRamCost(Player, \"weaken\"));\n const hostname = helper.string(\"weaken\", \"hostname\", _hostname);\n const threads = resolveNetscriptRequestedThreads(\n workerScript,\n \"weaken\",\n requestedThreads ?? workerScript.scriptRef.threads,\n );\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 Promise.resolve(0);\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: unknown, _cores: unknown = 1): number {\n updateDynamicRam(\"weakenAnalyze\", getRamCost(Player, \"weakenAnalyze\"));\n const threads = helper.number(\"weakenAnalyze\", \"threads\", _threads);\n const cores = helper.number(\"weakenAnalyze\", \"cores\", _cores);\n const coreBonus = 1 + (cores - 1) / 16;\n return CONSTANTS.ServerWeakenAmount * threads * coreBonus * BitNodeMultipliers.ServerWeakenRate;\n },\n share: async function (): Promise<void> {\n updateDynamicRam(\"share\", getRamCost(Player, \"share\"));\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 updateDynamicRam(\"getSharePower\", getRamCost(Player, \"getSharePower\"));\n return CalculateShareMult();\n },\n print: function (...args: any[]): void {\n updateDynamicRam(\"print\", getRamCost(Player, \"print\"));\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: unknown, ...args: any[]): void {\n updateDynamicRam(\"printf\", getRamCost(Player, \"printf\"));\n const format = helper.string(\"printf\", \"format\", _format);\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 updateDynamicRam(\"tprint\", getRamCost(Player, \"tprint\"));\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: unknown, ...args: any[]): void {\n updateDynamicRam(\"tprintf\", getRamCost(Player, \"tprintf\"));\n const format = helper.string(\"printf\", \"format\", _format);\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 (): void {\n updateDynamicRam(\"clearLog\", getRamCost(Player, \"clearLog\"));\n workerScript.scriptRef.clearLog();\n },\n disableLog: function (_fn: unknown): void {\n updateDynamicRam(\"disableLog\", getRamCost(Player, \"disableLog\"));\n const fn = helper.string(\"disableLog\", \"fn\", _fn);\n if (fn === \"ALL\") {\n for (const 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: unknown): void {\n updateDynamicRam(\"enableLog\", getRamCost(Player, \"enableLog\"));\n const fn = helper.string(\"enableLog\", \"fn\", _fn);\n if (fn === \"ALL\") {\n for (const 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: unknown): boolean {\n updateDynamicRam(\"isLogEnabled\", getRamCost(Player, \"isLogEnabled\"));\n const fn = helper.string(\"isLogEnabled\", \"fn\", _fn);\n if (possibleLogs[fn] === undefined) {\n throw makeRuntimeErrorMsg(\"isLogEnabled\", `Invalid argument: ${fn}.`);\n }\n return !workerScript.disableLogs[fn];\n },\n getScriptLogs: function (fn: any, hostname: any, ...scriptArgs: any[]): string[] {\n updateDynamicRam(\"getScriptLogs\", getRamCost(Player, \"getScriptLogs\"));\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[]): void {\n updateDynamicRam(\"tail\", getRamCost(Player, \"tail\"));\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 closeTail: function (_pid: unknown = workerScript.scriptRef.pid): void {\n updateDynamicRam(\"closeTail\", getRamCost(Player, \"closeTail\"));\n const pid = helper.number(\"closeTail\", \"pid\", _pid);\n //Emit an event to tell the game to close the tail window if it exists\n LogBoxCloserEvents.emit(pid);\n },\n nuke: function (_hostname: unknown): boolean {\n updateDynamicRam(\"nuke\", getRamCost(Player, \"nuke\"));\n const hostname = helper.string(\"tail\", \"hostname\", _hostname);\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: unknown): boolean {\n updateDynamicRam(\"brutessh\", getRamCost(Player, \"brutessh\"));\n const hostname = helper.string(\"brutessh\", \"hostname\", _hostname);\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: unknown): boolean {\n updateDynamicRam(\"ftpcrack\", getRamCost(Player, \"ftpcrack\"));\n const hostname = helper.string(\"ftpcrack\", \"hostname\", _hostname);\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: unknown): boolean {\n updateDynamicRam(\"relaysmtp\", getRamCost(Player, \"relaysmtp\"));\n const hostname = helper.string(\"relaysmtp\", \"hostname\", _hostname);\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: unknown): boolean {\n updateDynamicRam(\"httpworm\", getRamCost(Player, \"httpworm\"));\n const hostname = helper.string(\"httpworm\", \"hostname\", _hostname);\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: unknown): boolean {\n updateDynamicRam(\"sqlinject\", getRamCost(Player, \"sqlinject\"));\n const hostname = helper.string(\"sqlinject\", \"hostname\", _hostname);\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: unknown, _threads: unknown = 1, ...args: any[]): number {\n updateDynamicRam(\"run\", getRamCost(Player, \"run\"));\n const scriptname = helper.string(\"run\", \"scriptname\", _scriptname);\n const threads = helper.number(\"run\", \"threads\", _threads);\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: unknown, _hostname: unknown, _threads: unknown = 1, ...args: any[]): number {\n updateDynamicRam(\"exec\", getRamCost(Player, \"exec\"));\n const scriptname = helper.string(\"exec\", \"scriptname\", _scriptname);\n const hostname = helper.string(\"exec\", \"hostname\", _hostname);\n const threads = helper.number(\"exec\", \"threads\", _threads);\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: unknown, _threads: unknown = 1, ...args: any[]): void {\n updateDynamicRam(\"spawn\", getRamCost(Player, \"spawn\"));\n const scriptname = helper.string(\"spawn\", \"scriptname\", _scriptname);\n const threads = helper.number(\"spawn\", \"threads\", _threads);\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[]): boolean {\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: unknown = workerScript.hostname, _safetyguard: unknown = true): boolean {\n updateDynamicRam(\"killall\", getRamCost(Player, \"killall\"));\n const hostname = helper.string(\"killall\", \"hostname\", _hostname);\n const safetyguard = helper.boolean(_safetyguard);\n if (hostname === undefined) {\n throw makeRuntimeErrorMsg(\"killall\", \"Usage: killall(hostname, [safetyguard boolean])\");\n }\n const server = safeGetServer(hostname, \"killall\");\n\n let scriptsKilled = 0;\n\n for (let i = server.runningScripts.length - 1; i >= 0; --i) {\n if (safetyguard === true && server.runningScripts[i].pid == workerScript.pid) continue;\n killWorkerScript(server.runningScripts[i], server.hostname, false);\n ++scriptsKilled;\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 scriptsKilled > 0;\n },\n exit: function (): void {\n updateDynamicRam(\"exit\", getRamCost(Player, \"exit\"));\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: unknown, hostname2?: any): Promise<boolean> {\n updateDynamicRam(\"scp\", getRamCost(Player, \"scp\"));\n const hostname1 = helper.string(\"scp\", \"hostname1\", _hostname1);\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 scripts, .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: unknown, _grep: unknown = \"\"): string[] {\n updateDynamicRam(\"ls\", getRamCost(Player, \"ls\"));\n const hostname = helper.string(\"ls\", \"hostname\", _hostname);\n const grep = helper.string(\"ls\", \"grep\", _grep);\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 getRecentScripts: function (): IRecentScript[] {\n updateDynamicRam(\"getRecentScripts\", getRamCost(Player, \"getRecentScripts\"));\n return recentScripts.map((rs) => ({\n timeOfDeath: rs.timeOfDeath,\n ...createPublicRunningScript(rs.runningScript),\n }));\n },\n ps: function (_hostname: unknown = workerScript.hostname): ProcessInfo[] {\n updateDynamicRam(\"ps\", getRamCost(Player, \"ps\"));\n const hostname = helper.string(\"ps\", \"hostname\", _hostname);\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: unknown): boolean {\n updateDynamicRam(\"hasRootAccess\", getRamCost(Player, \"hasRootAccess\"));\n const hostname = helper.string(\"hasRootAccess\", \"hostname\", _hostname);\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 (): string {\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 (): number {\n updateDynamicRam(\"getHackingLevel\", getRamCost(Player, \"getHackingLevel\"));\n Player.updateSkillLevels();\n workerScript.log(\"getHackingLevel\", () => `returned ${Player.hacking}`);\n return Player.hacking;\n },\n getHackingMultipliers: function (): HackingMultipliers {\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 (): HacknetMultipliers {\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 (): IBNMults {\n updateDynamicRam(\"getBitNodeMultipliers\", getRamCost(Player, \"getBitNodeMultipliers\"));\n if (Player.sourceFileLvl(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: unknown = workerScript.hostname): IServerDef {\n updateDynamicRam(\"getServer\", getRamCost(Player, \"getServer\"));\n const hostname = helper.string(\"getServer\", \"hostname\", _hostname);\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: unknown): number {\n updateDynamicRam(\"getServerMoneyAvailable\", getRamCost(Player, \"getServerMoneyAvailable\"));\n const hostname = helper.string(\"getServerMoneyAvailable\", \"hostname\", _hostname);\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: unknown): number {\n updateDynamicRam(\"getServerSecurityLevel\", getRamCost(Player, \"getServerSecurityLevel\"));\n const hostname = helper.string(\"getServerSecurityLevel\", \"hostname\", _hostname);\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: unknown): number {\n updateDynamicRam(\"getServerBaseSecurityLevel\", getRamCost(Player, \"getServerBaseSecurityLevel\"));\n const hostname = helper.string(\"getServerBaseSecurityLevel\", \"hostname\", _hostname);\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: unknown): number {\n updateDynamicRam(\"getServerMinSecurityLevel\", getRamCost(Player, \"getServerMinSecurityLevel\"));\n const hostname = helper.string(\"getServerMinSecurityLevel\", \"hostname\", _hostname);\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: unknown): number {\n updateDynamicRam(\"getServerRequiredHackingLevel\", getRamCost(Player, \"getServerRequiredHackingLevel\"));\n const hostname = helper.string(\"getServerRequiredHackingLevel\", \"hostname\", _hostname);\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: unknown): number {\n updateDynamicRam(\"getServerMaxMoney\", getRamCost(Player, \"getServerMaxMoney\"));\n const hostname = helper.string(\"getServerMaxMoney\", \"hostname\", _hostname);\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: unknown): number {\n updateDynamicRam(\"getServerGrowth\", getRamCost(Player, \"getServerGrowth\"));\n const hostname = helper.string(\"getServerGrowth\", \"hostname\", _hostname);\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: unknown): number {\n updateDynamicRam(\"getServerNumPortsRequired\", getRamCost(Player, \"getServerNumPortsRequired\"));\n const hostname = helper.string(\"getServerNumPortsRequired\", \"hostname\", _hostname);\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: unknown): [number, number] {\n updateDynamicRam(\"getServerRam\", getRamCost(Player, \"getServerRam\"));\n const hostname = helper.string(\"getServerRam\", \"hostname\", _hostname);\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: unknown): number {\n updateDynamicRam(\"getServerMaxRam\", getRamCost(Player, \"getServerMaxRam\"));\n const hostname = helper.string(\"getServerMaxRam\", \"hostname\", _hostname);\n const server = safeGetServer(hostname, \"getServerMaxRam\");\n workerScript.log(\"getServerMaxRam\", () => `returned ${numeralWrapper.formatRAM(server.maxRam)}`);\n return server.maxRam;\n },\n getServerUsedRam: function (_hostname: unknown): number {\n updateDynamicRam(\"getServerUsedRam\", getRamCost(Player, \"getServerUsedRam\"));\n const hostname = helper.string(\"getServerUsedRam\", \"hostname\", _hostname);\n const server = safeGetServer(hostname, \"getServerUsedRam\");\n workerScript.log(\"getServerUsedRam\", () => `returned ${numeralWrapper.formatRAM(server.ramUsed)}`);\n return server.ramUsed;\n },\n serverExists: function (_hostname: unknown): boolean {\n updateDynamicRam(\"serverExists\", getRamCost(Player, \"serverExists\"));\n const hostname = helper.string(\"serverExists\", \"hostname\", _hostname);\n return GetServer(hostname) !== null;\n },\n fileExists: function (_filename: unknown, _hostname: unknown = workerScript.hostname): boolean {\n updateDynamicRam(\"fileExists\", getRamCost(Player, \"fileExists\"));\n const filename = helper.string(\"fileExists\", \"filename\", _filename);\n const hostname = helper.string(\"fileExists\", \"hostname\", _hostname);\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 return txtFile != null;\n },\n isRunning: function (fn: any, hostname: any = workerScript.hostname, ...scriptArgs: any[]): boolean {\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 (): number {\n updateDynamicRam(\"getPurchasedServerLimit\", getRamCost(Player, \"getPurchasedServerLimit\"));\n\n return getPurchaseServerLimit();\n },\n getPurchasedServerMaxRam: function (): number {\n updateDynamicRam(\"getPurchasedServerMaxRam\", getRamCost(Player, \"getPurchasedServerMaxRam\"));\n\n return getPurchaseServerMaxRam();\n },\n getPurchasedServerCost: function (_ram: unknown): number {\n updateDynamicRam(\"getPurchasedServerCost\", getRamCost(Player, \"getPurchasedServerCost\"));\n const ram = helper.number(\"getPurchasedServerCost\", \"ram\", _ram);\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 (_name: unknown, _ram: unknown): string {\n updateDynamicRam(\"purchaseServer\", getRamCost(Player, \"purchaseServer\"));\n const name = helper.string(\"purchaseServer\", \"name\", _name);\n const ram = helper.number(\"purchaseServer\", \"ram\", _ram);\n if (arguments.length !== 2) throw makeRuntimeErrorMsg(\"purchaseServer\", \"Takes 2 arguments\");\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(\n \"purchaseServer\",\n () => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`,\n );\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: unknown): boolean {\n updateDynamicRam(\"deleteServer\", getRamCost(Player, \"deleteServer\"));\n const name = helper.string(\"purchaseServer\", \"name\", _name);\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 (): string[] {\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: unknown, data: any = \"\"): Promise<any> {\n updateDynamicRam(\"writePort\", getRamCost(Player, \"writePort\"));\n const port = helper.number(\"writePort\", \"port\", _port);\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: unknown, data: any = \"\", _mode: unknown = \"a\"): Promise<void> {\n updateDynamicRam(\"write\", getRamCost(Player, \"write\"));\n const port = helper.string(\"write\", \"port\", _port);\n const mode = helper.string(\"write\", \"mode\", _mode);\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: unknown, data: any = \"\"): Promise<any> {\n updateDynamicRam(\"tryWritePort\", getRamCost(Player, \"tryWritePort\"));\n let port = helper.number(\"tryWritePort\", \"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw makeRuntimeErrorMsg(\n \"tryWritePort\",\n `Trying to write invalid data to a port: only strings and numbers are valid.`,\n );\n }\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: unknown): any {\n updateDynamicRam(\"readPort\", getRamCost(Player, \"readPort\"));\n const port = helper.number(\"readPort\", \"port\", _port);\n // Read from port\n const iport = helper.getValidPort(\"readPort\", port);\n const x = iport.read();\n return x;\n },\n read: function (_port: unknown): string {\n updateDynamicRam(\"read\", getRamCost(Player, \"read\"));\n const port = helper.string(\"read\", \"port\", _port);\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: unknown): any {\n updateDynamicRam(\"peek\", getRamCost(Player, \"peek\"));\n const port = helper.number(\"peek\", \"port\", _port);\n const iport = helper.getValidPort(\"peek\", port);\n const x = iport.peek();\n return x;\n },\n clear: function (_file: unknown): void {\n updateDynamicRam(\"clear\", getRamCost(Player, \"clear\"));\n const file = helper.string(\"peek\", \"file\", _file);\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 },\n clearPort: function (_port: unknown): void {\n updateDynamicRam(\"clearPort\", getRamCost(Player, \"clearPort\"));\n const port = helper.number(\"clearPort\", \"port\", _port);\n // Clear port\n const iport = helper.getValidPort(\"clearPort\", port);\n iport.clear();\n },\n getPortHandle: function (_port: unknown): IPort {\n updateDynamicRam(\"getPortHandle\", getRamCost(Player, \"getPortHandle\"));\n const port = helper.number(\"getPortHandle\", \"port\", _port);\n const iport = helper.getValidPort(\"getPortHandle\", port);\n return iport;\n },\n rm: function (_fn: unknown, hostname: any): boolean {\n updateDynamicRam(\"rm\", getRamCost(Player, \"rm\"));\n const fn = helper.string(\"rm\", \"fn\", _fn);\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: unknown, _hostname: unknown): boolean {\n updateDynamicRam(\"scriptRunning\", getRamCost(Player, \"scriptRunning\"));\n const scriptname = helper.string(\"scriptRunning\", \"scriptname\", _scriptname);\n const hostname = helper.string(\"scriptRunning\", \"hostname\", _hostname);\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: unknown, _hostname: unknown): boolean {\n updateDynamicRam(\"scriptKill\", getRamCost(Player, \"scriptKill\"));\n const scriptname = helper.string(\"scriptKill\", \"scriptname\", _scriptname);\n const hostname = helper.string(\"scriptKill\", \"hostname\", _hostname);\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 (): string {\n updateDynamicRam(\"getScriptName\", getRamCost(Player, \"getScriptName\"));\n return workerScript.name;\n },\n getScriptRam: function (_scriptname: unknown, _hostname: unknown = workerScript.hostname): number {\n updateDynamicRam(\"getScriptRam\", getRamCost(Player, \"getScriptRam\"));\n const scriptname = helper.string(\"getScriptRam\", \"scriptname\", _scriptname);\n const hostname = helper.string(\"getScriptRam\", \"hostname\", _hostname);\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[]): IRunningScriptDef | null {\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 createPublicRunningScript(runningScript);\n },\n getHackTime: function (_hostname: unknown = workerScript.hostname): number {\n updateDynamicRam(\"getHackTime\", getRamCost(Player, \"getHackTime\"));\n const hostname = helper.string(\"getHackTime\", \"hostname\", _hostname);\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: unknown = workerScript.hostname): number {\n updateDynamicRam(\"getGrowTime\", getRamCost(Player, \"getGrowTime\"));\n const hostname = helper.string(\"getGrowTime\", \"hostname\", _hostname);\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: unknown = workerScript.hostname): number {\n updateDynamicRam(\"getWeakenTime\", getRamCost(Player, \"getWeakenTime\"));\n const hostname = helper.string(\"getWeakenTime\", \"hostname\", _hostname);\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[]): number {\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: unknown, _format: unknown): string {\n updateDynamicRam(\"nFormat\", getRamCost(Player, \"nFormat\"));\n const n = helper.number(\"nFormat\", \"n\", _n);\n const format = helper.string(\"nFormat\", \"format\", _format);\n if (isNaN(n)) {\n return \"\";\n }\n\n return numeralWrapper.format(n, format);\n },\n tFormat: function (_milliseconds: unknown, _milliPrecision: unknown = false): string {\n updateDynamicRam(\"tFormat\", getRamCost(Player, \"tFormat\"));\n const milliseconds = helper.number(\"tFormat\", \"milliseconds\", _milliseconds);\n const milliPrecision = helper.boolean(_milliPrecision);\n return convertTimeMsToTimeElapsedString(milliseconds, milliPrecision);\n },\n getTimeSinceLastAug: function (): number {\n updateDynamicRam(\"getTimeSinceLastAug\", getRamCost(Player, \"getTimeSinceLastAug\"));\n return Player.playtimeSinceLastAug;\n },\n alert: function (_message: unknown): void {\n updateDynamicRam(\"alert\", getRamCost(Player, \"alert\"));\n const message = helper.string(\"alert\", \"message\", _message);\n dialogBoxCreate(message);\n },\n toast: function (_message: unknown, _variant: unknown = ToastVariant.SUCCESS, duration: any = 2000): void {\n updateDynamicRam(\"toast\", getRamCost(Player, \"toast\"));\n const message = helper.string(\"toast\", \"message\", _message);\n const variant = helper.string(\"toast\", \"variant\", _variant);\n if (!checkEnum(ToastVariant, variant))\n throw new Error(`variant must be one of ${Object.values(ToastVariant).join(\", \")}`);\n SnackbarEvents.emit(message, variant, duration);\n },\n prompt: function (_txt: unknown, options?: { type?: string; options?: string[] }): Promise<boolean | string> {\n updateDynamicRam(\"prompt\", getRamCost(Player, \"prompt\"));\n const txt = helper.string(\"toast\", \"txt\", _txt);\n\n return new Promise(function (resolve) {\n PromptEvent.emit({\n txt: txt,\n options,\n resolve: resolve,\n });\n });\n },\n wget: async function (\n _url: unknown,\n _target: unknown,\n _hostname: unknown = workerScript.hostname,\n ): Promise<boolean> {\n updateDynamicRam(\"wget\", getRamCost(Player, \"wget\"));\n const url = helper.string(\"wget\", \"url\", _url);\n const target = helper.string(\"wget\", \"target\", _target);\n const hostname = helper.string(\"wget\", \"hostname\", _hostname);\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 (): number {\n updateDynamicRam(\"getFavorToDonate\", getRamCost(Player, \"getFavorToDonate\"));\n return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n },\n getOwnedSourceFiles: function (): SourceFileLvl[] {\n 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 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 inBladeburner: Player.inBladeburner(),\n hasCorporation: Player.hasCorporation(),\n entropy: Player.entropy,\n };\n Object.assign(data.jobs, Player.jobs);\n return data;\n },\n atExit: function (f: any): void {\n updateDynamicRam(\"atExit\", getRamCost(Player, \"atExit\"));\n if (typeof f !== \"function\") {\n throw makeRuntimeErrorMsg(\"atExit\", \"argument should be function\");\n }\n workerScript.atExit = () => {\n f();\n }; // Wrap the user function to prevent WorkerScript leaking as 'this'\n },\n mv: function (_host: unknown, _source: unknown, _destination: unknown): void {\n updateDynamicRam(\"mv\", getRamCost(Player, \"mv\"));\n const host = helper.string(\"mv\", \"host\", _host);\n const source = helper.string(\"mv\", \"source\", _source);\n const destination = helper.string(\"mv\", \"destination\", _destination);\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 enums: {\n toast: ToastVariant,\n },\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","/**\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 || g === gangName);\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 AllGangs[otherGang].territory -= territoryGain;\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 AllGangs[otherGang].territory += territoryGain;\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 const total = Object.values(AllGangs)\n .map((g) => g.territory)\n .reduce((p, c) => p + c, 0);\n console.log(total);\n Object.values(AllGangs).forEach((g) => (g.territory /= total));\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 { 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 { 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 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 and the ones that have\",\n \"a backdoor installed can be connected to. To 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\",\n \" \",\n \"Connect to your home computer. This will work no matter what server you are currently connected to.\",\n \" \",\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] [-l] [--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 '-l' optional parameter allows you to force each item onto a single line.\",\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 -l --grep .script\",\n \" \",\n \"List all files with the '.js' extension in the root directory:\",\n \" \",\n \" ls / -l --grep .js\",\n \" \",\n \"List all files with the word 'purchase' in the filename, in the 'scripts' directory:\",\n \" \",\n \" ls scripts -l --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 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\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,\n features,\n error,\n errorInfo,\n 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 =\n `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${\n metadata.environment === GameEnv.Development\n ? `\n### Stack Trace\n\\`\\`\\`\n${metadata.errorInfo?.componentStack.toString().trim()}\n\\`\\`\\`\n`\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","import { List, ListItem, Paper, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React from \"react\";\n\ninterface IProps {\n children: React.ReactElement | (React.ReactElement | null)[];\n title: string;\n}\n\nexport const GameOptionsPage = (props: IProps): React.ReactElement => {\n return (\n <Paper sx={{ height: \"fit-content\", p: 1 }}>\n <Typography variant=\"h6\">{props.title}</Typography>\n {(props.children as any)?.length > 1 ? (\n <List disablePadding dense>\n {(props.children as React.ReactElement[])\n .filter((c) => c)\n .map((c, i) => (\n <ListItem key={uniqueId(String(i))} sx={{ px: 0, display: \"block\" }}>\n {c}\n </ListItem>\n ))}\n </List>\n ) : (\n props.children\n )}\n </Paper>\n );\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","import { Box, Table } from \"@mui/material\";\nimport * as React from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { DummyGift } from \"../DummyGift\";\nimport { Grid } from \"./Grid\";\nimport { calculateGrid, zeros } from \"../Helper\";\n\ninterface IProps {\n width: number;\n height: number;\n fragments: ActiveFragment[];\n}\n\nexport function DummyGrid(props: IProps): React.ReactElement {\n const gift = new DummyGift(props.width, props.height, props.fragments);\n const activeGrid = calculateGrid(gift);\n const ghostGrid = zeros([props.width, props.height]);\n return (\n <Box>\n <Table sx={{ width: props.width, height: props.height }}>\n <Grid\n width={props.width}\n height={props.height}\n activeGrid={activeGrid}\n ghostGrid={ghostGrid}\n gift={gift}\n enter={() => undefined}\n click={() => undefined}\n />\n </Table>\n </Box>\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 hostnames 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 | string): 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 pushProgram(program: string): void {\n if (this.programs.includes(program)) return;\n\n // Remove partially created program if there is one\n const existingPartialExeIndex = this.programs.findIndex((p) => p.startsWith(program));\n // findIndex returns -1 if there is no match, we only want to splice on a match\n if (existingPartialExeIndex > -1) {\n this.programs.splice(existingPartialExeIndex, 1);\n }\n\n this.programs.push(program);\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.key === 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 { 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\";\nimport { ITaskTracker } from \"../ITaskTracker\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { WorkType, ClassType, CrimeType, PlayerFactionWorkType } from \"../../utils/WorkType\";\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 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: PlayerFactionWorkType;\n createProgramName: string;\n timeWorkedCreateProgram: number;\n graftAugmentationName: string;\n timeWorkedGraftAugmentation: number;\n crimeType: CrimeType;\n committingCrimeThruSingFn: boolean;\n singFnCrimeWorkerScript: WorkerScript | null;\n timeNeededToCompleteWork: number;\n focus: boolean;\n className: ClassType;\n currentWorkFactionName: string;\n workType: WorkType;\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 entropy: 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 canAccessGrafting: () => 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 gainStats: (retValue: ITaskTracker) => 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 isAwareOfGang: () => 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: ClassType) => void;\n startCorporation: (corpName: string, additionalShares?: number) => void;\n startCrime: (\n router: IRouter,\n crimeType: CrimeType,\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, sing?: boolean) => 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?: WorkType, 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 startGraftAugmentationWork: (augmentationName: string, time: number) => void;\n graftAugmentationWork: (numCycles: number) => boolean;\n finishGraftAugmentationWork: (cancelled: boolean, singularity?: boolean) => string;\n applyEntropy: (stacks?: number) => void;\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 + CONSTANTS.Donations;\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 = \"\"; //hostname of Server currently being accessed through termina;\n this.purchasedServers = []; //hostnames of purchased server;\n\n // Hacknet Nodes/Servers\n this.hacknetNodes = []; // Note= For Hacknet Servers, this array holds the hostnames 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 = WorkType.None;\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.graftAugmentationName = \"\";\n this.timeWorkedGraftAugmentation = 0;\n\n this.className = ClassType.None;\n\n this.crimeType = CrimeType.None;\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 Only\n this.bladeburner_success_chance_mult = 1;\n\n // Sleeves & Re-sleeving\n this.sleeves = [];\n this.sleevesFromCovenant = 0; // # of Duplicate sleeves purchased from the covenant\n //bitnode\n this.bitNodeN = 1;\n\n this.entropy = 0;\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 Augmentation\n this.moneySourceB = new MoneySourceTracker(); // Where money comes from for this entire BitNode run\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.gainStats = generalMethods.gainStats;\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.startGraftAugmentationWork = generalMethods.startGraftAugmentationWork;\n this.graftAugmentationWork = generalMethods.craftAugmentationWork;\n this.finishGraftAugmentationWork = generalMethods.finishGraftAugmentationWork;\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.canAccessGrafting = generalMethods.canAccessGrafting;\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.isAwareOfGang = gangMethods.isAwareOfGang;\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 = PlayerFactionWorkType.None;\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 this.applyEntropy = augmentationMethods.applyEntropy;\n }\n\n whoAmI(): string {\n return \"Player\";\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, { 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 * 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 { 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","import { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { Sleeve } from \"./Sleeve\";\n\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { StaticAugmentations } from \"../../Augmentation/StaticAugmentations\";\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 (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 const validMults = [\n \"hacking_mult\",\n \"strength_mult\",\n \"defense_mult\",\n \"dexterity_mult\",\n \"agility_mult\",\n \"charisma_mult\",\n \"hacking_exp_mult\",\n \"strength_exp_mult\",\n \"defense_exp_mult\",\n \"dexterity_exp_mult\",\n \"agility_exp_mult\",\n \"charisma_exp_mult\",\n \"company_rep_mult\",\n \"faction_rep_mult\",\n \"crime_money_mult\",\n \"crime_success_mult\",\n \"work_money_mult\",\n ];\n for (const mult of Object.keys(aug.mults)) {\n if (validMults.includes(mult)) {\n return true;\n }\n }\n\n return false;\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(StaticAugmentations)) {\n const aug = StaticAugmentations[augName];\n if (!isAvailableForSleeve(aug)) {\n continue;\n }\n\n if (fac.playerReputation > aug.getCost(p).repCost) {\n availableAugs.push(aug);\n }\n }\n }\n\n for (const facName of p.factions) {\n if (facName === FactionNames.Bladeburners) {\n continue;\n }\n if (facName === FactionNames.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 = StaticAugmentations[augName];\n if (!isAvailableForSleeve(aug)) {\n continue;\n }\n\n if (fac.playerReputation > aug.getCost(p).repCost) {\n availableAugs.push(aug);\n }\n }\n }\n\n return availableAugs;\n}\n","import { EventEmitter } from \"../utils/EventEmitter\";\nexport const StaneksGiftEvents = new EventEmitter<[]>();\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.NewTokyo,\n name: LocationName.NewTokyoArcade,\n types: [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 { 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","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 * 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, { useEffect, useState } 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","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","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 { 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 <>\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)}>\n Delete Save\n </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}\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({\n color = \"primary\",\n noConfirmation = false,\n onTriggered,\n}: 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 <>\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}>\n Soft Reset\n </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}\n","/**\n * React component for displaying a single augmentation for purchase through\n * the faction UI\n */\nimport { CheckBox, CheckBoxOutlineBlank, CheckCircle, Info, NewReleases, Report } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Augmentation } from \"../Augmentation\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\nimport { PurchaseAugmentationModal } from \"./PurchaseAugmentationModal\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\n\ninterface IPreReqsProps {\n player: IPlayer;\n aug: Augmentation;\n}\n\nconst PreReqs = (props: IPreReqsProps): React.ReactElement => {\n const ownedPreReqs = props.aug.prereqs.filter((aug) => props.player.hasAugmentation(aug));\n const hasPreReqs = props.aug.prereqs.length > 0 && ownedPreReqs.length === props.aug.prereqs.length;\n\n return (\n <Tooltip\n title={\n <>\n <Typography sx={{ color: Settings.theme.money }}>\n This Augmentation has the following pre-requisite(s):\n </Typography>\n {props.aug.prereqs.map((preAug) => (\n <Requirement\n fulfilled={props.player.hasAugmentation(preAug)}\n value={preAug}\n color={Settings.theme.money}\n key={preAug}\n />\n ))}\n </>\n }\n >\n <Typography\n variant=\"body2\"\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n color: hasPreReqs ? Settings.theme.successlight : Settings.theme.error,\n }}\n >\n {hasPreReqs ? (\n <>\n <CheckCircle fontSize=\"small\" sx={{ mr: 1 }} />\n Pre-requisites Owned\n </>\n ) : (\n <>\n <Report fontSize=\"small\" sx={{ mr: 1 }} />\n Missing {props.aug.prereqs.length - ownedPreReqs.length} pre-requisite(s)\n </>\n )}\n </Typography>\n </Tooltip>\n );\n};\n\ninterface IExclusiveProps {\n player: IPlayer;\n aug: Augmentation;\n}\n\nconst Exclusive = (props: IExclusiveProps): React.ReactElement => {\n return (\n <Tooltip\n title={\n <>\n <Typography sx={{ color: Settings.theme.money }}>\n This Augmentation can only be acquired from the following source(s):\n </Typography>\n <ul>\n <Typography sx={{ color: Settings.theme.money }}>\n <li>\n <b>{props.aug.factions[0]}</b> faction\n </li>\n {props.player.isAwareOfGang() && !props.aug.isSpecial && (\n <li>\n Certain <b>gangs</b>\n </li>\n )}\n {props.player.canAccessGrafting() &&\n !props.aug.isSpecial &&\n props.aug.name !== AugmentationNames.TheRedPill && (\n <li>\n <b>Grafting</b>\n </li>\n )}\n </Typography>\n </ul>\n </>\n }\n >\n <NewReleases sx={{ ml: 1, color: Settings.theme.money, transform: \"rotate(180deg)\" }} />\n </Tooltip>\n );\n};\n\ninterface IReqProps {\n value: string;\n color: string;\n fulfilled: boolean;\n}\n\nconst Requirement = (props: IReqProps): React.ReactElement => {\n return (\n <Typography sx={{ display: \"flex\", alignItems: \"center\", color: props.color }}>\n {props.fulfilled ? <CheckBox sx={{ mr: 1 }} /> : <CheckBoxOutlineBlank sx={{ mr: 1 }} />}\n {props.value}\n </Typography>\n );\n};\n\ninterface IPurchasableAugsProps {\n augNames: string[];\n ownedAugNames: string[];\n player: IPlayer;\n\n canPurchase: (player: IPlayer, aug: Augmentation) => boolean;\n purchaseAugmentation: (player: IPlayer, aug: Augmentation, showModal: (open: boolean) => void) => void;\n\n rep?: number;\n sleeveAugs?: boolean;\n faction?: Faction;\n}\n\nexport const PurchasableAugmentations = (props: IPurchasableAugsProps): React.ReactElement => {\n return (\n <Container\n maxWidth=\"lg\"\n disableGutters\n sx={{ mx: 0, display: \"grid\", gridTemplateColumns: \"repeat(1, 1fr)\", gap: 1 }}\n >\n {props.augNames.map((augName: string) => (\n <PurchasableAugmentation key={augName} parent={props} augName={augName} owned={false} />\n ))}\n {props.ownedAugNames.map((augName: string) => (\n <PurchasableAugmentation key={augName} parent={props} augName={augName} owned={true} />\n ))}\n </Container>\n );\n};\n\ninterface IPurchasableAugProps {\n parent: IPurchasableAugsProps;\n augName: string;\n owned: boolean;\n}\n\nexport function PurchasableAugmentation(props: IPurchasableAugProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n const aug = StaticAugmentations[props.augName];\n const augCosts = aug.getCost(props.parent.player);\n const cost = props.parent.sleeveAugs ? aug.baseCost : augCosts.moneyCost;\n const repCost = augCosts.repCost;\n const info = typeof aug.info === \"string\" ? <span>{aug.info}</span> : aug.info;\n const description = (\n <>\n {info}\n <br />\n <br />\n {aug.stats}\n </>\n );\n\n return (\n <Paper\n sx={{\n p: 1,\n display: \"grid\",\n gridTemplateColumns: \"minmax(0, 4fr) 1fr\",\n gap: 1,\n opacity: props.owned ? 0.75 : 1,\n }}\n >\n <>\n <Box sx={{ display: \"flex\", alignItems: \"center\" }}>\n <Button\n onClick={() =>\n props.parent.purchaseAugmentation(props.parent.player, aug, (open): void => {\n setOpen(open);\n })\n }\n disabled={!props.parent.canPurchase(props.parent.player, aug) || props.owned}\n sx={{ width: \"48px\", height: \"48px\", float: \"left\", clear: \"none\", mr: 1 }}\n >\n {props.owned ? \"Owned\" : \"Buy\"}\n </Button>\n\n <Box sx={{ maxWidth: props.owned ? \"100%\" : \"85%\" }}>\n <Box sx={{ display: \"flex\", alignItems: \"center\" }}>\n <Tooltip\n title={\n <>\n <Typography variant=\"h5\">\n {props.augName}\n {props.augName === AugmentationNames.NeuroFluxGovernor &&\n ` - Level ${aug.getLevel(props.parent.player)}`}\n </Typography>\n <Typography>{description}</Typography>\n </>\n }\n >\n <Info sx={{ mr: 1 }} color=\"info\" />\n </Tooltip>\n <Typography\n variant=\"h6\"\n sx={{\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n color:\n props.owned || !props.parent.canPurchase(props.parent.player, aug)\n ? Settings.theme.disabled\n : Settings.theme.primary,\n }}\n >\n {aug.name}\n {aug.name === AugmentationNames.NeuroFluxGovernor && ` - Level ${aug.getLevel(props.parent.player)}`}\n </Typography>\n {aug.factions.length === 1 && !props.parent.sleeveAugs && (\n <Exclusive player={props.parent.player} aug={aug} />\n )}\n </Box>\n\n {aug.prereqs.length > 0 && !props.parent.sleeveAugs && <PreReqs player={props.parent.player} aug={aug} />}\n </Box>\n </Box>\n\n {props.owned || (\n <Box sx={{ display: \"grid\", alignItems: \"center\", justifyItems: \"left\" }}>\n <Requirement\n fulfilled={cost === 0 || props.parent.player.money > cost}\n value={numeralWrapper.formatMoney(cost)}\n color={Settings.theme.money}\n />\n {props.parent.rep !== undefined && (\n <Requirement\n fulfilled={props.parent.rep >= repCost}\n value={`${numeralWrapper.formatReputation(repCost)} rep`}\n color={Settings.theme.rep}\n />\n )}\n </Box>\n )}\n\n {Settings.SuppressBuyAugmentationConfirmation || (\n <PurchaseAugmentationModal\n open={open}\n onClose={() => setOpen(false)}\n faction={props.parent.faction}\n aug={aug}\n />\n )}\n </>\n </Paper>\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","import 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\";\nimport SearchIcon from \"@mui/icons-material/Search\";\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, makeTheme, sanitizeTheme } 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 { TextField, 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 remove 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 const [filter, setFilter] = useState(\"\");\n const [searchExpanded, setSearchExpanded] = useState(false);\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 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\n // Setup \"go to next tab\" and \"go to previous tab\". This is a little more involved\n // since these aren't Ex commands (they run in normal mode, not after typing `:`)\n MonacoVim.VimMode.Vim.defineAction(\"nextTabs\", function (_cm: any, args: { repeat?: number }) {\n const nTabs = args.repeat ?? 1;\n // Go to the next tab (to the right). Wraps around when at the rightmost tab\n const currIndex = currentTabIndex();\n if (currIndex !== undefined) {\n const nextIndex = (currIndex + nTabs) % openScripts.length;\n onTabClick(nextIndex);\n }\n });\n MonacoVim.VimMode.Vim.defineAction(\"prevTabs\", function (_cm: any, args: { repeat?: number }) {\n const nTabs = args.repeat ?? 1;\n // Go to the previous tab (to the left). Wraps around when at the leftmost tab\n const currIndex = currentTabIndex();\n if (currIndex !== undefined) {\n let nextIndex = currIndex - nTabs;\n while (nextIndex < 0) {\n nextIndex += openScripts.length;\n }\n onTabClick(nextIndex);\n }\n });\n MonacoVim.VimMode.Vim.mapCommand(\"gt\", \"action\", \"nextTabs\", {}, { context: \"normal\" });\n MonacoVim.VimMode.Vim.mapCommand(\"gT\", \"action\", \"prevTabs\", {}, { context: \"normal\" });\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)\n 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) =>\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${k}\\\\b`), { token: \"otherkeywords\" }]),\n );\n otherKeyvars.forEach((k) =>\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${k}\\\\b`), { token: \"otherkeyvars\" }]),\n );\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 sanitizeTheme(Settings.EditorTheme);\n monaco.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\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 a 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\" && currentScript.fileName !== \"n00dles.js\") {\n dialogBoxCreate(\"Don't change the script name for now.\");\n return;\n }\n const cleanCode = currentScript.code.replace(/\\s/g, \"\");\n const ns1 = \"while(true){hack('n00dles');}\";\n const ns2 = `exportasyncfunctionmain(ns){while(true){awaitns.hack('n00dles');}}`;\n if (cleanCode.indexOf(ns1) == -1 && cleanCode.indexOf(ns2) == -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 a 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 currentTabIndex(): number | undefined {\n if (currentScript !== null) {\n return openScripts.findIndex(\n (script) =>\n currentScript !== null &&\n script.fileName === currentScript.fileName &&\n script.hostname === currentScript.hostname,\n );\n }\n\n return undefined;\n }\n\n function onTabClick(index: number): void {\n if (currentScript !== null) {\n // Save currentScript to openScripts\n const curIndex = currentTabIndex();\n if (curIndex !== undefined) {\n openScripts[curIndex] = currentScript;\n }\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} on ${closingScript.hostname}?`,\n resolve: (result: boolean | string) => {\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:\n \"Do you want to overwrite the current editor content with the contents of \" +\n openScript.fileName +\n \" on the server? This cannot be undone.\",\n resolve: (result: boolean | string) => {\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 function handleFilterChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setFilter(event.target.value);\n }\n function handleExpandSearch(): void {\n setFilter(\"\");\n setSearchExpanded(!searchExpanded);\n }\n const filteredOpenScripts = Object.values(openScripts).filter(\n (script) => script.hostname.includes(filter) || script.fileName.includes(filter),\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 const tabsMaxWidth = 1640;\n const tabMargin = 5;\n const tabMaxWidth = filteredOpenScripts.length ? tabsMaxWidth / filteredOpenScripts.length - tabMargin : 0;\n const tabIconWidth = 25;\n const tabTextWidth = tabMaxWidth - tabIconWidth * 2;\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={`${tabsMaxWidth}px`}\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 <Tooltip title={\"Search Open Scripts\"}>\n {searchExpanded ? (\n <TextField\n value={filter}\n onChange={handleFilterChange}\n autoFocus\n InputProps={{\n startAdornment: <SearchIcon />,\n spellCheck: false,\n endAdornment: <CloseIcon onClick={handleExpandSearch} />,\n }}\n />\n ) : (\n <Button onClick={handleExpandSearch}>\n <SearchIcon />\n </Button>\n )}\n </Tooltip>\n {filteredOpenScripts.map(({ fileName, hostname }, index) => {\n const editingCurrentScript =\n currentScript?.fileName === filteredOpenScripts[index].fileName &&\n currentScript?.hostname === filteredOpenScripts[index].hostname;\n const externalScript = hostname !== \"home\";\n const colorProps = editingCurrentScript\n ? {\n background: Settings.theme.button,\n borderColor: Settings.theme.button,\n color: Settings.theme.primary,\n }\n : {\n background: Settings.theme.backgroundsecondary,\n borderColor: Settings.theme.backgroundsecondary,\n color: Settings.theme.secondary,\n };\n\n if (externalScript) {\n colorProps.color = Settings.theme.info;\n }\n const iconButtonStyle = {\n maxWidth: `${tabIconWidth}px`,\n minWidth: `${tabIconWidth}px`,\n minHeight: \"38.5px\",\n maxHeight: \"38.5px\",\n ...colorProps,\n };\n\n const scriptTabText = `${hostname}:~/${fileName} ${dirty(index)}`;\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 maxWidth: `${tabMaxWidth}px`,\n marginRight: `${tabMargin}px`,\n flexShrink: 0,\n border: \"1px solid \" + Settings.theme.well,\n }}\n >\n <Tooltip title={scriptTabText}>\n <Button\n onClick={() => onTabClick(index)}\n onMouseDown={(e) => {\n e.preventDefault();\n if (e.button === 1) onTabClose(index);\n }}\n style={{\n maxWidth: `${tabTextWidth}px`,\n minHeight: \"38.5px\",\n overflow: \"hidden\",\n ...colorProps,\n }}\n >\n <span style={{ overflow: \"hidden\", direction: \"rtl\", textOverflow: \"ellipsis\" }}>\n {scriptTabText}\n </span>\n </Button>\n </Tooltip>\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 }}>\n Options\n </Button>\n <Button onClick={beautify}>Beautify</Button>\n <Button\n color={updatingRam ? \"secondary\" : \"primary\"}\n sx={{ mx: 1 }}\n onClick={() => {\n setRamInfoOpen(true);\n }}\n >\n {ram}\n </Button>\n <Button onClick={save}>Save (Ctrl/Cmd + s)</Button>\n <Button sx={{ mx: 1 }} onClick={props.router.toTerminal}>\n Terminal (Ctrl/Cmd + b)\n </Button>\n <Typography>\n {\" \"}\n <strong>Documentation:</strong>{\" \"}\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={() => {\n sanitizeTheme(Settings.EditorTheme);\n monacoRef.current?.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\n setOptionsOpen(false);\n }}\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 sanitizeTheme(Settings.EditorTheme);\n monacoRef.current?.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\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 }}>\n {r}\n </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 * 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\n/**\n * Returns true, if the server's directory itself or one of its subdirectory contains files.\n */\nexport function containsFiles(server: BaseServer, dir: string): boolean {\n const dirWithTrailingSlash = dir + (dir.slice(-1) === \"/\" ? \"\" : \"/\");\n\n return [...server.scripts.map((s) => s.filename), ...server.textFiles.map((t) => t.fn)].some((filename) =>\n filename.startsWith(dirWithTrailingSlash),\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 URL.revokeObjectURL(script.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 if (script.dependencies.length > 0) script.dependencies.forEach((dep) => URL.revokeObjectURL(dep.url));\n script.url = uurls[uurls.length - 1].url;\n script.module = new Promise((resolve) => resolve(eval(\"import(uurls[uurls.length - 1].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//# sourceURL=${script.server}/${script.filename}`;\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 ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport { Box, Collapse, ListItemButton, ListItemText, Paper, Table, TableBody, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React from \"react\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../../ui/Context\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\nimport { defaultMultipliers, getBitNodeMultipliers } from \"../BitNode\";\nimport { IBitNodeMultipliers } from \"../BitNodeMultipliers\";\n\ninterface IProps {\n n: number;\n level?: number;\n}\n\nexport function BitnodeMultiplierDescription({ n, level }: IProps): React.ReactElement {\n const [open, setOpen] = React.useState(false);\n if (n === 1) return <></>;\n\n return (\n <Box component={Paper} sx={{ mt: 1, p: 1 }}>\n <ListItemButton disableGutters onClick={() => setOpen((old) => !old)}>\n <ListItemText primary={<Typography variant=\"h6\">Bitnode Multipliers</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open}>\n <BitNodeMultipliersDisplay n={n} level={level} />\n </Collapse>\n </Box>\n );\n}\n\nexport const BitNodeMultipliersDisplay = ({ n, level }: IProps): React.ReactElement => {\n const player = use.Player();\n // If a level argument has been provided, use that as the multiplier level\n // If not, then we have to assume that we want the next level up from the\n // current node's source file, so we get the min of that, the SF's max level,\n // or if it's BN12, ∞\n const maxSfLevel = n === 12 ? Infinity : 3;\n const mults = getBitNodeMultipliers(n, level ?? Math.min(player.sourceFileLvl(n) + 1, maxSfLevel));\n\n return (\n <Box sx={{ columnCount: 2, columnGap: 1, mb: -2 }}>\n <GeneralMults n={n} mults={mults} />\n <SkillMults n={n} mults={mults} />\n <FactionMults n={n} mults={mults} />\n <AugmentationMults n={n} mults={mults} />\n <HackingMults n={n} mults={mults} />\n <PurchasedServersMults n={n} mults={mults} />\n <StockMults n={n} mults={mults} />\n <CrimeMults n={n} mults={mults} />\n <InfiltrationMults n={n} mults={mults} />\n <CompanyMults n={n} mults={mults} />\n <GangMults n={n} mults={mults} />\n <CorporationMults n={n} mults={mults} />\n <BladeburnerMults n={n} mults={mults} />\n <StanekMults n={n} mults={mults} />\n </Box>\n );\n};\n\ninterface IBNMultRows {\n [mult: string]: {\n name: string;\n content?: string;\n color?: string;\n };\n}\n\ninterface IBNMultTableProps {\n sectionName: string;\n rowData: IBNMultRows;\n mults: IBitNodeMultipliers;\n}\n\nconst BNMultTable = (props: IBNMultTableProps): React.ReactElement => {\n const rowsArray = Object.entries(props.rowData)\n .filter(([key, _value]) => props.mults[key] !== defaultMultipliers[key])\n .map(([key, value]) => (\n <StatsRow\n key={uniqueId()}\n name={value.name}\n data={{ content: value.content ?? `${(props.mults[key] * 100).toFixed(3)}%` }}\n color={value.color ?? Settings.theme.primary}\n />\n ));\n\n return rowsArray.length > 0 ? (\n <span style={{ display: \"inline-block\", width: \"100%\", marginBottom: \"16px\" }}>\n <Typography variant=\"h6\">{props.sectionName}</Typography>\n <Table>\n <TableBody>{rowsArray}</TableBody>\n </Table>\n </span>\n ) : (\n <></>\n );\n};\n\ninterface IMultsProps {\n n: number;\n mults: IBitNodeMultipliers;\n}\n\nfunction GeneralMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n WorldDaemonDifficulty: { name: `${SpecialServers.WorldDaemon} Difficulty` },\n DaedalusAugsRequirement: {\n name: \"Daedalus Augs Requirement\",\n content: String(mults.DaedalusAugsRequirement),\n },\n HacknetNodeMoney: { name: \"Hacknet Production\" },\n CodingContractMoney: { name: \"Coding Contract Reward\" },\n ClassGymExpGain: { name: \"Class/Gym Exp\" },\n };\n\n return <BNMultTable sectionName=\"General\" rowData={rows} mults={mults} />;\n}\n\nfunction AugmentationMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n AugmentationMoneyCost: { name: \"Money Cost\" },\n AugmentationRepCost: {\n name: \"Reputation Cost\",\n color: Settings.theme.rep,\n },\n };\n\n return <BNMultTable sectionName=\"Augmentations\" rowData={rows} mults={mults} />;\n}\n\nfunction CompanyMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n CompanyWorkMoney: {\n name: \"Work Money\",\n color: Settings.theme.money,\n },\n CompanyWorkExpGain: { name: \"Work Exp\" },\n };\n\n return <BNMultTable sectionName=\"Company\" rowData={rows} mults={mults} />;\n}\n\nfunction StockMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n FourSigmaMarketDataCost: { name: \"Market Data Cost\" },\n FourSigmaMarketDataApiCost: { name: \"Market Data API Cost\" },\n };\n\n return <BNMultTable sectionName=\"Stock Market\" rowData={rows} mults={mults} />;\n}\n\nfunction FactionMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n RepToDonateToFaction: { name: \"Favor to Donate\" },\n FactionWorkRepGain: {\n name: \"Work Reputation\",\n color: Settings.theme.rep,\n },\n FactionWorkExpGain: { name: \"Work Exp\" },\n FactionPassiveRepGain: {\n name: \"Passive Rep\",\n color: Settings.theme.rep,\n },\n };\n\n return <BNMultTable sectionName=\"Faction\" rowData={rows} mults={mults} />;\n}\n\nfunction CrimeMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n CrimeExpGain: {\n name: \"Crime Exp\",\n color: Settings.theme.combat,\n },\n CrimeMoney: {\n name: \"Crime Money\",\n color: Settings.theme.combat,\n },\n };\n\n return <BNMultTable sectionName=\"Crime\" rowData={rows} mults={mults} />;\n}\n\nfunction SkillMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n HackingLevelMultiplier: {\n name: \"Hacking Level\",\n color: Settings.theme.hack,\n },\n StrengthLevelMultiplier: {\n name: \"Strength Level\",\n color: Settings.theme.combat,\n },\n DefenseLevelMultiplier: {\n name: \"Defense Level\",\n color: Settings.theme.combat,\n },\n DexterityLevelMultiplier: {\n name: \"Dexterity Level\",\n color: Settings.theme.combat,\n },\n AgilityLevelMultiplier: {\n name: \"Agility Level\",\n color: Settings.theme.combat,\n },\n CharismaLevelMultiplier: {\n name: \"Charisma Level\",\n color: Settings.theme.cha,\n },\n };\n\n return <BNMultTable sectionName=\"Skills\" rowData={rows} mults={mults} />;\n}\n\nfunction HackingMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n HackExpGain: {\n name: \"Hacking Exp\",\n color: Settings.theme.hack,\n },\n ServerGrowthRate: { name: \"Server Growth Rate\" },\n ServerMaxMoney: { name: \"Server Max Money\" },\n ServerStartingMoney: { name: \"Server Starting Money\" },\n ServerStartingSecurity: { name: \"Server Starting Security\" },\n ServerWeakenRate: { name: \"Server Weaken Rate\" },\n ManualHackMoney: {\n name: \"Manual Hack Money\",\n color: Settings.theme.money,\n },\n ScriptHackMoney: {\n name: \"Script Hack Money\",\n color: Settings.theme.money,\n },\n ScriptHackMoneyGain: {\n name: \"Money Gained From Hack\",\n color: Settings.theme.money,\n },\n };\n\n return <BNMultTable sectionName=\"Hacking\" rowData={rows} mults={mults} />;\n}\n\nfunction PurchasedServersMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n PurchasedServerCost: {\n name: \"Base Cost\",\n content: mults.PurchasedServerCost.toFixed(3),\n },\n PurchasedServerSoftcap: {\n name: \"Softcap Cost\",\n content: mults.PurchasedServerSoftcap.toFixed(3),\n },\n PurchasedServerLimit: { name: \"Server Limit\" },\n PurchasedServerMaxRam: { name: \"Max RAM\" },\n HomeComputerRamCost: { name: \"Home RAM Cost\" },\n };\n\n return <BNMultTable sectionName=\"Purchased Servers\" rowData={rows} mults={mults} />;\n}\n\nfunction InfiltrationMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n InfiltrationMoney: {\n name: \"Infiltration Money\",\n color: Settings.theme.money,\n },\n InfiltrationRep: {\n name: \"Infiltration Reputation\",\n color: Settings.theme.rep,\n },\n };\n\n return <BNMultTable sectionName=\"Infiltration\" rowData={rows} mults={mults} />;\n}\n\nfunction BladeburnerMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessBladeburner()) return <></>;\n\n const rows: IBNMultRows = {\n BladeburnerRank: { name: \"Rank Gain\" },\n BladeburnerSkillCost: { name: \"Skill Cost\" },\n };\n\n return <BNMultTable sectionName=\"Bladeburner\" rowData={rows} mults={mults} />;\n}\n\nfunction StanekMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessCotMG()) return <></>;\n\n const extraSize = mults.StaneksGiftExtraSize.toFixed(3);\n const rows: IBNMultRows = {\n StnakesGiftPowerMultiplier: { name: \"Gift Power\" },\n StaneksGiftExtraSize: {\n name: \"Base Size Modifier\",\n content: `${mults.StaneksGiftExtraSize > defaultMultipliers.StaneksGiftExtraSize ? `+${extraSize}` : extraSize}`,\n },\n };\n\n return <BNMultTable sectionName=\"Stanek's Gift\" rowData={rows} mults={mults} />;\n}\n\nfunction GangMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (player.bitNodeN !== 2 && player.sourceFileLvl(2) <= 0) return <></>;\n\n const rows: IBNMultRows = {\n GangSoftcap: {\n name: \"Gang Softcap\",\n content: mults.GangSoftcap.toFixed(3),\n },\n GangUniqueAugs: { name: \"Unique Augmentations\" },\n };\n\n return <BNMultTable sectionName=\"Gang\" rowData={rows} mults={mults} />;\n}\n\nfunction CorporationMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessCorporation()) return <></>;\n\n const rows: IBNMultRows = {\n CorporationSoftcap: {\n name: \"Corporation Softcap\",\n content: mults.CorporationSoftcap.toFixed(3),\n },\n CorporationValuation: { name: \"Valuation\" },\n };\n\n return <BNMultTable sectionName=\"Corporation\" rowData={rows} mults={mults} />;\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 { TableBody, TableRow } from \"@mui/material\";\nimport * as React from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { IStaneksGift } from \"../IStaneksGift\";\nimport { Cell } from \"./Cell\";\n\ninterface IProps {\n width: number;\n height: number;\n activeGrid: number[][];\n ghostGrid: number[][];\n gift: IStaneksGift;\n enter(i: number, j: number): void;\n click(i: number, j: number): void;\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\nexport function Grid(props: IProps): React.ReactElement {\n function color(worldX: number, worldY: number): string {\n if (props.ghostGrid[worldX][worldY] && props.activeGrid[worldX][worldY]) return \"red\";\n if (props.ghostGrid[worldX][worldY]) return \"white\";\n\n if (props.activeGrid[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 // 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(\n <Cell key={i} onMouseEnter={() => props.enter(i, j)} onClick={() => props.click(i, j)} color={color(i, j)} />,\n );\n }\n elems.push(<TableRow key={j}>{cells}</TableRow>);\n }\n\n return <TableBody>{elems}</TableBody>;\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","// by Discord: H3draut3r#6722, feel free to ask me any questions. i probably don't know the answer 🤣\nexport function HammingEncode(value: number): string {\n // encoding following Hammings rule\n function HammingSumOfParity(_lengthOfDBits: number): number {\n // will calculate the needed amount of parityBits 'without' the \"overall\"-Parity (that math took me 4 Days to get it working)\n return _lengthOfDBits < 3 || _lengthOfDBits == 0 // oh and of course using ternary operators, it's a pretty neat function\n ? _lengthOfDBits == 0\n ? 0\n : _lengthOfDBits + 1\n : // the following math will only work, if the length is greater equal 3, otherwise it's \"kind of\" broken :D\n Math.ceil(Math.log2(_lengthOfDBits * 2)) <=\n Math.ceil(Math.log2(1 + _lengthOfDBits + Math.ceil(Math.log2(_lengthOfDBits))))\n ? Math.ceil(Math.log2(_lengthOfDBits) + 1)\n : Math.ceil(Math.log2(_lengthOfDBits));\n }\n const _data = value.toString(2).split(\"\"); // first, change into binary string, then create array with 1 bit per index\n const _sumParity: number = HammingSumOfParity(_data.length); // get the sum of needed parity bits (for later use in encoding)\n const count = (arr: Array<string>, val: string): number =>\n arr.reduce((a: number, v: string) => (v === val ? a + 1 : a), 0);\n // function count for specific entries in the array, for later use\n\n const _build = [\"x\", \"x\", ..._data.splice(0, 1)]; // init the \"pre-build\"\n for (let i = 2; i < _sumParity; i++) {\n // add new paritybits and the corresponding data bits (pre-building array)\n _build.push(\"x\", ..._data.splice(0, Math.pow(2, i) - 1));\n }\n // now the \"calculation\"... get the paritybits ('x') working\n for (const index of _build.reduce(function (a: Array<number>, e: string, i: number) {\n if (e == \"x\") a.push(i);\n return a;\n }, [])) {\n // that reduce will result in an array of index numbers where the \"x\" is placed\n const _tempcount = index + 1; // set the \"stepsize\" for the parityBit\n const _temparray = []; // temporary array to store the extracted bits\n const _tempdata = [..._build]; // only work with a copy of the _build\n while (_tempdata[index] !== undefined) {\n // as long as there are bits on the starting index, do \"cut\"\n const _temp: Array<string> = _tempdata.splice(index, _tempcount * 2); // cut stepsize*2 bits, then...\n _temparray.push(..._temp.splice(0, _tempcount)); // ... cut the result again and keep the first half\n }\n _temparray.splice(0, 1); // remove first bit, which is the parity one\n _build[index] = (count(_temparray, \"1\") % 2).toString(); // count with remainder of 2 and\"toString\" to store the parityBit\n } // parity done, now the \"overall\"-parity is set\n _build.unshift((count(_build, \"1\") % 2).toString()); // has to be done as last element\n return _build.join(\"\"); // return the _build as string\n}\n\nexport function HammingDecode(_data: string): number {\n //check for altered bit and decode\n const _build = _data.split(\"\"); // ye, an array for working, again\n const _testArray = []; //for the \"truthtable\". if any is false, the data has an altered bit, will check for and fix it\n const _sumParity = Math.ceil(Math.log2(_data.length)); // sum of parity for later use\n const count = (arr: Array<string>, val: string): number =>\n arr.reduce((a: number, v: string) => (v === val ? a + 1 : a), 0);\n // the count.... again ;)\n\n let _overallParity = _build.splice(0, 1).join(\"\"); // store first index, for checking in next step and fix the _build properly later on\n _testArray.push(_overallParity == (count(_build, \"1\") % 2).toString() ? true : false); // first check with the overall parity bit\n for (let i = 0; i < _sumParity; i++) {\n // for the rest of the remaining parity bits we also \"check\"\n const _tempIndex = Math.pow(2, i) - 1; // get the parityBits Index\n const _tempStep = _tempIndex + 1; // set the stepsize\n const _tempData = [..._build]; // get a \"copy\" of the build-data for working\n const _tempArray = []; // init empty array for \"testing\"\n while (_tempData[_tempIndex] != undefined) {\n // extract from the copied data until the \"starting\" index is undefined\n const _temp = [..._tempData.splice(_tempIndex, _tempStep * 2)]; // extract 2*stepsize\n _tempArray.push(..._temp.splice(0, _tempStep)); // and cut again for keeping first half\n }\n const _tempParity = _tempArray.shift(); // and again save the first index separated for checking with the rest of the data\n _testArray.push(_tempParity == (count(_tempArray, \"1\") % 2).toString() ? true : false);\n // is the _tempParity the calculated data? push answer into the 'truthtable'\n }\n let _fixIndex = 0; // init the \"fixing\" index and start with 0\n for (let i = 1; i < _sumParity + 1; i++) {\n // simple binary adding for every boolean in the _testArray, starting from 2nd index of it\n _fixIndex += _testArray[i] ? 0 : Math.pow(2, i) / 2;\n }\n _build.unshift(_overallParity); // now we need the \"overall\" parity back in it's place\n // try fix the actual encoded binary string if there is an error\n if (_fixIndex > 0 && _testArray[0] == false) {\n // if the overall is false and the sum of calculated values is greater equal 0, fix the corresponding hamming-bit\n _build[_fixIndex] = _build[_fixIndex] == \"0\" ? \"1\" : \"0\";\n } else if (_testArray[0] == false) {\n // otherwise, if the the overall_parity is the only wrong, fix that one\n _overallParity = _overallParity == \"0\" ? \"1\" : \"0\";\n } else if (_testArray[0] == true && _testArray.some((truth) => truth == false)) {\n return 0; // uhm, there's some strange going on... 2 bits are altered? How? This should not happen 👀\n }\n // oof.. halfway through... we fixed an possible altered bit, now \"extract\" the parity-bits from the _build\n for (let i = _sumParity; i >= 0; i--) {\n // start from the last parity down the 2nd index one\n _build.splice(Math.pow(2, i), 1);\n }\n _build.splice(0, 1); // remove the overall parity bit and we have our binary value\n return parseInt(_build.join(\"\"), 2); // parse the integer with redux 2 and we're done!\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","// 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","export const StanekConstants: {\n RAMBonus: number;\n BaseSize: number;\n MaxSize: number;\n} = {\n RAMBonus: 0.1,\n BaseSize: 9,\n MaxSize: 25,\n};\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","import { Bladeburner } from \"../../Bladeburner/Bladeburner\";\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 || this.sourceFileLvl(6) > 0 || this.sourceFileLvl(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 { Corporation } from \"../../Corporation/Corporation\";\nimport {\n CorporationUnlockUpgradeIndex,\n CorporationUnlockUpgrades,\n} from \"../../Corporation/data/CorporationUnlockUpgrades\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function canAccessCorporation(this: IPlayer): boolean {\n return this.bitNodeN === 3 || this.sourceFileLvl(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 (this.sourceFileLvl(3) === 3) {\n const warehouseApi = CorporationUnlockUpgrades[CorporationUnlockUpgradeIndex.WarehouseAPI].index;\n const OfficeApi = CorporationUnlockUpgrades[CorporationUnlockUpgradeIndex.OfficeAPI].index;\n\n this.corporation.unlockUpgrades[warehouseApi] = 1;\n this.corporation.unlockUpgrades[OfficeApi] = 1;\n }\n\n this.corporation.totalShares += additionalShares;\n}\n","/**\n * Game engine. Handles the main game loop.\n */\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\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 { Page } from \"./ui/Router\";\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 } 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 { 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\";\nimport { Button, Typography } from \"@mui/material\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\n\nimport { WorkType } from \"./utils/WorkType\";\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 warnAutosaveDisabled();\n Engine.Counters.autoSaveCounter = 60 * 5; // Let's check back in a bit\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 (Player.hasAugmentation(AugmentationNames.TheRedPill)) {\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 initAugmentations(); // Also calls Player.reapplyAllAugmentations()\n Player.reapplyAllSourceFiles();\n if (Player.hasWseAccount) {\n initSymbolToStockMap();\n }\n\n // Apply penalty for entropy accumulation\n Player.applyEntropy(Player.entropy);\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 switch (Player.workType) {\n case WorkType.Faction:\n Player.workForFaction(numCyclesOffline);\n break;\n case WorkType.CreateProgram:\n Player.createProgramWork(numCyclesOffline);\n break;\n case WorkType.StudyClass:\n Player.takeClass(numCyclesOffline);\n break;\n case WorkType.Crime:\n Player.commitCrime(numCyclesOffline);\n break;\n case WorkType.CompanyPartTime:\n Player.workPartTime(numCyclesOffline);\n break;\n case WorkType.GraftAugmentation:\n Player.graftAugmentationWork(numCyclesOffline);\n break;\n default:\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 <Typography>Offline for {timeOfflineString}. While you were offline:</Typography>\n <ul>\n <li>\n <Typography>\n Your scripts generated <Money money={offlineHackingIncome} />\n </Typography>\n </li>\n <li>\n <Typography>Your Hacknet Nodes generated {hacknetProdInfo}</Typography>\n </li>\n <li>\n <Typography>\n You gained <Reputation reputation={offlineReputation} /> reputation divided amongst your factions\n </Typography>\n </li>\n </ul>\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\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\n/**\n * Shows a toast warning that lets the player know that auto-saves are disabled, with an button to re-enable them.\n */\nfunction warnAutosaveDisabled(): void {\n // If the player has suppressed those warnings let's just exit right away.\n if (Settings.SuppressAutosaveDisabledWarnings) return;\n\n // We don't want this warning to show up on certain pages.\n // When in recovery or importing we want to keep autosave disabled.\n const ignoredPages = [Page.Recovery, Page.ImportSave];\n if (ignoredPages.includes(Router.page())) return;\n\n const warningToast = (\n <>\n Auto-saves are <strong>disabled</strong>!\n <Button\n sx={{ ml: 1 }}\n color=\"warning\"\n size=\"small\"\n onClick={() => {\n // We reset the value to a default\n Settings.AutosaveInterval = 60;\n }}\n >\n Enable\n </Button>\n </>\n );\n SnackbarEvents.emit(warningToast, ToastVariant.WARNING, 5000);\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 * Augmentation-related methods for the Player class (PlayerObject)\n */\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\n\nimport { calculateEntropy } from \"../Grafting/EntropyAccumulation\";\n\nexport function hasAugmentation(this: IPlayer, aug: string | Augmentation, ignoreQueued = 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 (!ignoreQueued) {\n for (const owned of this.queuedAugmentations) {\n if (owned.name === augName) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nexport function applyEntropy(this: IPlayer, stacks = 1): void {\n // Re-apply all multipliers\n this.reapplyAllAugmentations();\n this.reapplyAllSourceFiles();\n\n const newMultipliers = calculateEntropy(this, stacks);\n for (const [mult, val] of Object.entries(newMultipliers)) {\n this.setMult(mult, val);\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 { FactionNames } from \"../Faction/data/FactionNames\";\nimport { 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.max(2, Math.min(Math.floor(this.baseSize() / 2 + 1), StanekConstants.MaxSize));\n }\n height(): number {\n return Math.max(3, Math.min(Math.floor(this.baseSize() / 2 + 0.6), StanekConstants.MaxSize));\n }\n\n charge(player: IPlayer, af: ActiveFragment, threads: number): void {\n if (threads > af.highestCharge) {\n af.numCharge = (af.highestCharge * af.numCharge) / threads + 1;\n af.highestCharge = threads;\n } else {\n af.numCharge += threads / af.highestCharge;\n }\n\n const cotmg = Factions[FactionNames.ChurchOfTheMachineGod];\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.highestCharge, 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.highestCharge = 0;\n f.numCharge = 0;\n });\n }\n\n updateMults(p: IPlayer): void {\n // applyEntropy also reapplies all augmentations and source files\n // This wraps up the reset nicely\n p.applyEntropy(p.entropy);\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","/**\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","import React from \"react\";\n\nimport { Typography, Table, TableBody, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { StatsRow } from \"../../../ui/React/StatsRow\";\nimport { characterOverviewStyles as useStyles } from \"../../../ui/React/CharacterOverview\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { MoneyRate } from \"../../../ui/React/MoneyRate\";\nimport { ReputationRate } from \"../../../ui/React/ReputationRate\";\nimport { use } from \"../../../ui/Context\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\n\ninterface IProps {\n sleeve: Sleeve;\n}\n\nexport function StatsElement(props: IProps): React.ReactElement {\n const classes = useStyles();\n\n return (\n <Table sx={{ display: \"table\", mb: 1, width: \"100%\" }}>\n <TableBody>\n <StatsRow name=\"City\" color={Settings.theme.primary} data={{ content: props.sleeve.city }} />\n <StatsRow\n name=\"HP\"\n color={Settings.theme.hp}\n data={{\n content: `${numeralWrapper.formatHp(props.sleeve.hp)} / ${numeralWrapper.formatHp(props.sleeve.max_hp)}`,\n }}\n />\n <StatsRow\n name=\"Hacking\"\n color={Settings.theme.hack}\n data={{ level: props.sleeve.hacking, exp: props.sleeve.hacking_exp }}\n />\n <StatsRow\n name=\"Strength\"\n color={Settings.theme.combat}\n data={{ level: props.sleeve.strength, exp: props.sleeve.strength_exp }}\n />\n <StatsRow\n name=\"Defense\"\n color={Settings.theme.combat}\n data={{ level: props.sleeve.defense, exp: props.sleeve.defense_exp }}\n />\n <StatsRow\n name=\"Dexterity\"\n color={Settings.theme.combat}\n data={{ level: props.sleeve.dexterity, exp: props.sleeve.dexterity_exp }}\n />\n <StatsRow\n name=\"Agility\"\n color={Settings.theme.combat}\n data={{ level: props.sleeve.agility, exp: props.sleeve.agility_exp }}\n />\n <StatsRow\n name=\"Charisma\"\n color={Settings.theme.cha}\n data={{ level: props.sleeve.charisma, exp: props.sleeve.charisma_exp }}\n />\n <TableRow>\n <TableCell classes={{ root: classes.cellNone }}>\n <br />\n </TableCell>\n </TableRow>\n <StatsRow\n name=\"Shock\"\n color={Settings.theme.primary}\n data={{ content: numeralWrapper.formatSleeveShock(100 - props.sleeve.shock) }}\n />\n <StatsRow\n name=\"Sync\"\n color={Settings.theme.primary}\n data={{ content: numeralWrapper.formatSleeveSynchro(props.sleeve.sync) }}\n />\n <StatsRow\n name=\"Memory\"\n color={Settings.theme.primary}\n data={{ content: numeralWrapper.formatSleeveMemory(props.sleeve.memory) }}\n />\n </TableBody>\n </Table>\n );\n}\n\nexport function EarningsElement(props: IProps): React.ReactElement {\n const classes = useStyles();\n const player = use.Player();\n\n let data: any[][] = [];\n if (props.sleeve.currentTask === SleeveTaskType.Crime) {\n data = [\n [\n `Money`,\n <>\n <Money money={parseFloat(props.sleeve.currentTaskLocation)} /> (on success)\n </>,\n ],\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)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.str)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.def)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.dex)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.agi)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.cha)} / sec`],\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 <Table sx={{ display: \"table\", mb: 1, width: \"100%\", lineHeight: 0 }}>\n <TableBody>\n <TableRow>\n <TableCell classes={{ root: classes.cellNone }}>\n <Typography variant=\"h6\">Earnings</Typography>\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 );\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\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\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(FactionNames.CyberSec);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.CyberSec}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.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(FactionNames.NiteSec);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.NiteSec}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.NiteSec]);\n },\n },\n {\n title: \"Join the faction hinted at in j3.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(FactionNames.TheBlackHand);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.TheBlackHand}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.TheBlackHand]);\n },\n },\n {\n title: \"Join the faction hinted at in 19dfj3l1nd.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(FactionNames.BitRunners);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.BitRunners}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.BitRunners]);\n },\n },\n {\n title: \"Complete fl1ght.exe\",\n fulfilled: (p: IPlayer): boolean => {\n // technically wrong but whatever\n return p.factions.includes(FactionNames.Daedalus);\n },\n },\n {\n title: `Install the special Augmentation from ${FactionNames.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 { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { IPlayer } from \"../IPlayer\";\nimport { ClassType } from \"../../utils/WorkType\";\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 ClassType.StudyComputerScience:\n hackExp =\n ((CONSTANTS.ClassStudyComputerScienceBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.DataStructures:\n cost = (CONSTANTS.ClassDataStructuresBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassDataStructuresBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Networks:\n cost = (CONSTANTS.ClassNetworksBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassNetworksBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Algorithms:\n cost = (CONSTANTS.ClassAlgorithmsBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassAlgorithmsBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Management:\n cost = (CONSTANTS.ClassManagementBaseCost * player.workCostMult) / gameCPS;\n chaExp = ((CONSTANTS.ClassManagementBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Leadership:\n cost = (CONSTANTS.ClassLeadershipBaseCost * player.workCostMult) / gameCPS;\n chaExp = ((CONSTANTS.ClassLeadershipBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.GymStrength:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n strExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case ClassType.GymDefense:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n defExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case ClassType.GymDexterity:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n dexExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case ClassType.GymAgility:\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 { 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({\n achievement,\n unlockedOn,\n cssFiltersUnlocked,\n cssFiltersLocked,\n}: 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\n sx={{\n border: `1px solid ${Settings.theme.well}`,\n mb: 2,\n }}\n >\n <Box\n sx={{\n display: \"flex\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n }}\n >\n <AchievementIcon\n achievement={achievement}\n unlocked={isUnlocked}\n size=\"72px\"\n colorFilters={isUnlocked ? cssFiltersUnlocked : cssFiltersLocked}\n />\n <Box\n sx={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n px: 1,\n }}\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.14,\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,\n s,\n 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(\n 4,\n )}%) 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 ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : 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 { 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 \"dist/images/83b2443ab7e7d346766c8f6bc5afc7a7.png\";","export default \"dist/images/6caf35202b10b52e1fc2743f674c33e8.png\";","export default \"dist/images/cb88977ea837bccb9cceb727adc78302.png\";","export default \"dist/images/4e0e750f2f09de58219773edd46cbbf5.png\";","export default \"dist/images/e97de4daa946331c7e99dee9c05d629c.png\";","export default \"dist/images/9f96a5084f4e5f1a6c0041b41b34d62d.png\";","export default \"dist/images/85a7b2896acb62be76f3ea7100fe9012.png\";","export default \"dist/images/5aa87b7de67a77c914088783b055e1cf.png\";","export default \"dist/images/c7164b072d62c91c27c6d607b5207e7b.png\";","export default \"dist/images/66f4b86d86164fc117bd6d648e4eaa6f.png\";","export default \"dist/images/a1110d6c8d16a14c4570411750248399.png\";","export default \"dist/images/447bc31e61f55e7eff875be3e9a81f1a.png\";","export default \"dist/images/297df8c0e47764ea113951318b2acf55.png\";","export default \"dist/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\";\nimport { apr1 } from \"./commands/apr1\";\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 const canRunScripts = hasAdminRights && currServ.maxRam > 0;\n this.print(\"Can run scripts on this host: \" + (canRunScripts ? \"YES\" : \"NO\"));\n this.print(\"RAM: \" + numeralWrapper.formatRAM(currServ.maxRam));\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 //Check if the contract still exists by the time the promise is fullfilled\n if (serv.getContract(contractName) == null) {\n this.contractOpen = false;\n return this.error(\"Contract no longer exists (Was it solved by a script?)\");\n }\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 }\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 (\n commandArray.length == 2 &&\n commandArray[0] == \"nano\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\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 (\n commandArray.length == 2 &&\n commandArray[0] == \"run\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.ActiveScriptsToTerminal:\n if (\n commandArray.length == 2 &&\n commandArray[0] == \"tail\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\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 apr1: apr1,\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\";\nimport { MinHeap } from \"../utils/Heap\";\n\nimport { comprGenChar, comprLZGenerate, comprLZEncode, comprLZDecode } from \"../utils/CompressionContracts\";\nimport { HammingEncode, HammingDecode } from \"../utils/HammingCodeTools\";\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 distinct 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: (data: [number, number[]]): string => {\n const n: number = data[0];\n const s: number[] = data[1];\n return [\n `How many different distinct ways can the number ${n} be written`,\n \"as a sum of integers contained in the set:\\n\\n\",\n `[${s}]?\\n\\n`,\n \"You may use each integer in the set zero or more times.\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): [number, number[]] => {\n const n: number = getRandomInt(12, 200);\n const maxLen: number = getRandomInt(8, 12);\n const s: number[] = [];\n // Bias towards small numbers is intentional to have much bigger answers in general\n // to force people better optimize their solutions\n for (let i = 1; i <= n; i++) {\n if (s.length == maxLen) {\n break;\n }\n if (Math.random() < 0.6 || n - i < maxLen - s.length) {\n s.push(i);\n }\n }\n return [n, s];\n },\n name: \"Total Ways to Sum II\",\n numTries: 10,\n solver: (data: [number, number[]], ans: string): boolean => {\n // https://www.geeksforgeeks.org/coin-change-dp-7/?ref=lbp\n const n = data[0];\n const s = data[1];\n const ways: number[] = [1];\n ways.length = n + 1;\n ways.fill(0, 1);\n for (let i = 0; i < s.length; i++) {\n for (let j = s[i]; j <= n; j++) {\n ways[j] += ways[j - s[i]];\n }\n }\n return ways[n] === 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 return (ans === \"1\" && solution) || (ans === \"0\" && !solution);\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 the minimum number of\",\n \"jumps to reach the end of the array.\\n\\n\",\n \"If it's impossible to reach the end, then the answer should be 0.\",\n ].join(\" \");\n },\n difficulty: 3,\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 for (let j = 0; j < 10; j++) {\n if (Math.random() <= j / 10 + 0.1) {\n arr[i] = j;\n break;\n }\n }\n }\n\n return arr;\n },\n name: \"Array Jumping Game II\",\n numTries: 3,\n solver: (data: number[], ans: string): boolean => {\n const n: number = data.length;\n let reach = 0;\n let jumps = 0;\n let lastJump = -1;\n while (reach < n - 1) {\n let jumpedFrom = -1;\n for (let i = reach; i > lastJump; i--) {\n if (i + data[i] > reach) {\n reach = i + data[i];\n jumpedFrom = i;\n }\n }\n if (jumpedFrom === -1) {\n jumps = 0;\n break;\n }\n lastJump = jumpedFrom;\n jumps++;\n }\n return jumps === parseInt(ans, 10);\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 name: \"Shortest Path in a Grid\",\n desc: (data: number[][]): string => {\n return [\n \"You are located in the top-left corner of the following grid:\\n\\n\",\n ` [${data.map((line) => \"[\" + line + \"]\").join(\",\\n \")}]\\n\\n`,\n \"You are trying to find the shortest path to the bottom-right corner of the grid,\",\n \"but there are obstacles on the grid that you cannot move onto.\",\n \"These obstacles are denoted by '1', while empty spaces are denoted by 0.\\n\\n\",\n \"Determine the shortest path from start to finish, if one exists.\",\n \"The answer should be given as a string of UDLR characters, indicating the moves along the path\\n\\n\",\n \"NOTE: If there are multiple equally short paths, any of them is accepted as answer.\",\n \"If there is no path, the answer should be an empty string.\\n\",\n \"NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\\n\\n\",\n \"Examples:\\n\\n\",\n \" [[0,1,0,0,0],\\n\",\n \" [0,0,0,1,0]]\\n\",\n \"\\n\",\n \"Answer: 'DRRURRD'\\n\\n\",\n \" [[0,1],\\n\",\n \" [1,0]]\\n\",\n \"\\n\",\n \"Answer: ''\\n\\n\",\n ].join(\" \");\n },\n difficulty: 7,\n numTries: 10,\n gen: (): number[][] => {\n const height = getRandomInt(6, 12);\n const width = getRandomInt(6, 12);\n const dstY = height - 1;\n const dstX = width - 1;\n const minPathLength = dstY + dstX; // Math.abs(dstY - srcY) + Math.abs(dstX - srcX)\n\n const grid: number[][] = new Array(height);\n for (let y = 0; y < height; y++) grid[y] = new Array(width).fill(0);\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n if (y == 0 && x == 0) continue; // Don't block start\n if (y == dstY && x == dstX) continue; // Don't block destination\n\n // Generate more obstacles the farther a position is from start and destination.\n // Raw distance factor peaks at 50% at half-way mark. Rescale to 40% max.\n // Obstacle chance range of [15%, 40%] produces ~78% solvable puzzles\n const distanceFactor = (Math.min(y + x, dstY - y + dstX - x) / minPathLength) * 0.8;\n if (Math.random() < Math.max(0.15, distanceFactor)) grid[y][x] = 1;\n }\n }\n\n return grid;\n },\n solver: (data: number[][], ans: string): boolean => {\n const width = data[0].length;\n const height = data.length;\n const dstY = height - 1;\n const dstX = width - 1;\n\n const distance: [number][] = new Array(height);\n //const prev: [[number, number] | undefined][] = new Array(height);\n const queue = new MinHeap<[number, number]>();\n\n for (let y = 0; y < height; y++) {\n distance[y] = new Array(width).fill(Infinity) as [number];\n //prev[y] = new Array(width).fill(undefined) as [undefined];\n }\n\n function validPosition(y: number, x: number): boolean {\n return y >= 0 && y < height && x >= 0 && x < width && data[y][x] == 0;\n }\n\n // List in-bounds and passable neighbors\n function* neighbors(y: number, x: number): Generator<[number, number]> {\n if (validPosition(y - 1, x)) yield [y - 1, x]; // Up\n if (validPosition(y + 1, x)) yield [y + 1, x]; // Down\n if (validPosition(y, x - 1)) yield [y, x - 1]; // Left\n if (validPosition(y, x + 1)) yield [y, x + 1]; // Right\n }\n\n // Prepare starting point\n distance[0][0] = 0;\n queue.push([0, 0], 0);\n\n // Take next-nearest position and expand potential paths from there\n while (queue.size > 0) {\n const [y, x] = queue.pop() as [number, number];\n for (const [yN, xN] of neighbors(y, x)) {\n const d = distance[y][x] + 1;\n if (d < distance[yN][xN]) {\n if (distance[yN][xN] == Infinity)\n // Not reached previously\n queue.push([yN, xN], d);\n // Found a shorter path\n else queue.changeWeight(([yQ, xQ]) => yQ == yN && xQ == xN, d);\n //prev[yN][xN] = [y, x];\n distance[yN][xN] = d;\n }\n }\n }\n\n // No path at all?\n if (distance[dstY][dstX] == Infinity) return ans == \"\";\n\n // There is a solution, require that the answer path is as short as the shortest\n // path we found\n if (ans.length > distance[dstY][dstX]) return false;\n\n // Further verify that the answer path is a valid path\n let ansX = 0;\n let ansY = 0;\n for (const direction of ans) {\n switch (direction) {\n case \"U\":\n ansY -= 1;\n break;\n case \"D\":\n ansY += 1;\n break;\n case \"L\":\n ansX -= 1;\n break;\n case \"R\":\n ansX += 1;\n break;\n default:\n return false; // Invalid character\n }\n if (!validPosition(ansY, ansX)) return false;\n }\n\n // Path was valid, finally verify that the answer path brought us to the end coordinates\n return ansY == dstY && ansX == dstX;\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: 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 (sanitizedPlayerAnsArr.length !== res.length) {\n return false;\n }\n for (const resultInAnswer of res) {\n if (!sanitizedPlayerAnsArr.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: The order of evaluation expects script operator precedence\",\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 name: \"HammingCodes: Integer to Encoded Binary\",\n numTries: 10,\n difficulty: 5,\n desc: (n: number): string => {\n return [\n \"You are given the following decimal Value: \\n\",\n `${n} \\n`,\n \"Convert it into a binary string and encode it as a 'Hamming-Code'. eg:\\n \",\n \"Value 8 will result into binary '1000', which will be encoded\",\n \"with the pattern 'pppdpddd', where p is a paritybit and d a databit,\\n\",\n \"or '10101' (Value 21) will result into (pppdpdddpd) '1001101011'.\\n\\n\",\n \"NOTE: You need an parity Bit on Index 0 as an 'overall'-paritybit. \\n\",\n \"NOTE 2: You should watch the HammingCode-video from 3Blue1Brown, which explains the 'rule' of encoding,\",\n \"including the first Index parity-bit mentioned on the first note.\\n\\n\",\n \"Now the only one rule for this encoding:\\n\",\n \" It's not allowed to add additional leading '0's to the binary value\\n\",\n \"That means, the binary value has to be encoded as it is\",\n ].join(\" \");\n },\n gen: (): number => {\n return getRandomInt(Math.pow(2, 4), Math.pow(2, getRandomInt(1, 57)));\n },\n solver: (data: number, ans: string): boolean => {\n return ans === HammingEncode(data);\n },\n },\n {\n name: \"HammingCodes: Encoded Binary to Integer\",\n difficulty: 8,\n numTries: 10,\n desc: (n: string): string => {\n return [\n \"You are given the following encoded binary String: \\n\",\n `'${n}' \\n`,\n \"Treat it as a Hammingcode with 1 'possible' error on an random Index.\\n\",\n \"Find the 'possible' wrong bit, fix it and extract the decimal value, which is hidden inside the string.\\n\\n\",\n \"Note: The length of the binary string is dynamic, but it's encoding/decoding is following Hammings 'rule'\\n\",\n \"Note 2: Index 0 is an 'overall' parity bit. Watch the Hammingcode-video from 3Blue1Brown for more information\\n\",\n \"Note 3: There's a ~55% chance for an altered Bit. So... MAYBE there is an altered Bit 😉\\n\",\n \"Extranote for automation: return the decimal value as a string\",\n ].join(\" \");\n },\n gen: (): string => {\n const _alteredBit = Math.round(Math.random());\n const _buildArray: Array<string> = HammingEncode(\n getRandomInt(Math.pow(2, 4), Math.pow(2, getRandomInt(1, 57))),\n ).split(\"\");\n if (_alteredBit) {\n const _randomIndex: number = getRandomInt(0, _buildArray.length - 1);\n _buildArray[_randomIndex] = _buildArray[_randomIndex] == \"0\" ? \"1\" : \"0\";\n }\n return _buildArray.join(\"\");\n },\n solver: (data: string, ans: string): boolean => {\n return parseInt(ans, 10) === HammingDecode(data);\n },\n },\n {\n name: \"Proper 2-Coloring of a Graph\",\n difficulty: 7,\n numTries: 5,\n desc: (data: [number, [number, number][]]): string => {\n return [\n `You are given the following data, representing a graph:\\n`,\n `${JSON.stringify(data)}\\n`,\n `Note that \"graph\", as used here, refers to the field of graph theory, and has`,\n `no relation to statistics or plotting.`,\n `The first element of the data represents the number of vertices in the graph.`,\n `Each vertex is a unique number between 0 and ${data[0] - 1}.`,\n `The next element of the data represents the edges of the graph.`,\n `Two vertices u,v in a graph are said to be adjacent if there exists an edge [u,v].`,\n `Note that an edge [u,v] is the same as an edge [v,u], as order does not matter.`,\n `You must construct a 2-coloring of the graph, meaning that you have to assign each`,\n `vertex in the graph a \"color\", either 0 or 1, such that no two adjacent vertices have`,\n `the same color. Submit your answer in the form of an array, where element i`,\n `represents the color of vertex i. If it is impossible to construct a 2-coloring of`,\n `the given graph, instead submit an empty array.\\n\\n`,\n `Examples:\\n\\n`,\n `Input: [4, [[0, 2], [0, 3], [1, 2], [1, 3]]]\\n`,\n `Output: [0, 0, 1, 1]\\n\\n`,\n `Input: [3, [[0, 1], [0, 2], [1, 2]]]\\n`,\n `Output: []`,\n ].join(\" \");\n },\n gen: (): [number, [number, number][]] => {\n //Generate two partite sets\n const n = Math.floor(Math.random() * 5) + 3;\n const m = Math.floor(Math.random() * 5) + 3;\n\n //50% chance of spawning any given valid edge in the bipartite graph\n const edges: [number, number][] = [];\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < m; j++) {\n if (Math.random() > 0.5) {\n edges.push([i, n + j]);\n }\n }\n }\n\n //Add an edge at random with no regard to partite sets\n let a = Math.floor(Math.random() * (n + m));\n let b = Math.floor(Math.random() * (n + m));\n if (a > b) [a, b] = [b, a]; //Enforce lower numbers come first\n if (a != b && !edges.includes([a, b])) {\n edges.push([a, b]);\n }\n\n //Randomize array in-place using Durstenfeld shuffle algorithm.\n function shuffle(array: any[]): void {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n }\n\n //Replace instances of the original vertex names in-place\n const vertexShuffler = Array.from(Array(n + m).keys());\n shuffle(vertexShuffler);\n for (let i = 0; i < edges.length; i++) {\n edges[i] = [vertexShuffler[edges[i][0]], vertexShuffler[edges[i][1]]];\n if (edges[i][0] > edges[i][1]) {\n //Enforce lower numbers come first\n [edges[i][0], edges[i][1]] = [edges[i][1], edges[i][0]];\n }\n }\n\n //Shuffle the order of the edges themselves, as well\n shuffle(edges);\n\n return [n + m, edges];\n },\n solver: (data: [number, [number, number][]], ans: string): boolean => {\n //Case where the player believes there is no solution.\n //Attempt to construct one to check if this is correct.\n if (ans == \"[]\") {\n //Helper function to get neighbourhood of a vertex\n function neighbourhood(vertex: number): number[] {\n const adjLeft = data[1].filter(([a, _]) => a == vertex).map(([_, b]) => b);\n const adjRight = data[1].filter(([_, b]) => b == vertex).map(([a, _]) => a);\n return adjLeft.concat(adjRight);\n }\n\n //Verify that there is no solution by attempting to create a proper 2-coloring.\n const coloring: (number | undefined)[] = Array(data[0]).fill(undefined);\n while (coloring.some((val) => val === undefined)) {\n //Color a vertex in the graph\n const initialVertex: number = coloring.findIndex((val) => val === undefined);\n coloring[initialVertex] = 0;\n const frontier: number[] = [initialVertex];\n\n //Propogate the coloring throughout the component containing v greedily\n while (frontier.length > 0) {\n const v: number = frontier.pop() || 0;\n const neighbors: number[] = neighbourhood(v);\n\n //For each vertex u adjacent to v\n for (const id in neighbors) {\n const u: number = neighbors[id];\n\n //Set the color of u to the opposite of v's color if it is new,\n //then add u to the frontier to continue the algorithm.\n if (coloring[u] === undefined) {\n if (coloring[v] === 0) coloring[u] = 1;\n else coloring[u] = 0;\n\n frontier.push(u);\n }\n\n //Assert u,v do not have the same color\n else if (coloring[u] === coloring[v]) {\n //If u,v do have the same color, no proper 2-coloring exists, meaning\n //the player was correct to say there is no proper 2-coloring of the graph.\n return true;\n }\n }\n }\n }\n\n //If this code is reached, there exists a proper 2-coloring of the input\n //graph, and thus the player was incorrect in submitting no answer.\n return false;\n }\n\n //Sanitize player input\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n const coloring: number[] = sanitizedPlayerAnsArr.map((val) => parseInt(val));\n\n //Solution provided case\n if (coloring.length == data[0]) {\n const edges = data[1];\n const validColors = [0, 1];\n //Check that the provided solution is a proper 2-coloring\n return edges.every(([a, b]) => {\n const aColor = coloring[a];\n const bColor = coloring[b];\n return (\n validColors.includes(aColor) && //Enforce the first endpoint is color 0 or 1\n validColors.includes(bColor) && //Enforce the second endpoint is color 0 or 1\n aColor != bColor //Enforce the endpoints are different colors\n );\n });\n }\n\n //Return false if the coloring is the wrong size\n else return false;\n },\n },\n {\n name: \"Compression I: RLE Compression\",\n difficulty: 2,\n numTries: 10,\n desc: (plaintext: string): string => {\n return [\n \"Run-length encoding (RLE) is a data compression technique which encodes data as a series of runs of\",\n \"a repeated single character. Runs are encoded as a length, followed by the character itself. Lengths\",\n \"are encoded as a single ASCII digit; runs of 10 characters or more are encoded by splitting them\",\n \"into multiple runs.\\n\\n\",\n \"You are given the following input string:\\n\",\n ` ${plaintext}\\n`,\n \"Encode it using run-length encoding with the minimum possible output length.\\n\\n\",\n \"Examples:\\n\",\n \" aaaaabccc -> 5a1b3c\\n\",\n \" aAaAaA -> 1a1A1a1A1a1A\\n\",\n \" 111112333 -> 511233\\n\",\n \" zzzzzzzzzzzzzzzzzzz -> 9z9z1z (or 9z8z2z, etc.)\\n\",\n ].join(\" \");\n },\n gen: (): string => {\n const length = 50 + Math.floor(25 * (Math.random() + Math.random()));\n let plain = \"\";\n\n while (plain.length < length) {\n const r = Math.random();\n\n let n = 1;\n if (r < 0.3) {\n n = 1;\n } else if (r < 0.6) {\n n = 2;\n } else if (r < 0.9) {\n n = Math.floor(10 * Math.random());\n } else {\n n = 10 + Math.floor(5 * Math.random());\n }\n\n const c = comprGenChar();\n plain += c.repeat(n);\n }\n\n return plain.substring(0, length);\n },\n solver: (plain: string, ans: string): boolean => {\n if (ans.length % 2 !== 0) {\n return false;\n }\n\n let ans_plain = \"\";\n for (let i = 0; i + 1 < ans.length; i += 2) {\n const length = ans.charCodeAt(i) - 0x30;\n if (length < 0 || length > 9) {\n return false;\n }\n\n ans_plain += ans[i + 1].repeat(length);\n }\n if (ans_plain !== plain) {\n return false;\n }\n\n let length = 0;\n for (let i = 0; i < plain.length; ) {\n let run_length = 1;\n while (i + run_length < plain.length && plain[i + run_length] === plain[i]) {\n ++run_length;\n }\n i += run_length;\n\n while (run_length > 0) {\n run_length -= 9;\n length += 2;\n }\n }\n\n return ans.length <= length;\n },\n },\n {\n name: \"Compression II: LZ Decompression\",\n difficulty: 4,\n numTries: 10,\n desc: (compressed: string): string => {\n return [\n \"Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to\",\n \"earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk\",\n \"begins with a length L, encoded as a single ASCII digit from 1 - 9, followed by the chunk data,\",\n \"which is either:\\n\\n\",\n \"1. Exactly L characters, which are to be copied directly into the uncompressed data.\\n\",\n \"2. A reference to an earlier part of the uncompressed data. To do this, the length is followed\",\n \"by a second ASCII digit X: each of the L output characters is a copy of the character X\",\n \"places before it in the uncompressed data.\\n\\n\",\n \"For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character\",\n \"is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final\",\n \"chunk may be of either type.\\n\\n\",\n \"You are given the following LZ-encoded string:\\n\",\n ` ${compressed}\\n`,\n \"Decode it and output the original string.\\n\\n\",\n \"Example: decoding '5aaabb450723abb' chunk-by-chunk\\n\",\n \" 5aaabb -> aaabb\\n\",\n \" 5aaabb45 -> aaabbaaab\\n\",\n \" 5aaabb450 -> aaabbaaab\\n\",\n \" 5aaabb45072 -> aaabbaaababababa\\n\",\n \" 5aaabb450723abb -> aaabbaaababababaabb\",\n ].join(\" \");\n },\n gen: (): string => {\n return comprLZEncode(comprLZGenerate());\n },\n solver: (compr: string, ans: string): boolean => {\n return ans === comprLZDecode(compr);\n },\n },\n {\n name: \"Compression III: LZ Compression\",\n difficulty: 10,\n numTries: 10,\n desc: (plaintext: string): string => {\n return [\n \"Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to\",\n \"earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk\",\n \"begins with a length L, encoded as a single ASCII digit from 1 - 9, followed by the chunk data,\",\n \"which is either:\\n\\n\",\n \"1. Exactly L characters, which are to be copied directly into the uncompressed data.\\n\",\n \"2. A reference to an earlier part of the uncompressed data. To do this, the length is followed\",\n \"by a second ASCII digit X: each of the L output characters is a copy of the character X\",\n \"places before it in the uncompressed data.\\n\\n\",\n \"For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character\",\n \"is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final\",\n \"chunk may be of either type.\\n\\n\",\n \"You are given the following input string:\\n\",\n ` ${plaintext}\\n`,\n \"Encode it using Lempel-Ziv encoding with the minimum possible output length.\\n\\n\",\n \"Examples (some have other possible encodings of minimal length):\\n\",\n \" abracadabra -> 7abracad47\\n\",\n \" mississippi -> 4miss433ppi\\n\",\n \" aAAaAAaAaAA -> 3aAA53035\\n\",\n \" 2718281828 -> 627182844\\n\",\n \" abcdefghijk -> 9abcdefghi02jk\\n\",\n \" aaaaaaaaaaaa -> 3aaa91\\n\",\n \" aaaaaaaaaaaaa -> 1a91031\\n\",\n \" aaaaaaaaaaaaaa -> 1a91041\",\n ].join(\" \");\n },\n gen: (): string => {\n return comprLZGenerate();\n },\n solver: (plain: string, ans: string): boolean => {\n return comprLZDecode(ans) === plain && ans.length <= comprLZEncode(plain).length;\n },\n },\n];\n","/** Binary heap. */\nabstract class BinHeap<T> {\n /**\n * Heap data array consisting of [weight, payload] pairs, arranged by weight\n * to satisfy heap condition.\n *\n * Encodes the binary tree by storing tree root at index 0 and\n * left child of element i at `i * 2 + 1` and\n * right child of element i at `i * 2 + 2`.\n */\n protected data: [number, T][];\n\n constructor() {\n this.data = [];\n }\n\n /** Get number of elements in the heap. */\n public get size(): number {\n return this.data.length;\n }\n\n /** Add a new element to the heap. */\n public push(value: T, weight: number): void {\n const i = this.data.length;\n this.data[i] = [weight, value];\n this.heapifyUp(i);\n }\n\n /** Get the value of the root-most element of the heap, without changing the heap. */\n public peek(): T | undefined {\n if (this.data.length == 0) return undefined;\n\n return this.data[0][1];\n }\n\n /** Remove the root-most element of the heap and return the removed element's value. */\n public pop(): T | undefined {\n if (this.data.length == 0) return undefined;\n\n const value = this.data[0][1];\n\n this.data[0] = this.data[this.data.length - 1];\n this.data.length = this.data.length - 1;\n\n this.heapifyDown(0);\n\n return value;\n }\n\n /** Change the weight of an element in the heap. */\n public changeWeight(predicate: (value: T) => boolean, weight: number): void {\n // Find first element with matching value, if any\n const i = this.data.findIndex((e) => predicate(e[1]));\n if (i == -1) return;\n\n // Update that element's weight\n this.data[i][0] = weight;\n\n // And re-heapify if needed\n const p = Math.floor((i - 1) / 2);\n\n if (!this.heapOrderABeforeB(this.data[p][0], this.data[i][0]))\n // Needs to shift root-wards?\n this.heapifyUp(i);\n // Try shifting deeper\n else this.heapifyDown(i);\n }\n\n /** Restore heap condition, starting at index i and traveling towards root. */\n protected heapifyUp(i: number): void {\n // Swap the new element up towards root until it reaches root position or\n // settles under under a suitable parent\n while (i > 0) {\n const p = Math.floor((i - 1) / 2);\n\n // Reached heap-ordered state already?\n if (this.heapOrderABeforeB(this.data[p][0], this.data[i][0])) break;\n\n // Swap\n const tmp = this.data[p];\n this.data[p] = this.data[i];\n this.data[i] = tmp;\n\n // And repeat at parent index\n i = p;\n }\n }\n\n /** Restore heap condition, starting at index i and traveling away from root. */\n protected heapifyDown(i: number): void {\n // Swap the shifted element down in the heap until it either reaches the\n // bottom layer or is in correct order relative to it's children\n while (i < this.data.length) {\n const l = i * 2 + 1;\n const r = i * 2 + 2;\n let toSwap = i;\n\n // Find which one of element i and it's children should be closest to root\n if (l < this.data.length && this.heapOrderABeforeB(this.data[l][0], this.data[toSwap][0])) toSwap = l;\n if (r < this.data.length && this.heapOrderABeforeB(this.data[r][0], this.data[toSwap][0])) toSwap = r;\n\n // Already in order?\n if (i == toSwap) break;\n\n // Not in order. Swap child that should be closest to root up to 'i' and repeat\n const tmp = this.data[toSwap];\n this.data[toSwap] = this.data[i];\n this.data[i] = tmp;\n\n i = toSwap;\n }\n }\n\n /**\n * Should element with weight `weightA` be closer to root than element with\n * weight `weightB`?\n */\n protected abstract heapOrderABeforeB(weightA: number, weightB: number): boolean;\n}\n\n/** Binary max-heap. */\nexport class MaxHeap<T> extends BinHeap<T> {\n heapOrderABeforeB(weightA: number, weightB: number): boolean {\n return weightA > weightB;\n }\n}\n\n/** Binary min-heap. */\nexport class MinHeap<T> extends BinHeap<T> {\n heapOrderABeforeB(weightA: number, weightB: number): boolean {\n return weightA < weightB;\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","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\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\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 = BitNodeMultipliers.DaedalusAugsRequirement;\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(`-- ${FactionNames.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 * 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) / 25;\n if (isNaN(x) || !isFinite(x)) return 1;\n return x;\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 \"Note that a server's maximum money is soft capped above $10t. \" +\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 { FactionNames } from \"../Faction/data/FactionNames\";\nimport { GangConstants } from \"../Gang/data/Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\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\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\n\nexport function NetscriptGang(player: IPlayer, workerScript: WorkerScript): InternalAPI<IGang> {\n const checkGangApiAccess = function (ctx: NetscriptContext): 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 ctx.makeRuntimeErrorMsg(`You do not currently have a Gang`);\n }\n };\n\n const getGangMember = function (ctx: NetscriptContext, 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 ctx.makeRuntimeErrorMsg(`Invalid gang member: '${name}'`);\n };\n\n const getGangTask = function (ctx: NetscriptContext, name: string): GangMemberTask {\n const task = GangMemberTasks[name];\n if (!task) {\n throw ctx.makeRuntimeErrorMsg(`Invalid task: '${name}'`);\n }\n\n return task;\n };\n\n return {\n createGang:\n (ctx: NetscriptContext) =>\n (_faction: unknown): boolean => {\n const faction = ctx.helper.string(\"faction\", _faction);\n // this list is copied from Faction/ui/Root.tsx\n\n if (!player.canAccessGang() || !GangConstants.Names.includes(faction)) return false;\n if (player.inGang()) return false;\n if (!player.factions.includes(faction)) return false;\n\n const isHacking = faction === FactionNames.NiteSec || faction === FactionNames.TheBlackHand;\n player.startGang(faction, isHacking);\n return true;\n },\n inGang: () => (): boolean => {\n return player.inGang();\n },\n getMemberNames: (ctx: NetscriptContext) => (): string[] => {\n checkGangApiAccess(ctx);\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: (ctx: NetscriptContext) => (): GangGenInfo => {\n checkGangApiAccess(ctx);\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: (ctx: NetscriptContext) => (): GangOtherInfo => {\n checkGangApiAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberInfo => {\n const memberName = ctx.helper.string(\"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\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: (ctx: NetscriptContext) => (): boolean => {\n checkGangApiAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): boolean => {\n const memberName = ctx.helper.string(\"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const recruited = gang.recruitMember(memberName);\n if (recruited) {\n workerScript.log(\"gang.recruitMember\", () => `Successfully recruited Gang Member '${memberName}'`);\n } else {\n workerScript.log(\"gang.recruitMember\", () => `Failed to recruit Gang Member '${memberName}'`);\n }\n\n return recruited;\n },\n getTaskNames: (ctx: NetscriptContext) => (): string[] => {\n checkGangApiAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_memberName: unknown, _taskName: unknown): boolean => {\n const memberName = ctx.helper.string(\"memberName\", _memberName);\n const taskName = ctx.helper.string(\"taskName\", _taskName);\n checkGangApiAccess(ctx);\n const member = getGangMember(ctx, 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 () =>\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 () =>\n `Failed to assign Gang Member '${memberName}' to '${taskName}' task. '${memberName}' is now Unassigned`,\n );\n }\n\n return success;\n },\n getTaskStats:\n (ctx: NetscriptContext) =>\n (_taskName: unknown): GangTaskStats => {\n const taskName = ctx.helper.string(\"taskName\", _taskName);\n checkGangApiAccess(ctx);\n const task = getGangTask(ctx, taskName);\n const copy = Object.assign({}, task);\n copy.territory = Object.assign({}, task.territory);\n return copy;\n },\n getEquipmentNames: (ctx: NetscriptContext) => (): string[] => {\n checkGangApiAccess(ctx);\n return Object.keys(GangMemberUpgrades);\n },\n getEquipmentCost:\n (ctx: NetscriptContext) =>\n (_equipName: any): number => {\n const equipName = ctx.helper.string(\"equipName\", _equipName);\n checkGangApiAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_equipName: unknown): string => {\n const equipName = ctx.helper.string(\"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const upg = GangMemberUpgrades[equipName];\n if (upg == null) return \"\";\n return upg.getType();\n },\n getEquipmentStats:\n (ctx: NetscriptContext) =>\n (_equipName: unknown): EquipmentStats => {\n const equipName = ctx.helper.string(\"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) {\n throw ctx.makeRuntimeErrorMsg(`Invalid equipment: ${equipName}`);\n }\n const typecheck: EquipmentStats = equipment.mults;\n return Object.assign({}, typecheck) as any;\n },\n purchaseEquipment:\n (ctx: NetscriptContext) =>\n (_memberName: unknown, _equipName: unknown): boolean => {\n const memberName = ctx.helper.string(\"memberName\", _memberName);\n const equipName = ctx.helper.string(\"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, 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:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberAscension | undefined => {\n const memberName = ctx.helper.string(\"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\n if (!member.canAscend()) return;\n return gang.ascendMember(member, workerScript);\n },\n getAscensionResult:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberAscension | undefined => {\n const memberName = ctx.helper.string(\"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\n if (!member.canAscend()) return;\n return {\n respect: member.earnedRespect,\n ...member.getAscensionResults(),\n };\n },\n setTerritoryWarfare:\n (ctx: NetscriptContext) =>\n (_engage: unknown): void => {\n const engage = ctx.helper.boolean(_engage);\n checkGangApiAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_otherGang: unknown): number => {\n const otherGang = ctx.helper.string(\"otherGang\", _otherGang);\n checkGangApiAccess(ctx);\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 ctx.makeRuntimeErrorMsg(`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: (ctx: NetscriptContext) => (): number => {\n checkGangApiAccess(ctx);\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) * 1000;\n },\n };\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","import { FactionNames } from \"../../Faction/data/FactionNames\";\nexport const PowerMultiplier: {\n [key: string]: number | undefined;\n} = {\n [FactionNames.SlumSnakes]: 1,\n [FactionNames.Tetrads]: 2,\n [FactionNames.TheSyndicate]: 2,\n [FactionNames.TheDarkArmy]: 2,\n [FactionNames.SpeakersForTheDead]: 5,\n [FactionNames.NiteSec]: 2,\n [FactionNames.TheBlackHand]: 5,\n};\n","import { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { FactionWorkType } from \"../Faction/FactionWorkTypeEnum\";\nimport { SleeveTaskType } from \"../PersonObjects/Sleeve/SleeveTaskTypesEnum\";\nimport { findSleevePurchasableAugs } from \"../PersonObjects/Sleeve/SleeveHelpers\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { findCrime } from \"../Crime/CrimeHelpers\";\n\nimport {\n AugmentPair,\n Sleeve as ISleeve,\n SleeveInformation,\n SleeveSkills,\n SleeveTask,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { checkEnum } from \"../utils/helpers/checkEnum\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\n\nexport function NetscriptSleeve(player: IPlayer): InternalAPI<ISleeve> {\n const checkSleeveAPIAccess = function (ctx: NetscriptContext): void {\n if (player.bitNodeN !== 10 && !player.sourceFileLvl(10)) {\n throw ctx.makeRuntimeErrorMsg(\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 (ctx: NetscriptContext, sleeveNumber: number): void {\n if (sleeveNumber >= player.sleeves.length || sleeveNumber < 0) {\n const msg = `Invalid sleeve number: ${sleeveNumber}`;\n ctx.log(() => msg);\n throw ctx.makeRuntimeErrorMsg(msg);\n }\n };\n\n const getSleeveStats = function (sleeveNumber: number): SleeveSkills {\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\n return {\n getNumSleeves: (ctx: NetscriptContext) => (): number => {\n checkSleeveAPIAccess(ctx);\n return player.sleeves.length;\n },\n setToShockRecovery:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return player.sleeves[sleeveNumber].shockRecovery(player);\n },\n setToSynchronize:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return player.sleeves[sleeveNumber].synchronize(player);\n },\n setToCommitCrime:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _crimeRoughName: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const crimeRoughName = ctx.helper.string(\"crimeName\", _crimeRoughName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, 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:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _universityName: unknown, _className: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const universityName = ctx.helper.string(\"universityName\", _universityName);\n const className = ctx.helper.string(\"className\", _className);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return player.sleeves[sleeveNumber].takeUniversityCourse(player, universityName, className);\n },\n travel:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _cityName: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const cityName = ctx.helper.string(\"cityName\", _cityName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n if (checkEnum(CityName, cityName)) {\n return player.sleeves[sleeveNumber].travel(player, cityName);\n } else {\n throw ctx.makeRuntimeErrorMsg(`Invalid city name: '${cityName}'.`);\n }\n },\n setToCompanyWork:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, acompanyName: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const companyName = ctx.helper.string(\"companyName\", acompanyName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, 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 ctx.makeRuntimeErrorMsg(\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:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _factionName: unknown, _workType: unknown): boolean | undefined => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const factionName = ctx.helper.string(\"factionName\", _factionName);\n const workType = ctx.helper.string(\"workType\", _workType);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, 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 ctx.makeRuntimeErrorMsg(\n `Sleeve ${sleeveNumber} cannot work for faction ${factionName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n if (player.gang && player.gang.facName == factionName) {\n throw ctx.makeRuntimeErrorMsg(\n `Sleeve ${sleeveNumber} cannot work for faction ${factionName} because you have started a gang with them.`,\n );\n }\n\n return player.sleeves[sleeveNumber].workForFaction(player, factionName, workType);\n },\n setToGymWorkout:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _gymName: unknown, _stat: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const gymName = ctx.helper.string(\"gymName\", _gymName);\n const stat = ctx.helper.string(\"stat\", _stat);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n return player.sleeves[sleeveNumber].workoutAtGym(player, gymName, stat);\n },\n getSleeveStats:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveSkills => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return getSleeveStats(sleeveNumber);\n },\n getTask:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveTask => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, 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:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveInformation => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n tor: false,\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:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): string[] => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, 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:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): AugmentPair[] => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, 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.baseCost,\n });\n }\n\n return augs;\n },\n purchaseSleeveAug:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _augName: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const augName = ctx.helper.string(\"augName\", _augName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n if (getSleeveStats(sleeveNumber).shock > 0) {\n throw ctx.makeRuntimeErrorMsg(`Sleeve shock too high: Sleeve ${sleeveNumber}`);\n }\n\n const aug = StaticAugmentations[augName];\n if (!aug) {\n throw ctx.makeRuntimeErrorMsg(`Invalid aug: ${augName}`);\n }\n\n return player.sleeves[sleeveNumber].tryBuyAugmentation(player, aug);\n },\n setToBladeburnerAction:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _action: unknown, _contract?: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const action = ctx.helper.string(\"action\", _action);\n let contract: string;\n if (typeof _contract === \"undefined\") {\n contract = \"------\";\n } else {\n contract = ctx.helper.string(\"contract\", _contract);\n }\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n // Cannot Take on Contracts if another sleeve is performing that action\n if (action === \"Take on contracts\") {\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.Bladeburner && other.bbAction === action) {\n throw ctx.helper.makeRuntimeErrorMsg(\n `Sleeve ${sleeveNumber} cannot take of contracts because Sleeve ${i} is already performing that action.`,\n );\n }\n }\n }\n\n return player.sleeves[sleeveNumber].bladeburner(player, action, contract);\n },\n };\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Exploit } from \"../Exploits/Exploit\";\nimport * as bcrypt from \"bcryptjs\";\nimport { INetscriptHelper } from \"./INetscriptHelper\";\nimport { Apr1Events as devMenu } from \"../ui/Apr1\";\n\nexport interface INetscriptExtra {\n heart: {\n break(): number;\n };\n openDevMenu(): void;\n exploit(): void;\n bypass(doc: Document): void;\n alterReality(): void;\n rainbow(guess: string): void;\n}\n\nexport function NetscriptExtra(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): INetscriptExtra {\n return {\n heart: {\n // Easter egg function\n break: function (): number {\n return player.karma;\n },\n },\n openDevMenu: function (): void {\n devMenu.emit();\n },\n exploit: function (): void {\n player.giveExploit(Exploit.UndocumentedFunctionCall);\n },\n bypass: function (doc: unknown): void {\n // reset both fields first\n const d = doc as any;\n d.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 (d.completely_unused_field && workerScript.ramUsage === 1.6) {\n player.giveExploit(Exploit.Bypass);\n }\n d.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 rainbow: function (guess: unknown): boolean {\n function tryGuess(): boolean {\n // eslint-disable-next-line no-sync\n const verified = bcrypt.compareSync(\n helper.string(\"rainbow\", \"guess\", guess),\n \"$2a$10$aertxDEkgor8baVtQDZsLuMwwGYmkRM/ohcA6FjmmzIHQeTCsrCcO\",\n );\n if (verified) {\n player.giveExploit(Exploit.INeedARainbow);\n return true;\n }\n return false;\n }\n return tryGuess();\n },\n };\n}\n","import { 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\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\n\nexport function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript): InternalAPI<IHacknet> {\n // Utility function to get Hacknet Node object\n const getHacknetNode = function (ctx: NetscriptContext, i: number): HacknetNode | HacknetServer {\n if (i < 0 || i >= player.hacknetNodes.length) {\n throw ctx.makeRuntimeErrorMsg(\"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 ctx.makeRuntimeErrorMsg(\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: () => (): number => {\n return player.hacknetNodes.length;\n },\n maxNumNodes: () => (): number => {\n if (hasHacknetServers(player)) {\n return HacknetServerConstants.MaxServers;\n }\n return Infinity;\n },\n purchaseNode: () => (): number => {\n return purchaseHacknet(player);\n },\n getPurchaseNodeCost: () => (): number => {\n if (hasHacknetServers(player)) {\n return getCostOfNextHacknetServer(player);\n } else {\n return getCostOfNextHacknetNode(player);\n }\n },\n getNodeStats:\n (ctx: NetscriptContext) =>\n (_i: unknown): NodeStats => {\n const i = ctx.helper.number(\"i\", _i);\n const node = getHacknetNode(ctx, i);\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:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseLevelUpgrade(player, node, n);\n },\n upgradeRam:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseRamUpgrade(player, node, n);\n },\n upgradeCore:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseCoreUpgrade(player, node, n);\n },\n upgradeCache:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n if (!hasHacknetServers(player)) {\n return false;\n }\n const node = getHacknetNode(ctx, i);\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:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateLevelUpgradeCost(n, player.hacknet_node_level_cost_mult);\n },\n getRamUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateRamUpgradeCost(n, player.hacknet_node_ram_cost_mult);\n },\n getCoreUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateCoreUpgradeCost(n, player.hacknet_node_core_cost_mult);\n },\n getCacheUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n const node = getHacknetNode(ctx, i);\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: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 0;\n }\n return player.hashManager.hashes;\n },\n hashCapacity: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 0;\n }\n return player.hashManager.capacity;\n },\n hashCost:\n (ctx: NetscriptContext) =>\n (_upgName: unknown): number => {\n const upgName = ctx.helper.string(\"upgName\", _upgName);\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n\n return player.hashManager.getUpgradeCost(upgName);\n },\n spendHashes:\n (ctx: NetscriptContext) =>\n (_upgName: unknown, _upgTarget: unknown = \"\"): boolean => {\n const upgName = ctx.helper.string(\"upgName\", _upgName);\n const upgTarget = ctx.helper.string(\"upgTarget\", _upgTarget);\n if (!hasHacknetServers(player)) {\n return false;\n }\n return purchaseHashUpgrade(player, upgName, upgTarget);\n },\n getHashUpgrades: () => (): string[] => {\n if (!hasHacknetServers(player)) {\n return [];\n }\n return Object.values(HashUpgrades).map((upgrade: HashUpgrade) => upgrade.name);\n },\n getHashUpgradeLevel:\n (ctx: NetscriptContext) =>\n (_upgName: unknown): number => {\n const upgName = ctx.helper.string(\"upgName\", _upgName);\n const level = player.hashManager.upgrades[upgName];\n if (level === undefined) {\n throw ctx.makeRuntimeErrorMsg(`Invalid Hash Upgrade: ${upgName}`);\n }\n return level;\n },\n getStudyMult: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 1;\n }\n return player.hashManager.getStudyMult();\n },\n getTrainingMult: () => (): 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\";\n\nimport { staneksGift } from \"../CotMG/Helper\";\nimport { Fragments, FragmentById } from \"../CotMG/Fragment\";\nimport { FragmentType } from \"../CotMG/FragmentType\";\n\nimport {\n Fragment as IFragment,\n ActiveFragment as IActiveFragment,\n Stanek as IStanek,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { NetscriptContext, InternalAPI } from \"../Netscript/APIWrapper\";\nimport { applyAugmentation } from \"../Augmentation/AugmentationHelpers\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { joinFaction } from \"../Faction/FactionHelpers\";\nimport { Factions } from \"../Faction/Factions\";\n\nexport function NetscriptStanek(\n player: IPlayer,\n workerScript: WorkerScript,\n helper: INetscriptHelper,\n): InternalAPI<IStanek> {\n function checkStanekAPIAccess(func: string): void {\n if (!player.hasAugmentation(AugmentationNames.StaneksGift1, true)) {\n throw helper.makeRuntimeErrorMsg(func, \"Stanek's Gift is not installed\");\n }\n }\n\n return {\n giftWidth: () =>\n function (): number {\n checkStanekAPIAccess(\"giftWidth\");\n return staneksGift.width();\n },\n giftHeight: () =>\n function (): number {\n checkStanekAPIAccess(\"giftHeight\");\n return staneksGift.height();\n },\n chargeFragment: (_ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown): Promise<void> {\n //Get the fragment object using the given coordinates\n const rootX = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n checkStanekAPIAccess(\"chargeFragment\");\n const fragment = staneksGift.findFragment(rootX, rootY);\n //Check whether the selected fragment can ge charged\n if (!fragment) throw _ctx.makeRuntimeErrorMsg(`No fragment with root (${rootX}, ${rootY}).`);\n if (fragment.fragment().type == FragmentType.Booster) {\n throw _ctx.makeRuntimeErrorMsg(\n `The fragment with root (${rootX}, ${rootY}) is a Booster Fragment and thus cannot be charged.`,\n );\n }\n //Charge the fragment\n const time = staneksGift.inBonus() ? 200 : 1000;\n return netscriptDelay(time, workerScript).then(function () {\n staneksGift.charge(player, fragment, workerScript.scriptRef.threads);\n _ctx.log(() => `Charged fragment with ${_ctx.workerScript.scriptRef.threads} threads.`);\n return Promise.resolve();\n });\n },\n fragmentDefinitions: (_ctx: NetscriptContext) =>\n function (): IFragment[] {\n checkStanekAPIAccess(\"fragmentDefinitions\");\n _ctx.log(() => `Returned ${Fragments.length} fragments`);\n return Fragments.map((f) => f.copy());\n },\n activeFragments: (_ctx: NetscriptContext) =>\n function (): IActiveFragment[] {\n checkStanekAPIAccess(\"activeFragments\");\n _ctx.log(() => `Returned ${staneksGift.fragments.length} fragments`);\n return staneksGift.fragments.map((af) => {\n return { ...af.copy(), ...af.fragment().copy() };\n });\n },\n clearGift: (_ctx: NetscriptContext) =>\n function (): void {\n checkStanekAPIAccess(\"clearGift\");\n _ctx.log(() => `Cleared Stanek's Gift.`);\n staneksGift.clear();\n },\n canPlaceFragment: (_ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown, _rotation: unknown, _fragmentId: unknown): boolean {\n const rootX = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n const rotation = _ctx.helper.number(\"rotation\", _rotation);\n const fragmentId = _ctx.helper.number(\"fragmentId\", _fragmentId);\n checkStanekAPIAccess(\"canPlaceFragment\");\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw _ctx.makeRuntimeErrorMsg(`Invalid fragment id: ${fragmentId}`);\n const can = staneksGift.canPlace(rootX, rootY, rotation, fragment);\n return can;\n },\n placeFragment: (_ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown, _rotation: unknown, _fragmentId: unknown): boolean {\n const rootX = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n const rotation = _ctx.helper.number(\"rotation\", _rotation);\n const fragmentId = _ctx.helper.number(\"fragmentId\", _fragmentId);\n checkStanekAPIAccess(\"placeFragment\");\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw _ctx.makeRuntimeErrorMsg(`Invalid fragment id: ${fragmentId}`);\n return staneksGift.place(rootX, rootY, rotation, fragment);\n },\n getFragment: (_ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown): IActiveFragment | undefined {\n const rootX = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n checkStanekAPIAccess(\"getFragment\");\n const fragment = staneksGift.findFragment(rootX, rootY);\n if (fragment !== undefined) return fragment.copy();\n return undefined;\n },\n removeFragment: (_ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown): boolean {\n const rootX = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n checkStanekAPIAccess(\"removeFragment\");\n return staneksGift.delete(rootX, rootY);\n },\n acceptGift: (_ctx: NetscriptContext) =>\n function (): boolean {\n //Check if the player is eligible to join the church\n if (\n player.canAccessCotMG() &&\n player.augmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length == 0 &&\n player.queuedAugmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length == 0\n ) {\n //Attempt to join CotMG\n joinFaction(Factions[FactionNames.ChurchOfTheMachineGod]);\n //Attempt to install the first Stanek aug\n if (\n !player.hasAugmentation(AugmentationNames.StaneksGift1) &&\n !player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)\n ) {\n applyAugmentation({ name: AugmentationNames.StaneksGift1, level: 1 });\n }\n }\n //Return true iff the player is in CotMG and has the first Stanek aug installed\n return (\n Factions[FactionNames.ChurchOfTheMachineGod].isMember &&\n player.hasAugmentation(AugmentationNames.StaneksGift1)\n );\n },\n };\n}\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nexport function CalculateEffect(highestCharge: number, numCharge: number, power: number, boost: number): number {\n return (\n 1 +\n (Math.log(highestCharge + 1) / 60) *\n Math.pow((numCharge + 1) / 5, 0.07) *\n power *\n boost *\n BitNodeMultipliers.StaneksGiftPowerMultiplier\n );\n}\n","import { IPlayer } from \"../PersonObjects/IPlayer\";\n\nimport { Infiltration as IInfiltration, InfiltrationLocation } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Location } from \"../Locations/Location\";\nimport { Locations } from \"../Locations/Locations\";\nimport { calculateDifficulty, calculateReward } from \"../Infiltration/formulas/game\";\nimport {\n calculateInfiltratorsRepReward,\n calculateSellInformationCashReward,\n calculateTradeInformationRepReward,\n} from \"../Infiltration/formulas/victory\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Factions } from \"../Faction/Factions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { checkEnum } from \"../utils/helpers/checkEnum\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\n\nexport function NetscriptInfiltration(player: IPlayer): InternalAPI<IInfiltration> {\n const getLocationsWithInfiltrations = Object.values(Locations).filter(\n (location: Location) => location.infiltrationData,\n );\n\n const calculateInfiltrationData = (ctx: NetscriptContext, locationName: string): InfiltrationLocation => {\n if (!checkEnum(LocationName, locationName)) throw new Error(`Location '${locationName}' does not exists.`);\n const location = Locations[locationName];\n if (location === undefined) throw ctx.makeRuntimeErrorMsg(`Location '${location}' does not exists.`);\n if (location.infiltrationData === undefined)\n throw ctx.makeRuntimeErrorMsg(`Location '${location}' does not provide infiltrations.`);\n const startingSecurityLevel = location.infiltrationData.startingSecurityLevel;\n const difficulty = calculateDifficulty(player, startingSecurityLevel);\n const reward = calculateReward(player, startingSecurityLevel);\n const maxLevel = location.infiltrationData.maxClearanceLevel;\n return {\n location: location,\n reward: {\n tradeRep: calculateTradeInformationRepReward(player, reward, maxLevel, difficulty),\n sellCash: calculateSellInformationCashReward(player, reward, maxLevel, difficulty),\n SoARep: calculateInfiltratorsRepReward(player, Factions[FactionNames.ShadowsOfAnarchy], difficulty),\n },\n difficulty: difficulty,\n };\n };\n return {\n getPossibleLocations: () => (): string[] => {\n return getLocationsWithInfiltrations.map((l) => l + \"\");\n },\n getInfiltration:\n (ctx: NetscriptContext) =>\n (_location: unknown): InfiltrationLocation => {\n const location = ctx.helper.string(\"location\", _location);\n return calculateInfiltrationData(ctx, location);\n },\n };\n}\n","import {\n GameInfo,\n IStyleSettings,\n UserInterface as IUserInterface,\n UserInterfaceTheme,\n} 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\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\nimport { Terminal } from \"../../src/Terminal\";\n\nexport function NetscriptUserInterface(): InternalAPI<IUserInterface> {\n return {\n getTheme: () => (): UserInterfaceTheme => {\n return { ...Settings.theme };\n },\n\n getStyles: () => (): IStyleSettings => {\n return { ...Settings.styles };\n },\n\n setTheme:\n (ctx: NetscriptContext) =>\n (newTheme: UserInterfaceTheme): void => {\n const hex = /^(#)((?:[A-Fa-f0-9]{2}){3,4}|(?:[A-Fa-f0-9]{3}))$/;\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 ctx.log(() => `Successfully set theme`);\n } else {\n ctx.log(() => `Failed to set theme. Errors: ${errors.join(\", \")}`);\n }\n },\n\n setStyles:\n (ctx: NetscriptContext) =>\n (newStyles: IStyleSettings): void => {\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 ctx.log(() => `Successfully set styles`);\n } else {\n ctx.log(() => `Failed to set styles. Errors: ${errors.join(\", \")}`);\n }\n },\n\n resetTheme: (ctx: NetscriptContext) => (): void => {\n Settings.theme = { ...defaultTheme };\n ThemeEvents.emit();\n ctx.log(() => `Reinitialized theme to default`);\n },\n\n resetStyles: (ctx: NetscriptContext) => (): void => {\n Settings.styles = { ...defaultStyles };\n ThemeEvents.emit();\n ctx.log(() => `Reinitialized styles to default`);\n },\n\n getGameInfo: () => (): GameInfo => {\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,\n commit,\n platform,\n };\n\n return gameInfo;\n },\n\n clearTerminal: (ctx: NetscriptContext) => (): void => {\n ctx.log(() => `Clearing terminal`);\n Terminal.clear();\n },\n };\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Bladeburner } from \"../Bladeburner/Bladeburner\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Bladeburner as INetscriptBladeburner, BladeburnerCurAction } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { IAction } from \"src/Bladeburner/IAction\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\n\nexport function NetscriptBladeburner(player: IPlayer, workerScript: WorkerScript): InternalAPI<INetscriptBladeburner> {\n const checkBladeburnerAccess = function (ctx: NetscriptContext, skipjoined = 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 ctx.makeRuntimeErrorMsg(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 ctx.makeRuntimeErrorMsg(bladeburnerDenied);\n }\n }\n };\n\n const checkBladeburnerCity = function (ctx: NetscriptContext, city: string): 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 ctx.makeRuntimeErrorMsg(`Invalid city: ${city}`);\n }\n };\n\n const getBladeburnerActionObject = function (ctx: NetscriptContext, type: string, name: string): IAction {\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 ctx.makeRuntimeErrorMsg(`Invalid action type='${type}', name='${name}'`);\n }\n const actionObj = bladeburner.getActionObject(actionId);\n if (!actionObj) {\n throw ctx.makeRuntimeErrorMsg(`Invalid action type='${type}', name='${name}'`);\n }\n\n return actionObj;\n };\n\n return {\n getContractNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\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: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\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: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_blackOpName: unknown): number => {\n const blackOpName = ctx.helper.string(\"blackOpName\", _blackOpName);\n checkBladeburnerAccess(ctx);\n const action: any = getBladeburnerActionObject(ctx, \"blackops\", blackOpName);\n return action.reqdRank;\n },\n getGeneralActionNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\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: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): boolean => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n checkBladeburnerAccess(ctx);\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 ctx.makeRuntimeErrorMsg(e);\n }\n },\n stopBladeburnerAction: (ctx: NetscriptContext) => (): void => {\n checkBladeburnerAccess(ctx);\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: (ctx: NetscriptContext) => (): BladeburnerCurAction => {\n checkBladeburnerAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n const time = bladeburner.getActionTimeNetscriptFn(player, type, name);\n if (typeof time === \"string\") {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n ctx.log(() => errorLogText);\n return -1;\n } else {\n return time;\n }\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getActionEstimatedSuccessChance:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): [number, number] => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n const chance = bladeburner.getActionEstimatedSuccessChanceNetscriptFn(player, type, name);\n if (typeof chance === \"string\") {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n ctx.log(() => errorLogText);\n return [-1, -1];\n } else {\n return chance;\n }\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getActionRepGain:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _level: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const level = ctx.helper.number(\"level\", _level);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, 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:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n checkBladeburnerAccess(ctx);\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 ctx.makeRuntimeErrorMsg(e);\n }\n },\n getActionMaxLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.maxLevel;\n },\n getActionCurrentLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.level;\n },\n getActionAutolevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): boolean => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.autoLevel;\n },\n setActionAutolevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _autoLevel: unknown = true): void => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const autoLevel = ctx.helper.boolean(_autoLevel);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n action.autoLevel = autoLevel;\n },\n setActionLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _level: unknown = 1): void => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const level = ctx.helper.number(\"level\", _level);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n if (level < 1 || level > action.maxLevel) {\n ctx.helper.makeRuntimeErrorMsg(`Level must be between 1 and ${action.maxLevel}, is ${level}`);\n }\n action.level = level;\n },\n getRank: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\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: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_skillName: unknown): number => {\n const skillName = ctx.helper.string(\"skillName\", _skillName);\n checkBladeburnerAccess(ctx);\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 ctx.makeRuntimeErrorMsg(e);\n }\n },\n getSkillUpgradeCost:\n (ctx: NetscriptContext) =>\n (_skillName: unknown): number => {\n const skillName = ctx.helper.string(\"skillName\", _skillName);\n checkBladeburnerAccess(ctx);\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 ctx.makeRuntimeErrorMsg(e);\n }\n },\n upgradeSkill:\n (ctx: NetscriptContext) =>\n (_skillName: unknown): boolean => {\n const skillName = ctx.helper.string(\"skillName\", _skillName);\n checkBladeburnerAccess(ctx);\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 ctx.makeRuntimeErrorMsg(e);\n }\n },\n getTeamSize:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n checkBladeburnerAccess(ctx);\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 ctx.makeRuntimeErrorMsg(e);\n }\n },\n setTeamSize:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _size: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const size = ctx.helper.number(\"size\", _size);\n checkBladeburnerAccess(ctx);\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 ctx.makeRuntimeErrorMsg(e);\n }\n },\n getCityEstimatedPopulation:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = ctx.helper.string(\"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, 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:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = ctx.helper.string(\"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, 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:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = ctx.helper.string(\"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, 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: (ctx: NetscriptContext) => (): string => {\n checkBladeburnerAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): boolean => {\n const cityName = ctx.helper.string(\"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n bladeburner.city = cityName;\n return true;\n },\n getStamina: (ctx: NetscriptContext) => (): [number, number] => {\n checkBladeburnerAccess(ctx);\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: (ctx: NetscriptContext) => (): boolean => {\n checkBladeburnerAccess(ctx, 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: (ctx: NetscriptContext) => (): boolean => {\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 ctx.log(() => \"You have been accepted into the Bladeburner division\");\n\n return true;\n } else {\n ctx.log(() => \"You do not meet the requirements for joining the Bladeburner division\");\n return false;\n }\n }\n return false;\n },\n getBonusTime: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\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) * 1000;\n },\n };\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { is2DArray } from \"../utils/helpers/is2DArray\";\nimport { CodingContract } from \"../CodingContracts\";\nimport { CodingAttemptOptions, CodingContract as ICodingContract } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\n\nexport function NetscriptCodingContract(player: IPlayer, workerScript: WorkerScript): InternalAPI<ICodingContract> {\n const getCodingContract = function (\n ctx: NetscriptContext,\n func: string,\n hostname: string,\n filename: string,\n ): CodingContract {\n const server = ctx.helper.getServer(hostname);\n const contract = server.getContract(filename);\n if (contract == null) {\n throw ctx.makeRuntimeErrorMsg(`Cannot find contract '${filename}' on server '${hostname}'`);\n }\n\n return contract;\n };\n\n return {\n attempt:\n (ctx: NetscriptContext) =>\n (\n answer: any,\n _filename: unknown,\n _hostname: unknown = workerScript.hostname,\n { returnReward }: CodingAttemptOptions = { returnReward: false },\n ): boolean | string => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"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 = ctx.helper.getServer(hostname);\n if (contract.isSolution(answer)) {\n const reward = player.gainCodingContractReward(creward, contract.getDifficulty());\n ctx.log(() => `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 ctx.log(() => `Coding Contract attempt '${filename}' failed. Contract is now self-destructing`);\n serv.removeContract(filename);\n } else {\n ctx.log(\n () =>\n `Coding Contract attempt '${filename}' failed. ${\n contract.getMaxNumTries() - contract.tries\n } attempts remaining.`,\n );\n }\n\n return returnReward ? \"\" : false;\n }\n },\n getContractType:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = workerScript.hostname): string => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getContractType\", hostname, filename);\n return contract.getType();\n },\n getData:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = workerScript.hostname): any => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"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:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = workerScript.hostname): string => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getDescription\", hostname, filename);\n return contract.getDescription();\n },\n getNumTriesRemaining:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = workerScript.hostname): number => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"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 { 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 BulkPurchase,\n SellShares,\n BuyBackShares,\n SetSmartSupplyUseLeftovers,\n LimitMaterialProduction,\n LimitProductProduction,\n UpgradeWarehouseCost,\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\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\n\nexport function NetscriptCorporation(player: IPlayer, workerScript: WorkerScript): InternalAPI<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 if (BitNodeMultipliers.CorporationSoftcap < 0.15)\n throw new Error(`You cannot create a corporation in Bitnode ${player.bitNodeN}`);\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.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n return corporation.unlockUpgrades[upgN] === 1;\n }\n\n function getUnlockUpgradeCost(upgradeName: string): number {\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n return upgrade.price;\n }\n\n function getUpgradeLevel(ctx: NetscriptContext, _upgradeName: string): number {\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n return corporation.upgrades[upgN];\n }\n\n function getUpgradeLevelCost(ctx: NetscriptContext, _upgradeName: string): number {\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n const baseCost = upgrade.basePrice;\n const priceMult = upgrade.priceMult;\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 (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length ||\n corporation.public\n )\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 (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length ||\n corporation.public\n )\n 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)\n throw new Error(\"Invalid value for amount field! Must be numeric, grater than 0.\");\n\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: string): 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: string, cityName: string): 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: string, cityName: string): 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: string, cityName: string, materialName: string): 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: string, productName: string): 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: string, cityName: string, employeeName: string): 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(ctx: NetscriptContext, api?: number): void {\n if (player.corporation === null) throw ctx.makeRuntimeErrorMsg(\"Must own a corporation.\");\n if (!api) return;\n\n if (!player.corporation.unlockUpgrades[api]) throw ctx.makeRuntimeErrorMsg(\"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\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.slice(),\n cities: cities,\n products: division.products === undefined ? [] : Object.keys(division.products),\n makesProducts: division.makesProducts,\n };\n }\n\n const warehouseAPI: InternalAPI<WarehouseAPI> = {\n getPurchaseWarehouseCost: (ctx: NetscriptContext) => (): number => {\n checkAccess(ctx, 7);\n return CorporationConstants.WarehouseInitialCost;\n },\n getUpgradeWarehouseCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _amt: unknown = 1): number => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const amt = ctx.helper.number(\"amount\", _amt);\n if (amt < 1) {\n throw ctx.makeRuntimeErrorMsg(\"You must provide a positive number\");\n }\n const warehouse = getWarehouse(divisionName, cityName);\n return UpgradeWarehouseCost(warehouse, amt);\n },\n hasWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): boolean => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\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:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): NSWarehouse => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\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:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown): NSMaterial => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const material = getMaterial(divisionName, cityName, materialName);\n const corporation = getCorporation();\n return {\n cost: material.bCost,\n sCost: material.sCost,\n name: material.name,\n qty: material.qty,\n qlt: material.qlt,\n dmd: corporation.unlockUpgrades[2] ? material.dmd : undefined,\n cmp: corporation.unlockUpgrades[3] ? material.cmp : undefined,\n prod: material.prd,\n sell: material.sll,\n };\n },\n getProduct:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown): NSProduct => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const product = getProduct(divisionName, productName);\n const corporation = getCorporation();\n return {\n name: product.name,\n dmd: corporation.unlockUpgrades[2] ? product.dmd : undefined,\n cmp: corporation.unlockUpgrades[3] ? product.cmp : undefined,\n rat: product.rat,\n properties: {\n qlt: product.qlt,\n per: product.per,\n dur: product.dur,\n rel: product.rel,\n aes: product.aes,\n fea: product.fea,\n },\n pCost: product.pCost,\n sCost: product.sCost,\n cityData: product.data,\n developmentProgress: product.prog,\n };\n },\n purchaseWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const corporation = getCorporation();\n PurchaseWarehouse(corporation, getDivision(divisionName), cityName);\n },\n upgradeWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _amt: unknown = 1): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const amt = ctx.helper.number(\"amount\", _amt);\n const corporation = getCorporation();\n if (amt < 1) {\n throw ctx.makeRuntimeErrorMsg(\"You must provide a positive number\");\n }\n UpgradeWarehouse(corporation, getDivision(divisionName), getWarehouse(divisionName, cityName), amt);\n },\n sellMaterial:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _amt: unknown, _price: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.string(\"amt\", _amt);\n const price = ctx.helper.string(\"price\", _price);\n const material = getMaterial(divisionName, cityName, materialName);\n SellMaterial(material, amt, price);\n },\n sellProduct:\n (ctx: NetscriptContext) =>\n (\n _divisionName: unknown,\n _cityName: unknown,\n _productName: unknown,\n _amt: unknown,\n _price: unknown,\n _all: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const amt = ctx.helper.string(\"amt\", _amt);\n const price = ctx.helper.string(\"price\", _price);\n const all = ctx.helper.boolean(_all);\n const product = getProduct(divisionName, productName);\n SellProduct(product, cityName, amt, price, all);\n },\n discontinueProduct:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"productName\", _productName);\n getDivision(divisionName).discontinueProduct(getProduct(divisionName, productName));\n },\n setSmartSupply:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _enabled: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const enabled = ctx.helper.boolean(_enabled);\n const warehouse = getWarehouse(divisionName, cityName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw ctx.makeRuntimeErrorMsg(`You have not purchased the Smart Supply upgrade!`);\n SetSmartSupply(warehouse, enabled);\n },\n setSmartSupplyUseLeftovers:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _enabled: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const enabled = ctx.helper.boolean(_enabled);\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw ctx.makeRuntimeErrorMsg(`You have not purchased the Smart Supply upgrade!`);\n SetSmartSupplyUseLeftovers(warehouse, material, enabled);\n },\n buyMaterial:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _amt: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.number(\"amt\", _amt);\n if (amt < 0) throw new Error(\"Invalid value for amount field! Must be numeric and greater than 0\");\n const material = getMaterial(divisionName, cityName, materialName);\n BuyMaterial(material, amt);\n },\n bulkPurchase:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _amt: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n if (!hasResearched(getDivision(divisionName), \"Bulk Purchasing\"))\n throw new Error(`You have not researched Bulk Purchasing in ${divisionName}`);\n const corporation = getCorporation();\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.number(\"amt\", _amt);\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n BulkPurchase(corporation, warehouse, material, amt);\n },\n makeProduct:\n (ctx: NetscriptContext) =>\n (\n _divisionName: unknown,\n _cityName: unknown,\n _productName: unknown,\n _designInvest: unknown,\n _marketingInvest: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const designInvest = ctx.helper.number(\"designInvest\", _designInvest);\n const marketingInvest = ctx.helper.number(\"marketingInvest\", _marketingInvest);\n const corporation = getCorporation();\n MakeProduct(corporation, getDivision(divisionName), cityName, productName, designInvest, marketingInvest);\n },\n limitProductProduction:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown, _cityName: unknown, _qty: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const qty = ctx.helper.number(\"qty\", _qty);\n LimitProductProduction(getProduct(divisionName, productName), cityName, qty);\n },\n exportMaterial:\n (ctx: NetscriptContext) =>\n (\n _sourceDivision: unknown,\n _sourceCity: unknown,\n _targetDivision: unknown,\n _targetCity: unknown,\n _materialName: unknown,\n _amt: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const sourceDivision = ctx.helper.string(\"sourceDivision\", _sourceDivision);\n const sourceCity = ctx.helper.string(\"sourceCity\", _sourceCity);\n const targetDivision = ctx.helper.string(\"targetDivision\", _targetDivision);\n const targetCity = ctx.helper.string(\"targetCity\", _targetCity);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.string(\"amt\", _amt);\n ExportMaterial(\n targetDivision,\n targetCity,\n getMaterial(sourceDivision, sourceCity, materialName),\n amt + \"\",\n getDivision(targetDivision),\n );\n },\n cancelExportMaterial:\n (ctx: NetscriptContext) =>\n (\n _sourceDivision: unknown,\n _sourceCity: unknown,\n _targetDivision: unknown,\n _targetCity: unknown,\n _materialName: unknown,\n _amt: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const sourceDivision = ctx.helper.string(\"sourceDivision\", _sourceDivision);\n const sourceCity = ctx.helper.string(\"sourceCity\", _sourceCity);\n const targetDivision = ctx.helper.string(\"targetDivision\", _targetDivision);\n const targetCity = ctx.helper.string(\"targetCity\", _targetCity);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.string(\"amt\", _amt);\n CancelExportMaterial(\n targetDivision,\n targetCity,\n getMaterial(sourceDivision, sourceCity, materialName),\n amt + \"\",\n );\n },\n limitMaterialProduction:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _qty: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const qty = ctx.helper.number(\"qty\", _qty);\n LimitMaterialProduction(getMaterial(divisionName, cityName, materialName), qty);\n },\n setMaterialMarketTA1:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw ctx.makeRuntimeErrorMsg(`You have not researched MarketTA.I for division: ${divisionName}`);\n SetMaterialMarketTA1(getMaterial(divisionName, cityName, materialName), on);\n },\n setMaterialMarketTA2:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw ctx.makeRuntimeErrorMsg(`You have not researched MarketTA.II for division: ${divisionName}`);\n SetMaterialMarketTA2(getMaterial(divisionName, cityName, materialName), on);\n },\n setProductMarketTA1:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw ctx.makeRuntimeErrorMsg(`You have not researched MarketTA.I for division: ${divisionName}`);\n SetProductMarketTA1(getProduct(divisionName, productName), on);\n },\n setProductMarketTA2:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw ctx.makeRuntimeErrorMsg(`You have not researched MarketTA.II for division: ${divisionName}`);\n SetProductMarketTA2(getProduct(divisionName, productName), on);\n },\n };\n\n const officeAPI: InternalAPI<OfficeAPI> = {\n getHireAdVertCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n const upgrade = IndustryUpgrades[1];\n return upgrade[1] * Math.pow(upgrade[2], division.upgrades[1]);\n },\n getHireAdVertCount:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return division.upgrades[1];\n },\n getResearchCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const researchName = ctx.helper.string(\"researchName\", _researchName);\n return getResearchCost(getDivision(divisionName), researchName);\n },\n hasResearched:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): boolean => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const researchName = ctx.helper.string(\"researchName\", _researchName);\n return hasResearched(getDivision(divisionName), researchName);\n },\n setAutoJobAssignment:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _job: unknown, _amount: unknown): Promise<boolean> => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const amount = ctx.helper.number(\"amount\", _amount);\n const job = ctx.helper.string(\"job\", _job);\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 return Promise.resolve(office.setEmployeeToJob(job, amount));\n });\n },\n getOfficeSizeUpgradeCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _size: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const size = ctx.helper.number(\"size\", _size);\n if (size < 0) throw new Error(\"Invalid value for size field! Must be numeric and greater 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:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _employeeName: unknown, _job: unknown): Promise<void> => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const employeeName = ctx.helper.string(\"employeeName\", _employeeName);\n const job = ctx.helper.string(\"job\", _job);\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:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): any => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const office = getOffice(divisionName, cityName);\n const employee = office.hireRandomEmployee();\n if (employee === undefined) return undefined;\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 upgradeOfficeSize:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _size: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const size = ctx.helper.number(\"size\", _size);\n if (size < 0) throw new Error(\"Invalid value for size field! Must be numeric and greater than 0\");\n const office = getOffice(divisionName, cityName);\n const corporation = getCorporation();\n UpgradeOfficeSize(corporation, office, size);\n },\n throwParty:\n (ctx: NetscriptContext) =>\n async (_divisionName: unknown, _cityName: unknown, _costPerEmployee: unknown): Promise<number> => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const costPerEmployee = ctx.helper.number(\"costPerEmployee\", _costPerEmployee);\n if (costPerEmployee < 0)\n throw new Error(\"Invalid value for Cost Per Employee field! Must be numeric and greater 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:\n (ctx: NetscriptContext) =>\n async (_divisionName: unknown, _cityName: unknown): Promise<void> => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _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(BuyCoffee(corporation, getDivision(divisionName), getOffice(divisionName, cityName)));\n });\n },\n hireAdVert:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const corporation = getCorporation();\n HireAdVert(corporation, getDivision(divisionName), getOffice(divisionName, \"Sector-12\"));\n },\n research:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const researchName = ctx.helper.string(\"researchName\", _researchName);\n Research(getDivision(divisionName), researchName);\n },\n getOffice:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): any => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\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 employeeJobs: {\n Operations: office.employeeJobs[EmployeePositions.Operations],\n Engineer: office.employeeJobs[EmployeePositions.Engineer],\n Business: office.employeeJobs[EmployeePositions.Business],\n Management: office.employeeJobs[EmployeePositions.Management],\n \"Research & Development\": office.employeeJobs[EmployeePositions.RandD],\n Training: office.employeeJobs[EmployeePositions.Training],\n Unassigned: office.employeeJobs[EmployeePositions.Unassigned],\n },\n };\n },\n getEmployee:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _employeeName: unknown): NSEmployee => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const employeeName = ctx.helper.string(\"employeeName\", _employeeName);\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:\n (ctx: NetscriptContext) =>\n (_industryName: unknown, _divisionName: unknown): void => {\n checkAccess(ctx);\n const industryName = ctx.helper.string(\"industryName\", _industryName);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const corporation = getCorporation();\n NewIndustry(corporation, industryName, divisionName);\n },\n expandCity:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): void => {\n checkAccess(ctx);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\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:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): void => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n UnlockUpgrade(corporation, upgrade);\n },\n levelUpgrade:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): void => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n LevelUpgrade(corporation, upgrade);\n },\n issueDividends:\n (ctx: NetscriptContext) =>\n (_percent: unknown): void => {\n checkAccess(ctx);\n const percent = ctx.helper.number(\"percent\", _percent);\n if (percent < 0 || percent > 100)\n throw new Error(\"Invalid value for percent field! Must be numeric, greater than 0, and less than 100\");\n const corporation = getCorporation();\n if (!corporation.public) throw ctx.makeRuntimeErrorMsg(`Your company has not gone public!`);\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:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): NSDivision => {\n checkAccess(ctx);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return getSafeDivision(division);\n },\n getCorporation: (ctx: NetscriptContext) => (): CorporationInfo => {\n checkAccess(ctx);\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:\n (ctx: NetscriptContext) =>\n (_corporationName: unknown, _selfFund: unknown = true): boolean => {\n const corporationName = ctx.helper.string(\"corporationName\", _corporationName);\n const selfFund = ctx.helper.boolean(_selfFund);\n return createCorporation(corporationName, selfFund);\n },\n hasUnlockUpgrade:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): boolean => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return hasUnlockUpgrade(upgradeName);\n },\n getUnlockUpgradeCost:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return getUnlockUpgradeCost(upgradeName);\n },\n getUpgradeLevel:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return getUpgradeLevel(ctx, upgradeName);\n },\n getUpgradeLevelCost:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return getUpgradeLevelCost(ctx, upgradeName);\n },\n getExpandIndustryCost:\n (ctx: NetscriptContext) =>\n (_industryName: unknown): number => {\n checkAccess(ctx);\n const industryName = ctx.helper.string(\"industryName\", _industryName);\n return getExpandIndustryCost(industryName);\n },\n getExpandCityCost: (ctx: NetscriptContext) => (): number => {\n checkAccess(ctx);\n return getExpandCityCost();\n },\n getInvestmentOffer: (ctx: NetscriptContext) => (): InvestmentOffer => {\n checkAccess(ctx);\n return getInvestmentOffer();\n },\n acceptInvestmentOffer: (ctx: NetscriptContext) => (): boolean => {\n checkAccess(ctx);\n return acceptInvestmentOffer();\n },\n goPublic:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): boolean => {\n checkAccess(ctx);\n const numShares = ctx.helper.number(\"numShares\", _numShares);\n return goPublic(numShares);\n },\n sellShares:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): number => {\n checkAccess(ctx);\n const numShares = ctx.helper.number(\"numShares\", _numShares);\n return SellShares(getCorporation(), player, numShares);\n },\n buyBackShares:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): boolean => {\n checkAccess(ctx);\n const numShares = ctx.helper.number(\"numShares\", _numShares);\n return BuyBackShares(getCorporation(), player, numShares);\n },\n bribe:\n (ctx: NetscriptContext) =>\n (_factionName: unknown, _amountCash: unknown, _amountShares: unknown): boolean => {\n checkAccess(ctx);\n const factionName = ctx.helper.string(\"factionName\", _factionName);\n const amountCash = ctx.helper.number(\"amountCash\", _amountCash);\n const amountShares = ctx.helper.number(\"amountShares\", _amountShares);\n return bribe(factionName, amountCash, amountShares);\n },\n getBonusTime: (ctx: NetscriptContext) => (): number => {\n checkAccess(ctx);\n return Math.round(getCorporation().storedCycles / 5) * 1000;\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 mat.maxsll =\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, (mat.maxsll + \"\").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(mat.maxsll, sellAmt);\n } else if (mat.sllman[1] === -1) {\n //Backwards compatibility, -1 = MAX\n sellAmt = mat.maxsll;\n } else {\n //Player's input value is just a number\n sellAmt = Math.min(mat.maxsll, 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 product.maxsll =\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, (product.maxsll + \"\").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 = product.maxsll;\n }\n sellAmt = Math.min(product.maxsll, tmp);\n } else if (product.sllman[city][0] && product.sllman[city][1] > 0) {\n //Sell amount is manually limited\n sellAmt = Math.min(product.maxsll, product.sllman[city][1]);\n } else if (product.sllman[city][0] === false) {\n sellAmt = 0;\n } else {\n sellAmt = product.maxsll;\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\";\nimport { favorToRep as calculateFavorToRep, repToFavor as calculateRepToFavor } from \"../Faction/formulas/favor\";\nimport { repFromDonation } from \"../Faction/formulas/donation\";\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 reputation: {\n calculateFavorToRep: function (_favor: unknown): number {\n const favor = helper.number(\"calculateFavorToRep\", \"favor\", _favor);\n checkFormulasAccess(\"reputation.calculateFavorToRep\");\n return calculateFavorToRep(favor);\n },\n calculateRepToFavor: function (_rep: unknown): number {\n const rep = helper.number(\"calculateRepToFavor\", \"rep\", _rep);\n checkFormulasAccess(\"reputation.calculateRepToFavor\");\n return calculateRepToFavor(rep);\n },\n repFromDonation: function (_amount: unknown, player: any): number {\n const amount = helper.number(\"repFromDonation\", \"amount\", _amount);\n checkFormulasAccess(\"reputation.repFromDonation\");\n return repFromDonation(amount, player);\n },\n },\n skills: {\n calculateSkill: function (_exp: unknown, _mult: unknown = 1): number {\n const exp = helper.number(\"calculateSkill\", \"exp\", _exp);\n const mult = helper.number(\"calculateSkill\", \"mult\", _mult);\n checkFormulasAccess(\"skills.calculateSkill\");\n return calculateSkill(exp, mult);\n },\n calculateExp: function (_skill: unknown, _mult: unknown = 1): number {\n const skill = helper.number(\"calculateExp\", \"skill\", _skill);\n const mult = helper.number(\"calculateExp\", \"mult\", _mult);\n checkFormulasAccess(\"skills.calculateExp\");\n return calculateExp(skill, mult);\n },\n },\n hacking: {\n hackChance: function (server: any, player: any): number {\n checkFormulasAccess(\"hacking.hackChance\");\n return calculateHackingChance(server, player);\n },\n hackExp: function (server: any, player: any): number {\n checkFormulasAccess(\"hacking.hackExp\");\n return calculateHackingExpGain(server, player);\n },\n hackPercent: function (server: any, player: any): number {\n checkFormulasAccess(\"hacking.hackPercent\");\n return calculatePercentMoneyHacked(server, player);\n },\n growPercent: function (server: any, _threads: unknown, player: any, _cores: unknown = 1): number {\n const threads = helper.number(\"growPercent\", \"threads\", _threads);\n const cores = helper.number(\"growPercent\", \"cores\", _cores);\n checkFormulasAccess(\"hacking.growPercent\");\n return calculateServerGrowth(server, threads, player, cores);\n },\n hackTime: function (server: any, player: any): number {\n checkFormulasAccess(\"hacking.hackTime\");\n return calculateHackingTime(server, player) * 1000;\n },\n growTime: function (server: any, player: any): number {\n checkFormulasAccess(\"hacking.growTime\");\n return calculateGrowTime(server, player) * 1000;\n },\n weakenTime: function (server: any, player: any): number {\n checkFormulasAccess(\"hacking.weakenTime\");\n return calculateWeakenTime(server, player) * 1000;\n },\n },\n hacknetNodes: {\n moneyGainRate: function (_level: unknown, _ram: unknown, _cores: unknown, _mult: unknown = 1): number {\n const level = helper.number(\"moneyGainRate\", \"level\", _level);\n const ram = helper.number(\"moneyGainRate\", \"ram\", _ram);\n const cores = helper.number(\"moneyGainRate\", \"cores\", _cores);\n const mult = helper.number(\"moneyGainRate\", \"mult\", _mult);\n checkFormulasAccess(\"hacknetNodes.moneyGainRate\");\n return calculateMoneyGainRate(level, ram, cores, mult);\n },\n levelUpgradeCost: function (_startingLevel: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number {\n const startingLevel = helper.number(\"levelUpgradeCost\", \"startingLevel\", _startingLevel);\n const extraLevels = helper.number(\"levelUpgradeCost\", \"extraLevels\", _extraLevels);\n const costMult = helper.number(\"levelUpgradeCost\", \"costMult\", _costMult);\n checkFormulasAccess(\"hacknetNodes.levelUpgradeCost\");\n return calculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost: function (_startingRam: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number {\n const startingRam = helper.number(\"ramUpgradeCost\", \"startingRam\", _startingRam);\n const extraLevels = helper.number(\"ramUpgradeCost\", \"extraLevels\", _extraLevels);\n const costMult = helper.number(\"ramUpgradeCost\", \"costMult\", _costMult);\n checkFormulasAccess(\"hacknetNodes.ramUpgradeCost\");\n return calculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost: function (_startingCore: unknown, _extraCores: unknown = 1, _costMult: unknown = 1): number {\n const startingCore = helper.number(\"coreUpgradeCost\", \"startingCore\", _startingCore);\n const extraCores = helper.number(\"coreUpgradeCost\", \"extraCores\", _extraCores);\n const costMult = helper.number(\"coreUpgradeCost\", \"costMult\", _costMult);\n checkFormulasAccess(\"hacknetNodes.coreUpgradeCost\");\n return calculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n hacknetNodeCost: function (_n: unknown, _mult: unknown): number {\n const n = helper.number(\"hacknetNodeCost\", \"n\", _n);\n const mult = helper.number(\"hacknetNodeCost\", \"mult\", _mult);\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 (\n _level: unknown,\n _ramUsed: unknown,\n _maxRam: unknown,\n _cores: unknown,\n _mult: unknown = 1,\n ): number {\n const level = helper.number(\"hashGainRate\", \"level\", _level);\n const ramUsed = helper.number(\"hashGainRate\", \"ramUsed\", _ramUsed);\n const maxRam = helper.number(\"hashGainRate\", \"maxRam\", _maxRam);\n const cores = helper.number(\"hashGainRate\", \"cores\", _cores);\n const mult = helper.number(\"hashGainRate\", \"mult\", _mult);\n checkFormulasAccess(\"hacknetServers.hashGainRate\");\n return HScalculateHashGainRate(level, ramUsed, maxRam, cores, mult);\n },\n levelUpgradeCost: function (_startingLevel: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number {\n const startingLevel = helper.number(\"levelUpgradeCost\", \"startingLevel\", _startingLevel);\n const extraLevels = helper.number(\"levelUpgradeCost\", \"extraLevels\", _extraLevels);\n const costMult = helper.number(\"levelUpgradeCost\", \"costMult\", _costMult);\n checkFormulasAccess(\"hacknetServers.levelUpgradeCost\");\n return HScalculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost: function (_startingRam: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number {\n const startingRam = helper.number(\"ramUpgradeCost\", \"startingRam\", _startingRam);\n const extraLevels = helper.number(\"ramUpgradeCost\", \"extraLevels\", _extraLevels);\n const costMult = helper.number(\"ramUpgradeCost\", \"costMult\", _costMult);\n checkFormulasAccess(\"hacknetServers.ramUpgradeCost\");\n return HScalculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost: function (_startingCore: unknown, _extraCores: unknown = 1, _costMult: unknown = 1): number {\n const startingCore = helper.number(\"coreUpgradeCost\", \"startingCore\", _startingCore);\n const extraCores = helper.number(\"coreUpgradeCost\", \"extraCores\", _extraCores);\n const costMult = helper.number(\"coreUpgradeCost\", \"costMult\", _costMult);\n checkFormulasAccess(\"hacknetServers.coreUpgradeCost\");\n return HScalculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n cacheUpgradeCost: function (_startingCache: unknown, _extraCache: unknown = 1): number {\n const startingCache = helper.number(\"cacheUpgradeCost\", \"startingCache\", _startingCache);\n const extraCache = helper.number(\"cacheUpgradeCost\", \"extraCache\", _extraCache);\n checkFormulasAccess(\"hacknetServers.cacheUpgradeCost\");\n return HScalculateCacheUpgradeCost(startingCache, extraCache);\n },\n hashUpgradeCost: function (_upgName: unknown, _level: unknown): number {\n const upgName = helper.string(\"hashUpgradeCost\", \"upgName\", _upgName);\n const level = helper.number(\"hashUpgradeCost\", \"level\", _level);\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: unknown, _mult: unknown = 1): number {\n const n = helper.number(\"hacknetServerCost\", \"n\", _n);\n const mult = helper.number(\"hacknetServerCost\", \"mult\", _mult);\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: unknown): number {\n const exp = helper.number(\"ascensionPointsGain\", \"exp\", _exp);\n checkFormulasAccess(\"gang.ascensionPointsGain\");\n return calculateAscensionPointsGain(exp);\n },\n ascensionMultiplier: function (_points: unknown): number {\n const points = helper.number(\"ascensionMultiplier\", \"points\", _points);\n checkFormulasAccess(\"gang.ascensionMultiplier\");\n return calculateAscensionMult(points);\n },\n },\n };\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { buyStock, sellStock, shortStock, sellShort } from \"../StockMarket/BuyingAndSelling\";\nimport { StockMarket, SymbolToStockMap, placeOrder, cancelOrder, initStockMarketFn } 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 {\n getStockMarket4SDataCost,\n getStockMarket4STixApiCost,\n getStockMarketWseCost,\n getStockMarketTixApiCost,\n} from \"../StockMarket/StockMarketCosts\";\nimport { Stock } from \"../StockMarket/Stock\";\nimport { TIX } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\n\nexport function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript): InternalAPI<TIX> {\n /**\n * Checks if the player has TIX API access. Throws an error if the player does not\n */\n const checkTixApiAccess = function (ctx: NetscriptContext): void {\n if (!player.hasWseAccount) {\n throw ctx.makeRuntimeErrorMsg(`You don't have WSE Access! Cannot use ${ctx.function}()`);\n }\n if (!player.hasTixApiAccess) {\n throw ctx.makeRuntimeErrorMsg(`You don't have TIX API Access! Cannot use ${ctx.function}()`);\n }\n };\n\n const getStockFromSymbol = function (ctx: NetscriptContext, symbol: string): Stock {\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw ctx.makeRuntimeErrorMsg(`Invalid stock symbol: '${symbol}'`);\n }\n\n return stock;\n };\n\n return {\n getSymbols: (ctx: NetscriptContext) => (): string[] => {\n checkTixApiAccess(ctx);\n return Object.values(StockSymbols);\n },\n getPrice:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.price;\n },\n getAskPrice:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.getAskPrice();\n },\n getBidPrice:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.getBidPrice();\n },\n getPosition:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): [number, number, number, number] => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw ctx.makeRuntimeErrorMsg(`Invalid stock symbol: ${symbol}`);\n }\n return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];\n },\n getMaxShares:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.maxShares;\n },\n getPurchaseCost:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _posType: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n let shares = ctx.helper.number(\"shares\", _shares);\n const posType = ctx.helper.string(\"posType\", _posType);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\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:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _posType: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n let shares = ctx.helper.number(\"shares\", _shares);\n const posType = ctx.helper.string(\"posType\", _posType);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\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:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = buyStock(stock, shares, workerScript, {});\n return res ? stock.getAskPrice() : 0;\n },\n sell:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellStock(stock, shares, workerScript, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n short:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\");\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = shortStock(stock, shares, workerScript, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n sellShort:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\");\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellShort(stock, shares, workerScript, {});\n\n return res ? stock.getAskPrice() : 0;\n },\n placeOrder:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _price: unknown, _type: unknown, _pos: unknown): boolean => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n const price = ctx.helper.number(\"price\", _price);\n const type = ctx.helper.string(\"type\", _type);\n const pos = ctx.helper.string(\"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\");\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`Invalid position type: ${pos}`);\n }\n\n return placeOrder(stock, shares, price, orderType, orderPos, workerScript);\n },\n cancelOrder:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _price: unknown, _type: unknown, _pos: unknown): boolean => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n const price = ctx.helper.number(\"price\", _price);\n const type = ctx.helper.string(\"type\", _type);\n const pos = ctx.helper.string(\"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\");\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n if (isNaN(shares) || isNaN(price)) {\n throw ctx.makeRuntimeErrorMsg(`Invalid shares or price. Must be numeric. shares=${shares}, price=${price}`);\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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`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: (ctx: NetscriptContext) => (): any => {\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or have Source-File 8 Level 3.\");\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:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw ctx.makeRuntimeErrorMsg(\"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.mv / 100; // Convert from percentage to decimal\n },\n getForecast:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw ctx.makeRuntimeErrorMsg(\"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(ctx, symbol);\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: (ctx: NetscriptContext) => (): boolean => {\n if (player.has4SData) {\n ctx.log(() => \"Already purchased 4S Market Data.\");\n return true;\n }\n\n if (player.money < getStockMarket4SDataCost()) {\n ctx.log(() => \"Not enough money to purchase 4S Market Data.\");\n return false;\n }\n\n player.has4SData = true;\n player.loseMoney(getStockMarket4SDataCost(), \"stock\");\n ctx.log(() => \"Purchased 4S Market Data\");\n return true;\n },\n purchase4SMarketDataTixApi: (ctx: NetscriptContext) => (): boolean => {\n checkTixApiAccess(ctx);\n\n if (player.has4SDataTixApi) {\n ctx.log(() => \"Already purchased 4S Market Data TIX API\");\n return true;\n }\n\n if (player.money < getStockMarket4STixApiCost()) {\n ctx.log(() => \"Not enough money to purchase 4S Market Data TIX API\");\n return false;\n }\n\n player.has4SDataTixApi = true;\n player.loseMoney(getStockMarket4STixApiCost(), \"stock\");\n ctx.log(() => \"Purchased 4S Market Data TIX API\");\n return true;\n },\n purchaseWseAccount: (ctx: NetscriptContext) => (): boolean => {\n if (player.hasWseAccount) {\n ctx.log(() => \"Already purchased WSE Account\");\n return true;\n }\n\n if (player.money < getStockMarketWseCost()) {\n ctx.log(() => \"Not enough money to purchase WSE Account Access\");\n return false;\n }\n\n player.hasWseAccount = true;\n initStockMarketFn();\n player.loseMoney(getStockMarketWseCost(), \"stock\");\n ctx.log(() => \"Purchased WSE Account Access\");\n return true;\n },\n purchaseTixApi: (ctx: NetscriptContext) => (): boolean => {\n if (player.hasTixApiAccess) {\n ctx.log(() => \"Already purchased TIX API\");\n return true;\n }\n\n if (player.money < getStockMarketTixApiCost()) {\n ctx.log(() => \"Not enough money to purchase TIX API Access\");\n return false;\n }\n\n player.hasTixApiAccess = true;\n player.loseMoney(getStockMarketTixApiCost(), \"stock\");\n ctx.log(() => \"Purchased TIX API\");\n return true;\n },\n };\n}\n","import { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { hasAugmentationPrereqs } from \"../Faction/FactionHelpers\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { GraftableAugmentation } from \"../PersonObjects/Grafting/GraftableAugmentation\";\nimport { getGraftingAvailableAugs, calculateGraftingTimeWithBonus } from \"../PersonObjects/Grafting/GraftingHelpers\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Grafting as IGrafting } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Router } from \"../ui/GameRoot\";\n\nexport function NetscriptGrafting(player: IPlayer): InternalAPI<IGrafting> {\n const checkGraftingAPIAccess = (ctx: NetscriptContext): void => {\n if (!player.canAccessGrafting()) {\n throw ctx.makeRuntimeErrorMsg(\n \"You do not currently have access to the Grafting 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 return {\n getAugmentationGraftPrice:\n (ctx: NetscriptContext) =>\n (_augName: unknown): number => {\n const augName = ctx.helper.string(\"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw ctx.makeRuntimeErrorMsg(`Invalid aug: ${augName}`);\n }\n const graftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n return graftableAug.cost;\n },\n\n getAugmentationGraftTime:\n (ctx: NetscriptContext) =>\n (_augName: string): number => {\n const augName = ctx.helper.string(\"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw ctx.makeRuntimeErrorMsg(`Invalid aug: ${augName}`);\n }\n const graftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n return calculateGraftingTimeWithBonus(player, graftableAug);\n },\n\n getGraftableAugmentations: (ctx: NetscriptContext) => (): string[] => {\n checkGraftingAPIAccess(ctx);\n const graftableAugs = getGraftingAvailableAugs(player);\n return graftableAugs;\n },\n\n graftAugmentation:\n (ctx: NetscriptContext) =>\n (_augName: string, _focus: unknown = true): boolean => {\n const augName = ctx.helper.string(\"augName\", _augName);\n const focus = ctx.helper.boolean(_focus);\n checkGraftingAPIAccess(ctx);\n if (player.city !== CityName.NewTokyo) {\n throw ctx.makeRuntimeErrorMsg(\"You must be in New Tokyo to begin grafting an Augmentation.\");\n }\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n ctx.log(() => `Invalid aug: ${augName}`);\n return false;\n }\n\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n ctx.log(() => txt);\n }\n\n const craftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n if (player.money < craftableAug.cost) {\n ctx.log(() => `You don't have enough money to craft ${augName}`);\n return false;\n }\n\n if (!hasAugmentationPrereqs(craftableAug.augmentation)) {\n ctx.log(() => `You don't have the pre-requisites for ${augName}`);\n return false;\n }\n\n player.loseMoney(craftableAug.cost, \"augmentations\");\n player.startGraftAugmentationWork(augName, craftableAug.time);\n\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n\n ctx.log(() => `Began grafting Augmentation ${augName}.`);\n return true;\n },\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","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 List from \"@mui/material/List\";\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\";\nimport { NSSelection } from \"./NSSelection\";\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\nenum Language {\n None,\n NS1,\n NS2,\n}\n\nexport function InteractiveTutorialRoot(): React.ReactElement {\n const [nsSelectionOpen, setNSSelectionOpen] = useState(false);\n const [language, setLanguage] = useState(Language.None);\n const classes = useStyles();\n\n const tutorialScriptName = {\n [Language.None]: \"n00dles.script\",\n [Language.NS1]: \"n00dles.script\",\n [Language.NS2]: \"n00dles.js\",\n }[language];\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.NSSelection as number]: {\n content: (\n <>\n <Typography>The tutorial will adjust to your programming ability.</Typography>\n <Typography>Bitburner has 2 types of scripts:</Typography>\n <List>\n <ListItem>\n <Typography>NS1: Javascript from 2009, very simple. Recommended for beginners to programming.</Typography>\n </ListItem>\n <ListItem>\n <Typography>\n NS2: Native, modern Javascript. Recommended if you know any programming language or are serious about\n learning programming.\n </Typography>\n </ListItem>\n </List>\n <Typography>\n Both are available at all time and interchangeably. This choice is only for the tutorial.\n </Typography>\n <Button\n onClick={() => {\n setLanguage(Language.NS1);\n iTutorialNextStep();\n }}\n >\n Use NS1\n </Button>\n <Button\n onClick={() => {\n setLanguage(Language.NS2);\n iTutorialNextStep();\n }}\n >\n Use NS2\n </Button>\n <Button onClick={() => setNSSelectionOpen(true)}>More info</Button>\n <br />\n </>\n ),\n canNext: false,\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 to 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 ${tutorialScriptName}`}</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.{\" \"}\n {language !== Language.NS2 && <>Scripts are written in a simplified version of javascript.</>} Copy and\n paste the following code into the script editor: <br />\n </Typography>\n\n <Typography classes={{ root: classes.code }}>\n {language !== Language.NS2 && (\n <CopyableText\n value={`while(true) {\n hack('n00dles');\n}`}\n />\n )}\n {language === Language.NS2 && (\n <CopyableText\n value={`export async function main(ns) {\n\twhile(true) {\n\t\tawait ns.hack('n00dles');\n\t}\n}`}\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 ${tutorialScriptName}`}</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 ${tutorialScriptName}`}</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 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 <>\n <NSSelection open={nsSelectionOpen} onClose={() => setNSSelectionOpen(false)} />\n <Paper square sx={{ maxWidth: \"70vw\", p: 2 }}>\n {content.content}\n {step !== iTutorialSteps.TutorialPageInfo && (\n <>\n {step !== iTutorialSteps.Start && (\n <IconButton onClick={iTutorialPrevStep} aria-label=\"previous\">\n <ArrowBackIos />\n </IconButton>\n )}\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}\n","import Editor from \"@monaco-editor/react\";\nimport { Tab, Tabs, Typography } from \"@mui/material\";\nimport React from \"react\";\n\nimport { Modal } from \"../React/Modal\";\n\nimport * as monaco from \"monaco-editor\";\n\ntype IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nconst ns1Example = `while(true) {\n hack('n00dles');\n}`;\nconst ns2Example = `/** @param {NS} ns */\nexport async function main(ns) {\n\twhile(true) {\n\t\tawait ns.hack('n00dles');\n\t}\n}`;\n\nexport function NSSelection(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 function onMount(editor: IStandaloneCodeEditor): void {\n editor.updateOptions({ readOnly: true });\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose} sx={{ zIndex: 999999 }}>\n <Tabs variant=\"fullWidth\" value={value} onChange={handleChange}>\n <Tab label=\"NS1\" />\n <Tab label=\"NS2\" />\n </Tabs>\n\n {value === 0 && (\n <>\n <Typography>\n These scripts end with '.script'. Using a very old interpreted version of javascript. It is perfect for\n beginner to programming.\n </Typography>\n <Typography>Example script using NS1:</Typography>\n <Editor\n loading={<></>}\n defaultLanguage=\"javascript\"\n defaultValue={ns1Example}\n height={`${300}px`}\n theme={\"vs-dark\"}\n onMount={onMount}\n options={{ fontSize: 30 }}\n />\n </>\n )}\n {value === 1 && (\n <>\n <Typography>\n These scripts end with '.js'. Scripts using ns2 are running natively along the game. If you know any\n programming language you should be using this. However if you're unfamiliar with javascript Promises you\n might want to read up on them a little bit before diving in.\n </Typography>\n <Typography>Example script using NS2:</Typography>\n <Editor\n loading={<></>}\n defaultLanguage=\"javascript\"\n defaultValue={ns2Example}\n height={`${300}px`}\n theme={\"vs-dark\"}\n options={{ fontSize: 30 }}\n />\n </>\n )}\n </Modal>\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 {\n <CurrentIcon\n className={classes.icon}\n color=\"secondary\"\n onClick={() => setOpen((old) => !old)}\n onTouchEnd={() => setOpen((old) => !old)}\n />\n }\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 { KEYCODE } from \"../../utils/helpers/keyCodes\";\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 { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\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\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) || props.router.page() === Page.BitVerse) return;\n if (event.code === KEYCODE.T && event.altKey) {\n event.preventDefault();\n clickTerminal();\n } else if (event.code === KEYCODE.C && event.altKey) {\n event.preventDefault();\n clickStats();\n } else if (event.code === KEYCODE.E && event.altKey) {\n event.preventDefault();\n clickScriptEditor();\n } else if (event.code === KEYCODE.S && event.altKey) {\n event.preventDefault();\n clickActiveScripts();\n } else if (event.code === KEYCODE.H && event.altKey) {\n event.preventDefault();\n clickHacknet();\n } else if (event.code === KEYCODE.W && event.altKey) {\n event.preventDefault();\n clickCity();\n } else if (event.code === KEYCODE.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.code === KEYCODE.R && event.altKey) {\n event.preventDefault();\n clickTravel();\n } else if (event.code === KEYCODE.P && event.altKey) {\n event.preventDefault();\n clickCreateProgram();\n } else if (event.code === KEYCODE.F && event.altKey) {\n if (props.page == Page.Terminal && Settings.EnableBashHotkeys) {\n return;\n }\n event.preventDefault();\n clickFactions();\n } else if (event.code === KEYCODE.A && event.altKey) {\n event.preventDefault();\n clickAugmentations();\n } else if (event.code === KEYCODE.U && event.altKey) {\n event.preventDefault();\n clickTutorial();\n } else if (event.code === KEYCODE.B && event.altKey && props.player.bladeburner) {\n event.preventDefault();\n clickBladeburner();\n } else if (event.code === KEYCODE.G && event.altKey && props.player.gang) {\n event.preventDefault();\n clickGang();\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 <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 {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\n color={![Page.Factions, Page.Faction].includes(props.page) ? \"secondary\" : \"primary\"}\n />\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\n color={flashHacknet ? \"error\" : props.page !== Page.Hacknet ? \"secondary\" : \"primary\"}\n />\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.Grafting || 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","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","/**\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 { SourceFilesElement } 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 Paper from \"@mui/material/Paper\";\nimport Container from \"@mui/material/Container\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { Info } from \"@mui/icons-material\";\n\ninterface NFGDisplayProps {\n player: IPlayer;\n}\n\nconst NeuroFluxDisplay = ({ player }: NFGDisplayProps): React.ReactElement => {\n const level = player.augmentations.find((e) => e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0;\n\n return level > 0 ? (\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\" color={Settings.theme.info}>\n NeuroFlux Governor - Level {level}\n </Typography>\n <Typography color={Settings.theme.info}>\n {StaticAugmentations[AugmentationNames.NeuroFluxGovernor].stats}\n </Typography>\n </Paper>\n ) : (\n <></>\n );\n};\n\ninterface EntropyDisplayProps {\n player: IPlayer;\n}\n\nconst EntropyDisplay = ({ player }: EntropyDisplayProps): React.ReactElement => {\n return player.entropy > 0 ? (\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\" color={Settings.theme.error}>\n Entropy Virus - Level {player.entropy}\n </Typography>\n <Typography color={Settings.theme.error}>\n <b>All multipliers decreased by:</b> {formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropy) * 100, 3)}%\n (multiplicative)\n </Typography>\n </Paper>\n ) : (\n <></>\n );\n};\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 <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0 }}>\n <Typography variant=\"h4\">Augmentations</Typography>\n <Box sx={{ mb: 1 }}>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\" color=\"primary\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n Purchased Augmentations\n <Tooltip\n title={\n <>\n <Typography>\n Below is a list of all Augmentations you have purchased but not yet installed. Click the button\n below to install them.\n </Typography>\n <Typography>\n WARNING: Installing your Augmentations resets most of your progress, including:\n </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\n Augmentations you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your\n home computer (but you will lose all programs besides NUKE.exe)\n </Typography>\n </>\n }\n >\n <Info sx={{ ml: 1, mb: 0.5 }} color=\"info\" />\n </Tooltip>\n </Typography>\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\n your choosing.\n </>\n }\n />\n <Box sx={{ display: \"grid\", width: \"100%\", gridTemplateColumns: \"1fr 1fr\" }}>\n <Tooltip title={<Typography>'I never asked for this'</Typography>}>\n <span>\n <Button sx={{ width: \"100%\" }} disabled={player.queuedAugmentations.length === 0} onClick={doInstall}>\n Install Augmentations\n </Button>\n </span>\n </Tooltip>\n <Tooltip title={<Typography>It's always a good idea to backup/export your save!</Typography>}>\n <Button sx={{ width: \"100%\", color: Settings.theme.successlight }} onClick={doExport}>\n Backup Save {exportBonusStr()}\n </Button>\n </Tooltip>\n </Box>\n </Paper>\n {player.queuedAugmentations.length > 0 ? (\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 3fr\" }}>\n <PurchasedAugmentations />\n <PlayerMultipliers />\n </Box>\n ) : (\n <Paper sx={{ p: 1 }}>\n <Typography>No Augmentations have been purchased yet</Typography>\n </Paper>\n )}\n </Box>\n\n <Box\n sx={{\n my: 1,\n display: \"grid\",\n gridTemplateColumns: `repeat(${\n +!!((player.augmentations.find((e) => e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0) > 0) +\n +!!(player.entropy > 0)\n }, 1fr)`,\n gap: 1,\n }}\n >\n <NeuroFluxDisplay player={player} />\n <EntropyDisplay player={player} />\n </Box>\n\n <Box>\n <InstalledAugmentations />\n </Box>\n <SourceFilesElement />\n </Container>\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 { Box, ListItemButton, Paper, Typography } from \"@mui/material\";\nimport Button from \"@mui/material/Button\";\nimport List from \"@mui/material/List\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport React, { useState } from \"react\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../../ui/Context\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\n\nexport function InstalledAugmentations(): React.ReactElement {\n const setRerender = useState(true)[1];\n const player = use.Player();\n const sourceAugs = player.augmentations.slice().filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor);\n\n const [selectedAug, setSelectedAug] = useState(sourceAugs[0]);\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 <Box sx={{ width: \"100%\" }}>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\">Installed Augmentations</Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}>\n <Tooltip title={\"Sorts the Augmentations alphabetically in numeral order\"}>\n <Button sx={{ width: \"100%\" }} onClick={sortInOrder}>\n Sort in Order\n </Button>\n </Tooltip>\n <Tooltip title={\"Sorts the Augmentations based on when you acquired them (same as default)\"}>\n <Button sx={{ width: \"100%\" }} onClick={sortByAcquirementTime}>\n Sort by Time of Acquirement\n </Button>\n </Tooltip>\n </Box>\n </Paper>\n {sourceAugs.length > 0 ? (\n <Paper sx={{ display: \"grid\", gridTemplateColumns: \"1fr 3fr\" }}>\n <Box>\n <List sx={{ height: 400, overflowY: \"scroll\", borderRight: `1px solid ${Settings.theme.welllight}` }}>\n {sourceAugs.map((k, i) => (\n <ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}>\n <Typography>{k.name}</Typography>\n </ListItemButton>\n ))}\n </List>\n </Box>\n <Box sx={{ m: 1 }}>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n {selectedAug.name}\n </Typography>\n <Typography sx={{ maxHeight: 350, overflowY: \"scroll\" }}>\n {(() => {\n const aug = StaticAugmentations[selectedAug.name];\n\n const info = typeof aug.info === \"string\" ? <span>{aug.info}</span> : aug.info;\n const tooltip = (\n <>\n {info}\n <br />\n <br />\n {aug.stats}\n </>\n );\n return tooltip;\n })()}\n </Typography>\n </Box>\n </Paper>\n ) : (\n <Paper sx={{ p: 1 }}>\n <Typography>No Augmentations have been installed yet</Typography>\n </Paper>\n )}\n </Box>\n );\n}\n","/**\n * React component for displaying the player's multipliers on the Augmentation UI page\n */\nimport { DoubleArrow } from \"@mui/icons-material\";\nimport { List, ListItem, ListItemText, Paper, Typography } from \"@mui/material\";\nimport * as React from \"react\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\n\ninterface IAugmentedStats {\n [index: string]: number;\n}\n\nfunction calculateAugmentedStats(): IAugmentedStats {\n const augP: IAugmentedStats = {};\n for (const aug of Player.queuedAugmentations) {\n const augObj = StaticAugmentations[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\ninterface IBitNodeModifiedStatsProps {\n base: number;\n mult: number;\n color: string;\n}\n\nfunction BitNodeModifiedStats(props: IBitNodeModifiedStatsProps): React.ReactElement {\n // If player doesn't have SF5 or if the property isn't affected by BitNode mults\n if (props.mult === 1 || Player.sourceFileLvl(5) === 0)\n return <Typography color={props.color}>{numeralWrapper.formatPercentage(props.base)}</Typography>;\n\n return (\n <Typography color={props.color}>\n <span style={{ opacity: 0.5 }}>{numeralWrapper.formatPercentage(props.base)}</span>{\" \"}\n {numeralWrapper.formatPercentage(props.base * props.mult)}\n </Typography>\n );\n}\n\ninterface MultiplierListItemData {\n mult: string;\n current: number;\n augmented: number;\n bnMult?: number;\n color?: string;\n}\n\ninterface IMultiplierListProps {\n rows: MultiplierListItemData[];\n}\n\nfunction MultiplierList(props: IMultiplierListProps): React.ReactElement {\n const listItems = props.rows\n .map((data) => {\n const { mult, current, augmented, bnMult = 1, color = Settings.theme.primary } = data;\n\n if (!isNaN(augmented)) {\n return (\n <ListItem key={mult} disableGutters sx={{ py: 0 }}>\n <ListItemText\n sx={{ my: 0.1 }}\n primary={\n <Typography color={color}>\n <b>{mult}</b>\n </Typography>\n }\n secondary={\n <span style={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n <BitNodeModifiedStats base={current} mult={bnMult} color={color} />\n <DoubleArrow fontSize=\"small\" color=\"success\" sx={{ mb: 0.5, mx: 1 }} />\n <BitNodeModifiedStats base={augmented} mult={bnMult} color={Settings.theme.success} />\n </span>\n }\n disableTypography\n />\n </ListItem>\n );\n }\n return;\n })\n .filter((i) => i !== undefined);\n\n return listItems.length > 0 ? <List disablePadding>{listItems}</List> : <></>;\n}\n\nexport function PlayerMultipliers(): React.ReactElement {\n const mults = calculateAugmentedStats();\n\n const leftColData: MultiplierListItemData[] = [\n ...[\n {\n mult: \"Hacking Chance\",\n current: Player.hacking_chance_mult,\n augmented: Player.hacking_chance_mult * mults.hacking_chance_mult,\n },\n {\n mult: \"Hacking Speed\",\n current: Player.hacking_speed_mult,\n augmented: Player.hacking_speed_mult * mults.hacking_speed_mult,\n },\n {\n mult: \"Hacking Money\",\n current: Player.hacking_money_mult,\n augmented: Player.hacking_money_mult * mults.hacking_money_mult,\n bnMult: BitNodeMultipliers.ScriptHackMoney,\n },\n {\n mult: \"Hacking Growth\",\n current: Player.hacking_grow_mult,\n augmented: Player.hacking_grow_mult * mults.hacking_grow_mult,\n },\n {\n mult: \"Hacking Level\",\n current: Player.hacking_mult,\n augmented: Player.hacking_mult * mults.hacking_mult,\n bnMult: BitNodeMultipliers.HackingLevelMultiplier,\n },\n {\n mult: \"Hacking Experience\",\n current: Player.hacking_exp_mult,\n augmented: Player.hacking_exp_mult * mults.hacking_exp_mult,\n bnMult: BitNodeMultipliers.HackExpGain,\n },\n ].map((data: MultiplierListItemData) =>\n Object.defineProperty(data, \"color\", {\n value: Settings.theme.hack,\n }),\n ),\n ...[\n {\n mult: \"Strength Level\",\n current: Player.strength_mult,\n augmented: Player.strength_mult * mults.strength_mult,\n bnMult: BitNodeMultipliers.StrengthLevelMultiplier,\n },\n {\n mult: \"Strength Experience\",\n current: Player.strength_exp_mult,\n augmented: Player.strength_exp_mult * mults.strength_exp_mult,\n },\n {\n mult: \"Defense Level\",\n current: Player.defense_mult,\n augmented: Player.defense_mult * mults.defense_mult,\n bnMult: BitNodeMultipliers.DefenseLevelMultiplier,\n },\n {\n mult: \"Defense Experience\",\n current: Player.defense_exp_mult,\n augmented: Player.defense_exp_mult * mults.defense_exp_mult,\n },\n {\n mult: \"Dexterity Level\",\n current: Player.dexterity_mult,\n augmented: Player.dexterity_mult * mults.dexterity_mult,\n bnMult: BitNodeMultipliers.DexterityLevelMultiplier,\n },\n {\n mult: \"Dexterity Experience\",\n current: Player.dexterity_exp_mult,\n augmented: Player.dexterity_exp_mult * mults.dexterity_exp_mult,\n },\n {\n mult: \"Agility Level\",\n current: Player.agility_mult,\n augmented: Player.agility_mult * mults.agility_mult,\n bnMult: BitNodeMultipliers.AgilityLevelMultiplier,\n },\n {\n mult: \"Agility Experience\",\n current: Player.agility_exp_mult,\n augmented: Player.agility_exp_mult * mults.agility_exp_mult,\n },\n ].map((data: MultiplierListItemData) =>\n Object.defineProperty(data, \"color\", {\n value: Settings.theme.combat,\n }),\n ),\n {\n mult: \"Charisma Level\",\n current: Player.charisma_mult,\n augmented: Player.charisma_mult * mults.charisma_mult,\n bnMult: BitNodeMultipliers.CharismaLevelMultiplier,\n color: Settings.theme.cha,\n },\n {\n mult: \"Charisma Experience\",\n current: Player.charisma_exp_mult,\n augmented: Player.charisma_exp_mult * mults.charisma_exp_mult,\n color: Settings.theme.cha,\n },\n ];\n const rightColData: MultiplierListItemData[] = [\n {\n mult: \"Hacknet Node Production\",\n current: Player.hacknet_node_money_mult,\n augmented: Player.hacknet_node_money_mult * mults.hacknet_node_money_mult,\n bnMult: BitNodeMultipliers.HacknetNodeMoney,\n },\n {\n mult: \"Hacknet Node Purchase Cost\",\n current: Player.hacknet_node_purchase_cost_mult,\n augmented: Player.hacknet_node_purchase_cost_mult * mults.hacknet_node_purchase_cost_mult,\n },\n {\n mult: \"Hacknet Node RAM Upgrade Cost\",\n current: Player.hacknet_node_ram_cost_mult,\n augmented: Player.hacknet_node_ram_cost_mult * mults.hacknet_node_ram_cost_mult,\n },\n {\n mult: \"Hacknet Node Core Purchase Cost\",\n current: Player.hacknet_node_core_cost_mult,\n augmented: Player.hacknet_node_core_cost_mult * mults.hacknet_node_core_cost_mult,\n },\n {\n mult: \"Hacknet Node Level Upgrade Cost\",\n current: Player.hacknet_node_level_cost_mult,\n augmented: Player.hacknet_node_level_cost_mult * mults.hacknet_node_level_cost_mult,\n },\n {\n mult: \"Company Reputation Gain\",\n current: Player.company_rep_mult,\n augmented: Player.company_rep_mult * mults.company_rep_mult,\n },\n {\n mult: \"Faction Reputation Gain\",\n current: Player.faction_rep_mult,\n augmented: Player.faction_rep_mult * mults.faction_rep_mult,\n bnMult: BitNodeMultipliers.FactionWorkRepGain,\n },\n {\n mult: \"Salary\",\n current: Player.work_money_mult,\n augmented: Player.work_money_mult * mults.work_money_mult,\n bnMult: BitNodeMultipliers.CompanyWorkMoney,\n color: Settings.theme.money,\n },\n {\n mult: \"Crime Success Chance\",\n current: Player.crime_success_mult,\n augmented: Player.crime_success_mult * mults.crime_success_mult,\n color: Settings.theme.combat,\n },\n {\n mult: \"Crime Money\",\n current: Player.crime_money_mult,\n augmented: Player.crime_money_mult * mults.crime_money_mult,\n bnMult: BitNodeMultipliers.CrimeMoney,\n color: Settings.theme.money,\n },\n ];\n\n if (Player.canAccessBladeburner()) {\n rightColData.push(\n {\n mult: \"Bladeburner Success Chance\",\n current: Player.bladeburner_success_chance_mult,\n augmented: Player.bladeburner_success_chance_mult * mults.bladeburner_success_chance_mult,\n },\n {\n mult: \"Bladeburner Max Stamina\",\n current: Player.bladeburner_max_stamina_mult,\n augmented: Player.bladeburner_max_stamina_mult * mults.bladeburner_max_stamina_mult,\n },\n {\n mult: \"Bladeburner Stamina Gain\",\n current: Player.bladeburner_stamina_gain_mult,\n augmented: Player.bladeburner_stamina_gain_mult * mults.bladeburner_stamina_gain_mult,\n },\n {\n mult: \"Bladeburner Field Analysis\",\n current: Player.bladeburner_analysis_mult,\n augmented: Player.bladeburner_analysis_mult * mults.bladeburner_analysis_mult,\n },\n );\n }\n\n return (\n <Paper\n sx={{\n p: 1,\n maxHeight: 400,\n overflowY: \"scroll\",\n display: \"flex\",\n flexDirection: \"column\",\n flexWrap: \"wrap\",\n gap: 1,\n }}\n >\n <MultiplierList rows={leftColData} />\n <MultiplierList rows={rightColData} />\n </Paper>\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 { List, ListItemText, Paper, Tooltip, Typography } from \"@mui/material\";\nimport * as React from \"react\";\nimport { Player } from \"../../Player\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\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 let displayName = ownedAug.name;\n\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;\n const aug = StaticAugmentations[ownedAug.name];\n\n let level = null;\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {\n level = ownedAug.level;\n displayName += ` - Level ${level}`;\n }\n\n augs.push(\n <Tooltip\n title={\n <Typography>\n {(() => {\n const info = typeof aug.info === \"string\" ? <span>{aug.info}</span> : aug.info;\n const tooltip = (\n <>\n {info}\n <br />\n <br />\n {aug.stats}\n </>\n );\n return tooltip;\n })()}\n </Typography>\n }\n enterNextDelay={500}\n key={displayName}\n >\n <ListItemText sx={{ px: 2, py: 1 }} primary={displayName} />\n </Tooltip>,\n );\n }\n\n return (\n <Paper sx={{ py: 1, maxHeight: 400, overflowY: \"scroll\" }}>\n <List sx={{ height: 400, overflowY: \"scroll\" }} disablePadding>\n {augs}\n </List>\n </Paper>\n );\n}\n","import { ListItemButton, ListItemText, Paper } from \"@mui/material\";\nimport Box from \"@mui/material/Box\";\nimport List from \"@mui/material/List\";\nimport Typography from \"@mui/material/Typography\";\nimport React, { useState } from \"react\";\nimport { Exploit, ExploitName } from \"../../Exploits/Exploit\";\nimport { Player } from \"../../Player\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { SourceFile } from \"../../SourceFile/SourceFile\";\nimport { SourceFiles } from \"../../SourceFile/SourceFiles\";\n\ninterface SfMinus1 {\n info: React.ReactElement;\n n: number;\n name: string;\n lvl: number;\n}\n\nconst safeGetSf = (sfNum: number): SourceFile | SfMinus1 | null => {\n if (sfNum === -1) {\n const sfMinus1: SfMinus1 = {\n info: (\n <>\n This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web ecosystem.\n <br />\n <br />\n It increases all of the player's multipliers by 0.1%\n <br />\n <br />\n You have found the following exploits:\n <br />\n <br />\n {Player.exploits.map((c: Exploit) => (\n <React.Fragment key={c}>\n * {ExploitName(c)}\n <br />\n </React.Fragment>\n ))}\n </>\n ),\n lvl: Player.exploits.length,\n n: -1,\n name: \"Source-File -1: Exploits in the BitNodes\",\n };\n return sfMinus1;\n }\n\n const srcFileKey = \"SourceFile\" + sfNum;\n const sfObj = SourceFiles[srcFileKey];\n if (sfObj == null) {\n console.error(`Invalid source file number: ${sfNum}`);\n return null;\n }\n return sfObj;\n};\n\nconst getMaxLevel = (sfObj: SourceFile | SfMinus1): string | number => {\n let maxLevel;\n switch (sfObj.n) {\n case 12:\n maxLevel = \"∞\";\n break;\n case -1:\n maxLevel = Object.keys(Exploit).length;\n break;\n default:\n maxLevel = \"3\";\n }\n return maxLevel;\n};\n\nexport function SourceFilesElement(): React.ReactElement {\n const sourceSfs = Player.sourceFiles.slice();\n const exploits = Player.exploits;\n // Create a fake SF for -1, if \"owned\"\n if (exploits.length > 0) {\n sourceSfs.unshift({\n n: -1,\n lvl: exploits.length,\n });\n }\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceSfs.sort((sf1, sf2) => {\n return sf1.n - sf2.n;\n });\n }\n\n if (sourceSfs.length === 0) {\n return <></>;\n }\n\n const [selectedSf, setSelectedSf] = useState(sourceSfs[0]);\n\n return (\n <Box sx={{ width: \"100%\", mt: 1 }}>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\">Source Files</Typography>\n </Paper>\n <Paper sx={{ display: \"grid\", gridTemplateColumns: \"1fr 3fr\" }}>\n <Box>\n <List\n sx={{ height: 400, overflowY: \"scroll\", borderRight: `1px solid ${Settings.theme.welllight}` }}\n disablePadding\n >\n {sourceSfs.map((e, i) => {\n const sfObj = safeGetSf(e.n);\n if (!sfObj) return;\n\n const maxLevel = getMaxLevel(sfObj);\n\n return (\n <ListItemButton\n key={i + 1}\n onClick={() => setSelectedSf(e)}\n selected={selectedSf.n === e.n}\n sx={{ py: 0 }}\n >\n <ListItemText\n disableTypography\n primary={<Typography>{sfObj.name}</Typography>}\n secondary={\n <Typography>\n Level {e.lvl} / {maxLevel}\n </Typography>\n }\n />\n </ListItemButton>\n );\n })}\n </List>\n </Box>\n <Box sx={{ m: 1 }}>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n {safeGetSf(selectedSf.n)?.name}\n </Typography>\n <Typography sx={{ maxHeight: 350, overflowY: \"scroll\" }}>\n {(() => {\n const sfObj = safeGetSf(selectedSf.n);\n if (!sfObj) return;\n\n const maxLevel = getMaxLevel(sfObj);\n\n return (\n <>\n Level {selectedSf.lvl} / {maxLevel}\n <br />\n <br />\n {sfObj.info}\n </>\n );\n })()}\n </Typography>\n </Box>\n </Paper>\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 { Entropy } from \"./DevMenu/ui/Entropy\";\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 <Entropy 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\";\nimport { MenuItem, SelectChangeEvent, TextField, Select } from \"@mui/material\";\nimport { Bladeburner } from \"../../Bladeburner/Bladeburner\";\nimport { GangConstants } from \"../../Gang/data/Constants\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { checkForMessagesToSend } from \"../../Message/MessageHelpers\";\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 const [corporationName, setCorporationName] = useState(\"\");\n const [gangFaction, setGangFaction] = useState(\"\");\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 function createCorporation(): void {\n props.player.startCorporation(corporationName);\n }\n\n function joinBladeburner(): void {\n props.player.bladeburner = new Bladeburner(props.player);\n }\n\n function startGang(): void {\n const isHacking = gangFaction === FactionNames.NiteSec || gangFaction === FactionNames.TheBlackHand;\n props.player.startGang(gangFaction, isHacking);\n }\n\n function setGangFactionDropdown(event: SelectChangeEvent<string>): void {\n setGangFaction(event.target.value);\n }\n\n function checkMessages(): void {\n checkForMessagesToSend();\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 <Typography>Corporation Name:</Typography>\n <TextField value={corporationName} onChange={(x) => setCorporationName(x.target.value)} />\n <Button onClick={createCorporation}>Create Corporation</Button>\n <br />\n <Typography>Gang Faction:</Typography>\n <Select value={gangFaction} onChange={setGangFactionDropdown}>\n {GangConstants.Names.map((factionName) => (\n <MenuItem key={factionName} value={factionName}>\n {factionName}\n </MenuItem>\n ))}\n </Select>\n <Button onClick={startGang}>Start Gang</Button>\n <br />\n <Button onClick={joinBladeburner}>Join BladeBurner</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 <Button onClick={checkMessages}>Check Messages</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\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nconst bigNumber = 1e12;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Factions(props: IProps): React.ReactElement {\n const [faction, setFaction] = useState(FactionNames.Illuminati as string);\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 Object.values(FactionNames).forEach((faction) => props.player.receiveInvite(faction));\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 { Clear, ExpandMore, Reply, ReplyAll } from \"@mui/icons-material\";\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Button,\n IconButton,\n MenuItem,\n Select,\n SelectChangeEvent,\n Typography,\n} from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\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 function clearQueuedAugs(): void {\n props.player.queuedAugmentations = [];\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMore />}>\n <Typography>Augmentations</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Select\n onChange={setAugmentationDropdown}\n value={augmentation}\n startAdornment={\n <>\n <IconButton onClick={queueAllAugs} size=\"large\">\n <ReplyAll />\n </IconButton>\n <IconButton onClick={queueAug} size=\"large\">\n <Reply />\n </IconButton>\n </>\n }\n endAdornment={\n <>\n <IconButton onClick={clearAugs} size=\"large\">\n <Clear />\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 <Button sx={{ display: \"block\" }} onClick={clearQueuedAugs}>\n Clear Queued Augmentations\n </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 { 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\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nconst bigNumber = 1e12;\n\nexport function Companies(): React.ReactElement {\n const [company, setCompany] = useState(FactionNames.ECorp as string);\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 + bigNumber;\n }\n }\n\n function modifyCorporationFunds(modify: number): (x: number) => void {\n return function (funds: number): void {\n if (props.player.corporation) {\n props.player.corporation.funds += funds * modify;\n }\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 <Typography>Funds:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"set funds\"\n placeholder=\"amt\"\n tons={addTonsCorporationFunds}\n add={modifyCorporationFunds(1)}\n subtract={modifyCorporationFunds(-1)}\n reset={resetCorporationFunds}\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={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.highestCharge = 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.highestCharge += cycles * modify));\n };\n }\n\n function resetCharge(): void {\n staneksGift.fragments.forEach((f) => {\n f.highestCharge = 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></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 (\n <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\n title={\n <>\n {i.ID}\n <br />\n {i.Description}\n </>\n }\n >\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 })}\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 { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Adjuster } from \"./Adjuster\";\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 Entropy(props: IProps): React.ReactElement {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Entropy</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Adjuster\n label=\"Set entropy\"\n placeholder=\"entropy\"\n add={(num) => {\n props.player.entropy += num;\n props.player.applyEntropy(props.player.entropy);\n }}\n subtract={(num) => {\n props.player.entropy -= num;\n props.player.applyEntropy(props.player.entropy);\n }}\n tons={() => {\n props.player.entropy += 1e12;\n props.player.applyEntropy(props.player.entropy);\n }}\n reset={() => {\n props.player.entropy = 0;\n props.player.applyEntropy(props.player.entropy);\n }}\n />\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\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\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[FactionNames.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%\" }}>\n Travel\n </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\n accurate 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\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\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.key === KEY.ENTER) {\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.key === KEY.UP_ARROW) {\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.key === KEY.DOWN_ARROW) {\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\n sx={{\n height: \"60vh\",\n paddingBottom: \"8px\",\n display: \"flex\",\n alignItems: \"stretch\",\n whiteSpace: \"pre-wrap\",\n }}\n onClick={handleClick}\n >\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) => <Line key={i} content={log} />)}\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, props.player);\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 improve 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, props.player);\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\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\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>\n Your ultimate goal to climb through the ranks of {FactionNames.Bladeburners} is to complete all of the Black\n Ops.\n </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, props.player);\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\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { BlackOperationNames } from \"./BlackOperationNames\";\n\ninterface IBlackOp {\n desc: JSX.Element;\n}\n\nexport const BlackOperations: {\n [key: string]: IBlackOp | undefined;\n} = {\n [BlackOperationNames.OperationTyphoon]: {\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 {BlackOperationNames.OperationTyphoon} is to find and eliminate Zenyatta and RedWater by any means\n necessary. After the task is completed, the actions must be covered up from the general public.\n </>\n ),\n },\n\n [BlackOperationNames.OperationZero]: {\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 {BlackOperationNames.OperationZero} is to covertly infiltrate AeroCorp and uncover any incriminating\n evidence or information against Watataki that will cause him to be removed from his position at AeroCorp.\n Incriminating evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced\n security measures in the world.\n </>\n ),\n },\n [BlackOperationNames.OperationX]: {\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 {CityName.Ishima}'s underground sewer systems. Your task is to investigate the\n sewer systems, and eliminate Samizdat. They must never publish anything again.\n </>\n ),\n },\n [BlackOperationNames.OperationTitan]: {\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 {CityName.Aevum}. The task is not\n just to retire the Synthoids there, but also to destroy any information or research at the facility that is\n relevant to the Synthoids and their goals.\n </>\n ),\n },\n [BlackOperationNames.OperationAres]: {\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 [BlackOperationNames.OperationArchangel]: {\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 [BlackOperationNames.OperationJuggernaut]: {\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{\" \"}\n {CityName.Sector12}. We also have reason to believe they tried to break into one of Universal Energy's\n facilities in order to cause a city-wide blackout. The CIA suspects that Juggernaut is a heavily-augmented\n Synthoid, and have thus enlisted our help.\n <br />\n <br />\n Your mission is to eradicate Juggernaut and his followers.\n </>\n ),\n },\n [BlackOperationNames.OperationRedDragon]: {\n desc: (\n <>\n The {FactionNames.Tetrads} criminal organization is suspected of reverse-engineering the MK-VI Synthoid design.\n We believe they altered and possibly improved the design and began manufacturing their own Synthoid models in\n order to bolster their criminal activities.\n <br />\n <br />\n Your task is to infiltrate and destroy the {FactionNames.Tetrads}' base of operations in Los Angeles.\n Intelligence tells us that their base houses one of their Synthoid manufacturing units.\n </>\n ),\n },\n [BlackOperationNames.OperationK]: {\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 [BlackOperationNames.OperationDeckard]: {\n desc: (\n <>\n Despite your success in eliminating VitaLife's new android-replicating technology in{\" \"}\n {BlackOperationNames.OperationK}, we've discovered that a small group of MK-VI Synthoids were able to make off\n with the schematics and design of the technology before the Operation. It is almost a certainty that these\n Synthoids are some of the rogue MK-VI ones from the Synthoid Uprising.\n <br />\n <br />\n The goal of {BlackOperationNames.OperationDeckard} is to hunt down these Synthoids and retire them. I don't need\n to tell you how critical this mission is.\n </>\n ),\n },\n [BlackOperationNames.OperationTyrell]: {\n desc: (\n <>\n A week ago {FactionNames.BladeIndustries} reported a small break-in at one of their {CityName.Aevum}{\" \"}\n Augmentation storage facilities. We figured out that {FactionNames.TheDarkArmy} was behind the heist, and didn't\n think any more of it. However, we've just discovered that several known MK-VI Synthoids were part of that\n 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 associated {FactionNames.TheDarkArmy} members and eliminate them.\n </>\n ),\n },\n [BlackOperationNames.OperationWallace]: {\n desc: (\n <>\n Based on information gathered from {BlackOperationNames.OperationTyrell}, we've discovered that{\" \"}\n {FactionNames.TheDarkArmy} was well aware that there were Synthoids amongst their ranks. Even worse, we believe\n that {FactionNames.TheDarkArmy} is working together with other criminal organizations such as{\" \"}\n {FactionNames.TheSyndicate} and that they are planning some sort of large-scale takeover of multiple major\n cities, most notably {CityName.Aevum}. We suspect that Synthoids have infiltrated the ranks of these criminal\n 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{\" \"}\n {BlackOperationNames.OperationWallace} is to destroy {FactionNames.TheDarkArmy} and Syndicate factions in{\" \"}\n {CityName.Aevum} immediately. Leave no survivors.\n </>\n ),\n },\n [BlackOperationNames.OperationShoulderOfOrion]: {\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 [BlackOperationNames.OperationHyron]: {\n desc: (\n <>\n Our intelligence tells us that {FactionNames.FulcrumSecretTechnologies} is developing a quantum supercomputer\n using human brains as core processors. This supercomputer is rumored to be able to store vast amounts of data\n and perform computations unmatched by any other supercomputer on the planet. But more importantly, the use of\n organic human brains means 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 {FactionNames.FulcrumSecretTechnologies} secret\n facilities in {CityName.Aevum}, codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work,\n and then find and kill the project lead.\n </>\n ),\n },\n [BlackOperationNames.OperationMorpheus]: {\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 {CityName.Chongqing}, we have reason to believe that one of the broadcast towers there\n has been 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 [BlackOperationNames.OperationIonStorm]: {\n desc: (\n <>\n Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the{\" \"}\n {CityName.Sector12} Slums. We don't know if they are rogue Synthoids from the Uprising, but we do know that they\n have been stockpiling 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 {CityName.Sector12}{\" \"}\n Slums.\n </>\n ),\n },\n [BlackOperationNames.OperationAnnihilus]: {\n desc: (\n <>\n Our superiors have ordered us to eradicate everything and everyone in an underground facility located in{\" \"}\n {CityName.Aevum}. They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist\n organization called '{FactionNames.TheCovenant}'. We have no prior intelligence about this organization, so you\n are going in blind.\n </>\n ),\n },\n [BlackOperationNames.OperationUltron]: {\n desc: (\n <>\n {FactionNames.OmniTekIncorporated}, the original designer and manufacturer of Synthoids, has notified us of a\n malfunction in their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized\n and seek out the destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue\n ones from the Uprising.\n <br />\n <br />\n {FactionNames.OmniTekIncorporated} has also told us they they believe someone has triggered this malfunction in\n a large group of MK-VI Synthoids, and that these newly-radicalized Synthoids are now amassing in{\" \"}\n {CityName.Volhaven} to form a terrorist group 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 [BlackOperationNames.OperationCenturion]: {\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 [BlackOperationNames.OperationVindictus]: {\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 [BlackOperationNames.OperationDaedalus]: {\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\";\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 {BladeburnerConstants.RanksPerSkillPoint} 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} sx={{ minWidth: \"fit-content\", maxWidth: \"45%\" }}>\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={<>Filter the members list by whether or not the member can be ascended.</>}\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 }}>\n Ascend\n </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","/**\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 { Table, TableBody, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMember } from \"../GangMember\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\nimport { characterOverviewStyles as useStyles } from \"../../ui/React/CharacterOverview\";\n\ninterface IProps {\n member: GangMember;\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 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 <StatsRow\n name=\"Hacking\"\n color={Settings.theme.hack}\n data={{ level: props.member.hack, exp: props.member.hack_exp }}\n />\n <StatsRow\n name=\"Strength\"\n color={Settings.theme.combat}\n data={{ level: props.member.str, exp: props.member.str_exp }}\n />\n <StatsRow\n name=\"Defense\"\n color={Settings.theme.combat}\n data={{ level: props.member.def, exp: props.member.def_exp }}\n />\n <StatsRow\n name=\"Dexterity\"\n color={Settings.theme.combat}\n data={{ level: props.member.dex, exp: props.member.dex_exp }}\n />\n <StatsRow\n name=\"Agility\"\n color={Settings.theme.combat}\n data={{ level: props.member.agi, exp: props.member.agi_exp }}\n />\n <StatsRow\n name=\"Charisma\"\n color={Settings.theme.cha}\n data={{ level: props.member.cha, exp: props.member.cha_exp }}\n />\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","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 const contextMember = gang.members.find((member) => member.name == props.member.name);\n if (contextMember && contextMember.task != currentTask) {\n setCurrentTask(contextMember.task);\n }\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>Recruit Gang Member</Button>\n <Typography sx={{ ml: 1 }}>\n {numeralWrapper.formatRespect(respect)} respect needed to recruit next member\n </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\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\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.key === KEY.ENTER) 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, { useState } from \"react\";\n\nimport { Container, Button, Paper, Box, Tooltip, Switch, FormControlLabel, Typography } from \"@mui/material\";\nimport { Help } from \"@mui/icons-material\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\n\nimport { AllGangs } from \"../AllGangs\";\n\nimport { useGang } from \"./Context\";\nimport { TerritoryInfoModal } from \"./TerritoryInfoModal\";\n\nexport function TerritorySubpage(): React.ReactElement {\n const gang = useGang();\n const gangNames = Object.keys(AllGangs).filter((g) => g != gang.facName);\n const [infoOpen, setInfoOpen] = useState(false);\n\n return (\n <Container disableGutters maxWidth=\"md\" sx={{ mx: 0 }}>\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 </Typography>\n\n <Button onClick={() => setInfoOpen(true)} sx={{ my: 1 }}>\n <Help sx={{ mr: 1 }} />\n About Gang Territory\n </Button>\n\n <Box component={Paper} sx={{ p: 1, mb: 1 }}>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n {gang.facName} (Your gang)\n </Typography>\n\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 <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\n dies in a territory clash.\n </Typography>\n }\n >\n <Typography>Notify about Gang Member Deaths</Typography>\n </Tooltip>\n }\n />\n\n <Typography>\n <b>Territory Clash Chance:</b> {numeralWrapper.formatPercentage(gang.territoryClashChance, 3)} <br />\n <b>Power:</b> {formatNumber(AllGangs[gang.facName].power, 3)} <br />\n <b>Territory:</b> {formatTerritory(AllGangs[gang.facName].territory)}% <br />\n </Typography>\n </Box>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"repeat(3, 1fr)\" }}>\n {gangNames\n .sort((a, b) => {\n if (AllGangs[a].territory <= 0 && AllGangs[b].territory > 0) return 1;\n if (AllGangs[a].territory > 0 && AllGangs[b].territory <= 0) return -1;\n return 0;\n })\n .map((name) => (\n <OtherGangTerritory key={name} name={name} />\n ))}\n </Box>\n <TerritoryInfoModal open={infoOpen} onClose={() => setInfoOpen(false)} />\n </Container>\n );\n}\nfunction formatTerritory(n: number): string {\n const v = n * 100;\n const precision = 3;\n if (v <= 0) {\n return formatNumber(0, precision);\n } else if (v >= 100) {\n return formatNumber(100, precision);\n } else {\n return formatNumber(v, precision);\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 const territory = AllGangs[props.name].territory;\n const opacity = territory ? 1 : 0.75;\n return (\n <Box component={Paper} sx={{ p: 1, opacity }}>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n {props.name}\n </Typography>\n <Typography>\n <b>Power:</b> {formatNumber(power, 3)} <br />\n <b>Territory:</b> {formatTerritory(territory)}% <br />\n <b>Clash Win Chance:</b> {numeralWrapper.formatPercentage(clashVictoryChance, 3)}\n </Typography>\n </Box>\n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\n\nimport { Modal } from \"../../ui/React/Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport const TerritoryInfoModal = ({ open, onClose }: IProps): React.ReactElement => {\n return (\n <Modal open={open} onClose={onClose}>\n <>\n <Typography variant=\"h4\">Clashing</Typography>\n <Typography>\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 </Typography>\n <br />\n <Typography variant=\"h4\">Territory</Typography>\n <Typography>\n The amount of territory you have affects all aspects of your Gang members' production, including money,\n respect, 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\n your gang power. Then, enable \"Engage in Territory Warfare\" to start fighting over territory.\n </Typography>\n <br />\n <Typography variant=\"h4\">Territory Clash Chance</Typography>\n <Typography>\n This percentage represents the chance you have of 'clashing' 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 </Modal>\n );\n};\n","/**\n * React Component for the popup that manages gang members upgrades\n */\nimport React, { useState } from \"react\";\nimport { useGang } from \"./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 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 { StatsRow } from \"../../ui/React/StatsRow\";\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 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\n {numeralWrapper.formatMultiplier(asc.hack)} Asc)\n <br />\n St: x{numeralWrapper.formatMultiplier(props.member.str_mult * asc.str)}\n (x{numeralWrapper.formatMultiplier(props.member.str_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.str)} Asc)\n <br />\n Df: x{numeralWrapper.formatMultiplier(props.member.def_mult * asc.def)}\n (x{numeralWrapper.formatMultiplier(props.member.def_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.def)} Asc)\n <br />\n Dx: x{numeralWrapper.formatMultiplier(props.member.dex_mult * asc.dex)}\n (x{numeralWrapper.formatMultiplier(props.member.dex_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.dex)} Asc)\n <br />\n Ag: x{numeralWrapper.formatMultiplier(props.member.agi_mult * asc.agi)}\n (x{numeralWrapper.formatMultiplier(props.member.agi_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.agi)} Asc)\n <br />\n Ch: x{numeralWrapper.formatMultiplier(props.member.cha_mult * asc.cha)}\n (x{numeralWrapper.formatMultiplier(props.member.cha_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.cha)} Asc)\n </Typography>\n }\n >\n <Table>\n <TableBody>\n <StatsRow\n name=\"Hacking\"\n color={Settings.theme.hack}\n data={{ level: props.member.hack, exp: props.member.hack_exp }}\n />\n <StatsRow\n name=\"Strength\"\n color={Settings.theme.combat}\n data={{ level: props.member.str, exp: props.member.str_exp }}\n />\n <StatsRow\n name=\"Defense\"\n color={Settings.theme.combat}\n data={{ level: props.member.def, exp: props.member.def_exp }}\n />\n <StatsRow\n name=\"Dexterity\"\n color={Settings.theme.combat}\n data={{ level: props.member.dex, exp: props.member.dex_exp }}\n />\n <StatsRow\n name=\"Agility\"\n color={Settings.theme.combat}\n data={{ level: props.member.agi, exp: props.member.agi_exp }}\n />\n <StatsRow\n name=\"Charisma\"\n color={Settings.theme.cha}\n data={{ level: props.member.cha, exp: props.member.cha_exp }}\n />\n </TableBody>\n </Table>\n </Tooltip>\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>All upgrades owned!</Typography>\n )}\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"1fr 1fr\" }}>\n {(categories[currentCategory][0] as GangMemberUpgrade[]).map((upg) => (\n <UpgradeButton key={upg.name} rerender={rerender} member={props.member} upg={upg} />\n ))}\n </Box>\n <NextReveal type={categories[currentCategory][1] as UpgradeType} upgrades={props.member.upgrades} />\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 const handleFilterChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setFilter(event.target.value.toLowerCase());\n };\n\n const members = gang.members.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: \"100%\" }}>\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=\"scrollable\" value={divisionName} onChange={handleChange} sx={{ maxWidth: \"65vw\" }} scrollButtons>\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} sx={{ maxWidth: \"65vw\" }}>\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 \"./modals/UpgradeOfficeSizeModal\";\nimport { ThrowPartyModal } from \"./modals/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 <span>\n <Button disabled={props.office.atCapacity()} onClick={autohireEmployeeButtonOnClick}>\n Hire Employee\n </Button>\n </span>\n </Tooltip>\n <Tooltip title={<Typography>Upgrade the office's size so that it can hold more employees!</Typography>}>\n <span>\n <Button disabled={corp.funds < 0} onClick={() => setUpgradeOfficeSizeOpen(true)}>\n Upgrade size\n </Button>\n </span>\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 <span>\n <Button disabled={corp.funds < 0} onClick={() => setThrowPartyOpen(true)}>\n Throw Party\n </Button>\n </span>\n </Tooltip>\n <ThrowPartyModal\n rerender={props.rerender}\n office={props.office}\n open={throwPartyOpen}\n onClose={() => setThrowPartyOpen(false)}\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\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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 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 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.key === KEY.ENTER) 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 \"./modals/MakeProductModal\";\nimport { ResearchModal } from \"./modals/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\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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.key === KEY.ENTER) 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\n color={color}\n disabled={disabled && !n.researched}\n onClick={research}\n style={{ width: \"100%\", textAlign: \"left\", justifyContent: \"unset\" }}\n >\n {n.researched && <CheckIcon sx={{ mr: 1 }} />}\n {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\n color={color}\n disabled={disabled && !n.researched}\n onClick={research}\n sx={{\n width: \"100%\",\n textAlign: \"left\",\n justifyContent: \"unset\",\n borderColor: Settings.theme.button,\n }}\n >\n {n.researched && <CheckIcon sx={{ mr: 1 }} />}\n {n.text}\n </Button>\n </span>,\n )}\n <Button\n onClick={() => setOpen((old) => !old)}\n sx={{ borderColor: Settings.theme.button, minWidth: \"fit-content\" }}\n >\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 \"./modals/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\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface IProps {\n corp: ICorporation;\n division: IIndustry;\n warehouse: Warehouse | 0;\n currentCity: string;\n player: IPlayer;\n rerender: () => void;\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n retainHeight: {\n minHeight: \"3em\",\n },\n }),\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 const classes = useStyles();\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 or in stock\n const isInStock = props.warehouse.materials[matName].qty > 0;\n const isRelevant = isRelevantMaterial(matName, division);\n if (!isInStock && !isRelevant) 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(\n <>\n {matName}: {numeralWrapper.format(mat.qty * MaterialSizes[matName], \"0,0.0\")}\n </>,\n );\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(\n <>\n {prodName}: {numeralWrapper.format(prod.data[props.warehouse.loc][0] * prod.siz, \"0,0.0\")}\n </>,\n );\n }\n\n let breakdown;\n if (breakdownItems && breakdownItems.length > 0) {\n breakdown = breakdownItems.reduce(\n (previous: JSX.Element, current: JSX.Element): JSX.Element =>\n (previous && (\n <>\n {previous}\n <br />\n {current}\n </>\n )) || <>{current}</>,\n );\n } else {\n breakdown = <>No items in storage.</>;\n }\n\n return (\n <Paper>\n <Box display=\"flex\" alignItems=\"center\">\n <Tooltip\n title={\n props.warehouse.sizeUsed !== 0 ? (\n <Typography>\n <>{breakdown}</>\n </Typography>\n ) : (\n \"\"\n )\n }\n >\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 className={classes.retainHeight}>{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 \"./modals/DiscontinueProductModal\";\nimport { LimitProductProductionModal } from \"./modals/LimitProductProductionModal\";\nimport { SellProductModal } from \"./modals/SellProductModal\";\nimport { ProductMarketTaModal } from \"./modals/ProductMarketTaModal\";\nimport { CancelProductModal } from \"./modals/CancelProductModal\";\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 [cancelOpen, setCancelOpen] = 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 <Button onClick={() => setCancelOpen(true)}>Cancel</Button>\n <CancelProductModal\n product={product}\n rerender={props.rerender}\n open={cancelOpen}\n onClose={() => setCancelOpen(false)}\n />\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 <Button onClick={() => setDiscontinueOpen(true)}>Discontinue</Button>\n <DiscontinueProductModal\n product={product}\n rerender={props.rerender}\n open={discontinueOpen}\n onClose={() => setDiscontinueOpen(false)}\n />\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 {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, { useEffect, 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\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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 // reset modal internal state on modal close\n useEffect(() => {\n if (!props.open) {\n setLimit(null);\n }\n }, [props.open]);\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.key === KEY.ENTER) 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 produce 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\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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.key === KEY.ENTER) 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","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 cancel a product\nexport function CancelProductModal(props: IProps): React.ReactElement {\n const division = useDivision();\n function cancel(): 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? Canceling a product removes it completely and permanently. You will receive no\n money back by doing so\n </Typography>\n <Button onClick={cancel}>Cancel</Button>\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 \"./modals/ExportModal\";\nimport { MaterialMarketTaModal } from \"./modals/MaterialMarketTaModal\";\nimport { SellMaterialModal } from \"./modals/SellMaterialModal\";\nimport { PurchaseMaterialModal } from \"./modals/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\";\nimport { LimitMaterialProductionModal } from \"./modals/LimitMaterialProductionModal\";\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 [limitProductionOpen, setLimitProductionOpen] = useState(false);\n\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 // Limit Production button\n let limitMaterialButtonText = \"Limit Material\";\n if (mat.prdman[0]) {\n limitMaterialButtonText += \" (\" + numeralWrapper.format(mat.prdman[1], nf) + \")\";\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 color={tutorial ? \"error\" : \"primary\"} onClick={() => setPurchaseMaterialOpen(true)}>\n {purchaseButtonText}\n </Button>\n </Tooltip>\n <PurchaseMaterialModal\n mat={mat}\n warehouse={warehouse}\n open={purchaseMaterialOpen}\n disablePurchaseLimit={\n props.warehouse.smartSupplyEnabled && Object.keys(division.reqMats).includes(props.mat.name)\n }\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 <Button color={tutorial ? \"error\" : \"primary\"} onClick={() => setLimitProductionOpen(true)}>\n {limitMaterialButtonText}\n </Button>\n <LimitMaterialProductionModal\n material={mat}\n open={limitProductionOpen}\n onClose={() => setLimitProductionOpen(false)}\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 { isRelevantMaterial } from \"../Helpers\";\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 const possibleDivisions = corp.divisions.filter((division: IIndustry) =>\n isRelevantMaterial(props.mat.name, division),\n );\n if (possibleDivisions.length === 0) throw new Error(\"Export popup created with no divisions.\");\n const defaultDivision = possibleDivisions[0];\n if (Object.keys(defaultDivision.warehouses).length === 0)\n throw new Error(\"Export popup created in a division with no warehouses.\");\n const [industry, setIndustry] = useState<string>(defaultDivision.name);\n const [city, setCity] = useState<string>(Object.keys(defaultDivision.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, currentDivision);\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\n .filter((division: IIndustry) => isRelevantMaterial(props.mat.name, division))\n .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\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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.key === KEY.ENTER) 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 { BulkPurchase, 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\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IBulkPurchaseTextProps {\n warehouse: Warehouse;\n mat: Material;\n amount: string;\n}\n\ninterface IBPProps {\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n}\n\nfunction BulkPurchaseSection(props: IBPProps): React.ReactElement {\n const corp = useCorporation();\n const [buyAmt, setBuyAmt] = useState(\"\");\n const [disabled, setDisabled] = useState(false);\n\n function 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 > maxAmount) {\n setDisabled(true);\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 setDisabled(true);\n return (\n <>\n <Typography color={\"error\"}>Invalid input for Bulk Purchase amount</Typography>\n </>\n );\n } else {\n setDisabled(false);\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\n function bulkPurchase(): void {\n try {\n BulkPurchase(corp, props.warehouse, props.mat, parseFloat(buyAmt));\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) 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 disabled={disabled} onClick={bulkPurchase}>\n Confirm Bulk Purchase\n </Button>\n </>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n disablePurchaseLimit: boolean;\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.key === KEY.ENTER) 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 {props.disablePurchaseLimit ? \"Note: Purchase amount is disabled as smart supply is enabled\" : \"\"}\n </Typography>\n <TextField\n value={buyAmt}\n onChange={onChange}\n autoFocus={true}\n placeholder=\"Purchase amount\"\n type=\"number\"\n disabled={props.disablePurchaseLimit}\n onKeyDown={onKeyDown}\n />\n <Button disabled={props.disablePurchaseLimit} onClick={purchaseMaterial}>\n Confirm\n </Button>\n <Button disabled={props.disablePurchaseLimit} onClick={clearPurchase}>\n Clear Purchase\n </Button>\n {division.hasResearch(\"Bulk Purchasing\") && (\n <BulkPurchaseSection onClose={props.onClose} mat={props.mat} warehouse={props.warehouse} />\n )}\n </>\n </Modal>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { LimitMaterialProduction } 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\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { Material } from \"../../Material\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n material: Material;\n}\n\n// Create a popup that lets the player limit the production of a product\nexport function LimitMaterialProductionModal(props: IProps): React.ReactElement {\n const [limit, setLimit] = useState<number | null>(null);\n\n // reset modal internal state on modal close\n useEffect(() => {\n if (!props.open) {\n setLimit(null);\n }\n }, [props.open]);\n\n function limitMaterialProduction(): void {\n let qty = limit;\n if (qty === null) qty = -1;\n LimitMaterialProduction(props.material, qty);\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) limitMaterialProduction();\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 material you would like to produce 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={limitMaterialProduction}>Limit production</Button>\n </Modal>\n );\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.map((p) => `1\\\\text{ }${p}`);\n if (props.division.makesProducts) {\n prod.push(\"Products\");\n }\n\n return <MathJaxWrapper>{\"\\\\(\" + reqs.join(\"+\") + `\\\\Rightarrow ` + prod.join(\"+\") + \"\\\\)\"}</MathJaxWrapper>;\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\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\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.key === KEY.ENTER) 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 \"./modals/BribeFactionModal\";\nimport { SellSharesModal } from \"./modals/SellSharesModal\";\nimport { BuybackSharesModal } from \"./modals/BuybackSharesModal\";\nimport { IssueDividendsModal } from \"./modals/IssueDividendsModal\";\nimport { IssueNewSharesModal } from \"./modals/IssueNewSharesModal\";\nimport { FindInvestorsModal } from \"./modals/FindInvestorsModal\";\nimport { GoPublicModal } from \"./modals/GoPublicModal\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { CorporationUnlockUpgrade, CorporationUnlockUpgrades } from \"../data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade, CorporationUpgradeIndex, 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.index])\n .map((upgrade: CorporationUnlockUpgrade) => (\n <UnlockUpgrade rerender={rerender} upgradeData={upgrade} key={upgrade.index} />\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 as CorporationUpgradeIndex])\n .map((upgrade: CorporationUpgrade) => (\n <LevelableUpgrade rerender={rerender} upgrade={upgrade} key={upgrade.index} />\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.index];\n\n const baseCost = data.basePrice;\n const priceMult = data.priceMult;\n const cost = baseCost * Math.pow(priceMult, level);\n\n const tooltip = data.desc;\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.name} - 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.desc;\n function onClick(): void {\n if (corp.funds < data.price) 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.price} sx={{ mx: 1 }} onClick={onClick}>\n <MoneyCost money={data.price} corp={corp} />\n </Button>\n <Tooltip title={tooltip}>\n <Typography>{data.name}</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 { 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\";\nimport { SellShares } from \"../../Actions\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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 let text = \"\";\n if (isNaN(props.shares) || props.shares <= 0) {\n text = `ERROR: Invalid value entered for number of shares to sell`;\n } else if (props.shares > corp.numShares) {\n text = `You don't have this many shares to sell!`;\n } else {\n const stockSaleResults = corp.calculateShareSale(props.shares);\n const profit = stockSaleResults[0];\n text = `Sell ${props.shares} shares for a total of ${numeralWrapper.formatMoney(profit)}`;\n }\n\n return (\n <Typography>\n <small>{text}</small>\n </Typography>\n );\n }\n\n function sell(): void {\n if (disabled) return;\n try {\n const profit = SellShares(corp, player, shares);\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 } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.key === KEY.ENTER) 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 <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 <ProfitIndicator shares={shares} corp={corp} />\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\";\nimport { BuyBackShares } from \"../../Actions\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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 try {\n BuyBackShares(corp, player, shares);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\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.key === KEY.ENTER) 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\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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.key === KEY.ENTER) 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\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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.key === KEY.ENTER) 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 (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length\n )\n 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\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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.key === KEY.ENTER) 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 React, { useState } from \"react\";\nimport { Location } from \"../../Locations/Location\";\nimport { use } from \"../../ui/Context\";\nimport { calculateDifficulty, calculateReward } from \"../formulas/game\";\nimport { Game } from \"./Game\";\nimport { Intro } from \"./Intro\";\ninterface IProps {\n location: Location;\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 startingSecurityLevel = props.location.infiltrationData.startingSecurityLevel;\n const difficulty = calculateDifficulty(player, startingSecurityLevel);\n const reward = calculateReward(player, startingSecurityLevel);\n\n function cancel(): void {\n router.toCity();\n }\n\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", height: \"calc(100vh - 16px)\" }}>\n {start ? (\n <Game\n StartingDifficulty={startingSecurityLevel}\n Difficulty={difficulty}\n Reward={reward}\n MaxLevel={props.location.infiltrationData.maxClearanceLevel}\n />\n ) : (\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 </div>\n );\n}\n","import { Button, Container, Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { use } from \"../../ui/Context\";\nimport { BackwardGame } from \"./BackwardGame\";\nimport { BracketGame } from \"./BracketGame\";\nimport { BribeGame } from \"./BribeGame\";\nimport { CheatCodeGame } from \"./CheatCodeGame\";\nimport { Countdown } from \"./Countdown\";\nimport { Cyberpunk2077Game } from \"./Cyberpunk2077Game\";\nimport { MinesweeperGame } from \"./MinesweeperGame\";\nimport { SlashGame } from \"./SlashGame\";\nimport { Victory } from \"./Victory\";\nimport { WireCuttingGame } from \"./WireCuttingGame\";\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\n ? player.hp\n : props.StartingDifficulty * 3 * (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 0.5 : 1);\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 <Container>\n <Paper sx={{ p: 1, mb: 1, display: \"grid\", justifyItems: \"center\", gap: 1 }}>\n {stage !== Stage.Sell && (\n <Button sx={{ width: \"100%\" }} onClick={cancel}>\n Cancel Infiltration\n </Button>\n )}\n <Typography variant=\"h5\">\n Level {level} / {props.MaxLevel}\n </Typography>\n <Progress />\n </Paper>\n\n {stageComponent}\n </Container>\n );\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\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 const hasAugment = Player.hasAugmentation(AugmentationNames.ChaosOfDionysus, true);\n\n function ignorableKeyboardEvent(event: KeyboardEvent): boolean {\n return event.key === KEY.BACKSPACE || (event.shiftKey && event.key === \"Shift\") || event.ctrlKey || event.altKey;\n }\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (ignorableKeyboardEvent(event)) 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 <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\", pb: 1 }}>\n <Typography variant=\"h4\">Type it{!hasAugment ? \" backward\" : \"\"}</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n <Typography style={{ transform: hasAugment ? \"none\" : \"scaleX(-1)\" }}>{answer}</Typography>\n <Typography>\n {guess}\n <BlinkingCursor />\n </Typography>\n </Paper>\n </>\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 { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\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 options = [KEY.OPEN_BRACKET, KEY.LESS_THAN, KEY.OPEN_PARENTHESIS, KEY.OPEN_BRACE];\n if (Player.hasAugmentation(AugmentationNames.WisdomOfAthena, true)) {\n options.splice(0, 1);\n }\n const length = random(difficulty.min, difficulty.max);\n for (let i = 0; i < length; i++) {\n str += options[Math.floor(Math.random() * options.length)];\n }\n\n return str;\n}\n\nfunction getChar(event: KeyboardEvent): string {\n if (event.key === KEY.CLOSE_PARENTHESIS) return KEY.CLOSE_PARENTHESIS;\n if (event.key === KEY.CLOSE_BRACKET) return KEY.CLOSE_BRACKET;\n if (event.key === KEY.CLOSE_BRACE) return KEY.CLOSE_BRACE;\n if (event.key === KEY.GREATER_THAN) return KEY.GREATER_THAN;\n return \"\";\n}\n\nfunction match(left: string, right: string): boolean {\n return (\n (left === KEY.OPEN_BRACKET && right === KEY.CLOSE_BRACKET) ||\n (left === KEY.LESS_THAN && right === KEY.GREATER_THAN) ||\n (left === KEY.OPEN_PARENTHESIS && right === KEY.CLOSE_PARENTHESIS) ||\n (left === KEY.OPEN_BRACE && right === KEY.CLOSE_BRACE)\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 <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\" }}>\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 </Paper>\n </>\n );\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\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 [correctIndex, setCorrectIndex] = useState(0);\n const [index, setIndex] = useState(0);\n const currentChoice = choices[index];\n\n useEffect(() => {\n setCorrectIndex(choices.findIndex((choice) => positive.includes(choice)));\n }, [choices]);\n\n const defaultColor = Settings.theme.primary;\n const disabledColor = Settings.theme.disabled;\n let upColor = defaultColor;\n let downColor = defaultColor;\n let choiceColor = defaultColor;\n const hasAugment = Player.hasAugmentation(AugmentationNames.BeautyOfAphrodite, true);\n\n if (hasAugment) {\n const upIndex = index + 1 >= choices.length ? 0 : index + 1;\n let upDistance = correctIndex - upIndex;\n if (upIndex > correctIndex) {\n upDistance = choices.length - 1 - upIndex + correctIndex;\n }\n\n const downIndex = index - 1 < 0 ? choices.length - 1 : index - 1;\n let downDistance = downIndex - correctIndex;\n if (downIndex < correctIndex) {\n downDistance = downIndex + choices.length - 1 - correctIndex;\n }\n\n const onCorrectIndex = correctIndex == index;\n\n upColor = upDistance <= downDistance && !onCorrectIndex ? upColor : disabledColor;\n downColor = upDistance >= downDistance && !onCorrectIndex ? downColor : disabledColor;\n choiceColor = onCorrectIndex ? defaultColor : disabledColor;\n }\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n\n const k = event.key;\n if (k === KEY.SPACE) {\n if (positive.includes(currentChoice)) props.onSuccess();\n else props.onFailure();\n return;\n }\n\n let newIndex = index;\n if ([KEY.UP_ARROW, KEY.W, KEY.RIGHT_ARROW, KEY.D].map((k) => k as string).includes(k)) newIndex++;\n if ([KEY.DOWN_ARROW, KEY.S, KEY.LEFT_ARROW, KEY.A].map((k) => k as string).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 <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\" }}>\n <Typography variant=\"h4\">Say something nice about the guard</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n <Typography variant=\"h5\" color={upColor}>\n {upArrowSymbol}\n </Typography>\n <Typography variant=\"h5\" color={choiceColor}>\n {currentChoice}\n </Typography>\n <Typography variant=\"h5\" color={downColor}>\n {downArrowSymbol}\n </Typography>\n </Paper>\n </>\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 \"based\",\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 \"cringe\",\n];\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport {\n downArrowSymbol,\n getArrow,\n getInverseArrow,\n leftArrowSymbol,\n random,\n rightArrowSymbol,\n upArrowSymbol,\n} from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\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 const hasAugment = Player.hasAugmentation(AugmentationNames.TrickeryOfHermes, true);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (code[index] !== getArrow(event) && (!hasAugment || code[index] !== getInverseArrow(event))) {\n props.onFailure();\n return;\n }\n setIndex(index + 1);\n if (index + 1 >= code.length) props.onSuccess();\n }\n\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\" }}>\n <Typography variant=\"h4\">Enter the Code!</Typography>\n <Typography variant=\"h4\">{code[index]}</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Paper>\n </>\n );\n}\n\nfunction generateCode(difficulty: Difficulty): string {\n const arrows = [leftArrowSymbol, rightArrowSymbol, upArrowSymbol, downArrowSymbol];\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 { Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\n\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), 300);\n });\n\n return (\n <Paper sx={{ p: 1, textAlign: \"center\" }}>\n <Typography variant=\"h4\">Get Ready!</Typography>\n <Typography variant=\"h4\">{x}</Typography>\n </Paper>\n );\n}\n","import { Paper, Typography, Box } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, getArrow, leftArrowSymbol, rightArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n symbols: number;\n}\n\ninterface GridItem {\n content: string;\n color: string;\n selected?: boolean;\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 [answers] = useState(generateAnswers(grid, difficulty));\n const [currentAnswerIndex, setCurrentAnswerIndex] = useState(0);\n const [pos, setPos] = useState([0, 0]);\n\n const hasAugment = Player.hasAugmentation(AugmentationNames.FloodOfPoseidon, true);\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 upArrowSymbol:\n move[1]--;\n break;\n case leftArrowSymbol:\n move[0]--;\n break;\n case downArrowSymbol:\n move[1]++;\n break;\n case rightArrowSymbol:\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 === KEY.SPACE) {\n const selected = grid[pos[1]][pos[0]];\n const expected = answers[currentAnswerIndex];\n if (selected !== expected) {\n props.onFailure();\n return;\n }\n setCurrentAnswerIndex(currentAnswerIndex + 1);\n if (answers.length === currentAnswerIndex + 1) props.onSuccess();\n }\n }\n\n const flatGrid: GridItem[] = [];\n grid.map((line, y) =>\n line.map((cell, x) => {\n const isCorrectAnswer = cell === answers[currentAnswerIndex];\n const optionColor = hasAugment && !isCorrectAnswer ? Settings.theme.disabled : Settings.theme.primary;\n\n if (x === pos[0] && y === pos[1]) {\n flatGrid.push({ color: optionColor, content: cell, selected: true });\n return;\n }\n\n flatGrid.push({ color: optionColor, content: cell });\n }),\n );\n\n const fontSize = \"2em\";\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\", pb: 1 }}>\n <Typography variant=\"h4\">Match the symbols!</Typography>\n <Typography variant=\"h5\" color={Settings.theme.primary}>\n Targets:{\" \"}\n {answers.map((a, i) => {\n if (i == currentAnswerIndex)\n return (\n <span key={`${i}`} style={{ fontSize: \"1em\", color: Settings.theme.infolight }}>\n {a} \n </span>\n );\n return (\n <span key={`${i}`} style={{ fontSize: \"1em\", color: Settings.theme.primary }}>\n {a} \n </span>\n );\n })}\n </Typography>\n <br />\n <Box\n sx={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${Math.round(difficulty.width)}, 1fr)`,\n gap: 1,\n }}\n >\n {flatGrid.map((item) => (\n <Typography\n sx={{\n fontSize: fontSize,\n color: item.color,\n border: item.selected ? `2px solid ${Settings.theme.infolight}` : \"unset\",\n lineHeight: \"unset\",\n p: item.selected ? \"2px\" : \"4px\",\n }}\n >\n {item.content}\n </Typography>\n ))}\n </Box>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Paper>\n </>\n );\n}\n\nfunction generateAnswers(grid: string[][], difficulty: Difficulty): string[] {\n const answers = [];\n for (let i = 0; i < Math.round(difficulty.symbols); i++) {\n answers.push(grid[Math.floor(Math.random() * grid.length)][Math.floor(Math.random() * grid[0].length)]);\n }\n return answers;\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 { Close, Flag, Report } from \"@mui/icons-material\";\nimport { Box, Paper, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, getArrow, leftArrowSymbol, rightArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\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 const hasAugment = Player.hasAugmentation(AugmentationNames.HuntOfArtemis, true);\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 upArrowSymbol:\n move[1]--;\n break;\n case leftArrowSymbol:\n move[0]--;\n break;\n case downArrowSymbol:\n move[1]++;\n break;\n case rightArrowSymbol:\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 == KEY.SPACE) {\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 const flatGrid: { flagged?: boolean; current?: boolean; marked?: boolean }[] = [];\n\n minefield.map((line, y) =>\n line.map((cell, x) => {\n if (memoryPhase) {\n flatGrid.push({ flagged: Boolean(minefield[y][x]) });\n return;\n } else if (x === pos[0] && y === pos[1]) {\n flatGrid.push({ current: true });\n } else if (answer[y][x]) {\n flatGrid.push({ marked: true });\n } else if (hasAugment && minefield[y][x]) {\n flatGrid.push({ flagged: true });\n } else {\n flatGrid.push({});\n }\n }),\n );\n\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\", pb: 1 }}>\n <Typography variant=\"h4\">{memoryPhase ? \"Remember all the mines!\" : \"Mark all the mines!\"}</Typography>\n <Box\n sx={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${Math.round(difficulty.width)}, 1fr)`,\n gridTemplateRows: `repeat(${Math.round(difficulty.height)}, 1fr)`,\n gap: 1,\n }}\n >\n {flatGrid.map((item) => {\n let color: string;\n let icon: React.ReactElement;\n\n if (item.marked) {\n color = Settings.theme.warning;\n icon = <Flag />;\n } else if (item.current) {\n color = Settings.theme.infolight;\n icon = <Close />;\n } else if (item.flagged) {\n color = Settings.theme.error;\n icon = <Report />;\n } else {\n color = Settings.theme.primary;\n icon = <></>;\n }\n\n return (\n <Typography\n key={`${item}${uniqueId()}`}\n sx={{\n color: color,\n border: `2px solid ${item.current ? Settings.theme.infolight : Settings.theme.primary}`,\n height: \"32px\",\n width: \"32px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {icon}\n </Typography>\n );\n })}\n </Box>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Paper>\n </>\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 { Box, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\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 !== KEY.SPACE) return;\n if (phase !== 2) {\n props.onFailure();\n } else {\n props.onSuccess();\n }\n }\n const hasAugment = Player.hasAugmentation(AugmentationNames.MightOfAres, true);\n const phaseZeroTime = Math.random() * 3250 + 1500 - (250 + difficulty.window);\n const phaseOneTime = 250;\n const timeUntilAttacking = phaseZeroTime + phaseOneTime;\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 }, phaseOneTime);\n }, phaseZeroTime);\n return () => {\n clearInterval(id);\n };\n }, []);\n\n return (\n <>\n <GameTimer millis={5000} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\" }}>\n <Typography variant=\"h4\">Slash when his guard is down!</Typography>\n\n {hasAugment ? (\n <Box sx={{ my: 1 }}>\n <Typography variant=\"h5\">Guard will drop in...</Typography>\n <GameTimer millis={timeUntilAttacking} onExpire={() => null} noPaper />\n </Box>\n ) : (\n <></>\n )}\n\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 </Paper>\n </>\n );\n}\n","import { Box, Button, MenuItem, Paper, Select, SelectChangeEvent, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { inviteToFaction } from \"../../Faction/FactionHelpers\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { use } from \"../../ui/Context\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport {\n calculateInfiltratorsRepReward,\n calculateSellInformationCashReward,\n calculateTradeInformationRepReward,\n} from \"../formulas/victory\";\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 handleInfiltrators();\n router.toCity();\n }\n\n const soa = Factions[FactionNames.ShadowsOfAnarchy];\n const repGain = calculateTradeInformationRepReward(player, props.Reward, props.MaxLevel, props.StartingDifficulty);\n const moneyGain = calculateSellInformationCashReward(player, props.Reward, props.MaxLevel, props.StartingDifficulty);\n const infiltrationRepGain = calculateInfiltratorsRepReward(player, soa, props.StartingDifficulty);\n\n const isMemberOfInfiltrators = player.factions.includes(FactionNames.ShadowsOfAnarchy);\n\n function sell(): void {\n handleInfiltrators();\n player.gainMoney(moneyGain, \"infiltration\");\n quitInfiltration();\n }\n\n function trade(): void {\n handleInfiltrators();\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 function handleInfiltrators(): void {\n inviteToFaction(Factions[FactionNames.ShadowsOfAnarchy]);\n if (isMemberOfInfiltrators) {\n soa.playerReputation += infiltrationRepGain;\n }\n }\n\n return (\n <Paper sx={{ p: 1, textAlign: \"center\", display: \"flex\", alignItems: \"center\", flexDirection: \"column\" }}>\n <Typography variant=\"h4\">Infiltration successful!</Typography>\n <Typography variant=\"h5\" color=\"primary\" width=\"75%\">\n You{\" \"}\n {isMemberOfInfiltrators ? (\n <>\n have gained {formatNumber(infiltrationRepGain, 2)} rep for {FactionNames.ShadowsOfAnarchy} and{\" \"}\n </>\n ) : (\n <></>\n )}\n can trade the confidential information you found for money or reputation.\n </Typography>\n <Box sx={{ width: \"fit-content\" }}>\n <Box sx={{ width: \"100%\" }}>\n <Select value={faction} onChange={changeDropdown} sx={{ mr: 1 }}>\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 </Box>\n <Button onClick={sell} sx={{ width: \"100%\" }}>\n Sell for \n <Money money={moneyGain} />\n </Button>\n </Box>\n <Button onClick={quitInfiltration} sx={{ width: \"100%\", mt: 1 }}>\n Quit\n </Button>\n </Paper>\n );\n}\n","import { Box, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\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 = [KEY.PIPE, KEY.DOT, KEY.FORWARD_SLASH, KEY.HYPHEN, \"█\", KEY.HASH];\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 const hasAugment = Player.hasAugmentation(AugmentationNames.KnowledgeOfApollo, true);\n\n function checkWire(wireNum: number): boolean {\n return questions.some((q) => q.shouldCut(wires[wireNum - 1], wireNum - 1));\n }\n\n useEffect(() => {\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 === cutWires[i])) {\n props.onSuccess();\n }\n }, [cutWires]);\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 (!checkWire(wireNum)) {\n props.onFailure();\n }\n\n return next;\n });\n }\n\n return (\n <>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Paper sx={{ display: \"grid\", justifyItems: \"center\", pb: 1 }}>\n <Typography variant=\"h4\" sx={{ width: \"75%\", textAlign: \"center\" }}>\n Cut the wires with the following properties! (keyboard 1 to 9)\n </Typography>\n {questions.map((question, i) => (\n <Typography key={i}>{question.toString()}</Typography>\n ))}\n <Box\n sx={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${wires.length}, 1fr)`,\n columnGap: 3,\n justifyItems: \"center\",\n }}\n >\n {new Array(wires.length).fill(0).map((_, i) => {\n const isCorrectWire = checkWire(i + 1);\n const color = hasAugment && !isCorrectWire ? Settings.theme.disabled : Settings.theme.primary;\n return (\n <Typography key={i} style={{ color: color }}>\n {i + 1}\n </Typography>\n );\n })}\n {new Array(8).fill(0).map((_, i) => (\n <React.Fragment key={i}>\n {wires.map((wire, j) => {\n if ((i === 3 || i === 4) && cutWires[j]) {\n return <Typography key={j}></Typography>;\n }\n const isCorrectWire = checkWire(j + 1);\n const wireColor =\n hasAugment && !isCorrectWire ? Settings.theme.disabled : wire.colors[i % wire.colors.length];\n return (\n <Typography key={j} style={{ color: wireColor }}>\n |{wire.tpe}|\n </Typography>\n );\n })}\n </React.Fragment>\n ))}\n </Box>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Paper>\n </>\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 { Report } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React from \"react\";\nimport { Location } from \"../../Locations/Location\";\nimport { Settings } from \"../../Settings/Settings\";\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(Settings.theme.primary, difficulty * 13)}\n {arrowPart(Settings.theme.warning, (difficulty - 1) * 13)}\n {arrowPart(Settings.theme.error, (difficulty - 2) * 13)}\n </>\n );\n }\n}\n\nexport function Intro(props: IProps): React.ReactElement {\n return (\n <Container sx={{ alignItems: \"center\" }}>\n <Paper sx={{ p: 1, mb: 1, display: \"grid\", justifyItems: \"center\" }}>\n <Typography variant=\"h4\">\n Infiltrating <b>{props.Location.name}</b>\n </Typography>\n <Typography variant=\"h6\">\n <b>Maximum Level: </b>\n {props.MaxLevel}\n </Typography>\n <Typography\n variant=\"h6\"\n sx={{\n color:\n props.Difficulty > 2\n ? Settings.theme.error\n : props.Difficulty > 1\n ? Settings.theme.warning\n : Settings.theme.primary,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <b>Difficulty: </b>\n {numeralWrapper.format(props.Difficulty * 33.3333, \"0\")} / 100\n {props.Difficulty > 1.5 && (\n <Tooltip\n title={\n <Typography color=\"error\">\n This location is too heavily guarded for your current stats. It is recommended that you try training,\n or finding an easier location.\n </Typography>\n }\n >\n <Report sx={{ ml: 1 }} />\n </Tooltip>\n )}\n </Typography>\n\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 </Paper>\n\n <Paper sx={{ p: 1, display: \"grid\", justifyItems: \"center\" }}>\n <Typography sx={{ width: \"75%\", textAlign: \"center\" }}>\n <b>Infiltration</b> is a series of short minigames that get progressively harder. You take damage for failing\n them. Reaching the maximum level rewards you with intel that you can trade for money or reputation.\n <br />\n <br />\n <b>Gameplay:</b>\n </Typography>\n <ul>\n <Typography>\n <li>\n The minigames you play are randomly selected.\n <br />\n It might take you a few tries to get used to them.\n </li>\n <li>No game requires use of the mouse.</li>\n <li>\n <b>Spacebar</b> is the default action/confirm button.\n </li>\n <li>\n The <b>arrow keys</b> and <b>WASD</b> can be used interchangeably.\n </li>\n <li>Sometimes the rest of the keyboard is used.</li>\n </Typography>\n </ul>\n\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\", width: \"100%\" }}>\n <Button onClick={props.start}>Start</Button>\n <Button onClick={props.cancel}>Cancel</Button>\n </Box>\n </Paper>\n </Container>\n );\n}\n","import { CheckBox, CheckBoxOutlineBlank, Construction } from \"@mui/icons-material\";\nimport { Box, Button, Container, List, ListItemButton, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { Augmentation } from \"../../../Augmentation/Augmentation\";\nimport { AugmentationNames } from \"../../../Augmentation/data/AugmentationNames\";\nimport { StaticAugmentations } from \"../../../Augmentation/StaticAugmentations\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { hasAugmentationPrereqs } from \"../../../Faction/FactionHelpers\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { Locations } from \"../../../Locations/Locations\";\nimport { PurchaseAugmentationsOrderSetting } from \"../../../Settings/SettingEnums\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { IMap } from \"../../../types\";\nimport { use } from \"../../../ui/Context\";\nimport { ConfirmationModal } from \"../../../ui/React/ConfirmationModal\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { convertTimeMsToTimeElapsedString, formatNumber } from \"../../../utils/StringHelperFunctions\";\nimport { IPlayer } from \"../../IPlayer\";\nimport { GraftableAugmentation } from \"../GraftableAugmentation\";\nimport { calculateGraftingTimeWithBonus, getGraftingAvailableAugs } from \"../GraftingHelpers\";\n\nconst GraftableAugmentations: IMap<GraftableAugmentation> = {};\n\nconst canGraft = (player: IPlayer, aug: GraftableAugmentation): boolean => {\n if (player.money < aug.cost) {\n return false;\n }\n return hasAugmentationPrereqs(aug.augmentation);\n};\n\ninterface IProps {\n player: IPlayer;\n aug: Augmentation;\n}\n\nconst AugPreReqsChecklist = (props: IProps): React.ReactElement => {\n const aug = props.aug,\n player = props.player;\n\n return (\n <Typography color={Settings.theme.money}>\n <b>Pre-Requisites:</b>\n <br />\n {aug.prereqs.map((preAug) => (\n <span style={{ display: \"flex\", alignItems: \"center\" }}>\n {player.hasAugmentation(preAug) ? <CheckBox sx={{ mr: 1 }} /> : <CheckBoxOutlineBlank sx={{ mr: 1 }} />}\n {preAug}\n </span>\n ))}\n </Typography>\n );\n};\n\nexport const GraftingRoot = (): React.ReactElement => {\n const player = use.Player();\n const router = use.Router();\n\n for (const aug of Object.values(StaticAugmentations)) {\n const name = aug.name;\n const graftableAug = new GraftableAugmentation(aug);\n GraftableAugmentations[name] = graftableAug;\n }\n\n const [selectedAug, setSelectedAug] = useState(getGraftingAvailableAugs(player)[0]);\n const [graftOpen, setGraftOpen] = useState(false);\n const selectedAugmentation = StaticAugmentations[selectedAug];\n\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const getAugsSorted = (): string[] => {\n const augs = getGraftingAvailableAugs(player);\n switch (Settings.PurchaseAugmentationsOrder) {\n case PurchaseAugmentationsOrderSetting.Cost:\n return augs.sort((a, b) => GraftableAugmentations[a].cost - GraftableAugmentations[b].cost);\n default:\n return augs;\n }\n };\n\n const switchSortOrder = (newOrder: PurchaseAugmentationsOrderSetting): void => {\n Settings.PurchaseAugmentationsOrder = newOrder;\n rerender();\n };\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0 }}>\n <Button onClick={() => router.toLocation(Locations[LocationName.NewTokyoVitaLife])}>Back</Button>\n <Typography variant=\"h4\">Grafting Laboratory</Typography>\n <Typography>\n You find yourself in a secret laboratory, owned by a mysterious researcher.\n <br />\n The scientist explains that they've been studying Augmentation grafting, the process of applying Augmentations\n without requiring a body reset.\n <br />\n <br />\n Through legally questionable connections, the scientist has access to a vast array of Augmentation blueprints,\n even private designs. They offer to build and graft the Augmentations to you, in exchange for both a hefty sum\n of money, and being a lab rat.\n </Typography>\n\n <Box sx={{ my: 3 }}>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\">Graft Augmentations</Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}>\n <Button sx={{ width: \"100%\" }} onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Cost)}>\n Sort by Cost\n </Button>\n <Button sx={{ width: \"100%\" }} onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Default)}>\n Sort by Default Order\n </Button>\n </Box>\n </Paper>\n {getGraftingAvailableAugs(player).length > 0 ? (\n <Paper sx={{ mb: 1, width: \"fit-content\", display: \"grid\", gridTemplateColumns: \"1fr 3fr\" }}>\n <List sx={{ height: 400, overflowY: \"scroll\", borderRight: `1px solid ${Settings.theme.welllight}` }}>\n {getAugsSorted().map((k, i) => (\n <ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}>\n <Typography\n sx={{\n color: canGraft(player, GraftableAugmentations[k])\n ? Settings.theme.primary\n : Settings.theme.disabled,\n }}\n >\n {k}\n </Typography>\n </ListItemButton>\n ))}\n </List>\n <Box sx={{ m: 1 }}>\n <Typography variant=\"h6\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n <Construction sx={{ mr: 1 }} /> {selectedAug}\n </Typography>\n <Button\n onClick={() => setGraftOpen(true)}\n sx={{ width: \"100%\" }}\n disabled={!canGraft(player, GraftableAugmentations[selectedAug])}\n >\n Graft Augmentation (\n <Typography>\n <Money money={GraftableAugmentations[selectedAug].cost} player={player} />\n </Typography>\n )\n </Button>\n <ConfirmationModal\n open={graftOpen}\n onClose={() => setGraftOpen(false)}\n onConfirm={() => {\n const graftableAug = GraftableAugmentations[selectedAug];\n player.loseMoney(graftableAug.cost, \"augmentations\");\n player.startGraftAugmentationWork(selectedAug, graftableAug.time);\n player.startFocusing();\n router.toWork();\n }}\n confirmationText={\n <>\n Cancelling grafting will <b>not</b> save grafting progress, and the money you spend will <b>not</b>{\" \"}\n be returned.\n {!player.hasAugmentation(AugmentationNames.CongruityImplant) && (\n <>\n <br />\n <br />\n Additionally, grafting an Augmentation will increase the potency of the Entropy virus.\n </>\n )}\n </>\n }\n />\n <Box sx={{ maxHeight: 330, overflowY: \"scroll\" }}>\n <Typography color={Settings.theme.info}>\n <b>Time to Graft:</b>{\" \"}\n {convertTimeMsToTimeElapsedString(\n calculateGraftingTimeWithBonus(player, GraftableAugmentations[selectedAug]),\n )}\n {/* Use formula so the displayed creation time is accurate to player bonus */}\n </Typography>\n\n {selectedAugmentation.prereqs.length > 0 && (\n <AugPreReqsChecklist player={player} aug={selectedAugmentation} />\n )}\n\n <br />\n\n <Typography>\n {(() => {\n const info =\n typeof selectedAugmentation.info === \"string\" ? (\n <span>{selectedAugmentation.info}</span>\n ) : (\n selectedAugmentation.info\n );\n const tooltip = (\n <>\n {info}\n <br />\n <br />\n {selectedAugmentation.stats}\n </>\n );\n return tooltip;\n })()}\n </Typography>\n </Box>\n </Box>\n </Paper>\n ) : (\n <Typography>All Augmentations owned</Typography>\n )}\n </Box>\n\n <Box sx={{ my: 3 }}>\n <Typography variant=\"h5\">Entropy Virus</Typography>\n\n <Paper sx={{ my: 1, p: 1, width: \"fit-content\" }}>\n <Typography>\n <b>Entropy strength:</b> {player.entropy}\n <br />\n <b>All multipliers decreased by:</b>{\" \"}\n {formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropy) * 100, 3)}% (multiplicative)\n </Typography>\n </Paper>\n\n <Typography>\n When installed on an unconscious individual, Augmentations are scanned by the body on awakening, eliminating\n hidden malware. However, grafted Augmentations do not provide this security measure.\n <br />\n <br />\n Individuals who tested Augmentation grafting have reported symptoms of an unknown virus, which they've dubbed\n \"Entropy\". This virus seems to grow more potent with each grafted Augmentation...\n </Typography>\n </Box>\n </Container>\n );\n};\n","import { Box, Container, Paper, Table, TableBody, Tooltip } from \"@mui/material\";\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport { uniqueId } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { Companies } from \"../Company/Companies\";\nimport { Company } from \"../Company/Company\";\nimport { CONSTANTS } from \"../Constants\";\nimport { Factions } from \"../Faction/Factions\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { Locations } from \"../Locations/Locations\";\nimport { Settings } from \"../Settings/Settings\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { use } from \"./Context\";\nimport { numeralWrapper } from \"./numeralFormat\";\nimport { Money } from \"./React/Money\";\nimport { MoneyRate } from \"./React/MoneyRate\";\nimport { ProgressBar } from \"./React/Progress\";\nimport { Reputation } from \"./React/Reputation\";\nimport { ReputationRate } from \"./React/ReputationRate\";\nimport { StatsRow } from \"./React/StatsRow\";\nimport { WorkType, ClassType } from \"../utils/WorkType\";\n\nconst CYCLES_PER_SEC = 1000 / CONSTANTS.MilliPerCycle;\n\ninterface IWorkInfo {\n buttons: {\n cancel: () => void;\n unfocus?: () => void;\n };\n title: string | React.ReactElement;\n\n description?: string | React.ReactElement;\n gains?: (string | React.ReactElement)[];\n progress?: {\n elapsed?: number;\n remaining?: number;\n percentage?: number;\n };\n\n stopText: string;\n stopTooltip?: string | React.ReactElement;\n}\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\n const player = use.Player();\n const router = use.Router();\n\n const expGains = [\n player.workHackExpGained > 0 ? (\n <StatsRow\n name=\"Hacking Exp\"\n color={Settings.theme.hack}\n data={{\n content: `${numeralWrapper.formatExp(player.workHackExpGained)} (${numeralWrapper.formatExp(\n player.workHackExpGainRate * CYCLES_PER_SEC,\n )} / sec)`,\n }}\n />\n ) : (\n <></>\n ),\n player.workStrExpGained > 0 ? (\n <StatsRow\n name=\"Strength Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(player.workStrExpGained)} (${numeralWrapper.formatExp(\n player.workStrExpGainRate * CYCLES_PER_SEC,\n )} / sec)`,\n }}\n />\n ) : (\n <></>\n ),\n player.workDefExpGained > 0 ? (\n <StatsRow\n name=\"Defense Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(player.workDefExpGained)} (${numeralWrapper.formatExp(\n player.workDefExpGainRate * CYCLES_PER_SEC,\n )} / sec)`,\n }}\n />\n ) : (\n <></>\n ),\n player.workDexExpGained > 0 ? (\n <StatsRow\n name=\"Dexterity Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(player.workDexExpGained)} (${numeralWrapper.formatExp(\n player.workDexExpGainRate * CYCLES_PER_SEC,\n )} / sec)`,\n }}\n />\n ) : (\n <></>\n ),\n player.workAgiExpGained > 0 ? (\n <StatsRow\n name=\"Agility Exp\"\n color={Settings.theme.combat}\n data={{\n content: `${numeralWrapper.formatExp(player.workAgiExpGained)} (${numeralWrapper.formatExp(\n player.workAgiExpGainRate * CYCLES_PER_SEC,\n )} / sec)`,\n }}\n />\n ) : (\n <></>\n ),\n player.workChaExpGained > 0 ? (\n <StatsRow\n name=\"Charisma Exp\"\n color={Settings.theme.cha}\n data={{\n content: `${numeralWrapper.formatExp(player.workChaExpGained)} (${numeralWrapper.formatExp(\n player.workChaExpGainRate * CYCLES_PER_SEC,\n )} / sec)`,\n }}\n />\n ) : (\n <></>\n ),\n ];\n\n let workInfo: IWorkInfo | null;\n\n switch (player.workType) {\n case WorkType.Faction: {\n const faction = Factions[player.currentWorkFactionName];\n if (!faction) {\n workInfo = {\n buttons: {\n cancel: () => router.toFactions(),\n },\n title:\n `You have not joined ${player.currentWorkFactionName || \"(Faction not found)\"} at this time,` +\n \" please try again if you think this should have worked\",\n\n stopText: \"Back to Factions\",\n };\n }\n\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\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently {player.currentWorkFactionDescription} for your faction <b>{faction.name}</b>\n </>\n ),\n\n description: (\n <>\n Current Faction Reputation: <Reputation reputation={faction.playerReputation} />\n </>\n ),\n gains: [\n player.workMoneyGained > 0 ? (\n <StatsRow name=\"Money\" color={Settings.theme.money}>\n <Typography>\n <Money money={player.workMoneyGained} /> (\n <MoneyRate money={player.workMoneyGainRate * CYCLES_PER_SEC} />)\n </Typography>\n </StatsRow>\n ) : (\n <></>\n ),\n <StatsRow name=\"Faction Reputation\" color={Settings.theme.rep}>\n <Typography>\n <Reputation reputation={player.workRepGained} /> (\n <ReputationRate reputation={player.workRepGainRate * CYCLES_PER_SEC} />)\n </Typography>\n </StatsRow>,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: \"Stop Faction work\",\n };\n\n break;\n }\n\n case WorkType.StudyClass: {\n const className = player.className;\n function cancel(): void {\n player.finishClass(true);\n router.toCity();\n }\n\n function unfocus(): void {\n router.toCity();\n player.stopFocusing();\n }\n\n let stopText = \"\";\n if (\n className === ClassType.GymStrength ||\n className === ClassType.GymDefense ||\n className === ClassType.GymDexterity ||\n className === ClassType.GymAgility\n ) {\n stopText = \"Stop training at gym\";\n } else {\n stopText = \"Stop taking course\";\n }\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently <b>{className}</b>\n </>\n ),\n\n gains: [\n <StatsRow name=\"Total Cost\" color={Settings.theme.money}>\n <Typography>\n <Money money={-player.workMoneyGained} /> (<MoneyRate money={player.workMoneyLossRate * CYCLES_PER_SEC} />\n )\n </Typography>\n </StatsRow>,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: stopText,\n };\n\n break;\n }\n\n case WorkType.Company: {\n const comp = Companies[player.companyName];\n if (comp == null || !(comp instanceof Company)) {\n workInfo = {\n buttons: {\n cancel: () => router.toTerminal(),\n },\n title:\n `You cannot work for ${player.companyName || \"(Company not found)\"} at this time,` +\n \" please try again if you think this should have worked\",\n\n stopText: \"Back to Terminal\",\n };\n }\n\n const 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\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working as a <b>{position}</b> at <b>{player.companyName}</b>\n </>\n ),\n\n description: (\n <>\n Current Company Reputation: <Reputation reputation={companyRep} />\n </>\n ),\n gains: [\n <StatsRow name=\"Money\" color={Settings.theme.money}>\n <Typography>\n <Money money={player.workMoneyGained} /> (<MoneyRate money={player.workMoneyGainRate * CYCLES_PER_SEC} />)\n </Typography>\n </StatsRow>,\n <StatsRow name=\"Company Reputation\" color={Settings.theme.rep}>\n <Typography>\n <Reputation reputation={player.workRepGained} /> (\n <ReputationRate reputation={player.workRepGainRate * CYCLES_PER_SEC} />)\n </Typography>\n </StatsRow>,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: \"Stop working\",\n stopTooltip:\n \"You will automatically finish after working for 8 hours. You can cancel earlier if you wish\" +\n ` but you will only gain ${penaltyString} of the reputation you've earned so far.`,\n };\n\n break;\n }\n\n case WorkType.CompanyPartTime: {\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\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working as a <b>{position}</b> at <b>{player.companyName}</b>\n </>\n ),\n\n description: (\n <>\n Current Company Reputation: <Reputation reputation={companyRep} />\n </>\n ),\n gains: [\n <StatsRow name=\"Money\" color={Settings.theme.money}>\n <Typography>\n <Money money={player.workMoneyGained} /> (<MoneyRate money={player.workMoneyGainRate * CYCLES_PER_SEC} />)\n </Typography>\n </StatsRow>,\n <StatsRow name=\"Company Reputation\" color={Settings.theme.rep}>\n <Typography>\n <Reputation reputation={player.workRepGained} /> (\n <ReputationRate reputation={player.workRepGainRate * CYCLES_PER_SEC} />)\n </Typography>\n </StatsRow>,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: \"Stop working\",\n stopTooltip:\n \"You will automatically finish after working for 8 hours. You can cancel earlier if you wish\" +\n \" and there will be no penalty because this is a part-time job.\",\n };\n\n break;\n }\n\n case WorkType.Crime: {\n const completion = Math.round((player.timeWorked / player.timeNeededToCompleteWork) * 100);\n\n workInfo = {\n buttons: {\n cancel: () => {\n router.toLocation(Locations[LocationName.Slums]);\n player.finishCrime(true);\n },\n },\n title: `You are attempting to ${player.crimeType}`,\n\n progress: {\n remaining: player.timeNeededToCompleteWork - player.timeWorked,\n percentage: completion,\n },\n\n stopText: \"Cancel crime\",\n };\n\n break;\n }\n\n case WorkType.CreateProgram: {\n function cancel(): void {\n player.finishCreateProgramWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n\n const completion = (player.timeWorkedCreateProgram / player.timeNeededToCompleteWork) * 100;\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on coding <b>{player.createProgramName}</b>\n </>\n ),\n\n progress: {\n elapsed: player.timeWorked,\n percentage: completion,\n },\n\n stopText: \"Stop creating program\",\n stopTooltip: \"Your work will be saved and you can return to complete the program later.\",\n };\n\n break;\n }\n\n case WorkType.GraftAugmentation: {\n function cancel(): void {\n player.finishGraftAugmentationWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n\n const completion = (player.timeWorkedGraftAugmentation / player.timeNeededToCompleteWork) * 100;\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on grafting <b>{player.graftAugmentationName}</b>\n </>\n ),\n\n progress: {\n elapsed: player.timeWorked,\n percentage: completion,\n },\n\n stopText: \"Stop grafting\",\n stopTooltip: (\n <>\n If you cancel, your work will <b>not</b> be saved, and the money you spent will <b>not</b> be returned\n </>\n ),\n };\n\n break;\n }\n\n default:\n router.toTerminal();\n workInfo = null;\n }\n\n if (workInfo === null) {\n return <></>;\n }\n\n const tooltipInfo =\n typeof workInfo?.stopTooltip === \"string\" ? (\n <Typography>{workInfo.stopTooltip}</Typography>\n ) : (\n workInfo.stopTooltip || <></>\n );\n\n return (\n <Container\n maxWidth=\"md\"\n sx={{ display: \"flex\", flexDirection: \"column\", justifyContent: \"center\", height: \"calc(100vh - 16px)\" }}\n >\n <Paper sx={{ p: 1, mb: 1 }}>\n <Typography variant=\"h6\">{workInfo.title}</Typography>\n <Typography>{workInfo.description}</Typography>\n {workInfo.gains && (\n <Table sx={{ mt: 1 }}>\n <TableBody>\n {workInfo.gains.map((row) => (\n <React.Fragment key={uniqueId()}>{row}</React.Fragment>\n ))}\n </TableBody>\n </Table>\n )}\n </Paper>\n <Paper sx={{ mb: 1, p: 1 }}>\n {workInfo.progress !== undefined && (\n <Box sx={{ mb: 1 }}>\n <Box\n display=\"grid\"\n sx={{\n gridTemplateColumns: `repeat(${Object.keys(workInfo.progress).length}, 1fr)`,\n width: \"100%\",\n justifyItems: \"center\",\n textAlign: \"center\",\n }}\n >\n {workInfo.progress.elapsed !== undefined && (\n <Typography>{convertTimeMsToTimeElapsedString(workInfo.progress.elapsed)} elapsed</Typography>\n )}\n {workInfo.progress.remaining !== undefined && (\n <Typography>{convertTimeMsToTimeElapsedString(workInfo.progress.remaining)} remaining</Typography>\n )}\n {workInfo.progress.percentage !== undefined && (\n <Typography>{workInfo.progress.percentage.toFixed(2)}% done</Typography>\n )}\n </Box>\n {workInfo.progress.percentage !== undefined && (\n <ProgressBar variant=\"determinate\" value={workInfo.progress.percentage} color=\"primary\" />\n )}\n </Box>\n )}\n\n <Box display=\"grid\" sx={{ gridTemplateColumns: `repeat(${Object.keys(workInfo.buttons).length}, 1fr)` }}>\n {workInfo.stopTooltip ? (\n <Tooltip title={tooltipInfo}>\n <Button onClick={workInfo.buttons.cancel}>{workInfo.stopText}</Button>\n </Tooltip>\n ) : (\n <Button onClick={workInfo.buttons.cancel}>{workInfo.stopText}</Button>\n )}\n {workInfo.buttons.unfocus && (\n <Button onClick={workInfo.buttons.unfocus}>Do something else simultaneously</Button>\n )}\n </Box>\n </Paper>\n </Container>\n );\n}\n","import { Box, Container, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\nimport { CurrentOptionsPage } from \"./CurrentOptionsPage\";\nimport { GameOptionsSidebar } from \"./GameOptionsSidebar\";\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 [currentTab, setCurrentTab] = useState(GameOptionsTab.SYSTEM);\n\n return (\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0 }}>\n <Typography variant=\"h4\">Options</Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 3fr\", gap: 1 }}>\n <GameOptionsSidebar\n tab={currentTab}\n setTab={(tab: GameOptionsTab) => setCurrentTab(tab)}\n player={props.player}\n router={props.router}\n save={props.save}\n export={props.export}\n forceKill={props.forceKill}\n softReset={props.softReset}\n />\n <CurrentOptionsPage currentTab={currentTab} player={props.player} />\n </Box>\n </Container>\n );\n}\n","import { MenuItem, Select, SelectChangeEvent, TextField, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { formatTime } from \"../../utils/helpers/formatTime\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { OptionsSlider } from \"./OptionsSlider\";\n\ninterface IProps {\n currentTab: GameOptionsTab;\n player: IPlayer;\n}\n\nexport const CurrentOptionsPage = (props: IProps): React.ReactElement => {\n const [execTime, setExecTime] = useState(Settings.CodeInstructionRunTime);\n const [recentScriptsSize, setRecentScriptsSize] = useState(Settings.MaxRecentScriptsCapacity);\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\n function handleExecTimeChange(event: any, newValue: number | number[]): void {\n setExecTime(newValue as number);\n Settings.CodeInstructionRunTime = newValue as number;\n }\n\n function handleRecentScriptsSizeChange(event: any, newValue: number | number[]): void {\n setRecentScriptsSize(newValue as number);\n Settings.MaxRecentScriptsCapacity = 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 const pages = {\n [GameOptionsTab.SYSTEM]: (\n <GameOptionsPage title=\"System\">\n {/* Wrap in a React fragment to prevent the sliders from breaking as list items */}\n <>\n <OptionsSlider\n label=\".script exec time (ms)\"\n initialValue={execTime}\n callback={handleExecTimeChange}\n step={1}\n min={5}\n max={100}\n tooltip={\n <>\n The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too low\n can result in poor performance if you have many scripts running.\n </>\n }\n />\n <OptionsSlider\n label=\"Recently killed scripts size\"\n initialValue={recentScriptsSize}\n callback={handleRecentScriptsSizeChange}\n step={25}\n min={0}\n max={500}\n tooltip={\n <>\n The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a\n lot of memory if you have many scripts running.\n </>\n }\n />\n <OptionsSlider\n label=\"Netscript log size\"\n initialValue={logSize}\n callback={handleLogSizeChange}\n step={20}\n min={20}\n max={500}\n tooltip={\n <>\n The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a\n lot of memory if you have many scripts running.\n </>\n }\n />\n <OptionsSlider\n label=\"Netscript port size\"\n initialValue={portSize}\n callback={handlePortSizeChange}\n step={1}\n min={20}\n max={100}\n tooltip={\n <>\n The maximum number of entries that can be written to a port using Netscript's write() function. Setting\n this too high can cause the game to use a lot of memory.\n </>\n }\n />\n <OptionsSlider\n label=\"Terminal capacity\"\n initialValue={terminalSize}\n callback={handleTerminalSizeChange}\n step={50}\n min={50}\n max={500}\n tooltip={\n <>\n The maximum number of entries that can be written to the terminal. Setting this too high can cause the\n game to use a lot of memory.\n </>\n }\n marks\n />\n <OptionsSlider\n label=\"Autosave interval (s)\"\n initialValue={autosaveInterval}\n callback={handleAutosaveIntervalChange}\n step={30}\n min={0}\n max={600}\n tooltip={<>The time (in seconds) between each autosave. Set to 0 to disable autosave.</>}\n marks\n />\n </>\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 <OptionSwitch\n checked={Settings.SuppressAutosaveDisabledWarnings}\n onChange={(newValue) => (Settings.SuppressAutosaveDisabledWarnings = newValue)}\n text=\"Suppress Auto-Save Disabled Warning\"\n tooltip={<>If this is set, there will be no warning triggered when auto-save is disabled (at 0).</>}\n />\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 <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 <OptionSwitch\n checked={Settings.InfinityLoopSafety}\n onChange={(newValue) => (Settings.InfinityLoopSafety = newValue)}\n text=\"Script infinite loop safety net\"\n tooltip={<>If this is set the game will attempt to automatically kill scripts stuck in infinite loops.</>}\n />\n </GameOptionsPage>\n ),\n [GameOptionsTab.INTERFACE]: (\n <GameOptionsPage title=\"Interface\">\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 <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 certain\n areas.\n </>\n }\n />\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 <OptionSwitch\n checked={Settings.UseIEC60027_2}\n onChange={(newValue) => (Settings.UseIEC60027_2 = newValue)}\n text=\"Use GiB instead of GB\"\n tooltip={\n <>If this is set all references to memory will use GiB instead of GB, in accordance with IEC 60027-2.</>\n }\n />\n <Tooltip\n title={\n <Typography>\n Terminal commands and log entries will be timestamped. See https://date-fns.org/docs/Getting-Started/\n </Typography>\n }\n >\n <TextField\n InputProps={{\n startAdornment: (\n <Typography\n color={formatTime(timestampFormat) === \"format error\" && timestampFormat !== \"\" ? \"error\" : \"success\"}\n >\n Timestamp format:\n </Typography>\n ),\n }}\n value={timestampFormat}\n onChange={handleTimestampFormatChange}\n placeholder=\"yyyy-MM-dd hh:mm:ss\"\n />\n </Tooltip>\n <>\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 </>\n </GameOptionsPage>\n ),\n [GameOptionsTab.GAMEPLAY]: (\n <GameOptionsPage title=\"Gameplay\">\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 still get\n sent to your home computer as '.msg' files and can be viewed with the 'cat' Terminal command.\n </>\n }\n />\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 <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 be\n deducted the travel cost as soon as you click.\n </>\n }\n />\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 <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 {props.player.bladeburner && (\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 will\n not display a popup message.\n </>\n }\n />\n )}\n </GameOptionsPage>\n ),\n [GameOptionsTab.MISC]: (\n <GameOptionsPage title=\"Misc\">\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 Terminal\n commands, hotkeys to navigate between different parts of the game, and the \"Save and Close (Ctrl + b)\"\n hotkey in the Text Editor.\n </>\n }\n />\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 that\n more closely resemble a real Bash-style shell. Note that when this mode is enabled, the default browser\n shortcuts are overriden by the new Bash shortcuts.\n </>\n }\n />\n </GameOptionsPage>\n ),\n };\n\n return pages[props.currentTab];\n};\n","import {\n BugReport,\n Chat,\n Download,\n LibraryBooks,\n Palette,\n Public,\n Reddit,\n Save,\n SystemUpdateAlt,\n Upload,\n Bloodtype,\n} from \"@mui/icons-material\";\nimport { Box, Button, List, ListItemButton, Paper, Tooltip, Typography } from \"@mui/material\";\nimport { default as React, useRef, useState } from \"react\";\nimport { FileDiagnosticModal } from \"../../Diagnostic/FileDiagnosticModal\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { ImportData, saveObject } from \"../../SaveObject\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { StyleEditorButton } from \"../../Themes/ui/StyleEditorButton\";\nimport { ThemeEditorButton } from \"../../Themes/ui/ThemeEditorButton\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\nimport { DeleteGameButton } from \"../../ui/React/DeleteGameButton\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { SoftResetButton } from \"../../ui/React/SoftResetButton\";\nimport { IRouter } from \"../../ui/Router\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\n\ninterface IProps {\n tab: GameOptionsTab;\n setTab: (tab: GameOptionsTab) => void;\n player: IPlayer;\n router: IRouter;\n save: () => void;\n export: () => void;\n forceKill: () => void;\n softReset: () => void;\n}\n\ninterface ITabProps {\n sideBarProps: IProps;\n tab: GameOptionsTab;\n tabName: string;\n}\n\nconst SideBarTab = (props: ITabProps): React.ReactElement => {\n return (\n <ListItemButton\n selected={props.sideBarProps.tab === props.tab}\n onClick={() => props.sideBarProps.setTab(props.tab)}\n >\n <Typography>{props.tabName}</Typography>\n </ListItemButton>\n );\n};\n\nexport const GameOptionsSidebar = (props: IProps): React.ReactElement => {\n const importInput = useRef<HTMLInputElement>(null);\n\n const [diagnosticOpen, setDiagnosticOpen] = useState(false);\n const [importSaveOpen, setImportSaveOpen] = useState(false);\n const [importData, setImportData] = useState<ImportData | null>(null);\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(), ToastVariant.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(), ToastVariant.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 <Box>\n <Paper sx={{ height: \"fit-content\", mb: 1 }}>\n <List>\n <SideBarTab sideBarProps={props} tab={GameOptionsTab.SYSTEM} tabName=\"System\" />\n <SideBarTab sideBarProps={props} tab={GameOptionsTab.GAMEPLAY} tabName=\"Gameplay\" />\n <SideBarTab sideBarProps={props} tab={GameOptionsTab.INTERFACE} tabName=\"Interface\" />\n <SideBarTab sideBarProps={props} tab={GameOptionsTab.MISC} tabName=\"Misc\" />\n </List>\n </Paper>\n <Box\n sx={{\n display: \"grid\",\n width: \"100%\",\n height: \"fit-content\",\n gridTemplateAreas: `\"save delete\"\n \"export import\"\n \"kill kill\"\n \"reset diagnose\"\n \"browse browse\"\n \"theme style\"\n \"links links\"\n \"devs devs\"`,\n gridTemplateColumns: \"1fr 1fr\",\n }}\n >\n <Button onClick={() => props.save()} startIcon={<Save />} sx={{ gridArea: \"save\" }}>\n Save Game\n </Button>\n <Box sx={{ gridArea: \"delete\", \"& .MuiButton-root\": { height: \"100%\", width: \"100%\" } }}>\n <DeleteGameButton />\n </Box>\n <Tooltip title={<Typography>Export your game to a text file.</Typography>}>\n <Button onClick={() => props.export()} startIcon={<Download />} sx={{ gridArea: \"export\" }}>\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={<Upload />} sx={{ gridArea: \"import\" }}>\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 <Tooltip\n title={\n <Typography>\n Forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the game.\n After using this, save the game and then reload the page. This is different than normal kill in that\n normal kill will tell the script to shut down while force kill just removes the references to it (and it\n should crash on its own). This will not remove the files on your computer, just forcefully kill all\n running instances of all scripts.\n </Typography>\n }\n >\n <Button onClick={() => props.forceKill()} sx={{ gridArea: \"kill\" }}>\n Force kill all active scripts\n </Button>\n </Tooltip>\n <Box sx={{ gridArea: \"reset\", \"& .MuiButton-root\": { height: \"100%\", width: \"100%\" } }}>\n <SoftResetButton\n noConfirmation={Settings.SuppressBuyAugmentationConfirmation}\n onTriggered={props.softReset}\n />\n </Box>\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 server.\n Be careful: there might be spoilers.\n </Typography>\n }\n >\n <Button onClick={() => setDiagnosticOpen(true)} sx={{ gridArea: \"diagnose\" }}>\n Diagnose files\n </Button>\n </Tooltip>\n <Tooltip title=\"Head to the theme browser to see a collection of prebuilt themes.\">\n <Button startIcon={<Palette />} onClick={() => props.router.toThemeBrowser()} sx={{ gridArea: \"browse\" }}>\n Theme Browser\n </Button>\n </Tooltip>\n <Box sx={{ gridArea: \"theme\", \"& .MuiButton-root\": { height: \"100%\", width: \"100%\" } }}>\n <ThemeEditorButton router={props.router} />\n </Box>\n <Box sx={{ gridArea: \"style\", \"& .MuiButton-root\": { height: \"100%\", width: \"100%\" } }}>\n <StyleEditorButton />\n </Box>\n\n <Box\n sx={{\n gridArea: \"links\",\n display: \"grid\",\n gridTemplateAreas: `\"bug changelog\"\n \"docs docs\"\n \"discord reddit\"\n \"plaza plaza\"`,\n gridTemplateColumns: \"1fr 1fr\",\n my: 1,\n }}\n >\n <Button\n startIcon={<BugReport />}\n href=\"https://github.com/danielyxie/bitburner/issues/new\"\n target=\"_blank\"\n sx={{ gridArea: \"bug\" }}\n >\n Report Bug\n </Button>\n <Button\n startIcon={<SystemUpdateAlt />}\n href=\"https://bitburner.readthedocs.io/en/latest/changelog.html\"\n target=\"_blank\"\n sx={{ gridArea: \" changelog\" }}\n >\n Changelog\n </Button>\n <Button\n startIcon={<LibraryBooks />}\n href=\"https://bitburner.readthedocs.io/en/latest/index.html\"\n target=\"_blank\"\n sx={{ gridArea: \"docs\" }}\n >\n Documentation\n </Button>\n <Button startIcon={<Chat />} href=\"https://discord.gg/TFc3hKD\" target=\"_blank\" sx={{ gridArea: \"discord\" }}>\n Discord\n </Button>\n <Button\n startIcon={<Reddit />}\n href=\"https://www.reddit.com/r/bitburner\"\n target=\"_blank\"\n sx={{ gridArea: \"reddit\" }}\n >\n Reddit\n </Button>\n <Button\n startIcon={<Public />}\n href=\"https://plaza.dsolver.ca/games/bitburner\"\n target=\"_blank\"\n sx={{ gridArea: \"plaza\" }}\n >\n Incremental game plaza\n </Button>\n </Box>\n\n {!location.href.startsWith(\"file://\") && (\n <Box sx={{ gridArea: \"devs\" }}>\n <form\n action=\"https://www.paypal.com/cgi-bin/webscr\"\n method=\"post\"\n target=\"_blank\"\n style={{ display: \"block\" }}\n >\n <Button sx={{ width: \"100%\", display: \"flex\", flexDirection: \"column\" }} type=\"submit\">\n danielyxie / BigD (Original Dev)\n <input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\" />\n <input\n type=\"hidden\"\n name=\"encrypted\"\n value=\"-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYA2Y2VGE75oWct89z//G2YEJKmzx0uDTXNrpje9ThxmUnBLFZCY+I11Pors7lGRvFqo5okwnu41CfYMPHDxpAgyYyQndMX9pWUX0gLfBMm2BaHwsNBCwt34WmpQqj7TGsQ+aw9NbmkxiJltGnOa+6/gy10mPZAA3HxiieLeCKkGgDELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI72F1YSzHUd2AgaDMekHU3AKT93Ey9wkB3486bV+ngFSD6VOHrPweH9QATsp+PMe9QM9vmq+s2bGtTbZaYrFqM3M97SnQ0l7IQ5yuOzdZhRdfysu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ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcwNzI1MDExODE2WjAjBgkqhkiG9w0BCQQxFgQUNo8efiZ7sk7nwKM/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 src=\"https://www.paypalobjects.com/digitalassets/c/website/marketing/apac/C2/logos-buttons/optimize/26_Yellow_PayPal_Pill_Button.png\"\n name=\"submit\"\n alt=\"PayPal - The safer, easier way to pay online!\"\n />\n </Button>\n </form>\n <Button\n href=\"https://www.google.com/search?q=Where+to+donate+blood+near+me%3F\"\n target=\"_blank\"\n sx={{\n width: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n }}\n >\n hydroflame (Current Maintainer)\n <span style={{ display: \"flex\", alignItems: \"center\" }}>\n <Bloodtype sx={{ mb: 0.5, mr: 1 }} />\n Donate blood!\n </span>\n </Button>\n </Box>\n )}\n </Box>\n <FileDiagnosticModal open={diagnosticOpen} onClose={() => setDiagnosticOpen(false)} />\n </Box>\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, { 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 } 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\">\n primary button\n </Button>\n </Tooltip>\n <Button color=\"secondary\" size=\"small\">\n secondary button\n </Button>\n <Button color=\"warning\" size=\"small\">\n warning button\n </Button>\n <Button color=\"info\" size=\"small\">\n info button\n </Button>\n <Button color=\"error\" size=\"small\">\n error button\n </Button>\n <Button disabled size=\"small\">\n disabled button\n </Button>\n <br />\n <Typography color=\"primary\" variant=\"caption\">\n text with primary color\n </Typography>\n \n <Typography color=\"secondary\" variant=\"caption\">\n text with secondary color\n </Typography>\n \n <Typography color=\"error\" variant=\"caption\">\n text with error color\n </Typography>\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={10}\n label={\"import / export theme\"}\n value={JSON.stringify(customTheme, undefined, 2)}\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)} 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()}>\n See more themes\n </Button>\n </Tooltip>\n </ButtonGroup>\n </>\n </Paper>\n </Modal>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { Box, Typography, Button, Container } from \"@mui/material\";\n\nimport { use } from \"../../../ui/Context\";\n\nimport { SleeveElem } from \"./SleeveElem\";\nimport { FAQModal } from \"./FAQModal\";\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 <Container disableGutters maxWidth=\"md\" sx={{ mx: 0 }}>\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 </Container>\n\n <Button onClick={() => setFAQOpen(true)}>FAQ</Button>\n <Button\n href=\"https://bitburner.readthedocs.io/en/latest/advancedgameplay/sleeves.html#duplicate-sleeves\"\n target=\"_blank\"\n >\n Wiki Documentation\n </Button>\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"repeat(2, 1fr)\", mt: 1 }}>\n {player.sleeves.map((sleeve, i) => (\n <SleeveElem key={i} rerender={rerender} sleeve={sleeve} />\n ))}\n </Box>\n <FAQModal open={FAQOpen} onClose={() => setFAQOpen(false)} />\n </>\n );\n}\n","import { Box, Button, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { FactionWorkType } from \"../../../Faction/FactionWorkTypeEnum\";\nimport { use } from \"../../../ui/Context\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { ProgressBar } from \"../../../ui/React/Progress\";\nimport { Sleeve } from \"../Sleeve\";\nimport { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\nimport { MoreEarningsModal } from \"./MoreEarningsModal\";\nimport { MoreStatsModal } from \"./MoreStatsModal\";\nimport { SleeveAugmentationsModal } from \"./SleeveAugmentationsModal\";\nimport { EarningsElement, StatsElement } from \"./StatsElement\";\nimport { TaskSelector } from \"./TaskSelector\";\nimport { TravelModal } from \"./TravelModal\";\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(player); // 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 \"Perform Bladeburner Actions\":\n props.sleeve.bladeburner(player, abc[1], abc[2]);\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.Bladeburner: {\n let message = \"\";\n if (props.sleeve.bbContract !== \"------\") {\n message = ` - ${props.sleeve.bbContract} (Success Rate: ${props.sleeve.currentTaskLocation})`;\n } else if (props.sleeve.currentTaskLocation !== \"\") {\n message = props.sleeve.currentTaskLocation;\n }\n desc = (\n <>\n This sleeve is currently attempting to {props.sleeve.bbAction}. {message}\n </>\n );\n break;\n }\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 return (\n <>\n <Paper sx={{ p: 1, display: \"grid\", gridTemplateColumns: \"1fr 1fr\", width: \"auto\", gap: 1 }}>\n <span>\n <StatsElement sleeve={props.sleeve} />\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"1fr 1fr\", width: \"100%\" }}>\n <Button onClick={() => setStatsOpen(true)}>More Stats</Button>\n <Button onClick={() => setEarningsOpen(true)}>More Earnings Info</Button>\n <Tooltip title={player.money < CONSTANTS.TravelCost ? <Typography>Insufficient funds</Typography> : \"\"}>\n <span>\n <Button\n onClick={() => setTravelOpen(true)}\n disabled={player.money < CONSTANTS.TravelCost}\n sx={{ width: \"100%\", height: \"100%\" }}\n >\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\n onClick={() => setAugmentationsOpen(true)}\n disabled={props.sleeve.shock < 100}\n sx={{ width: \"100%\", height: \"100%\" }}\n >\n Manage Augmentations\n </Button>\n </span>\n </Tooltip>\n </Box>\n </span>\n <span>\n <EarningsElement sleeve={props.sleeve} />\n <TaskSelector player={player} sleeve={props.sleeve} setABC={setABC} />\n <Button onClick={setTask} sx={{ width: \"100%\" }}>\n Set Task\n </Button>\n <Typography>{desc}</Typography>\n <Typography>\n {(props.sleeve.currentTask === SleeveTaskType.Crime ||\n props.sleeve.currentTask === SleeveTaskType.Bladeburner) &&\n props.sleeve.currentTaskMaxTime > 0 && (\n <ProgressBar\n variant=\"determinate\"\n value={(props.sleeve.currentTaskTime / props.sleeve.currentTaskMaxTime) * 100}\n color=\"primary\"\n />\n )}\n </Typography>\n </span>\n </Paper>\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 { 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 { 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 { Container, Typography, Paper } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { PurchasableAugmentations } from \"../../../Augmentation/ui/PurchasableAugmentations\";\nimport { use } from \"../../../ui/Context\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { Sleeve } from \"../Sleeve\";\nimport { findSleevePurchasableAugs } from \"../SleeveHelpers\";\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 return (\n <Modal open={props.open} onClose={props.onClose}>\n <Container component={Paper} disableGutters maxWidth=\"lg\" sx={{ mx: 0, mb: 1, p: 1 }}>\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 <br />\n <br />\n Augmentations will appear below as they become available.\n </Typography>\n </Container>\n <PurchasableAugmentations\n augNames={availableAugs.map((aug) => aug.name)}\n ownedAugNames={ownedAugNames}\n player={player}\n canPurchase={(player, aug) => {\n return player.money > aug.baseCost;\n }}\n purchaseAugmentation={(player, aug, _showModal) => {\n props.sleeve.tryBuyAugmentation(player, aug);\n rerender();\n }}\n sleeveAugs\n />\n </Modal>\n );\n}\n","import React from \"react\";\n\nimport { Augmentation } from \"../Augmentation\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { purchaseAugmentation } from \"../../Faction/FactionHelpers\";\nimport { isRepeatableAug } from \"../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}\n\nexport function PurchaseAugmentationModal(props: IProps): React.ReactElement {\n if (typeof props.aug === \"undefined\" || typeof props.faction === \"undefined\") {\n return <></>;\n }\n\n const player = use.Player();\n\n function buy(): void {\n if (!isRepeatableAug(props.aug as Augmentation) && player.hasAugmentation(props.aug as Augmentation)) {\n return;\n }\n\n purchaseAugmentation(props.aug as Augmentation, props.faction as Faction);\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.getCost(player).moneyCost} />?\n <br />\n <br />\n </Typography>\n <Button autoFocus onClick={buy}>\n Purchase\n </Button>\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\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\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\nconst bladeburnerSelectorOptions: string[] = [\n \"Field analysis\",\n \"Recruitment\",\n \"Diplomacy\",\n \"Infiltrate synthoids\",\n \"Support main sleeve\",\n \"Take on contracts\",\n];\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 = [FactionNames.Bladeburners as string, FactionNames.ShadowsOfAnarchy as string];\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.filter((faction) => {\n const factionObj = Factions[faction];\n if (!factionObj) return false;\n const facInfo = factionObj.getInfo();\n return facInfo.offerHackingWork || facInfo.offerFieldWork || facInfo.offerSecurityWork;\n });\n}\n\nfunction possibleContracts(player: IPlayer, sleeve: Sleeve): string[] {\n const bb = player.bladeburner;\n if (bb === null) {\n return [\"------\"];\n }\n let contracts = bb.getContractNamesNetscriptFn();\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (otherSleeve.currentTask === SleeveTaskType.Bladeburner && otherSleeve.bbAction == \"Take on contracts\") {\n contracts = contracts.filter((x) => x != otherSleeve.bbContract);\n }\n }\n if (contracts.length === 0) {\n return [\"------\"];\n }\n return contracts;\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 [\"Perform Bladeburner Actions\"]: (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 if (!faction) return [\"------\"];\n\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 \"Perform Bladeburner Actions\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n return {\n first: bladeburnerSelectorOptions,\n second: (s1: string) => {\n if (s1 === \"Take on contracts\") {\n return possibleContracts(player, sleeve);\n } else {\n return [\"------\"];\n }\n },\n };\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 [\"Perform Bladeburner Actions\"]: (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 \"Perform Bladeburner Actions\": (player: IPlayer, _: Sleeve) => player.inBladeburner(),\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.Bladeburner:\n return [\"Perform Bladeburner Actions\", sleeve.bbAction, sleeve.bbContract];\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} sx={{ width: \"100%\" }}>\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 <Select onChange={onS1Change} value={s1} sx={{ width: \"100%\" }}>\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 <Select onChange={onS2Change} value={s2} sx={{ width: \"100%\" }}>\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\";\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(player);\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 React from \"react\";\n\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\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 {FactionNames.Bladeburners}-specific ones and NeuroFlux Governor, are not\n 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 {FactionNames.TheCovenant}. It is a persistent stat,\n meaning it 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 colSpan={3}>\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 base_increase =\n calculateHashGainRate(node.level + multiplier, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult) -\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.hacknet_node_level_cost_mult);\n upgradeLevelButton = (\n <Tooltip\n title={\n <Typography>\n +<HashRate hashes={modded_increase} /> (effective increase, taking current RAM usage into account)\n <br />\n <span style={{ opacity: 0.5 }}>\n +<HashRate hashes={base_increase} />\n </span>{\" \"}\n (base increase, attained when no script is running)\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 base_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 ) - calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\n\n const modded_increase =\n calculateHashGainRate(\n node.level,\n node.ramUsed,\n node.maxRam * Math.pow(2, multiplier),\n node.cores,\n props.player.hacknet_node_money_mult,\n ) -\n calculateHashGainRate(node.level, node.ramUsed, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\n\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.hacknet_node_ram_cost_mult);\n upgradeRamButton = (\n <Tooltip\n title={\n <Typography>\n +<HashRate hashes={modded_increase} /> (effective increase, taking current RAM usage into account)\n <br />\n <span style={{ opacity: 0.5 }}>\n +<HashRate hashes={base_increase} />\n </span>{\" \"}\n (base increase, attained when no script is running)\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 base_increase =\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores + multiplier, props.player.hacknet_node_money_mult) -\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.hacknet_node_core_cost_mult);\n upgradeCoresButton = (\n <Tooltip\n title={\n <Typography>\n +<HashRate hashes={modded_increase} /> (effective increase, taking current RAM usage into account)\n <br />\n <span style={{ opacity: 0.5 }}>\n +<HashRate hashes={base_increase} />\n </span>{\" \"}\n (base increase, attained when no script is running)\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 <Tooltip\n title={\n <Typography>\n <Hashes hashes={node.totalHashesGenerated} /> hashes produced by this server since last augment\n installation.\n <br />\n <HashRate hashes={node.hashRate} /> current production rate.\n <br />\n <span style={{ opacity: 0.5 }}>\n <HashRate hashes={(node.hashRate * node.maxRam) / (node.maxRam - node.ramUsed)} />\n </span>{\" \"}\n max production rate. (achieved when 100% RAM is allocated to it)\n <br />\n {numeralWrapper.formatRAM(node.ramUsed)} / {numeralWrapper.formatRAM(node.maxRam)} (\n {Math.round((100 * node.ramUsed) / node.maxRam)}%) RAM allocated to script.\n <br />\n {numeralWrapper.formatRAM(node.maxRam - node.ramUsed)} / {numeralWrapper.formatRAM(node.maxRam)} (\n {Math.round((100 * (node.maxRam - node.ramUsed)) / node.maxRam)}%) RAM allocated to hash production.\n </Typography>\n }\n >\n <Typography>\n <Hashes hashes={node.totalHashesGenerated} /> (<HashRate hashes={node.hashRate} />)\n </Typography>\n </Tooltip>\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\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\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] : FactionNames.ECorp.toLowerCase(),\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>\n <CorruptableText content={loc.name} />\n </span>\n </Tooltip>\n ) : (\n loc.name\n )}\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 {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","// 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 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\";\nimport { ClassType } from \"../../utils/WorkType\";\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: ClassType): 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(ClassType.GymStrength);\n }\n\n function trainDefense(): void {\n train(ClassType.GymDefense);\n }\n\n function trainDexterity(): void {\n train(ClassType.GymDexterity);\n }\n\n function trainAgility(): void {\n train(ClassType.GymAgility);\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/modals/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, ToastVariant } 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\";\nimport { ArcadeRoot } from \"../../Arcade/ui/ArcadeRoot\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\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 if (p.strength >= 100 && p.defense >= 100 && p.dexterity >= 100 && p.agility >= 100) {\n // Apply for Bladeburner division\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 * Click handler for Resleeving button at New Tokyo VitaLife\n */\n function handleGrafting(): void {\n router.toGrafting();\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 (\n <>\n <br />\n <Button onClick={handleBladeburner}>{text}</Button>\n </>\n );\n }\n\n function renderNoodleBar(): React.ReactElement {\n function EatNoodles(): void {\n SnackbarEvents.emit(\"You ate some delicious noodles and feel refreshed\", ToastVariant.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 renderGrafting(): React.ReactElement {\n if (!player.canAccessGrafting()) {\n return <></>;\n }\n return (\n <Button onClick={handleGrafting} sx={{ my: 5 }}>\n Enter the secret lab\n </Button>\n );\n }\n\n function handleCotMG(): void {\n const faction = Factions[FactionNames.ChurchOfTheMachineGod];\n if (!player.factions.includes(FactionNames.ChurchOfTheMachineGod)) {\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.toStaneksGift();\n }\n\n function renderCotMG(): React.ReactElement {\n const toStanek = <Button onClick={() => router.toStaneksGift()}>Open Stanek's Gift</Button>;\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 <br />\n {toStanek}\n <br />\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 <br />\n {toStanek}\n <br />\n {symbol}\n </>\n );\n }\n if (player.factions.includes(FactionNames.ChurchOfTheMachineGod)) {\n return (\n <>\n <Typography>\n <i>Allison \"Mother\" Stanek: Welcome back my child!</i>\n </Typography>\n <br />\n {toStanek}\n <br />\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 renderGrafting();\n }\n case LocationName.Sector12CityHall: {\n return (BitNodeMultipliers.CorporationSoftcap < 0.15 && <></>) || <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 case LocationName.NewTokyoArcade: {\n return <ArcadeRoot />;\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.{\" \"}\n {player.bitNodeN === 3 &&\n `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","import React, { useState } from \"react\";\nimport { BBCabinetRoot } from \"./BBCabinet\";\n\nimport Button from \"@mui/material/Button\";\nimport { use } from \"../../ui/Context\";\nimport { AlertEvents } from \"../../ui/React/AlertManager\";\n\nenum Page {\n None,\n Megabyteburner2000,\n}\n\nexport function ArcadeRoot(): React.ReactElement {\n const player = use.Player();\n const [page, setPage] = useState(Page.None);\n\n function mbBurner2000(): void {\n if (player.sourceFileLvl(1) === 0) {\n AlertEvents.emit(\"This machine is broken.\");\n } else {\n setPage(Page.Megabyteburner2000);\n }\n }\n\n if (page === Page.None) {\n return (\n <>\n <Button onClick={mbBurner2000}>Megabyte burner 2000</Button>\n </>\n );\n }\n let currentGame = <></>;\n switch (page) {\n case Page.Megabyteburner2000:\n currentGame = <BBCabinetRoot />;\n }\n return (\n <>\n <Button onClick={() => setPage(Page.None)}>Back</Button>\n {currentGame}\n </>\n );\n}\n","import React, { useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { use } from \"../../ui/Context\";\nimport { Exploit } from \"../../Exploits/Exploit\";\n\nconst metaBB = \"https://bitburner-official.github.io/bitburner-legacy/\";\n\nconst style = {\n width: \"1060px\",\n height: \"800px\",\n border: \"0px\",\n} as any;\n\nexport function BBCabinetRoot(): React.ReactElement {\n const player = use.Player();\n useEffect(() => {\n window.addEventListener(\"message\", function (this: Window, ev: MessageEvent<boolean>) {\n if (ev.isTrusted && ev.origin == \"https://bitburner-official.github.io\" && ev.data) {\n player.giveExploit(Exploit.TrueRecursion);\n }\n });\n });\n // prettier-ignore\n const joystick =\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'}}> | | .-. '-' .-. </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 return (\n <>\n <div\n style={{\n width: \"1060px\",\n height: \"800px\",\n padding: \"0\",\n overflow: \"hidden\",\n borderColor: \"white\",\n borderStyle: \"solid\",\n borderWidth: \"5px\",\n }}\n >\n <iframe src={metaBB} style={style} />\n </div>\n <div\n style={{\n width: \"1060px\",\n borderColor: \"white\",\n borderStyle: \"solid\",\n borderWidth: \"5px\",\n }}\n >\n {joystick}\n </div>\n </>\n );\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\" }}>{purchaseServerButtons}</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\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\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 const bnMult = BitNodeMultipliers.HomeComputerRamCost === 1 ? \"\" : `\\\\cdot ${BitNodeMultipliers.HomeComputerRamCost}`;\n\n return (\n <Tooltip\n title={\n <MathJaxWrapper>{`\\\\(\\\\large{cost = ram \\\\cdot 3.2 \\\\cdot 10^4 \\\\cdot 1.58^{log_2{(ram)}}} ${bnMult}\\\\)`}</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 { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { CONSTANTS } from \"../Constants\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { GetServer } from \"../Server/AllServers\";\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 = GetServer(SpecialServers.DarkWeb);\n if (!darkweb) {\n throw new Error(\"Dark web is not a server.\");\n }\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 title={<MathJaxWrapper>{`\\\\(\\\\large{cost = 10^9 \\\\cdot 7.5 ^{\\\\text{cores}}}\\\\)`}</MathJaxWrapper>}>\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\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\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.key === KEY.ENTER) 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\nimport { ClassType } from \"../../utils/WorkType\";\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: ClassType): 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(ClassType.StudyComputerScience);\n }\n\n function dataStructures(): void {\n take(ClassType.DataStructures);\n }\n\n function networks(): void {\n take(ClassType.Networks);\n }\n\n function algorithms(): void {\n take(ClassType.Algorithms);\n }\n\n function management(): void {\n take(ClassType.Management);\n }\n\n function leadership(): void {\n take(ClassType.Leadership);\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 while (playerWin) {\n n = Math.floor(rng.random() * 37);\n playerWin = strategy.match(n);\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\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 let i = 0;\n for (const line of lines) {\n elems.push(\n <Typography key={i} sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>\n {lineElems(line)}\n </Typography>,\n );\n i++;\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\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport SaveIcon from \"@mui/icons-material/Save\";\n\nimport { ThemeEditorModal } from \"./ThemeEditorModal\";\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 const [themeEditorOpen, setThemeEditorOpen] = useState(false);\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 <ThemeEditorModal open={themeEditorOpen} onClose={() => setThemeEditorOpen(false)} />\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 <MenuItem value=\"customTheme\">Custom theme</MenuItem>\n </Select>\n <Button onClick={() => setThemeEditorOpen(true)} sx={{ mx: 1 }} startIcon={<EditIcon />}>\n Edit custom theme\n </Button>\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} startIcon={<SaveIcon />}>\n Save\n </Button>\n </Modal>\n );\n}\n","import { History, Reply, Save } from \"@mui/icons-material\";\nimport { Box, Button, Paper, TextField, Tooltip, Typography } from \"@mui/material\";\nimport IconButton from \"@mui/material/IconButton\";\nimport _ from \"lodash\";\nimport { Color, ColorPicker } from \"material-ui-color\";\nimport React, { useState } from \"react\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { defaultMonacoTheme, IScriptEditorTheme } from \"./themes\";\n\ninterface IProps {\n onClose: () => void;\n open: boolean;\n}\n\ninterface IColorEditorProps {\n label: string;\n themePath: string;\n color: string | undefined;\n onColorChange: (name: string, value: string) => void;\n defaultColor: string;\n}\n\n// Slightly tweaked version of the same function found in game options\nfunction ColorEditor({ label, themePath, onColorChange, color, defaultColor }: IColorEditorProps): React.ReactElement {\n if (color === undefined) {\n console.error(`color ${themePath} was undefined, reverting to default`);\n color = defaultColor;\n }\n\n return (\n <>\n <Tooltip title={label}>\n <span>\n <TextField\n label={themePath}\n value={\"#\" + color}\n sx={{ display: \"block\", my: 1 }}\n InputProps={{\n startAdornment: (\n <>\n <ColorPicker\n hideTextfield\n deferred\n value={\"#\" + color}\n onChange={(newColor: Color) => onColorChange(themePath, newColor.hex)}\n disableAlpha\n />\n </>\n ),\n endAdornment: (\n <>\n <IconButton onClick={() => onColorChange(themePath, defaultColor)}>\n <Reply color=\"primary\" />\n </IconButton>\n </>\n ),\n }}\n />\n </span>\n </Tooltip>\n </>\n );\n}\n\nexport function ThemeEditorModal(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n\n // Need to deep copy the object since it has nested attributes\n const [themeCopy, setThemeCopy] = useState<IScriptEditorTheme>(JSON.parse(JSON.stringify(Settings.EditorTheme)));\n\n function onColorChange(name: string, value: string): void {\n setThemeCopy(_.set(themeCopy, name, value));\n rerender();\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 setThemeCopy(importedTheme);\n } catch (err) {\n // ignore\n }\n }\n\n return (\n <Modal\n open={props.open}\n onClose={() => {\n setThemeCopy(Settings.EditorTheme);\n props.onClose();\n }}\n >\n <Typography variant=\"h4\">Customize Editor theme</Typography>\n <Typography>Hover over input boxes for more information</Typography>\n <Paper sx={{ p: 1, my: 1 }}>\n <OptionSwitch\n checked={themeCopy.base === \"vs\"}\n onChange={(val) => {\n setThemeCopy(_.set(themeCopy, \"base\", val ? \"vs\" : \"vs-dark\"));\n rerender();\n }}\n text=\"Use light theme as base\"\n tooltip={\n <>\n If enabled, the <code>vs</code> light theme will be used as the theme base, otherwise,{\" \"}\n <code>vs-dark</code> will be used.\n </>\n }\n />\n <Box display=\"grid\" sx={{ gridTemplateColumns: \"1fr 1fr\", width: \"fit-content\", gap: 1 }}>\n <Box>\n <Typography variant=\"h6\">UI</Typography>\n <ColorEditor\n label=\"Background color\"\n themePath=\"common.bg\"\n onColorChange={onColorChange}\n color={themeCopy.common.bg}\n defaultColor={defaultMonacoTheme.common.bg}\n />\n <ColorEditor\n label=\"Current line and minimap background color\"\n themePath=\"ui.line\"\n onColorChange={onColorChange}\n color={themeCopy.ui.line}\n defaultColor={defaultMonacoTheme.ui.line}\n />\n <ColorEditor\n label=\"Base text color\"\n themePath=\"common.fg\"\n onColorChange={onColorChange}\n color={themeCopy.common.fg}\n defaultColor={defaultMonacoTheme.common.fg}\n />\n <ColorEditor\n label=\"Popup background color\"\n themePath=\"ui.panel.bg\"\n onColorChange={onColorChange}\n color={themeCopy.ui.panel.bg}\n defaultColor={defaultMonacoTheme.ui.panel.bg}\n />\n <ColorEditor\n label=\"Background color for selected item in popup\"\n themePath=\"ui.panel.selected\"\n onColorChange={onColorChange}\n color={themeCopy.ui.panel.selected}\n defaultColor={defaultMonacoTheme.ui.panel.selected}\n />\n <ColorEditor\n label=\"Popup border color\"\n themePath=\"ui.panel.border\"\n onColorChange={onColorChange}\n color={themeCopy.ui.panel.border}\n defaultColor={defaultMonacoTheme.ui.panel.border}\n />\n <ColorEditor\n label=\"Background color of highlighted text\"\n themePath=\"ui.selection.bg\"\n onColorChange={onColorChange}\n color={themeCopy.ui.selection.bg}\n defaultColor={defaultMonacoTheme.ui.selection.bg}\n />\n </Box>\n <Box>\n <Typography variant=\"h6\">Syntax</Typography>\n <ColorEditor\n label=\"Numbers, function names, and other key vars\"\n themePath=\"common.accent\"\n onColorChange={onColorChange}\n color={themeCopy.common.accent}\n defaultColor={defaultMonacoTheme.common.accent}\n />\n <ColorEditor\n label=\"Keywords\"\n themePath=\"syntax.keyword\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.keyword}\n defaultColor={defaultMonacoTheme.syntax.keyword}\n />\n <ColorEditor\n label=\"Strings\"\n themePath=\"syntax.string\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.string}\n defaultColor={defaultMonacoTheme.syntax.string}\n />\n <ColorEditor\n label=\"Regexp literals as well as escapes within strings\"\n themePath=\"syntax.regexp\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.regexp}\n defaultColor={defaultMonacoTheme.syntax.regexp}\n />\n <ColorEditor\n label=\"Constants\"\n themePath=\"syntax.constant\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.constant}\n defaultColor={defaultMonacoTheme.syntax.constant}\n />\n <ColorEditor\n label=\"Entities\"\n themePath=\"syntax.entity\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.entity}\n defaultColor={defaultMonacoTheme.syntax.entity}\n />\n <ColorEditor\n label=\"'this', 'ns', types, and tags\"\n themePath=\"syntax.tag\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.tag}\n defaultColor={defaultMonacoTheme.syntax.tag}\n />\n <ColorEditor\n label=\"Netscript functions and constructors\"\n themePath=\"syntax.markup\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.markup}\n defaultColor={defaultMonacoTheme.syntax.markup}\n />\n <ColorEditor\n label=\"Errors\"\n themePath=\"syntax.error\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.error}\n defaultColor={defaultMonacoTheme.syntax.error}\n />\n <ColorEditor\n label=\"Comments\"\n themePath=\"syntax.comment\"\n onColorChange={onColorChange}\n color={themeCopy.syntax.comment}\n defaultColor={defaultMonacoTheme.syntax.comment}\n />\n </Box>\n </Box>\n </Paper>\n <Paper sx={{ p: 1 }}>\n <TextField\n multiline\n fullWidth\n maxRows={10}\n label={\"import / export theme\"}\n value={JSON.stringify(themeCopy, undefined, 2)}\n onChange={onThemeChange}\n />\n <Box sx={{ mt: 1 }}>\n <Button\n onClick={() => {\n Settings.EditorTheme = { ...themeCopy };\n props.onClose();\n }}\n startIcon={<Save />}\n >\n Save\n </Button>\n <Button\n onClick={() => {\n setThemeCopy(defaultMonacoTheme);\n rerender();\n }}\n startIcon={<History />}\n >\n Reset to default\n </Button>\n </Box>\n </Paper>\n </Modal>\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 inBladeburner: boolean;\\n entropy: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface RunningScript {\\n /** Arguments the script was called with */\\n args: string[];\\n /** Filename of the script */\\n filename: string;\\n /**\\n * Script logs as an array. The newest log entries are at the bottom.\\n * Timestamps, if enabled, are placed inside `[brackets]` at the start of each line.\\n **/\\n logs: string[];\\n /** Total amount of hacking experience earned from this script when offline */\\n offlineExpGained: number;\\n /** Total amount of money made by this script when offline */\\n offlineMoneyMade: number;\\n /** Number of seconds that the script has been running offline */\\n offlineRunningTime: number;\\n /** Total amount of hacking experience earned from this script when online */\\n onlineExpGained: number;\\n /** Total amount of money made by this script when online */\\n onlineMoneyMade: number;\\n /** Number of seconds that this script has been running online */\\n onlineRunningTime: number;\\n /** Process ID. Must be an integer */\\n pid: number;\\n /** How much RAM this script uses for ONE thread */\\n ramUsage: number;\\n /** Hostname of the server on which this script runs */\\n server: string;\\n /** Number of threads that this script runs with */\\n threads: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface RecentScript extends RunningScript {\\n /** Timestamp of when the script was killed */\\n timeOfDeath: Date;\\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 /** Multiplier to hacking skill */\\n hacking_mult?: number;\\n /** Multiplier to strength skill */\\n strength_mult?: number;\\n /** Multiplier to defense skill */\\n defense_mult?: number;\\n /** Multiplier to dexterity skill */\\n dexterity_mult?: number;\\n /** Multiplier to agility skill */\\n agility_mult?: number;\\n /** Multiplier to charisma skill */\\n charisma_mult?: number;\\n /** Multiplier to hacking experience gain rate */\\n hacking_exp_mult?: number;\\n /** Multiplier to strength experience gain rate */\\n strength_exp_mult?: number;\\n /** Multiplier to defense experience gain rate */\\n defense_exp_mult?: number;\\n /** Multiplier to dexterity experience gain rate */\\n dexterity_exp_mult?: number;\\n /** Multiplier to agility experience gain rate */\\n agility_exp_mult?: number;\\n /** Multiplier to charisma experience gain rate */\\n charisma_exp_mult?: number;\\n /** Multiplier to chance of successfully performing a hack */\\n hacking_chance_mult?: number;\\n /** Multiplier to hacking speed */\\n hacking_speed_mult?: number;\\n /** Multiplier to amount of money the player gains from hacking */\\n hacking_money_mult?: number;\\n /** Multiplier to amount of money injected into servers using grow */\\n hacking_grow_mult?: number;\\n /** Multiplier to amount of reputation gained when working */\\n company_rep_mult?: number;\\n /** Multiplier to amount of reputation gained when working */\\n faction_rep_mult?: number;\\n /** Multiplier to amount of money gained from crimes */\\n crime_money_mult?: number;\\n /** Multiplier to crime success rate */\\n crime_success_mult?: number;\\n /** Multiplier to amount of money gained from working */\\n work_money_mult?: number;\\n /** Multiplier to amount of money produced by Hacknet Nodes */\\n hacknet_node_money_mult?: number;\\n /** Multiplier to cost of purchasing a Hacknet Node */\\n hacknet_node_purchase_cost_mult?: number;\\n /** Multiplier to cost of ram for a Hacknet Node */\\n hacknet_node_ram_cost_mult?: number;\\n /** Multiplier to cost of core for a Hacknet Node */\\n hacknet_node_core_cost_mult?: number;\\n /** Multiplier to cost of leveling up a Hacknet Node */\\n hacknet_node_level_cost_mult?: number;\\n /** Multiplier to Bladeburner max stamina */\\n bladeburner_max_stamina_mult?: number;\\n /** Multiplier to Bladeburner stamina gain rate */\\n bladeburner_stamina_gain_mult?: number;\\n /** Multiplier to effectiveness in Bladeburner Field Analysis */\\n bladeburner_analysis_mult?: number;\\n /** Multiplier 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 currently 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 money gain from dividends of corporations created by the player. */\\n CorporationSoftcap: 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 maximum 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 /** Charisma 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 /** Charisma stat */\\n charisma: number;\\n /** Charisma exp */\\n charismaExp: 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 jobs */\\n jobs: string[];\\n /** Array of job positions for all companies you are employed at. Same order as 'jobs' */\\n jobTitles: 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 /** total hacking exp */\\n hackingExp: number;\\n /** total strength exp */\\n strengthExp: number;\\n /** total defense exp */\\n defenseExp: number;\\n /** total dexterity exp */\\n dexterityExp: number;\\n /** total agility exp */\\n agilityExp: number;\\n /** total charisma exp */\\n charismaExp: 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 /** Strength 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 of the gang member */\\n name: string;\\n /** Currently assigned task */\\n task: string;\\n earnedRespect: number;\\n\\n /** Hack skill level */\\n hack: number;\\n /** Strength skill level */\\n str: number;\\n /** Defense skill level */\\n def: number;\\n /** Dexterity skill level */\\n dex: number;\\n /** Agility skill level */\\n agi: number;\\n /** Charisma skill level */\\n cha: number;\\n\\n /** Current hack experience */\\n hack_exp: number;\\n /** Current strength experience */\\n str_exp: number;\\n /** Current defense experience */\\n def_exp: number;\\n /** Current dexterity experience */\\n dex_exp: number;\\n /** Current agility experience */\\n agi_exp: number;\\n /** Current charisma experience */\\n cha_exp: number;\\n\\n /** Hack multiplier from equipment */\\n hack_mult: number;\\n /** Strength multiplier from equipment */\\n str_mult: number;\\n /** Defense multiplier from equipment */\\n def_mult: number;\\n /** Dexterity multiplier from equipment */\\n dex_mult: number;\\n /** Agility multiplier from equipment */\\n agi_mult: number;\\n /** Charisma multiplier from equipment */\\n cha_mult: number;\\n\\n /** Hack multiplier from ascensions */\\n hack_asc_mult: number;\\n /** Strength multiplier from ascensions */\\n str_asc_mult: number;\\n /** Defense multiplier from ascensions */\\n def_asc_mult: number;\\n /** Dexterity multiplier from ascensions */\\n dex_asc_mult: number;\\n /** Agility multiplier from ascensions */\\n agi_asc_mult: number;\\n /** Charisma multiplier from ascensions */\\n cha_asc_mult: number;\\n\\n /** Total earned hack experience */\\n hack_asc_points: number;\\n /** Total earned strength experience */\\n str_asc_points: number;\\n /** Total earned defense experience */\\n def_asc_points: number;\\n /** Total earned dexterity experience */\\n dex_asc_points: number;\\n /** Total earned agility experience */\\n agi_asc_points: number;\\n /** Total earned charisma experience */\\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 * Purchase WSE Account.\\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 purchaseWseAccount(): boolean;\\n\\n /**\\n * Purchase 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 purchaseTixApi(): 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 or you already own TOR router, 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 university,\\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 out at a gym\\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 * Quit jobs by company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will finish work with the company provided and quit any jobs.\\n *\\n * @param companyName - Name of the company.\\n */\\n quitJob(companyName?: string): void;\\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. If you do not own uninstalled Augmentations then the game will not reset.\\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 hospitalize(): void;\\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 * Get a list of programs offered on the dark web.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function allows the player to get a list of programs available for purchase\\n * on the dark web. Players MUST have purchased Tor to get the list of programs\\n * available. If Tor has not been purchased yet, this function will return an\\n * empty list.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * getDarkwebPrograms();\\n * // returns ['BruteSSH.exe', 'FTPCrack.exe'...etc]\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.getDarkwebPrograms();\\n * // returns ['BruteSSH.exe', 'FTPCrack.exe'...etc]\\n * ```\\n * @returns - a list of programs available for purchase on the dark web, or [] if Tor has not\\n * been purchased\\n */\\n getDarkwebPrograms(): string[];\\n\\n /**\\n * Check the price of an exploit on the dark web\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * This function allows you to check the price of a darkweb exploit/program.\\n * You MUST have a TOR router in order to use this function. The price returned\\n * by this function is the same price you would see with buy -l from the terminal.\\n * Returns the cost of the program if it has not been purchased yet, 0 if it\\n * has already been purchased, or -1 if Tor has not been purchased (and thus\\n * the program/exploit is not available for purchase).\\n *\\n * If the program does not exist, an error is thrown.\\n *\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * getDarkwebProgramCost(\\\"brutessh.exe\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.getDarkwebProgramCost(\\\"brutessh.exe\\\");\\n * ```\\n * @param programName - Name of program to check the price of\\n * @returns Price of the specified darkweb program\\n * (if not yet purchased), 0 if it has already been purchased, or -1 if Tor has not been\\n * purchased. Throws an error if the specified program/exploit does not exist\\n */\\n getDarkwebProgramCost(programName: string): number;\\n\\n /**\\n * b1t_flum3 into a different BN.\\n * @remarks\\n * RAM cost: 16 GB * 16/4/1\\n *\\n * @param nextBN - BN number to jump to\\n * @param callbackScript - Name of the script to launch in the next BN.\\n */\\n b1tflum3(nextBN: number, callbackScript?: string): void;\\n\\n /**\\n * Destroy the w0r1d_d43m0n and move on to the next BN.\\n * @remarks\\n * RAM cost: 32 GB * 16/4/1\\n *\\n * You must have the special augment installed and the required hacking level\\n * OR\\n * Completed the final black op.\\n *\\n * @param nextBN - BN number to jump to\\n * @param callbackScript - Name of the script to launch in the next BN.\\n */\\n destroyW0r1dD43m0n(nextBN: number, callbackScript?: string): void;\\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(upgradeName);\\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(upgradeName);\\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 multiplier 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 multiplier 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 whether\\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 whether 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 * Attempts 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 filename - 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 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 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 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 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 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 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, can also throw on errors\\n */\\n setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean | undefined;\\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 * Set a sleeve to perform bladeburner actions.\\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 action - Name of the action to be performed.\\n * @param contract - Name of the contract if applicable.\\n * @returns True if the sleeve started working out, false otherwise.\\n */\\n setToBladeburnerAction(sleeveNumber: number, action: string, contract?: string): boolean;\\n}\\n\\n/**\\n * Grafting API\\n * @remarks\\n * This API requires Source-File 10 to use.\\n * @public\\n */\\nexport interface Grafting {\\n /**\\n * Retrieve the grafting cost of an aug.\\n * @remarks\\n * RAM cost: 3.75 GB\\n *\\n * @param augName - Name of the aug to check the price of. Must be an exact match.\\n * @returns The cost required to graft the named augmentation.\\n * @throws Will error if an invalid Augmentation name is provided.\\n */\\n getAugmentationGraftPrice(augName: string): number;\\n\\n /**\\n * Retrieves the time required to graft an aug.\\n * @remarks\\n * RAM cost: 3.75 GB\\n *\\n * @param augName - Name of the aug to check the grafting time of. Must be an exact match.\\n * @returns The time required, in millis, to graft the named augmentation.\\n * @throws Will error if an invalid Augmentation name is provided.\\n */\\n getAugmentationGraftTime(augName: string): number;\\n\\n /**\\n * Retrieves a list of Augmentations that can be grafted.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Note that this function returns a list of currently graftable Augmentations,\\n * based off of the Augmentations that you already own.\\n *\\n * @returns An array of graftable Augmentations.\\n */\\n getGraftableAugmentations(): string[];\\n\\n /**\\n * Begins grafting the named aug. You must be in New Tokyo to use this.\\n * @remarks\\n * RAM cost: 7.5 GB\\n *\\n * @param augName - The name of the aug to begin grafting. Must be an exact match.\\n * @param focus - Acquire player focus on this Augmentation grafting. Optional. Defaults to true.\\n * @returns True if the aug successfully began grafting, false otherwise (e.g. not enough money, or\\n * invalid Augmentation name provided).\\n * @throws Will error if called while you are not in New Tokyo.\\n */\\n graftAugmentation(augName: string, focus?: boolean): 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 * Reputation formulas\\n * @public\\n */\\ninterface ReputationFormulas {\\n /**\\n * Calculate the total required amount of faction reputation to reach a target favor.\\n * @param favor - target faction favor.\\n * @returns The calculated faction reputation required.\\n */\\n calculateFavorToRep(favor: number): number;\\n /**\\n * Calculate the resulting faction favor of a total amount of reputation.\\n * (Faction favor is gained whenever you install an Augmentation.)\\n * @param rep - amount of reputation.\\n * @returns The calculated faction favor.\\n */\\n calculateRepToFavor(rep: number): number;\\n\\n /**\\n * Calculate how much rep would be gained.\\n * @param amount - Amount of money donated\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n */\\n repFromDonation(amount: number, player: Player): 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 /** Reputation formulas */\\n reputation: ReputationFormulas;\\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 highestCharge: 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 giftWidth(): number;\\n /**\\n * Stanek's Gift height.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @returns The height of the gift.\\n */\\n giftHeight(): 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 chargeFragment(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 clearGift(): 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 canPlaceFragment(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 placeFragment(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 getFragment(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 removeFragment(rootX: number, rootY: number): boolean;\\n\\n /**\\n * Accept Stanek's Gift by joining the Church of the Machine God\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * @returns true if the player is a member of the church and has the gift installed,\\n * false otherwise.\\n */\\n acceptGift(): boolean;\\n}\\n\\nexport interface InfiltrationReward {\\n tradeRep: number;\\n sellCash: number;\\n SoARep: number;\\n}\\n\\nexport interface InfiltrationLocation {\\n location: any;\\n reward: InfiltrationReward;\\n difficulty: number;\\n}\\n\\n/**\\n * Infiltration API.\\n * @public\\n */\\ninterface Infiltration {\\n /**\\n * Get all locations that can be infiltrated.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @returns all locations that can be infiltrated.\\n */\\n getPossibleLocations(): string[];\\n /**\\n * Get all infiltrations with difficulty, location and rewards.\\n * @remarks\\n * RAM cost: 15 GB\\n *\\n * @returns Infiltration data for given location.\\n */\\n getInfiltration(location: string): InfiltrationLocation;\\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 * Clear the Terminal window, as if the player ran `clear` in the terminal\\n * @remarks\\n * RAM cost: 0.2 GB\\n */\\n clearTerminal(): void;\\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 awaited\\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 {\\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 infiltration functions.\\n * RAM cost: 0 GB\\n */\\n readonly infiltration: Infiltration;\\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 * Namespace for singularity functions.\\n * RAM cost: 0 GB\\n */\\n readonly singularity: Singularity;\\n\\n /**\\n * Namespace for grafting functions.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n readonly grafting: Grafting;\\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 * @param hostname - Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money.\\n * @returns The security increase.\\n */\\n hackAnalyzeSecurity(threads: number, hostname?: string): 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 * @param hostname - Optional. Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money.\\n * @param cores - Optional. The number of cores of the server that would run grow.\\n * @returns The security increase.\\n */\\n growthAnalyzeSecurity(threads: number, hostname?: string, cores?: 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<true>;\\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<true>;\\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 * Get an array of recently killed scripts across all servers.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * The most recently killed script is the first element in the array.\\n * Note that there is a maximum number of recently killed scripts which are tracked.\\n * This is configurable in the game's options as `Recently killed scripts size`.\\n *\\n * @example\\n * ```ts\\n * let recentScripts = ns.getRecentScripts();\\n * let mostRecent = recentScripts.shift()\\n * if (mostRecent)\\n * ns.tprint(mostRecent.logs.join('\\\\n'))\\n * ```\\n *\\n * @returns Array with information about previously killed scripts.\\n */\\n getRecentScripts(): RecentScript[];\\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 * Close the tail window of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Closes a script’s logs. This is functionally the same pressing the \\\"Close\\\" button on the tail window.\\n *\\n * If the function is called with no arguments, it will close the current script’s logs.\\n *\\n * Otherwise, the pid argument can be used to close the logs from another script.\\n *\\n * @param pid - Optional. PID of the script having its tail closed. If omitted, the current script is used.\\n */\\n closeTail(pid?: number): 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 0 or 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\\n /**\\n * {@inheritDoc NS.(kill:1)}\\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 */\\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 * @param safetyguard - Skips the script that calls this function\\n * @returns True if any scripts were killed, and false otherwise.\\n */\\n killall(host?: string, safetyguard?: boolean): 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\\n /**\\n * {@inheritDoc NS.(scp:1)}\\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 */\\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 * var scripts = ps(\\\"home\\\");\\n * for (var 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 (let script of ps) {\\n * ns.tprint(`${script.filename} ${script.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 current 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 | null;\\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 use 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\\n /**\\n * {@inheritDoc NS.(getScriptIncome:1)}\\n */\\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\\n /**\\n * {@inheritDoc NS.(getScriptExpGain:1)}\\n */\\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 an input modal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Prompts the player with a dialog box. If `options.type` is undefined or \\\"boolean\\\",\\n * the player is shown \\\"Yes\\\" and \\\"No\\\" prompts, which return true and false respectively.\\n * Passing a type of \\\"text\\\" will give the player a text field and a value of \\\"select\\\"\\n * will show a drop-down field. Choosing type \\\"select\\\" will require an array or object\\n * to be passed via the `options.choices` property.\\n * The script’s execution is halted until the player selects one of the options.\\n *\\n * @param txt - Text to appear in the prompt dialog box.\\n * @param options - Options to modify the prompt the player is shown.\\n * @returns True if the player click “Yes”; false if the player clicks “No”; or the value entered by the player.\\n */\\n prompt(\\n txt: string,\\n options?: { type?: \\\"boolean\\\" | \\\"text\\\" | \\\"select\\\" | undefined; choices?: string[] },\\n ): Promise<boolean | string>;\\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?: ToastVariantValues, 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 enums: NSEnums;\\n}\\n\\n/** @public */\\nexport enum ToastVariant {\\n SUCCESS = \\\"success\\\",\\n WARNING = \\\"warning\\\",\\n ERROR = \\\"error\\\",\\n INFO = \\\"info\\\",\\n}\\n\\n/** @public */\\nexport type ToastVariantValues = `${ToastVariant}`;\\n\\n/** @public */\\nexport interface NSEnums {\\n toast: typeof ToastVariant;\\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 * Set material to bulk buy\\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 bulkPurchase(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 * @param amt - amount of upgrades defaults to 1\\n */\\n upgradeWarehouse(divisionName: string, cityName: string, amt?: number): 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 * Limit Material Production.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param qty - Amount to limit to\\n */\\n limitMaterialProduction(divisionName: string, cityName: string, materialName: string, qty: number): void;\\n /**\\n * Limit Product Production.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param qty - Amount to limit to\\n */\\n limitProductProduction(divisionName: string, cityName: string, productName: string, qty: number): 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 * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param amt - amount of upgrades defaults to 1\\n * @returns cost to upgrade\\n */\\n getUpgradeWarehouseCost(adivisionName: any, acityName: any, amt?: number): 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 * Buyback Shares\\n * @param amount - Amount of shares to buy back.\\n *\\n */\\n buyBackShares(amount: number): void;\\n /**\\n * Sell Shares\\n * @param amount - Amount of shares to sell.\\n *\\n */\\n sellShares(amount: number): void;\\n /**\\n * Get bonus time.\\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.\\n *\\n * @returns Bonus time for the Corporation mechanic in milliseconds.\\n */\\n getBonusTime(): number;\\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 of the employee */\\n mor: number;\\n /** Happiness of the employee */\\n hap: number;\\n /** Energy of the employee */\\n ene: number;\\n /** Intelligence of the employee */\\n int: number;\\n /** Charisma of the employee */\\n cha: number;\\n /** Experience of the employee */\\n exp: number;\\n /** Creativity of the employee */\\n cre: number;\\n /** Efficiency of the employee */\\n eff: number;\\n /** Salary of the employee */\\n sal: number;\\n /** Current Location (city) */\\n loc: string;\\n /** Current job position */\\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, only present if \\\"Market Research - Demand\\\" unlocked */\\n dmd: number | undefined;\\n /** Competition for the product, only present if \\\"Market Research - Competition\\\" unlocked */\\n cmp: number | undefined;\\n /** Product Rating */\\n rat: number;\\n /** Product Properties. The data is \\\\{qlt, per, dur, rel, aes, fea\\\\} */\\n properties: { [key: string]: 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 /** Demand for the material, only present if \\\"Market Research - Demand\\\" unlocked */\\n dmd: number | undefined;\\n /** Competition for the material, only present if \\\"Market Research - Competition\\\" unlocked */\\n cmp: number | undefined;\\n /** Amount of material produced */\\n prod: number;\\n /** Amount of material sold */\\n sell: number;\\n /** cost to buy material */\\n cost: number;\\n /** Sell cost, can be \\\"MP+5\\\" */\\n sCost: string | 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 /** Production of the employees */\\n employeeProd: EmployeeJobs;\\n /** Positions of the employees */\\n employeeJobs: 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 Agriculture */\\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 /** Whether the industry this division is in is capable of making products */\\n makesProducts: boolean;\\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\\n/**\\n * Used for autocompletion\\n * @public\\n */\\ninterface AutocompleteData {\\n servers: string[];\\n scripts: string[];\\n txts: string[];\\n flags(schema: [string, string | number | boolean | string[]][]): any;\\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 const lineClassMap: Record<string, string> = {\n error: classes.error,\n success: classes.success,\n info: classes.info,\n warn: classes.warning,\n };\n return lineClassMap[s] || classes.primary;\n }\n\n function ansiCodeStyle(code: string | null): Record<string, any> {\n // The ANSI colors actually have the dark color set as default and require extra work to get\n // bright colors. But these are rarely used or, if they are, are often re-mapped by the\n // terminal emulator to brighter colors. So for foreground colors we use the bright color set\n // and for background colors we use the dark color set. Of course, all colors are available\n // via the longer ESC[n8;5;c] sequence (n={3,4}, c=color). Ideally, these 8-bit maps could\n // be managed in the user preferences/theme.\n const COLOR_MAP_BRIGHT: Record<string | number, string> = {\n 0: \"#404040\",\n 1: \"#ff0000\",\n 2: \"#00ff00\",\n 3: \"#ffff00\",\n 4: \"#0000ff\",\n 5: \"#ff00ff\",\n 6: \"#00ffff\",\n 7: \"#ffffff\",\n };\n const COLOR_MAP_DARK: Record<string | number, string> = {\n 0: \"#000000\",\n 1: \"#800000\",\n 2: \"#008000\",\n 3: \"#808000\",\n 4: \"#000080\",\n 5: \"#800080\",\n 6: \"#008080\",\n 7: \"#c0c0c0\",\n };\n\n const ansi2rgb = (code: number): string => {\n /* eslint-disable yoda */\n if (0 <= code && code < 8) {\n // x8 RGB\n return COLOR_MAP_BRIGHT[code];\n }\n if (8 <= code && code < 16) {\n // x8 RGB - \"High Intensity\" (but here, actually the dark set)\n return COLOR_MAP_DARK[code];\n }\n if (16 <= code && code < 232) {\n // x216 RGB\n const base = code - 16;\n const ir = Math.floor(base / 36);\n const ig = Math.floor((base % 36) / 6);\n const ib = Math.floor((base % 6) / 1);\n const r = ir <= 0 ? 0 : 55 + ir * 40;\n const g = ig <= 0 ? 0 : 55 + ig * 40;\n const b = ib <= 0 ? 0 : 55 + ib * 40;\n return `rgb(${r}, ${g}, ${b})`;\n }\n if (232 <= code && code < 256) {\n // x32 greyscale\n const base = code - 232;\n const grey = base * 10 + 8;\n return `rgb(${grey}, ${grey}, ${grey})`;\n }\n // shouldn't get here (under normal circumstances), but just in case\n return \"initial\";\n };\n\n type styleKey = \"fontWeight\" | \"textDecoration\" | \"color\" | \"backgroundColor\" | \"display\";\n const style: {\n fontWeight?: string;\n textDecoration?: string;\n color?: string;\n backgroundColor?: string;\n display?: string;\n } = {};\n\n if (code === null || code === \"0\") {\n return style;\n }\n\n const codeParts = code\n .split(\";\")\n .map((p) => parseInt(p))\n .filter(\n (p, i, arr) =>\n // If the sequence is 38;5 (x256 foreground color) or 48;5 (x256 background color),\n // filter out the 5 so the next codePart after {38,48} is the color code.\n p != 5 || i == 0 || (arr[i - 1] != 38 && arr[i - 1] != 48),\n );\n\n let nextStyleKey: styleKey | null = null;\n codeParts.forEach((codePart) => {\n /* eslint-disable yoda */\n if (nextStyleKey !== null) {\n style[nextStyleKey] = ansi2rgb(codePart);\n nextStyleKey = null;\n }\n // Decorations\n else if (codePart == 1) {\n style.fontWeight = \"bold\";\n } else if (codePart == 4) {\n style.textDecoration = \"underline\";\n }\n // Forground Color (x8)\n else if (30 <= codePart && codePart < 38) {\n if (COLOR_MAP_BRIGHT[codePart % 10]) {\n style.color = COLOR_MAP_BRIGHT[codePart % 10];\n }\n }\n // Background Color (x8)\n else if (40 <= codePart && codePart < 48) {\n if (COLOR_MAP_DARK[codePart % 10]) {\n style.backgroundColor = COLOR_MAP_DARK[codePart % 10];\n }\n }\n // Forground Color (x256)\n else if (codePart == 38) {\n nextStyleKey = \"color\";\n }\n // Background Color (x256)\n else if (codePart == 48) {\n nextStyleKey = \"backgroundColor\";\n }\n });\n // If a background color is set, render this as an inline block element (instead of inline)\n // so that the background between lines (at least those that don't wrap) is uninterrupted.\n if (style.backgroundColor !== undefined) {\n style.display = \"inline-block\";\n }\n return style;\n }\n\n function parseOutputText(item: Output): React.ReactElement {\n const parts = [];\n // Some things, oddly, can cause item.text to not be a string (e.g. expr from the CLI), which\n // causes .matchAll to throw. Ensure it's a string immediately\n if (typeof item.text === \"string\") {\n // eslint-disable-next-line no-control-regex\n const ANSI_ESCAPE = new RegExp(\"\\u{001b}\\\\[(?<code>.*?)m\", \"ug\");\n // Build a look-alike regex match to place at the front of the matches list\n const INITIAL = {\n 0: \"\",\n index: 0,\n groups: { code: null },\n };\n const matches = [INITIAL, ...item.text.matchAll(ANSI_ESCAPE), null];\n if (matches.length > 2) {\n matches.slice(0, -1).forEach((m, i) => {\n const n = matches[i + 1];\n if (!m || m.index === undefined || m.groups === undefined) {\n return;\n }\n const startIndex = m.index + m[0].length;\n const stopIndex = n ? n.index : item.text.length;\n const partText = item.text.slice(startIndex, stopIndex);\n if (startIndex !== stopIndex) {\n // Don't generate \"empty\" spans\n parts.push({ code: m.groups.code, text: partText });\n }\n });\n }\n }\n if (parts.length === 0) {\n // For example, if the string was empty or there were no escape sequence matches\n parts.push({ code: null, text: item.text });\n }\n return (\n <Typography classes={{ root: lineClass(item.color) }} paragraph={false}>\n {parts.map((part, index) => {\n const spanStyle = ansiCodeStyle(part.code);\n if (!_.isEmpty(spanStyle)) {\n // Only wrap parts with spans if the calculated spanStyle is non-empty...\n return (\n <Typography key={index} paragraph={false} component=\"span\" sx={spanStyle}>\n {part.text}\n </Typography>\n );\n } else {\n // ... otherwise yield the unmodified, unwrapped part.\n return part.text;\n }\n })}\n </Typography>\n );\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 {parseOutputText(item)}\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 Paper from \"@mui/material/Paper\";\nimport Popper from \"@mui/material/Popper\";\nimport TextField from \"@mui/material/TextField\";\n\nimport { KEY, KEYCODE } 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) === KEY.SPACE || 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) === KEY.SPACE || 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) === KEY.SPACE) {\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) === KEY.SPACE) {\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.key === 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.key === 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.key === 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.key === 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.key === KEY.L && event.ctrlKey) {\n event.preventDefault();\n terminal.clear();\n }\n\n // Select previous command.\n if (event.key === KEY.UP_ARROW || (Settings.EnableBashHotkeys && event.key === 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.key === KEY.DOWN_ARROW || (Settings.EnableBashHotkeys && event.key === 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.code === KEYCODE.A && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"home\");\n }\n\n if (event.code === KEYCODE.E && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"end\");\n }\n\n if (event.code === KEYCODE.B && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"prevchar\");\n }\n\n if (event.code === KEYCODE.B && event.altKey) {\n event.preventDefault();\n moveTextCursor(\"prevword\");\n }\n\n if (event.code === KEYCODE.F && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"nextchar\");\n }\n\n if (event.code === KEYCODE.F && event.altKey) {\n event.preventDefault();\n moveTextCursor(\"nextword\");\n }\n\n if ((event.code === KEYCODE.H || event.code === KEYCODE.D) && event.ctrlKey) {\n modifyInput(\"backspace\");\n event.preventDefault();\n }\n\n if (event.code === KEYCODE.W && event.ctrlKey) {\n event.preventDefault();\n modifyInput(\"deletewordbefore\");\n }\n\n if (event.code === KEYCODE.D && event.altKey) {\n event.preventDefault();\n modifyInput(\"deletewordafter\");\n }\n\n if (event.code === KEYCODE.U && event.ctrlKey) {\n event.preventDefault();\n modifyInput(\"clearbefore\");\n }\n\n if (event.code === KEYCODE.K && event.ctrlKey) {\n event.preventDefault();\n modifyInput(\"clearafter\");\n }\n }\n }\n\n return (\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 onBlur: () => setPossibilities([]),\n onKeyDown: onKeyDown,\n }}\n ></TextField>\n <Popper open={possibilities.length > 0} anchorEl={terminalInput.current} placement={\"top-start\"}>\n <Paper sx={{ m: 1, p: 2 }}>\n <Typography classes={{ root: classes.preformatted }} color={\"primary\"} paragraph={false}>\n Possible autocomplete candidates:\n </Typography>\n <Typography classes={{ root: classes.preformatted }} color={\"primary\"} paragraph={false}>\n {possibilities.join(\" \")}\n </Typography>\n </Paper>\n </Popper>\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 { GetAllServers } from \"../Server/AllServers\";\nimport { Server } from \"../Server/Server\";\nimport { ParseCommand, ParseCommands } from \"./Parser\";\nimport { HelpTexts } from \"./HelpText\";\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\nimport { compile } from \"../NetscriptJSEvaluator\";\nimport { Flags } from \"../NetscriptFunctions/Flags\";\nimport { AutocompleteData } from \"../ScriptEditor/NetscriptDefinitions\";\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 directly connected and backdoored servers are reachable\n console.log(GetAllServers());\n return GetAllServers()\n .filter(\n (server) =>\n currServ.serversOnNetwork.includes(server.hostname) || (server instanceof Server && server.backdoorInstalled),\n )\n .map((server) => server.hostname);\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 const autocompleteData: AutocompleteData = {\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 let pos: string[] = [];\n let pos2: string[] = [];\n pos = pos.concat(loadedModule.autocomplete(autocompleteData, flags._));\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","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 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 } else if (longestStartSubstr === arg) {\n // List all possible options\n return allPossibilities;\n } else 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","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} sx={{ minWidth: \"fit-content\", maxWidth: \"25%\" }}>\n <Tab label={\"Active\"} value={\"active\"} />\n <Tab label={\"Recently Killed\"} 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 hostname: ${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\n primary={\n <Typography>\n └ {props.workerScript.name} {JSON.stringify(props.workerScript.args)}\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(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.runningScript.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.runningScript.filename} (died{\" \"}\n {convertTimeMsToTimeElapsedString(new Date().getTime() - recentScript.timeOfDeath.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.runningScript.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\";\n\nimport { use } from \"../../ui/Context\";\n\nimport { Typography, Button } from \"@mui/material\";\nimport { CovenantPurchasesRoot } from \"../../PersonObjects/Sleeve/ui/CovenantPurchasesRoot\";\nimport { FactionNames } from \"../data/FactionNames\";\nimport { GangButton } from \"./GangButton\";\n\ntype IProps = {\n faction: Faction;\n augPage: boolean;\n};\n\n// Info text for all options on the UI\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\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 factionInfo = faction.getInfo();\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 = player.inGang() && player.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 === FactionNames.TheCovenant && player.bitNodeN === 10;\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 <GangButton faction={faction} />\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 const player = use.Player();\n const router = use.Router();\n const [purchasingAugs, setPurchasingAugs] = useState(props.augPage);\n\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 if (player && !player.factions.includes(faction.name)) {\n return (\n <>\n <Typography variant=\"h4\" color=\"primary\">\n You have not joined {faction.name} yet!\n </Typography>\n <Button onClick={() => router.toFactions()}>Back to Factions</Button>\n </>\n );\n }\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 { Box, Button, Tooltip, Typography, Paper, Container } from \"@mui/material\";\nimport React, { useState } from \"react\";\n\nimport { StaticAugmentations } from \"../../Augmentation/StaticAugmentations\";\nimport { getGenericAugmentationPriceMultiplier } from \"../../Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { PurchasableAugmentations } from \"../../Augmentation/ui/PurchasableAugmentations\";\nimport { PurchaseAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../../ui/Context\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { FactionNames } from \"../data/FactionNames\";\nimport { Faction } from \"../Faction\";\nimport { getFactionAugmentationsFiltered, hasAugmentationPrereqs, purchaseAugmentation } from \"../FactionHelpers\";\n\ntype IProps = {\n faction: Faction;\n routeToMainPage: () => void;\n};\n\nexport function AugmentationsPage(props: IProps): React.ReactElement {\n const player = use.Player();\n\n const setRerender = useState(false)[1];\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function getAugs(): string[] {\n return getFactionAugmentationsFiltered(player, props.faction);\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 = StaticAugmentations[augName1],\n aug2 = StaticAugmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n\n return aug1.getCost(player).moneyCost - aug2.getCost(player).moneyCost;\n });\n\n return augs;\n }\n\n function getAugsSortedByPurchasable(): string[] {\n const augs = getAugs();\n function canBuy(augName: string): boolean {\n const aug = StaticAugmentations[augName];\n const augCosts = aug.getCost(player);\n const repCost = augCosts.repCost;\n const hasReq = props.faction.playerReputation >= repCost;\n const hasRep = hasAugmentationPrereqs(aug);\n const hasCost = augCosts.moneyCost !== 0 && player.money > augCosts.moneyCost;\n return hasCost && hasReq && hasRep;\n }\n const buy = augs.filter(canBuy).sort((augName1, augName2) => {\n const aug1 = StaticAugmentations[augName1],\n aug2 = StaticAugmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n\n return aug1.getCost(player).moneyCost - aug2.getCost(player).moneyCost;\n });\n const cantBuy = augs\n .filter((aug) => !canBuy(aug))\n .sort((augName1, augName2) => {\n const aug1 = StaticAugmentations[augName1],\n aug2 = StaticAugmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n return aug1.getCost(player).repCost - aug2.getCost(player).repCost;\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 = StaticAugmentations[augName1],\n aug2 = StaticAugmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n return aug1.getCost(player).repCost - aug2.getCost(player).repCost;\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 const owned = augs.filter((aug: string) => !purchasable.includes(aug));\n\n const multiplierComponent =\n props.faction.name !== FactionNames.ShadowsOfAnarchy ? (\n <Typography>\n <b>Price multiplier:</b> x {numeralWrapper.formatReallyBigNumber(getGenericAugmentationPriceMultiplier())}\n </Typography>\n ) : (\n <></>\n );\n\n return (\n <>\n <Container disableGutters maxWidth=\"lg\" sx={{ mx: 0 }}>\n <Button onClick={props.routeToMainPage}>Back</Button>\n <Typography variant=\"h4\">Faction Augmentations - {props.faction.name}</Typography>\n <Paper sx={{ p: 1, mb: 1 }}>\n <Typography>\n These are all of the Augmentations that are available to purchase from <b>{props.faction.name}</b>.\n Augmentations are powerful upgrades that will enhance your abilities.\n <br />\n </Typography>\n <Box\n sx={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${props.faction.name === FactionNames.ShadowsOfAnarchy ? \"2\" : \"3\"}, 1fr)`,\n justifyItems: \"center\",\n my: 1,\n }}\n >\n <Tooltip\n title={\n <Typography>\n The price of every Augmentation increases for every queued Augmentation and it is reset when you\n install them.\n </Typography>\n }\n >\n {multiplierComponent}\n </Tooltip>\n <Typography>\n <b>Reputation:</b> <Reputation reputation={props.faction.playerReputation} />\n </Typography>\n <Typography>\n <b>Favor:</b> <Favor favor={Math.floor(props.faction.favor)} />\n </Typography>\n </Box>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"repeat(4, 1fr)\" }}>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Cost)}>Sort by Cost</Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Reputation)}>\n Sort by Reputation\n </Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Default)}>\n Sort by Default Order\n </Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Purchasable)}>\n Sort by Purchasable\n </Button>\n </Box>\n </Paper>\n </Container>\n\n <PurchasableAugmentations\n augNames={purchasable}\n ownedAugNames={owned}\n player={player}\n canPurchase={(player, aug) => {\n const costs = aug.getCost(player);\n return (\n hasAugmentationPrereqs(aug) &&\n props.faction.playerReputation >= costs.repCost &&\n (costs.moneyCost === 0 || player.money > costs.moneyCost)\n );\n }}\n purchaseAugmentation={(player, aug, showModal) => {\n if (!Settings.SuppressBuyAugmentationConfirmation) {\n showModal(true);\n } else {\n purchaseAugmentation(aug, props.faction);\n rerender();\n }\n }}\n rep={props.faction.playerReputation}\n faction={props.faction}\n />\n </>\n );\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\";\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\";\nimport { FactionInfo } from \"../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\nfunction DefaultAssignment(): React.ReactElement {\n return (\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 that\n enhance your abilities.\n </Typography>\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 Assignment = props.factionInfo.assignment ?? DefaultAssignment;\n\n const favorGain = props.faction.getFavorGain();\n\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 {\"\\\\(\\\\huge{favor=1+\\\\left\\\\lfloor\\\\log_{1.02}\\\\left(\\\\frac{r+25000}{25500}\\\\right)\\\\right\\\\rfloor}\\\\)\"}\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 <Typography>\n Faction Favor: <Favor favor={Math.floor(props.faction.favor)} />\n </Typography>\n </Tooltip>\n </Box>\n\n <Typography>-------------------------</Typography>\n <Assignment />\n </>\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\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\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 {FactionNames.TheCovenant}.\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 * as generalMethods from \"./Player/PlayerObjectGeneralMethods\";\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\";\nimport { IPerson } from \"./IPerson\";\n\n// Base class representing a person-like object\nexport abstract class Person implements IPerson {\n /**\n * Stats\n */\n hacking = 1;\n strength = 1;\n defense = 1;\n dexterity = 1;\n agility = 1;\n charisma = 1;\n intelligence = 0;\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\n /**\n * City that the person is in\n */\n city: CityName = CityName.Sector12;\n\n gainHackingExp = generalMethods.gainHackingExp;\n gainStrengthExp = generalMethods.gainStrengthExp;\n gainDefenseExp = generalMethods.gainDefenseExp;\n gainDexterityExp = generalMethods.gainDexterityExp;\n gainAgilityExp = generalMethods.gainAgilityExp;\n gainCharismaExp = generalMethods.gainCharismaExp;\n gainIntelligenceExp = generalMethods.gainIntelligenceExp;\n gainStats = generalMethods.gainStats;\n calculateSkill = generalMethods.calculateSkill;\n regenerateHp = generalMethods.regenerateHp;\n queryStatFromString = generalMethods.queryStatFromString;\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 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.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\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 abstract takeDamage(amt: number): boolean;\n\n abstract whoAmI(): string;\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 { Button, Typography, Box, Paper, Tooltip } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { GangConstants } from \"../../Gang/data/Constants\";\nimport { use } from \"../../ui/Context\";\nimport { Faction } from \"../Faction\";\nimport { CreateGangModal } from \"./CreateGangModal\";\n\ntype IProps = {\n faction: Faction;\n};\n\nexport function GangButton({ faction }: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [gangOpen, setGangOpen] = useState(false);\n\n if (\n !GangConstants.Names.includes(faction.name) || // not even a gang\n !player.isAwareOfGang() || // doesn't know about gang\n (player.inGang() && player.getGangName() !== faction.name) // already in another gang\n ) {\n return <></>;\n }\n\n let data = {\n enabled: false,\n title: \"\",\n tooltip: \"\" as string | React.ReactElement,\n description: \"\",\n };\n\n if (player.inGang()) {\n data = {\n enabled: true,\n title: \"Manage Gang\",\n tooltip: \"\",\n description: \"Manage a gang for this Faction. Gangs will earn you money and faction reputation\",\n };\n } else {\n data = {\n enabled: player.canAccessGang(),\n title: \"Create Gang\",\n tooltip: !player.canAccessGang() ? (\n <Typography>Unlocked when reaching {GangConstants.GangKarmaRequirement} karma</Typography>\n ) : (\n \"\"\n ),\n description: \"Create a gang for this Faction. Gangs will earn you money and faction reputation\",\n };\n }\n\n const 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 return (\n <>\n <Box>\n <Paper sx={{ my: 1, p: 1 }}>\n <Tooltip title={data.tooltip}>\n <span>\n <Button onClick={manageGang} disabled={!data.enabled}>\n {data.title}\n </Button>\n </span>\n </Tooltip>\n <Typography>{data.description}</Typography>\n </Paper>\n </Box>\n\n <CreateGangModal facName={faction.name} open={gangOpen} onClose={() => setGangOpen(false)} />\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\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { FactionNames } from \"../data/FactionNames\";\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 [FactionNames.NiteSec as string, FactionNames.TheBlackHand as string].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.key === KEY.ENTER) 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","import { Paper, Table, TableBody, Box, IconButton, Typography, Container, Tooltip } from \"@mui/material\";\nimport { MoreHoriz, Info } from \"@mui/icons-material\";\nimport React, { useEffect, useState } from \"react\";\nimport { BitNodes, defaultMultipliers, getBitNodeMultipliers } from \"../BitNode/BitNode\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { BitNodeMultipliersDisplay } from \"../BitNode/ui/BitnodeMultipliersDescription\";\nimport { HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { getPurchaseServerLimit } from \"../Server/ServerPurchases\";\nimport { Settings } from \"../Settings/Settings\";\nimport { MoneySourceTracker } from \"../utils/MoneySourceTracker\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { use } from \"./Context\";\nimport { numeralWrapper } from \"./numeralFormat\";\nimport { Modal } from \"./React/Modal\";\nimport { Money } from \"./React/Money\";\nimport { StatsRow } from \"./React/StatsRow\";\nimport { StatsTable } from \"./React/StatsTable\";\nimport { isEqual } from \"lodash\";\n\ninterface EmployersModalProps {\n open: boolean;\n onClose: () => void;\n}\n\nconst EmployersModal = ({ open, onClose }: EmployersModalProps): React.ReactElement => {\n const player = use.Player();\n return (\n <Modal open={open} onClose={onClose}>\n <>\n <Typography variant=\"h5\">All Employers</Typography>\n <ul>\n {Object.keys(player.jobs).map((j) => (\n <Typography key={j}>* {j}</Typography>\n ))}\n </ul>\n </>\n </Modal>\n );\n};\n\ninterface IMultRow {\n // The name of the multiplier\n mult: string;\n\n // The player's raw multiplier value\n value: number;\n\n // The player's effective multiplier value, affected by BitNode mults\n effValue?: number;\n\n // The text color for the row\n color?: string;\n}\n\ninterface MultTableProps {\n rows: IMultRow[];\n color: string;\n noMargin?: boolean;\n}\n\nfunction MultiplierTable(props: MultTableProps): React.ReactElement {\n const player = use.Player();\n return (\n <Table sx={{ display: \"table\", width: \"100%\", mb: (props.noMargin ?? false) === true ? 0 : 2 }}>\n <TableBody>\n {props.rows.map((data) => {\n const { mult, value, effValue = null, color = props.color } = data;\n\n if (effValue !== null && effValue !== value && player.sourceFileLvl(5) > 0) {\n return (\n <StatsRow key={mult} name={mult} color={color} data={{}}>\n <>\n <Typography color={color}>\n <span style={{ opacity: 0.5 }}>{numeralWrapper.formatPercentage(value)}</span>{\" \"}\n {numeralWrapper.formatPercentage(effValue)}\n </Typography>\n </>\n </StatsRow>\n );\n }\n return (\n <StatsRow key={mult} name={mult} color={color} data={{ content: numeralWrapper.formatPercentage(value) }} />\n );\n })}\n </TableBody>\n </Table>\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 const lvl = Math.min(player.sourceFileLvl(player.bitNodeN) + 1, player.bitNodeN === 12 ? Infinity : 3);\n return (\n <Paper sx={{ mb: 1, p: 1 }}>\n <Typography variant=\"h5\">\n BitNode {player.bitNodeN}: {BitNodes[index].name} (Level {lvl})\n </Typography>\n <Typography sx={{ whiteSpace: \"pre-wrap\", overflowWrap: \"break-word\" }}>{BitNodes[index].info}</Typography>\n </Paper>\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 [employersOpen, setEmployersOpen] = 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 [\"Since last Augmentation installation\", convertTimeMsToTimeElapsedString(player.playtimeSinceLastAug)],\n ];\n if (player.sourceFiles.length > 0) {\n timeRows.push([\"Since last Bitnode destroyed\", convertTimeMsToTimeElapsedString(player.playtimeSinceLastBitnode)]);\n }\n timeRows.push([\"Total\", convertTimeMsToTimeElapsedString(player.totalPlaytime)]);\n\n let showBitNodeMults = false;\n if (player.sourceFileLvl(5) > 0) {\n const n = player.bitNodeN;\n const maxSfLevel = n === 12 ? Infinity : 3;\n const mults = getBitNodeMultipliers(n, Math.min(player.sourceFileLvl(n) + 1, maxSfLevel));\n showBitNodeMults = !isEqual(mults, defaultMultipliers);\n }\n\n return (\n <Container maxWidth=\"lg\" disableGutters sx={{ mx: 0 }}>\n <Typography variant=\"h4\">Stats</Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\", minWidth: \"fit-content\", mb: 1, gap: 1 }}>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\">General</Typography>\n <Table>\n <TableBody>\n <StatsRow name=\"Current City\" color={Settings.theme.primary} data={{ content: player.city }} />\n <StatsRow name=\"Money\" color={Settings.theme.money} data={{}}>\n <>\n <Money money={player.money} />\n <IconButton onClick={() => setMoneyOpen(true)} sx={{ p: 0 }}>\n <MoreHoriz color=\"info\" />\n </IconButton>\n </>\n </StatsRow>\n {player.companyName ? (\n <>\n <StatsRow\n name=\"Last Employer\"\n color={Settings.theme.primary}\n data={{ content: player.companyName }}\n />\n <StatsRow\n name=\"Last Job\"\n color={Settings.theme.primary}\n data={{ content: player.jobs[player.companyName] }}\n />\n </>\n ) : (\n <></>\n )}\n {player.jobs && Object.keys(player.jobs).length !== 0 ? (\n <StatsRow name=\"All Employers\" color={Settings.theme.primary} data={{}}>\n <>\n <span style={{ color: Settings.theme.primary }}>{Object.keys(player.jobs).length} total</span>\n <IconButton onClick={() => setEmployersOpen(true)} sx={{ p: 0 }}>\n <MoreHoriz color=\"info\" />\n </IconButton>\n </>\n </StatsRow>\n ) : (\n <></>\n )}\n <StatsRow\n name=\"Servers Owned\"\n color={Settings.theme.primary}\n data={{ content: `${player.purchasedServers.length} / ${getPurchaseServerLimit()}` }}\n />\n <StatsRow\n name={`Hacknet ${player.bitNodeN === 9 || player.sourceFileLvl(9) > 0 ? \"Servers\" : \"Nodes\"} owned`}\n color={Settings.theme.primary}\n data={{\n content: `${player.hacknetNodes.length}${\n player.bitNodeN === 9 || player.sourceFileLvl(9) > 0\n ? ` / ${HacknetServerConstants.MaxServers}`\n : \"\"\n }`,\n }}\n />\n <StatsRow\n name=\"Augmentations Installed\"\n color={Settings.theme.primary}\n data={{ content: String(player.augmentations.length) }}\n />\n </TableBody>\n </Table>\n </Paper>\n <Paper sx={{ p: 1 }}>\n <Typography variant=\"h5\">Skills</Typography>\n <Table>\n <TableBody>\n <StatsRow\n name=\"Hacking\"\n color={Settings.theme.hack}\n data={{ level: player.hacking, exp: player.hacking_exp }}\n />\n <StatsRow\n name=\"Strength\"\n color={Settings.theme.combat}\n data={{ level: player.strength, exp: player.strength_exp }}\n />\n <StatsRow\n name=\"Defense\"\n color={Settings.theme.combat}\n data={{ level: player.defense, exp: player.defense_exp }}\n />\n <StatsRow\n name=\"Dexterity\"\n color={Settings.theme.combat}\n data={{ level: player.dexterity, exp: player.dexterity_exp }}\n />\n <StatsRow\n name=\"Agility\"\n color={Settings.theme.combat}\n data={{ level: player.agility, exp: player.agility_exp }}\n />\n <StatsRow\n name=\"Charisma\"\n color={Settings.theme.cha}\n data={{ level: player.charisma, exp: player.charisma_exp }}\n />\n {player.intelligence > 0 && (player.bitNodeN === 5 || player.sourceFileLvl(5) > 0) && (\n <StatsRow\n name=\"Intelligence\"\n color={Settings.theme.int}\n data={{ level: player.intelligence, exp: player.intelligence_exp }}\n />\n )}\n </TableBody>\n </Table>\n </Paper>\n </Box>\n\n <Paper sx={{ p: 1, mb: 1 }}>\n <Typography variant=\"h5\" color=\"primary\" sx={{ display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\" }}>\n Multipliers\n {player.sourceFileLvl(5) > 0 && (\n <Tooltip\n title={\n <Typography>\n Displays your current multipliers.\n <br />\n <br />\n When there is a dim number next to a multiplier, that means that the multiplier in question is being\n affected by BitNode multipliers.\n <br />\n <br />\n The dim number is the raw multiplier, and the undimmed number is the effective multiplier, as dictated\n by the BitNode.\n </Typography>\n }\n >\n <Info sx={{ ml: 1, mb: 0.5 }} color=\"info\" />\n </Tooltip>\n )}\n </Typography>\n <Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\", gap: 1 }}>\n <Box>\n <MultiplierTable\n rows={[\n {\n mult: \"Hacking Chance\",\n value: player.hacking_chance_mult,\n },\n {\n mult: \"Hacking Speed\",\n value: player.hacking_speed_mult,\n },\n {\n mult: \"Hacking Money\",\n value: player.hacking_money_mult,\n effValue: player.hacking_money_mult * BitNodeMultipliers.ScriptHackMoney,\n },\n {\n mult: \"Hacking Growth\",\n value: player.hacking_grow_mult,\n effValue: player.hacking_grow_mult * BitNodeMultipliers.ServerGrowthRate,\n },\n ]}\n color={Settings.theme.hack}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Hacking Level\",\n value: player.hacking_mult,\n effValue: player.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier,\n },\n {\n mult: \"Hacking Experience\",\n value: player.hacking_exp_mult,\n effValue: player.hacking_exp_mult * BitNodeMultipliers.HackExpGain,\n },\n ]}\n color={Settings.theme.hack}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Strength Level\",\n value: player.strength_mult,\n effValue: player.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier,\n },\n {\n mult: \"Strength Experience\",\n value: player.strength_exp_mult,\n },\n ]}\n color={Settings.theme.combat}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Defense Level\",\n value: player.defense_mult,\n effValue: player.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier,\n },\n {\n mult: \"Defense Experience\",\n value: player.defense_exp_mult,\n },\n ]}\n color={Settings.theme.combat}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Dexterity Level\",\n value: player.dexterity_mult,\n effValue: player.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier,\n },\n {\n mult: \"Dexterity Experience\",\n value: player.dexterity_exp_mult,\n },\n ]}\n color={Settings.theme.combat}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Agility Level\",\n value: player.agility_mult,\n effValue: player.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier,\n },\n {\n mult: \"Agility Experience\",\n value: player.agility_exp_mult,\n },\n ]}\n color={Settings.theme.combat}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Charisma Level\",\n value: player.charisma_mult,\n effValue: player.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier,\n },\n {\n mult: \"Charisma Experience\",\n value: player.charisma_exp_mult,\n },\n ]}\n color={Settings.theme.cha}\n noMargin\n />\n </Box>\n\n <Box>\n <MultiplierTable\n rows={[\n {\n mult: \"Hacknet Node Production\",\n value: player.hacknet_node_money_mult,\n effValue: player.hacknet_node_money_mult * BitNodeMultipliers.HacknetNodeMoney,\n },\n {\n mult: \"Hacknet Node Purchase Cost\",\n value: player.hacknet_node_purchase_cost_mult,\n },\n {\n mult: \"Hacknet Node RAM Upgrade Cost\",\n value: player.hacknet_node_ram_cost_mult,\n },\n {\n mult: \"Hacknet Node Core Purchase Cost\",\n value: player.hacknet_node_core_cost_mult,\n },\n {\n mult: \"Hacknet Node Level Upgrade Cost\",\n value: player.hacknet_node_level_cost_mult,\n },\n ]}\n color={Settings.theme.primary}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Company Reputation Gain\",\n value: player.company_rep_mult,\n color: Settings.theme.rep,\n },\n {\n mult: \"Faction Reputation Gain\",\n value: player.faction_rep_mult,\n effValue: player.faction_rep_mult * BitNodeMultipliers.FactionWorkRepGain,\n color: Settings.theme.rep,\n },\n {\n mult: \"Salary\",\n value: player.work_money_mult,\n effValue: player.work_money_mult * BitNodeMultipliers.CompanyWorkMoney,\n color: Settings.theme.money,\n },\n ]}\n color={Settings.theme.money}\n />\n <MultiplierTable\n rows={[\n {\n mult: \"Crime Success Chance\",\n value: player.crime_success_mult,\n },\n {\n mult: \"Crime Money\",\n value: player.crime_money_mult,\n effValue: player.crime_money_mult * BitNodeMultipliers.CrimeMoney,\n color: Settings.theme.money,\n },\n ]}\n color={Settings.theme.combat}\n />\n {player.canAccessBladeburner() && (\n <MultiplierTable\n rows={[\n {\n mult: \"Bladeburner Success Chance\",\n value: player.bladeburner_success_chance_mult,\n },\n {\n mult: \"Bladeburner Max Stamina\",\n value: player.bladeburner_max_stamina_mult,\n },\n {\n mult: \"Bladeburner Stamina Gain\",\n value: player.bladeburner_stamina_gain_mult,\n },\n {\n mult: \"Bladeburner Field Analysis\",\n value: player.bladeburner_analysis_mult,\n },\n ]}\n color={Settings.theme.primary}\n noMargin\n />\n )}\n </Box>\n </Box>\n </Paper>\n\n <Paper sx={{ p: 1, mb: 1 }}>\n <Typography variant=\"h5\">Time Played</Typography>\n <Table>\n <TableBody>\n {timeRows.map(([name, content]) => (\n <StatsRow key={name} name={name} color={Settings.theme.primary} data={{ content: content }} />\n ))}\n </TableBody>\n </Table>\n </Paper>\n\n <CurrentBitNode />\n\n {showBitNodeMults && (\n <Paper sx={{ p: 1, mb: 1 }}>\n <Typography variant=\"h5\">BitNode Multipliers</Typography>\n <BitNodeMultipliersDisplay n={player.bitNodeN} />\n </Paper>\n )}\n\n <MoneyModal open={moneyOpen} onClose={() => setMoneyOpen(false)} />\n <EmployersModal open={employersOpen} onClose={() => setEmployersOpen(false)} />\n </Container>\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\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\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 {FactionNames.FourSigma} (4S) Market Data Feed\n </Typography>\n <Typography>\n {FactionNames.FourSigma}'s (4S) Market Data Feed provides information about stocks that will help your trading\n 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 { 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 if (qty > stock.playerShortShares) {\n return <>You do not have this many shares in the Short position</>;\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 || props.p.sourceFileLvl(8) >= 3;\n }\n\n // Whether the player has access to shorting stocks\n function hasShortAccess(): boolean {\n return props.p.bitNodeN === 8 || props.p.sourceFileLvl(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 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 || props.p.sourceFileLvl(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 { IRouter } from \"../../ui/Router\";\nimport { BitNodes } from \"../BitNode\";\nimport { enterBitNode } 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 IconButton from \"@mui/material/IconButton\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { Settings } from \"../../Settings/Settings\";\nimport Button from \"@mui/material/Button\";\n\nconst useStyles = makeStyles(() =>\n createStyles({\n portal: {\n cursor: \"pointer\",\n fontFamily: \"inherit\",\n fontSize: \"1rem\",\n fontWeight: \"bold\",\n lineHeight: 1,\n padding: 0,\n \"&:hover\": {\n color: \"#fff\",\n },\n },\n level0: {\n color: \"red\",\n },\n level1: {\n color: \"yellow\",\n },\n level2: {\n color: \"#48d1cc\",\n },\n level3: {\n color: \"blue\",\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 cssClass = `${classes.portal} ${cssClass}`;\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 {Settings.DisableASCIIArt ? (\n <Button onClick={() => setPortalOpen(true)} sx={{ m: 2 }} aria-description={bitNode.desc}>\n <Typography>\n BitNode-{bitNode.number.toString()}: {bitNode.name}\n </Typography>\n </Button>\n ) : (\n <IconButton\n onClick={() => setPortalOpen(true)}\n className={cssClass}\n aria-label={`BitNode-${bitNode.number.toString()}: ${bitNode.name}`}\n aria-description={bitNode.desc}\n >\n O\n </IconButton>\n )}\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 {Settings.DisableASCIIArt && <br />}\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 const player = use.Player();\n const enter = enterBitNode;\n const destroyed = player.bitNodeN;\n const [destroySequence, setDestroySequence] = useState(!props.quick);\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 const nextSourceFileLvl = (n: number): number => {\n const lvl = player.sourceFileLvl(n);\n if (n !== destroyed) {\n return lvl;\n }\n const max = n === 12 ? Infinity : 3;\n\n // If accessed via flume, display the current BN level, else the next\n return Math.min(max, lvl + Number(!props.flume));\n };\n\n if (Settings.DisableASCIIArt) {\n return (\n <>\n {Object.values(BitNodes)\n .filter((node) => {\n return node.desc !== \"COMING SOON\";\n })\n .map((node) => {\n return (\n <BitNodePortal\n key={node.number}\n n={node.number}\n level={nextSourceFileLvl(node.number)}\n enter={enter}\n flume={props.flume}\n destroyedBitNode={destroyed}\n />\n );\n })}\n <br />\n <br />\n <br />\n <br />\n <CinematicText\n 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 }\n\n const n = nextSourceFileLvl;\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={n(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={n(10)} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | | / | <BitNodePortal n={11} level={n(11)} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> <BitNodePortal n={9} level={n(9)} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | | | | | | | <BitNodePortal n={12} level={n(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={n(7)} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> / \\ <BitNodePortal n={8} level={n(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={n(5)} enter={enter} flume={props.flume} destroyedBitNode={destroyed} />3R | | | | | | R3<BitNodePortal n={6} level={n(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={n(1)} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> |/ <BitNodePortal n={2} level={n(2)} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | | <BitNodePortal n={3} level={n(3)} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> \\| <BitNodePortal n={4} level={n(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","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\";\nimport { BitnodeMultiplierDescription } from \"./BitnodeMultipliersDescription\";\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 <BitnodeMultiplierDescription n={props.n} level={newLevel} />\n <br />\n <br />\n <Button\n aria-label={`enter-bitnode-${bitNode.number.toString()}`}\n autoFocus={true}\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 { Info } from \"@mui/icons-material\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport Typography from \"@mui/material/Typography\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { Fragments } from \"../Fragment\";\nimport { DummyGrid } from \"./DummyGrid\";\nimport Container from \"@mui/material/Container\";\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 <Container maxWidth=\"lg\" disableGutters sx={{ mx: 0 }}>\n <Typography variant=\"h4\">\n Stanek's Gift\n <Info\n sx={{ ml: 1, mb: 0 }}\n color=\"info\"\n onClick={() =>\n dialogBoxCreate(\n <>\n <Typography>\n Stanek's Gift is a powerful, unique augmentation obtained by joining the Church of the Machine God,\n which can be found in Chongqing. It is only possible to join the church if you are in BitNode 13 or\n possess at least one level of Source File 13, and you will be turned away if you have purchased or\n installed any augmentations beside NeuroFlux Governors. You are, however, permitted to install\n augmentations as normal once you have joined the church.\n </Typography>\n <br />\n <Typography>\n Initially, those bearing the gift will find that its overwhelming power worsens all of their stats by\n 10%. This penalty can be overcome in time by receiving free upgrades from the Church of the Machine\n God faction, but the reputation requirements for these upgrades are steep, and you can only obtain\n reputation with the church by charging the gift.\n </Typography>\n <br />\n <Typography>\n In order to charge Stanek's Gift, the user must first arrange stat-modifying fragments within the grid\n located on the device. This may be done manually or by scripts that utilize the Stanek's Gift\n Netscript API. Not every tile of the grid must house a fragment, but fragments cannot overlap or\n otherwise share tiles. Fragments can be rotated, but their design does not allow them to be flipped\n around to mirror their original shape. Note that the size of the grid is determined by the BitNode you\n are currently in and the level of your Source File 13, if applicable.\n </Typography>\n <br />\n <Typography>\n There exist two kinds of fragments. The first are Stat Fragments, which take up 4 tiles of the grid.\n Each Stat Fragment is unique, and there is only one of each. There is no way to obtain more of these\n fragments. Each Stat Fragment has an associated stat that it will improve, as well as a multiplier on\n its effectiveness known as power. When initially placed, a Stat Fragment will have no effect. In order\n for the fragment to gain stat boosts, it must be charged. The other kind of fragments are known as\n Booster Fragments, which take up 5 tiles of the grid. There is no shortage of Booster Fragments, and\n it is virtually impossible to run out of them. While not providing any direct stat increases to their\n user, Stat Fragments increase the efficacy of adjacent Stat Fragments by 10%, and do not need to be\n charged.\n </Typography>\n <br />\n\n <DummyGrid\n width={4}\n height={4}\n fragments={[\n new ActiveFragment({\n x: 0,\n y: 0,\n rotation: 0,\n fragment: Fragments.find((f) => f.id === 5) ?? Fragments[0],\n }),\n new ActiveFragment({\n x: 0,\n y: 2,\n rotation: 0,\n fragment: Fragments.find((f) => f.id === 101) ?? Fragments[0],\n }),\n ]}\n />\n <Typography sx={{ fontStyle: \"italic\" }}>\n This Booster Fragment provides a bonus to the adjacent Stat Fragment.\n </Typography>\n <br />\n\n <DummyGrid\n width={3}\n height={4}\n fragments={[\n new ActiveFragment({\n x: 0,\n y: 1,\n rotation: 3,\n fragment: Fragments.find((f) => f.id === 100) ?? Fragments[0],\n }),\n new ActiveFragment({\n x: 0,\n y: 0,\n rotation: 2,\n fragment: Fragments.find((f) => f.id === 1) ?? Fragments[0],\n }),\n ]}\n />\n <Typography sx={{ fontStyle: \"italic\" }}>\n Even though the Booster Fragment touches the Stat Fragment in multiple places, the bonus is only\n applied once.\n </Typography>\n <br />\n\n <DummyGrid\n width={4}\n height={4}\n fragments={[\n new ActiveFragment({\n x: 0,\n y: 0,\n rotation: 0,\n fragment: Fragments.find((f) => f.id === 5) ?? Fragments[0],\n }),\n new ActiveFragment({\n x: 1,\n y: 1,\n rotation: 0,\n fragment: Fragments.find((f) => f.id === 105) ?? Fragments[0],\n }),\n ]}\n />\n <Typography sx={{ fontStyle: \"italic\" }}>\n This Booster Fragment does nothing, as it is not touching a Stat Fragment.\n </Typography>\n <br />\n\n <DummyGrid\n width={4}\n height={4}\n fragments={[\n new ActiveFragment({\n x: 0,\n y: 0,\n rotation: 1,\n fragment: Fragments.find((f) => f.id === 27) ?? Fragments[0],\n }),\n new ActiveFragment({\n x: 0,\n y: 1,\n rotation: 2,\n fragment: Fragments.find((f) => f.id === 100) ?? Fragments[0],\n }),\n new ActiveFragment({\n x: 2,\n y: 0,\n rotation: 1,\n fragment: Fragments.find((f) => f.id === 30) ?? Fragments[0],\n }),\n ]}\n />\n <Typography sx={{ fontStyle: \"italic\" }}>\n This Booster Fragment provides a bonus to both Stat Fragments it's touching.\n </Typography>\n <br />\n\n <Typography>\n Stat Fragments are charged using the stanek.chargeFragment(rootX, rootY) NetScript API function. The\n charging process ordinarily takes 1000ms to complete, but only takes 200ms during bonus time. When the\n function finishes executing, the fragment's charge levels will be raised by an amount corresponding to\n the number of threads that were used. Note that it is no more effective to charge a fragment many\n times with few threads than to charge few times with many threads, so there is no need to distribute\n charging jobs across multiple scripts. As a Stat Fragment's charge level is increased, its bonuses\n will increase, but there will be diminishing returns. As such, it is generally most efficient to\n charge all of the placed fragments equally. The charge level of a fragment will not decrease over\n time, but it will be reset to 0 upon removing it from the board or installing augmentations.\n </Typography>\n </>,\n )\n }\n />\n </Typography>\n\n <Typography sx={{ mb: 1 }}>\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 the neighboring fragments (not diagonally). Use Q/E to rotate fragments.\n </Typography>\n {staneksGift.storedCycles > 5 && (\n <Typography sx={{ mb: 1 }}>\n Bonus time: {convertTimeMsToTimeElapsedString(CONSTANTS._idleSpeed * staneksGift.storedCycles)}\n </Typography>\n )}\n <MainBoard gift={staneksGift} />\n </Container>\n );\n}\n","import * as React from \"react\";\nimport { Fragment, NoneFragment } from \"../Fragment\";\nimport { FragmentType } from \"../FragmentType\";\nimport { IStaneksGift } from \"../IStaneksGift\";\nimport { FragmentInspector } from \"./FragmentInspector\";\nimport { FragmentSelector } from \"./FragmentSelector\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport { Table } from \"../../ui/React/Table\";\nimport { Grid } from \"./Grid\";\nimport { zeros, calculateGrid } from \"../Helper\";\nimport { ActiveFragmentSummary } from \"./ActiveFragmentSummary\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n gift: IStaneksGift;\n}\n\nexport function MainBoard(props: IProps): React.ReactElement {\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 clear(): void {\n props.gift.clear();\n setGrid(zeros([props.gift.width(), props.gift.height()]));\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 <Box display=\"flex\" sx={{ mb: 1 }}>\n <Table sx={{ mr: 1 }}>\n <Grid\n width={props.gift.width()}\n height={props.gift.height()}\n activeGrid={grid}\n ghostGrid={ghostGrid}\n gift={props.gift}\n enter={(i, j) => moveGhost(i, j, rotation)}\n click={(i, j) => clickAt(i, j)}\n />\n </Table>\n <FragmentInspector gift={props.gift} x={pos[0]} y={pos[1]} fragment={props.gift.fragmentAt(pos[0], pos[1])} />\n </Box>\n <Box display=\"flex\" sx={{ mb: 1 }}>\n <FragmentSelector gift={props.gift} selectFragment={updateSelectedFragment} />\n </Box>\n\n <ActiveFragmentSummary gift={props.gift} />\n\n <Tooltip\n title={\n <Typography>\n WARNING : This will remove all active fragment from the grid. <br />\n All cumulated charges will be lost.\n </Typography>\n }\n >\n <Button onClick={clear}>Clear grid</Button>\n </Tooltip>\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 sx={{ flexGrow: 1 }}>\n <Typography>\n [X, Y] {props.x}, {props.y}\n <br />\n <br />\n ID: N/A\n <br />\n Effect: N/A\n <br />\n Base Power: N/A\n <br />\n Charge: N/A\n <br />\n root [X, Y] N/A\n <br />\n </Typography>\n </Paper>\n );\n }\n const f = props.fragment.fragment();\n\n let charge = numeralWrapper.formatStaneksGiftCharge(props.fragment.highestCharge * props.fragment.numCharge);\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 if (Effect(f.type).includes(\"+x%\")) {\n effect = Effect(f.type).replace(/-*x%/, numeralWrapper.formatPercentage(props.gift.effect(props.fragment) - 1));\n } else if (Effect(f.type).includes(\"-x%\")) {\n const effectAmt = props.gift.effect(props.fragment);\n const perc = numeralWrapper.formatPercentage(1 - 1 / effectAmt);\n effect = Effect(f.type).replace(/-x%/, perc);\n }\n\n return (\n <Paper sx={{ flexGrow: 1 }}>\n <Typography>\n [X, Y] {props.x}, {props.y}\n <br />\n <br />\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 root [X, Y] {props.fragment.x}, {props.fragment.y}\n <br />\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 { 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\";\nimport Table from \"@mui/material/Table\";\nimport { TableBody, TableCell, TableRow } from \"@mui/material\";\n\ntype IProps = {\n gift: IStaneksGift;\n};\n\nfunction formatEffect(effect: number, type: FragmentType): string {\n if (Effect(type).includes(\"+x%\")) {\n return Effect(type).replace(/-*x%/, numeralWrapper.formatPercentage(effect - 1));\n } else if (Effect(type).includes(\"-x%\")) {\n const perc = numeralWrapper.formatPercentage(1 - 1 / effect);\n return Effect(type).replace(/-x%/, perc);\n } else {\n return Effect(type);\n }\n}\n\nexport function ActiveFragmentSummary(props: IProps): React.ReactElement {\n const summary: { coordinate: { x: number; y: number }[]; effect: number; type: FragmentType }[] = [];\n // Iterate through Active Fragment\n props.gift.fragments.forEach((fragment: ActiveFragment) => {\n const f = fragment.fragment();\n // Discard ToolBrush and Booster.\n if (![FragmentType.Booster, FragmentType.None, FragmentType.Delete].includes(f.type)) {\n // Check for an existing entry in summary for this fragment's type\n const entry = summary.find((e) => {\n return e.type === f.type;\n });\n if (entry) {\n // If there's one, update the existing entry\n entry.effect *= props.gift.effect(fragment);\n entry.coordinate.push({ x: fragment.x, y: fragment.y });\n } else {\n // If there's none, create a new entry\n summary.push({\n coordinate: [{ x: fragment.x, y: fragment.y }],\n effect: props.gift.effect(fragment),\n type: f.type,\n });\n }\n }\n });\n\n return (\n <Paper sx={{ mb: 1 }}>\n <Typography variant=\"h5\">Summary of active fragments:</Typography>\n <Table sx={{ display: \"table\", width: \"100%\" }}>\n <TableBody>\n <TableRow>\n <TableCell sx={{ borderBottom: \"none\", p: 0, m: 0 }}>\n <Typography>Coordinate</Typography>\n </TableCell>\n\n <TableCell sx={{ borderBottom: \"none\", p: 0, m: 0 }}>\n <Typography>Effect</Typography>\n </TableCell>\n </TableRow>\n {summary.map((entry) => {\n return (\n <TableRow>\n <TableCell sx={{ borderBottom: \"none\", p: 0, m: 0 }}>\n <Typography>\n {entry.coordinate.map((coord) => {\n return \"[\" + coord.x + \",\" + coord.y + \"]\";\n })}\n </Typography>\n </TableCell>\n\n <TableCell sx={{ borderBottom: \"none\", p: 0, m: 0 }}>\n <Typography>{formatEffect(entry.effect, entry.type)}</Typography>\n </TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n </Paper>\n );\n}\n","import { ActiveFragment } from \"./ActiveFragment\";\nimport { IStaneksGift } from \"./IStaneksGift\";\n\nexport class DummyGift implements IStaneksGift {\n storedCycles = 0;\n fragments: ActiveFragment[] = [];\n _width: number;\n _height: number;\n\n constructor(width: number, height: number, fragments: ActiveFragment[]) {\n this.fragments = fragments;\n this._width = width;\n this._height = height;\n }\n\n width(): number {\n return this._width;\n }\n height(): number {\n return this._height;\n }\n charge(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n process(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n effect(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n canPlace(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n place(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n findFragment(): any {\n throw new Error(\"unimplemented for dummy gift\");\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 delete(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n clear(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n count(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n inBonus(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n prestigeAugmentation(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n prestigeSourceFile(): any {\n throw new Error(\"unimplemented for dummy gift\");\n }\n}\n","import React from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\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, ${FactionNames.OmniTekIncorporated} 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 ${FactionNames.OmniTekIncorporated} 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 ${FactionNames.Bladeburners} 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 ${FactionNames.Bladeburners} ` +\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\n .map((achievement) => ({\n achievement,\n unlockedOn: playerAchievements.find((playerAchievement) => playerAchievement.ID === achievement.ID)?.unlockedOn,\n }))\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(\n (entry) =>\n !entry.unlockedOn && !entry.achievement.Secret && entry.achievement.Visible && !entry.achievement.Visible(),\n );\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\n sx={{\n display: \"flex\",\n flexDirection: \"column\",\n flexWrap: \"wrap\",\n }}\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\n key={`unlocked_${item.achievement.ID}`}\n achievement={item.achievement}\n unlockedOn={item.unlockedOn}\n cssFiltersUnlocked={cssPrimary}\n cssFiltersLocked={cssSecondary}\n />\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\n key={`locked_${item.achievement.ID}`}\n achievement={item.achievement}\n cssFiltersUnlocked={cssPrimary}\n cssFiltersLocked={cssSecondary}\n />\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,\n height: size,\n m: 1,\n visibility: imgLoaded ? \"visible\" : \"hidden\",\n }}\n >\n <img\n 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 />\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 (\n <RecoveryRoot\n router={this.props.router}\n softReset={this.props.softReset}\n errorData={errorData}\n resetError={() => this.reset()}\n />\n );\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, ToastVariant } 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 ToastVariant.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 : \"n/a\"}\n </TableCell>\n <TableCell>\n {(importData.playerData?.lastSave ?? 0) > 0\n ? new Date(importData.playerData?.lastSave ?? 0).toLocaleString()\n : \"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 { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { purchaseAugmentation, joinFaction, getFactionAugmentationsFiltered } from \"../Faction/FactionHelpers\";\nimport { startWorkerScript } from \"../NetscriptWorker\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { augmentationExists, installAugmentations } from \"../Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { killWorkerScript } from \"../Netscript/killWorkerScript\";\nimport { CONSTANTS } from \"../Constants\";\nimport { isString } from \"../utils/helpers/isString\";\nimport { RunningScript } from \"../Script/RunningScript\";\n\nimport {\n AugmentationStats,\n CharacterInfo,\n CrimeStats,\n PlayerSkills,\n Singularity as ISingularity,\n} 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 { 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 } 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 } from \"../Server/ServerHelpers\";\nimport { Terminal } from \"../Terminal\";\nimport { calculateHackingTime } from \"../Hacking\";\nimport { Server } from \"../Server/Server\";\nimport { netscriptCanHack } from \"../Hacking/netscriptCanHack\";\nimport { FactionInfos } from \"../Faction/FactionInfo\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\nimport { BlackOperationNames } from \"../Bladeburner/data/BlackOperationNames\";\nimport { enterBitNode } from \"../RedPill\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { ClassType, WorkType } from \"../utils/WorkType\";\n\nexport function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript): InternalAPI<ISingularity> {\n const getAugmentation = function (_ctx: NetscriptContext, name: string): Augmentation {\n if (!augmentationExists(name)) {\n throw _ctx.helper.makeRuntimeErrorMsg(`Invalid augmentation: '${name}'`);\n }\n\n return StaticAugmentations[name];\n };\n\n const getFaction = function (_ctx: NetscriptContext, name: string): Faction {\n if (!factionExists(name)) {\n throw _ctx.helper.makeRuntimeErrorMsg(`Invalid faction name: '${name}`);\n }\n\n return Factions[name];\n };\n\n const getCompany = function (_ctx: NetscriptContext, name: string): Company {\n const company = Companies[name];\n if (company == null || !(company instanceof Company)) {\n throw _ctx.helper.makeRuntimeErrorMsg(`Invalid company name: '${name}'`);\n }\n return company;\n };\n\n const runAfterReset = function (cbScript: string | null = null): void {\n //Run a script after reset\n if (!cbScript) return;\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 + 0.001) {\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: (_ctx: NetscriptContext) =>\n function (_purchased: unknown = false): string[] {\n _ctx.helper.checkSingularityAccess();\n const purchased = _ctx.helper.boolean(_purchased);\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: (_ctx: NetscriptContext) =>\n function (_facName: unknown): string[] {\n _ctx.helper.checkSingularityAccess();\n const facName = _ctx.helper.string(\"facName\", _facName);\n const faction = getFaction(_ctx, facName);\n\n return getFactionAugmentationsFiltered(player, faction);\n },\n getAugmentationCost: (_ctx: NetscriptContext) =>\n function (_augName: unknown): [number, number] {\n _ctx.helper.checkSingularityAccess();\n const augName = _ctx.helper.string(\"augName\", _augName);\n const aug = getAugmentation(_ctx, augName);\n const costs = aug.getCost(player);\n return [costs.repCost, costs.moneyCost];\n },\n getAugmentationPrereq: (_ctx: NetscriptContext) =>\n function (_augName: unknown): string[] {\n _ctx.helper.checkSingularityAccess();\n const augName = _ctx.helper.string(\"augName\", _augName);\n const aug = getAugmentation(_ctx, augName);\n return aug.prereqs.slice();\n },\n getAugmentationPrice: (_ctx: NetscriptContext) =>\n function (_augName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const augName = _ctx.helper.string(\"augName\", _augName);\n const aug = getAugmentation(_ctx, augName);\n return aug.getCost(player).moneyCost;\n },\n getAugmentationRepReq: (_ctx: NetscriptContext) =>\n function (_augName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const augName = _ctx.helper.string(\"augName\", _augName);\n const aug = getAugmentation(_ctx, augName);\n return aug.getCost(player).repCost;\n },\n getAugmentationStats: (_ctx: NetscriptContext) =>\n function (_augName: unknown): AugmentationStats {\n _ctx.helper.checkSingularityAccess();\n const augName = _ctx.helper.string(\"augName\", _augName);\n const aug = getAugmentation(_ctx, augName);\n return Object.assign({}, aug.mults);\n },\n purchaseAugmentation: (_ctx: NetscriptContext) =>\n function (_facName: unknown, _augName: unknown): boolean {\n _ctx.helper.checkSingularityAccess();\n const facName = _ctx.helper.string(\"facName\", _facName);\n const augName = _ctx.helper.string(\"augName\", _augName);\n const fac = getFaction(_ctx, facName);\n const aug = getAugmentation(_ctx, augName);\n\n const augs = getFactionAugmentationsFiltered(player, fac);\n\n if (!augs.includes(augName)) {\n _ctx.log(() => `Faction '${facName}' does not have the '${augName}' augmentation.`);\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 _ctx.log(() => `You already have the '${augName}' 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 _ctx.log(() => `You already have the '${augName}' augmentation.`);\n return false;\n }\n }\n }\n\n if (fac.playerReputation < aug.getCost(player).repCost) {\n _ctx.log(() => `You do not have enough reputation with '${fac.name}'.`);\n return false;\n }\n\n const res = purchaseAugmentation(aug, fac, true);\n _ctx.log(() => 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: (_ctx: NetscriptContext) =>\n function (_cbScript: unknown = \"\"): void {\n _ctx.helper.checkSingularityAccess();\n const cbScript = _ctx.helper.string(\"cbScript\", _cbScript);\n\n _ctx.log(() => \"Soft resetting. This will cause this script to be killed\");\n setTimeout(() => {\n installAugmentations(true);\n runAfterReset(cbScript);\n }, 0);\n\n // Prevent workerScript from \"finishing execution naturally\"\n workerScript.running = false;\n killWorkerScript(workerScript);\n },\n installAugmentations: (_ctx: NetscriptContext) =>\n function (_cbScript: unknown = \"\"): boolean {\n _ctx.helper.checkSingularityAccess();\n const cbScript = _ctx.helper.string(\"cbScript\", _cbScript);\n\n if (player.queuedAugmentations.length === 0) {\n _ctx.log(() => \"You do not have any Augmentations to be installed.\");\n return false;\n }\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 10);\n _ctx.log(() => \"Installing Augmentations. This will cause this script to be killed\");\n setTimeout(() => {\n installAugmentations();\n runAfterReset(cbScript);\n }, 0);\n\n workerScript.running = false; // Prevent workerScript from \"finishing execution naturally\"\n killWorkerScript(workerScript);\n return true;\n },\n\n goToLocation: (_ctx: NetscriptContext) =>\n function (_locationName: unknown): boolean {\n _ctx.helper.checkSingularityAccess();\n const locationName = _ctx.helper.string(\"locationName\", _locationName);\n const location = Object.values(Locations).find((l) => l.name === locationName);\n if (!location) {\n _ctx.log(() => `No location named ${locationName}`);\n return false;\n }\n if (player.city !== location.city) {\n _ctx.log(() => `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: (_ctx: NetscriptContext) =>\n function (_universityName: unknown, _className: unknown, _focus: unknown = true): boolean {\n _ctx.helper.checkSingularityAccess();\n const universityName = _ctx.helper.string(\"universityName\", _universityName);\n const className = _ctx.helper.string(\"className\", _className);\n const focus = _ctx.helper.boolean(_focus);\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n _ctx.log(() => txt);\n }\n\n let costMult, expMult;\n switch (universityName.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase():\n if (player.city != CityName.Aevum) {\n _ctx.log(() => `You cannot study at 'Summit University' because you are not in '${CityName.Aevum}'.`);\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 _ctx.log(() => `You cannot study at 'Rothman University' because you are not in '${CityName.Sector12}'.`);\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 _ctx.log(\n () => `You cannot study at 'ZB Institute of Technology' because you are not in '${CityName.Volhaven}'.`,\n );\n return false;\n }\n player.location = LocationName.VolhavenZBInstituteOfTechnology;\n costMult = 5;\n expMult = 4;\n break;\n default:\n _ctx.log(() => `Invalid university name: '${universityName}'.`);\n return false;\n }\n\n let task: ClassType;\n switch (className.toLowerCase()) {\n case \"Study Computer Science\".toLowerCase():\n task = ClassType.StudyComputerScience;\n break;\n case \"Data Structures\".toLowerCase():\n task = ClassType.DataStructures;\n break;\n case \"Networks\".toLowerCase():\n task = ClassType.Networks;\n break;\n case \"Algorithms\".toLowerCase():\n task = ClassType.Algorithms;\n break;\n case \"Management\".toLowerCase():\n task = ClassType.Management;\n break;\n case \"Leadership\".toLowerCase():\n task = ClassType.Leadership;\n break;\n default:\n _ctx.log(() => `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 _ctx.log(() => `Started ${task} at ${universityName}`);\n return true;\n },\n\n gymWorkout: (_ctx: NetscriptContext) =>\n function (_gymName: unknown, _stat: unknown, _focus: unknown = true): boolean {\n _ctx.helper.checkSingularityAccess();\n const gymName = _ctx.helper.string(\"gymName\", _gymName);\n const stat = _ctx.helper.string(\"stat\", _stat);\n const focus = _ctx.helper.boolean(_focus);\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n _ctx.log(() => txt);\n }\n let costMult, expMult;\n switch (gymName.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase():\n if (player.city != CityName.Aevum) {\n _ctx.log(\n () =>\n `You cannot workout at '${LocationName.AevumCrushFitnessGym}' because you are not in '${CityName.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 _ctx.log(\n () =>\n `You cannot workout at '${LocationName.AevumSnapFitnessGym}' because you are not in '${CityName.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 _ctx.log(\n () =>\n `You cannot workout at '${LocationName.Sector12IronGym}' because you are not in '${CityName.Sector12}'.`,\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 _ctx.log(\n () =>\n `You cannot workout at '${LocationName.Sector12PowerhouseGym}' because you are not in '${CityName.Sector12}'.`,\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 _ctx.log(\n () =>\n `You cannot workout at '${LocationName.VolhavenMilleniumFitnessGym}' because you are not in '${CityName.Volhaven}'.`,\n );\n return false;\n }\n player.location = LocationName.VolhavenMilleniumFitnessGym;\n costMult = 7;\n expMult = 4;\n break;\n default:\n _ctx.log(() => `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, ClassType.GymStrength);\n break;\n case \"defense\".toLowerCase():\n case \"def\".toLowerCase():\n player.startClass(costMult, expMult, ClassType.GymDefense);\n break;\n case \"dexterity\".toLowerCase():\n case \"dex\".toLowerCase():\n player.startClass(costMult, expMult, ClassType.GymDexterity);\n break;\n case \"agility\".toLowerCase():\n case \"agi\".toLowerCase():\n player.startClass(costMult, expMult, ClassType.GymAgility);\n break;\n default:\n _ctx.log(() => `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 _ctx.log(() => `Started training ${stat} at ${gymName}`);\n return true;\n },\n\n travelToCity: (_ctx: NetscriptContext) =>\n function (_cityName: unknown): boolean {\n _ctx.helper.checkSingularityAccess();\n const cityName = _ctx.helper.city(\"cityName\", _cityName);\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 _ctx.log(() => \"Not enough money to travel.\");\n return false;\n }\n player.loseMoney(CONSTANTS.TravelCost, \"other\");\n player.city = cityName;\n _ctx.log(() => `Traveled to ${cityName}`);\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 50000);\n return true;\n default:\n throw _ctx.helper.makeRuntimeErrorMsg(`Invalid city name: '${cityName}'.`);\n }\n },\n\n purchaseTor: (_ctx: NetscriptContext) =>\n function (): boolean {\n _ctx.helper.checkSingularityAccess();\n\n if (player.hasTorRouter()) {\n _ctx.log(() => \"You already have a TOR router!\");\n return true;\n }\n\n if (player.money < CONSTANTS.TorRouterCost) {\n _ctx.log(() => \"You cannot afford to purchase a Tor router.\");\n return false;\n }\n player.loseMoney(CONSTANTS.TorRouterCost, \"other\");\n\n const darkweb = GetServer(SpecialServers.DarkWeb);\n if (!darkweb) throw _ctx.makeRuntimeErrorMsg(\"DarkWeb was not a server but should have been\");\n\n player.getHomeComputer().serversOnNetwork.push(darkweb.hostname);\n darkweb.serversOnNetwork.push(player.getHomeComputer().hostname);\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 500);\n _ctx.log(() => \"You have purchased a Tor router!\");\n return true;\n },\n purchaseProgram: (_ctx: NetscriptContext) =>\n function (_programName: unknown): boolean {\n _ctx.helper.checkSingularityAccess();\n const programName = _ctx.helper.string(\"programName\", _programName).toLowerCase();\n\n if (!player.hasTorRouter()) {\n _ctx.log(() => \"You do not have the TOR router.\");\n return false;\n }\n\n const item = Object.values(DarkWebItems).find((i) => i.program.toLowerCase() === programName);\n if (item == null) {\n _ctx.log(() => `Invalid program name: '${programName}.`);\n return false;\n }\n\n if (player.money < item.price) {\n _ctx.log(\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 _ctx.log(() => `You already have the '${item.program}' program`);\n return true;\n }\n\n player.getHomeComputer().pushProgram(item.program);\n // Cancel if the program is in progress of writing\n if (player.createProgramName === item.program) {\n player.isWorking = false;\n player.resetWorkStatus();\n }\n\n player.loseMoney(item.price, \"other\");\n _ctx.log(\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: (_ctx: NetscriptContext) =>\n function (): string {\n _ctx.helper.checkSingularityAccess();\n return player.getCurrentServer().hostname;\n },\n connect: (_ctx: NetscriptContext) =>\n function (_hostname: unknown): boolean {\n _ctx.helper.checkSingularityAccess();\n const hostname = _ctx.helper.string(\"hostname\", _hostname);\n if (!hostname) {\n throw _ctx.helper.makeRuntimeErrorMsg(`Invalid hostname: '${hostname}'`);\n }\n\n const target = GetServer(hostname);\n if (target == null) {\n throw _ctx.helper.makeRuntimeErrorMsg(`Invalid hostname: '${hostname}'`);\n }\n\n //Home case\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 //Adjacent server case\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 //Backdoor case\n const other = GetServer(hostname);\n if (other !== null && other instanceof Server && other.backdoorInstalled) {\n player.getCurrentServer().isConnectedTo = false;\n player.currentServer = target.hostname;\n player.getCurrentServer().isConnectedTo = true;\n Terminal.setcwd(\"/\");\n return true;\n }\n\n //Failure case\n return false;\n },\n manualHack: (_ctx: NetscriptContext) =>\n function (): Promise<number> {\n _ctx.helper.checkSingularityAccess();\n const server = player.getCurrentServer();\n return _ctx.helper.hack(server.hostname, true);\n },\n installBackdoor: (_ctx: NetscriptContext) =>\n function (): Promise<void> {\n _ctx.helper.checkSingularityAccess();\n const baseserver = player.getCurrentServer();\n if (!(baseserver instanceof Server)) {\n _ctx.log(() => \"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 _ctx.helper.makeRuntimeErrorMsg(canHack.msg || \"\");\n }\n\n _ctx.log(\n () => `Installing backdoor on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(installTime, true)}`,\n );\n\n return netscriptDelay(installTime, workerScript).then(function () {\n _ctx.log(() => `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: (_ctx: NetscriptContext) =>\n function (): boolean {\n _ctx.helper.checkSingularityAccess();\n return player.focus;\n },\n setFocus: (_ctx: NetscriptContext) =>\n function (_focus: unknown): boolean {\n _ctx.helper.checkSingularityAccess();\n const focus = _ctx.helper.boolean(_focus);\n if (!player.isWorking) {\n throw _ctx.helper.makeRuntimeErrorMsg(\"Not currently working\");\n }\n if (\n !(\n player.workType === WorkType.Faction ||\n player.workType === WorkType.Company ||\n player.workType === WorkType.CompanyPartTime ||\n player.workType === WorkType.CreateProgram ||\n player.workType === WorkType.StudyClass\n )\n ) {\n throw _ctx.helper.makeRuntimeErrorMsg(\"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: (_ctx: NetscriptContext) =>\n function (): PlayerSkills {\n _ctx.helper.checkSingularityAccess();\n _ctx.log(() => `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: (_ctx: NetscriptContext) =>\n function (): CharacterInfo {\n _ctx.helper.checkSingularityAccess();\n _ctx.log(() => `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 charisma: player.charisma,\n charismaExp: player.charisma_exp,\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: (_ctx: NetscriptContext) =>\n function (): void {\n _ctx.helper.checkSingularityAccess();\n if (player.isWorking || Router.page() === Page.Infiltration || Router.page() === Page.BitVerse) {\n _ctx.log(() => \"Cannot go to the hospital because the player is busy.\");\n return;\n }\n player.hospitalize();\n },\n isBusy: (_ctx: NetscriptContext) =>\n function (): boolean {\n _ctx.helper.checkSingularityAccess();\n return player.isWorking || Router.page() === Page.Infiltration || Router.page() === Page.BitVerse;\n },\n stopAction: (_ctx: NetscriptContext) =>\n function (): boolean {\n _ctx.helper.checkSingularityAccess();\n if (player.isWorking) {\n if (player.focus) {\n player.stopFocusing();\n Router.toTerminal();\n }\n const txt = player.singularityStopWork();\n _ctx.log(() => txt);\n return true;\n }\n return false;\n },\n upgradeHomeCores: (_ctx: NetscriptContext) =>\n function (): boolean {\n _ctx.helper.checkSingularityAccess();\n\n // Check if we're at max cores\n const homeComputer = player.getHomeComputer();\n if (homeComputer.cpuCores >= 8) {\n _ctx.log(() => `Your home computer is at max cores.`);\n return false;\n }\n\n const cost = player.getUpgradeHomeCoresCost();\n if (player.money < cost) {\n _ctx.log(() => `You don't have enough money. Need ${numeralWrapper.formatMoney(cost)}`);\n return false;\n }\n\n homeComputer.cpuCores += 1;\n player.loseMoney(cost, \"servers\");\n\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 2);\n _ctx.log(() => `Purchased an additional core for home computer! It now has ${homeComputer.cpuCores} cores.`);\n return true;\n },\n getUpgradeHomeCoresCost: (_ctx: NetscriptContext) =>\n function (): number {\n _ctx.helper.checkSingularityAccess();\n\n return player.getUpgradeHomeCoresCost();\n },\n upgradeHomeRam: (_ctx: NetscriptContext) =>\n function (): boolean {\n _ctx.helper.checkSingularityAccess();\n\n // Check if we're at max RAM\n const homeComputer = player.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n _ctx.log(() => `Your home computer is at max RAM.`);\n return false;\n }\n\n const cost = player.getUpgradeHomeRamCost();\n if (player.money < cost) {\n _ctx.log(() => `You don't have enough money. Need ${numeralWrapper.formatMoney(cost)}`);\n return false;\n }\n\n homeComputer.maxRam *= 2;\n player.loseMoney(cost, \"servers\");\n\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 2);\n _ctx.log(\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: (_ctx: NetscriptContext) =>\n function (): number {\n _ctx.helper.checkSingularityAccess();\n\n return player.getUpgradeHomeRamCost();\n },\n workForCompany: (_ctx: NetscriptContext) =>\n function (_companyName: unknown, _focus: unknown = true): boolean {\n _ctx.helper.checkSingularityAccess();\n let companyName = _ctx.helper.string(\"companyName\", _companyName);\n const focus = _ctx.helper.boolean(_focus);\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 _ctx.log(() => `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 _ctx.log(() => `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 _ctx.log(() => \"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 _ctx.log(() => 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 _ctx.log(() => `Began working at '${player.companyName}' as a '${companyPositionName}'`);\n return true;\n },\n applyToCompany: (_ctx: NetscriptContext) =>\n function (_companyName: unknown, _field: unknown): boolean {\n _ctx.helper.checkSingularityAccess();\n const companyName = _ctx.helper.string(\"companyName\", _companyName);\n const field = _ctx.helper.string(\"field\", _field);\n getCompany(_ctx, companyName);\n\n player.location = companyName as LocationName;\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 _ctx.log(() => `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 // _ctx.log(\"applyToCompany\",()=> res);\n // return false;\n // }\n if (res) {\n _ctx.log(() => `You were offered a new job at '${companyName}' as a '${player.jobs[companyName]}'`);\n } else {\n _ctx.log(() => `You failed to get a new job/promotion at '${companyName}' in the '${field}' field.`);\n }\n return res;\n },\n quitJob: (_ctx: NetscriptContext) =>\n function (_companyName: unknown): void {\n _ctx.helper.checkSingularityAccess();\n const companyName = _ctx.helper.string(\"companyName\", _companyName);\n player.quitJob(companyName);\n },\n getCompanyRep: (_ctx: NetscriptContext) =>\n function (_companyName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const companyName = _ctx.helper.string(\"companyName\", _companyName);\n const company = getCompany(_ctx, companyName);\n return company.playerReputation;\n },\n getCompanyFavor: (_ctx: NetscriptContext) =>\n function (_companyName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const companyName = _ctx.helper.string(\"companyName\", _companyName);\n const company = getCompany(_ctx, companyName);\n return company.favor;\n },\n getCompanyFavorGain: (_ctx: NetscriptContext) =>\n function (_companyName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const companyName = _ctx.helper.string(\"companyName\", _companyName);\n const company = getCompany(_ctx, companyName);\n return company.getFavorGain();\n },\n checkFactionInvitations: (_ctx: NetscriptContext) =>\n function (): string[] {\n _ctx.helper.checkSingularityAccess();\n // Make a copy of player.factionInvitations\n return player.factionInvitations.slice();\n },\n joinFaction: (_ctx: NetscriptContext) =>\n function (_facName: unknown): boolean {\n _ctx.helper.checkSingularityAccess();\n const facName = _ctx.helper.string(\"facName\", _facName);\n getFaction(_ctx, facName);\n\n if (!player.factionInvitations.includes(facName)) {\n _ctx.log(() => `You have not been invited by faction '${facName}'`);\n return false;\n }\n const fac = Factions[facName];\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] == facName || Factions[player.factionInvitations[i]].isBanned) {\n player.factionInvitations.splice(i, 1);\n i--;\n }\n }\n player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain * 5);\n _ctx.log(() => `Joined the '${facName}' faction.`);\n return true;\n },\n workForFaction: (_ctx: NetscriptContext) =>\n function (_facName: unknown, _type: unknown, _focus: unknown = true): boolean {\n _ctx.helper.checkSingularityAccess();\n const facName = _ctx.helper.string(\"facName\", _facName);\n const type = _ctx.helper.string(\"type\", _type);\n const focus = _ctx.helper.boolean(_focus);\n const faction = getFaction(_ctx, facName);\n\n // if the player is in a gang and the target faction is any of the gang faction, fail\n if (player.inGang() && faction.name === player.getGangFaction().name) {\n _ctx.log(() => `You can't work for '${facName}' because youre managing a gang for it`);\n return false;\n }\n\n if (!player.factions.includes(facName)) {\n _ctx.log(() => `You are not a member of '${facName}'`);\n return false;\n }\n\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n _ctx.log(() => txt);\n }\n\n switch (type.toLowerCase()) {\n case \"hacking\":\n case \"hacking contracts\":\n case \"hackingcontracts\":\n if (!FactionInfos[faction.name].offerHackingWork) {\n _ctx.log(() => `Faction '${faction.name}' do not need help with hacking contracts.`);\n return false;\n }\n player.startFactionHackWork(faction);\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n _ctx.log(() => `Started carrying out hacking contracts for '${faction.name}'`);\n return true;\n case \"field\":\n case \"fieldwork\":\n case \"field work\":\n if (!FactionInfos[faction.name].offerFieldWork) {\n _ctx.log(() => `Faction '${faction.name}' do not need help with field missions.`);\n return false;\n }\n player.startFactionFieldWork(faction);\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n _ctx.log(() => `Started carrying out field missions for '${faction.name}'`);\n return true;\n case \"security\":\n case \"securitywork\":\n case \"security work\":\n if (!FactionInfos[faction.name].offerSecurityWork) {\n _ctx.log(() => `Faction '${faction.name}' do not need help with security work.`);\n return false;\n }\n player.startFactionSecurityWork(faction);\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n _ctx.log(() => `Started carrying out security work for '${faction.name}'`);\n return true;\n default:\n _ctx.log(() => `Invalid work type: '${type}`);\n return false;\n }\n },\n getFactionRep: (_ctx: NetscriptContext) =>\n function (_facName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const facName = _ctx.helper.string(\"facName\", _facName);\n const faction = getFaction(_ctx, facName);\n return faction.playerReputation;\n },\n getFactionFavor: (_ctx: NetscriptContext) =>\n function (_facName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const facName = _ctx.helper.string(\"facName\", _facName);\n const faction = getFaction(_ctx, facName);\n return faction.favor;\n },\n getFactionFavorGain: (_ctx: NetscriptContext) =>\n function (_facName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const facName = _ctx.helper.string(\"facName\", _facName);\n const faction = getFaction(_ctx, facName);\n return faction.getFavorGain();\n },\n donateToFaction: (_ctx: NetscriptContext) =>\n function (_facName: unknown, _amt: unknown): boolean {\n _ctx.helper.checkSingularityAccess();\n const facName = _ctx.helper.string(\"facName\", _facName);\n const amt = _ctx.helper.number(\"amt\", _amt);\n const faction = getFaction(_ctx, facName);\n if (!player.factions.includes(faction.name)) {\n _ctx.log(() => `You can't donate to '${facName}' because you aren't a member`);\n return false;\n }\n if (player.inGang() && faction.name === player.getGangFaction().name) {\n _ctx.log(() => `You can't donate to '${facName}' because youre managing a gang for it`);\n return false;\n }\n if (faction.name === FactionNames.ChurchOfTheMachineGod || faction.name === FactionNames.Bladeburners) {\n _ctx.log(() => `You can't donate to '${facName}' because they do not accept donations`);\n return false;\n }\n if (typeof amt !== \"number\" || amt <= 0 || isNaN(amt)) {\n _ctx.log(() => `Invalid donation amount: '${amt}'.`);\n return false;\n }\n if (player.money < amt) {\n _ctx.log(() => `You do not have enough money to donate ${numeralWrapper.formatMoney(amt)} to '${facName}'`);\n return false;\n }\n const repNeededToDonate = Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n if (faction.favor < repNeededToDonate) {\n _ctx.log(\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 _ctx.log(\n () =>\n `${numeralWrapper.formatMoney(amt)} donated to '${facName}' for ${numeralWrapper.formatReputation(\n repGain,\n )} reputation`,\n );\n return true;\n },\n createProgram: (_ctx: NetscriptContext) =>\n function (_programName: unknown, _focus: unknown = true): boolean {\n _ctx.helper.checkSingularityAccess();\n const programName = _ctx.helper.string(\"programName\", _programName).toLowerCase();\n const focus = _ctx.helper.boolean(_focus);\n\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n _ctx.log(() => txt);\n }\n\n const p = Object.values(Programs).find((p) => p.name.toLowerCase() === programName);\n\n if (p == null) {\n _ctx.log(() => `The specified program does not exist: '${programName}`);\n return false;\n }\n\n if (player.hasProgram(p.name)) {\n _ctx.log(() => `You already have the '${p.name}' program`);\n return false;\n }\n\n const create = p.create;\n if (create === null) {\n _ctx.log(() => `You cannot create the '${p.name}' program`);\n return false;\n }\n\n if (!create.req(player)) {\n _ctx.log(() => `Hacking level is too low to create '${p.name}' (level ${create.level} req)`);\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 _ctx.log(() => `Began creating program: '${programName}'`);\n return true;\n },\n commitCrime: (_ctx: NetscriptContext) =>\n function (_crimeRoughName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const crimeRoughName = _ctx.helper.string(\"crimeRoughName\", _crimeRoughName);\n\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n _ctx.log(() => 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 _ctx.helper.makeRuntimeErrorMsg(`Invalid crime: '${crimeRoughName}'`);\n }\n _ctx.log(() => `Attempting to commit ${crime.name}...`);\n return crime.commit(Router, player, 1, workerScript);\n },\n getCrimeChance: (_ctx: NetscriptContext) =>\n function (_crimeRoughName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const crimeRoughName = _ctx.helper.string(\"crimeRoughName\", _crimeRoughName);\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n throw _ctx.helper.makeRuntimeErrorMsg(`Invalid crime: ${crimeRoughName}`);\n }\n\n return crime.successRate(player);\n },\n getCrimeStats: (_ctx: NetscriptContext) =>\n function (_crimeRoughName: unknown): CrimeStats {\n _ctx.helper.checkSingularityAccess();\n const crimeRoughName = _ctx.helper.string(\"crimeRoughName\", _crimeRoughName);\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n throw _ctx.helper.makeRuntimeErrorMsg(`Invalid crime: ${crimeRoughName}`);\n }\n\n return Object.assign({}, crime);\n },\n getDarkwebPrograms: (_ctx: NetscriptContext) =>\n function (): string[] {\n _ctx.helper.checkSingularityAccess();\n\n // If we don't have Tor, log it and return [] (empty list)\n if (!player.hasTorRouter()) {\n _ctx.log(() => \"You do not have the TOR router.\");\n return [];\n }\n return Object.values(DarkWebItems).map((p) => p.program);\n },\n getDarkwebProgramCost: (_ctx: NetscriptContext) =>\n function (_programName: unknown): number {\n _ctx.helper.checkSingularityAccess();\n const programName = _ctx.helper.string(\"programName\", _programName).toLowerCase();\n\n // If we don't have Tor, log it and return -1\n if (!player.hasTorRouter()) {\n _ctx.log(() => \"You do not have the TOR router.\");\n // returning -1 rather than throwing an error to be consistent with purchaseProgram\n // which returns false if tor has\n return -1;\n }\n\n const item = Object.values(DarkWebItems).find((i) => i.program.toLowerCase() === programName);\n\n // If the program doesn't exist, throw an error. The reasoning here is that the 99% case is that\n // the player will be using this in automation scripts, and if they're asking for a program that\n // doesn't exist, it's the first time they've run the script. So throw an error to let them know\n // that they need to fix it.\n if (item == null) {\n throw _ctx.helper.makeRuntimeErrorMsg(\n `No such exploit ('${programName}') found on the darkweb! ` +\n `\\nThis function is not case-sensitive. Did you perhaps forget .exe at the end?`,\n );\n }\n\n if (player.hasProgram(item.program)) {\n _ctx.log(() => `You already have the '${item.program}' program`);\n return 0;\n }\n return item.price;\n },\n b1tflum3:\n (_ctx: NetscriptContext) =>\n (_nextBN: unknown, _callbackScript: unknown = \"\"): void => {\n _ctx.helper.checkSingularityAccess();\n const nextBN = _ctx.helper.number(\"nextBN\", _nextBN);\n const callbackScript = _ctx.helper.string(\"callbackScript\", _callbackScript);\n _ctx.helper.checkSingularityAccess();\n enterBitNode(Router, true, player.bitNodeN, nextBN);\n if (callbackScript)\n setTimeout(() => {\n runAfterReset(callbackScript);\n }, 0);\n },\n destroyW0r1dD43m0n:\n (_ctx: NetscriptContext) =>\n (_nextBN: unknown, _callbackScript: unknown = \"\"): void => {\n _ctx.helper.checkSingularityAccess();\n const nextBN = _ctx.helper.number(\"nextBN\", _nextBN);\n const callbackScript = _ctx.helper.string(\"callbackScript\", _callbackScript);\n _ctx.helper.checkSingularityAccess();\n\n const hackingRequirements = (): boolean => {\n const wd = GetServer(SpecialServers.WorldDaemon);\n if (!(wd instanceof Server))\n throw new Error(\"WorldDaemon was not a normal server. This is a bug contact dev.\");\n if (player.hacking < wd.requiredHackingSkill) return false;\n if (!wd.hasAdminRights) return false;\n return true;\n };\n const bladeburnerRequirements = (): boolean => {\n if (!player.inBladeburner()) return false;\n if (!player.bladeburner) return false;\n return player.bladeburner.blackops[BlackOperationNames.OperationDaedalus];\n };\n\n if (!hackingRequirements() && !bladeburnerRequirements()) {\n _ctx.log(() => \"Requirements not met to destroy the world daemon\");\n return;\n }\n\n enterBitNode(Router, false, player.bitNodeN, nextBN);\n if (callbackScript)\n setTimeout(() => {\n runAfterReset(callbackScript);\n }, 0);\n },\n };\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 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 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 { IMap } from \"../../types\";\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { IPlayer } from \"../IPlayer\";\n\nexport const calculateEntropy = (player: IPlayer, stacks = 1): IMap<number> => {\n const multipliers: IMap<number> = {\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\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\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\n company_rep_mult: player.company_rep_mult,\n faction_rep_mult: player.faction_rep_mult,\n\n crime_money_mult: player.crime_money_mult,\n crime_success_mult: player.crime_success_mult,\n\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\n work_money_mult: player.work_money_mult,\n\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 };\n\n for (const [mult, val] of Object.entries(multipliers)) {\n multipliers[mult] = val * CONSTANTS.EntropyEffect ** stacks;\n }\n\n return multipliers;\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 { CityName } from \"./../Locations/data/CityNames\";\nimport { Literature } from \"./Literature\";\nimport { LiteratureNames } from \"./data/LiteratureNames\";\nimport { IMap } from \"../types\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\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 ${FactionNames.OmniTekIncorporated} 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 ${FactionNames.OmniTekIncorporated} 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 ${FactionNames.OmniTekIncorporated} and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. ` +\n `This hack went undetected and for months ${FactionNames.OmniTekIncorporated} 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 ${FactionNames.Bladeburners}, that humanity ` +\n `was finally able to defeat the Synthoids. The ${FactionNames.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 ${FactionNames.OmniTekIncorporated} ` +\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 `${FactionNames.Bladeburners} 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 ${FactionNames.KuaiGongInternational}, which ` +\n \"holds a complete monopoly for manufacturing and commerce in Asia, or Global Pharmaceuticals, the world's largest \" +\n `drug company, or ${FactionNames.OmniTekIncorporated}, 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 ${FactionNames.ECorp}, ${FactionNames.MegaCorp}, and ${FactionNames.KuaiGongInternational} 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 ${CityName.Sector12}`;\n fn = LiteratureNames.Sector12Crime;\n txt =\n \"A recent study by analytics company Wilson Inc. shows a significant rise \" +\n `in criminal activity in ${CityName.Sector12}. 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 ${FactionNames.TheSyndicate} or the ${FactionNames.SlumSnakes}.`;\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 ${FactionNames.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 ${FactionNames.TheBlackHand}, are black hat groups that claim they are trying to ` +\n `help the oppressed by attacking the elite and powerful. Others, such as ${FactionNames.NiteSec}, are hacktivist groups ` +\n \"that try to push political and social agendas. Perhaps the most intriguing hacker group \" +\n `is the mysterious ${FactionNames.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 ${FactionNames.OmniTekIncorporated}'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 ${FactionNames.OmniTekIncorporated} 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, ${FactionNames.MegaCorp} and ${FactionNames.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 ${FactionNames.Illuminati.toUpperCase()} ARE THE SECRET RULERS OF THE WORLD!<br><br>` +\n `Yes, the ${FactionNames.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 ${FactionNames.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>\" +\n \"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 ${FactionNames.Tetrads}.<br><br>` +\n `It is widely believed that the ${FactionNames.Tetrads} are a rogue group that splintered off from the Triads sometime in the ` +\n `mid 21st century. The founders of the ${FactionNames.Tetrads}, all of whom were ex-Triad members, believed that the ` +\n `Triads were losing their purpose and direction. The ${FactionNames.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 ${FactionNames.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 ${FactionNames.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 { 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 { MessageFilenames, showMessage } from \"../../Message/MessageHelpers\";\nimport { showLiterature } from \"../../Literature/LiteratureHelpers\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { checkEnum } from \"../../utils/helpers/checkEnum\";\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 (\n !filename.endsWith(\".msg\") &&\n !filename.endsWith(\".lit\") &&\n !filename.endsWith(\".txt\") &&\n !filename.endsWith(\".script\") &&\n !filename.endsWith(\".js\") &&\n !filename.endsWith(\".ns\")\n ) {\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 if (!checkEnum(MessageFilenames, file)) return;\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\";\nimport { containsFiles } from \"../DirectoryServerHelpers\";\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 if (terminal.cwd().length > 1 && dir === \"..\") {\n terminal.setcwd(evaledDir);\n return;\n }\n\n const server = player.getCurrentServer();\n if (!containsFiles(server, evaledDir)) {\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(\n `Cannot directly connect to ${hostname}. Make sure the server is backdoored or adjacent to your current Server`,\n );\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 \"../DirectoryHelpers\";\nimport { IRouter } from \"../../ui/Router\";\nimport { ITerminal } from \"../ITerminal\";\nimport * as libarg from \"arg\";\nimport { showLiterature } from \"../../Literature/LiteratureHelpers\";\nimport { MessageFilenames, showMessage } from \"../../Message/MessageHelpers\";\n\nexport function ls(\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 {\n \"-l\": Boolean,\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 incorrectUsage();\n return;\n }\n const filter = flags[\"--grep\"];\n\n const numArgs = args.length;\n function incorrectUsage(): void {\n terminal.error(\"Incorrect usage of ls command. Usage: ls [dir] [-l] [-g, --grep pattern]\");\n }\n\n if (numArgs > 4) {\n return incorrectUsage();\n }\n\n // Directory path\n let prefix = terminal.cwd();\n if (!prefix.endsWith(\"/\")) {\n prefix += \"/\";\n }\n\n // If first arg doesn't contain a - it must be the file/folder\n const dir = args[0] && typeof args[0] == \"string\" && !args[0].startsWith(\"-\") ? args[0] : \"\";\n const newPath = evaluateDirectoryPath(dir + \"\", terminal.cwd());\n prefix = newPath || \"\";\n if (!prefix.endsWith(\"/\")) {\n prefix += \"/\";\n }\n if (!isValidDirectoryPath(prefix)) {\n return incorrectUsage();\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 ClickableRowProps {\n row: string;\n prefix: string;\n hostname: string;\n }\n\n function ClickableScriptRow({ row, prefix, hostname }: ClickableRowProps): 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.split(\"~\");\n let rowSplitArray = rowSplit.map((x) => [x.trim(), x.replace(x.trim(), \"\")]);\n rowSplitArray = rowSplitArray.filter((x) => !!x[0]);\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 {rowSplitArray.map((rowItem) => (\n <span key={\"script_\" + rowItem[0]}>\n <span className={classes.scriptLink} onClick={() => onScriptLinkClick(rowItem[0])}>\n {rowItem[0]}\n </span>\n <span>{rowItem[1]}</span>\n </span>\n ))}\n </span>\n );\n }\n\n function ClickableMessageRow({ row, prefix, hostname }: ClickableRowProps): React.ReactElement {\n const classes = makeStyles((theme: Theme) =>\n createStyles({\n linksWrap: {\n display: \"inline-flex\",\n color: theme.palette.primary.main,\n },\n link: {\n cursor: \"pointer\",\n textDecorationLine: \"underline\",\n paddingRight: \"1.15em\",\n \"&:last-child\": { padding: 0 },\n },\n }),\n )();\n\n const rowSplit = row.split(\"~\");\n let rowSplitArray = rowSplit.map((x) => [x.trim(), x.replace(x.trim(), \"\")]);\n rowSplitArray = rowSplitArray.filter((x) => !!x[0]);\n\n function onMessageLinkClick(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\n if (filepath.endsWith(\".lit\")) {\n showLiterature(filepath);\n } else if (filepath.endsWith(\".msg\")) {\n showMessage(filepath as MessageFilenames);\n }\n }\n\n return (\n <span className={classes.linksWrap}>\n {rowSplitArray.map((rowItem) => (\n <span key={\"text_\" + rowItem[0]}>\n <span className={classes.link} onClick={() => onMessageLinkClick(rowItem[0])}>\n {rowItem[0]}\n </span>\n <span>{rowItem[1]}</span>\n </span>\n ))}\n </span>\n );\n }\n\n enum FileType {\n Folder,\n Message,\n TextFile,\n Program,\n Contract,\n Script,\n }\n\n interface FileGroup {\n type: FileType;\n segments: string[];\n }\n\n function postSegments(group: FileGroup, flags: any): void {\n const segments = group.segments;\n const linked = group.type === FileType.Script || group.type === FileType.Message;\n const maxLength = Math.max(...segments.map((s) => s.length)) + 1;\n const filesPerRow = flags[\"-l\"] === true ? 1 : Math.ceil(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 if (linked) {\n row += \"~\";\n }\n i++;\n }\n i--;\n\n switch (group.type) {\n case FileType.Folder:\n terminal.printRaw(<span style={{ color: \"cyan\" }}>{row}</span>);\n break;\n case FileType.Script:\n terminal.printRaw(<ClickableScriptRow row={row} prefix={prefix} hostname={server.hostname} />);\n break;\n case FileType.Message:\n terminal.printRaw(<ClickableMessageRow row={row} prefix={prefix} hostname={server.hostname} />);\n break;\n default:\n terminal.print(row);\n }\n }\n }\n\n const groups: FileGroup[] = [\n { type: FileType.Folder, segments: folders },\n { type: FileType.Message, segments: allMessages },\n { type: FileType.TextFile, segments: allTextFiles },\n { type: FileType.Program, segments: allPrograms },\n { type: FileType.Contract, segments: allContracts },\n { type: FileType.Script, segments: allScripts },\n ].filter((g) => g.segments.length > 0);\n for (const group of groups) {\n postSegments(group, flags);\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(\n `${numeralWrapper.formatRAM(entry.cost * numThreads).padStart(padding)} | ${entry.name} (${entry.type})`,\n );\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\n // Command doesnt work if script is running\n if (server.isRunning(destPath)) {\n terminal.error(`Cannot use 'mv' on a script that is running`);\n return;\n }\n\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 {\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(\n \"This script is already running with the same args. Cannot run multiple instances with the same args\",\n );\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 + 0.001) {\n terminal.error(\n \"This machine does not have enough RAM to run this script\" +\n (numThreads === 1 ? \"\" : ` with ${numThreads} threads`) +\n `. Script requires ${numeralWrapper.formatRAM(ramUsage)} 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 scan command. Usage: 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 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","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 $ from \"jquery\";\n\nimport { 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 { Apr1Events } from \"../../ui/Apr1\";\n\nexport function apr1(): void {\n Apr1Events.emit();\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 { ScriptDeath } from \"./Netscript/ScriptDeath\";\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 ScriptDeath) {\n const msg =\n `UNCAUGHT PROMISE ERROR<br>You forgot to await a promise<br>${e.reason.name}@${e.reason.hostname} (PID - ${e.reason.pid})<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\n(function () {\n window.print = () => {\n throw new Error(\"You accidentally called window.print instead of ns.print\");\n };\n})();\n"],"sourceRoot":""} |